251 private: |
251 private: |
252 LDDocument* m_fileInfo; |
252 LDDocument* m_fileInfo; |
253 }; |
253 }; |
254 |
254 |
255 /* |
255 /* |
256 * Represents a single code-2 line in the LDraw code file. |
|
257 */ |
|
258 class LDEdgeLine : public LDObject |
|
259 { |
|
260 public: |
|
261 static constexpr LDObjectType SubclassType = LDObjectType::EdgeLine; |
|
262 |
|
263 virtual LDObjectType type() const override |
|
264 { |
|
265 return SubclassType; |
|
266 } |
|
267 |
|
268 virtual QString asText() const override; |
|
269 virtual void invert() override; |
|
270 int numVertices() const override { return 2; } |
|
271 LDColor defaultColor() const override { return EdgeColor; } |
|
272 QString typeName() const override { return "line"; } |
|
273 |
|
274 protected: |
|
275 friend class Model; |
|
276 LDEdgeLine (Model* model); |
|
277 LDEdgeLine (Vertex v1, Vertex v2, Model* model = nullptr); |
|
278 }; |
|
279 |
|
280 /* |
|
281 * Represents a single code-5 conditional line. |
|
282 */ |
|
283 class LDConditionalEdge : public LDEdgeLine |
|
284 { |
|
285 public: |
|
286 static constexpr LDObjectType SubclassType = LDObjectType::ConditionalEdge; |
|
287 |
|
288 virtual LDObjectType type() const override |
|
289 { |
|
290 return SubclassType; |
|
291 } |
|
292 |
|
293 virtual QString asText() const override; |
|
294 virtual void invert() override; |
|
295 int numVertices() const override { return 4; } |
|
296 LDColor defaultColor() const override { return EdgeColor; } |
|
297 LDEdgeLine* becomeEdgeLine(); |
|
298 QString typeName() const override { return "condline"; } |
|
299 |
|
300 protected: |
|
301 friend class Model; |
|
302 LDConditionalEdge (Model* model); |
|
303 LDConditionalEdge (const Vertex& v0, const Vertex& v1, const Vertex& v2, const Vertex& v3, Model* model = nullptr); |
|
304 }; |
|
305 |
|
306 /* |
|
307 * Represents a single code-3 triangle in the LDraw code file. |
256 * Represents a single code-3 triangle in the LDraw code file. |
308 */ |
257 */ |
309 class LDTriangle : public LDObject |
258 class LDTriangle : public LDObject |
310 { |
259 { |
311 public: |
260 public: |