CUnit.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # ifndef CUNIT
  2. # define CUNIT
  3. #define DLine_Tool 10
  4. #define Curve_Tool 11
  5. #define Rectangle_Tool 12
  6. #define RoundRectangle_Tool 13
  7. #define Ellipse_Tool 14
  8. #define Round_Tool 15
  9. #define Polygon_Tool 16
  10. #define LiEllipse_Tool 17
  11. #define RoundArc_Tool 18
  12. #define EllipseArc_Tool 19
  13. #define PolyBezier_Tool 20
  14. #define Text_Tool 21
  15. #define Draw_Status 1
  16. #define Drag_Status 2
  17. #define Select_Status 3
  18. #define Select_Color_Status 4
  19. #define Change_Status 5
  20. #define Circumrotate_Status 6
  21. #include <afxtempl.h>
  22. #include <math.h>
  23. #include"resource.h"
  24. class CEastDrawView;
  25. class CTextEdit;
  26. class CUnit:public CObject
  27. {
  28. public:
  29. DECLARE_SERIAL(CUnit)
  30. UINT m_PenStyle;
  31. int m_PenWidth;
  32. int m_BkMode;
  33. int m_DrawingMode;
  34. COLORREF m_PenColor;
  35. COLORREF m_BrushColor;
  36. COLORREF m_BackgroundColor;
  37. CPoint m_FirstPoint;
  38. CPoint m_SecondPoint;
  39. CPoint m_ThirdPoint;
  40. CPoint m_CenterPoint;
  41. CPoint m_FourthPoint;
  42. CPoint m_FifthPoint;
  43. CPoint m_MovingPoint;
  44. CPoint m_MinPoint;
  45. CPoint m_MaxPoint;
  46. CPoint m_IntersectionPointFirst;
  47. CPoint m_IntersectionPointSecond;
  48. CRect m_BoundingRect;
  49. CRgn *m_Rgn;
  50. CArray<CPoint,CPoint>*m_PointList;
  51. CArray<CPoint,CPoint>m_PointArray;
  52. UINT m_BrushStyle;
  53. LONG m_BrushHatch;
  54. int m_FoundIndex;
  55. CPoint m_FoundPoint;
  56. int m_Radious;
  57. int m_Xr;
  58. int m_Yr;
  59. BOOL m_HaveLBUp;
  60. double m_Cos;
  61. double m_Sin;
  62. double m_Sloap1;
  63. double m_Sloap2;
  64. double m_AngleFirst;
  65. double m_AngleSecond;
  66. BOOL m_HaveFindFirst;
  67. CTextEdit* m_pTextEdit;
  68. CFont *m_Font;
  69. int m_DrawStatus;
  70. public:
  71. void SetBrushOrg(CDC*pDC,CBrush*brush);
  72. virtual void OnMenuitemCirCu(CDC*pDC,CEastDrawView*pView);
  73. void OnMENUITEMSize();
  74. virtual void OnMenuitemOk(CDC *pDC, CEastDrawView *pView);
  75. virtual void OnContextMenu(CWnd* pWnd, CPoint point);
  76. virtual void ChangeFontSize(ENUMLOGFONT*lpelf);
  77. virtual void ChangeFont(ENUMLOGFONT *lpelf);
  78. virtual void SetFont(ENUMLOGFONT* lpelf);
  79. virtual void OnLButtonDblClk(CDC*pDC,CEastDrawView*pView,CPoint point);
  80. virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point);
  81. virtual CPoint ComputeIntersectionPointSecond(CPoint point);
  82. virtual CPoint ComputeIntersectionPointFirst(CPoint point);
  83. virtual void DrawStaticStepOne(CDC*pDC,CPoint movingPoint);
  84. virtual void DrawActiveStepOne(CDC*pDC,CPoint movingPoint);
  85. virtual void DrawActive(CDC*pDC,CPoint point);
  86. virtual double ComputeSloap2(CPoint firstpoint,CPoint secondpoint);
  87. virtual double ComputeSloap1(CPoint firstpoint,CPoint secondpoint);
  88. virtual CRect GetBoundingRect();
  89. virtual void DrawOldReferencePoint(CDC*pDC,CPoint point);
  90. virtual void ShowSelectPoint(CDC*pDC);
  91. virtual void ShowMovingLine(CDC*pDC,CPoint firstPoint,CPoint secondPoint);
  92. virtual int ComputRadiusX(CPoint firstPoint,CPoint secondPoint);
  93. virtual int ComputRadiusY(CPoint firstPoint,CPoint secondPoint);
  94. virtual float ComputSloap(CPoint firstPoint,CPoint secondPoint);
  95. virtual void ellipseMidpoint(CDC*pDC,int xCenter,int yCenter,int Rx,int Ry);
  96. virtual int ComputRadious(CPoint centerPoint,CPoint movingPoint);
  97. virtual void ExchangeDraw(CDC*pDC,CPoint point);
  98. virtual void DrawEnd(CDC*pDC,CPoint point);
  99. virtual void DrawMask(CDC*pDC,CPoint point);
  100. virtual void DrawMask(CDC*pDC,CPoint first,CPoint second);
  101. virtual void OnLButtonDown(CDC*pDC,CEastDrawView*pView,CPoint point);
  102. virtual void Circumrotate(CPoint first,CPoint second);
  103. virtual int IsOnMarginPoint(CPoint point);
  104. virtual BOOL IsInRgn(CPoint point);
  105. virtual CRgn* GetRgn();
  106. virtual void Serialize(CArchive&ar);
  107. CUnit();
  108. CUnit(CUnit&unit);
  109. CUnit operator=(CUnit&unit);
  110. virtual void Initial();
  111. virtual void DrawStatic(CDC*pDC){};
  112. };
  113. #endif