GraphDefines.h
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:4k
源码类别:
绘图程序
开发平台:
Visual C++
- #ifndef XGL_GRAPH_DEFINES
- #define XGL_GRAPH_DEFINES
- //////////////////////////////////////////////////////////////////
- //GRAPHDEFINES Header File
- //GraphDefines.h
- //author: handwolf
- //date: 2004.3.22
- //This header file includes all that const value that would be
- //used in the project
- /////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "afxtempl.h"
- #define WINDOW_HEIGHT 600
- #define PI 3.14159265358979323846
- #define LITTLEFLOAT 0.00001
- #define LITTLEANGLE 0.5
- //
- #define WM_SETCOLOR WM_USER+5
- #define WM_SETFILLCOLOR WM_USER+6
- #define WM_SETFILLSTYLE WM_USER+7
- #define WM_SELGRAPH_POINT WM_USER+8
- #define WM_SELGRAPH_ROTATE WM_USER+9
- #define WM_SELGRAPH_COLOR WM_USER+10
- #define WM_SELGRAPH_FILLCOLOR WM_USER+11
- #define WM_SELGRAPH_FILLSTYLE WM_USER+12
- #define WM_SELGRAPH_PENWIDTH WM_USER+13
- //
- class CShape;
- enum GRAPH_SHAPE_TYPE
- {
- _shape_none=0,
- _shape_Line,
- _shape_Rectangle,
- _shape_Parallelogram,
- _shape_Polygon,
- _shape_Circle,
- _shape_Ellipse,
- _shape_RoundRect,
- _shape_ModelCurve3Param,
- _shape_ModelCurve2AvB,
- _shape_BezierCurve
- };
- enum GRAPH_OPERATION
- {
- _graph_noneOp=0,
- _graph_move,
- _graph_rotate,
- _graph_magnify,
- _graph_copy,
- _graph_delete,
- _graph_leftToRight,
- _graph_topTobottom,
- _graph_edit,
- _graph_pointsShow,
- _graph_pointsHide,
- _graph_property
- };
- enum MOUSE_STATE
- {
- _MOUSE_NONESTATE=0,
- _MOUSE_LBUTTONDOWN,
- _MOUSE_LBUTTONUP,
- _MOUSE_MOVE,
- _MOUSE_RBUTTONDOWN,
- _MOUSE_RBUTTONUP,
- _MOUSE_LDBCLICKED
- };
- enum SHAPE_FILLSTYLE
- {
- _shape_none_fill=0,
- _shape_solid_fill
- };
- enum UND_Kind {
- _UND_Base,
- _UND_Title,
- _UND_Operation,
- _UND_Op_create,
- _UND_OP_move,
- _UND_OP_rotate,
- _UND_OP_magnify,
- _UND_OP_copy,
- _UND_OP_delete,
- _UND_OP_leftToRight,
- _UND_OP_topTobottom,
- _UND_OP_edit,
- _UND_OP_pointsShow,
- _UND_OP_property,
- };
- enum UND_OperationKind {
- _UND_Null_Operation,
- _UND_Add_Operation,
- _UND_Delete_Operation,
- _UND_Modify_Operation
- };
- //操作的数据结构,用于撤消/恢复
- struct SUNDMove{
- CArray<unsigned long,unsigned long> ArrId;
- float nStepX;
- float nStepY;
- } ;
- struct SUNDRotate{
- CArray<unsigned long,unsigned long> ArrId;
- float flCX;
- float flCY;
- float flAngle;
- } ;
- struct SUNDMagnify{
- CArray<unsigned long,unsigned long> ArrId;
- float flCX;
- float flCY;
- float flScale;
- };
- struct SUNDShowPoints{
- CArray<unsigned long,unsigned long> ArrId;
- int nShowFlag;
- };
- struct SUNDLeftToRight{
- CArray<unsigned long,unsigned long> ArrId;
- CRect rtOut;
- };
- struct SUNDCopy{
- CArray<CShape*,CShape*> ArrShape;
- };
- struct SUNDDelete{
- CArray<CShape*,CShape*> ArrShape;
- };
- struct SUNDEdit{
- CArray<float,float> ArrDataPrevX;
- CArray<float,float> ArrDataPrevY;
- CArray<float,float> ArrDataCurX;
- CArray<float,float> ArrDataCurY;
- unsigned long nID;
- };
- struct SUNDPropertyUnit{
- unsigned long nID;//图形序号
- COLORREF color;//线条颜色
- COLORREF colorFill;//填充颜色
- SHAPE_FILLSTYLE fillStyle;//填充类型
- int nPenWidth;//笔宽
- float flRCX;//旋转中心x坐标
- float flRCY;//旋转中心x坐标
- float flAngle;//旋转角度
- int nPtShow;//组成点显示标志
- };
- struct SUNDProperty{
- CArray<SUNDPropertyUnit,SUNDPropertyUnit> ArrPropertyPrev;
- CArray<SUNDPropertyUnit,SUNDPropertyUnit> ArrPropertyCur;
- };
- ////////////////////////////////////////////////////////////////////////////////////
- #endif