OSG
3.4.0
|
#include <Node.h>
Classes | |
struct | ComputeBoundingSphereCallback |
Public Types | |
typedef std::vector< Group * > | ParentList |
typedef unsigned int | NodeMask |
typedef std::vector< std::string > | DescriptionList |
![]() | |
enum | DataVariance { DYNAMIC, STATIC, UNSPECIFIED } |
Protected Member Functions | |
virtual | ~Node () |
void | addParent (osg::Group *parent) |
void | removeParent (osg::Group *parent) |
void | setNumChildrenRequiringUpdateTraversal (unsigned int num) |
void | setNumChildrenRequiringEventTraversal (unsigned int num) |
void | setNumChildrenWithCullingDisabled (unsigned int num) |
void | setNumChildrenWithOccluderNodes (unsigned int num) |
![]() | |
virtual | ~Object () |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Protected Attributes | |
BoundingSphere | _initialBound |
ref_ptr < ComputeBoundingSphereCallback > | _computeBoundCallback |
BoundingSphere | _boundingSphere |
bool | _boundingSphereComputed |
ParentList | _parents |
ref_ptr< Callback > | _updateCallback |
unsigned int | _numChildrenRequiringUpdateTraversal |
ref_ptr< Callback > | _eventCallback |
unsigned int | _numChildrenRequiringEventTraversal |
ref_ptr< Callback > | _cullCallback |
bool | _cullingActive |
unsigned int | _numChildrenWithCullingDisabled |
unsigned int | _numChildrenWithOccluderNodes |
NodeMask | _nodeMask |
ref_ptr< StateSet > | _stateset |
![]() | |
std::string | _name |
DataVariance | _dataVariance |
osg::UserDataContainer * | _userDataContainer |
![]() | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
Friends | |
class | osg::Group |
class | osg::Drawable |
class | osg::StateSet |
Additional Inherited Members | |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
Base class for all internal nodes in the scene graph. Provides interface for most common node operations (Composite Pattern).
typedef std::vector<std::string> osg::Node::DescriptionList |
typedef unsigned int osg::Node::NodeMask |
This is a set of bits (flags) that represent the Node. The default value is 0xffffffff (all bits set).
The most common use of these is during traversal of the scene graph. For instance, when traversing the scene graph the osg::NodeVisitor does a bitwise AND of its TraversalMask with the Node's NodeMask to determine if the Node should be processed/traversed.
For example, if a Node has a NodeMask value of 0x02 (only 2nd bit set) and the osg::Camera has a CullMask of 0x4 (2nd bit not set) then during cull traversal, which takes it's TraversalMask from the Camera's CullMask, the node and any children would be ignored and thereby treated as "culled" and thus not rendered. Conversely, if the osg::Camera CullMask were 0x3 (2nd bit set) then the node would be processed and child Nodes would be examined.
typedef std::vector<Group*> osg::Node::ParentList |
A vector of osg::Group pointers which is used to store the parent(s) of node.
osg::Node::Node | ( | ) |
Construct a node. Initialize the parent list to empty, node name to "" and bounding sphere dirty flag to true.
osg::Node::Node | ( | const Node & | , |
const CopyOp & | copyop = CopyOp::SHALLOW_COPY |
||
) |
Copy constructor using CopyOp to manage deep vs shallow copy.
|
protectedvirtual |
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 Nodes 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 |
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type.
Reimplemented in osgParticle::ParticleProcessor, osgParticle::Program, osgParticle::Emitter, osgParticle::ParticleEffect, osg::AutoTransform, and osgParticle::PrecipitationEffect.
void osg::Node::addDescription | ( | const std::string & | desc | ) |
Add a description string to the node.
|
protected |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Traverse upwards : calls parents' accept method with NodeVisitor.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Convert 'this' into a Transform pointer if Node is a Terrain, otherwise return 0. Equivalent to dynamic_cast<Terrrain*>(this).
Reimplemented in osgTerrain::Terrain.
|
inlinevirtual |
convert 'const this' into a const Terrain pointer if Node is a Terrain, otherwise return 0. Equivalent to dynamic_cast<const Terrain*>(this).
Reimplemented in osgTerrain::Terrain.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
return the name of the node's class type.
Implements osg::Object.
Reimplemented in osgShadow::ShadowVolumeGeometry, osg::ShapeDrawable, osgFX::Effect, osgAnimation::MorphGeometry, osgSim::ImpostorSprite, osgParticle::ParticleProcessor, osgShadow::OccluderGeometry, osgManipulator::AntiSquish, osgParticle::Program, osg::DrawPixels, osgParticle::Emitter, osgParticle::ParticleEffect, osg::AutoTransform, osgText::Text, osgParticle::PrecipitationEffect, and osgText::TextBase.
return a clone of a node, with Object* return type.
Implements osg::Object.
Reimplemented in osgShadow::ShadowVolumeGeometry, osg::ShapeDrawable, osgAnimation::MorphGeometry, osgSim::ImpostorSprite, osgShadow::OccluderGeometry, osgManipulator::AntiSquish, osg::DrawPixels, osg::AutoTransform, and osgText::Text.
|
inlinevirtual |
clone an object of the same type as the node.
Implements osg::Object.
Reimplemented in osgShadow::ShadowVolumeGeometry, osg::ShapeDrawable, osgAnimation::MorphGeometry, osgSim::ImpostorSprite, osgShadow::OccluderGeometry, osgManipulator::AntiSquish, osg::AutoTransform, osg::DrawPixels, and osgText::Text.
|
virtual |
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().
Reimplemented in osgTerrain::TerrainTile, osg::Drawable, osg::Transform, osg::Group, osgParticle::ParticleProcessor, osgUI::Widget, osgVolume::VolumeTile, osg::Geode, osg::LOD, osg::ProxyNode, osg::OcclusionQueryNode, osg::AutoTransform, osgSim::Impostor, osg::Billboard, osg::ClipNode, osgSim::LightPointNode, osg::Switch, osg::LightSource, osgParticle::ParticleSystemUpdater, osgGA::Widget, and osg::OccluderNode.
bool osg::Node::containsOccluderNodes | ( | ) | const |
return true if this node is an OccluderNode or the subgraph below this node are OccluderNodes.
void osg::Node::dirtyBound | ( | ) |
Mark this node's bounding sphere dirty. Forcing it to be computed on the next call to getBound().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
const std::string& osg::Node::getDescription | ( | unsigned int | i | ) | const |
Get a single const description of the const node.
std::string& osg::Node::getDescription | ( | unsigned int | i | ) |
Get a single description of the node.
DescriptionList& osg::Node::getDescriptions | ( | ) |
Get the description list of the node.
const DescriptionList& osg::Node::getDescriptions | ( | ) | const |
Get the const description list of the const node.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the number of Children of this node which are or have OccluderNode's.
Definition at line 329 of file Node.h.
unsigned int osg::Node::getNumDescriptions | ( | ) | const |
Get the number of descriptions of the node.
|
inline |
osg::StateSet* osg::Node::getOrCreateStateSet | ( | ) |
|
inline |
NodePathList osg::Node::getParentalNodePaths | ( | osg::Node * | haltTraversalAtNode = 0 | ) | const |
Get the list of node paths parent paths. The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
MatrixList osg::Node::getWorldMatrices | ( | const osg::Node * | haltTraversalAtNode = 0 | ) | const |
Get the list of matrices that transform this node from local coordinates to world coordinates. The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node.
|
inline |
Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal. Note, returns true only if no children have culling disabled, and the local _cullingActive flag is true.
Definition at line 326 of file Node.h.
|
inlinevirtual |
return true if this and obj are of the same kind of object.
Reimplemented from osg::Object.
Reimplemented in osgShadow::ShadowVolumeGeometry, osg::ShapeDrawable, osgFX::Effect, osgAnimation::MorphGeometry, osgParticle::ParticleProcessor, osgSim::ImpostorSprite, osgParticle::Program, osgShadow::OccluderGeometry, osgParticle::Emitter, osgParticle::ParticleEffect, osgManipulator::AntiSquish, osg::DrawPixels, osgParticle::PrecipitationEffect, osg::AutoTransform, osgText::Text, and osgText::TextBase.
|
inlinevirtual |
return the name of the node's library.
Implements osg::Object.
Reimplemented in osgShadow::ShadowVolumeGeometry, osg::ShapeDrawable, osgFX::Effect, osgAnimation::MorphGeometry, osgSim::ImpostorSprite, osgParticle::ParticleProcessor, osgShadow::OccluderGeometry, osgManipulator::AntiSquish, osgParticle::Program, osg::DrawPixels, osgParticle::Emitter, osgParticle::ParticleEffect, osg::AutoTransform, osgText::Text, osgText::TextBase, and osgParticle::PrecipitationEffect.
|
virtual |
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.
Reimplemented from osg::Object.
Reimplemented in osg::Camera, osgText::Text, osg::Drawable, osgText::TextBase, osgTerrain::TerrainTile, osgTerrain::HeightFieldDrawable, osg::Geometry, osgUI::Widget, osg::Group, osgSim::OverlayNode, osgText::Text3D, osg::OcclusionQueryNode, osg::QueryGeometry, osgTerrain::SharedGeometry, and osgShadow::ShadowedScene.
|
protected |
|
virtual |
Resize any per context GLObject buffers to specified size.
Reimplemented from osg::Object.
Reimplemented in osg::Camera, osgText::Text, osg::Drawable, osgText::TextBase, osgTerrain::HeightFieldDrawable, osgUI::Widget, osg::Geometry, osg::Group, osgSim::OverlayNode, osgText::Text3D, osgTerrain::SharedGeometry, and osgShadow::ShadowedScene.
|
inline |
void osg::Node::setCullingActive | ( | bool | active | ) |
Set the view frustum/small feature culling of this node to be active or inactive. The default value is true for _cullingActive. Used as a guide to the cull traversal.
void osg::Node::setDescriptions | ( | const DescriptionList & | descriptions | ) |
Set the list of string descriptions.
Set event node callback, called during event traversal.
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
void osg::Node::setStateSet | ( | osg::StateSet * | stateset | ) |
Set the node's StateSet.
|
virtual |
Set whether to use a mutex to ensure ref() and unref() are thread safe.
Reimplemented from osg::Object.
Reimplemented in osgText::Text, osg::Drawable, osgText::TextBase, osg::Group, osgSim::OverlayNode, osgText::Text3D, osg::LightSource, and osg::TexGenNode.
Set update node callback, called during update traversal.
|
inlinevirtual |
Traverse downwards : calls children's accept method with NodeVisitor.
Reimplemented in osgManipulator::Dragger, osgFX::Effect, osgParticle::ParticleProcessor, osgPresentation::Timeout, osgVolume::VolumeTile, osgTerrain::TerrainTile, osgParticle::ParticleSystemUpdater, osgSim::Impostor, osg::LOD, osgSim::OverlayNode, osgSim::LightPointNode, osg::Group, osg::Switch, osgPresentation::Cursor, osgSim::VisibilityGroup, osgParticle::PrecipitationEffect, osgShadow::ShadowedScene, osgTerrain::Terrain, osg::ProxyNode, osgSim::MultiSwitch, osgVolume::Volume, osgVolume::VolumeScene, osg::PagedLOD, osg::Sequence, osgSim::DOFTransform, osgUI::Widget, and osgGA::Widget.
Definition at line 174 of file Node.h.
|
friend |
|
friend |
|
friend |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |