|
WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
|
Base class for all scene-graph nodes in the component hierarchy. More...
#include <Component.h>
Public Member Functions | |
| Component () | |
| virtual | ~Component () |
| virtual bool | addChild (Component *) |
| Add a child component to this node. | |
| virtual bool | removeChild (Component *) |
| Remove a child component from this node. | |
| virtual void | removeAllChildren () |
| virtual unsigned int | nbChildren () const |
| virtual bool | findChildComponent (Component *, bool) |
| virtual Component * | getChild (unsigned int) |
| virtual const Component * | getChild (unsigned int) const |
| void | setParentComponent (Component *) |
| Set the parent of this component. | |
| virtual void | onParentSet (Component *) |
| Called after the parent has been set; override for custom logic. | |
| const Component * | parent () const |
| Get the parent component (const). | |
| Component * | parent () |
| Get the parent component. | |
| template<class DataType > | |
| const DataType * | firstParentOfType () |
| Walk up the parent chain and return the first ancestor of the given type. | |
| void | ref () |
| Increment the reference counter. | |
| void | unref () |
| Decrement the reference counter; deletes this when it reaches zero. | |
| void | setName (const std::string &name) |
| std::string | name () const |
| virtual void | onNameChanged () |
| void | print (int l_depth=0) |
| virtual void | doPrint () |
| void | copy (const Component &component, bool) |
Private Attributes | |
| Component * | m_p_parent |
| unsigned int | m_refCounter |
| std::string | m_name |
Base class for all scene-graph nodes in the component hierarchy.
Supports parent–child relationships, reference counting, and naming. Derived classes (Container, GameFile, WoWItem, etc.) extend this to form the application's object graph.
Definition at line 10 of file Component.h.
| Component::Component | ( | ) |
Definition at line 5 of file Component.cpp.
|
virtualdefault |
|
virtual |
Add a child component to this node.
Definition at line 12 of file Component.cpp.
| void Component::copy | ( | const Component & | component, |
| bool | |||
| ) |
Definition at line 92 of file Component.cpp.
|
virtual |
|
inlinevirtual |
Reimplemented in Container< DataType >, Container< GameFile >, Container< LogOutput >, and Container< WoWItem >.
Definition at line 28 of file Component.h.
| const DataType * Component::firstParentOfType | ( | ) |
Walk up the parent chain and return the first ancestor of the given type.
| DataType | The type to search for (must be a Component subclass). |
Definition at line 78 of file Component.h.
|
inlinevirtual |
Reimplemented in Container< DataType >, Container< GameFile >, Container< LogOutput >, and Container< WoWItem >.
Definition at line 29 of file Component.h.
|
inlinevirtual |
Reimplemented in Container< DataType >, Container< GameFile >, Container< LogOutput >, and Container< WoWItem >.
Definition at line 30 of file Component.h.
| std::string Component::name | ( | ) | const |
|
inlinevirtual |
Reimplemented in Container< DataType >, Container< GameFile >, Container< LogOutput >, and Container< WoWItem >.
Definition at line 26 of file Component.h.
|
virtual |
|
virtual |
Called after the parent has been set; override for custom logic.
Reimplemented in WoWItem.
Definition at line 36 of file Component.cpp.
|
inline |
Get the parent component.
Definition at line 42 of file Component.h.
|
inline |
Get the parent component (const).
Definition at line 39 of file Component.h.
| void Component::print | ( | int | l_depth = 0 | ) |
Definition at line 61 of file Component.cpp.
| void Component::ref | ( | ) |
Increment the reference counter.
Definition at line 22 of file Component.cpp.
|
inlinevirtual |
Reimplemented in Container< DataType >, Container< GameFile >, Container< LogOutput >, and Container< WoWItem >.
Definition at line 22 of file Component.h.
|
virtual |
Remove a child component from this node.
Definition at line 17 of file Component.cpp.
| void Component::setName | ( | const std::string & | name | ) |
Definition at line 46 of file Component.cpp.
| void Component::setParentComponent | ( | Component * | a_p_parent | ) |
Set the parent of this component.
Definition at line 40 of file Component.cpp.
| void Component::unref | ( | ) |
Decrement the reference counter; deletes this when it reaches zero.
Definition at line 27 of file Component.cpp.
|
private |
Definition at line 74 of file Component.h.
|
private |
Definition at line 70 of file Component.h.
|
private |
Definition at line 72 of file Component.h.