src/ldtypes.h

changeset 223
4f95d7f2e9ef
parent 216
c8882ff62d61
child 232
4e44c92e21dd
equal deleted inserted replaced
222:fddd36a6526c 223:4f95d7f2e9ef
75 // in the LDraw code file. The virtual method getType returns an enumerator 75 // in the LDraw code file. The virtual method getType returns an enumerator
76 // which is a token of the object's type. The object can be casted into 76 // which is a token of the object's type. The object can be casted into
77 // sub-classes based on this enumerator. 77 // sub-classes based on this enumerator.
78 // ============================================================================= 78 // =============================================================================
79 class LDObject { 79 class LDObject {
80 PROPERTY (bool, hidden, setHidden)
81 PROPERTY (bool, selected, setSelected)
82
80 public: 83 public:
81 // Object type codes. Codes are sorted in order of significance. 84 // Object type codes. Codes are sorted in order of significance.
82 enum Type { 85 enum Type {
83 Subfile, // Object represents a sub-file reference 86 Subfile, // Object represents a sub-file reference
84 Radial, // Object represents a generic radial 87 Radial, // Object represents a generic radial
129 return new LDObject (*this); 132 return new LDObject (*this);
130 } 133 }
131 134
132 // Replace this LDObject with another LDObject. This method deletes the 135 // Replace this LDObject with another LDObject. This method deletes the
133 // object and any pointers to it become invalid. 136 // object and any pointers to it become invalid.
134 void replace (LDObject* replacement); 137 void replace (LDObject* replacement);
135 138
136 // Swap this object with another. 139 // Swap this object with another.
137 void swap (LDObject* other); 140 void swap (LDObject* other);
138 141
139 // Moves this object using the given vertex as a movement vector 142 // Moves this object using the given vertex as a movement vector
158 static str objectListContents (const std::vector<LDObject*>& objs); 161 static str objectListContents (const std::vector<LDObject*>& objs);
159 162
160 // Object list entry for this object 163 // Object list entry for this object
161 QListWidgetItem* qObjListEntry; 164 QListWidgetItem* qObjListEntry;
162 165
163 bool hidden () const { return m_hidden; }
164 virtual bool hasMatrix () const { return false; } 166 virtual bool hasMatrix () const { return false; }
165 virtual HistoryEntry* invert (); 167 virtual HistoryEntry* invert ();
166 LDObject* next () const; 168 LDObject* next () const;
167 LDObject* prev () const; 169 LDObject* prev () const;
168 void setHidden (const bool hidden) { m_hidden = hidden; }
169 bool selected () const { return m_selected; }
170 void setSelected (bool selected) { m_selected = selected; }
171 170
172 protected: 171 protected:
173 bool m_glinit; 172 bool m_glinit;
174 friend class GLRenderer; 173 friend class GLRenderer;
175
176 private:
177 bool m_hidden, m_selected;
178 }; 174 };
179 175
180 // ============================================================================= 176 // =============================================================================
181 // LDGibberish 177 // LDGibberish
182 // 178 //

mercurial