| 1 #include "triangle.h" |
1 #include "triangle.h" |
| 2 |
2 |
| 3 linetypes::Triangle::Triangle( |
3 linetypes::Triangle::Triangle( |
| 4 const Vertex& point_1, |
4 const Point3D& point_1, |
| 5 const Vertex& point_2, |
5 const Point3D& point_2, |
| 6 const Vertex& point_3, |
6 const Point3D& point_3, |
| 7 Color color_index) : |
7 Color color_index) : |
| 8 ColoredObject{color_index}, |
8 ColoredObject{color_index}, |
| 9 points{point_1, point_2, point_3} |
9 points{point_1, point_2, point_3} |
| 10 { |
10 { |
| 11 } |
11 } |
| 12 |
12 |
| 13 linetypes::Triangle::Triangle(const QVector<Vertex>& vertices, const Color color) : |
13 linetypes::Triangle::Triangle(const QVector<Point3D>& vertices, const Color color) : |
| 14 ColoredObject{color}, |
14 ColoredObject{color}, |
| 15 points{vertices[0], vertices[1], vertices[2]} |
15 points{vertices[0], vertices[1], vertices[2]} |
| 16 { |
16 { |
| 17 } |
17 } |
| 18 |
18 |
| 35 -> SetPropertyResult |
35 -> SetPropertyResult |
| 36 { |
36 { |
| 37 switch (id) |
37 switch (id) |
| 38 { |
38 { |
| 39 case Property::Point1: |
39 case Property::Point1: |
| 40 points[0] = value.value<Vertex>(); |
40 points[0] = value.value<Point3D>(); |
| 41 return SetPropertyResult::Success; |
41 return SetPropertyResult::Success; |
| 42 case Property::Point2: |
42 case Property::Point2: |
| 43 points[1] = value.value<Vertex>(); |
43 points[1] = value.value<Point3D>(); |
| 44 return SetPropertyResult::Success; |
44 return SetPropertyResult::Success; |
| 45 case Property::Point3: |
45 case Property::Point3: |
| 46 points[2] = value.value<Vertex>(); |
46 points[2] = value.value<Point3D>(); |
| 47 return SetPropertyResult::Success; |
47 return SetPropertyResult::Success; |
| 48 default: |
48 default: |
| 49 return ColoredObject::setProperty(id, value); |
49 return ColoredObject::setProperty(id, value); |
| 50 } |
50 } |
| 51 } |
51 } |