SoQt  1.6.2
Coin3D GUI toolkit binding
No Matches
SoQtObject Class Referenceabstract

The SoQtObject class is the common superclass for all SoQt component classes. More...

#include <Inventor/Qt/SoQtObject.h>

Inheritance diagram for SoQtObject:
SoQtComponent SoQtDevice SoQtGLWidget SoQtKeyboard SoQtMouse SoQtRenderArea SoQtViewer SoQtFullViewer SoQtConstrainedViewer SoQtExaminerViewer SoQtPlaneViewer SoQtFlyViewer

Public Member Functions

virtual SoType getTypeId (void) const =0
SbBool isOfType (SoType type) const

Static Public Member Functions

static SoType getClassTypeId (void)
static void init (void)
static void initClass (void)

Detailed Description

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 runtime 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 provide the necessary definitions for setting up a runtime type system for your extension classes:

class MySpecialViewer : public SoQtExaminerViewer {
SOQT_OBJECT_HEADER(MySpecialViewer, SoQtExaminerViewer);
// [rest of class definition follows]
The SoQtExaminerViewer class is a 3D-model examination viewer.
Definition SoQtExaminerViewer.h:50

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>
// [rest of class implementation]

See also the documentation of the SoType class in Coin or Inventor.

Member Function Documentation

◆ getClassTypeId()

SoType SoQtObject::getClassTypeId ( void )

This static method returns the SoType object associated with objects of this class.

◆ getTypeId()

SoType SoQtObject::getTypeId ( void ) const
pure virtual

Returns the type identification of an object derived from a class inheriting SoQtObject. This is used for runtime type checking and "downward" casting.

Usage example:

void foo(SoQtViewer * comp)
// 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
The SoQtFlyViewer class implements controls for moving the camera in a "flying" motion.
Definition SoQtFlyViewer.h:42
static SoType getClassTypeId(void)
Definition SoQtObject.cpp:152
virtual SoType getTypeId(void) const =0
The SoQtViewer class is the top level base viewer class.
Definition SoQtViewer.h:90

◆ init()

void SoQtObject::init ( void )

Initialize the type system of SoQtObject, all SoQt device classes and all SoQt components (including viewers).

◆ initClass()

void SoQtObject::initClass ( void )

Sets up initialization for data common to all instances of this class, submitting necessary information to the internal SoQt type system.

◆ isOfType()

SbBool SoQtObject::isOfType ( SoType type) const

Returns TRUE if the type of this object is either of the same type or inherited from type.

The documentation for this class was generated from the following files: