src/linetypes/edge.cpp

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

mercurial