GraphDefines.h
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:4k
源码类别:

绘图程序

开发平台:

Visual C++

  1. #ifndef XGL_GRAPH_DEFINES
  2. #define XGL_GRAPH_DEFINES
  3. //////////////////////////////////////////////////////////////////
  4. //GRAPHDEFINES Header File
  5. //GraphDefines.h
  6. //author:  handwolf
  7. //date:    2004.3.22
  8. //This header file includes all that const value that would be
  9. //used in the project
  10. /////////////////////////////////////////////////////////////////
  11. #include "stdafx.h"
  12. #include "afxtempl.h"
  13. #define WINDOW_HEIGHT 600
  14. #define PI 3.14159265358979323846
  15. #define LITTLEFLOAT 0.00001
  16. #define LITTLEANGLE 0.5
  17. //
  18. #define WM_SETCOLOR             WM_USER+5
  19. #define WM_SETFILLCOLOR         WM_USER+6
  20. #define WM_SETFILLSTYLE         WM_USER+7
  21. #define WM_SELGRAPH_POINT       WM_USER+8
  22. #define WM_SELGRAPH_ROTATE      WM_USER+9 
  23. #define WM_SELGRAPH_COLOR       WM_USER+10
  24. #define WM_SELGRAPH_FILLCOLOR   WM_USER+11
  25. #define WM_SELGRAPH_FILLSTYLE   WM_USER+12
  26. #define WM_SELGRAPH_PENWIDTH    WM_USER+13
  27. //
  28. class CShape;
  29. enum GRAPH_SHAPE_TYPE
  30. {
  31. _shape_none=0,
  32. _shape_Line,
  33. _shape_Rectangle,
  34. _shape_Parallelogram, 
  35. _shape_Polygon,
  36. _shape_Circle,
  37. _shape_Ellipse,
  38. _shape_RoundRect,
  39. _shape_ModelCurve3Param,
  40.     _shape_ModelCurve2AvB,
  41. _shape_BezierCurve
  42. };
  43. enum GRAPH_OPERATION
  44. {
  45. _graph_noneOp=0,
  46. _graph_move,
  47. _graph_rotate,
  48. _graph_magnify,
  49.     _graph_copy,
  50. _graph_delete,
  51. _graph_leftToRight,
  52. _graph_topTobottom,
  53. _graph_edit,
  54. _graph_pointsShow,
  55. _graph_pointsHide,
  56. _graph_property
  57. };
  58. enum MOUSE_STATE
  59. {
  60. _MOUSE_NONESTATE=0,
  61. _MOUSE_LBUTTONDOWN,
  62. _MOUSE_LBUTTONUP,
  63. _MOUSE_MOVE,
  64. _MOUSE_RBUTTONDOWN,
  65. _MOUSE_RBUTTONUP,
  66. _MOUSE_LDBCLICKED
  67. };
  68. enum SHAPE_FILLSTYLE
  69. {
  70.     _shape_none_fill=0,
  71. _shape_solid_fill
  72. };
  73. enum UND_Kind {
  74. _UND_Base,
  75. _UND_Title,
  76. _UND_Operation,
  77. _UND_Op_create,
  78. _UND_OP_move,
  79. _UND_OP_rotate,
  80. _UND_OP_magnify,
  81.     _UND_OP_copy,
  82. _UND_OP_delete,
  83. _UND_OP_leftToRight,
  84. _UND_OP_topTobottom,
  85. _UND_OP_edit,
  86. _UND_OP_pointsShow,
  87. _UND_OP_property,
  88. };
  89. enum UND_OperationKind {
  90. _UND_Null_Operation,
  91. _UND_Add_Operation,
  92. _UND_Delete_Operation,
  93. _UND_Modify_Operation
  94. };
  95. //操作的数据结构,用于撤消/恢复
  96. struct SUNDMove{
  97. CArray<unsigned long,unsigned long> ArrId;
  98. float nStepX;
  99. float nStepY;
  100. } ;
  101. struct SUNDRotate{
  102. CArray<unsigned long,unsigned long> ArrId;
  103. float flCX;
  104. float flCY;
  105. float flAngle;
  106. } ;
  107. struct SUNDMagnify{
  108. CArray<unsigned long,unsigned long> ArrId;
  109. float flCX;
  110. float flCY;
  111. float flScale;
  112. };
  113. struct SUNDShowPoints{
  114. CArray<unsigned long,unsigned long> ArrId;
  115. int nShowFlag;
  116. };
  117. struct SUNDLeftToRight{
  118. CArray<unsigned long,unsigned long> ArrId;
  119. CRect rtOut;
  120. };
  121. struct SUNDCopy{
  122. CArray<CShape*,CShape*> ArrShape;
  123. };
  124. struct SUNDDelete{
  125. CArray<CShape*,CShape*> ArrShape;
  126. };
  127. struct SUNDEdit{
  128. CArray<float,float> ArrDataPrevX;
  129. CArray<float,float> ArrDataPrevY;
  130. CArray<float,float> ArrDataCurX;
  131. CArray<float,float> ArrDataCurY;
  132. unsigned long nID;
  133. };
  134. struct SUNDPropertyUnit{
  135. unsigned long     nID;//图形序号
  136. COLORREF          color;//线条颜色
  137. COLORREF          colorFill;//填充颜色
  138. SHAPE_FILLSTYLE   fillStyle;//填充类型
  139. int               nPenWidth;//笔宽
  140. float             flRCX;//旋转中心x坐标
  141. float             flRCY;//旋转中心x坐标
  142. float             flAngle;//旋转角度
  143. int               nPtShow;//组成点显示标志 
  144. };
  145. struct SUNDProperty{
  146. CArray<SUNDPropertyUnit,SUNDPropertyUnit> ArrPropertyPrev;
  147. CArray<SUNDPropertyUnit,SUNDPropertyUnit> ArrPropertyCur;
  148. };
  149. ////////////////////////////////////////////////////////////////////////////////////
  150. #endif