GL Studio C++ Runtime API
gls_thumb_wheel.h
Go to the documentation of this file.
1/// \file gls_thumb_wheel.h
2/// \brief The disti::GlsThumbWheel class.
3///
4/// \par Copyright Information
5///
6/// Copyright (c) 2017 by The DiSTI Corporation.<br>
7/// 12249 Science Drive; Suite 300<br>
8/// Orlando, Florida 32826<br>
9/// USA<br>
10/// <br>
11/// All rights reserved.<br>
12///
13/// This Software contains proprietary trade secrets of DiSTI and may not be
14/// reproduced, in whole or part, in any form, or by any means of electronic,
15/// mechanical, or otherwise, without the written permission of DiSTI. Said
16/// permission may be derived through the purchase of applicable DiSTI product
17/// licenses which detail the distribution rights of this content and any
18/// Derivative Works based on this or other copyrighted DiSTI Software.
19///
20/// NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21/// AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22/// PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23/// AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24/// IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25/// PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26///
27/// LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28/// IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29/// INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30/// DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31/// INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32/// INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33/// OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34/// EXCEED FIVE DOLLARS (US$5.00).
35///
36/// The aforementioned terms and restrictions are governed by the laws of the
37/// State of Florida and the United States of America.
38
39#ifndef INCLUDED_GLS_THUMBWHEEL_H
40#define INCLUDED_GLS_THUMBWHEEL_H
41
42#include "gls_odometer.h" // Needed to autolink the odometer lib
43#include "glsutil.h"
44#include "group.h"
45
46/// Provides support for creating DLLs.
47#if( defined( GLSGEN_EXPORT_GLSTHUMBWHEEL ) || defined( GLSGEN_IMPORT_GLSTHUMBWHEEL ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
48 && defined( _MSC_VER )
49# if defined( GLSGEN_EXPORT_GLSTHUMBWHEEL ) || defined( GLS_EXPORT_GENERATED )
50# define GLSGEN_GLSTHUMBWHEEL_EXPORT __declspec( dllexport )
51# else
52# define GLSGEN_GLSTHUMBWHEEL_EXPORT __declspec( dllimport )
53# endif
54#else
55# define GLSGEN_GLSTHUMBWHEEL_EXPORT
56#endif
57///////////////////////////////////////////////////////////////////////////////
58
59/// Automatically link the runtime library plugin (on Windows).
60#define LIB_BASE_NAME "gls_thumb_wheel"
61#include "gls_auto_lib.h"
62#undef LIB_BASE_NAME
63
64namespace disti
65{
66// SetValue enumerations
67// enums for metadata attributes
68enum
69{
70 GLS_GLSTHUMBWHEEL_INITIAL_VAL = GLS_LAST_INITIALIZER + 1,
71 GLS_GLSTHUMBWHEEL_EMIT_DETENT_VAL_EVENT,
72 GLS_GLSTHUMBWHEEL_EMIT_LIMIT_EVENT,
73 GLS_GLSTHUMBWHEEL_EMIT_RELEASE_EVENT,
74 GLS_GLSTHUMBWHEEL_NUMBER_OF_DETENTS,
75 GLS_GLSTHUMBWHEEL_CONTINUOUS_DRAG,
76 GLS_GLSTHUMBWHEEL_DETENT_VAL,
77 GLS_GLSTHUMBWHEEL_WHICH_OBJECT_THUMBWHEEL,
78 GLS_GLSTHUMBWHEEL_WHICH_OBJECT_ODOMETER,
79 GLS_GLSTHUMBWHEEL_SOUND_INDEX
80};
81
82/** Runtime implementation of a GlsThumbWheel */
83class GlsThumbWheel : public Group
84{
85 friend class GlsThumbWheelEditor;
86
87public:
88 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
89 typedef Group _BaseClass; ///< Deprecated typedef for the base class.
90 typedef Group BaseClass; ///< Typedef for the base class.
91
92 /** Create a new GlsThumbWheel.
93 * \param generateInstance Whether or not to generate an instance name
94 * for this inputdevice */
95 GLSGEN_GLSTHUMBWHEEL_EXPORT GlsThumbWheel( bool generateInstance = false );
96
97 /** Copy construct a new GlsThumbWheel object
98 * \param thumbwheel The thumbwheel to be cloned
99 * \param generateNames Whether or not to generate a new instance name
100 */
101 GLSGEN_GLSTHUMBWHEEL_EXPORT GlsThumbWheel( const GlsThumbWheel& thumbwheel, const bool generateNames );
102
103 /** Destructs a GlsThumbWheel object */
105
106 /// \return A pointer to a new GlsThumbWheel object.
108
110
112
114
115#ifndef GLES
118#endif
119
122
124
125 /// \return If this switch is horizontal or vertical relative to the y axis.
127
128 void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
129
130 //////////////////////////////////////////////////
131 // GlsThumbWheel specific operations
132 //////////////////////////////////////////////////
133
134 /** Sets current detent of the thumbwheel
135 * \param val New detent of the thumbwheel
136 */
138
139 /** Returns the current detent of the thumbwheel
140 * \return Current thumbwheel detent
141 */
143
144 /** Sets current odometer index
145 * \param val New current odometer index
146 */
147 GLSGEN_GLSTHUMBWHEEL_EXPORT void IndexVal( const int& val );
148
149 /** Returns current odometer index
150 * \return Current odometer index
151 */
153
154 /** Sets group index for the selected odometer
155 * \param val New group index for the selected odometer
156 */
158
159 /** Returns the group index for the selected odometer
160 * \return group index for the selected odometer
161 */
163
164 /** Sets group index for the selected ThumbWheel geometry
165 * \param val New group index for the selected ThumbWheel geometry
166 */
168
169 /** Returns the group index for the selected ThumbWheel geometry
170 * \return group index for the selected ThumbWheel geometry
171 */
173
175 const Vector& logicalCoords,
176 float scale,
177 const Vector& directionVector,
178 Vector& collisionWinLoc /*Returned*/,
179 const OpenGLMatrices& drawnMatrices ) DISTI_METHOD_OVERRIDE;
180
181protected:
182 bool _emitDetentValEvent; ///< If true, events will be emitted whenever the detent value changes.
183 bool _emitLimitEvent; ///< Whether or not to emit limit events - when start or end is reached.
184 bool _emitReleaseEvent; ///< If true, an event will be emitted when the wheel is released.
185 int _detentVal; ///< range: 1 to _numberOfDetents (the detent of the thumbwheel)
186 int _indexVal; ///< range: 0 to _numberOfDetents - 1 (the index of the odometer)
187 int _initialVal; ///< The initial detent state of the wheel.
188 int _numberOfDetents; ///< The total number of detents of the wheel.
189 int _soundIndex; ///< The index into the list of sounds.
190 bool _continuousDrag; ///< if true, the wheel will wrap around when limit is reached.
191 int _whichObjectThumbWheel; ///< The object index in the group to be the thumbwheel.
192 int _whichObjectOdometer; ///< The object index in the group to be the odometer (if there is one).
193
194 int _browserIndexThumbWheel; ///< Need to keep track of browser Index for use in ShowProperties()
195 int _browserIndexOdometer; ///< Need to keep track of browser Index for use in ShowProperties()
196
197 bool _initialized; ///< If true, the object has been configured from its original state.
198 bool _mouseWasDown; ///< Whether or not the mouse is down on this object.
199 unsigned int _currentCursor; ///< The current cursor used for interaction. Any other cursors are ignored while interacting.
200
201#ifdef GLES
202 /** Set a single attribute from the GLO file.
203 * \param data The attribute to set and its associated data.
204 */
206#endif
207};
208
209} // namespace disti
210
211#endif
Definition: cull.h:49
Definition: events.h:111
Definition: display.h:95
Definition: dynamic_array.h:79
Definition: gls_glo_file.h:1241
Definition: gls_thumb_wheel.h:84
int _detentVal
range: 1 to _numberOfDetents (the detent of the thumbwheel)
Definition: gls_thumb_wheel.h:185
bool _emitDetentValEvent
If true, events will be emitted whenever the detent value changes.
Definition: gls_thumb_wheel.h:182
unsigned int _currentCursor
The current cursor used for interaction. Any other cursors are ignored while interacting.
Definition: gls_thumb_wheel.h:199
int _whichObjectThumbWheel
The object index in the group to be the thumbwheel.
Definition: gls_thumb_wheel.h:191
void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
int _initialVal
The initial detent state of the wheel.
Definition: gls_thumb_wheel.h:187
int _browserIndexOdometer
Need to keep track of browser Index for use in ShowProperties()
Definition: gls_thumb_wheel.h:195
bool _initialized
If true, the object has been configured from its original state.
Definition: gls_thumb_wheel.h:197
void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
int _soundIndex
The index into the list of sounds.
Definition: gls_thumb_wheel.h:189
int _whichObjectOdometer
The object index in the group to be the odometer (if there is one).
Definition: gls_thumb_wheel.h:192
bool _mouseWasDown
Whether or not the mouse is down on this object.
Definition: gls_thumb_wheel.h:198
DisplayObject * handle(DisplayEvent *ev) DISTI_METHOD_OVERRIDE
bool _continuousDrag
if true, the wheel will wrap around when limit is reached.
Definition: gls_thumb_wheel.h:190
int _indexVal
range: 0 to _numberOfDetents - 1 (the index of the odometer)
Definition: gls_thumb_wheel.h:186
int _numberOfDetents
The total number of detents of the wheel.
Definition: gls_thumb_wheel.h:188
void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
static DisplayObject * CreateInstance()
void Draw() DISTI_METHOD_OVERRIDE
bool _emitReleaseEvent
If true, an event will be emitted when the wheel is released.
Definition: gls_thumb_wheel.h:184
InputOrientationEnum InputType()
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices) DISTI_METHOD_OVERRIDE
int _browserIndexThumbWheel
Need to keep track of browser Index for use in ShowProperties()
Definition: gls_thumb_wheel.h:194
DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
bool _emitLimitEvent
Whether or not to emit limit events - when start or end is reached.
Definition: gls_thumb_wheel.h:183
InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
Definition: group.h:52
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:540
Definition: vertex.h:84
The gls_auto_lib.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:487
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:221
The disti::GlsOdometer class.
#define GLSGEN_GLSTHUMBWHEEL_EXPORT
Provides support for creating DLLs.
Definition: gls_thumb_wheel.h:55
GL Studio helper functions.
The disti::Group class. Implements groups of objects.
Definition: bmpimage.h:46
InputOrientationEnum
Enumeration for Input Operators.
Definition: glsutil.h:270