Base class for all internal nodes in the scene graph.
Inheritance:
Public Methods
-
Node()
- Construct a node.
-
virtual Object* clone() const
- return a shallow copy of a node, with Object* return type
-
virtual bool isSameKindAs(const Object* obj) const
- return true if this and obj are of the same kind of object
-
virtual const char* className() const
- return the name of the node's class type
-
virtual void accept(NodeVisitor& nv)
- Visitor Pattern : calls the apply method of a NodeVisitor with this node's type
-
virtual void ascend(NodeVisitor& nv)
- Traverse upwards : calls parents' accept method with NodeVisitor
-
virtual void traverse(NodeVisitor& )
- Traverse downwards : calls children's accept method with NodeVisitor
-
inline void setName( const std::string& name )
- Set the name of node using C++ style string
-
inline void setName( const char* name )
- Set the name of node using a C style string
-
inline const std::string& getName() const
- Get the name of node
-
inline const ParentList& getParents() const
- Get the parent list of node.
-
inline Group* getParent(const int i)
- Get the a copy of parent list of node.
-
inline const Group* getParent(const int i) const
- Get a single const parent of node.
-
inline const int getNumParents() const
- Get the number of parents of node.
-
void setAppCallback(NodeCallback* nc)
- Set app node callback, called during app traversal.
-
inline NodeCallback* getAppCallback()
- Get app node callback, called during app traversal.
-
inline const NodeCallback* getAppCallback() const
- Get const app node callback, called during app traversal.
-
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
-
inline void setUserData(void* data, MemoryAdapter* ma=0L)
- Set user data.
-
inline void* getUserData()
- Get user data
-
inline const void* getUserData() const
- Get const user data
-
inline MemoryAdapter* getMemoryAdapter()
- Get the memory adapter associated with _userData
-
inline const MemoryAdapter* getMemoryAdapter() const
- Get the const memory adapter associated with _userData
-
inline void setNodeMask(const NodeMask nm)
- Set the node mask.
-
inline const NodeMask getNodeMask() const
- Get the node Mask.
-
inline const DescriptionList& getDescriptions() const
- Get the description list of the const node
-
inline DescriptionList& getDescriptions()
- Get the description list of the const node
-
inline const std::string& getDescription(const int i) const
- Get a single const description of the const node
-
inline std::string& getDescription(const int i)
- Get a single description of the node
-
inline const int getNumDescriptions() const
- Get the number of descriptions of the node
-
void addDescription(const std::string& desc)
- Add a description string to the node
-
inline void setStateSet(osg::StateSet* dstate)
- set the node's StateSet
-
inline osg::StateSet* getStateSet()
- return the node's StateSet
-
inline const osg::StateSet* getStateSet() const
- return the node's const StateSet
-
inline const BoundingSphere& getBound() const
- get the bounding sphere of node.
-
void dirtyBound()
- Mark this node's bounding sphere dirty.
Public Members
-
typedef std::vector<Group*> ParentList
- A vector of osg::Group pointers which is used to store the parent(s) of node
-
typedef std::vector<std::string> DescriptionList
- A vector of std::string's which are used to describe the object
Protected Fields
-
mutable BoundingSphere _bsphere
-
mutable bool _bsphere_computed
-
std::string _name
-
ParentList _parents
-
ref_ptr<NodeCallback> _appCallback
-
int _numChildrenRequiringAppTraversal
-
void* _userData
-
ref_ptr<MemoryAdapter> _memoryAdapter
-
NodeMask _nodeMask
-
DescriptionList _descriptions
-
ref_ptr<StateSet> _dstate
Protected Methods
-
virtual ~Node()
- Node destructor.
-
virtual const bool computeBound() const
- Compute the bounding sphere around Node's geometry or children.
-
void setNumChildrenRequiringAppTraversal(const int num)
Inherited from Object:
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
Documentation
Base class for all internal nodes in the scene graph.
Provides interface for most common node operations (Composite Pattern).
- Node()
- Construct a node.
Initialize the parent list to empty, node name to "" and
bounding sphere dirty flag to true.
- virtual Object* clone() const
- return a shallow copy of a node, with Object* return type
- virtual bool isSameKindAs(const Object* obj) const
- return true if this and obj are of the same kind of object
- virtual const char* className() const
- return the name of the node's class type
- virtual void accept(NodeVisitor& nv)
- Visitor Pattern : calls the apply method of a NodeVisitor with this node's type
- virtual void ascend(NodeVisitor& nv)
- Traverse upwards : calls parents' accept method with NodeVisitor
- virtual void traverse(NodeVisitor& )
- Traverse downwards : calls children's accept method with NodeVisitor
- inline void setName( const std::string& name )
- Set the name of node using C++ style string
- inline void setName( const char* name )
- Set the name of node using a C style string
- inline const std::string& getName() const
- Get the name of node
- typedef std::vector<Group*> ParentList
- A vector of osg::Group pointers which is used to store the parent(s) of node
- inline const ParentList& getParents() const
- Get the parent list of node.
- inline Group* getParent(const int i)
- Get the a copy of parent list of node. A copy is returned to
prevent modification of the parent list.
- inline 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.
- inline const int getNumParents() const
-
Get the number of parents of node.
- Returns:
- the number of parents of this node.
- void setAppCallback(NodeCallback* nc)
- Set app node callback, called during app traversal.
- inline NodeCallback* getAppCallback()
- Get app node callback, called during app traversal.
- inline const NodeCallback* getAppCallback() const
- Get const app node callback, called during app traversal.
- 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
- inline void setUserData(void* data, MemoryAdapter* ma=0L)
-
Set user data. See MemoryAdapter documention for details
of how to specify memory management of _userData.
- inline void* getUserData()
- Get user data
- inline const void* getUserData() const
- Get const user data
- inline MemoryAdapter* getMemoryAdapter()
- Get the memory adapter associated with _userData
- inline const MemoryAdapter* getMemoryAdapter() const
- Get the const memory adapter associated with _userData
- inline void setNodeMask(const NodeMask nm)
- Set the node mask. Note, node mask is will be replaced by TraversalMask.
- inline const NodeMask getNodeMask() const
- Get the node Mask. Note, node mask is will be replaced by TraversalMask.
- typedef std::vector<std::string> DescriptionList
- A vector of std::string's which are used to describe the object
- inline const DescriptionList& getDescriptions() const
- Get the description list of the const node
- inline DescriptionList& getDescriptions()
- Get the description list of the const node
- inline const std::string& getDescription(const int i) const
- Get a single const description of the const node
- inline std::string& getDescription(const int i)
- Get a single description of the node
- inline const int getNumDescriptions() const
- Get the number of descriptions of the node
- void addDescription(const std::string& desc)
- Add a description string to the node
- inline void setStateSet(osg::StateSet* dstate)
- set the node's StateSet
- inline osg::StateSet* getStateSet()
- return the node's StateSet
- inline const osg::StateSet* getStateSet() const
- return the node's const StateSet
- inline const BoundingSphere& getBound() const
- get the bounding sphere of node.
Using lazy evaluation computes the bounding sphere if it is 'dirty'.
- void dirtyBound()
- Mark this node's bounding sphere dirty.
Forcing it to be computed on the next call to getBound().
- virtual ~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().
- virtual 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().
- mutable BoundingSphere _bsphere
- mutable bool _bsphere_computed
- std::string _name
- ParentList _parents
- ref_ptr<NodeCallback> _appCallback
- int _numChildrenRequiringAppTraversal
- void setNumChildrenRequiringAppTraversal(const int num)
- void* _userData
- ref_ptr<MemoryAdapter> _memoryAdapter
- NodeMask _nodeMask
- DescriptionList _descriptions
- ref_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++.