src/linetypes/conditionaledge.cpp

changeset 86
4bec0525ef1b
parent 81
62373840e33a
child 87
93ec4d630346
equal deleted inserted replaced
85:40e2940605a3 86:4bec0525ef1b
21 21
22 QVariant ldraw::ConditionalEdge::getProperty(Property property) const 22 QVariant ldraw::ConditionalEdge::getProperty(Property property) const
23 { 23 {
24 switch (property) 24 switch (property)
25 { 25 {
26 case Property::ControlPoint0:
27 return QVariant::fromValue(controlPoint_1);
26 case Property::ControlPoint1: 28 case Property::ControlPoint1:
27 return QVariant::fromValue(controlPoint_1);
28 case Property::ControlPoint2:
29 return QVariant::fromValue(controlPoint_2); 29 return QVariant::fromValue(controlPoint_2);
30 default: 30 default:
31 return Edge::getProperty(property); 31 return Edge::getProperty(property);
32 } 32 }
33 } 33 }
34 34
35 auto ldraw::ConditionalEdge::setProperty( 35 void ldraw::ConditionalEdge::setProperty(SetPropertyResult* result, const PropertyKeyValue& pair)
36 Property property,
37 const QVariant& value)
38 -> SetPropertyResult
39 { 36 {
40 switch (property) 37 LDRAW_OBJECT_HANDLE_SET_PROPERTY(ControlPoint0, {this->controlPoint_1 = value;})
41 { 38 LDRAW_OBJECT_HANDLE_SET_PROPERTY(ControlPoint1, {this->controlPoint_2 = value;})
42 case Property::ControlPoint1: 39 BaseClass::setProperty(result, pair);
43 controlPoint_1 = value.value<glm::vec3>();
44 case Property::ControlPoint2:
45 controlPoint_2 = value.value<glm::vec3>();
46 default:
47 return Edge::setProperty(property, value);
48 }
49 } 40 }
50 41
51 QString ldraw::ConditionalEdge::textRepresentation() const 42 QString ldraw::ConditionalEdge::textRepresentation() const
52 { 43 {
53 return Edge::textRepresentation() + utility::format("%1 %2", 44 return Edge::textRepresentation() + utility::format("%1 %2",

mercurial