Sun, 19 Jan 2020 02:54:48 +0200
commit work on GL rendering
3 | 1 | #pragma once |
2 | #include "model.h" | |
14 | 3 | #include "linetypes/object.h" |
3 | 4 | |
5 | class Model::EditContext | |
6 | { | |
7 | public: | |
8 | template<typename T, typename... Args> | |
5 | 9 | T* append(Args&&... args); |
13 | 10 | void append(std::unique_ptr<linetypes::Object>&& object); |
3 | 11 | template<typename T, typename... Args> |
5 | 12 | T* insert(int position, Args&&... args); |
3 | 13 | void setObjectProperty( |
13 | 14 | linetypes::Object* object, |
15 | linetypes::Property property, | |
3 | 16 | const QVariant &value); |
17 | private: | |
18 | EditContext(Model& model); | |
19 | friend class Model; | |
20 | Model& model; | |
21 | }; | |
22 | ||
23 | template<typename T, typename... Args> | |
5 | 24 | T* Model::EditContext::append(Args&&... args) |
3 | 25 | { |
26 | return this->model.append<T>(args...); | |
27 | } | |
28 | ||
29 | template<typename T, typename... Args> | |
5 | 30 | T* Model::EditContext::insert(int position, Args&&... args) |
3 | 31 | { |
32 | return this->model.insert<T>(position, args...); | |
33 | } |