SoBase(3)
hey bestie!! β¨ welcome to the SoBase(3) glow-up, part 1 of 4. this is the manual page for the SoBase class, and we're gonna make it make sense. no cap, every detail stays, just with more sparkle. let's go π
πΈ NAME πΈ
SoBase β The SoBase class is the top-level superclass for a number of class-hierarchies. it's giving main character energy for like a whole bunch of hierarchies, fr fr. π
β¨ SYNOPSIS β¨
okay so here's the vibe check on how you include it and what's inside:
#include <Inventor/misc/SoBase.h>
Inherited by SoFieldContainer, and SoPath.
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)
π Detailed Description π
so, the SoBase class is the top-level superclass for a number of class-hierarchies. periodt. π
SoBase hands you the basic interfaces and methods for reference counting, type identification, and import/export. literally every class in Coin that uses these mechanisms is a descendent of this class. iykyk.
β οΈ big important thing: SoBase-derived classes should NOT be statically allocated. not in static module memory, not on function's stack-frames. nope. they must always be allocated dynamically from the memory heap with the new operator. that's the rule, bestie.
why? because SoBase-derived instances are reference counted and will self-destruct at the approriate time. for that to work, they have to be explicitly allocated in heap-memory. check the class documentation of SoNode for more info. π
π Member Enumeration Documentation π
enum SoBase::BaseFlags [protected]
this API member is considered internal to the library, lowkey. it's not likely to be of interest to the application programmer. so if you're just vibing with the public API, you can skip this one. but it's here for completeness. π
ποΈ Constructor & Destructor Documentation ποΈ
SoBase::SoBase (void ) [protected]
constructor. the initial reference count is set to zero. that's it. simple. β¨
- References:
SoType::badType() - Referenced by:
addName(),SoNode::getByName(),SoPath::getByName(),getNamedBase(),getNamedBases(),SoBaseKit::getPartString(),getTypeId(),SoPath::isRelevantNotification(),SoFieldContainer::notify(),read(),SoGroup::readChildren(),readInstance(),ref(),removeName(),unref(),unrefNoDelete(), andwriteHeader()
SoBase::~SoBase () [protected], [virtual]
destructor. bestie, there should not be any normal circumstance where you need to explicitly delete an object derived from the SoBase class. the reference counting should take care of deallocating unused objects. so don't do it unless you know what you're doing. π
- See also:
unref(),unrefNoDelete() - References:
SoDebugError::postInfo(), andSoAuditorList::remove()
π οΈ Member Function Documentation π οΈ
void SoBase::initClass (void ) [static]
sets up initialization for data common to all instances of this class. like, it submits the necessary info to the Coin type system. you know, the usual. β¨
- References:
SoType::badType(), andSoType::createType() - Referenced by:
SoDB::init(),SoInteraction::init(),SoNodeKit::init(),SoEngine::initClasses(), andSoNode::initClasses()
void SoBase::ref (void ) const
increase the reference count of the object. this might be necessary to do explicitly from user code in certain situations (chiefly to avoid premature deletion), but it's usually called from other instances within the Coin library when objects are made dependent on each other. so like, you probably won't call it manually, but sometimes you gotta. π
see the class documentation of SoNode for more extensive info about reference counting.
- See also:
unref(),unrefNoDelete() - References:
assertAlive(),getName(),getTypeId(),SoDebugError::post(),SoDebugError::postInfo(), andSoBase() - Referenced by:
SoEngineOutput::addConnection(),SoFieldContainer::addCopy(),SoSearchAction::addPath(),SoBaseList::addReferences(),SoBaseKit::addToCopyDict(),SoBaseList::append(),SoAction::apply(),SoAction::apply(),SoField::connectFrom(),SoField::connectFrom(),SoEngine::copy(),SoNode::copy(),SoFile::copyChildren(),SoSelection::copyFromThis(),SoBaseKit::createPathToAnyPart(),SoSelection::findPath(),SoDragger::getPartToLocalMatrix(),SoDragger::handleEvent(),SoLocateHighlight::handleEvent(),SoSelection::handleEvent(),SoVRMLDragSensor::handleEvent(),SoVRMLTouchSensor::handleEvent(),SoFieldContainer::hasDefaultValues(),SoBaseList::insert(),SoMFPath::notify(),SoSelection::performSingleSelection(),SoBaseKit::printSubDiagram(),read(),SoDB::read(),SoDB::read(),SoInteractionKit::readDefaultParts(),SoNodekitCatalog::recursiveSearch(),SoSelection::removePath(),SoClipPlaneManip::replaceNode(),SoDirectionalLightManip::replaceNode(),SoPointLightManip::replaceNode(),SoSpotLightManip::replaceNode(),SoTransformManip::replaceNode(),SoSelection::select(),SoBaseList::set(),SoNodeKitDetail::setNodeKit(),SoNodeKitDetail::setPart(),SoEventCallback::setPath(),SoHandleEventAction::setPickRoot(),SoSceneTexture2::setSceneTransparencyType(),SoFieldContainer::setToDefaults(),SoBlinker::SoBlinker(),SoPendulum::SoPendulum(),SoPickedPoint::SoPickedPoint(),SoPickedPoint::SoPickedPoint(),SoShuttle::SoShuttle(),SoSurroundScale::updateMySurroundParams(),SoDebug::write(),SoGroup::write(), andSoDebug::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. no cap, this is important.
- See also:
ref(),unrefNoDelete() - References:
assertAlive(),destroy(),getName(),getTypeId(),SoDebugError::postInfo(),SoDebugError::postWarning(), andSoBase() - Referenced by:
SoBaseList::addReferences(),SoField::connectFrom(),SoFile::copyChildren(),SoBaseKit::createPathToAnyPart(),SoSelection::deselect(),SoField::disconnect(),SoField::disconnect(),SoSelection::findPath(),SoDragger::getPartToLocalMatrix(),SoDragger::handleEvent(),SoSelection::handleEvent(),SoVRMLDragSensor::handleEvent(),SoVRMLTouchSensor::handleEvent(),SoFieldContainer::hasDefaultValues(),SoSelection::isSelected(),SoMFPath::notify(),SoSelection::performSingleSelection(),SoBaseKit::printSubDiagram(),read(),SoDB::read(),SoDB::read(),SoNodekitCatalog::recursiveSearch(),SoEngineOutput::removeConnection(),SoSelection::removePath(),SoSelection::select(),SoHandleEventAction::setPickRoot(),SoSceneManager::setSceneGraph(),SoFieldContainer::setToDefaults(),SoSelection::toggle(), andSoSurroundScale::updateMySurroundParams()
void SoBase::unrefNoDelete (void ) const
decrease reference count, but do NOT delete ourself if the count reaches zero. it's like unref() but with a no-delete clause. π«Ά
- See also:
unref() - References:
assertAlive(),getName(),getTypeId(),SoDebugError::postInfo(), andSoBase() - Referenced by:
SoBaseKit::addToCopyDict(),SoAction::apply(),SoAction::apply(),SoEngine::copy(),SoNode::copy(),SoSelection::copyFromThis(),SoBaseKit::createPathToAnyPart(),SoDragger::getPartToLocalMatrix(),SoClipPlaneManip::replaceNode(),SoDirectionalLightManip::replaceNode(),SoPointLightManip::replaceNode(),SoSpotLightManip::replaceNode(),SoTransformManip::replaceNode(),SoSelection::select(),SoDebug::write(), andSoDebug::writeToFile()
int32_t SoBase::getRefCount (void ) const
returns the number of objects referring to this object. like, how many besties are holding onto you? π
- Referenced by:
SoAction::apply(),SoAction::apply(), andSoEventCallback::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. basically you're poking them and saying 'hey, re-check this!' π₯
this is often used as an effective way of manually triggering a redraw by application programmers. so if you want to force a redraw, this is your girl.
- References:
startNotify() - Referenced by:
SoGeoCoordinate::doAction(),SoExtSelection::handleEvent(),SoLocateHighlight::handleEvent(),SoVRMLImageTexture::setImage(), andSoShape::shouldGLRender()
virtual 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. so like, you can ask 'what type are you?' and then safely cast. π
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. you got this! β¨
For more info on writing Coin extensions, go check the class docs of the toplevel superclasses for each of the different class groups. iykyk π
πΈ Implemented in
Bestie. Sit down. This thing is everywhere. It's giving main character energy across the entire library, fr fr:
SoAnnotation, SoAntiSquish, SoAppearanceKit, SoArray, SoAsciiText, SoBaseColor, SoBaseKit, SoBlinker, SoBoolOperation, SoBumpMap, SoBumpMapCoordinate, SoBumpMapTransform, SoCalculator, SoCallback, SoCamera, SoCameraKit, SoCenterballDragger, SoCenterballManip, SoClipPlane, SoClipPlaneManip, SoColorIndex, SoComplexity, SoComposeMatrix, SoComposeRotation, SoComposeRotationFromTo, SoComposeVec2f, SoComposeVec3f, SoComposeVec4f, SoComputeBoundingBox, SoConcatenate, SoCone, SoCoordinate3, SoCoordinate4, SoCounter, SoCube, SoCylinder, SoDecomposeMatrix, SoDecomposeRotation, SoDecomposeVec2f, SoDecomposeVec3f, SoDecomposeVec4f, SoDirectionalLight, SoDirectionalLightDragger, SoDirectionalLightManip, SoDragger, SoDragPointDragger, SoDrawStyle, SoElapsedTime, SoEnvironment, SoEventCallback, SoExtSelection, SoFaceSet, SoFieldConverter, SoFile, SoFont, SoFontStyle, SoFragmentShader, SoFrustumCamera, SoGate, SoGeoCoordinate, SoGeoLocation, SoGeometryShader, SoGeoOrigin, SoGeoSeparator, SoGroup, SoHandleBoxDragger, SoHandleBoxManip, SoImage, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedNurbsCurve, SoIndexedNurbsSurface, SoIndexedShape, SoIndexedTriangleStripSet, SoInfo, SoInteractionKit, SoInterpolate, SoInterpolateFloat, SoInterpolateRotation, SoInterpolateVec2f, SoInterpolateVec3f, SoInterpolateVec4f, SoJackDragger, SoJackManip, SoLabel, SoLevelOfDetail, SoLight, SoLightKit, SoLightModel, SoLinearProfile, SoLineSet, SoListener, SoLocateHighlight, SoLOD, SoMarkerSet, SoMaterial, SoMaterialBinding, SoMatrixTransform, SoMultipleCopy, SoNodeKitListPart, SoNonIndexedShape, SoNormal, SoNormalBinding, SoNurbsCurve, SoNurbsProfile, SoNurbsSurface, SoOneShot, SoOnOff, SoOrthographicCamera, SoPackedColor, SoPath, SoPathSwitch, SoPendulum, SoPerspectiveCamera, SoPickStyle, SoPointLight, SoPointLightDragger, SoPointLightManip, SoPointSet, SoPolygonOffset, SoProfile, SoProfileCoordinate2, SoProfileCoordinate3, SoQuadMesh, SoResetTransform, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoRotation, SoRotationXYZ, SoRotor, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScale, SoScaleUniformDragger, SoSceneKit, SoSceneTexture2, SoSelection, SoSelectOne, SoSeparator, SoSeparatorKit, SoShaderObject, SoShaderProgram, SoShadowCulling, SoShadowGroup, SoShadowStyle, SoShape, SoShapeHints, SoShapeKit, SoShuttle, SoSphere, SoSpotLight, SoSpotLightDragger, SoSpotLightManip, SoSurroundScale, SoSwitch, SoTabBoxDragger, SoTabBoxManip, SoTabPlaneDragger, SoText2, SoText3, SoTexture2, SoTexture2Transform, SoTexture3, SoTexture3Transform, SoTextureCombine, SoTextureCoordinate2, SoTextureCoordinate3, SoTextureCoordinateBinding, SoTextureCoordinateCube, SoTextureCoordinateCylinder, SoTextureCoordinateDefault, SoTextureCoordinateEnvironment, SoTextureCoordinateFunction, SoTextureCoordinatePlane, SoTextureCoordinateSphere, SoTextureCubeMap, SoTextureScalePolicy, SoTextureUnit, SoTimeCounter, SoTrackballDragger, SoTrackballManip, SoTransform, SoTransformation, SoTransformBoxDragger, SoTransformBoxManip, SoTransformerDragger, SoTransformerManip, SoTransformManip, SoTransformSeparator, SoTransformVec3f, SoTranslate1Dragger, SoTranslate2Dragger, SoTranslation, SoTransparencyType, SoTriangleStripSet, SoTriggerAny, SoUnits, SoVertexProperty, SoVertexShader, SoVertexShape, 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, SoVRMLLight, SoVRMLLOD, 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, SoWrapperKit, SoWWWAnchor, and SoWWWInline.
Likeβ¦ all of them. Every last one. Periodt. π
π«Ά References
These are the glow-ups it leans on: addAuditor(), addName(), addWriteReference(), assertAlive(), connectRoute(), decrementCurrentWriteCounter(), getAuditors(), getClassTypeId(), getName(), getNamedBase(), getNamedBases(), getTraceRefs(), incrementCurrentWriteCounter(), isOfType(), notify(), read(), readRoute(), removeAuditor(), removeName(), setInstancePrefix(), setName(), setTraceRefs(), shouldWrite(), SoBase(), and startNotify().
π¦ Referenced by
And literally everyone is in its mentions. No cap, here's the whole list:
SoGLRenderAction::abortNow(), SoNodeKitListPart::addChild(), SoFieldData::addField(), SoNode::addToCopyDict(), addWriteReference(), SoNotList::append(), SoPath::append(), SoPath::append(), SoField::connectFrom(), SoEngine::copy(), destroy(), SoField::disconnect(), SoField::disconnect(), SoFieldContainer::findCopy(), getFileFormatName(), SoNode::GLRenderS(), SoFieldContainer::hasDefaultValues(), SoNodeKitListPart::insertChild(), SoCallbackAction::invokePostCallbacks(), SoCallbackAction::invokePreCallbacks(), SoNodeKitListPart::isChildPermitted(), isOfType(), SoEngine::notify(), SoNode::notify(), SoNodeEngine::notify(), read(), SoDB::read(), SoDB::read(), SoField::read(), SoFieldData::read(), SoField::readConnection(), SoFieldData::readFieldDescriptions(), SoInteractionKit::readInstance(), ref(), SoGroup::removeChild(), SoPath::removeIndex(), SoGroup::replaceChild(), SoNodeKitListPart::replaceChild(), SoNodeKitListPart::replaceChild(), SoPath::replaceIndex(), SoTransformManip::replaceNode(), SoOutput::resolveRoutes(), SoNode::search(), SoInteractionKit::setAnySurrogatePath(), SoBaseKit::setDefaultOnNonWritingFields(), SoInteractionKit::setDefaultOnNonWritingFields(), SoBaseKit::setPart(), SoFieldContainer::setToDefaults(), SoEngine::shouldCopy(), SoAction::traverse(), SoBaseKit::typeCheck(), unref(), unrefNoDelete(), and writeHeader().
π SbBool SoBase::isOfType (SoType type) const
Hits you back with TRUE if the type of this object is either of the same type, or inherited from type. Basically a vibe check on the family tree π§¬
References getTypeId(), and SoType::isDerivedFrom().
Referenced by SoEngineOutput::addConnection(), SoFieldData::addField(), SoNode::addToCopyDict(), SoNotList::append(), SoInput::checkISReference(), SoIndexedShape::computeBBox(), SoText3::computeBBox(), SoNonIndexedShape::computeCoordBBox(), SoField::connectFrom(), SoVRMLInline::copyChildren(), SoWWWInline::copyChildren(), SoClipPlaneManip::copyContents(), SoDirectionalLightManip::copyContents(), SoInteractionKit::copyContents(), SoNode::copyContents(), SoPointLightManip::copyContents(), SoRotateCylindricalDragger::copyContents(), SoRotateSphericalDragger::copyContents(), SoSpotLightManip::copyContents(), SoTransformManip::copyContents(), SoVRMLScript::copyContents(), SoBaseKit::countMyFields(), SoDB::createRoute(), SoField::disconnect(), SoDragPointDragger::dragStart(), SoSpotLightManip::fieldSensorCB(), SoFieldContainer::findCopy(), SoBaseKit::forceChildDrivenWriteRefs(), SoIndexedTriangleStripSet::generateDefaultNormals(), SoBaseKit::getAnyPart(), SoBaseKit::getContainerNode(), SoClipPlaneManip::getDragger(), SoDirectionalLightManip::getDragger(), SoPointLightManip::getDragger(), SoSpotLightManip::getDragger(), SoTransformManip::getDragger(), SoEngineOutput::getForwardConnections(), SoFieldData::getIndex(), SoNodeKitPath::getLength(), getNamedBase(), getNamedBases(), SoNodeKitPath::getNode(), SoNodeKitPath::getNodeFromTail(), SoBaseKit::getPartString(), SoPointSet::getPrimitiveCount(), SoNodeKitPath::getTail(), getTypeId(), SoShape::GLRender(), SoTransformerManip::isLocateHighlighting(), SoInteractionKit::isPathSurrogateInMySubgraph(), SoPath::isRelevantNotification(), SoDataSensor::notify(), SoShadowGroup::notify(), SoNodeKitPath::pop(), SoNotList::print(), SoDB::read(), SoDB::read(), SoField::readConnection(), SoBaseKit::readInstance(), SoField::referencesCopy(), SoSFEngine::referencesCopy(), SoSFNode::referencesCopy(), SoSFPath::referencesCopy(), SoEngineOutput::removeConnection(), SoDB::removeRoute(), SoClipPlaneManip::replaceNode(), SoDirectionalLightManip::replaceNode(), SoPointLightManip::replaceNode(), SoSpotLightManip::replaceNode(), SoTransformManip::replaceNode(), SoBaseKit::set(), SoBaseKit::setAnyPart(), SoInteractionKit::setAnySurrogatePath(), SoBaseKit::setDefaultOnNonWritingFields(), SoTransformerManip::setLocateHighlighting(), SoBaseKit::setPart(), SoInteractionKit::setSwitchValue(), SoDragger::shouldGrabBasedOnSurrogate(), SoField::shouldWrite(), SoNodeKitPath::SoNodeKitPath(), SoTransformManip::transferFieldValues(), SoNodeKitPath::truncate(), SoBaseKit::typeCheck(), SoTransformerManip::unsquishKnobs(), SoSpotLightManip::valueChangedCB(), SoField::write(), SoNode::write(), SoField::writeConnection(), and writeHeader().
β¨ SoType SoBase::getClassTypeId (void ) [static]
A static method that hands you the SoType object associated with objects of this class. The blueprint, the origin story, the β¨ancestryβ¨.
Referenced by SoField::disconnect(), getTypeId(), SoDragger::initClass(), SoNodeKitListPart::initClass(), SoDB::read(), and SoDragger::shouldGrabBasedOnSurrogate().
π SbName SoBase::getName (void ) const [virtual]
Gives you back the name of the object. And if nobody ever gave this object a name? The SbName it returns just contains the empty string. Sad little nameless icon, we've all been there π
Referenced by SoGLRenderAction::abortNow(), SoNode::addToCopyDict(), addWriteReference(), SoNotList::append(), SoField::connectFrom(), SoFieldContainer::copyContents(), SoDB::createRoute(), destroy(), getTypeId(), SoGroup::GLRender(), SoSeparator::GLRenderBelowPath(), SoVRMLBillboard::GLRenderBelowPath(), SoVRMLGroup::GLRenderBelowPath(), SoVRMLLOD::GLRenderBelowPath(), SoEngine::notify(), SoNode::notify(), SoNodeEngine::notify(), SoBaseKit::printDiagram(), SoDebug::printName(), SoBaseKit::printTable(), SoAction::pushCurPath(), ref(), SoDB::removeRoute(), SoOutput::resolveRoutes(), SoNode::search(), setName(), SoBaseKit::setPart(), SoInteractionKit::setPart(), SoEngine::shouldCopy(), SoNodeKitListPart::SoNodeKitListPart(), unref(), unrefNoDelete(), and writeHeader().
π void SoBase::setName (const SbName & newname) [virtual]
Sets the name of this object. Name your child, bestie, it deserves an identity π
Some characters are lowkey illegal in names for SoBase-derived objects, and it's not even a vibe thing β object names have to stay consistent with the syntax of Inventor and VRML files when you do file export / import, so bestie, you literally must avoid using special token characters. π
Invalid characters get auto-replaced by underscore characters. And if the name starts with an invalid character, the new name gets an underscore plopped in front of it. Periodt. β¨
For the exact definitions of what counts as legal and illegal for SoBase names, go peek at the SbName functions listed below. iykyk π«Ά
See also: getName(), SbName::isBaseNameStartChar(), SbName::isBaseNameChar()
References: addName(), SbName::getLength(), getName(), SbName::getString(), SbString::getString(), SbName::isBaseNameChar(), SbName::isBaseNameStartChar(), SoDebugError::postWarning(), and removeName().
Referenced by: SoFieldContainer::copyContents(), and getTypeId().
void SoBase::addName (SoBase *const b, const char *const name) [static]
Adds a name<->object mapping to the global dictionary. π
References: SbPList::append(), and SoBase().
Referenced by: getTypeId(), and setName().
void SoBase::removeName (SoBase *const b, const char *const name) [static]
Removes a name<->object mapping from the global dictionary. bye felicia π
References: SbPList::find(), SbPList::get(), SbPList::remove(), and SoBase().
Referenced by: destroy(), getTypeId(), 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: getTypeId(), SoPath::operator=(), SoNode::startNotify(), and touch().
void SoBase::notify (SoNotList * l) [virtual]
Notifies all auditors for this instance when changes are made. it's giving "hey everyone, something changed" π’
Reimplemented in SoAsciiText, SoBlinker, SoBumpMap, SoEngine, SoFieldContainer, SoImage, SoLevelOfDetail, SoLOD, SoMaterial, SoNode, SoNodeEngine, SoPackedColor, SoSceneTexture2, SoSeparator, SoShadowGroup, 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, and SoVRMLVertexShape.
References: assertAlive(), and SoDebugError::postInfo().
Referenced by: getTypeId(), 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(), SoPathSensor::attach(), getTypeId(), SoChildList::insert(), 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. no more updates for you, bestie π
See also: addAuditor()
Referenced by: getTypeId(), SoMFPath::notify(), SoChildList::remove(), and SoChildList::set().
const SoAuditorList & SoBase::getAuditors (void ) const
Returns list of objects auditing this object. π΅οΈββοΈβ¨
See also: addAuditor(), removeAuditor()
References: SoAuditorList::getLength(), and SoAuditorList::remove().
Referenced by: getTypeId().
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. tallying up the receipts π§Ύ
Reimplemented in SoBaseKit, and SoFieldContainer.
References: getName(), SoOutput::getStage(), getTypeId(), and SoDebugError::postInfo().
Referenced by: SoBaseKit::addWriteReference(), SoFieldContainer::addWriteReference(), SoBaseKit::forceChildDrivenWriteRefs(), getTypeId(), 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. so basically: no refs = no writeout, sorry babe πΈ
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.
Referenced by: SoBaseKit::forceChildDrivenWriteRefs(), and getTypeId().
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. π
Referenced by: getTypeId().
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. π
Referenced by: getTypeId().
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. last one wins, that's the rule π
If no object of a valid type or subtype has been registered with the given name, returns NULL.
References: SbPList::getLength(), isOfType(), and SoBase().
Referenced by: SoInput::findReference(), SoEngine::getByName(), SoNode::getByName(), SoPath::getByName(), getTypeId(), and SoInteractionKit::setAnyPartAsDefault().
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(), isOfType(), and SoBase().
Referenced by: SoEngine::getByName(), SoNode::getByName(), SoPath::getByName(), and getTypeId().
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:
- End-of-file. Use
SoInput::eof()after calling this method to detect end-of-file conditions. indidn'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.- A child was given as the
NULLkeyword. This can happen when reading the contents ofSoSFNodefields (note thatNULLis not allowed forSoMFNode)
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(), SoBase(), and unref().
Referenced by: getTypeId(), SoDB::read(), SoGroup::readChildren(), 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.
Referenced by: getTypeId().
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. π (fr fr, she is loud)
The reference tracing functionality will be disabled in "releaseversions" of the Coin library.
Referenced by: getTypeId().
SbBool SoBase::getTraceRefs (void ) [static]
Return the status of the reference tracing flag. π©
See also: setTraceRefs()
Referenced by: getTypeId().
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: getTypeId(), and 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. π
bestie if your refcount hits zero too early you're gonna have a bad time, and by "bad time" I mean memory corruption and mysterious crashes. the assert is literally there to catch you. let it catch you. π«Ά
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: SoMFEngine::fixCopy(), SoMFNode::fixCopy(), SoMFPath::fixCopy(), SoSFEngine::fixCopy(), SoSFNode::fixCopy(), SoSFPath::fixCopy(), getTypeId(), notify(), SoField::notify(), ref(), unref(), and unrefNoDelete().
SbBool SoBase::readRoute (SoInput * in) [static]
okay so this one is internal to the library β like, the docs straight-up say it's "not likely to be of interest to the application programmer", so if you're just out here writing normal Coin code, bestie, this is not your moment. π
It reads a (VRML97) ROUTE. And the lore: they decided to also add support for routes in Coin as a generic feature, because they thought it was nicer than setting up field connections inside the nodes. π iconic decision honestly.
References: SoInput::addRoute(), connectRoute(), SoNode::getByName(), SoInput::getCurrentProto(), SbName::getString(), SbString::getString(), SoReadError::post(), SoDebugError::postInfo(), and SoInput::read().
Referenced by: getTypeId(), read(), and SoFieldData::read().
void SoBase::destroy (void ) [protected], [virtual]
Cleans up all the hanging references to and from this instance, and then commits suicide. π (that's literally the original wording, I'm not being dramatic β okay maybe a little dramatic, but it's also the actual wording)
Called automatically when the reference count goes to zero. So like, it's not something you summon β it just happens when the vibe count hits zero. π«Ά
References: SbList< Type >::getLength(), SbName::getLength(), getName(), SoType::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. β¨
β οΈ heads up, the result from this method is only valid during the second pass of a write action (and partly during the COUNT_REFS pass). So don't be out here trusting it whenever, bestie.
Referenced by: SoBaseKit::addWriteReference(), SoPath::write(), and SoSwitch::write().
SbBool SoBase::writeHeader (SoOutput * out, SbBool isgroup, SbBool isengine) const [protected]
Writes out the header of any SoBase derived object. The header consists of:
- the
DEFkeyword 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(), getFileFormatName(), SbName::getLength(), SbString::getLength(), getName(), SbName::getString(), SbString::getString(), SbString::getSubString(), getTypeId(), SoOutput::incrementIndent(), SoOutput::indent(), SoOutput::isBinary(), isOfType(), SoDebugError::postInfo(), SoBase(), SbString::sprintf(), SoNode::VRML2, and SoOutput::write().
Referenced by: SoBaseKit::write(), SoGroup::write(), SoNode::write(), SoPath::write(), SoSwitch::write(), SoVRMLParent::write(), SoVRMLScript::write(), and SoEngine::writeInstance().
void SoBase::writeFooter (SoOutput * out) const [protected]
This method will terminate the block representing an SoBase derived object. So it's the lil closing bracket energy of the whole thing. πΈ
References: SoOutput::decrementIndent(), SoOutput::indent(), SoOutput::isBinary(), and SoOutput::write().
Referenced by: SoBaseKit::write(), SoGroup::write(), SoNode::write(), SoPath::write(), SoSwitch::write(), SoVRMLParent::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().
virtual 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. π (corrupted input is not the moment to be brave, just say FALSE)
flags is used internally during binary import when reading user extension nodes, group nodes or engines.
Implemented in: SoBaseKit, SoBumpMap, SoEngine, SoFieldContainer, SoFile, SoGroup, SoImage, SoInteractionKit, SoNode, SoNodeEngine, SoNodeKitListPart, SoNormalBinding, SoSeparator, SoShaderObject, SoTexture2, SoTexture3, SoTextureCoordinateBinding, SoTextureCubeMap, SoVRMLImageTexture, SoVRMLLOD, SoVRMLParent, SoVRMLPixelTexture, SoVRMLSwitch, and SoWWWInline.
References: getCurrentWriteCounter(), SoBase(), staticDataLock(), and staticDataUnlock().
uint32_t SoBase::getCurrentWriteCounter (void ) [static], [protected]
Another one that's considered internal to the library, as it is not likely to be of interest to the application programmer. π
Referenced by: readInstance().
void SoBase::staticDataLock (void ) [static], [protected]
Since: Coin 2.3
Referenced by: SoBaseColor::doAction(), SoMaterial::doAction(), SoPackedColor::doAction(), SoVertexProperty::doAction(), SoVRMLColor::doAction(), SoCoordinate3::GLRender(), SoCoordinate4::GLRender(), SoNormal::GLRender(), SoTextureCoordinate2::GLRender(), SoTextureCoordinate3::GLRender(), SoVRMLCoordinate::GLRender(), SoVRMLNormal::GLRender(), SoVRMLTextureCoordinate::GLRender(), and readInstance().
void SoBase::staticDataUnlock (void ) [static], [protected]
Since: Coin 2.3
Referenced by: SoBaseColor::doAction(), SoMaterial::doAction(), SoPackedColor::doAction(), SoVertexProperty::doAction(), SoVRMLColor::doAction(), SoCoordinate3::GLRender(), SoCoordinate4::GLRender(), SoNormal::GLRender(), SoTextureCoordinate2::GLRender(), SoTextureCoordinate3::GLRender(), SoVRMLCoordinate::GLRender(), SoVRMLNormal::GLRender(), SoVRMLTextureCoordinate::GLRender(), and readInstance().
π Author
Generated automatically by Doxygen for Coin from the source code. (not a human, not a bestie, just Doxygen doing its lil thing β¨)
and that's the whole page, babes!! ππ you read the entire SoBase(3) manual like the absolute main character you are. this was Coin, Version 2.5.0, and the page is dated SoBase(3). go forth and reference-count responsibly. π
πΈπ¦
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms