32#ifndef DVD_SGN_EDITOR_COMPONENT_H_
33#define DVD_SGN_EDITOR_COMPONENT_H_
48 class EditorComponentEditor;
49 class EditorComponentSceneGraphNode;
152 void get(T& dataOut)
const;
155 void set(
const T& dataIn);
159 [[nodiscard]]
bool isMatrix() const noexcept;
177 registerField(
MOV(field));
194 void saveToXML(boost::property_tree::ptree& pt)
const;
195 void loadFromXML(
const boost::property_tree::ptree& pt);
197 bool saveCache(
ByteBuffer& outputBuffer)
const;
static void onChanged(const EditorComponent &comp, const EditorComponentField &field)
static const vector< EditorComponentField > & fields(const EditorComponent &comp) noexcept
static vector< EditorComponentField > & fields(EditorComponent &comp) noexcept
static bool loadCache(EditorComponent &comp, ByteBuffer &inputBuffer)
static void loadFromXML(EditorComponent &comp, const boost::property_tree::ptree &pt)
static bool saveCache(const EditorComponent &comp, ByteBuffer &outputBuffer)
static void saveToXML(const EditorComponent &comp, boost::property_tree::ptree &pt)
void onChangedCbk(const DELEGATE< void, std::string_view > &cbk)
PROPERTY_R(ComponentType, componentType, ComponentType::COUNT)
void saveToXML(boost::property_tree::ptree &pt) const
void loadFromXML(const boost::property_tree::ptree &pt)
const vector< EditorComponentField > & fields() const noexcept
void addHeader(const Str< 32 > &name)
void onChangedCbk(DELEGATE< void, std::string_view > &&cbk) noexcept
bool loadCache(ByteBuffer &inputBuffer)
bool saveCache(ByteBuffer &outputBuffer) const
vector< EditorComponentField > _fields
DELEGATE< void, std::string_view > _onChangedCbk
void onChanged(const EditorComponentField &field) const
vector< EditorComponentField > & fields() noexcept
PROPERTY_RW(Str< 128 >, name, "")
Utility class that adds basic GUID management to objects.
static const char * componentType[]
ComponentType StringToComponentType(const std::string_view name)
const char * ComponentTypeToString(const ComponentType compType) noexcept
Handle console commands that start with a forward slash.
DELEGATE_STD< Ret, Args... > DELEGATE
std::function< Ret(Args...) > DELEGATE_STD
eastl::vector< Type > vector
@ DROPDOWN_TYPE
Only U8 types supported!
constexpr T toBit(const T X)
Converts an arbitrary positive integer value to a bitwise value used for masks.
constexpr auto to_base(const Type value) -> Type
void set(const T &dataIn)
DELEGATE_STD< void, void * > _dataGetter
DELEGATE_STD< void, const void * > _dataSetter
vec2< F32 > _range
Used by slider_type as a min / max range or dropdown as selected_index / count.
F32 _step
0.0f == no +- buttons
DELEGATE_STD< const char *, U8 > _displayNameGetter
PushConstantType _basicType
bool isMatrix() const noexcept
PushConstantSize _basicTypeSize
const char *const * _labels
bool supportsByteCount() const noexcept
EditorComponentFieldType _type
const char * getDisplayName(const U8 index) const