src/linetypes/quadrilateral.cpp

changeset 18
918b6c0f8b5b
parent 15
9e18ec63eec3
child 21
0133e565e072
equal deleted inserted replaced
17:a5111f4e6412 18:918b6c0f8b5b
1 #include "quadrilateral.h" 1 #include "quadrilateral.h"
2 2
3 linetypes::Quadrilateral::Quadrilateral( 3 linetypes::Quadrilateral::Quadrilateral(
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 const Vertex& point_4, 7 const Point3D& point_4,
8 Color color_index) : 8 Color color_index) :
9 ColoredObject{color_index}, 9 ColoredObject{color_index},
10 points{point_1, point_2, point_3, point_4} 10 points{point_1, point_2, point_3, point_4}
11 { 11 {
12 } 12 }
13 13
14 linetypes::Quadrilateral::Quadrilateral(const QVector<Vertex>& vertices, const Color color) : 14 linetypes::Quadrilateral::Quadrilateral(const QVector<Point3D>& vertices, const Color color) :
15 ColoredObject{color}, 15 ColoredObject{color},
16 points{vertices[0], vertices[1], vertices[2], vertices[3]} 16 points{vertices[0], vertices[1], vertices[2], vertices[3]}
17 { 17 {
18 } 18 }
19 19
40 -> SetPropertyResult 40 -> SetPropertyResult
41 { 41 {
42 switch (id) 42 switch (id)
43 { 43 {
44 case Property::Point1: 44 case Property::Point1:
45 points[0] = value.value<Vertex>(); 45 points[0] = value.value<Point3D>();
46 return SetPropertyResult::Success; 46 return SetPropertyResult::Success;
47 case Property::Point2: 47 case Property::Point2:
48 points[1] = value.value<Vertex>(); 48 points[1] = value.value<Point3D>();
49 return SetPropertyResult::Success; 49 return SetPropertyResult::Success;
50 case Property::Point3: 50 case Property::Point3:
51 points[2] = value.value<Vertex>(); 51 points[2] = value.value<Point3D>();
52 return SetPropertyResult::Success; 52 return SetPropertyResult::Success;
53 case Property::Point4: 53 case Property::Point4:
54 points[3] = value.value<Vertex>(); 54 points[3] = value.value<Point3D>();
55 return SetPropertyResult::Success; 55 return SetPropertyResult::Success;
56 default: 56 default:
57 return ColoredObject::setProperty(id, value); 57 return ColoredObject::setProperty(id, value);
58 } 58 }
59 } 59 }

mercurial