src/objecttypes/edge.cpp

changeset 8
44679e468ba9
parent 6
73e448b2943d
child 13
6e838748867b
equal deleted inserted replaced
7:68443f5be176 8:44679e468ba9
5 const Vertex& point_2, 5 const Vertex& point_2,
6 const Color color_index) : 6 const Color color_index) :
7 ColoredBaseObject{color_index}, 7 ColoredBaseObject{color_index},
8 point_1{point_1}, 8 point_1{point_1},
9 point_2{point_2} {} 9 point_2{point_2} {}
10
11 modelobjects::Edge::Edge(const QVector<Vertex>& vertices, const Color color) :
12 ColoredBaseObject{color},
13 point_1{vertices[0]},
14 point_2{vertices[1]}
15 {
16 }
10 17
11 QVariant modelobjects::Edge::getProperty(Property property) const 18 QVariant modelobjects::Edge::getProperty(Property property) const
12 { 19 {
13 switch (property) 20 switch (property)
14 { 21 {
37 } 44 }
38 } 45 }
39 46
40 QString modelobjects::Edge::textRepresentation() const 47 QString modelobjects::Edge::textRepresentation() const
41 { 48 {
42 return format("%1 %2", vertexToStringParens(point_1), vertexToStringParens(point_2)); 49 return utility::format("%1 %2", vertexToStringParens(point_1), vertexToStringParens(point_2));
43 } 50 }

mercurial