src/ldObject.h

changeset 1015
92c6ec099075
parent 1014
f0a8ecb6a357
child 1023
9450ac3cd930
equal deleted inserted replaced
1014:f0a8ecb6a357 1015:92c6ec099075
123 void setColor (LDColor color); 123 void setColor (LDColor color);
124 void setDocument (LDDocument* document); 124 void setDocument (LDDocument* document);
125 void setHidden (bool value); 125 void setHidden (bool value);
126 void setVertex (int i, const Vertex& vert); 126 void setVertex (int i, const Vertex& vert);
127 void swap (LDObject* other); 127 void swap (LDObject* other);
128 LDObject* topLevelParent(); 128 virtual int triangleCount() const;
129 virtual LDObjectType type() const = 0; 129 virtual LDObjectType type() const = 0;
130 virtual QString typeName() const = 0; 130 virtual QString typeName() const = 0;
131 const Vertex& vertex (int i) const; 131 const Vertex& vertex (int i) const;
132 132
133 static QString describeObjects (const LDObjectList& objs); 133 static QString describeObjects (const LDObjectList& objs);
141 141
142 private: 142 private:
143 bool m_isHidden; 143 bool m_isHidden;
144 bool m_isSelected; 144 bool m_isSelected;
145 bool m_isDestroyed; 145 bool m_isDestroyed;
146 LDObject* m_parent;
147 LDDocument* m_document; 146 LDDocument* m_document;
148 qint32 m_id; 147 qint32 m_id;
149 LDColor m_color; 148 LDColor m_color;
150 QColor m_randomColor; 149 QColor m_randomColor;
151 Vertex m_coords[4]; 150 Vertex m_coords[4];
322 LDDocument* fileInfo() const; 321 LDDocument* fileInfo() const;
323 virtual void getVertices (QVector<Vertex>& verts) const override; 322 virtual void getVertices (QVector<Vertex>& verts) const override;
324 LDObjectList inlineContents (bool deep, bool render); 323 LDObjectList inlineContents (bool deep, bool render);
325 QList<LDPolygon> inlinePolygons(); 324 QList<LDPolygon> inlinePolygons();
326 void setFileInfo (LDDocument* fileInfo); 325 void setFileInfo (LDDocument* fileInfo);
326 int triangleCount() const override;
327 327
328 private: 328 private:
329 LDDocument* m_fileInfo; 329 LDDocument* m_fileInfo;
330 }; 330 };
331 331
385 LDOBJ_SCEMANTIC 385 LDOBJ_SCEMANTIC
386 LDOBJ_NO_MATRIX 386 LDOBJ_NO_MATRIX
387 387
388 public: 388 public:
389 LDTriangle (Vertex const& v1, Vertex const& v2, Vertex const& v3, LDDocument* document = nullptr); 389 LDTriangle (Vertex const& v1, Vertex const& v2, Vertex const& v3, LDDocument* document = nullptr);
390 int triangleCount() const override;
390 }; 391 };
391 392
392 // 393 //
393 // LDQuad 394 // LDQuad
394 // 395 //
408 public: 409 public:
409 LDQuad (const Vertex& v1, const Vertex& v2, const Vertex& v3, const Vertex& v4, LDDocument* document = nullptr); 410 LDQuad (const Vertex& v1, const Vertex& v2, const Vertex& v3, const Vertex& v4, LDDocument* document = nullptr);
410 411
411 // Split this quad into two triangles 412 // Split this quad into two triangles
412 QList<LDTriangle*> splitToTriangles(); 413 QList<LDTriangle*> splitToTriangles();
414 int triangleCount() const override;
413 }; 415 };
414 416
415 // 417 //
416 // LDOverlay 418 // LDOverlay
417 // 419 //

mercurial