src/modeleditcontext.h

Sun, 19 Jan 2020 02:54:48 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 19 Jan 2020 02:54:48 +0200
changeset 22
6da867fa5429
parent 14
20d2ed3af73d
child 24
1a0faaaceb84
permissions
-rw-r--r--

commit work on GL rendering

#pragma once
#include "model.h"
#include "linetypes/object.h"

class Model::EditContext
{
public:
	template<typename T, typename... Args>
	T* append(Args&&... args);
	void append(std::unique_ptr<linetypes::Object>&& object);
	template<typename T, typename... Args>
	T* insert(int position, Args&&... args);
	void setObjectProperty(
		linetypes::Object* object,
		linetypes::Property property,
		const QVariant &value);
private:
	EditContext(Model& model);
	friend class Model;
	Model& model;
};

template<typename T, typename... Args>
T* Model::EditContext::append(Args&&... args)
{
	return this->model.append<T>(args...);
}

template<typename T, typename... Args>
T* Model::EditContext::insert(int position, Args&&... args)
{
	return this->model.insert<T>(position, args...);
}

mercurial