SOTYPE(3iv)
π NAME π
SoType β bestie, this thing literally stores runtime type information. that's the whole job. iconic.
πΈ INHERITS FROM πΈ
SoType
(yes she's her own parent situation, no cap β it just says SoType, and we respect that π
)
β¨ SYNOPSIS β¨
#include <Inventor/SoType.h>
Methods from class SoType:
static SoType fromName(SbName name)
SbName getName() const
SoType getParent() const
static SoType badType()
SbBool isBad() const
SbBool isDerivedFrom(SoType t) const
static int getAllDerivedFrom(SoType type, SoTypeList &list)
SbBool canCreateInstance() const
void * createInstance() const
int operator ==(const SoType t) const
int operator !=(const SoType t) const
int operator <(const SoType t) const
π¦ DESCRIPTION π¦
okay so the SoType class keeps track of runtime type information in Inventor. every type is linked to a given name, which means you can look stuff up in either direction β name β type, or type β name. two-way street, main character energy π«Ά
a bunch of Inventor classes ask for their own unique SoType when they get initialized. and then that type is likeβ¦ your little key π you can use it to find out the actual class of an instance when all you know is its base class, OR to get yourself an instance of a particular class if you've got its type or its name.
heads up bestie: the names associated with types of Inventor classes do not contain the "So" prefix. so don't go looking for it, it's not there π
π METHODS π
static SoType fromName(SbName name)β hands you back the type that's associated with the given name. name in, type out. slay.SbName getName() constβ the reverse vibe: returns the name that's associated with a type.SoType getParent() constβ returns the type of the parent class. family tree reveal π³static SoType badType()β returns an always-illegal type. lowkey useful for returning errors, like "this is nothing, don't come for me".SbBool isBad() constβ returnsTRUEif the type is a bad type. vibe check on the type, fr fr.SbBool isDerivedFrom(SoType t) constβ returnsTRUEif the type is derived from typet. lineage check β¨static int getAllDerivedFrom(SoType type, SoTypeList &list)β adds every type derived from the given type into the given type list, then returns the number of types it added. so you get the whole squad plus a headcount π«ΆSbBool canCreateInstance() constβ some types are actually able to create instances; for example, most nodes and engines (the ones that are not abstract classes) can be created this way. this method returnsTRUEif the type supports that kind of creation.void * createInstance() constβ creates and returns a pointer to an instance of the type. returnsNULLif an instance couldn't be created for some reason π the pointer comes back as a generic pointer, but you can cast it to whatever the appropriate type is. for example:
SoCube *c = (SoCube *) SoCube::getClassTypeId().createInstance();
is a convoluted way of creating a new instance of an SoCube. the way that this is the most extra route possible and it still works π
int operator ==(const SoType t) constint operator !=(const SoType t) const
both of these return TRUE if this type is the same as β or not the same as β the given type. matching fits and mismatches, no in-between.
int operator <(const SoType t) constβ a less-than comparison operator that you can use to sort types. otherwise it's pretty useless, ngl. sorting queen behavior only π
π SEE ALSO π
SoAction, SoBase, SoDetail, SoError, SoEvent, SoField
and that's the whole page, bestie!! π§ this was SoType(3IV) β that's the manual name, and the footer is just SoType(3IV)() with, like, no version and no date, it's giving mystery and we love that for it. go forth and type-check responsibly β¨ππ
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms