Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoXtSpaceball Class Reference

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

#include <Inventor/Xt/devices/SoXtSpaceball.h>

+ Inheritance diagram for SoXtSpaceball:

Public Member Functions

 SoXtSpaceball (SoGuiSpaceball::Mask mask=SoGuiSpaceball::ALL)
 Constructor.
 
 SoXtSpaceball (Display *d, SoGuiSpaceball::Mask mask=SoGuiSpaceball::ALL)
 Constructor.
 
 ~SoXtSpaceball ()
 Destructor.
 
virtual void enable (SoWidget w, XtEventHandler f, XtPointer data, Window win=0)
 Enables this device for the passed widget.
 
virtual void disable (SoWidget w, XtEventHandler f, XtPointer data)
 Disables this device for the passed widget.
 
virtual const SoEventtranslateEvent (XAnyEvent *xevent)
 This converts a system event into an SoEvent, returning NULL if the event is not from this device.
 
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 SoXtDevice
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 this device is registered for.
 
virtual ~SoXtDevice ()
 

Static Public Member Functions

static SbBool exists ()
 Returns whether or not the spaceball device exists for use.
 
static SbBool exists (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).

Definition at line 81 of file SoXtSpaceball.h.

Constructor & Destructor Documentation

◆ SoXtSpaceball() [1/2]

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

Constructor.

◆ SoXtSpaceball() [2/2]

SoXtSpaceball::SoXtSpaceball ( Display *  d,
SoGuiSpaceball::Mask  mask = SoGuiSpaceball::ALL 
)

Constructor.

◆ ~SoXtSpaceball()

SoXtSpaceball::~SoXtSpaceball ( )

Destructor.

Member Function Documentation

◆ disable()

virtual void SoXtSpaceball::disable ( SoWidget  w,
XtEventHandler  f,
XtPointer  data 
)
virtual

Disables this device for the passed widget.

The callback function f will be invoked when events occur in w. Data is the clientData which will be passed.

Implements SoXtDevice.

◆ enable()

virtual void SoXtSpaceball::enable ( SoWidget  w,
XtEventHandler  f,
XtPointer  data,
Window  win = 0 
)
virtual

Enables this device for the passed widget.

The callback function f will be invoked when events occur in w. Data is the clientData which will be passed.

Implements SoXtDevice.

◆ exists() [1/2]

static SbBool SoXtSpaceball::exists ( )
inlinestatic

Returns whether or not the spaceball device exists for use.

Definition at line 153 of file SoXtSpaceball.h.

◆ exists() [2/2]

static SbBool SoXtSpaceball::exists ( Display *  d)
static

Returns whether or not the spaceball device exists for use.

◆ getRotationScaleFactor()

float SoXtSpaceball::getRotationScaleFactor ( ) const
inline

Returns the rotation scale factor.

Definition at line 138 of file SoXtSpaceball.h.

◆ getTranslationScaleFactor()

float SoXtSpaceball::getTranslationScaleFactor ( ) const
inline

Returns the translation scale factor.

Definition at line 148 of file SoXtSpaceball.h.

◆ isFocusToWindow()

SbBool SoXtSpaceball::isFocusToWindow ( ) const
inline

Gets the input focus method.

See setFocusToWindow() for details.

Definition at line 169 of file SoXtSpaceball.h.

◆ setFocusToWindow()

void SoXtSpaceball::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 SoXtSpaceball::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 134 of file SoXtSpaceball.h.

◆ setTranslationScaleFactor()

void SoXtSpaceball::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 144 of file SoXtSpaceball.h.

◆ translateEvent()

virtual const SoEvent * SoXtSpaceball::translateEvent ( XAnyEvent *  xevent)
virtual

This converts a system event into an SoEvent, returning NULL if the event is not from this device.

Implements SoXtDevice.


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