src/linetypes/edge.cpp

changeset 200
ca23936b455b
parent 199
6988973515d2
child 201
5d201ee4a9c3
equal deleted inserted replaced
199:6988973515d2 200:ca23936b455b
1 #include "edge.h"
2
3 QString ldraw::Edge::textRepresentation() const
4 {
5 return utility::format(
6 "%1 %2",
7 utility::vertexToStringParens(this->points[0]),
8 utility::vertexToStringParens(this->points[1]));
9 }
10
11 void ldraw::Edge::getPolygons(
12 std::vector<gl::Polygon>& polygons,
13 GetPolygonsContext* context) const
14 {
15 Q_UNUSED(context)
16 polygons.push_back(gl::edgeLine(this->points[0], this->points[1], this->colorIndex, this->id));
17 }
18
19 ldraw::Object::Type ldraw::Edge::typeIdentifier() const
20 {
21 return Type::EdgeLine;
22 }
23
24 QString ldraw::Edge::toLDrawCode() const
25 {
26 return utility::format(
27 "2 %1 %2 %3",
28 this->colorIndex.index,
29 utility::vertexToString(this->points[0]),
30 utility::vertexToString(this->points[1]));
31 }
32
33 QString ldraw::Edge::iconName() const
34 {
35 return ":/icons/linetype-edgeline.png";
36 }
37
38 QString ldraw::Edge::typeName() const
39 {
40 return QObject::tr("edge");
41 }

mercurial