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* className() const
return the name of the node's class type
[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(const int i)
[more]inline const Group* getParent(const int i) const
Get a single const parent of node.
[more]inline const int getNumParents() const
Get the number of parents of node.
[more]void setAppCallback(NodeCallback* nc)
Set app node callback, called during app traversal.
[more]inline NodeCallback* getAppCallback()
Get app node callback, called during app traversal.
[more]inline const NodeCallback* getAppCallback() const
Get const app node callback, called during app traversal.
[more]inline const int getNumChildrenRequiringAppTraversal() 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 setCullingActive(const bool active)
Set the view frustum/small feature culling of this node to be active or inactive.
[more]inline const bool getCullingActive() const
Get the view frustum/small feature _cullingActive flag.
[more]inline const int getNumChildrenWithCullingDisabled() const
Get the number of Children of this node which have culling disabled
[more]inline void setUserData(osg::Referenced* obj)
Set user data, data must be subclased from Referenced to allow automatic memory handling.
[more]inline Referenced* getUserData()
Get user data
[more]inline const Referenced* getUserData() const
Get const user data
[more]inline void setNodeMask(const NodeMask nm)
Set the node mask.
[more]inline const 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(const int i) const
Get a single const description of the const node
[more]inline std::string& getDescription(const int i)
Get a single description of the node
[more]inline const 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]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 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> _appCallback
[more]int _numChildrenRequiringAppTraversal
[more]bool _cullingActive
[more]int _numChildrenWithCullingDisabled
[more]osg::ref_ptr<Referenced> _userData
[more]NodeMask _nodeMask
[more]DescriptionList _descriptions
[more]ref_ptr<StateSet> _dstate

Protected Methods

[more]virtual ~Node()
Node destructor.
[more]virtual const 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 setNumChildrenRequiringAppTraversal(const int num)
[more]void setNumChildrenWithCullingDisabled(const int num)


Inherited from Object:


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
oinline void ref() const
oinline void unref() const
oinline const int referenceCount() 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* className() const
return the name of the node's class type

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(const int i)

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

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

ovoid setAppCallback(NodeCallback* nc)
Set app node callback, called during app traversal.

oinline NodeCallback* getAppCallback()
Get app node callback, called during app traversal.

oinline const NodeCallback* getAppCallback() const
Get const app node callback, called during app traversal.

oinline const int getNumChildrenRequiringAppTraversal() 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 setCullingActive(const 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 const bool getCullingActive() const
Get the view frustum/small feature _cullingActive flag. Used a guide to the cull traversal.

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

oinline void setUserData(osg::Referenced* obj)
Set user data, data must be subclased from Referenced to allow automatic memory handling. If you own data isn't directly subclassed from Referenced then create and adapter object which points to your own objects and handles the memory addressing.

oinline Referenced* getUserData()
Get user data

oinline const Referenced* getUserData() const
Get const user data

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

oinline const 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(const int i) const
Get a single const description of the const node

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

oinline const 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

oinline osg::StateSet* getStateSet()
return the node's StateSet

oinline const osg::StateSet* getStateSet() const
return the node's const StateSet

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 const 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> _appCallback

oint _numChildrenRequiringAppTraversal

ovoid setNumChildrenRequiringAppTraversal(const int num)

obool _cullingActive

oint _numChildrenWithCullingDisabled

ovoid setNumChildrenWithCullingDisabled(const int num)

oosg::ref_ptr<Referenced> _userData

oNodeMask _nodeMask

oDescriptionList _descriptions

oref_ptr<StateSet> _dstate


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

Alphabetic index HTML hierarchy of classes or Java



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