1SoBase(3IV)()                                                    SoBase(3IV)()
2
3
4

NAME

6       SoBase — base class for all nodes, paths, and engines
7

INHERITS FROM

9       SoBase
10

SYNOPSIS

12       #include <Inventor/misc/SoBase.h>
13
14          Methods from class SoBase:
15
16     void                ref()
17     void                unref() const
18     void                unrefNoDelete() const
19     void                touch()
20     static SoType       getClassTypeId()
21     virtual SoType      getTypeId() const
22     SbBool              isOfType(SoType type) const
23     virtual void        setName(const SbName &name)
24     virtual SbName      getName() const
25
26

DESCRIPTION

28       Abstract  base  class for Inventor node, path, and engine classes. This
29       class handles reference counting, notification, and naming.
30

METHODS

32     void                ref()
33     void                unref() const
34     void                unrefNoDelete() const
35          Adds and removes a reference to an  instance.  Instances  should  be
36          referenced  when  they  will be used outside of the routine in which
37          they were initialized. (A typical example of this is  maintaining  a
38          pointer to the root of a graph.) Whenever the reference count for an
39          instance  is  decremented  to  0,  the  instance  is   automatically
40          destroyed  by the database (unless unrefNoDelete()  is used to unref
41          it). The reference count of a node is automatically incremented when
42          the  node  is added as a child of another node or when a path points
43          to the node. Likewise, the reference count is  automatically  decre‐
44          mented  when  the  node  is  removed  as a child or when a path that
45          points to the node is changed or destroyed.
46
47          unrefNoDelete()  should be called when it is  desired  to  decrement
48          the  reference count, but not delete the instance if this brings the
49          reference count to zero. This is most useful in returning an  object
50          to  a zero-reference-count state, like it was when it was created by
51          new.
52
53     void                touch()
54          Marks an instance as modified, simulating a change to it. This  will
55          notify  auditors  (parent  nodes, connected engines, and so on) of a
56          change to this object and cause attached sensors to be triggered.
57
58     static SoType       getClassTypeId()
59          Returns type identifier for this class.
60
61     virtual SoType      getTypeId() const
62          Returns the type identifier for a specific instance.
63
64     SbBool              isOfType(SoType type) const
65          Returns TRUE if this object is of the type specified in type  or  is
66          derived from that type. Otherwise, it returns FALSE. For example,
67
68               nodePtr->isOfType(SoGroup::getClassTypeId())
69
70
71          returns TRUE if nodePtr is an instance of SoGroup or one of its sub‐
72          classes.
73
74     virtual void        setName(const SbName &name)
75          Sets the name of  an  instance.  Object  names  are  preserved  when
76          objects  are  written  to  or read from files. Object names must not
77          begin with a digit, and must not contain spaces or  control  charac‐
78          ters,  single  or double quote characters, backslashes, curly braces
79          or  the  plus  character.  The  isBaseNameChar()  and   isBaseNameS‐
80          tartChar() methods  of SbName can be used to validate names input by
81          users. This method will replace any bad charaters in the  name  with
82          underscore  characters,  and  will print out an error message if the
83          application is using the Inventor debugging library.
84
85     virtual SbName      getName() const
86          Returns the name of an instance. If the instance has not been named,
87          an empty SbName is returned. Objects that are named can be looked up
88          using the getByName() methods  of SoNode, SoEngine, or SoPath.
89
90

SEE ALSO

92       SoFieldContainer, SoNode, SoPath, SoEngine, SoDB
93
94
95
96
97                                                                 SoBase(3IV)()
Impressum