MyGraphObject.h
上传用户:netltd
上传日期:2013-02-12
资源大小:7234k
文件大小:2k
- //浮点型点坐标
- struct FPOINT
- {
- float x;
- float y;
- };
- class CGraphObjectInfo: public CObject
- {
- public:
- BOOL m_del; //图形对象被暂时删除标记
- BOOL m_selected; //图形对象被选中标记
- CRect m_rect; //图形对象所占的逻辑区域
- public:
- CGraphObjectInfo();
- CGraphObjectInfo(CRect rect, BOOL del, BOOL selected);
- void Initialize(CRect rect, BOOL del, BOOL selected);
- };
- // 直线对象
- class CMyLine : public CObject
- {
- public:
- FPOINT m_start;
- FPOINT m_end;
-
- CString m_layer; //图形对象所在图层
- int m_style;
- COLORREF m_color;
- CMyLine()
- {}
- DECLARE_SERIAL(CMyLine)
-
- public:
- CMyLine(CString layer, FPOINT startpoint, FPOINT endpoint, int style, COLORREF color);
- void Serialize(CArchive& ar);
- public:
- int GetObjectType();
- };
- //矩形对象
- class CMyRect: public CObject
- {
- public:
- FPOINT m_start;
- FPOINT m_end;
- CString m_layer; //图形对象所在图层
- int m_style;
- COLORREF m_color;
- CMyRect()
- {}
- DECLARE_SERIAL(CMyRect)
-
- public:
- CMyRect(CString layer, FPOINT startpoint, FPOINT endpoint, int style, COLORREF color);
- void Serialize(CArchive& ar);
- public:
- int GetObjectType();
- };
- //圆对象
- class CMyCircle: public CObject
- {
- public:
- FPOINT m_origin;
- float m_radius;
- CString m_layer; //图形对象所在图层
- int m_style;
- COLORREF m_color;
- CMyCircle()
- {}
- DECLARE_SERIAL(CMyCircle)
-
- public:
- CMyCircle(CString layer, FPOINT originpoint, float radius, int style, COLORREF color);
- void Serialize(CArchive& ar);
- public:
- int GetObjectType();
- };
- //圆弧对象
- class CMyArc: public CObject
- {
- public:
- //圆心坐标
- FPOINT m_origin;
- //起点坐标
- FPOINT m_start;
- //终点坐标
- FPOINT m_end;
- float m_radius;
- CString m_layer; //图形对象所在图层
- int m_style;
- COLORREF m_color;
- CMyArc()
- {}
- DECLARE_SERIAL(CMyArc)
-
- public:
- CMyArc(CString layer, FPOINT originpoint, FPOINT startpoint, FPOINT endpoint, float radius,
- int style, COLORREF color);
- void Serialize(CArchive& ar);
- public:
- int GetObjectType();
- };