class SG_EXPORT osg::Node

Base class for all internal nodes in the scene graph.

Inheritance:


Public Methods

[more] Node()
Construct a node.
[more]virtual Object* clone() const
return a shallow copy 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 Group* getParent(const int i)
Get the a copy of parent list of node.
[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]inline void setUserData(void* data, MemoryAdapter* ma=0L)
Set user data.
[more]inline void* getUserData()
Get user data
[more]inline const void* getUserData() const
Get const user data
[more]inline MemoryAdapter* getMemoryAdapter()
Get the memory adapter associated with _userData
[more]inline const MemoryAdapter* getMemoryAdapter() const
Get the const memory adapter associated with _userData
[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]void* _userData
[more]ref_ptr<MemoryAdapter> _memoryAdapter
[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.


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.

ovirtual Object* clone() const
return a shallow copy 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 Group* getParent(const int i)
Get the a copy of parent list of node. A copy is returned to prevent modifiaction of the parent list.

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.

oinline void setUserData(void* data, MemoryAdapter* ma=0L)
Set user data. See MemoryAdapter documention for details of how to specify memory managament of _userData.

oinline void* getUserData()
Get user data

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

oinline MemoryAdapter* getMemoryAdapter()
Get the memory adapter associated with _userData

oinline const MemoryAdapter* getMemoryAdapter() const
Get the const memory adapter associated with _userData

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

oParentList _parents

ovoid* _userData

oref_ptr<MemoryAdapter> _memoryAdapter

oNodeMask _nodeMask

oDescriptionList _descriptions

oref_ptr<StateSet> _dstate


Direct child classes:
LightSource
Group
Geode
Friends:
Group

Alphabetic index HTML hierarchy of classes or Java



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