Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoWinSpaceball.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25
26#ifndef _SO_WIN_SPACEBALL_
27#define _SO_WIN_SPACEBALL_
28
29#include <Inventor/Win/SoWinBeginStrict.h>
30
31#include <windows.h>
32#include <Inventor/Win/SoWin.h>
33#include <Inventor/Win/devices/SoWinDevice.h>
34
35#include <Inventor/events/SoMotion3Event.h>
36#include <Inventor/events/SoSpaceballButtonEvent.h>
37#include <Inventor/Win/SoWinRenderArea.h>
38
39#include <Inventor/Gui/devices/SoGuiSpaceball.h>
56
57 public:
58
59 //
60 // valid event mask values:
61 // SoWinSpaceball::MOTION - spaceball translation and rotation
62 // SoWinSpaceball::PRESS - spaceball button press
63 // SoWinSpaceball::RELEASE - spaceball button release
64 // SoWinSpaceball::ALL - all spaceball events
65 // Bitwise OR these to specify whichEvents this device should queue.
66 //
67
73
77 SoWinSpaceball(SoGuiSpaceball::Mask mask = SoGuiSpaceball::ALL);
78
83
85 virtual void enable(SoWidget w, XtEventHandler f,
86 XtPointer data, Window win = NULL);
87
89 virtual void disable(SoWidget w, XtEventHandler f, XtPointer data);
90
92 virtual const SoEvent *translateEvent(XAnyEvent *xevent);
93
99 void setRotationScaleFactor(float f) { m_guiSpaceball->setRotationScaleFactor( f ); }
100
104 float getRotationScaleFactor() const { return m_guiSpaceball->getRotationScaleFactor(); }
105
111 void setTranslationScaleFactor(float f) { m_guiSpaceball->setTranslationScaleFactor( f ); }
112
116 float getTranslationScaleFactor() const { return m_guiSpaceball->getTranslationScaleFactor(); }
117
121 static SbBool exists();
122
127 void setFocusToWindow(SbBool flag) { m_guiSpaceball->setFocusToWindow( flag ); }
128
133 SbBool isFocusToWindow() const { return m_guiSpaceball->isFocusToWindow(); }
134
135 private:
136
137 SoGuiSpaceball* m_guiSpaceball; // Implementation class for SoXxSpaceball
138
139 SoMotion3Event *motionEvent; // spaceball rotation/translation
140 SoSpaceballButtonEvent *buttonEvent; // spball button press/release
141
142 // The first widget which registered the space ball object
143 SoWidget parentWidget;
144
145 HWND m_curHwnd;
146
147 // event translators!
148 SoMotion3Event *translateMotionEvent(MSG *me);
149 SoSpaceballButtonEvent *translateButtonEvent(MSG *be,
150 SoButtonEvent::State whichState);
151 SoMotion3Event *translateMotionEventMagellan(MSG *me);
152
153 // Magellanstruct _MagellanControl_ Space Mouse data structure
154 struct _MagellanControl_ *magellanHandle;
155};
156
157#include <Inventor/Win/SoWinEndStrict.h>
158
159#endif /* _SO_WIN_SPACEBALL_ */
160
Base class for all events.
Definition SoEvent.h:116
3D motion events.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Spaceball button...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Definition SoWinDevice.h:58
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Translates and r...
float getTranslationScaleFactor() const
Returns the translation scale factor.
virtual void disable(SoWidget w, XtEventHandler f, XtPointer data)
Disables the device.
void setFocusToWindow(SbBool flag)
Win32 does not support focus change.
~SoWinSpaceball()
Destructor.
static SbBool exists()
Returns whether or not the spaceball device exists for use.
SoWinSpaceball(SoGuiSpaceball::Mask mask=SoGuiSpaceball::ALL)
Constructor.
void setRotationScaleFactor(float f)
The spaceball reports rotations and translations as integers.
virtual void enable(SoWidget w, XtEventHandler f, XtPointer data, Window win=NULL)
Enables the device for the passed window handle.
float getRotationScaleFactor() const
Returns the rotation scale factor.
void setTranslationScaleFactor(float f)
The spaceball reports rotations and translations as integers.
SbBool isFocusToWindow() const
Win32 does not support focus change.
virtual const SoEvent * translateEvent(XAnyEvent *xevent)
Attempts to convert the passed message into an SoEvent.
static SbBool isSpaceMousePresent()
Used in glxWindowProc method from SoWinGLWidget and SoWinMPGLWidget.
int SbBool
Boolean type.
Definition SbBase.h:87
void * XtPointer
Definition SoQtDef.h:122