Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoWinDevice Class Referenceabstract

VSG extension Abstract base class for input devices. More...

#include <Inventor/Win/devices/SoWinDevice.h>

+ Inheritance diagram for SoWinDevice:

Public Member Functions

virtual void enable (SoWidget w, XtEventHandler f, XtPointer data, Window win=NULL)=0
 Enables the device for the passed window handle.
 
virtual void disable (SoWidget w, XtEventHandler f, XtPointer data)=0
 Disables the device.
 
virtual const SoEventtranslateEvent (XAnyEvent *msg)=0
 Attempts to convert the passed message into an SoEvent.
 
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.
 

Detailed Description

VSG extension Abstract base class for input devices.

This is the abstract base class for devices in the Open Inventor Windows component and utility library. When a device is registered with an SoWinRenderArea, the device is able to generate messages in the render area window.

Used internally by SoWinRenderArea and derived classes. Can also be used by the application to translate system events into SoEvent objects.

SEE ALSO

SoWinMouse, SoWinKeyboard, SoWinRenderArea, SoWinTouchScreen

Definition at line 58 of file SoWinDevice.h.

Member Function Documentation

◆ disable()

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

Disables the device.

Implemented in SoWinTouchScreen, SoWinKeyboard, SoWinMouse, and SoWinSpaceball.

◆ enable()

virtual void SoWinDevice::enable ( SoWidget  w,
XtEventHandler  f,
XtPointer  data,
Window  win = NULL 
)
pure virtual

Enables the device for the passed window handle.

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

Implemented in SoWinTouchScreen, SoWinKeyboard, SoWinMouse, and SoWinSpaceball.

◆ getWindowSize()

const SbVec2s & SoWinDevice::getWindowSize ( ) const
inline

Gets the size of the window this device is registered for.

Definition at line 93 of file SoWinDevice.h.

◆ setWindowSize()

void SoWinDevice::setWindowSize ( const SbVec2s s)
inline

Sets the size of the window this device is registered for.

This allows the device to correctly convert position information from Windows coordinates (origin at top left) to Open Inventor window coordinates (origin at bottom left). (SoWinRenderArea will automatically call this method for each device registered on it whenever the window size changes.) Note: Setting the window size only affects the size as perceived by the device and not the actual window size.

Definition at line 89 of file SoWinDevice.h.

◆ translateEvent()

virtual const SoEvent * SoWinDevice::translateEvent ( XAnyEvent *  msg)
pure virtual

Attempts to convert the passed message 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.

Implemented in SoWinTouchScreen, SoWinKeyboard, SoWinMouse, and SoWinSpaceball.


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