56 lines
860 B
C++
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;
|
|
};
|