logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoType — stores runtime type information

Description

       The  SoType  class  keeps  track  of runtime type information in Inventor. Each type is associated with a
       given name, so lookup is possible in either direction.

       Many Inventor classes request a unique SoType 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.

       Note that the names associated with types of Inventor classes do not contain the "So" prefix.

Inherits From

       SoType

Methods

staticSoTypefromName(SbNamename)
          Returns the type associated with the given name.

     SbNamegetName()const
          Returns the name associated with a type.

     SoTypegetParent()const
          Returns the type of the parent class.

     staticSoTypebadType()
          Returns an always-illegal type. Useful for returning errors.

     SbBoolisBad()const
          Returns TRUE if the type is a bad type.

     SbBoolisDerivedFrom(SoTypet)const
          Returns TRUE if the type is derived from type t.

     staticintgetAllDerivedFrom(SoTypetype,SoTypeList&list)
          Adds all types derived from the given type to the given type list. Returns the number of types added.

     SbBoolcanCreateInstance()const
          Some  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.

     void*createInstance()const
          Creates  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:
               SoCube*c=(SoCube*)SoCube::getClassTypeId().createInstance();
            is a convoluted way of creating a new instance of an SoCube.

     intoperator==(constSoTypet)constintoperator!=(constSoTypet)const
          Returns TRUE if this type is the same as or not the same as the given type.

     intoperator<(constSoTypet)const
          Less-than comparison operator that can be used to sort types. This is pretty useless otherwise.

Name

       SoType — stores runtime type information

See Also

SoAction,SoBase,SoDetail,SoError,SoEvent,SoFieldSoType(3IV)()

Synopsis

#include<Inventor/SoType.h>

          Methods from class SoType:

     staticSoTypefromName(SbNamename)SbNamegetName()constSoTypegetParent()conststaticSoTypebadType()SbBoolisBad()constSbBoolisDerivedFrom(SoTypet)conststaticintgetAllDerivedFrom(SoTypetype,SoTypeList&list)SbBoolcanCreateInstance()constvoid*createInstance()constintoperator==(constSoTypet)constintoperator!=(constSoTypet)constintoperator<(constSoTypet)const

See Also