58 { |
58 { |
59 Q_OBJECT |
59 Q_OBJECT |
60 |
60 |
61 public: |
61 public: |
62 LDObject(); |
62 LDObject(); |
63 virtual ~LDObject(); |
|
64 |
63 |
65 virtual QString asText() const = 0; // This object as LDraw code |
64 virtual QString asText() const = 0; // This object as LDraw code |
66 LDColor color() const; |
65 LDColor color() const; |
67 virtual LDColor defaultColor() const; // What color does the object default to? |
66 virtual LDColor defaultColor() const; // What color does the object default to? |
68 LDPolygon* getPolygon(); |
67 LDPolygon* getPolygon(); |
69 virtual void getVertices (DocumentManager *context, QSet<Vertex>& verts) const; |
68 virtual void getVertices (DocumentManager *context, QSet<Vertex>& verts) const; |
70 virtual bool hasMatrix() const; // Does this object have a matrix and position? (see LDMatrixObject) |
69 virtual bool hasMatrix() const; // Does this object have a matrix and position? (see LDMatrixObject) |
71 qint32 id() const; |
|
72 virtual bool isColored() const; |
70 virtual bool isColored() const; |
73 bool isHidden() const; |
71 bool isHidden() const; |
74 virtual bool isScemantic() const; // Does this object have meaning in the part model? |
72 virtual bool isScemantic() const; // Does this object have meaning in the part model? |
75 void move (Vertex vect); |
73 void move (Vertex vect); |
76 virtual int numVertices() const; |
74 virtual int numVertices() const; |
86 virtual LDObjectType type() const = 0; |
84 virtual LDObjectType type() const = 0; |
87 virtual QString typeName() const = 0; |
85 virtual QString typeName() const = 0; |
88 const Vertex& vertex (int i) const; |
86 const Vertex& vertex (int i) const; |
89 virtual void serialize(class Serializer& serializer); |
87 virtual void serialize(class Serializer& serializer); |
90 |
88 |
91 static LDObject* fromID(qint32 id); |
|
92 static LDObject* newFromType(LDObjectType type); |
89 static LDObject* newFromType(LDObjectType type); |
93 |
90 |
94 signals: |
91 signals: |
95 void codeChanged(const LDObjectState& before, const LDObjectState& after); |
92 void codeChanged(const LDObjectState& before, const LDObjectState& after); |
96 |
93 |