src/objecttypes/conditionaledge.cpp

changeset 13
6e838748867b
parent 8
44679e468ba9
equal deleted inserted replaced
12:fe67489523b5 13:6e838748867b
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;
30 default: 30 default:
31 return Edge::getProperty(property); 31 return Edge::getProperty(property);
32 } 32 }
33 } 33 }
34 34
35 auto modelobjects::ConditionalEdge::setProperty( 35 auto linetypes::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 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 }

mercurial