SoBase

Langue: en

Autres versions - même langue

Version: 318180 (ubuntu - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

Sommaire

NAME

SoBase -

SYNOPSIS


#include <Inventor/misc/SoBase.h>

Inherited by SoFieldContainer, and SoPath.

Detailed Description

The SoBase class is the top-level superclass for a number of class-hierarchies.

SoBase provides the basic interfaces and methods for doing reference counting, type identification and import/export. All classes in Coin which uses these mechanisms are descendent from this class.

One important issue with SoBase-derived classes is that they should not be statically allocated, neither in static module memory nor on function's stack-frames. SoBase-derived classes must always be allocated dynamically from the memory heap with the new operator.

This is so because SoBase-derived instances are reference counted, and will self-destruct on the approriate time. For this to work, they must be explicitly allocated in heap-memory. See the class documentation of SoNode for more information.

Public Member Functions


void ref (void) const

void unref (void) const

void unrefNoDelete (void) const

int32_t getRefCount (void) const

void touch (void)

virtual SoType getTypeId (void) const =0

SbBool isOfType (SoType type) const

virtual SbName getName (void) const

virtual void setName (const SbName &newname)

virtual void startNotify (void)

virtual void notify (SoNotList *l)

void addAuditor (void *const auditor, const SoNotRec::Type type)

void removeAuditor (void *const auditor, const SoNotRec::Type type)

const SoAuditorList & getAuditors (void) const

virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)

SbBool shouldWrite (void)

void assertAlive (void) const

Static Public Member Functions


static void initClass (void)

static SoType getClassTypeId (void)

static void addName (SoBase *const base, const char *const name)

static void removeName (SoBase *const base, const char *const name)

static void incrementCurrentWriteCounter (void)

static void decrementCurrentWriteCounter (void)

static SoBase * getNamedBase (const SbName &name, SoType type)

static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)

static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)

static void setInstancePrefix (const SbString &c)

static void setTraceRefs (SbBool trace)

static SbBool getTraceRefs (void)

static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)

static SbBool readRoute (SoInput *in)

Protected Types


enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }

Protected Member Functions


SoBase (void)

virtual ~SoBase ()

virtual void destroy (void)

SbBool hasMultipleWriteRefs (void) const

SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const

void writeFooter (SoOutput *out) const

virtual const char * getFileFormatName (void) const

virtual SbBool readInstance (SoInput *in, unsigned short flags)=0

Static Protected Member Functions


static uint32_t getCurrentWriteCounter (void)

static void staticDataLock (void)

static void staticDataUnlock (void)

Member Enumeration Documentation

enum SoBase::BaseFlags [protected]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Constructor & Destructor Documentation

SoBase::SoBase (void) [protected]

Constructor. The initial reference count will be set to zero.

References SoType::badType().

SoBase::~SoBase () [protected, virtual]

Destructor. There should not be any normal circumstance where you need to explicitly delete an object derived from the SoBase class, as the reference counting should take care of deallocating unused objects.

See also:

unref(), unrefNoDelete()

References SoDebugError::postInfo(), and SoAuditorList::remove().

Member Function Documentation

void SoBase::initClass (void) [static]

Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

Reimplemented in SoPath, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger, SoBoolOperation, SoCalculator, SoComposeMatrix, SoComposeRotation, SoComposeRotationFromTo, SoComposeVec2f, SoComposeVec3f, SoComposeVec4f, SoComputeBoundingBox, SoConcatenate, SoCounter, SoDecomposeMatrix, SoDecomposeRotation, SoDecomposeVec2f, SoDecomposeVec3f, SoDecomposeVec4f, SoElapsedTime, SoEngine, SoFieldConverter, SoGate, SoInterpolate, SoInterpolateFloat, SoInterpolateRotation, SoInterpolateVec2f, SoInterpolateVec3f, SoInterpolateVec4f, SoOnOff, SoOneShot, SoSelectOne, SoTimeCounter, SoTransformVec3f, SoTriggerAny, SoNodeEngine, SoFieldContainer, SoCenterballManip, SoClipPlaneManip, SoDirectionalLightManip, SoHandleBoxManip, SoJackManip, SoPointLightManip, SoSpotLightManip, SoTabBoxManip, SoTrackballManip, SoTransformBoxManip, SoTransformManip, SoTransformerManip, SoAppearanceKit, SoBaseKit, SoCameraKit, SoInteractionKit, SoLightKit, SoNodeKitListPart, SoSceneKit, SoSeparatorKit, SoShapeKit, SoWrapperKit, SoAnnotation, SoAntiSquish, SoArray, SoAsciiText, SoBaseColor, SoBlinker, SoBumpMapCoordinate, SoBumpMapTransform, SoBumpMap, SoCallback, SoCamera, SoClipPlane, SoColorIndex, SoComplexity, SoCone, SoCoordinate3, SoCoordinate4, SoCube, SoCylinder, SoDirectionalLight, SoDrawStyle, SoEnvironment, SoEventCallback, SoExtSelection, SoFaceSet, SoFile, SoFont, SoFontStyle, SoGroup, SoImage, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedNurbsCurve, SoIndexedNurbsSurface, SoIndexedShape, SoIndexedTriangleStripSet, SoInfo, SoLOD, SoLabel, SoLevelOfDetail, SoLight, SoLightModel, SoLineSet, SoLinearProfile, SoListener, SoLocateHighlight, SoMarkerSet, SoMaterial, SoMaterialBinding, SoMatrixTransform, SoMultipleCopy, SoNode, SoNonIndexedShape, SoNormal, SoNormalBinding, SoNurbsCurve, SoNurbsProfile, SoNurbsSurface, SoOrthographicCamera, SoPackedColor, SoPathSwitch, SoPendulum, SoPerspectiveCamera, SoPickStyle, SoPointLight, SoPointSet, SoPolygonOffset, SoProfile, SoProfileCoordinate2, SoProfileCoordinate3, SoQuadMesh, SoResetTransform, SoRotation, SoRotationXYZ, SoRotor, SoScale, SoSceneTexture2, SoSelection, SoSeparator, SoShape, SoShapeHints, SoShuttle, SoSphere, SoSpotLight, SoSurroundScale, SoSwitch, SoText2, SoText3, SoTexture2, SoTexture2Transform, SoTexture3, SoTexture3Transform, SoTextureCombine, SoTextureCoordinate2, SoTextureCoordinate3, SoTextureCoordinateBinding, SoTextureCoordinateCube, SoTextureCoordinateCylinder, SoTextureCoordinateDefault, SoTextureCoordinateEnvironment, SoTextureCoordinateFunction, SoTextureCoordinatePlane, SoTextureCoordinateSphere, SoTextureCubeMap, SoTextureScalePolicy, SoTextureUnit, SoTransform, SoTransformSeparator, SoTransformation, SoTranslation, SoTransparencyType, SoTriangleStripSet, SoUnits, SoVertexProperty, SoShaderProgram, SoShaderObject, SoVertexShader, SoFragmentShader, SoFrustumCamera, SoGeometryShader, SoVertexShape, SoWWWAnchor, SoWWWInline, SoVRMLAnchor, SoVRMLAppearance, SoVRMLAudioClip, SoVRMLBackground, SoVRMLBillboard, SoVRMLBox, SoVRMLCollision, SoVRMLColor, SoVRMLColorInterpolator, SoVRMLCone, SoVRMLCoordinate, SoVRMLCoordinateInterpolator, SoVRMLCylinder, SoVRMLCylinderSensor, SoVRMLDirectionalLight, SoVRMLDragSensor, SoVRMLElevationGrid, SoVRMLExtrusion, SoVRMLFog, SoVRMLFontStyle, SoVRMLGeometry, SoVRMLGroup, SoVRMLImageTexture, SoVRMLIndexedFaceSet, SoVRMLIndexedLine, SoVRMLIndexedLineSet, SoVRMLIndexedShape, SoVRMLInline, SoVRMLInterpolator, SoVRMLLOD, SoVRMLLight, SoVRMLMaterial, SoVRMLMovieTexture, SoVRMLNavigationInfo, SoVRMLNormal, SoVRMLNormalInterpolator, SoVRMLOrientationInterpolator, SoVRMLParent, SoVRMLPixelTexture, SoVRMLPlaneSensor, SoVRMLPointLight, SoVRMLPointSet, SoVRMLPositionInterpolator, SoVRMLProximitySensor, SoVRMLScalarInterpolator, SoVRMLScript, SoVRMLSensor, SoVRMLShape, SoVRMLSound, SoVRMLSphere, SoVRMLSphereSensor, SoVRMLSpotLight, SoVRMLSwitch, SoVRMLText, SoVRMLTexture, SoVRMLTextureCoordinate, SoVRMLTextureTransform, SoVRMLTimeSensor, SoVRMLTouchSensor, SoVRMLTransform, SoVRMLVertexLine, SoVRMLVertexPoint, SoVRMLVertexShape, SoVRMLViewpoint, SoVRMLVisibilitySensor, SoVRMLWorldInfo, SoShadowGroup, SoShadowStyle, SoShadowCulling, SoGeoOrigin, SoGeoSeparator, SoGeoLocation, and SoGeoCoordinate.

References SoType::badType(), and SoType::createType().

Referenced by SoDB::init().

void SoBase::ref (void) const

Increase the reference count of the object. This might be necessary to do explicitly from user code for certain situations (chiefly to avoid premature deletion), but is usually called from other instances within the Coin library when objects are made dependent on each other.

See the class documentation of SoNode for more extensive information about reference counting.

See also:

unref(), unrefNoDelete()

References assertAlive(), getName(), getTypeId(), objdata, SoDebugError::post(), SoDebugError::postInfo(), and referencecount.

Referenced by SoEngineOutput::addConnection(), SoFieldContainer::addCopy(), SoSelection::addPath(), SoSearchAction::addPath(), SoBaseList::addReferences(), SoBaseList::append(), SoAction::apply(), SoGroup::audioRender(), SoField::connectFrom(), SoNodeKitDetail::copy(), SoNode::copy(), SoEngine::copy(), SoVRMLTouchSensor::handleEvent(), SoSelection::handleEvent(), SoLocateHighlight::handleEvent(), SoFieldContainer::hasDefaultValues(), SoVRMLParent::initClass(), SoBaseList::insert(), SoSFPath::notify(), SoMFPath::notify(), SoDataSensor::notify(), SoDB::read(), read(), SoNodekitCatalog::recursiveSearch(), SoBaseKit::search(), SoBaseList::set(), SoNodeKitDetail::setNodeKit(), SoNodeKitDetail::setPart(), SoEventCallback::setPath(), SoFieldContainer::setToDefaults(), SoPickedPoint::SoPickedPoint(), SoDebug::write(), and SoDebug::writeToFile().

void SoBase::unref (void) const

Decrease the reference count of an object. If the reference count reaches zero, the object will delete itself. Be careful when explicitly calling this method, beware that you usually need to match user level calls to ref() with calls to either unref() or unrefNoDelete() to avoid memory leaks.

See also:

ref(), unrefNoDelete()

References assertAlive(), destroy(), getName(), getTypeId(), objdata, SoDebugError::postInfo(), SoDebugError::postWarning(), and referencecount.

Referenced by SoSearchAction::addPath(), SoBaseList::addReferences(), SoSearchAction::beginTraversal(), SoField::connectFrom(), SoField::disconnect(), SoVRMLTouchSensor::handleEvent(), SoSelection::handleEvent(), SoFieldContainer::hasDefaultValues(), SoEventCallback::initClass(), SoSFPath::notify(), SoMFPath::notify(), SoDataSensor::notify(), SoDB::read(), read(), SoNodekitCatalog::recursiveSearch(), SoEngineOutput::removeConnection(), SoSearchAction::reset(), SoBaseKit::search(), SoNodeKitDetail::setNodeKit(), SoNodeKitDetail::setPart(), SoSceneManager::setSceneGraph(), SoFieldContainer::setToDefaults(), SoDataSensor::trigger(), SoDataSensor::~SoDataSensor(), SoNodeKitDetail::~SoNodeKitDetail(), and SoPickedPoint::~SoPickedPoint().

void SoBase::unrefNoDelete (void) const

Decrease reference count, but do not delete ourself if the count reaches zero.

See also:

unref()

References assertAlive(), getName(), getTypeId(), objdata, SoDebugError::postInfo(), and referencecount.

Referenced by SoAction::apply(), SoNode::copy(), SoEngine::copy(), SoDebug::write(), and SoDebug::writeToFile().

int32_t SoBase::getRefCount (void) const

Returns number of objects referring to this object.

Referenced by SoAction::apply(), and SoEventCallback::setPath().

void SoBase::touch (void)

Force an update, in the sense that all objects connected to this object as an auditor will have to re-check the values of their inter-dependent data.

This is often used as an effective way of manually triggering a redraw by application programmers.

References startNotify().

Referenced by SoLocateHighlight::handleEvent(), and SoExtSelection::wasShiftDown().

SoType SoBase::getTypeId (void) const [pure virtual]

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting.

Usage example:

   void foo(SoNode * node)
   {
     if (node->getTypeId() == SoFile::getClassTypeId()) {
       SoFile * filenode = (SoFile *)node;  // safe downward cast, knows the type
     }
     else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
       SoGroup * group = (SoGroup *)node;  // safe downward cast, knows the type
     }
   }
 

For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.

For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.

Implemented in SoPath, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger, SoBoolOperation, SoCalculator, SoComposeMatrix, SoComposeRotation, SoComposeRotationFromTo, SoComposeVec2f, SoComposeVec3f, SoComposeVec4f, SoComputeBoundingBox, SoConcatenate, SoCounter, SoDecomposeMatrix, SoDecomposeRotation, SoDecomposeVec2f, SoDecomposeVec3f, SoDecomposeVec4f, SoElapsedTime, SoFieldConverter, SoGate, SoInterpolate, SoInterpolateFloat, SoInterpolateRotation, SoInterpolateVec2f, SoInterpolateVec3f, SoInterpolateVec4f, SoOnOff, SoOneShot, SoSelectOne, SoTimeCounter, SoTransformVec3f, SoTriggerAny, SoCenterballManip, SoClipPlaneManip, SoDirectionalLightManip, SoHandleBoxManip, SoJackManip, SoPointLightManip, SoSpotLightManip, SoTabBoxManip, SoTrackballManip, SoTransformBoxManip, SoTransformManip, SoTransformerManip, SoAppearanceKit, SoBaseKit, SoCameraKit, SoInteractionKit, SoLightKit, SoNodeKitListPart, SoSceneKit, SoSeparatorKit, SoShapeKit, SoWrapperKit, SoAnnotation, SoAntiSquish, SoArray, SoAsciiText, SoBaseColor, SoBlinker, SoBumpMapCoordinate, SoBumpMapTransform, SoBumpMap, SoCallback, SoCamera, SoClipPlane, SoColorIndex, SoComplexity, SoCone, SoCoordinate3, SoCoordinate4, SoCube, SoCylinder, SoDirectionalLight, SoDrawStyle, SoEnvironment, SoEventCallback, SoExtSelection, SoFaceSet, SoFile, SoFont, SoFontStyle, SoGroup, SoImage, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedNurbsCurve, SoIndexedNurbsSurface, SoIndexedShape, SoIndexedTriangleStripSet, SoInfo, SoLOD, SoLabel, SoLevelOfDetail, SoLight, SoLightModel, SoLineSet, SoLinearProfile, SoListener, SoLocateHighlight, SoMarkerSet, SoMaterial, SoMaterialBinding, SoMatrixTransform, SoMultipleCopy, SoNonIndexedShape, SoNormal, SoNormalBinding, SoNurbsCurve, SoNurbsProfile, SoNurbsSurface, SoOrthographicCamera, SoPackedColor, SoPathSwitch, SoPendulum, SoPerspectiveCamera, SoPickStyle, SoPointLight, SoPointSet, SoPolygonOffset, SoProfile, SoProfileCoordinate2, SoProfileCoordinate3, SoQuadMesh, SoResetTransform, SoRotation, SoRotationXYZ, SoRotor, SoScale, SoSceneTexture2, SoSelection, SoSeparator, SoShape, SoShapeHints, SoShuttle, SoSphere, SoSpotLight, SoSurroundScale, SoSwitch, SoText2, SoText3, SoTexture2, SoTexture2Transform, SoTexture3, SoTexture3Transform, SoTextureCombine, SoTextureCoordinate2, SoTextureCoordinate3, SoTextureCoordinateBinding, SoTextureCoordinateCube, SoTextureCoordinateCylinder, SoTextureCoordinateDefault, SoTextureCoordinateEnvironment, SoTextureCoordinateFunction, SoTextureCoordinatePlane, SoTextureCoordinateSphere, SoTextureCubeMap, SoTextureScalePolicy, SoTextureUnit, SoTransform, SoTransformSeparator, SoTransformation, SoTranslation, SoTransparencyType, SoTriangleStripSet, SoUnits, SoVertexProperty, SoShaderProgram, SoShaderObject, SoVertexShader, SoFragmentShader, SoFrustumCamera, SoGeometryShader, SoVertexShape, SoWWWAnchor, SoWWWInline, SoVRMLAnchor, SoVRMLAppearance, SoVRMLAudioClip, SoVRMLBackground, SoVRMLBillboard, SoVRMLBox, SoVRMLCollision, SoVRMLColor, SoVRMLColorInterpolator, SoVRMLCone, SoVRMLCoordinate, SoVRMLCoordinateInterpolator, SoVRMLCylinder, SoVRMLCylinderSensor, SoVRMLDirectionalLight, SoVRMLDragSensor, SoVRMLElevationGrid, SoVRMLExtrusion, SoVRMLFog, SoVRMLFontStyle, SoVRMLGeometry, SoVRMLGroup, SoVRMLImageTexture, SoVRMLIndexedFaceSet, SoVRMLIndexedLine, SoVRMLIndexedLineSet, SoVRMLIndexedShape, SoVRMLInline, SoVRMLInterpolator, SoVRMLLOD, SoVRMLLight, SoVRMLMaterial, SoVRMLMovieTexture, SoVRMLNavigationInfo, SoVRMLNormal, SoVRMLNormalInterpolator, SoVRMLOrientationInterpolator, SoVRMLParent, SoVRMLPixelTexture, SoVRMLPlaneSensor, SoVRMLPointLight, SoVRMLPointSet, SoVRMLPositionInterpolator, SoVRMLProximitySensor, SoVRMLScalarInterpolator, SoVRMLScript, SoVRMLSensor, SoVRMLShape, SoVRMLSound, SoVRMLSphere, SoVRMLSphereSensor, SoVRMLSpotLight, SoVRMLSwitch, SoVRMLText, SoVRMLTexture, SoVRMLTextureCoordinate, SoVRMLTextureTransform, SoVRMLTimeSensor, SoVRMLTouchSensor, SoVRMLTransform, SoVRMLVertexLine, SoVRMLVertexPoint, SoVRMLVertexShape, SoVRMLViewpoint, SoVRMLVisibilitySensor, SoVRMLWorldInfo, SoShadowGroup, SoShadowStyle, SoShadowCulling, SoGeoOrigin, SoGeoSeparator, SoGeoLocation, and SoGeoCoordinate.

Referenced by SoGLRenderAction::abortNow(), SoFieldData::addField(), SoNode::addToCopyDict(), addWriteReference(), SoPath::append(), SoNotList::append(), SoField::connectFrom(), SoEngine::copy(), destroy(), SoField::disconnect(), SoFieldContainer::findCopy(), getFileFormatName(), SoNode::GLRenderS(), SoFieldContainer::hasDefaultValues(), SoCallbackAction::invokePostCallbacks(), SoCallbackAction::invokePreCallbacks(), SoEngineOutput::isNodeEngineOutput(), isOfType(), SoNodeEngine::notify(), SoNode::notify(), SoEngine::notify(), SoNotRec::print(), SoFieldData::read(), SoField::read(), SoDB::read(), read(), SoField::readConnection(), SoFieldData::readFieldDescriptions(), SoInteractionKit::readInstance(), ref(), SoPath::removeIndex(), SoChildList::removePathAuditor(), SoPath::replaceIndex(), SoOutput::resolveRoutes(), SoNode::search(), SoBaseKit::search(), SoInteractionKit::setAnySurrogatePath(), SoBaseKit::setPart(), SoFieldContainer::setToDefaults(), SoEngine::shouldCopy(), SoAction::traverse(), unref(), unrefNoDelete(), and writeHeader().

SbBool SoBase::isOfType (SoType type) const

Returns TRUE if the type of this object is either of the same type or inherited from type.

References getTypeId(), and SoType::isDerivedFrom().

Referenced by SoEngineOutput::addConnection(), SoFieldData::addField(), SoNode::addToCopyDict(), SoNotList::append(), SoInput::checkISReference(), SoField::connectFrom(), SoNode::copyContents(), SoVRMLScript::copyContents(), SoDB::createRoute(), SoField::disconnect(), SoFieldContainer::findCopy(), SoBaseKit::getAnyPart(), SoBaseKit::getContainerNode(), SoEngineOutput::getForwardConnections(), SoFieldData::getIndex(), SoNodeKitPath::getLength(), getNamedBase(), getNamedBases(), SoNodeKitPath::getNode(), SoNodeKitPath::getNodeFromTail(), SoRotateSphericalDragger::getProjector(), SoRotateCylindricalDragger::getProjector(), SoNodeKitPath::getTail(), SoPath::isRelevantNotification(), SoShadowGroup::notify(), SoDataSensor::notify(), SoNodeKitPath::pop(), SoNotList::print(), SoDB::read(), SoField::readConnection(), SoSFPath::referencesCopy(), SoSFNode::referencesCopy(), SoSFEngine::referencesCopy(), SoField::referencesCopy(), SoEngineOutput::removeConnection(), SoDB::removeRoute(), SoBaseKit::set(), SoBaseKit::setAnyPart(), SoInteractionKit::setAnySurrogatePath(), SoField::shouldWrite(), SoNodeKitPath::SoNodeKitPath(), SoNodeKitPath::truncate(), SoNode::write(), SoField::write(), SoField::writeConnection(), and writeHeader().

SoType SoBase::getClassTypeId (void) [static]

This static method returns the SoType object associated with objects of this class.

Reimplemented in SoPath, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger, SoBoolOperation, SoCalculator, SoComposeMatrix, SoComposeRotation, SoComposeRotationFromTo, SoComposeVec2f, SoComposeVec3f, SoComposeVec4f, SoComputeBoundingBox, SoConcatenate, SoCounter, SoDecomposeMatrix, SoDecomposeRotation, SoDecomposeVec2f, SoDecomposeVec3f, SoDecomposeVec4f, SoElapsedTime, SoEngine, SoFieldConverter, SoGate, SoInterpolate, SoInterpolateFloat, SoInterpolateRotation, SoInterpolateVec2f, SoInterpolateVec3f, SoInterpolateVec4f, SoOnOff, SoOneShot, SoSelectOne, SoTimeCounter, SoTransformVec3f, SoTriggerAny, SoNodeEngine, SoFieldContainer, SoCenterballManip, SoClipPlaneManip, SoDirectionalLightManip, SoHandleBoxManip, SoJackManip, SoPointLightManip, SoSpotLightManip, SoTabBoxManip, SoTrackballManip, SoTransformBoxManip, SoTransformManip, SoTransformerManip, SoAppearanceKit, SoBaseKit, SoCameraKit, SoInteractionKit, SoLightKit, SoNodeKitListPart, SoSceneKit, SoSeparatorKit, SoShapeKit, SoWrapperKit, SoAnnotation, SoAntiSquish, SoArray, SoAsciiText, SoBaseColor, SoBlinker, SoBumpMapCoordinate, SoBumpMapTransform, SoBumpMap, SoCallback, SoCamera, SoClipPlane, SoColorIndex, SoComplexity, SoCone, SoCoordinate3, SoCoordinate4, SoCube, SoCylinder, SoDirectionalLight, SoDrawStyle, SoEnvironment, SoEventCallback, SoExtSelection, SoFaceSet, SoFile, SoFont, SoFontStyle, SoGroup, SoImage, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedNurbsCurve, SoIndexedNurbsSurface, SoIndexedShape, SoIndexedTriangleStripSet, SoInfo, SoLOD, SoLabel, SoLevelOfDetail, SoLight, SoLightModel, SoLineSet, SoLinearProfile, SoListener, SoLocateHighlight, SoMarkerSet, SoMaterial, SoMaterialBinding, SoMatrixTransform, SoMultipleCopy, SoNode, SoNonIndexedShape, SoNormal, SoNormalBinding, SoNurbsCurve, SoNurbsProfile, SoNurbsSurface, SoOrthographicCamera, SoPackedColor, SoPathSwitch, SoPendulum, SoPerspectiveCamera, SoPickStyle, SoPointLight, SoPointSet, SoPolygonOffset, SoProfile, SoProfileCoordinate2, SoProfileCoordinate3, SoQuadMesh, SoResetTransform, SoRotation, SoRotationXYZ, SoRotor, SoScale, SoSceneTexture2, SoSelection, SoSeparator, SoShape, SoShapeHints, SoShuttle, SoSphere, SoSpotLight, SoSurroundScale, SoSwitch, SoText2, SoText3, SoTexture2, SoTexture2Transform, SoTexture3, SoTexture3Transform, SoTextureCombine, SoTextureCoordinate2, SoTextureCoordinate3, SoTextureCoordinateBinding, SoTextureCoordinateCube, SoTextureCoordinateCylinder, SoTextureCoordinateDefault, SoTextureCoordinateEnvironment, SoTextureCoordinateFunction, SoTextureCoordinatePlane, SoTextureCoordinateSphere, SoTextureCubeMap, SoTextureScalePolicy, SoTextureUnit, SoTransform, SoTransformSeparator, SoTransformation, SoTranslation, SoTransparencyType, SoTriangleStripSet, SoUnits, SoVertexProperty, SoShaderProgram, SoShaderObject, SoVertexShader, SoFragmentShader, SoFrustumCamera, SoGeometryShader, SoVertexShape, SoWWWAnchor, SoWWWInline, SoVRMLAnchor, SoVRMLAppearance, SoVRMLAudioClip, SoVRMLBackground, SoVRMLBillboard, SoVRMLBox, SoVRMLCollision, SoVRMLColor, SoVRMLColorInterpolator, SoVRMLCone, SoVRMLCoordinate, SoVRMLCoordinateInterpolator, SoVRMLCylinder, SoVRMLCylinderSensor, SoVRMLDirectionalLight, SoVRMLDragSensor, SoVRMLElevationGrid, SoVRMLExtrusion, SoVRMLFog, SoVRMLFontStyle, SoVRMLGeometry, SoVRMLGroup, SoVRMLImageTexture, SoVRMLIndexedFaceSet, SoVRMLIndexedLine, SoVRMLIndexedLineSet, SoVRMLIndexedShape, SoVRMLInline, SoVRMLInterpolator, SoVRMLLOD, SoVRMLLight, SoVRMLMaterial, SoVRMLMovieTexture, SoVRMLNavigationInfo, SoVRMLNormal, SoVRMLNormalInterpolator, SoVRMLOrientationInterpolator, SoVRMLParent, SoVRMLPixelTexture, SoVRMLPlaneSensor, SoVRMLPointLight, SoVRMLPointSet, SoVRMLPositionInterpolator, SoVRMLProximitySensor, SoVRMLScalarInterpolator, SoVRMLScript, SoVRMLSensor, SoVRMLShape, SoVRMLSound, SoVRMLSphere, SoVRMLSphereSensor, SoVRMLSpotLight, SoVRMLSwitch, SoVRMLText, SoVRMLTexture, SoVRMLTextureCoordinate, SoVRMLTextureTransform, SoVRMLTimeSensor, SoVRMLTouchSensor, SoVRMLTransform, SoVRMLVertexLine, SoVRMLVertexPoint, SoVRMLVertexShape, SoVRMLViewpoint, SoVRMLVisibilitySensor, SoVRMLWorldInfo, SoShadowGroup, SoShadowStyle, SoShadowCulling, SoGeoOrigin, SoGeoSeparator, SoGeoLocation, and SoGeoCoordinate.

Referenced by SoPath::initClass(), SoFieldContainer::initClass(), and SoDB::read().

SbName SoBase::getName (void) const [virtual]

Returns name of object. If no name has been given to this object, the returned SbName will contain the empty string.

Referenced by SoGLRenderAction::abortNow(), SoNode::addToCopyDict(), addWriteReference(), SoNotList::append(), SoField::connectFrom(), SoFieldContainer::copyContents(), SoDB::createRoute(), destroy(), SoVRMLLOD::GLRenderBelowPath(), SoIndexedShape::initClass(), SoNodeEngine::notify(), SoNode::notify(), SoEngine::notify(), SoNotRec::print(), SoDebug::printName(), SoBaseKit::printTable(), SoAction::pushCurPath(), ref(), SoDB::removeRoute(), SoOutput::resolveRoutes(), SoNode::search(), SoInteractionKit::setAnySurrogatePath(), setName(), SoEngine::shouldCopy(), unref(), unrefNoDelete(), and writeHeader().

void SoBase::setName (const SbName & newname) [virtual]

Set the name of this object.

Some characters are invalid to use as parts of names for SoBase derived objects, as object names needs to be consistent with the syntax of Inventor and VRML files upon file export / import operations (so one must for instance avoid using special token characters).

Invalid characters will be automatically replaced by underscore characters. If the name starts with an invalid character, the new name will be preceded by an underscore character.

For the exact definitions of what constitutes legal and illegal characters for SoBase names, see the SbName functions listed below.

See also:

getName(), SbName::isBaseNameStartChar(), SbName::isBaseNameChar()

References addName(), SbName::getLength(), getName(), SbString::getString(), SbName::getString(), SbName::isBaseNameChar(), SbName::isBaseNameStartChar(), SoDebugError::postWarning(), and removeName().

Referenced by SoFieldContainer::copyContents().

void SoBase::addName (SoBase *const b, const char *const name) [static]

Adds a name<->object mapping to the global dictionary.

References SbPList::append().

Referenced by setName().

void SoBase::removeName (SoBase *const b, const char *const name) [static]

Removes a name<->object mapping from the global dictionary.

References SbPList::find(), and SbPList::remove().

Referenced by destroy(), and setName().

void SoBase::startNotify (void) [virtual]

This is the method which starts the notification sequence after changes.

At the end of a notification sequence, all 'immediate' sensors (i.e. sensors set up with a zero priority) are triggered.

Reimplemented in SoNode.

References SoNotList::append(), SoDB::endNotify(), notify(), SoNotList::setLastType(), and SoDB::startNotify().

Referenced by SoPath::operator=(), SoNode::startNotify(), and touch().

void SoBase::notify (SoNotList * l) [virtual]

Notifies all auditors for this instance when changes are made.

Reimplemented in SoEngine, SoNodeEngine, SoFieldContainer, SoAsciiText, SoBlinker, SoBumpMap, SoImage, SoLOD, SoLevelOfDetail, SoMaterial, SoNode, SoPackedColor, SoSceneTexture2, SoSeparator, SoShape, SoSwitch, SoText3, SoTexture2, SoTexture3, SoTextureCubeMap, SoVertexProperty, SoVertexShape, SoVRMLAppearance, SoVRMLBillboard, SoVRMLCollision, SoVRMLElevationGrid, SoVRMLExtrusion, SoVRMLGeometry, SoVRMLGroup, SoVRMLIndexedLine, SoVRMLIndexedShape, SoVRMLLOD, SoVRMLParent, SoVRMLPixelTexture, SoVRMLProximitySensor, SoVRMLScript, SoVRMLShape, SoVRMLSwitch, SoVRMLText, SoVRMLTimeSensor, SoVRMLTouchSensor, SoVRMLTransform, SoVRMLVertexLine, SoVRMLVertexPoint, SoVRMLVertexShape, and SoShadowGroup.

References assertAlive(), and SoDebugError::postInfo().

Referenced by SoFieldContainer::notify(), and startNotify().

void SoBase::addAuditor (void *const auditor, const SoNotRec::Type type)

Add an auditor to notify whenever the object changes in any significant way.

See also:

removeAuditor()

Referenced by SoChildList::append(), SoNodeSensor::attach(), SoChildList::insert(), SoSFPath::notify(), SoMFPath::notify(), and SoChildList::set().

void SoBase::removeAuditor (void *const auditor, const SoNotRec::Type type)

Remove an auditor from the list. auditor will then no longer be notified whenever any updates are made to this object.

See also:

addAuditor()

Referenced by SoNodeSensor::detach(), SoSFPath::notify(), SoMFPath::notify(), SoChildList::remove(), SoChildList::set(), and SoChildList::truncate().

const SoAuditorList & SoBase::getAuditors (void) const

Returns list of objects auditing this object.

See also:

addAuditor(), removeAuditor()

References SoAuditorList::getLength(), and SoAuditorList::remove().

void SoBase::addWriteReference (SoOutput * out, SbBool isfromfield = 0) [virtual]

This method is used during the first write pass of a write action to count the number of references to this object in the scene graph.

Reimplemented in SoFieldContainer, and SoBaseKit.

References getName(), SoOutput::getStage(), getTypeId(), and SoDebugError::postInfo().

Referenced by SoFieldContainer::addWriteReference(), and SoPath::write().

SbBool SoBase::shouldWrite (void)

Returns TRUE if this object should be written out during a write action. Will return FALSE if no references to this object has been made in the scene graph.

Note that connections from the fields of fieldcontainer objects is not alone a valid reason for writing out the object -- there must also be at least one reference directly from another SoBase (like a parent/child relationship, for instance).

This method will return a valid result only during the second pass of write actions.

void SoBase::incrementCurrentWriteCounter (void) [static]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

void SoBase::decrementCurrentWriteCounter (void) [static]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

SoBase * SoBase::getNamedBase (const SbName & name, SoType type) [static]

Returns the object of type, or derived from type, registered under name. If several has been registered under the same name with the same type, returns the last one which was registered.

If no object of a valid type or subtype has been registered with the given name, returns NULL.

References SbPList::getLength(), and isOfType().

Referenced by SoInput::findReference(), SoPath::getByName(), SoNode::getByName(), and SoEngine::getByName().

int SoBase::getNamedBases (const SbName & name, SoBaseList & baselist, SoType type) [static]

Returns the number of objects of type type, or derived from type, registered under name.

All matches will also be appended to baselist.

References SoBaseList::append(), SbPList::getLength(), and isOfType().

Referenced by SoPath::getByName(), SoNode::getByName(), and SoEngine::getByName().

SbBool SoBase::read (SoInput * in, SoBase *& base, SoType expectedtype) [static]

Read next SoBase derived instance from the in stream, check that it is derived from expectedtype and place a pointer to the newly allocated instance in base.

FALSE is returned on read errors, mismatch with the expectedtype, or if there are attempts at referencing (through the USE keyword) unknown instances.

If we return TRUE with base equal to NULL, three things might have happened:

1. End-of-file. Use SoInput::eof() after calling this method to detect end-of-file conditions.

2. in didn't have a valid identifier name at the stream for us to read. This happens either in the case of errors, or when all child nodes of a group has been read. Check if the next character in the stream is a '}' to detect the latter case.

3. A child was given as the NULL keyword. This can happen when reading the contents of SoSFNode fields (note that NULL is not allowed for SoMFNode)

If TRUE is returned and base is not NULL upon return, the instance was allocated and initialized according to what was read from the in stream.

References SoType::badType(), SoType::getName(), SbName::getString(), getTypeId(), SoType::isDerivedFrom(), SoReadError::post(), SoDebugError::postInfo(), SoInput::read(), readRoute(), ref(), and unref().

Referenced by SoDB::read(), and SoField::readConnection().

void SoBase::setInstancePrefix (const SbString & c) [static]

Referenced instances of SoBase are written as 'DEF NamePrefixNumber' when exported. 'Name' is the name of the base instance from setName(), 'Prefix' is common for all objects and can be set by this method (default is '+'), and 'Number' is a unique id which is necessary if multiple objects have the same name.

If you want the prefix to be something else than '+', use this method.

void SoBase::setTraceRefs (SbBool trace) [static]

Set to TRUE to activate debugging of reference counting, which could aid in finding hard to track down problems with accesses to freed memory or memory leaks. Note: this will produce lots of debug information in any 'normal' running system, so use sensibly.

The reference tracing functionality will be disabled in 'release versions' of the Coin library.

SbBool SoBase::getTraceRefs (void) [static]

Return the status of the reference tracing flag.

See also:

setTraceRefs()

SbBool SoBase::connectRoute (SoInput * in, const SbName & fromnodename, const SbName & fromfieldname, const SbName & tonodename, const SbName & tofieldname) [static]

Connect a route from the node named fromnodename's field fromfieldname to the node named tonodename's field tofieldname. This method will consider the fields types (event in, event out, etc) when connecting.

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Since:

Coin 2.0

References SoDB::createRoute(), SoNode::getByName(), and SbName::getString().

Referenced by readRoute().

void SoBase::assertAlive (void) const

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

There are 4 bits allocated for each SoBase-object for a bitpattern that indicates the object is still 'alive'. The pattern is changed when the object is destructed. If this method is then called after destruction, an assert will hit.

This is used internally in Coin (in for instance SoBase::ref()) to try to detect when the instance has been prematurely destructed. This is a very common mistake to make by application programmers (letting the refcount dip to zero before it should, that is), so the extra piece of assistance through the accompanying assert() in this method to detect dangling references to the object, with subsequent memory corruption and mysterious crashes, should be a Good Thing.

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Since:

Coin 2.0

References SoDebugError::post().

Referenced by SoSFPath::fixCopy(), SoSFNode::fixCopy(), SoSFEngine::fixCopy(), SoMFPath::fixCopy(), SoMFNode::fixCopy(), SoMFEngine::fixCopy(), SoField::notify(), notify(), ref(), unref(), and unrefNoDelete().

SbBool SoBase::readRoute (SoInput * in) [static]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Reads a (VRML97) ROUTE. We decided to also add support for routes in Coin, as a generic feature, since we think it is nicer than setting up field connections inside the nodes.

References SoInput::addRoute(), connectRoute(), SoNode::getByName(), SoInput::getCurrentProto(), SbName::getString(), SbString::getString(), SoReadError::post(), SoDebugError::postInfo(), and SoInput::read().

Referenced by SoFieldData::read(), and read().

void SoBase::destroy (void) [protected, virtual]

Cleans up all hanging references to and from this instance, and then commits suicide.

Called automatically when the reference count goes to zero.

References SbName::getLength(), SbList< Type >::getLength(), SoType::getName(), getName(), SbName::getString(), getTypeId(), SoDebugError::postInfo(), and removeName().

Referenced by unref().

SbBool SoBase::hasMultipleWriteRefs (void) const [protected]

Returns TRUE if this object will be written more than once upon export. Note that the result from this method is only valid during the second pass of a write action (and partly during the COUNT_REFS pass).

Referenced by SoSwitch::write(), and SoPath::write().

SbBool SoBase::writeHeader (SoOutput * out, SbBool isgroup, SbBool isengine) const [protected]

Write out the header of any SoBase derived object. The header consists of the DEF keyword and the object name (if the object has a name, otherwise these will be skipped), the class name and a left bracket.

Alternatively, the object representation may be made up of just the USE keyword plus the object name, if this is the second or subsequent reference written to the file.

If the object has been completed just by writing the header (which will be the case if we're writing multiple references of an object), we return TRUE, otherwise FALSE.

If we return FALSE (i.e. there's more to write), we will increment the indentation level.

See also:

writeFooter(), SoOutput::indent()

References SoOutput::findReference(), SoNode::getClassTypeId(), getFileFormatName(), SbString::getLength(), SbName::getLength(), getName(), SbString::getString(), SbName::getString(), SbString::getSubString(), getTypeId(), SoOutput::incrementIndent(), SoOutput::indent(), SoOutput::isBinary(), isOfType(), SoOutput::pimpl, SoDebugError::postInfo(), SbString::sprintf(), SoNode::VRML2, and SoOutput::write().

Referenced by SoPath::write(), SoNode::write(), SoVRMLScript::write(), and SoEngine::writeInstance().

void SoBase::writeFooter (SoOutput * out) const [protected]

This method will terminate the block representing an SoBase derived object.

References SoOutput::decrementIndent(), SoOutput::indent(), SoOutput::isBinary(), and SoOutput::write().

Referenced by SoPath::write(), SoNode::write(), SoVRMLScript::write(), and SoEngine::writeInstance().

const char * SoBase::getFileFormatName (void) const [protected, virtual]

Returns the class name this object should be written under. Default string returned is the name of the class from the type system.

User extensions nodes and engines override this method to return the name of the extension (instead of 'UnknownNode' or 'UnknownEngine').

References SoType::getName(), SbName::getString(), and getTypeId().

Referenced by writeHeader().

SbBool SoBase::readInstance (SoInput * in, unsigned short flags) [protected, pure virtual]

This method is mainly intended for internal use during file import operations.

It reads a definition of an instance from the input stream in. The input stream state points to the start of a serialized / persistant representation of an instance of this class type.

TRUE or FALSE is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not. The import process should be robust and handle corrupted input streams by returning FALSE.

flags is used internally during binary import when reading user extension nodes, group nodes or engines.

Implemented in SoEngine, SoNodeEngine, SoFieldContainer, SoBaseKit, SoInteractionKit, SoNodeKitListPart, SoBumpMap, SoFile, SoGroup, SoImage, SoNode, SoNormalBinding, SoSeparator, SoTexture2, SoTexture3, SoTextureCoordinateBinding, SoTextureCubeMap, SoShaderObject, SoWWWInline, SoVRMLImageTexture, SoVRMLLOD, SoVRMLParent, SoVRMLPixelTexture, and SoVRMLSwitch.

uint32_t SoBase::getCurrentWriteCounter (void) [static, protected]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

SoBase::staticDataLock (void) [static, protected]

For internal use only.

Since:
Coin 2.3

Referenced by SoPackedColor::doAction(), SoBaseColor::doAction(), and SoVRMLColor::doAction().

SoBase::staticDataUnlock (void) [static, protected]

For internal use only.

Since:
Coin 2.3

Referenced by SoPackedColor::doAction(), SoBaseColor::doAction(), and SoVRMLColor::doAction().

Author

Generated automatically by Doxygen for Coin from the source code.