69 using PropertyType = typename PropertyTraits<property>::type; |
69 using PropertyType = typename PropertyTraits<property>::type; |
70 |
70 |
71 template<ldraw::Property property> |
71 template<ldraw::Property property> |
72 inline const char* PROPERTY_NAME = PropertyTraits<property>::name; |
72 inline const char* PROPERTY_NAME = PropertyTraits<property>::name; |
73 |
73 |
|
74 constexpr int MAX_POINTS = 4; |
|
75 |
74 struct PropertyKeyValue |
76 struct PropertyKeyValue |
75 { |
77 { |
76 Property key; |
78 Property key; |
77 QVariant value; |
79 QVariant value; |
78 }; |
80 }; |
79 |
81 |
80 constexpr Property pointProperty(int n) |
82 constexpr Property pointProperty(int n) |
81 { |
83 { |
82 Q_ASSERT(n >= 0 and n < 4); |
84 Q_ASSERT(n >= 0 and n < MAX_POINTS); |
83 return static_cast<Property>(static_cast<int>(Property::Point0) + n); |
85 return static_cast<Property>(static_cast<int>(Property::Point0) + n); |
84 } |
86 } |
85 |
87 |
86 struct PropertyTrait |
88 struct PropertyTrait |
87 { |
89 { |