1 #pragma once |
|
2 #include "object.h" |
|
3 |
|
4 class Model; |
|
5 |
|
6 namespace ldraw |
|
7 { |
|
8 class CompoundObject; |
|
9 } |
|
10 |
|
11 /** |
|
12 * @brief An abstract object that has a transformation mmatrix and can be inverted. |
|
13 * It can be inlined into multiple objects. |
|
14 */ |
|
15 class ldraw::CompoundObject : public ColoredObject |
|
16 { |
|
17 public: |
|
18 CompoundObject() = default; |
|
19 CompoundObject( |
|
20 const glm::mat4& transformation, |
|
21 const Color color = ldraw::MAIN_COLOR); |
|
22 QVariant getProperty(Property property) const override; |
|
23 glm::vec3 position() const; |
|
24 void invert(GetPolygonsContext*context) override; |
|
25 Model* resolve(const ModelId callingModelId, DocumentManager* documents) const; |
|
26 QDataStream& serialize(QDataStream& stream) const override; |
|
27 QDataStream& deserialize(QDataStream& stream) override; |
|
28 std::optional<Axis> flatDimension(GetPolygonsContext *context) const; |
|
29 glm::mat4 transformation; |
|
30 QString transformToBareString() const; |
|
31 bool isInverted = false; |
|
32 protected: |
|
33 void setProperty(SetPropertyResult* result, const PropertyKeyValue& pair) override; |
|
34 }; |
|