47 template <
class DataType>
58 std::string
name()
const;
62 void print(
int l_depth = 0);
77template <
class DataType>
82 DataType* l_p_parent =
dynamic_cast<DataType*
>(
parent());
83 if (l_p_parent !=
nullptr)
Base class for all scene-graph nodes in the component hierarchy.
void unref()
Decrement the reference counter; deletes this when it reaches zero.
virtual void removeAllChildren()
void print(int l_depth=0)
const Component * parent() const
Get the parent component (const).
void ref()
Increment the reference counter.
virtual void onNameChanged()
virtual unsigned int nbChildren() const
virtual const Component * getChild(unsigned int) const
void setName(const std::string &name)
Component * parent()
Get the parent component.
unsigned int m_refCounter
virtual void onParentSet(Component *)
Called after the parent has been set; override for custom logic.
void setParentComponent(Component *)
Set the parent of this component.
void copy(const Component &component, bool)
virtual Component * getChild(unsigned int)
virtual bool findChildComponent(Component *, bool)
virtual bool addChild(Component *)
Add a child component to this node.
virtual bool removeChild(Component *)
Remove a child component from this node.
const DataType * firstParentOfType()
Walk up the parent chain and return the first ancestor of the given type.