src/ui/objecteditor.cpp

changeset 232
8efa3a33172e
parent 200
ca23936b455b
child 249
37d3c819cafa
equal deleted inserted replaced
231:a9bf6bab5ea2 232:8efa3a33172e
10 10
11 using PropertyValue = std::variant< 11 using PropertyValue = std::variant<
12 const glm::vec3*, 12 const glm::vec3*,
13 const glm::mat4*, 13 const glm::mat4*,
14 const QString*, 14 const QString*,
15 ldraw::Color>; 15 ldraw::Color,
16 const CircularFraction*>;
16 17
17 enum PropertyKey 18 enum PropertyKey
18 { 19 {
19 Point1, 20 Point1,
20 Point2, 21 Point2,
25 Color, 26 Color,
26 Transformation, 27 Transformation,
27 Name, 28 Name,
28 Text, 29 Text,
29 Code, 30 Code,
31 Fraction,
30 }; 32 };
31 33
32 std::map<PropertyKey, PropertyValue> getProperties(const ModelElement& element) 34 std::map<PropertyKey, PropertyValue> getProperties(const ModelElement& element)
33 { 35 {
34 std::map<PropertyKey, PropertyValue> result; 36 std::map<PropertyKey, PropertyValue> result;
61 [&](const Colored<SubfileReference>& ref) { 63 [&](const Colored<SubfileReference>& ref) {
62 result[Transformation] = &ref.transformation; 64 result[Transformation] = &ref.transformation;
63 result[Name] = &ref.name; 65 result[Name] = &ref.name;
64 result[Color] = ref.color; 66 result[Color] = ref.color;
65 }, 67 },
68 [&](const Colored<CircularPrimitive>& circ) {
69 result[Transformation] = &circ.transformation;
70 result[Fraction] = &circ.fraction;
71 result[Color] = circ.color;
72 },
66 [&](Empty) {}, 73 [&](Empty) {},
67 [&](const Comment& comment) { 74 [&](const Comment& comment) {
68 result[Text] = &comment.text; 75 result[Text] = &comment.text;
69 }, 76 },
70 [&](const ParseError& parseError) { 77 [&](const ParseError& parseError) {

mercurial