25 class LDTriangle : public LDObject |
25 class LDTriangle : public LDObject |
26 { |
26 { |
27 public: |
27 public: |
28 static constexpr LDObjectType SubclassType = LDObjectType::Triangle; |
28 static constexpr LDObjectType SubclassType = LDObjectType::Triangle; |
29 |
29 |
|
30 LDTriangle() = default; |
|
31 LDTriangle(Vertex const& v1, Vertex const& v2, Vertex const& v3); |
|
32 |
30 virtual LDObjectType type() const override |
33 virtual LDObjectType type() const override |
31 { |
34 { |
32 return SubclassType; |
35 return LDObjectType::Triangle; |
33 } |
36 } |
34 |
37 |
35 virtual QString asText() const override; |
38 virtual QString asText() const override; |
36 int triangleCount(DocumentManager*) const override; |
39 int triangleCount(DocumentManager*) const override; |
37 int numVertices() const override { return 3; } |
40 int numVertices() const override { return 3; } |
38 QString typeName() const override { return "triangle"; } |
41 QString typeName() const override { return "triangle"; } |
39 |
|
40 protected: |
|
41 friend class Model; |
|
42 LDTriangle (Model* model); |
|
43 LDTriangle (Vertex const& v1, Vertex const& v2, Vertex const& v3, Model* model = nullptr); |
|
44 }; |
42 }; |