src/linetypes/conditionaledge.cpp

changeset 86
4bec0525ef1b
parent 81
62373840e33a
child 87
93ec4d630346
--- a/src/linetypes/conditionaledge.cpp	Wed Mar 18 17:11:23 2020 +0200
+++ b/src/linetypes/conditionaledge.cpp	Thu Mar 19 21:06:06 2020 +0200
@@ -23,29 +23,20 @@
 {
 	switch (property)
 	{
-	case Property::ControlPoint1:
+	case Property::ControlPoint0:
 		return QVariant::fromValue(controlPoint_1);
-	case Property::ControlPoint2:
+	case Property::ControlPoint1:
 		return QVariant::fromValue(controlPoint_2);
 	default:
 		return Edge::getProperty(property);
 	}
 }
 
-auto ldraw::ConditionalEdge::setProperty(
-	Property property,
-	const QVariant& value)
-	-> SetPropertyResult
+void ldraw::ConditionalEdge::setProperty(SetPropertyResult* result, const PropertyKeyValue& pair)
 {
-	switch (property)
-	{
-	case Property::ControlPoint1:
-		controlPoint_1 = value.value<glm::vec3>();
-	case Property::ControlPoint2:
-		controlPoint_2 = value.value<glm::vec3>();
-	default:
-		return Edge::setProperty(property, value);
-	}
+	LDRAW_OBJECT_HANDLE_SET_PROPERTY(ControlPoint0, {this->controlPoint_1 = value;})
+	LDRAW_OBJECT_HANDLE_SET_PROPERTY(ControlPoint1, {this->controlPoint_2 = value;})
+	BaseClass::setProperty(result, pair);
 }
 
 QString ldraw::ConditionalEdge::textRepresentation() const

mercurial