Main Page Class Hierarchy Compound List File List Compound Members

# element.h

    00001
    00002
    00003 /*
    00004 Program                 ELEMENT.H
    00005 Purpose                 base class for elements
    00006 Last Update             24-09-96
    00007 */
    00008
    00009 #ifndef ELEMENT_H
    00010 #define ELEMENT_H
    00011
    00012 #ifdef __GNUG__
    00013 #pragma interface
    00014 #endif
    00015
    00016 enum SelectType { DESELECT, SELECT, SELECTALL, DESELECTALL,QUERY };
    00017 enum TYPE {NON,BOUNDARY,PATH,TEXT,SREF,AREF,ARCSEG,BOX,CIRCLE,IMAGE,SLINE};
    00018 enum EleFlags{ELE_NON=0x0000,ELE_SELECTED=0x0001,ELE_GR_A=0x0002,ELE_GR_B=0x0004,
    00019                                   ELE_GR_C=0x0008,ELE_GR_AB=0x0006,ELE_FILLED=0x0010,ELE_ALL=0xFFFF};
    00020 enum PATHTYPE {PATH_END_SQAURE,PATH_END_ROUND,PATH_END_SQAURE_EXT};
    00021
    00022 #include "misc.h"
    00023 #include "bbox.h"
    00024
    00025 class wxPropertySheet;
    00026
    00027 class DrawDriver;
    00028 class Driver_out;
    00029
    00030
    00031 typedef struct element_bitflags
    00032 {
    00033
    00034 #if wxBYTE_ORDER == wxLITTLE_ENDIAN
    00035                 unsigned        m_select : 1;
    00036                 unsigned        m_group_a: 1;
    00037                 unsigned        m_group_b: 1;
    00038                 unsigned        m_group_c: 1;
    00039                 unsigned        m_filled : 1;
    00040                 unsigned        m_template:1 ;
    00041                 unsigned        m_external :1 ;
    00042                 unsigned        m_used :1 ;
    00043                 unsigned        reserved  :      8;
    00044 #else
    00045                 unsigned        reserved  :      8;
    00046                 unsigned        m_used :1 ;
    00047                 unsigned        m_external :1 ;
    00048                 unsigned        m_template:1 ;
    00049                 unsigned        m_filled : 1;
    00050                 unsigned        m_group_c: 1;
    00051                 unsigned        m_group_b: 1;
    00052                 unsigned        m_group_a: 1;
    00053                 unsigned        m_select : 1;
    00054 #endif
    00055 } element_bitflags;
    00056
    00057 class Structure;
    00058
    00060
    00069 class Element
    00070 {
    00071         public:
    00072                 Element();
    00073
    00074                 virtual ~Element();
    00075
    00076                 Element& operator=(Element &other);
    00077
    00078       void Write(Driver_out& dr);
    00079       virtual void OWrite(Driver_out& dr)=0;
    00080
    00081       virtual void Write(DrawDriver& dr);
    00082       virtual void DoWrite(DrawDriver& dr)=0;
    00083
    00084                 virtual Element*                        Duplicate()=0;
    00085
    00087                 virtual BoundingBox&                            CalcBoundingBox()=0;
    00089                 virtual BoundingBox&                            GetBoundingBox()=0;
    00091                 virtual void                                            Transform( wxTransformMatrix* _Matrix)=0;
    00092
    00094                 virtual TYPE                                            GetType()=0;
    00096                 virtual bool                                            Select(Point*)=0;
    00099                 virtual bool                                            Select(BoundingBox*,wxTransformMatrix*)=0;
    00100
    00102                 void                                                          SetFilled(bool);
    00104                 bool                                                    GetFilled();
    00106                 void                                                          SetSelect(bool);
    00108                 bool                                                    GetSelect();
    00110                 bool                                                                    GetGroupA();
    00112                 bool                                                                    GetGroupB();
    00114                 bool                                                                    GetGroupC();
    00116                 void                                                                    SetGroupA(bool value);
    00118                 void                                                                    SetGroupB(bool value);
    00120                 void                                                                    SetGroupC(bool value);
    00122                 void                                                                    SetFlags(short int which);
    00124                 void                                                                    ClearFlags(short int which);
    00126                 short int                                                  GetFlags();
    00128                 virtual wxPropertySheet*                HasPropList();
    00130       virtual wxPropertySheet*          GetPropList();
    00132       virtual void                                              UpdatePropList();
    00134                 void                                                                    AddProperty(const wxString& name,const wxString& type,const wxString& value);
    00136       void                                                                      SetStamp(long event);
    00138       long                                                                      GetStamp();
    00139
    00140       virtual Structure*                                        GetStructure(){return 0;};
    00141
    00142                 void            SetTemplate(bool b = true);
    00143                 void            SetExternal(bool b = true);
    00144                 void            SetUsed(bool b = true);
    00145
    00146                 bool    GetTemplate();
    00147                 bool    GetExternal();
    00148                 bool    GetUsed();
    00149
    00150    protected:
    00152                 long                                     m_stamp;
    00154                 union  {
    00155                short int _all;
    00156                                         element_bitflags bits;
    00157                                  } bit_flags;
    00159       wxPropertySheet*   m_wxpropsheet;
    00161                 BoundingBox     m_boundingbox;
    00162
    00163 };
    00164 #endif
    00165

element.h Source File -- Thu Nov 28 21:24:56 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page