src/linetypes/modelobject.h

changeset 1278
6e1ea24e5a5e
parent 1271
c022fb3855b1
child 1279
0f6a4a7cafec
equal deleted inserted replaced
1277:821c30615069 1278:6e1ea24e5a5e
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
99 void changeProperty(T* property, const T& value); 96 void changeProperty(T* property, const T& value);
100 97
101 private: 98 private:
102 bool m_hasInvertNext = false; 99 bool m_hasInvertNext = false;
103 bool m_isHidden; 100 bool m_isHidden;
104 qint32 m_id;
105 LDColor m_color; 101 LDColor m_color;
106 QColor m_randomColor; 102 QColor m_randomColor;
107 Vertex m_coords[4]; 103 Vertex m_coords[4];
108 }; 104 };
109 105

mercurial