6#include <Common/primitive_type.h>
7#include <Utility/TSpan.h>
8#include <SDL/sdl_interface.h>
9#include <Math/math_fwd.h>
10#include <Math/Transform/TDecomposedTransform.h>
11#include "Utility/TFunction.h"
61 virtual void editorRotate(
const math::QuaternionR& additionalRotation);
62 virtual void editorScale(
const math::Vector3R& amount);
70 template<
typename ChildType>
72 bool shouldInit =
true,
73 bool shouldSetToDefault =
true);
78 const SdlClass* clazz,
79 bool shouldInit =
true,
80 bool shouldSetToDefault =
true);
106 void setName(std::string name);
126 const std::string&
getName()
const;
152 virtual void selected();
156 virtual void deselected();
168 GeneralParent m_parent;
176 ClassType clazz(
"dobj");
177 clazz.docName(
"Designer Object");
178 clazz.description(
"Main base class of designer object.");
181 clazz.allowCreateFromClass(
false);
185 TSdlString<OwnerType> name(
"name", &OwnerType::m_name);
186 name.description(
"Name of the designer object.");
188 clazz.addField(name);
Definition AbstractDesignerObject.h:16
AbstractDesignerObject()
Definition AbstractDesignerObject.cpp:7
Definition DesignerObject.h:31
bool isVisible() const
Definition DesignerObject.ipp:40
virtual void renderUpdate(const MainThreadRenderUpdateContext &ctx)
Definition DesignerObject.cpp:98
virtual void update(const MainThreadUpdateContext &ctx)
Definition DesignerObject.cpp:95
DesignerObject()
Definition DesignerObject.cpp:48
UIPropertyLayout layoutProperties() override
Create custom property layout.
Definition DesignerObject.cpp:128
void setRenderTick(bool shouldTick)
Definition DesignerObject.cpp:282
DesignerObject(const DesignerObject &other)
bool isSelected() const
Definition DesignerObject.ipp:35
~DesignerObject() override
Definition DesignerObject.cpp:60
void setTick(bool shouldTick)
Definition DesignerObject.cpp:277
void select()
Definition DesignerObject.cpp:256
DesignerObject(DesignerObject &&other) noexcept
virtual void renderUninit(RenderThreadCaller &caller)
Definition DesignerObject.cpp:90
DesignerScene & getScene()
Definition DesignerObject.cpp:287
DesignerObject * getParent()
Definition DesignerObject.cpp:309
void deleteChild(DesignerObject *childObj)
Remove, uninitialize and destruct a child.
Definition DesignerObject.cpp:193
virtual void renderInit(RenderThreadCaller &caller)
Definition DesignerObject.cpp:85
ChildType * newChild(bool shouldInit=true, bool shouldSetToDefault=true)
Create and add the new object as a child.
Definition DesignerObject.ipp:14
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< DesignerObject >)
Definition DesignerObject.h:174
virtual void uninit()
Definition DesignerObject.cpp:80
virtual void createRenderCommands(RenderThreadCaller &caller)
Definition DesignerObject.cpp:101
virtual void init()
Definition DesignerObject.cpp:75
void enqueueRenderWork(RenderWorkType work)
Add a render thread work for this object. This method is intended for piecemeal (better to be indepen...
Definition DesignerObject.cpp:233
virtual void editorTranslate(const math::Vector3R &amount)
Definition DesignerObject.cpp:104
bool haveChildren() const
Definition DesignerObject.ipp:71
virtual bool canHaveChildren() const =0
virtual void setLocalToParent(const math::TDecomposedTransform< real > &transform)=0
void deleteAllChildren()
Remove, uninitialize and destruct all children.
Definition DesignerObject.cpp:219
TFunction< void(render::System &)> RenderWorkType
Definition DesignerObject.h:36
void setName(std::string name)
Set name of the object. name should be unique in the scene. If not, the name will be modified automat...
Definition DesignerObject.cpp:238
void setVisibility(bool isVisible)
Definition DesignerObject.cpp:272
void setUniqueName(std::string uniqueName)
Set a unique name to the object.
Definition DesignerObject.cpp:248
static std::string generateObjectName()
Definition DesignerObject.cpp:32
virtual math::TDecomposedTransform< real > getLocalToParent() const =0
const std::string & getName() const
Definition DesignerObject.ipp:66
virtual void editorScale(const math::Vector3R &amount)
Definition DesignerObject.cpp:120
virtual TSpanView< DesignerObject * > getChildren() const =0
DesignerObject & operator=(const DesignerObject &rhs)
virtual void editorRotate(const math::QuaternionR &additionalRotation)
Definition DesignerObject.cpp:112
DesignerObject * addNewChild(DesignerObject *childObj)
Add the object as a child. This method allows an object to be created separately then added to this o...
Definition DesignerObject.cpp:166
void deselect()
Definition DesignerObject.cpp:264
Definition DesignerScene.h:58
Definition MainThreadRenderUpdateContext.h:11
Definition MainThreadUpdateContext.h:11
Thin wrapper for render thread interactions from another thread. Mainly to hide unrelated render thre...
Definition RenderThreadCaller.h:16
Definition UIPropertyLayout.h:17
Definition DesignerObject.h:19
Definition ph_editor.h:10