SoQtObject(3)
π NAME π
Okay so welcome to SoQtObject(3) from the SoQt manual, bestie β¨ SoQtObject is the common superclass for all SoQt component classes β like, every single one. Thatβs the whole vibe. π
π¦ SYNOPSIS π¦
#include <Inventor/Qt/SoQtObject.h>
Inherited by SoQtComponent, and SoQtDevice.
π Public Member Functions
virtual SoType getTypeId (void) const =0β pure virtual type-ID getter; full tea is below.SbBool isOfType (SoType type) constβ checks the objectβs type againsttype; full tea is below.
π«Ά Static Public Member Functions
static void initClass (void)β sets up class-wide init data; details below.static SoType getClassTypeId (void)β hands you theSoTypefor this class; details below.static void init (void)β boots the type system; details below.
π Detailed Description π
So SoQtObject is the common superclass for all SoQt component classes. No cap.
The whole reason itβs the superclass of all SoQt device, component and viewer classes is so you can do runtime type checking on the SoQt objects. Itβs giving main character energy for the type system π
You can drop the macro SOQT_OBJECT_HEADER(classname,parentname) inside a class definition header for SoQt extension components, and it automatically provides the necessary definitions for setting up a runtime type system for your extension classes:
#ifndef MYSPECIALVIEWER_H
#define MYSPECIALVIEWER_H
class MySpecialViewer : public SoQtExaminerViewer {
SOQT_OBJECT_HEADER(MySpecialViewer, SoQtExaminerViewer);
// [rest of class definition follows]
};
#endif // !MYSPECIALVIEWER_H
Then put the SOQT_OBJECT_SOURCE(classname) macro within the actual implementation source code file to include the necessary code for the runtime type system:
#include <MySpecialViewer.h>
SOQT_OBJECT_SOURCE(MySpecialViewer);
// [rest of class implementation]
Also go peek at the documentation of the SoType class in Coin or Inventor β iykyk π
π Member Function Documentation π
β¨ void SoQtObject::initClass (void ) [static]
This static setup move gets the data thatβs common to all instances of this class ready, and it submits the necessary information to the internal SoQt type system. Slay, initialization handled β¨
β¨ SoType SoQtObject::getClassTypeId (void ) [static]
This static method returns the SoType object associated with objects of this class. Literally the classβs type-ID hookup π«Ά
β¨ virtual SoType SoQtObject::getTypeId (void ) const [pure virtual]
This returns the type identification of an object derived from a class inheriting SoQtObject. Itβs used for runtime type checking and "downward" casting. Itβs pure virtual, so your subclass has to bring its own implementation β periodt π
Usage example:
void foo(SoQtViewer * comp)
{
if (comp->getTypeId() == SoQtExaminerViewer::getClassTypeId()) {
// safe downward cast, knows the type
SoQtExaminerViewer * exviewer = (SoQtExaminerViewer *)comp;
}
else if (comp->getTypeId().isOfType(SoQtFlyViewer::getClassTypeId())) {
// safe downward cast, knows the type
SoQtFlyViewer * flyviewer = (SoQtFlyViewer *)comp;
// then something else
}
}
Implemented in SoQtComponent.
β¨ SbBool SoQtObject::isOfType (SoType type) const
Pass in a SoType type; this returns TRUE if the type of this object is either of the same type or inherited from type. Vibe check for type inheritance β
β¨ void SoQtObject::init (void ) [static]
This initializes the type system of SoQtObject, all SoQt device classes and all SoQt components (including viewers). Itβs the big type-system glow-up for the whole crew π
π¦ Author π¦
Generated automatically by Doxygen for SoQt from the source code. Not me writing it by hand, bestie β the robots handled this one π€π
Catch you later, bestie π«Ά SoQtObject(3) β Version 1.6.2, dated Sat Jan 6 2024 12:20:55. Slay. π
π¦ where this page comes from
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms