123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #ifndef __PCL_OBJECT_BASE__2003_03_30__H__
- #define __PCL_OBJECT_BASE__2003_03_30__H__
- #include "StdDefine.h"
- class FCObject ;
- class FCObjGraph ;
- class FCObject
- {
- public:
- virtual ~FCObject() {}
-
- virtual int Serialize (bool bSave, BYTE* pSave) {return 0;}
- };
- class FCObjGraph : public FCObject
- {
- public:
- FCObjGraph() {m_ptObj.x = m_ptObj.y = 0;}
- FCObjGraph& operator= (const FCObjGraph& GraphObj) {m_ptObj = GraphObj.m_ptObj; return *this;}
-
- virtual int Serialize (bool bSave, BYTE* pSave)
- {
- bSave ? (*(POINT*)pSave = m_ptObj) : (m_ptObj = *(POINT*)pSave) ;
- return sizeof(m_ptObj) ;
- }
-
-
-
- void SetGraphObjPos (int xPos, int yPos) {m_ptObj.x=xPos; m_ptObj.y=yPos;}
-
- void SetGraphObjPos (const POINT& pos) {m_ptObj = pos;}
-
- POINT GetGraphObjPos() const {return m_ptObj;}
-
- void OffsetGraphObj (int xOff, int yOff) {m_ptObj.x += xOff; m_ptObj.y += yOff;}
-
-
-
-
- void Canvas_to_Layer (POINT& pt) const
- {
- pt.x -= m_ptObj.x ; pt.y -= m_ptObj.y ;
- }
- void Canvas_to_Layer (RECT& rc) const
- {
- rc.left -= m_ptObj.x ;
- rc.top -= m_ptObj.y ;
- rc.right -= m_ptObj.x ;
- rc.bottom -= m_ptObj.y ;
- }
-
- void Layer_to_Canvas (POINT& pt) const
- {
- pt.x += m_ptObj.x ; pt.y += m_ptObj.y ;
- }
- void Layer_to_Canvas (RECT& rc) const
- {
- rc.left += m_ptObj.x ;
- rc.top += m_ptObj.y ;
- rc.right += m_ptObj.x ;
- rc.bottom += m_ptObj.y ;
- }
-
- private:
- POINT m_ptObj ;
- };
- #endif
|