| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 | #include "stdafx.h"#include "OTSImageProcessParam.h"namespace OTSIMGPROC{	// constructor	COTSImageProcessParam::COTSImageProcessParam()	{		Init();	}	// copy constructor	COTSImageProcessParam::COTSImageProcessParam(const COTSImageProcessParam& a_oSource)	{		// can't copy itself		if (&a_oSource == this)		{			return;		}		// copy data over		Duplicate(a_oSource);	}	// copy constructor	COTSImageProcessParam::COTSImageProcessParam(COTSImageProcessParam* a_poSource)	{		// input check		ASSERT(a_poSource);		if (!a_poSource)		{			return;		}		// can't copy itself		if (a_poSource == this)		{			return;		}		// copy data over		Duplicate(*a_poSource);	}	// =operator	COTSImageProcessParam& COTSImageProcessParam::operator=(const COTSImageProcessParam& a_oSource)	{		// cleanup		Cleanup();		// copy the class data over		Duplicate(a_oSource);		// return class		return *this;	}	// ==operator	BOOL COTSImageProcessParam::operator==(const COTSImageProcessParam& a_oSource)	{		// return test result		return m_oIncArea == a_oSource.m_oIncArea &&			m_oBGGray == a_oSource.m_oBGGray &&			m_oParticleGray == a_oSource.m_oParticleGray;	}	// detractor	COTSImageProcessParam::~COTSImageProcessParam()	{		Cleanup();	}	// COTSStageData member functions	// serialization	void COTSImageProcessParam::Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode)	{		/*xmls::xBool xbShowAreaUp;		xmls::xBool xbShowAreaDown;		xmls::xBool xbShowBGGrayUp;		xmls::xBool xbShowBGGrayDown;		xmls::xBool xbShowParticleGrayUp;		xmls::xBool xbShowParticleGrayDown;*/		xmls::Slo slo;		slo.Register("IncArea", &m_oIncArea);			slo.Register("BGGray", &m_oBGGray);				slo.Register("ParticleGray", &m_oParticleGray);				if (isStoring)		{			slo.Serialize(true, classDoc, rootNode);		}		else		{			slo.Serialize(false, classDoc, rootNode);						}	}	// cleanup	void COTSImageProcessParam::Cleanup()	{		// nothing needs to be done at the moment	}	// initialization	void COTSImageProcessParam::Init()	{			m_oIncArea = CDoubleRange(DEFUALT_PARTICALE_AREA_MIN, DEFUALT_PARTICALE_AREA_MAX);		m_oBGGray = CIntRange(DEFUALT_BG_GRAY_LEVEL_MIN, DEFUALT_BG_GRAY_LEVEL_MAX);		m_oParticleGray = CIntRange(DEFUALT_PARTICLE_GRAY_LEVEL_MIN, DEFUALT_PARTICLE_GRAY_LEVEL_MAX);	}	// duplication	void COTSImageProcessParam::Duplicate(const COTSImageProcessParam& a_oSource)	{		// initialization		Init();			// copy data over		m_oIncArea = a_oSource.m_oIncArea;		m_oBGGray = a_oSource.m_oBGGray;		m_oParticleGray = a_oSource.m_oParticleGray;		}}
 |