igor::iNode Class Reference

#include <iNode.h>

Inherited by igor::iNodeAudioListener, igor::iNodeAudioSource, igor::iNodeCamera, igor::iNodeEmitter, igor::iNodeLODSwitch, igor::iNodeLODTrigger, igor::iNodeLight, igor::iNodeModel, igor::iNodeRender, igor::iNodeSwitch, and igor::iNodeTransform.

Public Member Functions

iNodeKind getKind () const
 
iNodeType getType () const
 
iNodeID getID () const
 
const iaStringgetName () const
 
virtual std::vector< iaStringgetInfo (bool brief=false) const
 
void setName (const iaString &name)
 
void insertNode (iNodePtr node)
 
void insertNodeAsync (iNodePtr node)
 
void setActive (bool active=true)
 
void setActiveAsync (bool active=true)
 
void removeNode (iNodePtr node)
 
void removeNodeAsync (iNodePtr node)
 
bool isChild ()
 
bool isChild (iNodePtr child)
 
bool hasChildren ()
 
const std::vector< iNodePtr > & getChildren () const
 
void getAllChildren (std::vector< iNodePtr > &children) const
 
iNodePtr getChild (const iaString &name)
 
iNodePtr getChild (iNodeID id)
 
const std::vector< iNodePtr > & getInactiveChildren () const
 
iNodePtr getParent ()
 
iScenePtr getScene ()
 
bool isTransformationDirty ()
 
void setTransformationDirty (bool dirty=true)
 
void calcWorldTransformation (iaMatrixd &matrix)
 
bool isActive () const
 
iTransformationChangeEvent & getTransformationChangeEvent ()
 

Static Public Member Functions

static iaString getKindName (iNodeKind kind)
 
static iaString getTypeName (iNodeType nodeType)
 

Static Public Attributes

static const iNodeID INVALID_NODE_ID = IGOR_INVALID_ID
 

Protected Member Functions

void setTransformationDirtyDown ()
 
void setTransformationDirtyUp ()
 
void setDataDirty ()
 
bool isDataDirty ()
 
void setParent (iNodePtr parent)
 
void setScene (iScenePtr scene)
 
virtual void onUpdateTransform (iaMatrixd &matrix)
 
virtual void onPreSetScene ()
 
virtual void onPostSetScene ()
 
virtual bool onUpdateData ()
 
virtual void onPostCopyLink (std::map< iNodeID, iNodeID > &nodeIDMap)
 
 iNode ()
 
 iNode (iNodePtr node)
 
virtual ~iNode ()
 

Protected Attributes

bool _active = true
 
iNodeType _nodeType = iNodeType::iNode
 
iNodeKind _nodeKind = iNodeKind::Node
 
iaString _name = L"iNode"
 
bool _transformationDirty = true
 
iScenePtr _scene = nullptr
 
iNodePtr _parent = nullptr
 
std::vector< iNodePtr_children
 
std::vector< iNodePtr_inactiveChildren
 
iTransformationChangeEvent _transformationChangeEvent
 

Friends

class iNodeManager
 
class iScene
 
class iNodeVisitorUpdateTransform
 
class iDataUpdateQueue
 

Detailed Description

base node implementation

Works basically as a group node and has no other specific features.

Make changes to the scene only in main thread. If you want to create nodes multithreaded you can do so but adding them is only save within the main thread

Constructor & Destructor Documentation

◆ iNode() [1/2]

igor::iNode::iNode ( )
protected

set's node id

◆ iNode() [2/2]

igor::iNode::iNode ( iNodePtr  node)
protected

copy ctor

◆ ~iNode()

igor::iNode::~iNode ( )
protectedvirtual

destroys all childdren

Member Function Documentation

◆ calcWorldTransformation()

void igor::iNode::calcWorldTransformation ( iaMatrixd matrix)

gets the world transformation for any node

this is a quite expensive routine. preferably use an other interface from specialized nodes like iNodeCamera::getWorldMatrix

Parameters
[out]matrixworld matrix of this node

◆ getAllChildren()

void igor::iNode::getAllChildren ( std::vector< iNodePtr > &  children) const

returns list of all children

Parameters
[out]childrenreturned list with all children active and inactive

◆ getChild() [1/2]

iNodePtr igor::iNode::getChild ( const iaString name)

returns child by name

attention names are not unique. It will return the first node with the correct name found

Parameters
namethe name to search for
Returns
node with the name specified. returns zero in case of an error

◆ getChild() [2/2]

iNodePtr igor::iNode::getChild ( iNodeID  id)

returns child by id

Parameters
idthe id of the child node
Returns
pointer to child object

◆ getChildren()

const std::vector< iNodePtr > & igor::iNode::getChildren ( ) const
Returns
list of active children

◆ getID()

iNodeID igor::iNode::getID ( ) const
Returns
id of the node

◆ getInactiveChildren()

const std::vector< iNodePtr > & igor::iNode::getInactiveChildren ( ) const
Returns
list of inactive children

◆ getInfo()

std::vector< iaString > igor::iNode::getInfo ( bool  brief = false) const
virtual

returns multiple lines of information about this node

each entry in vector is one line of information

Returns
strings with the nodes information
Parameters
briefif true only one brief line of information will be returned

Reimplemented in igor::iNodeMesh, igor::iNodeModel, and igor::iNodeTransform.

◆ getKind()

iNodeKind igor::iNode::getKind ( ) const
Returns
kind (group) of the node

◆ getKindName()

iaString igor::iNode::getKindName ( iNodeKind  kind)
static
Returns
name for given kind of node
Parameters
nodeTypethe given kind of node

◆ getName()

const iaString & igor::iNode::getName ( ) const
Returns
name of the node

◆ getParent()

iNodePtr igor::iNode::getParent ( )
Returns
pointer to parent node

◆ getScene()

iScenePtr igor::iNode::getScene ( )
Returns
pointer to scene this node is in

◆ getTransformationChangeEvent()

iTransformationChangeEvent & igor::iNode::getTransformationChangeEvent ( )

◆ getType()

iNodeType igor::iNode::getType ( ) const
Returns
the type of the node

◆ getTypeName()

iaString igor::iNode::getTypeName ( iNodeType  nodeType)
static
Returns
name for given node type
Parameters
nodeTypethe given node type

◆ hasChildren()

bool igor::iNode::hasChildren ( )
Returns
true: if node has children; false: if node has no children

◆ insertNode()

void igor::iNode::insertNode ( iNodePtr  node)

inserts node as child

Parameters
nodepointer to node to be inserted

◆ insertNodeAsync()

void igor::iNode::insertNodeAsync ( iNodePtr  node)

inserts a node as child asynchronously

Parameters
nodepointer to node to be inserted

◆ isActive()

bool igor::iNode::isActive ( ) const
Returns
true: if node is active

◆ isChild() [1/2]

bool igor::iNode::isChild ( )
Returns
true: if this node has a parent; false if it does not have a parent

◆ isChild() [2/2]

bool igor::iNode::isChild ( iNodePtr  child)
Returns
true if node is child of node
Parameters
childthe node to check if it is a child of this node

◆ isDataDirty()

bool igor::iNode::isDataDirty ( )
protected
Returns
true if data is dirty and top be queued

◆ isTransformationDirty()

bool igor::iNode::isTransformationDirty ( )
Returns
true: if transformation flag is dirty; false: if not

this flag is set if on the path form root node down to this node the transformations have changed, so it's position will get updated during next frame

◆ onPostCopyLink()

void igor::iNode::onPostCopyLink ( std::map< iNodeID, iNodeID > &  nodeIDMap)
protectedvirtual

called after a node was copied

Parameters
nodeIDMapmap with old node ids to new node ids

◆ onPostSetScene()

void igor::iNode::onPostSetScene ( )
protectedvirtual

this is called just after setScene and gives the class the chance to register it self to the new scene.

Reimplemented in igor::iNodeLight, igor::iNodeLODTrigger, igor::iNodeCamera, igor::iNodeRender, and igor::iNodeVolume.

◆ onPreSetScene()

void igor::iNode::onPreSetScene ( )
protectedvirtual

this is called just before setScene and gives the class the chance to unregister from the current scene if set.

Reimplemented in igor::iNodeLight, igor::iNodeLODTrigger, igor::iNodeCamera, igor::iNodeRender, and igor::iNodeVolume.

◆ onUpdateData()

bool igor::iNode::onUpdateData ( )
protectedvirtual

called by update dirty data queue

to end up in that queue call setDataDirty();

◆ onUpdateTransform()

void igor::iNode::onUpdateTransform ( iaMatrixd matrix)
protectedvirtual

called by node visitor update transform

Parameters
[in,out]matrixcurrent transformation matrix

Reimplemented in igor::iNodeAudioListener, igor::iNodeAudioSource, igor::iNodeCamera, igor::iNodeLight, igor::iNodeLODTrigger, igor::iNodeRender, and igor::iNodeVolume.

◆ removeNode()

void igor::iNode::removeNode ( iNodePtr  node)

removes node that was a child before

Parameters
nodepointer to node to be removed

◆ removeNodeAsync()

void igor::iNode::removeNodeAsync ( iNodePtr  node)

removes node that was a child before asynchronously

Parameters
nodepointer to node to be removed

◆ setActive()

void igor::iNode::setActive ( bool  active = true)

sets node active or inactive

Parameters
activethe active flag

◆ setActiveAsync()

void igor::iNode::setActiveAsync ( bool  active = true)

sets node active or inactive asynchronously

Parameters
activethe active flag

◆ setDataDirty()

void igor::iNode::setDataDirty ( )
protected

sets data dirty and puts node in update data queue

◆ setName()

void igor::iNode::setName ( const iaString name)

sets name of the node

Parameters
namenew name of the node

◆ setParent()

void igor::iNode::setParent ( iNodePtr  parent)
protected

sets the parent of this node

Parameters
parentpointer to parent node

◆ setScene()

void igor::iNode::setScene ( iScenePtr  scene)
protected

sets pointer to scene

Parameters
scenepointer to scene

◆ setTransformationDirty()

void igor::iNode::setTransformationDirty ( bool  dirty = true)

sets the transformation flag dirty.

also sets the transformation flag of all children and parents dirty

Parameters
dirtytrue: this node, all parents and children will be set dirty; false: only this node will be set non dirty

◆ setTransformationDirtyDown()

void igor::iNode::setTransformationDirtyDown ( )
protected

traveses child trees ans sets the transformation dirty flag

◆ setTransformationDirtyUp()

void igor::iNode::setTransformationDirtyUp ( )
protected

goes through all parent nodes and sets the transformation dirty flag

Friends And Related Function Documentation

◆ iDataUpdateQueue

friend class iDataUpdateQueue
friend

◆ iNodeManager

friend class iNodeManager
friend

◆ iNodeVisitorUpdateTransform

friend class iNodeVisitorUpdateTransform
friend

◆ iScene

friend class iScene
friend

Member Data Documentation

◆ _active

bool igor::iNode::_active = true
protected

true: node is active; false: node will be ignored for most operations

◆ _children

std::vector<iNodePtr> igor::iNode::_children
protected

list of pointers to child nodes

◆ _inactiveChildren

std::vector<iNodePtr> igor::iNode::_inactiveChildren
protected

list of pointers to child nodes that are inactive

◆ _name

iaString igor::iNode::_name = L"iNode"
protected

the name of this node

◆ _nodeKind

iNodeKind igor::iNode::_nodeKind = iNodeKind::Node
protected

the kind of this node

◆ _nodeType

iNodeType igor::iNode::_nodeType = iNodeType::iNode
protected

the type of this node

◆ _parent

iNodePtr igor::iNode::_parent = nullptr
protected

pointer to parent node

◆ _scene

iScenePtr igor::iNode::_scene = nullptr
protected

pointer to parenting scene

◆ _transformationChangeEvent

iTransformationChangeEvent igor::iNode::_transformationChangeEvent
protected

call this when ever you change something on the node

◆ _transformationDirty

bool igor::iNode::_transformationDirty = true
protected

dirty flag to detect transformation changes

◆ INVALID_NODE_ID

const iNodeID igor::iNode::INVALID_NODE_ID = IGOR_INVALID_ID
static

invalid node id definition


The documentation for this class was generated from the following files: