| 4 namespace ldraw |
4 namespace ldraw |
| 5 { |
5 { |
| 6 class Triangle; |
6 class Triangle; |
| 7 } |
7 } |
| 8 |
8 |
| 9 class ldraw::Triangle : public ColoredObject |
9 class ldraw::Triangle : public PolygonObject<3> |
| 10 { |
10 { |
| 11 public: |
11 public: |
| 12 Triangle() = default; |
12 using PolygonObject<3>::PolygonObject; |
| 13 Triangle( |
|
| 14 const glm::vec3 &point_1, |
|
| 15 const glm::vec3 &point_2, |
|
| 16 const glm::vec3 &point_3, |
|
| 17 Color colorIndex = ldraw::mainColor); |
|
| 18 Triangle(const std::array<glm::vec3, 3>& vertices, const Color color); |
|
| 19 Triangle(const glm::vec3 (&vertices)[3], const Color color); |
|
| 20 QVariant getProperty(Property id) const override; |
|
| 21 QString textRepresentation() const override; |
13 QString textRepresentation() const override; |
| 22 void getPolygons(std::vector<gl::Polygon>& polygons, GetPolygonsContext* context) const override; |
14 void getPolygons(std::vector<gl::Polygon>& polygons, GetPolygonsContext* context) const override; |
| 23 void invert() override; |
15 void invert() override; |
| 24 int numPoints() const override; |
|
| 25 const glm::vec3& getPoint(int index) const override; |
|
| 26 glm::vec3 points[3] = {{}}; |
|
| 27 protected: |
|
| 28 void setProperty(SetPropertyResult* result, const PropertyKeyValue& pair) override; |
|
| 29 }; |
16 }; |
| 30 |
17 |