~ubuntu-branches/ubuntu/oneiric/soqt/oneiric

« back to all changes in this revision

Viewing changes to build/msvc7/src/Inventor/Qt/devices/SoQtSpaceballCommon.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2006-02-06 22:34:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060206223400-g69m5soqa4zh0gkc
Tags: 1.3.0-3
debian/control: update libsoqt-dev depends.  Closes: #351700.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************\
 
2
 *
 
3
 *  This file is part of the Coin 3D visualization library.
 
4
 *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
 
5
 *
 
6
 *  This library is free software; you can redistribute it and/or
 
7
 *  modify it under the terms of the GNU General Public License
 
8
 *  ("GPL") version 2 as published by the Free Software Foundation.
 
9
 *  See the file LICENSE.GPL at the root directory of this source
 
10
 *  distribution for additional information about the GNU GPL.
 
11
 *
 
12
 *  For using Coin with software that can not be combined with the GNU
 
13
 *  GPL, and for taking advantage of the additional benefits of our
 
14
 *  support services, please contact Systems in Motion about acquiring
 
15
 *  a Coin Professional Edition License.
 
16
 *
 
17
 *  See <URL:http://www.coin3d.org/> for more information.
 
18
 *
 
19
 *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
 
20
 *  <URL:http://www.sim.no/>.
 
21
 *
 
22
\**************************************************************************/
 
23
 
 
24
/*!
 
25
  \class SoQtSpaceball SoQtSpaceball.h Inventor/Qt/devices/SoQtSpaceball.h
 
26
  \brief The SoQtSpaceball class is the spaceball input device abstraction.
 
27
  \ingroup devices
 
28
 
 
29
  The SoQtSpaceball class is the glue between native spaceball
 
30
  handling and how those events translates to generic events for the
 
31
  Inventor API scenegraph.
 
32
*/
 
33
 
 
34
// *************************************************************************
 
35
 
 
36
#ifdef HAVE_CONFIG_H
 
37
#include <config.h>
 
38
#endif // HAVE_CONFIG_H
 
39
 
 
40
#include <Inventor/Qt/devices/SoQtSpaceball.h>
 
41
#include <Inventor/Qt/devices/SoQtSpaceballP.h>
 
42
 
 
43
#define PRIVATE(p) (p->pimpl)
 
44
#define PUBLIC(p) (p->pub)
 
45
 
 
46
// *************************************************************************
 
47
 
 
48
SOQT_OBJECT_SOURCE(SoQtSpaceball);
 
49
 
 
50
// *************************************************************************
 
51
 
 
52
/*!
 
53
  \enum SoQtSpaceball::DeviceType
 
54
 
 
55
  Enumeration of spaceball input device types.
 
56
*/
 
57
/*!
 
58
  \enum SoQtSpaceball::Mask
 
59
  Enumeration of spaceball input device event types.
 
60
*/
 
61
 
 
62
/*!
 
63
  \fn SoQtSpaceball::SoQtSpaceball(int mask)
 
64
 
 
65
  Public constructor. The \a mask argument specifies which events we
 
66
  are interested in.
 
67
*/
 
68
 
 
69
/*!
 
70
  \fn SoQtSpaceball::~SoQtSpaceball()
 
71
  Destructor.
 
72
*/
 
73
 
 
74
// *************************************************************************
 
75
 
 
76
/*!
 
77
  This method sets the scale factor for the spaceball rotation vectors.
 
78
*/
 
79
void
 
80
SoQtSpaceball::setRotationScaleFactor(float f)
 
81
{
 
82
  PRIVATE(this)->rotationscale = f;
 
83
}
 
84
 
 
85
/*!
 
86
  This method returns the scale factor for the spaceball rotation vectors.
 
87
*/
 
88
float
 
89
SoQtSpaceball::getRotationScaleFactor(void) const
 
90
{
 
91
  return PRIVATE(this)->rotationscale;
 
92
}
 
93
 
 
94
/*!
 
95
  This method sets the scale factor for the spaceball translation vectors.
 
96
*/
 
97
void
 
98
SoQtSpaceball::setTranslationScaleFactor(float f)
 
99
{
 
100
  PRIVATE(this)->translationscale = f;
 
101
}
 
102
 
 
103
/*!
 
104
  This method returns the scale factor for the spaceball translation vectors.
 
105
*/
 
106
float
 
107
SoQtSpaceball::getTranslationScaleFactor(void) const
 
108
{
 
109
  return PRIVATE(this)->translationscale;
 
110
}
 
111
 
 
112
// *************************************************************************
 
113
 
 
114
/*!
 
115
  \fn SbBool SoQtSpaceball::exists(void)
 
116
 
 
117
  Returns \c TRUE iff there could be a device of this type available
 
118
  on the system.
 
119
 
 
120
  Note that a return value of \c TRUE does \e not signify that there
 
121
  is such a device active.
 
122
*/
 
123
 
 
124
// *************************************************************************
 
125
 
 
126
/*!
 
127
  \fn void SoQtSpaceball::setFocusToWindow(SbBool flag)
 
128
 
 
129
  Set to \c TRUE if you want spaceball events to be received even when
 
130
  the component does not have focus.
 
131
*/
 
132
 
 
133
/*!
 
134
  \fn SbBool SoQtSpaceball::isFocusToWindow(void) const
 
135
 
 
136
  Returns whether or not spaceball events are caught even when the
 
137
  component does not have focus.
 
138
*/
 
139
 
 
140
// *************************************************************************
 
141
 
 
142
#ifndef DOXYGEN_SKIP_THIS
 
143
 
 
144
SoGuiSpaceballP::SoGuiSpaceballP(SoQtSpaceball * p)
 
145
{
 
146
  this->pub = p;
 
147
}
 
148
 
 
149
SoGuiSpaceballP::~SoGuiSpaceballP()
 
150
{
 
151
}
 
152
 
 
153
#endif // !DOXYGEN_SKIP_THIS
 
154
 
 
155
// *************************************************************************
 
156
 
 
157
#undef PRIVATE
 
158
#undef PUBLIC
 
159