The soqtobject class is the common superclass for all soqt component classes. the purpose of making this class the superclass of all soqt device, component and viewer classes is to be able to do run-time type checking of the soqt objects.
#include <Inventor/Qt/SoQtObject.h>
Inherited by SoQtComponent, and SoQtDevice.
virtual SoType getTypeId (void) const =0
SbBool isOfType (SoType type) const
static void initClass (void)
static SoType getClassTypeId (void)
static void init (void)
The SoQtObject class is the common superclass for all SoQt component classes.
The purpose of making this class the superclass of all SoQt device, component and viewer classes is to be able to do run-time type checking of the SoQt objects.
You can place the macro SOQT_OBJECT_HEADER(classname,parentname) within a class definition header for SoQt extension components to automatically make the necessary definitions for setting up a run-time 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 sourcecode file to include the necessary code for the run-time type system:
#include <MySpecialViewer.h> SOQT_OBJECT_SOURCE(MySpecialViewer); // [rest of class implementation]
See also the documentation of the SoType class in Coin or Inventor.
Sets up initialization for data common to all instances of this class, submitting necessary information to the internal SoQt type system.
Referenced by init(), SoQtDevice::initClasses(), and SoQtComponent::initClasses().
This static method returns the SoType object associated with objects of this class.
Referenced by SoQtRenderArea::sizeChanged().
Returns the type identification of an object derived from a class inheriting SoQtObject. This is used for run-time type checking and 'downward' casting.
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 } }
Referenced by isOfType(), and SoQtRenderArea::sizeChanged().
Returns TRUE if the type of this object is either of the same type or inherited from type.
References getTypeId().
Initialize the type system of SoQtObject, all SoQt device classes and all SoQt components (including viewers).
References initClass(), SoQtDevice::initClasses(), and SoQtComponent::initClasses().
Generated automatically by Doxygen for SoQt from the source code.