src/linetypes/object.cpp

changeset 35
98906a94732f
parent 21
0133e565e072
child 46
98645c8e7704
equal deleted inserted replaced
34:1de2b8d64e9f 35:98906a94732f
7 static unsigned int id = 0; 7 static unsigned int id = 0;
8 id += 1; 8 id += 1;
9 return id; 9 return id;
10 } 10 }
11 11
12 linetypes::Object::Object() : 12 ldraw::Object::Object() :
13 id {getIdForNewObject()} 13 id {getIdForNewObject()}
14 { 14 {
15 } 15 }
16 16
17 linetypes::Object::~Object() 17 ldraw::Object::~Object()
18 { 18 {
19 } 19 }
20 20
21 bool linetypes::Object::hasColor() const 21 bool ldraw::Object::hasColor() const
22 { 22 {
23 return false; 23 return false;
24 } 24 }
25 25
26 QVariant linetypes::Object::getProperty(Property id) const 26 QVariant ldraw::Object::getProperty(Property id) const
27 { 27 {
28 Q_UNUSED(id); 28 Q_UNUSED(id);
29 return {}; 29 return {};
30 } 30 }
31 31
32 auto linetypes::Object::setProperty(Property id, const QVariant& value) 32 auto ldraw::Object::setProperty(Property id, const QVariant& value)
33 -> SetPropertyResult 33 -> SetPropertyResult
34 { 34 {
35 Q_UNUSED(id) 35 Q_UNUSED(id)
36 Q_UNUSED(value) 36 Q_UNUSED(value)
37 return SetPropertyResult::PropertyNotHandled; 37 return SetPropertyResult::PropertyNotHandled;
38 } 38 }
39 39
40 QBrush linetypes::Object::textRepresentationForeground() const 40 QBrush ldraw::Object::textRepresentationForeground() const
41 { 41 {
42 return {}; 42 return {};
43 } 43 }
44 44
45 QBrush linetypes::Object::textRepresentationBackground() const 45 QBrush ldraw::Object::textRepresentationBackground() const
46 { 46 {
47 return {}; 47 return {};
48 } 48 }
49 49
50 QFont linetypes::Object::textRepresentationFont() const 50 QFont ldraw::Object::textRepresentationFont() const
51 { 51 {
52 return {}; 52 return {};
53 } 53 }
54 54
55 void linetypes::Object::getPolygons(std::vector<gl::Polygon>& polygons, GetPolygonsContext* context) const 55 void ldraw::Object::getPolygons(std::vector<gl::Polygon>& polygons, GetPolygonsContext* context) const
56 { 56 {
57 Q_UNUSED(polygons) 57 Q_UNUSED(polygons)
58 Q_UNUSED(context) 58 Q_UNUSED(context)
59 } 59 }
60 60
61 linetypes::ColoredObject::ColoredObject(const Color color_index) : 61 ldraw::ColoredObject::ColoredObject(const Color color_index) :
62 colorIndex{color_index} 62 colorIndex{color_index}
63 { 63 {
64 } 64 }
65 65
66 bool linetypes::ColoredObject::hasColor() const 66 bool ldraw::ColoredObject::hasColor() const
67 { 67 {
68 return true; 68 return true;
69 } 69 }
70 70
71 QVariant linetypes::ColoredObject::getProperty(Property id) const 71 QVariant ldraw::ColoredObject::getProperty(Property id) const
72 { 72 {
73 switch (id) 73 switch (id)
74 { 74 {
75 case Property::Color: 75 case Property::Color:
76 return colorIndex.index; 76 return colorIndex.index;
77 default: 77 default:
78 return Object::getProperty(id); 78 return Object::getProperty(id);
79 } 79 }
80 } 80 }
81 81
82 auto linetypes::ColoredObject::setProperty(Property id, const QVariant& value) 82 auto ldraw::ColoredObject::setProperty(Property id, const QVariant& value)
83 -> SetPropertyResult 83 -> SetPropertyResult
84 { 84 {
85 switch (id) 85 switch (id)
86 { 86 {
87 case Property::Color: 87 case Property::Color:
101 default: 101 default:
102 return Object::setProperty(id, value); 102 return Object::setProperty(id, value);
103 } 103 }
104 } 104 }
105 105
106 QString linetypes::Empty::textRepresentation() const 106 QString ldraw::Empty::textRepresentation() const
107 { 107 {
108 return ""; 108 return "";
109 } 109 }

mercurial