| 1 |
NAME SoBase "" "" { base class for all nodes, paths, and engines } |
| 2 |
|
| 3 |
INCLUDE misc/SoBase.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
Abstract base class for Inventor node, path, and engine classes. This |
| 7 |
class handles reference counting, notification, and naming. |
| 8 |
} |
| 9 |
|
| 10 |
METHOD "" void ref() {} |
| 11 |
METHOD "" void unref() const {} |
| 12 |
METHOD "" void unrefNoDelete() const { |
| 13 |
Adds and removes a reference to an instance. Instances should be |
| 14 |
referenced when they will be used outside of the routine in which they |
| 15 |
were initialized. (A typical example of this is maintaining a pointer |
| 16 |
to the root of a graph.) Whenever the reference count for an instance |
| 17 |
is decremented to 0, the instance is automatically destroyed by the |
| 18 |
database (unless |
| 19 |
\+\munrefNoDelete()\.\. |
| 20 |
\-\mSoBaseUnrefNoDelete()\.\. |
| 21 |
is used to unref it). The |
| 22 |
reference count of a node is automatically incremented when the node |
| 23 |
is added as a child of another node or when a path points to the node. |
| 24 |
Likewise, the reference count is automatically decremented when the |
| 25 |
node is removed as a child or when a path that points to the node is |
| 26 |
changed or destroyed. |
| 27 |
\p |
| 28 |
\+\munrefNoDelete()\.\. |
| 29 |
\-\mSoBaseUnrefNoDelete()\.\. |
| 30 |
should be called when it is desired to decrement |
| 31 |
the reference count, but not delete the instance if this brings the |
| 32 |
reference count to zero. This is most useful in returning an object to |
| 33 |
a zero-reference-count state, like it was when it was created by |
| 34 |
\+\mnew\..\. |
| 35 |
\-a \mCreate()\. method.\. |
| 36 |
} |
| 37 |
|
| 38 |
METHOD "" void touch() { |
| 39 |
Marks an instance as modified, simulating a change to it. This will |
| 40 |
notify auditors (parent nodes, connected engines, and so on) of a |
| 41 |
change to this object and cause attached sensors to be triggered. |
| 42 |
} |
| 43 |
|
| 44 |
METHOD "" static SoType getClassTypeId() { |
| 45 |
Returns type identifier for this class. |
| 46 |
} |
| 47 |
|
| 48 |
METHOD "" virtual SoType getTypeId() const { |
| 49 |
Returns the type identifier for a specific instance. |
| 50 |
} |
| 51 |
|
| 52 |
METHOD "" SbBool isOfType(SoType type) const { |
| 53 |
Returns TRUE if this object is of the type specified in \atype\. or is |
| 54 |
derived from that type. Otherwise, it returns FALSE. For example, |
| 55 |
\b |
| 56 |
\+nodePtr->isOfType(SoGroup::getClassTypeId())\. |
| 57 |
\-SoBaseIsOfType(nodePtr, SoGroupGetClassTypeId())\. |
| 58 |
\. |
| 59 |
returns TRUE if \anodePtr\. is an instance of \cSoGroup\. or one of |
| 60 |
its subclasses. |
| 61 |
} |
| 62 |
|
| 63 |
METHOD "" virtual void setName(const SbName &name) { |
| 64 |
Sets the name of an instance. Object names are preserved when objects |
| 65 |
are written to or read from files. Object names must not begin with a |
| 66 |
digit, and must not contain |
| 67 |
spaces or control characters, single or double quote characters, |
| 68 |
backslashes, curly braces or the plus character. |
| 69 |
The |
| 70 |
\+\misBaseNameChar()\. and \misBaseNameStartChar()\. methods\. |
| 71 |
\-\mIsBaseNameChar()\. and \mIsBaseNameStartChar()\. functions\. |
| 72 |
of \cSbName\. can be used to validate names input by users. |
| 73 |
This method will replace any bad charaters in the name with |
| 74 |
underscore characters, and will print out an error message if the |
| 75 |
application is using the Inventor debugging library. |
| 76 |
} |
| 77 |
|
| 78 |
METHOD "" virtual SbName getName() const { |
| 79 |
Returns the name of an instance. If the instance has not been named, |
| 80 |
an empty \cSbName\. is returned. Objects that are named can be looked |
| 81 |
up using the |
| 82 |
\+\mgetByName()\. methods\. |
| 83 |
\-\mGetByName()\. functions\. |
| 84 |
of \cSoNode\., \cSoEngine\., or \cSoPath\.. |
| 85 |
} |
| 86 |
|
| 87 |
ALSO { SoFieldContainer, SoNode, SoPath, SoEngine, SoDB } |