Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoQtSpaceball Class Reference

Translates and reports events for a SpaceBall or SpaceMouse (Magellan) device. More...

#include <Inventor/Qt/devices/SoQtSpaceball.h>

+ Inheritance diagram for SoQtSpaceball:

Public Member Functions

 SoQtSpaceball (SoGuiSpaceball::Mask mask=SoGuiSpaceball::ALL)
 Constructor.
 
 SoQtSpaceball (SbGlContextHelper::Display d, SoGuiSpaceball::Mask mask=SoGuiSpaceball::ALL)
 Constructor.
 
 ~SoQtSpaceball ()
 Destructor.
 
virtual void enable (QWidget *w, XtEventHandler f, XtPointer data, void *unused=NULL)
 Enables the device for the passed widget.
 
virtual void disable (QWidget *w, XtEventHandler f, XtPointer data)
 Disables the device for the passed widget.
 
virtual const SoEventtranslateEvent (QEvent *xevent)
 Attempts to convert the passed event into an SoEvent.
 
void setRotationScaleFactor (float f)
 The spaceball reports rotations and translations as integers.
 
float getRotationScaleFactor () const
 Returns the rotation scale factor.
 
void setTranslationScaleFactor (float f)
 The spaceball reports rotations and translations as integers.
 
float getTranslationScaleFactor () const
 Returns the translation scale factor.
 
void setFocusToWindow (SbBool flag)
 Sets the input focus method used to get events from the space ball.
 
SbBool isFocusToWindow () const
 Gets the input focus method.
 
- Public Member Functions inherited from SoQtDevice
void setWindowSize (const SbVec2s &s)
 Sets the size of the window this device is registered for.
 
const SbVec2sgetWindowSize () const
 Gets the size of the window, in pixels, this device is registered for.
 

Static Public Member Functions

static SbBool exists ()
 Returns whether or not the spaceball device exists for use.
 
static SbBool exists (SbGlContextHelper::Display d)
 Returns whether or not the spaceball device exists for use.
 

Detailed Description

Translates and reports events for a SpaceBall or SpaceMouse (Magellan) device.

This class manages events generated by the spaceball, including spaceball motion (SoMotion3Event), and spaceball button press and release events (SoSpaceballButtonEvent).

SEE ALSO

SoQtDevice, SoMotion3Event, SoSpaceballButtonEvent

Definition at line 52 of file SoQtSpaceball.h.

Constructor & Destructor Documentation

◆ SoQtSpaceball() [1/2]

SoQtSpaceball::SoQtSpaceball ( SoGuiSpaceball::Mask  mask = SoGuiSpaceball::ALL)

Constructor.

◆ SoQtSpaceball() [2/2]

SoQtSpaceball::SoQtSpaceball ( SbGlContextHelper::Display  d,
SoGuiSpaceball::Mask  mask = SoGuiSpaceball::ALL 
)

Constructor.

◆ ~SoQtSpaceball()

SoQtSpaceball::~SoQtSpaceball ( )

Destructor.

Member Function Documentation

◆ disable()

virtual void SoQtSpaceball::disable ( QWidget *  w,
XtEventHandler  f,
XtPointer  data 
)
virtual

Disables the device for the passed widget.

Implements SoQtDevice.

◆ enable()

virtual void SoQtSpaceball::enable ( QWidget *  w,
XtEventHandler  f,
XtPointer  data,
void *  unused = NULL 
)
virtual

Enables the device for the passed widget.

When enabled, the callback function f will be invoked when events occur in the window. data is the clientData which will be passed.

Implements SoQtDevice.

◆ exists() [1/2]

static SbBool SoQtSpaceball::exists ( )
inlinestatic

Returns whether or not the spaceball device exists for use.

Definition at line 133 of file SoQtSpaceball.h.

◆ exists() [2/2]

static SbBool SoQtSpaceball::exists ( SbGlContextHelper::Display  d)
static

Returns whether or not the spaceball device exists for use.

◆ getRotationScaleFactor()

float SoQtSpaceball::getRotationScaleFactor ( ) const
inline

Returns the rotation scale factor.

Definition at line 118 of file SoQtSpaceball.h.

◆ getTranslationScaleFactor()

float SoQtSpaceball::getTranslationScaleFactor ( ) const
inline

Returns the translation scale factor.

Definition at line 128 of file SoQtSpaceball.h.

◆ isFocusToWindow()

SbBool SoQtSpaceball::isFocusToWindow ( ) const
inline

Gets the input focus method.

See setFocusToWindow() for details.

Definition at line 149 of file SoQtSpaceball.h.

◆ setFocusToWindow()

void SoQtSpaceball::setFocusToWindow ( SbBool  flag)

Sets the input focus method used to get events from the space ball.

If FALSE: SpaceBall events are received only if the cursor is in the window or when the window has the focus (default).
If TRUE: SpaceBall events are received even if cursor is out of the window.

◆ setRotationScaleFactor()

void SoQtSpaceball::setRotationScaleFactor ( float  f)
inline

The spaceball reports rotations and translations as integers.

These values must be scaled to be useful. This method sets the rotation scale factor. Default is .006.

Definition at line 114 of file SoQtSpaceball.h.

◆ setTranslationScaleFactor()

void SoQtSpaceball::setTranslationScaleFactor ( float  f)
inline

The spaceball reports rotations and translations as integers.

These values must be scaled to be useful. This method sets the translation scale factor. Default is .006.

Definition at line 124 of file SoQtSpaceball.h.

◆ translateEvent()

virtual const SoEvent * SoQtSpaceball::translateEvent ( QEvent *  xevent)
virtual

Attempts to convert the passed event into an SoEvent.


Returns a pointer to an internal SoEvent object owned by the class. Do not delete this object. If the message was not generated by this device, then NULL is returned.

Implements SoQtDevice.


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