Base class for all nodes, paths, and engines.
More...
#include <Inventor/misc/SoBase.h>
|
static bool | traceRefs |
| Turns on/off reference count tracing (for debugging)
|
|
|
| SoBase () |
| Constructor is protected - this is an abstract class.
|
|
virtual | ~SoBase () |
| Virtual destructor so that subclasses are deleted properly.
|
|
virtual void | destroy () |
| Actually deletes an instance.
|
|
bool | hasMultipleWriteRefs () const |
| Returns TRUE if the instance has multiple write references.
|
|
bool | writeHeader (SoOutput *out, bool isGroup, bool isEngine) const |
| Writes a header (name, open brace) or footer (close brace) to file defined by SoOutput.
|
|
void | writeFooter (SoOutput *out) const |
|
virtual const char * | getFileFormatName () const |
| Unknown nodes and engines write a different name for themselves than their typeId; this virtual method lets them do that (by default the typeId name is returned)
|
|
virtual bool | readInstance (SoInput *in, unsigned short flags)=0 |
| Reads stuff into instance of subclass.
|
|
Abstract base class for Inventor node, path, and engine classes. This class handles reference counting, notification, and naming.
- See Also
- SoFieldContainer, SoNode, SoPath, SoEngine, SoDB
Definition at line 90 of file SoBase.h.
◆ BaseFlags
Each enum represents a different bit in a bit field which will be written.
Enumerator |
---|
IS_ENGINE | |
IS_GROUP | |
Definition at line 199 of file SoBase.h.
◆ SoBase()
◆ ~SoBase()
virtual SoBase::~SoBase |
( |
| ) |
|
|
protectedvirtual |
◆ addAuditor()
◆ addName()
static void SoBase::addName |
( |
SoBase * |
, |
|
|
const char * |
|
|
) |
| |
|
static |
◆ addWriteReference()
virtual void SoBase::addWriteReference |
( |
SoOutput * |
out, |
|
|
bool |
isFromField = FALSE |
|
) |
| |
|
virtual |
isFromField indicates whether the reference is from a field-to-field connection.
Reimplemented in SoFieldContainer, and SoBaseKit.
◆ decrementCurrentWriteCounter()
static void SoBase::decrementCurrentWriteCounter |
( |
| ) |
|
|
inlinestatic |
◆ destroy()
virtual void SoBase::destroy |
( |
| ) |
|
|
protectedvirtual |
Allows subclasses to do other stuff before the deletion if necessary.
◆ getAuditors()
◆ getClassTypeId()
static SoType SoBase::getClassTypeId |
( |
| ) |
|
|
inlinestatic |
◆ getCurrentWriteCounter()
static uint32_t SoBase::getCurrentWriteCounter |
( |
| ) |
|
|
inlinestaticprotected |
◆ getFileFormatName()
virtual const char * SoBase::getFileFormatName |
( |
| ) |
const |
|
protectedvirtual |
◆ getName()
virtual SbName SoBase::getName |
( |
| ) |
const |
|
virtual |
If the instance has not been named, an empty SbName is returned. Objects that are named can be looked up using the getByName() methods of SoNode, SoEngine, or SoPath.
◆ getNamedBase()
◆ getNamedBases()
◆ getRefCount()
int SoBase::getRefCount |
( |
| ) |
const |
|
inline |
◆ getTypeId()
virtual SoType SoBase::getTypeId |
( |
| ) |
const |
|
pure virtual |
◆ hasMultipleWriteRefs()
bool SoBase::hasMultipleWriteRefs |
( |
| ) |
const |
|
inlineprotected |
◆ incrementCurrentWriteCounter()
static void SoBase::incrementCurrentWriteCounter |
( |
| ) |
|
|
inlinestatic |
◆ initClass()
static void SoBase::initClass |
( |
| ) |
|
|
static |
◆ isOfType()
bool SoBase::isOfType |
( |
SoType |
type | ) |
const |
Otherwise, it returns FALSE. For example,
static SoType getClassTypeId()
Returns the type of this class.
returns TRUE if nodePtr
is an instance of SoGroup or one of its subclasses.
◆ notify()
virtual void SoBase::notify |
( |
SoNotList * |
list | ) |
|
|
virtual |
◆ read()
Returns pointer to read-in instance in base, or NULL on EOF. Returns FALSE on error. The last parameter is a subclass type to match. If the returned base is not of this type, it is an error. A type of SoBase::getClassTypeId() will match any base.
◆ readInstance()
virtual bool SoBase::readInstance |
( |
SoInput * |
in, |
|
|
unsigned short |
flags |
|
) |
| |
|
protectedpure virtual |
Return FALSE on error. If reading binary file format, the flags specify whether the object was written as an engine or a group; unknown nodes and groups need this information to read themselves in properly.
Implemented in SoElapsedTime, SoEngine, SoOneShot, SoTimeCounter, SoFieldContainer, SoBaseKit, SoInteractionKit, SoNodeKitListPart, SoFile, SoGroup, SoMaterialBinding, SoNormalBinding, SoSeparator, SoTexture2, SoTextureCoordinateBinding, SoWWWInline, and SoUnknownNode.
◆ ref()
void SoBase::ref |
( |
| ) |
const |
Instances should be referenced when they will be used outside of the routine in which they were initialized. (A typical example of this is maintaining a pointer to the root of a graph.) Whenever the reference count for an instance is decremented to 0, the instance is automatically destroyed by the database (unless unrefNoDelete() is used to unref it). The reference count of a node is automatically incremented when the node is added as a child of another node or when a path points to the node. Likewise, the reference count is automatically decremented when the node is removed as a child or when a path that points to the node is changed or destroyed.
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. This is most useful in returning an object to a zero-reference-count state, like it was when it was created by new.
◆ removeAuditor()
◆ removeName()
static void SoBase::removeName |
( |
SoBase * |
, |
|
|
const char * |
|
|
) |
| |
|
static |
◆ setInstancePrefix()
static void SoBase::setInstancePrefix |
( |
const SbString & |
c | ) |
|
|
inlinestatic |
The ivdowngrade converter needs to set it to other than "+" since that was an illegal character for Inventor V1.0 names.
Definition at line 280 of file SoBase.h.
◆ setName()
virtual void SoBase::setName |
( |
const SbName & |
name | ) |
|
|
virtual |
Object names are preserved when objects are written to or read from files. Object names must not begin with a digit, and must not contain spaces or control characters, single or double quote characters, backslashes, curly braces or the plus character. The isBaseNameChar() and isBaseNameStartChar() methods of SbName can be used to validate names input by users. This method will replace any bad charaters in the name with underscore characters, and will print out an error message if the application is using the Inventor debugging library.
◆ shouldWrite()
bool SoBase::shouldWrite |
( |
| ) |
|
◆ startNotify()
virtual void SoBase::startNotify |
( |
| ) |
|
|
virtual |
The default method does nothing, because some classes (path, sensor) never initiate notification. This is used by touch().
Reimplemented in SoNode.
◆ touch()
This will notify auditors (parent nodes, connected engines, and so on) of a change to this object and cause attached sensors to be triggered.
Definition at line 125 of file SoBase.h.
◆ unref()
void SoBase::unref |
( |
| ) |
const |
◆ unrefNoDelete()
void SoBase::unrefNoDelete |
( |
| ) |
const |
◆ writeFooter()
void SoBase::writeFooter |
( |
SoOutput * |
out | ) |
const |
|
protected |
◆ writeHeader()
bool SoBase::writeHeader |
( |
SoOutput * |
out, |
|
|
bool |
isGroup, |
|
|
bool |
isEngine |
|
) |
| const |
|
protected |
writeHeader returns TRUE if no further writing is necessary for an instance. isEngine/isGroup are exactly what they sound like, and must be passed in so that unknown nodes/engines can be correctly created when reading the binary file format.
◆ hasName
unsigned int SoBase::hasName |
◆ multWriteRef
unsigned int SoBase::multWriteRef |
◆ traceRefs
◆ writeCounter
unsigned int SoBase::writeCounter |
◆ writeRefFromField
unsigned int SoBase::writeRefFromField |
The documentation for this class was generated from the following file:
- C:/jh/mevislab/4.0.2_1/build/MeVis/ThirdParty/Sources/Inventor/include/Inventor/misc/SoBase.h