src/ldtypes.h

changeset 192
c414924a647c
parent 191
9bb6a17305ad
child 211
8d35e631bef3
equal deleted inserted replaced
191:9bb6a17305ad 192:c414924a647c
20 #define LDTYPES_H 20 #define LDTYPES_H
21 21
22 #include "common.h" 22 #include "common.h"
23 #include "types.h" 23 #include "types.h"
24 24
25 class HistoryEntry;
26
25 #define IMPLEMENT_LDTYPE(T, NUMVERTS) \ 27 #define IMPLEMENT_LDTYPE(T, NUMVERTS) \
26 LD##T () {} \ 28 LD##T () {} \
27 virtual ~LD##T () {} \ 29 virtual ~LD##T () {} \
28 virtual LDObject::Type getType () const { \ 30 virtual LDObject::Type getType () const { \
29 return LDObject::T; \ 31 return LDObject::T; \
32 virtual LD##T* clone () { \ 34 virtual LD##T* clone () { \
33 return new LD##T (*this); \ 35 return new LD##T (*this); \
34 } \ 36 } \
35 virtual void move (vertex vVector); \ 37 virtual void move (vertex vVector); \
36 virtual short vertices () const { return NUMVERTS; } \ 38 virtual short vertices () const { return NUMVERTS; } \
39 virtual HistoryEntry* invert ();
37 40
38 #define LDOBJ_SETCOLORED(V) virtual bool isColored () const { return V; } 41 #define LDOBJ_SETCOLORED(V) virtual bool isColored () const { return V; }
39 #define LDOBJ_COLORED LDOBJ_SETCOLORED (true) 42 #define LDOBJ_COLORED LDOBJ_SETCOLORED (true)
40 #define LDOBJ_UNCOLORED LDOBJ_SETCOLORED (false) 43 #define LDOBJ_UNCOLORED LDOBJ_SETCOLORED (false)
41 44
136 static str objectListContents (const std::vector<LDObject*>& objs); 139 static str objectListContents (const std::vector<LDObject*>& objs);
137 140
138 // Object list entry for this object 141 // Object list entry for this object
139 QListWidgetItem* qObjListEntry; 142 QListWidgetItem* qObjListEntry;
140 143
141 bool hidden () const { return m_hidden; } 144 bool hidden () const { return m_hidden; }
142 LDObject* next () const; 145 virtual HistoryEntry* invert ();
143 LDObject* prev () const; 146 LDObject* next () const;
144 void setHidden (const bool hidden) { m_hidden = hidden; } 147 LDObject* prev () const;
145 bool selected () const { return m_selected; } 148 void setHidden (const bool hidden) { m_hidden = hidden; }
146 void setSelected (bool selected) { m_selected = selected; } 149 bool selected () const { return m_selected; }
150 void setSelected (bool selected) { m_selected = selected; }
147 151
148 private: 152 private:
149 bool m_hidden; 153 bool m_hidden;
150 bool m_selected; 154 bool m_selected;
151 }; 155 };

mercurial