src/objecttypes/subfilereference.cpp

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

mercurial