Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

soqtobject(3) [debian man page]

SoQtObject(3)							       SoQt							     SoQtObject(3)

NAME
SoQtObject - 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. SYNOPSIS
#include <Inventor/Qt/SoQtObject.h> Inherited by SoQtComponent, and SoQtDevice. Public Member Functions virtual SoType getTypeId (void) const =0 SbBool isOfType (SoType type) const Static Public Member Functions static void initClass (void) static SoType getClassTypeId (void) static void init (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 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. Member Function Documentation void SoQtObject::initClass (void) [static] 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(). SoType SoQtObject::getClassTypeId (void) [static] This static method returns the SoType object associated with objects of this class. Referenced by SoQtViewer::setCameraType(), SoQtViewer::setSceneGraph(), SoQtRenderArea::sizeChanged(), SoQtViewer::SoQtViewer(), and SoQtViewer::toggleCameraType(). SoType SoQtObject::getTypeId (void) const [pure virtual] 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(). SbBool SoQtObject::isOfType (SoTypetype) const Returns TRUE if the type of this object is either of the same type or inherited from type. References getTypeId(). void SoQtObject::init (void) [static] Initialize the type system of SoQtObject, all SoQt device classes and all SoQt components (including viewers). References initClass(), SoQtDevice::initClasses(), and SoQtComponent::initClasses(). Author Generated automatically by Doxygen for SoQt from the source code. Version 1.5.0 Sun Dec 11 2011 SoQtObject(3)

Check Out this Related Man Page

SoQtDevice(3)							       SoQt							     SoQtDevice(3)

NAME
SoQtDevice - The SoQtDevice class is the base class for the translation devices. The SoQt device classes provide glue functionality for translating native GUI events from the underlying toolkit to Inventor scenegraph SoEvent events. SYNOPSIS
#include <Inventor/Qt/devices/SoQtDevice.h> Inherits SoQtObject. Inherited by SoQtKeyboard, and SoQtMouse. Public Member Functions virtual ~SoQtDevice () virtual void enable (QWidget *w, SoQtEventHandler *handler, void *closure)=0 virtual void disable (QWidget *w, SoQtEventHandler *handler, void *closure)=0 virtual const SoEvent * translateEvent (QEvent *event)=0 void setWindowSize (const SbVec2s size) SbVec2s getWindowSize (void) const Static Public Member Functions static void initClasses (void) Protected Member Functions SoQtDevice (void) void setEventPosition (SoEvent *event, int x, int y) const void addEventHandler (QWidget *, SoQtEventHandler *, void *) void removeEventHandler (QWidget *, SoQtEventHandler *, void *) void invokeHandlers (QEvent *event) Static Protected Member Functions static SbVec2s getLastEventPosition (void) Friends class SoQtDeviceP Detailed Description The SoQtDevice class is the base class for the translation devices. The SoQt device classes provide glue functionality for translating native GUI events from the underlying toolkit to Inventor scenegraph SoEvent events. The device classes are mainly of interest to application programmers when writing extensions for new types of devices, and seldom in other contexts -- so they can most often be ignored. Constructor &; Destructor Documentation SoQtDevice::~SoQtDevice () [virtual] Public virtual destructor. SoQtDevice::SoQtDevice (void) [protected] Constructor. Protected to only enable invocation from derived device classes. Member Function Documentation void SoQtDevice::enable (QWidget *widget, SoQtEventHandler *handler, void *closure) [pure virtual] This method will enable the device for the widget. handler is invoked with the closure argument when an event occur in widget. Implemented in SoQtMouse, and SoQtKeyboard. Referenced by SoQtRenderArea::buildWidget(), and SoQtRenderArea::registerDevice(). void SoQtDevice::disable (QWidget *widget, SoQtEventHandler *handler, void *closure) [pure virtual] This method will disable the handler for the device. Implemented in SoQtMouse, and SoQtKeyboard. Referenced by SoQtRenderArea::unregisterDevice(). const SoEvent * SoQtDevice::translateEvent (QEvent *event) [pure virtual] This method translates from native events to Open Inventor SoEvent events. Implemented in SoQtMouse, and SoQtKeyboard. void SoQtDevice::setWindowSize (const SbVec2ssize) This method sets the cached size of the window the device is 'attached' to. Referenced by SoQtRenderArea::registerDevice(). SbVec2s SoQtDevice::getWindowSize (void) const This method returns the cached window size. void SoQtDevice::initClasses (void) [static] This function initializes the type system for all the SoQt device classes. It is called indirectly when calling SoQt::init(), so the application programmer doesn't have to bother with it. References SoQtObject::initClass(). Referenced by SoQtObject::init(). void SoQtDevice::setEventPosition (SoEvent *event, intx, inty) const [protected] This method fills in the position information of event, translating the coordinates into the correct coordinate system. Referenced by SoQtKeyboard::translateEvent(), and SoQtMouse::translateEvent(). SbVec2s SoQtDevice::getLastEventPosition (void) [static, protected] Returns last event position that was set with SoQtDevice::setEventPosition(). Referenced by SoQtKeyboard::translateEvent(). void SoQtDevice::addEventHandler (QWidget *widget, SoQtEventHandler *handler, void *closure) [protected] Stores an event handler for the widget, which can later be invoked with SoQtDevice::invokeHandlers(). Used by extension device types. void SoQtDevice::removeEventHandler (QWidget *widget, SoQtEventHandler *handler, void *closure) [protected] Remove a handler registered with SoQtDevice::addEventHandler(). void SoQtDevice::invokeHandlers (QEvent *event) [protected] Invoke all handlers registered with SoQtDevice::addEventHandler(). Author Generated automatically by Doxygen for SoQt from the source code. Version 1.5.0 Sun Dec 11 2011 SoQtDevice(3)
Man Page