stuff-from-scratch/src/visual_elements/SceneItem.h
2022-11-16 17:00:55 +00:00

56 lines
860 B
C++

#pragma once
#include "Color.h"
#include "Transform.h"
#include <string>
class SceneItem
{
public:
enum class Type
{
UNSET,
MODEL,
TEXT
};
SceneItem();
virtual ~SceneItem() = default;
const Color& getColor() const;
const Transform& getTransform() const;
virtual Type getType() const = 0;
bool isVisible() const;
void setIsVisible(bool isVisible);
void updateUniformColor(const Color& color);
void updateTransform(const Transform& transform);
void setName(const std::string& name)
{
mName = name;
}
const std::string& getName() const
{
return mName;
}
protected:
Transform mTransform;
Color mUniformColor;
bool mColorIsDirty{true};
bool mTransformIsDirty{true};
bool mIsVisible{true};
std::string mName;
};