diff -r 68443f5be176 -r 44679e468ba9 src/objecttypes/polygon.cpp --- a/src/objecttypes/polygon.cpp Sat Oct 05 23:47:03 2019 +0300 +++ b/src/objecttypes/polygon.cpp Sun Nov 03 12:17:41 2019 +0200 @@ -10,6 +10,12 @@ { } +modelobjects::Triangle::Triangle(const QVector& vertices, const Color color) : + ColoredBaseObject{color}, + points{vertices[0], vertices[1], vertices[2]} +{ +} + QVariant modelobjects::Triangle::getProperty(const Property id) const { switch (id) @@ -46,7 +52,7 @@ QString modelobjects::Triangle::textRepresentation() const { - return format("%1 %2 %3", + return utility::format("%1 %2 %3", vertexToStringParens(points[0]), vertexToStringParens(points[1]), vertexToStringParens(points[2])); @@ -63,6 +69,12 @@ { } +modelobjects::Quadrilateral::Quadrilateral(const QVector& vertices, const Color color) : + ColoredBaseObject{color}, + points{vertices[0], vertices[1], vertices[2], vertices[3]} +{ +} + QVariant modelobjects::Quadrilateral::getProperty(const Property id) const { switch (id) @@ -106,7 +118,7 @@ QString modelobjects::Quadrilateral::textRepresentation() const { - return format("%1 %2 %3 %4", + return utility::format("%1 %2 %3 %4", vertexToStringParens(points[0]), vertexToStringParens(points[1]), vertexToStringParens(points[2]),