src/objecttypes/polygon.cpp

changeset 6
73e448b2943d
parent 3
55a55a9ec2c2
child 8
44679e468ba9
--- a/src/objecttypes/polygon.cpp	Thu Oct 03 11:45:44 2019 +0300
+++ b/src/objecttypes/polygon.cpp	Thu Oct 03 23:44:28 2019 +0300
@@ -44,6 +44,14 @@
 	}
 }
 
+QString modelobjects::Triangle::textRepresentation() const
+{
+	return format("%1 %2 %3",
+		vertexToStringParens(points[0]),
+		vertexToStringParens(points[1]),
+		vertexToStringParens(points[2]));
+}
+
 modelobjects::Quadrilateral::Quadrilateral(
 	const Vertex& point_1,
 	const Vertex& point_2,
@@ -95,3 +103,12 @@
 		return ColoredBaseObject::setProperty(id, value);
 	}
 }
+
+QString modelobjects::Quadrilateral::textRepresentation() const
+{
+	return format("%1 %2 %3 %4",
+		vertexToStringParens(points[0]),
+		vertexToStringParens(points[1]),
+		vertexToStringParens(points[2]),
+		vertexToStringParens(points[3]));
+}

mercurial