stuff-from-scratch/src/visual_elements/Scene.h

44 lines
816 B
C
Raw Normal View History

2022-11-14 11:19:51 +00:00
#pragma once
2022-11-15 15:50:36 +00:00
#include "TextData.h"
2022-11-14 11:19:51 +00:00
#include <vector>
2022-11-14 13:07:11 +00:00
#include <memory>
2022-11-14 11:19:51 +00:00
class VisualLayer;
2022-11-14 13:07:11 +00:00
class TriMesh;
2022-11-15 09:32:28 +00:00
class FontsManager;
2022-11-14 13:07:11 +00:00
class RectangleNode;
template <typename T>
class Image;
2022-11-14 11:19:51 +00:00
class Scene
{
public:
2022-11-15 15:50:36 +00:00
2022-11-14 11:19:51 +00:00
Scene() = default;
2022-11-14 13:07:11 +00:00
void syncLayers(const std::vector<VisualLayer*>& layers);
2022-11-15 09:32:28 +00:00
void update(FontsManager* fontsManager, Image<unsigned char>* image = nullptr);
2022-11-14 13:07:11 +00:00
unsigned getNumMeshes() const;
TriMesh* getMesh(std::size_t idx) const;
2022-11-14 11:19:51 +00:00
2022-11-15 09:32:28 +00:00
Image<unsigned char>* getTexture(std::size_t idx) const;
2022-11-15 15:50:36 +00:00
const std::vector<TextData>& getTextData() const;
2022-11-14 13:07:11 +00:00
2022-11-15 15:50:36 +00:00
private:
2022-11-14 13:07:11 +00:00
void processRectangleNode(RectangleNode* node);
2022-11-14 11:19:51 +00:00
std::vector<VisualLayer*> mLayers;
2022-11-15 15:50:36 +00:00
std::vector<TriMesh*> mWorkingMeshs;
2022-11-15 09:32:28 +00:00
std::vector<Image<unsigned char>* > mTextures;
2022-11-15 15:50:36 +00:00
std::vector<TextData> mTextData;
2022-11-14 11:19:51 +00:00
};