DomainClr.h 1.9 KB

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