Класс сцены

This commit is contained in:
2023-10-17 02:17:33 +03:00
committed by re.kovalev
parent 9142518494
commit d1ec60c285
2 changed files with 115 additions and 0 deletions

32
include/Scene.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef SCENE_H
#define SCENE_H
#include <list>
#include "Model.h"
// Класс сцены
class Scene
{
public:
Scene(); // Конструктор пустой сцены
Scene(const Scene &copy); // Конструктор копирования
Scene& operator=(const Scene& other); // Оператор присваивания
void render(); // Рендер сцены
Node root; // Корневой узел
// Списки объектов, выступающих узлами
std::list<Node> nodes; // Список пустых узлов
std::list<Model> models; // Список моделей для рендера
protected:
void rebuld_tree(const Scene& from); // Перестройка дерева после копирования или присваивания
template <class T>
void rebuild_Nodes_list(T& nodes, const Scene& from); // Перестройка узлов выбранного списка
template <class T>
void move_parent(Node& for_node, const std::list<T>& from_nodes, std::list<T>& this_nodes); // Сдвигает родителя узла между двумя списками при условии его принадлежности к оригинальному
};
#endif // SCENE_H