59#define META_Node(library,name) \
60 virtual osg::Object* cloneType() const { return new name (); } \
61 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
62 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
63 virtual const char* className() const { return #name; } \
64 virtual const char* libraryName() const { return #library; } \
65 virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } \
96 virtual const char*
className()
const {
return "Node"; }
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
std::vector< Matrix > MatrixList
A vector of NodePath, typically used to describe all the paths from a node to the potential root node...
Definition Node:53
std::vector< NodePath > NodePathList
A vector of NodePath, typically used to describe all the paths from a node to the potential root node...
Definition Node:50
BoundingSphered BoundingSphere
Definition BoundingSphere:308
std::vector< Node * > NodePath
A vector of Nodes pointers which is used to describe the path from a root node to a descendant.
Definition Node:47
The osgTerrain library is a NodeKit that provides geospecifc terrain rendering support.
Definition Node:29
osg::Callback * getNestedCallback()
Definition Callback:89
void setNestedCallback(osg::Callback *cb)
Definition Callback:88
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Pure virtual base class for drawable geometry.
Definition Drawable:89
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
General group node which maintains a list of children.
Definition Group:29
Base class for all internal nodes in the scene graph.
Definition Node:72
virtual const osgTerrain::Terrain * asTerrain() const
convert 'const this' into a const Terrain pointer if Node is a Terrain, otherwise return 0.
Definition Node:159
void setEventCallback(const ref_ptr< T > &nc)
Definition Node:249
virtual void releaseGLObjects(osg::State *=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
void setCullCallback(Callback *nc)
Set cull node callback, called during cull traversal.
Definition Node:288
void setUpdateCallback(const ref_ptr< T > &nc)
Definition Node:208
void setUpdateCallback(Callback *nc)
Set update node callback, called during update traversal.
ref_ptr< Callback > _eventCallback
Definition Node:511
const Group * getParent(unsigned int i) const
Get a single const parent of node.
Definition Node:186
std::string & getDescription(unsigned int i)
Get a single description of the node.
virtual const Geode * asGeode() const
convert 'const this' into a const Geode pointer if Node is a Geode, otherwise return 0.
Definition Node:151
bool _cullingActive
Definition Node:517
void addDescription(const std::string &desc)
Add a description string to the node.
unsigned int _numChildrenWithOccluderNodes
Definition Node:521
void setEventCallback(Callback *nc)
Set event node callback, called during event traversal.
virtual void traverse(NodeVisitor &)
Traverse downwards : calls children's accept method with NodeVisitor.
Definition Node:167
ref_ptr< ComputeBoundingSphereCallback > _computeBoundCallback
Definition Node:495
unsigned int getNumParents() const
Get the number of parents of node.
Definition Node:192
bool containsOccluderNodes() const
return true if this node is an OccluderNode or the subgraph below this node are OccluderNodes.
DescriptionList & getDescriptions()
Get the description list of the node.
ref_ptr< Callback > _updateCallback
Definition Node:507
void setNumChildrenRequiringUpdateTraversal(unsigned int num)
NodeMask _nodeMask
Definition Node:524
void setNumChildrenWithOccluderNodes(unsigned int num)
virtual const char * libraryName() const
return the name of the node's library.
Definition Node:93
void removeEventCallback(Callback *nc)
Convenience method that removes a given callback from a node, even if that callback is nested.
Definition Node:268
bool isCullingActive() const
Return true if this node can be culled by view frustum, occlusion or small feature culling during the...
Definition Node:337
bool getCullingActive() const
Get the view frustum/small feature _cullingActive flag for this node.
Definition Node:330
unsigned int getNumDescriptions() const
Get the number of descriptions of the node.
virtual Geometry * asGeometry()
convert 'this' into a Geometry pointer if Node is a Geometry, otherwise return 0.
Definition Node:115
NodePathList getParentalNodePaths(osg::Node *haltTraversalAtNode=0) const
Get the list of node paths parent paths.
unsigned int getNumChildrenRequiringEventTraversal() const
Get the number of Children of this node which require Event traversal, since they have an Event Callb...
Definition Node:284
virtual Group * asGroup()
convert 'this' into a Group pointer if Node is a Group, otherwise return 0.
Definition Node:122
ref_ptr< StateSet > _stateset
Definition Node:526
NodeMask getNodeMask() const
Get the node Mask.
Definition Node:367
void setNumChildrenRequiringEventTraversal(unsigned int num)
std::vector< Group * > ParentList
A vector of osg::Group pointers which is used to store the parent(s) of node.
Definition Node:170
void removeCullCallback(Callback *nc)
Convenience method that removes a given callback from a node, even if that callback is nested.
Definition Node:309
void addParent(osg::Group *parent)
virtual Geode * asGeode()
Convert 'this' into a Geode pointer if Node is a Geode, otherwise return 0.
Definition Node:147
const osg::StateSet * getStateSet() const
Return the node's const StateSet.
Definition Node:385
osg::StateSet * getStateSet()
Return the node's StateSet.
Definition Node:382
unsigned int getNumChildrenWithCullingDisabled() const
Get the number of Children of this node which have culling disabled.
Definition Node:333
virtual Drawable * asDrawable()
convert 'this' into a Drawable pointer if Node is a Drawable, otherwise return 0.
Definition Node:108
virtual void resizeGLObjectBuffers(unsigned int)
Resize any per context GLObject buffers to specified size.
virtual const Switch * asSwitch() const
convert 'const this' into a const Switch pointer if Node is a Switch, otherwise return 0.
Definition Node:143
void removeUpdateCallback(const ref_ptr< T > &nc)
Definition Node:239
void addEventCallback(const ref_ptr< T > &nc)
Definition Node:265
ref_ptr< Callback > _cullCallback
Definition Node:515
void setStateSet(const osg::ref_ptr< T > &stateset)
Definition Node:374
unsigned int getNumChildrenWithOccluderNodes() const
Get the number of Children of this node which are or have OccluderNode's.
Definition Node:340
osg::StateSet * getOrCreateStateSet()
return the node's StateSet, if one does not already exist create it set the node and return the newly...
void setInitialBound(const osg::BoundingSphere &bsphere)
Set the initial bounding volume to use when computing the overall bounding volume.
Definition Node:415
Group * getParent(unsigned int i)
Definition Node:179
virtual ~Node()
Node destructor.
void setCullingActive(bool active)
Set the view frustum/small feature culling of this node to be active or inactive.
virtual const Group * asGroup() const
convert 'const this' into a const Group pointer if Node is a Group, otherwise return 0.
Definition Node:125
void setComputeBoundingSphereCallback(ComputeBoundingSphereCallback *callback)
Set the compute bound callback to override the default computeBound.
Definition Node:459
virtual osgTerrain::Terrain * asTerrain()
Convert 'this' into a Transform pointer if Node is a Terrain, otherwise return 0.
Definition Node:155
std::vector< std::string > DescriptionList
A vector of std::string's which are used to describe the object.
Definition Node:389
void addEventCallback(Callback *nc)
Convenience method that sets the event callback of the node if it doesn't exist, or nest it into the ...
Definition Node:258
Callback * getUpdateCallback()
Get update node callback, called during update traversal.
Definition Node:211
virtual BoundingSphere computeBound() const
Compute the bounding sphere around Node's geometry or children.
friend class osg::Group
Definition Node:503
void addUpdateCallback(const ref_ptr< T > &nc)
Definition Node:224
virtual bool isSameKindAs(const Object *obj) const
return true if this and obj are of the same kind of object.
Definition Node:90
const BoundingSphere & getInitialBound() const
Set the initial bounding volume to use when computing the overall bounding volume.
Definition Node:418
virtual const char * className() const
return the name of the node's class type.
Definition Node:96
virtual Transform * asTransform()
Convert 'this' into a Transform pointer if Node is a Transform, otherwise return 0.
Definition Node:129
void setNodeMask(NodeMask nm)
Set the node mask.
Definition Node:365
Callback * getCullCallback()
Get cull node callback, called during cull traversal.
Definition Node:293
unsigned int getNumChildrenRequiringUpdateTraversal() const
Get the number of Children of this node which require Update traversal, since they have an Update Cal...
Definition Node:243
const Callback * getUpdateCallback() const
Get const update node callback, called during update traversal.
Definition Node:214
virtual const Transform * asTransform() const
convert 'const this' into a const Transform pointer if Node is a Transform, otherwise return 0.
Definition Node:133
unsigned int _numChildrenRequiringUpdateTraversal
Definition Node:508
const Callback * getCullCallback() const
Get const cull node callback, called during cull traversal.
Definition Node:296
void setCullCallback(const ref_ptr< T > &nc)
Definition Node:290
MatrixList getWorldMatrices(const osg::Node *haltTraversalAtNode=0) const
Get the list of matrices that transform this node from local coordinates to world coordinates.
virtual const Node * asNode() const
convert 'const this' into a const Node pointer if Object is a Node, otherwise return 0.
Definition Node:104
virtual const Drawable * asDrawable() const
convert 'const this' into a const Drawable pointer if Node is a Drawable, otherwise return 0.
Definition Node:111
void addCullCallback(Callback *nc)
Convenience method that sets the cull callback of the node if it doesn't exist, or nest it into the e...
Definition Node:299
void addCullCallback(const ref_ptr< T > &nc)
Definition Node:306
BoundingSphere _initialBound
Definition Node:494
void removeUpdateCallback(Callback *nc)
Convenience method that removes a given callback from a node, even if that callback is nested.
Definition Node:227
void setDescriptions(const DescriptionList &descriptions)
Set the list of string descriptions.
virtual void setThreadSafeRefUnref(bool threadSafe)
Set whether to use a mutex to ensure ref() and unref() are thread safe.
ParentList getParents()
Get the a copy of parent list of node.
Definition Node:177
void removeEventCallback(const ref_ptr< T > &nc)
Definition Node:280
const std::string & getDescription(unsigned int i) const
Get a single const description of the const node.
void setNumChildrenWithCullingDisabled(unsigned int num)
virtual Object * cloneType() const
clone an object of the same type as the node.
Definition Node:84
void setComputeBoundingSphereCallback(const ref_ptr< T > &callback)
Definition Node:461
const ParentList & getParents() const
Get the parent list of node.
Definition Node:173
unsigned int NodeMask
This is a set of bits (flags) that represent the Node.
Definition Node:363
const DescriptionList & getDescriptions() const
Get the const description list of the const node.
virtual Node * asNode()
Convert 'this' into a Node pointer if Object is a Node, otherwise return 0.
Definition Node:100
virtual Switch * asSwitch()
Convert 'this' into a Switch pointer if Node is a Switch, otherwise return 0.
Definition Node:139
void removeCullCallback(const ref_ptr< T > &nc)
Definition Node:321
void setStateSet(osg::StateSet *stateset)
Set the node's StateSet.
virtual Object * clone(const CopyOp ©op) const
return a clone of a node, with Object* return type.
Definition Node:87
virtual void accept(NodeVisitor &nv)
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type.
void addUpdateCallback(Callback *nc)
Convenience method that sets the update callback of the node if it doesn't exist, or nest it into the...
Definition Node:217
virtual const Geometry * asGeometry() const
convert 'const this' into a const Geometry pointer if Node is a Geometry, otherwise return 0.
Definition Node:118
void removeParent(osg::Group *parent)
void dirtyBound()
Mark this node's bounding sphere dirty.
virtual void ascend(NodeVisitor &nv)
Traverse upwards : calls parents' accept method with NodeVisitor.
Callback * getEventCallback()
Get event node callback, called during event traversal.
Definition Node:252
bool _boundingSphereComputed
Definition Node:497
Node(const Node &, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
friend class osg::Drawable
Definition Node:504
ParentList _parents
Definition Node:502
const ComputeBoundingSphereCallback * getComputeBoundingSphereCallback() const
Get the const compute bound callback.
Definition Node:467
const BoundingSphere & getBound() const
Definition Node:425
BoundingSphere _boundingSphere
Definition Node:496
ComputeBoundingSphereCallback * getComputeBoundingSphereCallback()
Get the compute bound callback.
Definition Node:464
const Callback * getEventCallback() const
Get const event node callback, called during event traversal.
Definition Node:255
unsigned int _numChildrenRequiringEventTraversal
Definition Node:512
unsigned int _numChildrenWithCullingDisabled
Definition Node:518
Callback to allow users to override the default computation of bounding volume.
Definition Node:447
ComputeBoundingSphereCallback()
Definition Node:448
META_Object(osg, ComputeBoundingSphereCallback)
ComputeBoundingSphereCallback(const ComputeBoundingSphereCallback &org, const CopyOp ©op)
Definition Node:450
virtual BoundingSphere computeBound(const osg::Node &) const
Definition Node:455
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Object()
Construct an object.
Definition Object:69
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Switch is a Group node that allows switching between children.
Definition Switch:27
A Transform is a group node for which all children are transformed by a 4x4 matrix.
Definition Transform:75
Terrain provides a framework for loosely coupling height field data with height rendering algorithms.
Definition Terrain:28
#define NULL
Definition Export:55
#define OSG_EXPORT
Definition Export:39