src/linetypes/conditionaledge.cpp

changeset 35
98906a94732f
parent 33
4c41bfe2ec6e
child 77
028798a72591
equal deleted inserted replaced
34:1de2b8d64e9f 35:98906a94732f
1 #include "conditionaledge.h" 1 #include "conditionaledge.h"
2 2
3 linetypes::ConditionalEdge::ConditionalEdge( 3 ldraw::ConditionalEdge::ConditionalEdge(
4 const glm::vec3& point_1, 4 const glm::vec3& point_1,
5 const glm::vec3& point_2, 5 const glm::vec3& point_2,
6 const glm::vec3& controlPoint_1, 6 const glm::vec3& controlPoint_1,
7 const glm::vec3& controlPoint_2, 7 const glm::vec3& controlPoint_2,
8 const Color color_index) : 8 const Color color_index) :
10 controlPoint_1{controlPoint_1}, 10 controlPoint_1{controlPoint_1},
11 controlPoint_2{controlPoint_2} 11 controlPoint_2{controlPoint_2}
12 { 12 {
13 } 13 }
14 14
15 linetypes::ConditionalEdge::ConditionalEdge(const QVector<glm::vec3>& vertices, const Color color) : 15 ldraw::ConditionalEdge::ConditionalEdge(const QVector<glm::vec3>& vertices, const Color color) :
16 Edge{vertices[0], vertices[1], color}, 16 Edge{vertices[0], vertices[1], color},
17 controlPoint_1{vertices[2]}, 17 controlPoint_1{vertices[2]},
18 controlPoint_2{vertices[3]} 18 controlPoint_2{vertices[3]}
19 { 19 {
20 } 20 }
21 21
22 QVariant linetypes::ConditionalEdge::getProperty(Property property) const 22 QVariant ldraw::ConditionalEdge::getProperty(Property property) const
23 { 23 {
24 switch (property) 24 switch (property)
25 { 25 {
26 case Property::ControlPoint1: 26 case Property::ControlPoint1:
27 return QVariant::fromValue(controlPoint_1); 27 return QVariant::fromValue(controlPoint_1);
30 default: 30 default:
31 return Edge::getProperty(property); 31 return Edge::getProperty(property);
32 } 32 }
33 } 33 }
34 34
35 auto linetypes::ConditionalEdge::setProperty( 35 auto ldraw::ConditionalEdge::setProperty(
36 Property property, 36 Property property,
37 const QVariant& value) 37 const QVariant& value)
38 -> SetPropertyResult 38 -> SetPropertyResult
39 { 39 {
40 switch (property) 40 switch (property)
46 default: 46 default:
47 return Edge::setProperty(property, value); 47 return Edge::setProperty(property, value);
48 } 48 }
49 } 49 }
50 50
51 QString linetypes::ConditionalEdge::textRepresentation() const 51 QString ldraw::ConditionalEdge::textRepresentation() const
52 { 52 {
53 return Edge::textRepresentation() + utility::format("%1 %2", 53 return Edge::textRepresentation() + utility::format("%1 %2",
54 utility::vertexToStringParens(controlPoint_1), 54 utility::vertexToStringParens(controlPoint_1),
55 utility::vertexToStringParens(controlPoint_2)); 55 utility::vertexToStringParens(controlPoint_2));
56 } 56 }

mercurial