src/LDObject.h

changeset 681
c1cc036c6e1f
parent 629
b75c6cce02e2
child 690
9e9c52ca955e
equal deleted inserted replaced
680:bf6323f2b1be 681:c1cc036c6e1f
20 #define LDFORGE_LDTYPES_H 20 #define LDFORGE_LDTYPES_H
21 21
22 #include "Main.h" 22 #include "Main.h"
23 #include "Types.h" 23 #include "Types.h"
24 #include "misc/DocumentPointer.h" 24 #include "misc/DocumentPointer.h"
25 #include "GLShared.h"
25 26
26 #define LDOBJ(T) \ 27 #define LDOBJ(T) \
27 protected: \ 28 protected: \
28 virtual LD##T* clone() override \ 29 virtual LD##T* clone() override \
29 { \ 30 { \
72 PROPERTY (public, LDObject*, Parent, NO_OPS, STOCK_WRITE) 73 PROPERTY (public, LDObject*, Parent, NO_OPS, STOCK_WRITE)
73 PROPERTY (public, LDDocument*, File, NO_OPS, STOCK_WRITE) // TODO: rename~ 74 PROPERTY (public, LDDocument*, File, NO_OPS, STOCK_WRITE) // TODO: rename~
74 PROPERTY (private, int, ID, NUM_OPS, STOCK_WRITE) 75 PROPERTY (private, int, ID, NUM_OPS, STOCK_WRITE)
75 PROPERTY (public, int, Color, NUM_OPS, CUSTOM_WRITE) 76 PROPERTY (public, int, Color, NUM_OPS, CUSTOM_WRITE)
76 PROPERTY (public, bool, GLInit, BOOL_OPS, STOCK_WRITE) 77 PROPERTY (public, bool, GLInit, BOOL_OPS, STOCK_WRITE)
78 PROPERTY (public, QString, Origin, NO_OPS, STOCK_WRITE)
77 79
78 public: 80 public:
79 // Object type codes. 81 // Object type codes.
80 enum Type 82 enum Type
81 { 83 {
172 static void moveObjects (LDObjectList objs, const bool up); 174 static void moveObjects (LDObjectList objs, const bool up);
173 175
174 // Get a description of a list of LDObjects 176 // Get a description of a list of LDObjects
175 static QString describeObjects (const LDObjectList& objs); 177 static QString describeObjects (const LDObjectList& objs);
176 static LDObject* fromID (int id); 178 static LDObject* fromID (int id);
179 LDPolygon* getPolygon();
177 180
178 // TODO: make these private! 181 // TODO: make these private!
179 // OpenGL list for this object 182 // OpenGL list for this object
180 uint glLists[4]; 183 uint glLists[4];
181 184
393 LDOBJ_NAME (subfile) 396 LDOBJ_NAME (subfile)
394 LDOBJ_VERTICES (0) 397 LDOBJ_VERTICES (0)
395 LDOBJ_COLORED 398 LDOBJ_COLORED
396 LDOBJ_SCEMANTIC 399 LDOBJ_SCEMANTIC
397 LDOBJ_HAS_MATRIX 400 LDOBJ_HAS_MATRIX
398 PROPERTY (public, LDDocumentPointer, FileInfo, NO_OPS, STOCK_WRITE) 401 PROPERTY (public, LDDocumentPointer, FileInfo, NO_OPS, CUSTOM_WRITE)
399 402
400 public: 403 public:
401 enum InlineFlag 404 enum InlineFlag
402 { 405 {
403 DeepInline = (1 << 0), 406 DeepInline = (1 << 0),
414 setLinkPointer (this); 417 setLinkPointer (this);
415 } 418 }
416 419
417 // Inlines this subfile. Note that return type is an array of heap-allocated 420 // Inlines this subfile. Note that return type is an array of heap-allocated
418 // LDObject copies, they must be deleted manually. 421 // LDObject copies, they must be deleted manually.
419 LDObjectList inlineContents (InlineFlags flags); 422 LDObjectList inlineContents (bool deep, bool render);
423 QList<LDPolygon> inlinePolygons();
420 424
421 protected: 425 protected:
422 ~LDSubfile(); 426 ~LDSubfile();
423 }; 427 };
424 428

mercurial