'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoType(3IV) .SH NAME SoType \(em stores runtime type information .SH INHERITS FROM SoType .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SoType: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbfromName\*(Cr(SbName name) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbName .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetName\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetParent\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbbadType\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisBad\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisDerivedFrom\*(Cr(SoType t) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic int .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetAllDerivedFrom\*(Cr(SoType type, SoTypeList &list) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcanCreateInstance\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcreateInstance\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator ==\*(Cr(const SoType t) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator !=\*(Cr(const SoType t) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator <\*(Cr(const SoType t) const .sp .SH DESCRIPTION The \*(CbSoType\f1 class keeps track of runtime type information in Inventor. Each type is associated with a given name, so lookup is possible in either direction. .sp Many Inventor classes request a unique \*(CbSoType\f1 when they are \&initialized. This type can then be used to find out the actual class of an instance when only its base class is known, or to obtain an instance of a particular class given its type or name. .sp Note that \&the names associated with types of Inventor classes do not contain the "So" prefix. .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbfromName\*(Cr(SbName name) .br .in 1i \f1Returns the type associated with the given name. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbName .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetName\*(Cr() const .br .in 1i \f1Returns the name associated with a type. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetParent\*(Cr() const .br .in 1i \f1Returns the type of the parent class. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbbadType\*(Cr() .br .in 1i \f1Returns an always-illegal type. Useful for returning errors. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisBad\*(Cr() const .br .in 1i \f1Returns TRUE if the type is a bad type. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisDerivedFrom\*(Cr(SoType t) const .br .in 1i \f1Returns TRUE if the type is derived from type \*(Crt\f1. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic int .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetAllDerivedFrom\*(Cr(SoType type, SoTypeList &list) .br .in 1i \f1Adds all types derived from the given type to the given type list. Returns the number of types added. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcanCreateInstance\*(Cr() const .br .in 1i \f1Some types are able to create instances; for example, most nodes and engines (those which are not abstract classes) can be created this way. This method returns TRUE if the type supports such creation. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcreateInstance\*(Cr() const .br .in 1i \f1Creates and returns a pointer to an instance of the type. Returns NULL if an instance could not be created for some reason. The pointer is returned as a generic pointer, but can be cast to the appropriate \&type. For example: .nf .in 1.5i \*(Cr SoCube *c = (SoCube *) SoCube::getClassTypeId().createInstance(); \f1 .fi .in 1i is a convoluted way of creating a new instance of an \*(CbSoCube\f1. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator ==\*(Cr(const SoType t) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator !=\*(Cr(const SoType t) const .br .in 1i \f1Returns TRUE if this type is the same as or not the same as the given type. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator <\*(Cr(const SoType t) const .br .in 1i \f1Less-than comparison operator that can be used to sort types. This is pretty useless otherwise. .sp .in 0.5i .SH SEE ALSO \*(CbSoAction, SoBase, SoDetail, SoError, SoEvent, SoField