openscenegraph
|
Public Types | |
enum | DataVariance { DYNAMIC, STATIC, UNSPECIFIED } |
Public Member Functions | |
Object () | |
Object (bool threadSafeRefUnref) | |
Object (const Object &, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
virtual Object * | cloneType () const =0 |
virtual Object * | clone (const CopyOp &) const =0 |
virtual bool | isSameKindAs (const Object *) const |
virtual const char * | libraryName () const =0 |
virtual const char * | className () const =0 |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
virtual void | setName (const std::string &name) |
void | setName (const char *name) |
const std::string & | getName () const |
void | setDataVariance (DataVariance dv) |
DataVariance | getDataVariance () const |
virtual void | computeDataVariance () |
void | setUserDataContainer (osg::UserDataContainer *udc) |
osg::UserDataContainer * | getUserDataContainer () |
const osg::UserDataContainer * | getUserDataContainer () const |
osg::UserDataContainer * | getOrCreateUserDataContainer () |
virtual void | setUserData (Referenced *obj) |
virtual Referenced * | getUserData () |
virtual const Referenced * | getUserData () const |
template<typename T > | |
bool | getUserValue (const std::string &name, T &value) const |
template<typename T > | |
void | setUserValue (const std::string &name, const T &value) |
virtual void | resizeGLObjectBuffers (unsigned int) |
virtual void | releaseGLObjects (osg::State *=0) const |
![]() | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
bool | getThreadSafeRefUnref () const |
OpenThreads::Mutex * | getRefMutex () const |
int | ref () const |
int | unref () const |
int | unref_nodelete () const |
int | referenceCount () const |
ObserverSet * | getObserverSet () const |
ObserverSet * | getOrCreateObserverSet () const |
void | addObserver (Observer *observer) const |
void | removeObserver (Observer *observer) const |
Protected Member Functions | |
virtual | ~Object () |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Protected Attributes | |
std::string | _name |
DataVariance | _dataVariance |
osg::UserDataContainer * | _userDataContainer |
![]() | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
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/standard interface for objects which require IO support, cloning and reference counting. Based on GOF Composite, Prototype and Template Method patterns.
|
inline |
Construct an object. Note Object is a pure virtual base class and therefore cannot be constructed on its own, only derived classes which override the clone and className methods are concrete classes and can be constructed.
|
inlineexplicit |
osg::Object::Object | ( | const Object & | , |
const CopyOp & | copyop = CopyOp::SHALLOW_COPY |
||
) |
Copy constructor, optional CopyOp object can be used to control shallow vs deep copying of dynamic data.
|
protectedvirtual |
Object destructor. Note, is protected so that Objects 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().
|
pure virtual |
return the name of the object's class type. Must be defined by derived classes.
Implemented in osg::BufferData, osg::DrawElementsUInt, osg::RefMatrixf, osg::BufferObject, osg::GraphicsContext, osg::DrawElementsUShort, osg::DrawElementsUByte, osg::RefMatrixd, osg::DrawArrayLengths, osg::Texture, osg::DrawArrays, osgText::GlyphTexture, osgViewer::GraphicsWindowEmbedded, osg::StateAttribute, osgShadow::ShadowVolumeGeometry, osg::PrimitiveSet, osg::ShapeDrawable, osg::TemplateValueObject< T >, osg::Drawable, osg::Image, osg::Array, osg::Node, osgText::Font, osgViewer::GraphicsWindowX11, osg::Shape, osgFX::Effect, osgUtil::RenderBin, osgAnimation::MorphGeometry, osg::Light, osgGA::UFOManipulator, osg::AudioStream, osg::ClipPlane, osg::StateSet, osgSim::ImpostorSprite, osgGA::StandardManipulator, osgParticle::ParticleProcessor, osgUtil::RenderStage, osgViewer::GraphicsWindow, osgGA::CameraManipulator, osgShadow::OccluderGeometry, osg::Hint, osgGA::AnimationPathManipulator, osgParticle::Program, osg::DrawPixels, osgParticle::Emitter, osgParticle::Operator, osgParticle::ParticleEffect, osg::Geometry, osg::ImageSequence, osg::UserDataContainer, osgParticle::Interpolator, osgUtil::PositionalStateContainer, osgGA::KeySwitchMatrixManipulator, osgGA::StateSetManipulator, osgSim::Sector, osgViewer::GraphicsWindowWin32, osgViewer::PixelBufferWin32, osg::AutoTransform, osg::ImageStream, osgParticle::Placer, osgText::Text, osg::ShaderAttribute, osgDB::Archive, osgParticle::PrecipitationEffect, osgParticle::Shooter, osgText::TextBase, osgViewer::PixelBufferX11, osgGA::DriveManipulator, osgParticle::CenteredPlacer, osgParticle::VariableRateCounter, osg::AudioSink, osgParticle::Counter, osgGA::SphericalManipulator, and osgGA::CameraViewSwitchManipulator.
Clone an object, with Object* return type. Must be defined by derived classes.
Implemented in osg::DrawElementsUInt, osg::RefMatrixf, osg::GraphicsContext, osg::DrawElementsUShort, osg::DrawElementsUByte, osg::RefMatrixd, osg::DrawArrayLengths, osg::Texture, osg::DrawArrays, osg::TemplateIndexArray< T, ARRAYTYPE, DataSize, DataType >, osg::StateAttribute, osgShadow::ShadowVolumeGeometry, osg::TemplateArray< T, ARRAYTYPE, DataSize, DataType >, osg::ShapeDrawable, osg::TemplateValueObject< T >, osg::Image, osg::Node, osgText::Font, osgUtil::RenderBin, osgAnimation::MorphGeometry, osg::Light, osg::Shape, osg::ClipPlane, osg::StateSet, osgSim::ImpostorSprite, osgUtil::RenderStage, osgManipulator::AntiSquish, osgShadow::OccluderGeometry, osg::Hint, osg::Geometry, osg::ImageSequence, osg::DrawPixels, osgUtil::PositionalStateContainer, osg::AutoTransform, osgText::Text, osg::ImageStream, and osg::ShaderAttribute.
Referenced by osg::clone().
|
pure virtual |
Clone the type of an object, with Object* return type. Must be defined by derived classes.
Implemented in osg::DrawElementsUInt, osg::RefMatrixf, osg::GraphicsContext, osg::DrawElementsUShort, osg::DrawElementsUByte, osg::RefMatrixd, osg::DrawArrayLengths, osg::Texture, osg::DrawArrays, osg::TemplateIndexArray< T, ARRAYTYPE, DataSize, DataType >, osgShadow::ShadowVolumeGeometry, osg::StateAttribute, osg::TemplateArray< T, ARRAYTYPE, DataSize, DataType >, osg::ShapeDrawable, osg::TemplateValueObject< T >, osg::Image, osg::Node, osgText::Font, osgUtil::RenderBin, osgAnimation::MorphGeometry, osg::Light, osg::Shape, osg::ClipPlane, osg::StateSet, osgUtil::RenderStage, osgSim::ImpostorSprite, osgManipulator::AntiSquish, osgShadow::OccluderGeometry, osg::Hint, osg::Geometry, osg::ImageSequence, osgUtil::PositionalStateContainer, osg::AutoTransform, osg::DrawPixels, osgText::Text, osg::ImageStream, and osg::ShaderAttribute.
Referenced by osg::cloneType().
|
inlinevirtual |
Compute the DataVariance based on an assessment of callback etc.
Reimplemented in osg::Drawable, and osg::StateSet.
|
inline |
Get the data variance of this object.
Referenced by osgUtil::RenderLeaf::RenderLeaf(), and osgUtil::StateGraph::StateGraph().
|
inline |
Get the name of object.
Reimplemented in osgAnimation::AnimationUpdateCallback< T >, osgAnimation::AnimationUpdateCallback< osg::NodeCallback >, and osgAnimation::AnimationUpdateCallback< osg::StateAttributeCallback >.
Referenced by osgTerrain::CompositeLayer::addLayer(), osg::State::applyShaderCompositionUniform(), and osgAnimation::RigGeometry::UpdateVertex::update().
osg::UserDataContainer* osg::Object::getOrCreateUserDataContainer | ( | ) |
Convinience method that returns the UserDataContainer, and if one doesn't already exist creates and assigns a DefaultUserDataContainer to the Object and then return this new UserDataContainer.
|
virtual |
Get user data.
Reimplemented in osg::DefaultUserDataContainer, and osg::UserDataContainer.
Referenced by osgUtil::Optimizer::isOperationPermissibleForObjectImplementation().
|
virtual |
Get const user data.
Reimplemented in osg::DefaultUserDataContainer, and osg::UserDataContainer.
|
inline |
get the UserDataContainer attached to this object.
|
inline |
get the const UserDataContainer attached to this object.
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject bool osg::Object::getUserValue | ( | const std::string & | name, |
T & | value | ||
) | const |
Convinience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value. To use this template method you need to include the osg/ValueObject header.
provide implementation of osg::Object::getUserValue(..) template
References osg::UserDataContainer::getUserObject().
|
inlinevirtual |
Reimplemented in osg::BufferData, osg::DrawElementsUInt, osg::RefMatrixf, osg::BufferObject, osg::GraphicsContext, osg::DrawElementsUShort, osg::DrawElementsUByte, osg::RefMatrixd, osg::DrawArrayLengths, osg::Texture, osg::DrawArrays, osg::StateAttribute, osgShadow::ShadowVolumeGeometry, osg::IndexArray, osg::PrimitiveSet, osg::ShapeDrawable, osg::TemplateValueObject< T >, osg::Drawable, osg::Image, osg::Array, osg::Node, osgText::Font, osgFX::Effect, osgUtil::RenderBin, osgAnimation::MorphGeometry, osg::Shape, osg::Light, osg::AudioStream, osg::ClipPlane, osg::StateSet, osgParticle::ParticleProcessor, osgSim::ImpostorSprite, osgUtil::RenderStage, osgManipulator::AntiSquish, osgParticle::Program, osgShadow::OccluderGeometry, osg::Hint, osgParticle::Emitter, osgParticle::Operator, osgParticle::ParticleEffect, osgParticle::Interpolator, osgSim::Sector, osg::DrawPixels, osg::Geometry, osg::ImageSequence, osgParticle::Placer, osgParticle::PrecipitationEffect, osgParticle::Shooter, osgUtil::PositionalStateContainer, osg::AutoTransform, osgParticle::CenteredPlacer, osgText::Text, osg::ImageStream, osgText::TextBase, osg::ShaderAttribute, osgParticle::VariableRateCounter, osg::UserDataContainer, and osgParticle::Counter.
|
pure virtual |
return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.
Implemented in osg::BufferData, osg::DrawElementsUInt, osg::RefMatrixf, osg::BufferObject, osg::GraphicsContext, osg::DrawElementsUShort, osg::DrawElementsUByte, osg::RefMatrixd, osg::DrawArrayLengths, osg::Texture, osg::DrawArrays, osgViewer::GraphicsWindowEmbedded, osg::StateAttribute, osgShadow::ShadowVolumeGeometry, osg::PrimitiveSet, osg::ShapeDrawable, osg::TemplateValueObject< T >, osg::Drawable, osg::Image, osg::Array, osg::Node, osgText::Font, osgViewer::GraphicsWindowX11, osgFX::Effect, osgUtil::RenderBin, osg::Shape, osgAnimation::MorphGeometry, osg::Light, osg::AudioStream, osg::ClipPlane, osg::StateSet, osgSim::ImpostorSprite, osgParticle::ParticleProcessor, osgViewer::GraphicsWindow, osgShadow::OccluderGeometry, osg::Hint, osgParticle::Program, osg::DrawPixels, osgParticle::Emitter, osgParticle::Operator, osgParticle::ParticleEffect, osg::Geometry, osg::ImageSequence, osg::AutoTransform, osgParticle::Interpolator, osgText::Text, osgUtil::PositionalStateContainer, osgSim::Sector, osgText::TextBase, osgViewer::GraphicsWindowWin32, osgViewer::PixelBufferWin32, osg::ImageStream, osg::UserDataContainer, osgParticle::Placer, osg::ShaderAttribute, osgParticle::PrecipitationEffect, osgParticle::Shooter, osgViewer::PixelBufferX11, osgDB::Archive, osgParticle::CenteredPlacer, osgParticle::VariableRateCounter, osg::AudioSink, and osgParticle::Counter.
|
inlinevirtual |
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 in osg::BufferData, osg::Texture, osg::Camera, osg::BufferObject, osg::FrameBufferObject, osg::StateSet, osg::Node, osg::StateAttribute, osg::Drawable, osg::Geometry, osg::ShaderComponent, osgText::Text, osgText::TextBase, osgUtil::RenderStage, osg::RenderBuffer, osg::VertexProgram, osg::FragmentProgram, osgTerrain::TerrainTile, osg::Shader, osgText::Font, osg::Group, osgUtil::RenderBin, osg::Geode, osgSim::OverlayNode, osgText::Text3D, osg::OcclusionQueryNode, osgTerrain::TerrainTechnique, osg::Program, osg::QueryGeometry, osgTerrain::GeometryTechnique, and osg::ShaderAttribute.
|
inlinevirtual |
Resize any per context GLObject buffers to specified size.
Reimplemented in osg::PixelDataBufferObject, osg::BufferData, osg::Texture, osg::Camera, osg::BufferObject, osg::FrameBufferObject, osg::StateSet, osg::Node, osg::StateAttribute, osg::Drawable, osg::Geometry, osg::ShaderComponent, osgText::Text, osgText::GlyphTexture, osgText::TextBase, osg::RenderBuffer, osg::VertexProgram, osg::FragmentProgram, osg::Shader, osgText::Font, osg::Group, osg::Geode, osgSim::OverlayNode, osgText::Text3D, osg::Program, and osg::ShaderAttribute.
|
inline |
Set the data variance of this object. Can be set to either STATIC for values that do not change over the lifetime of the object, or DYNAMIC for values that vary over the lifetime of the object. The DataVariance value can be used by routines such as optimization codes that wish to share static data. UNSPECIFIED is used to specify that the DataVariance hasn't been set yet.
|
inlinevirtual |
Set the name of object using C++ style string.
Reimplemented in osg::Uniform.
Referenced by osgAnimation::AnimationUpdateCallback< osg::StateAttributeCallback >::AnimationUpdateCallback(), and osg::ValueObject::ValueObject().
|
inline |
Set the name of object using a C style string.
|
virtual |
Set whether to use a mutex to ensure ref() and unref() are thread safe.
Reimplemented from osg::Referenced.
Reimplemented in osg::StateSet, osg::Node, osg::Drawable, osgText::Text, osgText::GlyphTexture, osgText::TextBase, osgText::Font, osg::Group, osg::Geode, osgSim::OverlayNode, osgText::Text3D, osg::LightSource, osg::Program, and osg::TexGenNode.
|
virtual |
Set user data, data must be subclassed from Referenced to allow automatic memory handling. If your own data isn't directly subclassed from Referenced then create an adapter object which points to your own object and handles the memory addressing.
Reimplemented in osg::DefaultUserDataContainer, and osg::UserDataContainer.
void osg::Object::setUserDataContainer | ( | osg::UserDataContainer * | udc | ) |
set the UserDataContainer object.
void osg::Object::setUserValue | ( | const std::string & | name, |
const T & | value | ||
) |
Convinience method that creates the osg::TemplateValueObject<T> to store the specified value and adds it as a named UserObject. To use this template method you need to include the osg/ValueObject header.
provide implementation of osg::Object::setUserValue(..) template.
References osg::UserDataContainer::addUserObject(), osg::UserDataContainer::getUserObjectIndex(), and osg::UserDataContainer::setUserObject().
|
protected |
|
protected |
Referenced by osgWidget::NotifyWidget::focus(), osgWidget::NotifyWidget::keyPress(), osgWidget::NotifyWidget::keyRelease(), osgWidget::NotifyWidget::mouseDrag(), osgWidget::NotifyWidget::mouseEnter(), osgWidget::NotifyWidget::mouseLeave(), osgWidget::NotifyWidget::mouseOver(), osgWidget::NotifyWidget::mousePush(), osgWidget::NotifyWidget::mouseRelease(), osgWidget::NotifyWidget::mouseScroll(), and osgWidget::NotifyWidget::unfocus().
|
protected |