DomainClr.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include "Domain.h"
  3. namespace OTSCOMMONCLR {
  4. using namespace System;
  5. using namespace System::Drawing;
  6. using namespace OTSDATA;
  7. public ref class CDomainClr
  8. {
  9. public:
  10. CDomainClr(); // constructor
  11. CDomainClr(CDomainPtr); // copy constructor
  12. CDomainClr(int a_nShape, System::Drawing::Rectangle^ a_rectDomain); // copy constructor
  13. // =operator
  14. ~CDomainClr();
  15. //!CDomainClr();
  16. CDomainClr(CDomain*);
  17. void MyDispose(); // validation check
  18. virtual bool IsInvalid();
  19. // check if it is empty
  20. bool IsEmpty();// { return m_rectDomain->IsEmpty; }
  21. // check if this is a round domain
  22. bool IsRound();// { return m_nShape == (int)DOMAIN_SHAPE::ROUND; }
  23. // check if this is a rectangle domain
  24. bool IsRect();// { return m_nShape == (int)DOMAIN_SHAPE::RECTANGLE; }
  25. // domain center
  26. System::Drawing::Point GetDomainCenter();
  27. void OffsetDomain(System::Drawing::Point a_poiMove);
  28. // diameter
  29. long GetDiameter();// { return m_rectDomain->Width; }
  30. // check if have common area with the given domain
  31. bool IntersectDomain(CDomainClr^ a_oDomain);
  32. // check if the point in the domain
  33. bool PtInDomain(System::Drawing::Point^ a_poiCheck);
  34. // Get and set shape
  35. void SetShape(int a_nShape);// { m_nShape = a_nShape; }
  36. int GetShape();// { return m_nShape; }
  37. // get and set domain rectangle
  38. void SetRectDomain(System::Drawing::Rectangle a_oRect);// { m_rectDomain = a_oRect; }
  39. System::Drawing::Rectangle GetRectDomain();// { return m_rectDomain; }
  40. // check if the given domain is in the domain
  41. bool DomainInDomain(CDomainClr^ a_oDomain);
  42. // get domain pointer
  43. CDomainPtr GetDomainPtr();
  44. // PolygonPoint
  45. System::Collections::Generic::List<System::Drawing::Point>^ GetPolygonPoint();
  46. void SetPolygonPoint(System::Collections::Generic::List<System::Drawing::Point>^ a_PolygonPoint);
  47. private:
  48. CDomainPtr *m_LpDomain;
  49. };
  50. }