1 #include "conditionaledge.h" |
1 #include "conditionaledge.h" |
2 |
2 |
3 modelobjects::ConditionalEdge::ConditionalEdge( |
3 linetypes::ConditionalEdge::ConditionalEdge( |
4 const Vertex& point_1, |
4 const Vertex& point_1, |
5 const Vertex& point_2, |
5 const Vertex& point_2, |
6 const Vertex& controlPoint_1, |
6 const Vertex& controlPoint_1, |
7 const Vertex& controlPoint_2, |
7 const Vertex& 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 modelobjects::ConditionalEdge::ConditionalEdge(const QVector<Vertex>& vertices, const Color color) : |
15 linetypes::ConditionalEdge::ConditionalEdge(const QVector<Vertex>& 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 modelobjects::ConditionalEdge::getProperty(Property property) const |
22 QVariant linetypes::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 controlPoint_1; |
27 return 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 modelobjects::ConditionalEdge::textRepresentation() const |
51 QString linetypes::ConditionalEdge::textRepresentation() const |
52 { |
52 { |
53 return Edge::textRepresentation() + utility::format("%1 %2", |
53 return Edge::textRepresentation() + utility::format("%1 %2", |
54 vertexToStringParens(controlPoint_1), |
54 vertexToStringParens(controlPoint_1), |
55 vertexToStringParens(controlPoint_2)); |
55 vertexToStringParens(controlPoint_2)); |
56 } |
56 } |