| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 | #pragma once#include "XMLSerialization.h"namespace OTSDATA {	// domain shape	typedef enum class __declspec(dllexport) DOMAIN_SHAPE	{		INVALID = -1,		MIN = 0,		ROUND = 0,		POLYGON = 15,		RECTANGLE = 1,		MAX = 1	} DOMAIN_SHAPE;	__declspec(dllexport) const int DOMAIN_ITEM_NUMBER = 5;	// CDomain command target	class __declspec(dllexport) CDomain:public xmls::ISlo	{		public:		// constructor		CDomain();											// constructor		CDomain(DOMAIN_SHAPE a_nShape, CRect a_rectRegion);	// constructor		CDomain(const CDomain&);							// copy constructor		CDomain(CDomain*);									// copy constructor		CDomain& operator=(const CDomain&);					// =operator		BOOL operator==(const CDomain&);					// ==operator		virtual ~CDomain();									// destructor		// serialization		//void Serialize(CArchive& ar);		// validation check		 BOOL IsInvalid() const;		// check if it is empty		BOOL IsEmpty() { return m_rectDomain.IsRectEmpty(); }		// check if this is a round domain		BOOL IsRound() const { return m_nShape == DOMAIN_SHAPE::ROUND; }		// check if this is a rectangle domain		BOOL IsRect() const { return m_nShape == DOMAIN_SHAPE::RECTANGLE; }		// domain center		CPoint GetDomainCenter() const { return m_rectDomain.CenterPoint(); }		void OffsetDomain(CPoint a_poiMove) { m_rectDomain += a_poiMove; }		// diameter		long GetDiameter() const { return m_rectDomain.Width(); }		// rectangle		CRect GetDomainRect() const { return m_rectDomain; }		void SetDomainRect(const CRect& a_rect) { m_rectDomain = a_rect; }		// sharp		DOMAIN_SHAPE GetShape() const { return m_nShape; }		void SetShape(const DOMAIN_SHAPE a_nShape) { m_nShape = a_nShape; }		// PolygonPoint		std::vector<CPoint> GetPolygonPoint() const { return m_PolygonPoint; }		void SetPolygonPoint(const std::vector<CPoint> a_PolygonPoint);		//void AddPolygonPoint(CPoint p) { m_PolygonPoint.push_back(p); }		// check if have common area with the given domain		BOOL IntersectDomain(const CDomain& a_oDomain);		// check if the point in the domain		BOOL PtInDomain(const CPoint& a_poiCheck) const;		// check if the given domain is in the domain		BOOL DomainInDomain(const CDomain& a_oDomain);		virtual void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);		//virtual void Deserialize(Slo * classItem, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);	protected:		// cleanup		void Cleanup();		// initialization		void Init();		// duplication 		void Duplicate(const CDomain& a_oSource);		// sharp		DOMAIN_SHAPE m_nShape;		// area		CRect m_rectDomain;		std::vector<CPoint> m_PolygonPoint;	};	typedef std::shared_ptr<CDomain> __declspec(dllexport) CDomainPtr;	typedef std::vector<CDomainPtr> __declspec(dllexport) CDomainsList;}
 |