66 virtual ~LDObject(); |
66 virtual ~LDObject(); |
67 |
67 |
68 virtual QString asText() const = 0; // This object as LDraw code |
68 virtual QString asText() const = 0; // This object as LDraw code |
69 LDColor color() const; |
69 LDColor color() const; |
70 virtual LDColor defaultColor() const; // What color does the object default to? |
70 virtual LDColor defaultColor() const; // What color does the object default to? |
71 Model* model() const; |
|
72 LDPolygon* getPolygon(); |
71 LDPolygon* getPolygon(); |
73 virtual void getVertices (DocumentManager *context, QSet<Vertex>& verts) const; |
72 virtual void getVertices (DocumentManager *context, QSet<Vertex>& verts) const; |
74 virtual bool hasMatrix() const; // Does this object have a matrix and position? (see LDMatrixObject) |
73 virtual bool hasMatrix() const; // Does this object have a matrix and position? (see LDMatrixObject) |
75 qint32 id() const; |
74 qint32 id() const; |
76 virtual bool isColored() const; |
75 virtual bool isColored() const; |
97 |
96 |
98 signals: |
97 signals: |
99 void codeChanged(const LDObjectState& before, const LDObjectState& after); |
98 void codeChanged(const LDObjectState& before, const LDObjectState& after); |
100 |
99 |
101 protected: |
100 protected: |
102 void setDocument(Model* model); |
|
103 |
|
104 template<typename T> |
101 template<typename T> |
105 void changeProperty(T* property, const T& value); |
102 void changeProperty(T* property, const T& value); |
106 |
103 |
107 private: |
104 private: |
108 bool m_hasInvertNext = false; |
105 bool m_hasInvertNext = false; |
109 bool m_isHidden; |
106 bool m_isHidden; |
110 Model* _model; |
|
111 qint32 m_id; |
107 qint32 m_id; |
112 LDColor m_color; |
108 LDColor m_color; |
113 QColor m_randomColor; |
109 QColor m_randomColor; |
114 Vertex m_coords[4]; |
110 Vertex m_coords[4]; |
115 }; |
111 }; |