Google

class SG_EXPORT osg::Node

Base class for all internal nodes in the scene graph.

Inheritance:


Public Methods

[more] Node()
Construct a node.
[more] Node(const Node&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more]virtual Object* cloneType() const
clone the an object of the same type as the node
[more]virtual Object* clone(const CopyOp& copyop) const
return a clone of a node, with Object* return type
[more]virtual bool isSameKindAs(const Object* obj) const
return true if this and obj are of the same kind of object
[more]virtual const char* libraryName() const
return the name of the node's library
[more]virtual const char* className() const
return the name of the node's class type
[more]virtual Group* asGroup()
convert 'this' into a Group pointer if Node is a Group, otherwise return 0.
[more]virtual const Group* asGroup() const
convert 'const this' into a const Group pointer if Node is a Group, otherwise return 0.
[more]virtual Transform* asTransform()
convert 'this' into a Transform pointer if Node is a Transform, otherwise return 0.
[more]virtual const Transform* asTransform() const
convert 'const this' into a const Transform pointer if Node is a Transform, otherwise return 0.
[more]virtual void accept(NodeVisitor& nv)
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type
[more]virtual void ascend(NodeVisitor& nv)
Traverse upwards : calls parents' accept method with NodeVisitor
[more]virtual void traverse(NodeVisitor& )
Traverse downwards : calls children's accept method with NodeVisitor
[more]inline void setName( const std::string& name )
Set the name of node using C++ style string
[more]inline void setName( const char* name )
Set the name of node using a C style string
[more]inline const std::string& getName() const
Get the name of node
[more]inline const ParentList& getParents() const
Get the parent list of node.
[more]inline ParentList getParents()
Get the a copy of parent list of node.
[more]inline Group* getParent(unsigned int i)
[more]inline const Group* getParent(unsigned int i) const
Get a single const parent of node.
[more]inline unsigned int getNumParents() const
Get the number of parents of node.
[more]void setUpdateCallback(NodeCallback* nc)
Set update node callback, called during update traversal.
[more]inline NodeCallback* getUpdateCallback()
Get update node callback, called during update traversal.
[more]inline const NodeCallback* getUpdateCallback() const
Get const update node callback, called during update traversal.
[more]void setAppCallback(NodeCallback* nc)
deprecated.
[more]inline NodeCallback* getAppCallback()
deprecated.
[more]inline const NodeCallback* getAppCallback() const
deprecated.
[more]inline unsigned int getNumChildrenRequiringUpdateTraversal() const
Get the number of Children of this node which require App traversal, since they have an AppCallback attached to them or their children
[more]void setCullCallback(NodeCallback* nc)
Set cull node callback, called during cull traversal.
[more]inline NodeCallback* getCullCallback()
Get cull node callback, called during cull traversal.
[more]inline const NodeCallback* getCullCallback() const
Get const cull node callback, called during cull traversal.
[more]void setCullingActive(bool active)
Set the view frustum/small feature culling of this node to be active or inactive.
[more]inline bool getCullingActive() const
Get the view frustum/small feature _cullingActive flag for this node.
[more]inline unsigned int getNumChildrenWithCullingDisabled() const
Get the number of Children of this node which have culling disabled
[more]inline bool isCullingActive() const
Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal.
[more]inline unsigned int getNumChildrenWithOccluderNodes() const
Get the number of Children of this node which are or have OccluderNode's
[more]bool containsOccluderNodes() const
return true if this node is an OccluderNode or the subgraph below this node are OccluderNodes
[more]inline void setNodeMask(NodeMask nm)
Set the node mask.
[more]inline NodeMask getNodeMask() const
Get the node Mask.
[more]inline const DescriptionList& getDescriptions() const
Get the description list of the const node
[more]inline DescriptionList& getDescriptions()
Get the description list of the const node
[more]inline const std::string& getDescription(unsigned int i) const
Get a single const description of the const node
[more]inline std::string& getDescription(unsigned int i)
Get a single description of the node
[more]inline unsigned int getNumDescriptions() const
Get the number of descriptions of the node
[more]void addDescription(const std::string& desc)
Add a description string to the node
[more]inline void setStateSet(osg::StateSet* dstate)
set the node's StateSet
[more]osg::StateSet* getOrCreateStateSet()
return the node's StateSet, if one does not already exist create it set the node and return the newly created StateSet.
[more]inline osg::StateSet* getStateSet()
return the node's StateSet.
[more]inline const osg::StateSet* getStateSet() const
return the node's const StateSet.
[more]inline const BoundingSphere& getBound() const
get the bounding sphere of node.
[more]void dirtyBound()
Mark this node's bounding sphere dirty.

Public Members

[more]typedef std::vector<Group*> ParentList
A vector of osg::Group pointers which is used to store the parent(s) of node
[more]typedef unsigned int NodeMask
[more]typedef std::vector<std::string> DescriptionList
A vector of std::string's which are used to describe the object

Protected Fields

[more]mutable BoundingSphere _bsphere
[more]mutable bool _bsphere_computed
[more]std::string _name
[more]ParentList _parents
[more]ref_ptr<NodeCallback> _updateCallback
[more]unsigned int _numChildrenRequiringUpdateTraversal
[more]ref_ptr<NodeCallback> _cullCallback
[more]bool _cullingActive
[more]unsigned int _numChildrenWithCullingDisabled
[more]unsigned int _numChildrenWithOccluderNodes
[more]NodeMask _nodeMask
[more]DescriptionList _descriptions
[more]ref_ptr<StateSet> _stateset

Protected Methods

[more]virtual ~Node()
Node destructor.
[more]virtual bool computeBound() const
Compute the bounding sphere around Node's geometry or children.
[more]void addParent(osg::Group* node)
[more]void removeParent(osg::Group* node)
[more]void setNumChildrenRequiringUpdateTraversal(unsigned int num)
[more]void setNumChildrenWithCullingDisabled(unsigned int num)
[more]void setNumChildrenWithOccluderNodes(unsigned int num)


Inherited from Object:

Public Methods

oinline void setDataVariance(DataVariance dv)
oinline DataVariance getDataVariance() const
oinline void setUserData(Referenced* obj)
oinline Referenced* getUserData()
oinline const Referenced* getUserData() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
ostatic void setDeleteHandler(DeleteHandler* handler)
ostatic DeleteHandler* getDeleteHandler()
oinline void ref() const
oinline void unref_nodelete() const
oinline int referenceCount() const
oinline void unref() const

Protected Fields

omutable int _refCount


Documentation

Base class for all internal nodes in the scene graph. Provides interface for most common node operations (Composite Pattern).
o Node()
Construct a node. Initialize the parent list to empty, node name to "" and bounding sphere dirty flag to true.

o Node(const Node&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

ovirtual Object* cloneType() const
clone the an object of the same type as the node

ovirtual Object* clone(const CopyOp& copyop) const
return a clone of a node, with Object* return type

ovirtual bool isSameKindAs(const Object* obj) const
return true if this and obj are of the same kind of object

ovirtual const char* libraryName() const
return the name of the node's library

ovirtual const char* className() const
return the name of the node's class type

ovirtual Group* asGroup()
convert 'this' into a Group pointer if Node is a Group, otherwise return 0. Equivalent to dynamic_cast(this).

ovirtual const Group* asGroup() const
convert 'const this' into a const Group pointer if Node is a Group, otherwise return 0. Equivalent to dynamic_cast(this).

ovirtual Transform* asTransform()
convert 'this' into a Transform pointer if Node is a Transform, otherwise return 0. Equivalent to dynamic_cast(this).

ovirtual const Transform* asTransform() const
convert 'const this' into a const Transform pointer if Node is a Transform, otherwise return 0. Equivalent to dynamic_cast(this).

ovirtual void accept(NodeVisitor& nv)
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type

ovirtual void ascend(NodeVisitor& nv)
Traverse upwards : calls parents' accept method with NodeVisitor

ovirtual void traverse(NodeVisitor& )
Traverse downwards : calls children's accept method with NodeVisitor

oinline void setName( const std::string& name )
Set the name of node using C++ style string

oinline void setName( const char* name )
Set the name of node using a C style string

oinline const std::string& getName() const
Get the name of node

otypedef std::vector<Group*> ParentList
A vector of osg::Group pointers which is used to store the parent(s) of node

oinline const ParentList& getParents() const
Get the parent list of node.

oinline ParentList getParents()
Get the a copy of parent list of node. A copy is returned to prevent modification of the parent list.

oinline Group* getParent(unsigned int i)

oinline const Group* getParent(unsigned int i) const
Get a single const parent of node.
Parameters:
i - index of the parent to get.
Returns:
the parent i.

oinline unsigned int getNumParents() const
Get the number of parents of node.
Returns:
the number of parents of this node.

ovoid setUpdateCallback(NodeCallback* nc)
Set update node callback, called during update traversal.

oinline NodeCallback* getUpdateCallback()
Get update node callback, called during update traversal.

oinline const NodeCallback* getUpdateCallback() const
Get const update node callback, called during update traversal.

ovoid setAppCallback(NodeCallback* nc)
deprecated.

oinline NodeCallback* getAppCallback()
deprecated.

oinline const NodeCallback* getAppCallback() const
deprecated.

oinline unsigned int getNumChildrenRequiringUpdateTraversal() const
Get the number of Children of this node which require App traversal, since they have an AppCallback attached to them or their children

ovoid setCullCallback(NodeCallback* nc)
Set cull node callback, called during cull traversal.

oinline NodeCallback* getCullCallback()
Get cull node callback, called during cull traversal.

oinline const NodeCallback* getCullCallback() const
Get const cull node callback, called during cull traversal.

ovoid setCullingActive(bool active)
Set the view frustum/small feature culling of this node to be active or inactive. The default value to true for _cullingActive. Used a guide to the cull traversal.

oinline bool getCullingActive() const
Get the view frustum/small feature _cullingActive flag for this node. Used a guide to the cull traversal.

oinline unsigned int getNumChildrenWithCullingDisabled() const
Get the number of Children of this node which have culling disabled

oinline bool isCullingActive() const
Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal. note, return true only if no children have culling disabled, and the local _cullingActive flag is true.

oinline unsigned int getNumChildrenWithOccluderNodes() const
Get the number of Children of this node which are or have OccluderNode's

obool containsOccluderNodes() const
return true if this node is an OccluderNode or the subgraph below this node are OccluderNodes

otypedef unsigned int NodeMask

oinline void setNodeMask(NodeMask nm)
Set the node mask. Note, node mask is will be replaced by TraversalMask.

oinline NodeMask getNodeMask() const
Get the node Mask. Note, node mask is will be replaced by TraversalMask.

otypedef std::vector<std::string> DescriptionList
A vector of std::string's which are used to describe the object

oinline const DescriptionList& getDescriptions() const
Get the description list of the const node

oinline DescriptionList& getDescriptions()
Get the description list of the const node

oinline const std::string& getDescription(unsigned int i) const
Get a single const description of the const node

oinline std::string& getDescription(unsigned int i)
Get a single description of the node

oinline unsigned int getNumDescriptions() const
Get the number of descriptions of the node

ovoid addDescription(const std::string& desc)
Add a description string to the node

oinline void setStateSet(osg::StateSet* dstate)
set the node's StateSet

oosg::StateSet* getOrCreateStateSet()
return the node's StateSet, if one does not already exist create it set the node and return the newly created StateSet. This ensures that a valid StateSet is always returned and can be used directly.

oinline osg::StateSet* getStateSet()
return the node's StateSet. returns NULL if a stateset is not attached.

oinline const osg::StateSet* getStateSet() const
return the node's const StateSet. returns NULL if a stateset is not attached.

oinline const BoundingSphere& getBound() const
get the bounding sphere of node. Using lazy evaluation computes the bounding sphere if it is 'dirty'.

ovoid dirtyBound()
Mark this node's bounding sphere dirty. Forcing it to be computed on the next call to getBound().

ovirtual ~Node()
Node destructor. Note, is protected so that Nodes cannot be deleted other than by being dereferenced and the reference count being zero (see osg::Referenced), preventing the deletion of nodes which are still in use. This also means that Node's cannot be created on stack i.e Node node will not compile, forcing all nodes to be created on the heap i.e Node* node = new Node().

ovirtual bool computeBound() const
Compute the bounding sphere around Node's geometry or children. This method is automatically called by getBound() when the bounding sphere has been marked dirty via dirtyBound().

omutable BoundingSphere _bsphere

omutable bool _bsphere_computed

ostd::string _name

ovoid addParent(osg::Group* node)

ovoid removeParent(osg::Group* node)

oParentList _parents

oref_ptr<NodeCallback> _updateCallback

ounsigned int _numChildrenRequiringUpdateTraversal

ovoid setNumChildrenRequiringUpdateTraversal(unsigned int num)

oref_ptr<NodeCallback> _cullCallback

obool _cullingActive

ounsigned int _numChildrenWithCullingDisabled

ovoid setNumChildrenWithCullingDisabled(unsigned int num)

ounsigned int _numChildrenWithOccluderNodes

ovoid setNumChildrenWithOccluderNodes(unsigned int num)

oNodeMask _nodeMask

oDescriptionList _descriptions

oref_ptr<StateSet> _stateset


Direct child classes:
Group
Geode
Friends:
class osg::Group
class osg::Drawable

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.