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); |
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 } |