src/linetypes/conditionaledge.cpp

changeset 33
4c41bfe2ec6e
parent 18
918b6c0f8b5b
child 35
98906a94732f
--- a/src/linetypes/conditionaledge.cpp	Sun Jan 26 01:06:27 2020 +0200
+++ b/src/linetypes/conditionaledge.cpp	Sun Jan 26 14:29:30 2020 +0200
@@ -1,10 +1,10 @@
 #include "conditionaledge.h"
 
 linetypes::ConditionalEdge::ConditionalEdge(
-	const Point3D& point_1,
-	const Point3D& point_2,
-	const Point3D& controlPoint_1,
-	const Point3D& controlPoint_2,
+	const glm::vec3& point_1,
+	const glm::vec3& point_2,
+	const glm::vec3& controlPoint_1,
+	const glm::vec3& controlPoint_2,
 	const Color color_index) :
 	Edge{point_1, point_2, color_index},
 	controlPoint_1{controlPoint_1},
@@ -12,7 +12,7 @@
 {
 }
 
-linetypes::ConditionalEdge::ConditionalEdge(const QVector<Point3D>& vertices, const Color color) :
+linetypes::ConditionalEdge::ConditionalEdge(const QVector<glm::vec3>& vertices, const Color color) :
 	Edge{vertices[0], vertices[1], color},
 	controlPoint_1{vertices[2]},
 	controlPoint_2{vertices[3]}
@@ -24,9 +24,9 @@
 	switch (property)
 	{
 	case Property::ControlPoint1:
-		return controlPoint_1;
+		return QVariant::fromValue(controlPoint_1);
 	case Property::ControlPoint2:
-		return controlPoint_2;
+		return QVariant::fromValue(controlPoint_2);
 	default:
 		return Edge::getProperty(property);
 	}
@@ -40,9 +40,9 @@
 	switch (property)
 	{
 	case Property::ControlPoint1:
-		controlPoint_1 = value.value<Point3D>();
+		controlPoint_1 = value.value<glm::vec3>();
 	case Property::ControlPoint2:
-		controlPoint_2 = value.value<Point3D>();
+		controlPoint_2 = value.value<glm::vec3>();
 	default:
 		return Edge::setProperty(property, value);
 	}
@@ -51,6 +51,6 @@
 QString linetypes::ConditionalEdge::textRepresentation() const
 {
 	return Edge::textRepresentation() + utility::format("%1 %2",
-		vertexToStringParens(controlPoint_1),
-		vertexToStringParens(controlPoint_2));
+		utility::vertexToStringParens(controlPoint_1),
+		utility::vertexToStringParens(controlPoint_2));
 }

mercurial