src/objecttypes/subfilereference.cpp

changeset 8
44679e468ba9
parent 6
73e448b2943d
child 13
6e838748867b
equal deleted inserted replaced
7:68443f5be176 8:44679e468ba9
1 #include "subfilereference.h" 1 #include "subfilereference.h"
2
3 modelobjects::SubfileReference::SubfileReference(
4 const Vertex& position,
5 const Matrix3x3& transformation,
6 const QString& referenceName,
7 const Color color) :
8 ColoredBaseObject{color},
9 position{position},
10 transformation{transformation},
11 referenceName{referenceName}
12 {
13 }
2 14
3 QVariant modelobjects::SubfileReference::getProperty(Property property) const 15 QVariant modelobjects::SubfileReference::getProperty(Property property) const
4 { 16 {
5 switch (property) 17 switch (property)
6 { 18 {
13 default: 25 default:
14 return ColoredBaseObject::getProperty(property); 26 return ColoredBaseObject::getProperty(property);
15 } 27 }
16 } 28 }
17 29
30 auto modelobjects::SubfileReference::setProperty(
31 Property property,
32 const QVariant& value)
33 -> SetPropertyResult
34 {
35 switch (property)
36 {
37 case Property::Position:
38 this->position = value.value<Vertex>();
39 return SetPropertyResult::Success;
40 case Property::Transformation:
41 this->transformation = value.value<Matrix3x3>();
42 return SetPropertyResult::Success;
43 case Property::ReferenceName:
44 this->referenceName = value.toString();
45 return SetPropertyResult::Success;
46 default:
47 return ColoredBaseObject::setProperty(property, value);
48 }
49 }
50
18 QString modelobjects::SubfileReference::textRepresentation() const 51 QString modelobjects::SubfileReference::textRepresentation() const
19 { 52 {
20 return referenceName + " " + vertexToStringParens(this->position); 53 return referenceName + " " + vertexToStringParens(this->position);
21 } 54 }

mercurial