diff -r cef43609a374 -r 0133e565e072 src/model.h --- a/src/model.h Sat Dec 14 23:00:01 2019 +0200 +++ b/src/model.h Wed Jan 01 17:45:56 2020 +0200 @@ -4,6 +4,7 @@ #include "main.h" #include "header.h" #include "linetypes/object.h" +#include "gl/common.h" enum class HeaderProperty { @@ -15,7 +16,7 @@ Q_OBJECT public: class EditContext; - Model(); + Model(QObject* parent = nullptr); Model(const Model&) = delete; int size() const; EditContext edit(); @@ -24,6 +25,8 @@ QVariant getHeaderProperty(const HeaderProperty property); const QString& getName() const; QVariant getObjectProperty(const int index, const linetypes::Property property) const; + std::vector getPolygons(class DocumentManager* documents) const; + void getObjectPolygons(const int index, std::vector& polygons_out, linetypes::GetPolygonsContext* context) const; signals: void objectAdded(linetypes::Id id, int position); private: @@ -38,6 +41,8 @@ LDHeader header; std::vector body; std::map objectsById; + mutable std::vector cachedPolygons; + mutable bool needRecache = true; }; template