diff -r 40e2940605a3 -r 4bec0525ef1b src/modeleditcontext.h --- a/src/modeleditcontext.h Wed Mar 18 17:11:23 2020 +0200 +++ b/src/modeleditcontext.h Thu Mar 19 21:06:06 2020 +0200 @@ -25,21 +25,30 @@ class Model::EditContext { public: + ~EditContext(); template ldraw::Id append(Args&&... args); ldraw::id_t append(std::unique_ptr&& object); template ldraw::Id insert(int position, Args&&... args); void remove(int position); - void setObjectProperty( - ldraw::id_t object, - ldraw::Property property, - const QVariant &value); + template + void setObjectProperty(ldraw::id_t id, const ldraw::PropertyType_t& value) + { + ldraw::Object* object = this->model().objectAt(id); + if (object != nullptr) + { + object->setProperty(value); + modifiedObjects.insert(id); + } + } + void setObjectPoint(ldraw::id_t id, int pointId, const glm::vec3& value); void invertObject(ldraw::id_t id); Model& model(); private: EditContext(Model& model); friend class Model; + QSet modifiedObjects; Model& storedModel; };