#include <scenenode.h>
Public Types | |
enum | SCENENODE_TYPE { ASSEMBLY = 0, ROOT = 1, CAMERA = 2, GEOMETRY = 4, LIGHT = 8 } |
typedef std::list< NODE_ID > | NodeIDList |
Public Member Functions | |
SceneNode (const wxString &_uid, const wxString &_name, SCENENODE_TYPE _type) | |
Class constructor. | |
SceneNode (const SceneNode &n) | |
Copy constructor. | |
virtual | ~SceneNode () |
Class destructor. | |
const wxString & | GetUid () const |
Get uid. | |
const wxString & | GetName () const |
Get name. | |
NODE_ID | GetID () const |
Get ID. | |
const MATRIX * | GetLocalTransMatrix () const |
Get model space transofrmation matrix. | |
const MATRIX * | GetWorldTransMatrix () const |
const NodeIDList * | GetChildren () const |
Get children list. | |
NODE_ID | GetParent () const |
Get parent node. | |
bool | IsValid () const |
Is node's transformation updated? | |
bool | IsActive () const |
Is node active and should be drawn? | |
void | SetActive (const bool _active) |
Is node active and should be drawn? | |
SCENENODE_TYPE | GetType () const |
Get node type. | |
bool | IsOfType (SCENENODE_TYPE _type) const |
Is node of given type? | |
virtual wxString | ToString () const |
Get string with node's properties. | |
virtual SceneNode * | Clone () const |
Get copy of instance. | |
Private Attributes | |
wxString | uid |
Unique ID. | |
wxString | name |
Name. | |
NODE_ID | id |
ID. | |
SCENENODE_TYPE | type |
Node type. | |
MATRIX | localTransMatrix |
Local transformation matrix. | |
MATRIX | worldTransMatrix |
World transformation matrix. | |
bool | valid |
Is worldTransMatrix updated? | |
bool | active |
Is node active? | |
NodeIDList | children |
Children list. | |
NODE_ID | parent |
Parent node. | |
Friends | |
class | Scene |
Definition at line 26 of file scenenode.h.
typedef std::list<NODE_ID> VRUT::SceneNode::NodeIDList |
Definition at line 29 of file scenenode.h.
VRUT::SceneNode::SceneNode | ( | const wxString & | _uid, | |
const wxString & | _name, | |||
SCENENODE_TYPE | _type | |||
) | [inline] |
Class constructor.
Definition at line 67 of file scenenode.h.
00068 : uid(CloneWxString(_uid)), name(CloneWxString(_name)), type(_type) 00069 { 00070 wxASSERT_MSG(IsOk(), wxT("<SceneNode>Failed to create mutex")); 00071 active = true; 00072 valid = false; 00073 id = parent = NODE_ID_NONE; 00074 }
VRUT::SceneNode::SceneNode | ( | const SceneNode & | n | ) | [inline] |
Copy constructor.
Definition at line 77 of file scenenode.h.
00078 : ReadWriteMutex(), uid(CloneWxString(n.uid)), name(CloneWxString(n.name)), id(n.id), type(n.type), 00079 localTransMatrix(n.localTransMatrix), worldTransMatrix(n.worldTransMatrix), 00080 valid(n.valid), active(n.active), parent(n.parent) 00081 { 00082 children.assign(n.children.begin(), n.children.end()); 00083 }
virtual VRUT::SceneNode::~SceneNode | ( | ) | [inline, virtual] |
const wxString& VRUT::SceneNode::GetUid | ( | ) | const [inline] |
const wxString& VRUT::SceneNode::GetName | ( | ) | const [inline] |
NODE_ID VRUT::SceneNode::GetID | ( | ) | const [inline] |
const MATRIX* VRUT::SceneNode::GetLocalTransMatrix | ( | ) | const [inline] |
Get model space transofrmation matrix.
Definition at line 109 of file scenenode.h.
00110 { 00111 return &localTransMatrix; 00112 }
const MATRIX* VRUT::SceneNode::GetWorldTransMatrix | ( | ) | const [inline] |
Get world transofrmation matrix
Definition at line 116 of file scenenode.h.
00117 { 00118 if (!valid) 00119 LOGWARNING(wxT("<SceneNode>Getting invalid world transformation matrix - update first")); 00120 return &worldTransMatrix; 00121 }
const NodeIDList* VRUT::SceneNode::GetChildren | ( | ) | const [inline] |
Get children list.
Definition at line 124 of file scenenode.h.
00125 { 00126 return &children; 00127 }
NODE_ID VRUT::SceneNode::GetParent | ( | ) | const [inline] |
bool VRUT::SceneNode::IsValid | ( | ) | const [inline] |
Is node's transformation updated?
Definition at line 136 of file scenenode.h.
00137 { 00138 return valid; 00139 }
bool VRUT::SceneNode::IsActive | ( | ) | const [inline] |
Is node active and should be drawn?
Definition at line 142 of file scenenode.h.
00143 { 00144 return active; 00145 }
void VRUT::SceneNode::SetActive | ( | const bool | _active | ) | [inline] |
Is node active and should be drawn?
Definition at line 148 of file scenenode.h.
00149 { 00150 active=_active; 00151 }
SCENENODE_TYPE VRUT::SceneNode::GetType | ( | ) | const [inline] |
bool VRUT::SceneNode::IsOfType | ( | SCENENODE_TYPE | _type | ) | const [inline] |
Is node of given type?
Definition at line 160 of file scenenode.h.
00161 { 00162 return ( type == _type ); 00163 }
virtual wxString VRUT::SceneNode::ToString | ( | ) | const [inline, virtual] |
Get string with node's properties.
Reimplemented in VRUT::Camera, VRUT::GeometryNode, and VRUT::LightNode.
Definition at line 166 of file scenenode.h.
00167 { 00168 return wxString::Format(wxT("ID: %i\nName: %s\nType: %i\nLocal:\n%sWorld:\n%s"), 00169 unsigned(GetID()), 00170 GetName().c_str(), 00171 type, 00172 GetLocalTransMatrix()->ToString().c_str(), 00173 ( IsValid() ? GetWorldTransMatrix()->ToString().c_str() : wxT("invalid\n") )); 00174 }
virtual SceneNode* VRUT::SceneNode::Clone | ( | ) | const [inline, virtual] |
Get copy of instance.
Reimplemented in VRUT::Camera, VRUT::GeometryNode, and VRUT::LightNode.
Definition at line 176 of file scenenode.h.
00177 { 00178 return new SceneNode(*this); 00179 }
friend class Scene [friend] |
Reimplemented in VRUT::Camera, VRUT::GeometryNode, and VRUT::LightNode.
Definition at line 181 of file scenenode.h.
wxString VRUT::SceneNode::uid [private] |
wxString VRUT::SceneNode::name [private] |
NODE_ID VRUT::SceneNode::id [private] |
SCENENODE_TYPE VRUT::SceneNode::type [private] |
MATRIX VRUT::SceneNode::localTransMatrix [private] |
MATRIX VRUT::SceneNode::worldTransMatrix [private] |
bool VRUT::SceneNode::valid [private] |
bool VRUT::SceneNode::active [private] |
NodeIDList VRUT::SceneNode::children [private] |
NODE_ID VRUT::SceneNode::parent [private] |