| GL Studio C++ Runtime API

gls_thumb_wheel.h
Go to the documentation of this file.
1/*! \file
2 \brief The disti::GlsThumbWheel class.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<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*/
40#ifndef INCLUDED_GLS_THUMBWHEEL_H
41#define INCLUDED_GLS_THUMBWHEEL_H
42
43#include "gls_odometer.h" // Needed to autolink the odometer lib
44#include "glsutil.h"
45#include "group.h"
46
47/// Provides support for creating DLLs.
48#if( defined( GLSGEN_EXPORT_GLSTHUMBWHEEL ) || defined( GLSGEN_IMPORT_GLSTHUMBWHEEL ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
49 && defined( _MSC_VER )
50# if defined( GLSGEN_EXPORT_GLSTHUMBWHEEL ) || defined( GLS_EXPORT_GENERATED )
51# define GLSGEN_GLSTHUMBWHEEL_EXPORT __declspec( dllexport )
52# else
53# define GLSGEN_GLSTHUMBWHEEL_EXPORT __declspec( dllimport )
54# endif
55#else
56# define GLSGEN_GLSTHUMBWHEEL_EXPORT
57#endif
58///////////////////////////////////////////////////////////////////////////////
59
60/// Automatically link the runtime library plugin (on Windows).
61#define LIB_BASE_NAME "gls_thumb_wheel"
62#include "gls_auto_lib.h"
63#undef LIB_BASE_NAME
64
65 namespace disti
66{
67// SetValue enumerations
68// enums for metadata attributes
69 enum
70{
71 GLS_GLSTHUMBWHEEL_INITIAL_VAL = GLS_LAST_INITIALIZER + 1,
72 GLS_GLSTHUMBWHEEL_EMIT_DETENT_VAL_EVENT,
73 GLS_GLSTHUMBWHEEL_EMIT_LIMIT_EVENT,
74 GLS_GLSTHUMBWHEEL_EMIT_RELEASE_EVENT,
75 GLS_GLSTHUMBWHEEL_NUMBER_OF_DETENTS,
76 GLS_GLSTHUMBWHEEL_CONTINUOUS_DRAG,
77 GLS_GLSTHUMBWHEEL_DETENT_VAL,
78 GLS_GLSTHUMBWHEEL_WHICH_OBJECT_THUMBWHEEL,
79 GLS_GLSTHUMBWHEEL_WHICH_OBJECT_ODOMETER,
80 GLS_GLSTHUMBWHEEL_SOUND_INDEX
81};
82
83/** Runtime implementation of a GlsThumbWheel */
84 class GlsThumbWheel : public Group
85{
86 friend class GlsThumbWheelEditor;
87
88 public:
89 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
90 typedef Group _BaseClass; ///< Deprecated typedef for the base class.
91 typedef Group BaseClass; ///< Typedef for the base class.
92
93 /** Create a new GlsThumbWheel.
94 * \param generateInstance Whether or not to generate an instance name
95 * for this inputdevice */
96 GLSGEN_GLSTHUMBWHEEL_EXPORT GlsThumbWheel( bool generateInstance = false );
97
98 /** Copy construct a new GlsThumbWheel object
99 * \param thumbwheel The thumbwheel to be cloned
100 * \param generateNames Whether or not to generate a new instance name
101 */
102 GLSGEN_GLSTHUMBWHEEL_EXPORT GlsThumbWheel( const GlsThumbWheel& thumbwheel, const bool generateNames );
103
104 /** Destructs a GlsThumbWheel object */
105 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT ~GlsThumbWheel();
106
107 /// \return A pointer to a new GlsThumbWheel object.
108 static GLSGEN_GLSTHUMBWHEEL_EXPORT DisplayObject* CreateInstance();
109
110 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
111
112 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
113
114 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
115
116#ifndef GLES
117 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
118 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
119#endif
120
121 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler ) DISTI_METHOD_OVERRIDE;
122 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT void Draw() DISTI_METHOD_OVERRIDE;
123
124 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT DisplayObject* handle( DisplayEvent* ev ) DISTI_METHOD_OVERRIDE;
125
126 /// \return If this switch is horizontal or vertical relative to the y axis.
127 InputOrientationEnum InputType();
128
129 virtual void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
130
131 //////////////////////////////////////////////////
132 // GlsThumbWheel specific operations
133 //////////////////////////////////////////////////
134
135 /** Sets current detent of the thumbwheel
136 * \param val New detent of the thumbwheel
137 */
138 GLSGEN_GLSTHUMBWHEEL_EXPORT void DetentVal( const int& val );
139
140 /** Returns the current detent of the thumbwheel
141 * \return Current thumbwheel detent
142 */
143 GLSGEN_GLSTHUMBWHEEL_EXPORT int DetentVal();
144
145 /** Sets current odometer index
146 * \param val New current odometer index
147 */
148 GLSGEN_GLSTHUMBWHEEL_EXPORT void IndexVal( const int& val );
149
150 /** Returns current odometer index
151 * \return Current odometer index
152 */
153 GLSGEN_GLSTHUMBWHEEL_EXPORT int IndexVal();
154
155 /** Sets group index for the selected odometer
156 * \param val New group index for the selected odometer
157 */
158 GLSGEN_GLSTHUMBWHEEL_EXPORT void WhichObjectOdometer( const int& val );
159
160 /** Returns the group index for the selected odometer
161 * \return group index for the selected odometer
162 */
163 GLSGEN_GLSTHUMBWHEEL_EXPORT int WhichObjectOdometer();
164
165 /** Sets group index for the selected ThumbWheel geometry
166 * \param val New group index for the selected ThumbWheel geometry
167 */
168 GLSGEN_GLSTHUMBWHEEL_EXPORT void WhichObjectThumbWheel( const int& val );
169
170 /** Returns the group index for the selected ThumbWheel geometry
171 * \return group index for the selected ThumbWheel geometry
172 */
173 GLSGEN_GLSTHUMBWHEEL_EXPORT int WhichObjectThumbWheel();
174
175 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT DisplayObject* Pick3D( const Vector& winLoc,
176 const Vector& logicalCoords,
177 float scale,
178 const Vector& directionVector,
179 Vector& collisionWinLoc /*Returned*/,
180 const OpenGLMatrices& drawnMatrices ) DISTI_METHOD_OVERRIDE;
181
182protected:
183 bool _emitDetentValEvent; ///< If true, events will be emitted whenever the detent value changes.
184 bool _emitLimitEvent; ///< Whether or not to emit limit events - when start or end is reached.
185 bool _emitReleaseEvent; ///< If true, an event will be emitted when the wheel is released.
186 int _detentVal; ///< range: 1 to _numberOfDetents (the detent of the thumbwheel)
187 int _indexVal; ///< range: 0 to _numberOfDetents - 1 (the index of the odometer)
188 int _initialVal; ///< The initial detent state of the wheel.
189 int _numberOfDetents; ///< The total number of detents of the wheel.
190 int _soundIndex; ///< The index into the list of sounds.
191 bool _continuousDrag; ///< if true, the wheel will wrap around when limit is reached.
192 int _whichObjectThumbWheel; ///< The object index in the group to be the thumbwheel.
193 int _whichObjectOdometer; ///< The object index in the group to be the odometer (if there is one).
194
195 int _browserIndexThumbWheel; ///< Need to keep track of browser Index for use in ShowProperties()
196 int _browserIndexOdometer; ///< Need to keep track of browser Index for use in ShowProperties()
197
198 bool _initialized; ///< If true, the object has been configured from its original state.
199 bool _mouseWasDown; ///< Whether or not the mouse is down on this object.
200 unsigned int _currentCursor; ///< The current cursor used for interaction. Any other cursors are ignored while interacting.
201
202#ifdef GLES
203 /** Set a single attribute from the GLO file.
204 * \param data The attribute to set and its associated data.
205 */
206 virtual GLSGEN_GLSTHUMBWHEEL_EXPORT void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
207#endif
208};
209
210} // namespace disti
211
212#endif
disti::Culler
Definition: cull.h:50
disti::DisplayEvent
Definition: events.h:113
disti::DisplayObject
Definition: display.h:96
disti::DynamicArray
Definition: dynamic_array.h:79
disti::GlsGloFileAttribute
Definition: gls_glo_file.h:1243
disti::GlsThumbWheel
Definition: gls_thumb_wheel.h:85
disti::GlsThumbWheel::_detentVal
int _detentVal
range: 1 to _numberOfDetents (the detent of the thumbwheel)
Definition: gls_thumb_wheel.h:186
disti::GlsThumbWheel::WhichObjectThumbWheel
int WhichObjectThumbWheel()
disti::GlsThumbWheel::_emitDetentValEvent
bool _emitDetentValEvent
If true, events will be emitted whenever the detent value changes.
Definition: gls_thumb_wheel.h:183
disti::GlsThumbWheel::SetAvailableAttributes
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::Draw
virtual void Draw() DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::_currentCursor
unsigned int _currentCursor
The current cursor used for interaction. Any other cursors are ignored while interacting.
Definition: gls_thumb_wheel.h:200
disti::GlsThumbWheel::_whichObjectThumbWheel
int _whichObjectThumbWheel
The object index in the group to be the thumbwheel.
Definition: gls_thumb_wheel.h:192
disti::GlsThumbWheel::CloneObject
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::_initialVal
int _initialVal
The initial detent state of the wheel.
Definition: gls_thumb_wheel.h:188
disti::GlsThumbWheel::_browserIndexOdometer
int _browserIndexOdometer
Need to keep track of browser Index for use in ShowProperties()
Definition: gls_thumb_wheel.h:196
disti::GlsThumbWheel::SetFromGloData
virtual void SetFromGloData(GlsGloFileAttribute &data) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::PreDraw
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::_initialized
bool _initialized
If true, the object has been configured from its original state.
Definition: gls_thumb_wheel.h:198
disti::GlsThumbWheel::handle
virtual DisplayObject * handle(DisplayEvent *ev) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::IndexVal
int IndexVal()
disti::GlsThumbWheel::SetValue
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::_soundIndex
int _soundIndex
The index into the list of sounds.
Definition: gls_thumb_wheel.h:190
disti::GlsThumbWheel::_whichObjectOdometer
int _whichObjectOdometer
The object index in the group to be the odometer (if there is one).
Definition: gls_thumb_wheel.h:193
disti::GlsThumbWheel::_mouseWasDown
bool _mouseWasDown
Whether or not the mouse is down on this object.
Definition: gls_thumb_wheel.h:199
disti::GlsThumbWheel::DetentVal
int DetentVal()
disti::GlsThumbWheel::_continuousDrag
bool _continuousDrag
if true, the wheel will wrap around when limit is reached.
Definition: gls_thumb_wheel.h:191
disti::GlsThumbWheel::_indexVal
int _indexVal
range: 0 to _numberOfDetents - 1 (the index of the odometer)
Definition: gls_thumb_wheel.h:187
disti::GlsThumbWheel::_numberOfDetents
int _numberOfDetents
The total number of detents of the wheel.
Definition: gls_thumb_wheel.h:189
disti::GlsThumbWheel::CreateInstance
static DisplayObject * CreateInstance()
disti::GlsThumbWheel::_emitReleaseEvent
bool _emitReleaseEvent
If true, an event will be emitted when the wheel is released.
Definition: gls_thumb_wheel.h:185
disti::GlsThumbWheel::InputType
InputOrientationEnum InputType()
disti::GlsThumbWheel::WhichObjectOdometer
int WhichObjectOdometer()
disti::GlsThumbWheel::Pick3D
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::CopyProperties
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
disti::GlsThumbWheel::_browserIndexThumbWheel
int _browserIndexThumbWheel
Need to keep track of browser Index for use in ShowProperties()
Definition: gls_thumb_wheel.h:195
disti::GlsThumbWheel::_emitLimitEvent
bool _emitLimitEvent
Whether or not to emit limit events - when start or end is reached.
Definition: gls_thumb_wheel.h:184
disti::Group
Definition: group.h:53
disti::OpenGLMatrices
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
disti::VertexNoColor
Definition: vertex.h:85
gls_auto_lib.h
The gls_auto_lib.
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
gls_odometer.h
The disti::GlsOdometer class.
GLSGEN_GLSTHUMBWHEEL_EXPORT
#define GLSGEN_GLSTHUMBWHEEL_EXPORT
Provides support for creating DLLs.
Definition: gls_thumb_wheel.h:56
glsutil.h
GL Studio helper functions.
group.h
The disti::Group class. Implements groups of objects.
disti
Definition: bmpimage.h:47
disti::InputOrientationEnum
InputOrientationEnum
Enumeration for Input Operators.
Definition: glsutil.h:271