GL Studio C++ Runtime API
gls_lod_group.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsLodGroup 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 _GlsLodGroup_H
41 #define _GlsLodGroup_H
42 
43 #include <vector>
44 
45 #include "gls_cpp_lang_support.h"
46 #include "group.h"
47 
48 //////////////////// Provides support for creating DLLs ////////////////////////
49 #if( defined( GLSGEN_EXPORT_GlsLodGroup ) || defined( GLSGEN_IMPORT_GlsLodGroup ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
50  && defined( _MSC_VER )
51 # if defined( GLSGEN_EXPORT_GlsLodGroup ) || defined( GLS_EXPORT_GENERATED )
52 # define GLSGEN_GlsLodGroup_EXPORT __declspec( dllexport )
53 # else
54 # define GLSGEN_GlsLodGroup_EXPORT __declspec( dllimport )
55 # endif
56 #else
57 # define GLSGEN_GlsLodGroup_EXPORT
58 #endif
59 ///////////////////////////////////////////////////////////////////////////////
60 
61 #define LIB_BASE_NAME "gls_lod_group"
62 #include "gls_auto_lib.h"
63 #undef LIB_BASE_NAME
64 
65 namespace disti
66 {
67 // Forward Declaration
68 class GlsGloFileAttribute;
69 
70 typedef enum
71 {
72  GLS_LOD_GROUP_DISTANCE_RANGE = GLS_LAST_INITIALIZER + 1,
73  GLS_LOD_GROUP_LOD_POSITIONS
74 } GLS_LodGroup_Initializers;
75 
76 /**
77  Runtime implementation of a GlsLodGroup. The GlsLodGroup is a group the is capable of
78  creating occlusion queries.
79 */
80 class GlsLodGroup : public Group
81 {
82 public:
83  typedef Group _BaseClass;
84 
85  friend class GlsLodGroupEditor;
86 
87  /** Create a new GlsLodGroup.
88  * \param generateInstance Whether or not to generate an instance name
89  * for this inputdevice
90  */
91  GLSGEN_GlsLodGroup_EXPORT GlsLodGroup( bool generateInstance = false );
92 
93  GLSGEN_GlsLodGroup_EXPORT GlsLodGroup( const GlsLodGroup& that, const bool generateNames );
94 
95  /** Destructs a GlsLodGroup object */
96  virtual GLSGEN_GlsLodGroup_EXPORT ~GlsLodGroup();
97 
98  static GLSGEN_GlsLodGroup_EXPORT DisplayObject* CreateInstance();
99 
100  static GLSGEN_GlsLodGroup_EXPORT void GroupDebugCommand( const char* cmd, const char* arg );
101 
102  virtual GLSGEN_GlsLodGroup_EXPORT void SetAvailableAttributes( unsigned int value );
103 
104  //////////////////////////////////////////////////
105  // Overridden base class methods
106  // The base class methods are overridden so that the Group Class methods
107  // are not called, generally DisplayObject methods are called, there
108  // are a few exceptions.
109  //////////////////////////////////////////////////
110 
111  virtual GLSGEN_GlsLodGroup_EXPORT void Draw( void );
112  virtual GLSGEN_GlsLodGroup_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler );
113 
114  virtual GLSGEN_GlsLodGroup_EXPORT int NumLods();
115 
116  /** Adds the specified object into the group, at the end of the list
117  * \param obj A pointer to the object to add
118  * \param reparent Whether or not the object parent should be set to this group
119  * \param recalculateBoundingbox Whether or not to recalculate the bounding box
120  * \param loc Where to insert it (defaults to -1 which means at the end of the list)
121  */
122  virtual GLSGEN_GlsLodGroup_EXPORT void InsertObject( DisplayObject* obj, bool reparent = true, bool recalculateBoundingbox = true, int loc = -1 );
123 
124  virtual GLSGEN_GlsLodGroup_EXPORT float GetLodPosition( int index );
125 
126 protected:
127  /* See base class */
128  virtual GLSGEN_GlsLodGroup_EXPORT void SetValue( int spec, va_list& args );
129 
130 #ifdef GLES
131  /** Set a single attribute from the GLO file.
132  * \param data The attribute to set and its associated data.
133  */
134  virtual GLSGEN_GlsLodGroup_EXPORT void SetFromGloData( GlsGloFileAttribute& data );
135 #endif
136  //////////////////////////////////////////////////
137  // GlsLodGroup specific operations
138  //////////////////////////////////////////////////
139 
140 private:
141  // Disable implicit generated Members
142  GlsLodGroup& operator=( const GlsLodGroup& rhs );
143  GlsLodGroup( const GlsLodGroup& src );
144 
145  DynamicArray<float> _lodPositions;
146  float _distanceRange;
147  int _currentState;
148  int _previewState;
149  float _previewValue;
150 };
151 
152 } // namespace disti
153 
154 #endif
Definition: cull.h:49
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:278
virtual void SetAvailableAttributes(unsigned int value)
Definition: display.h:97
virtual void Draw(void)
Definition: gls_glo_file.h:835
virtual void SetValue(int spec, va_list &args)
virtual ~GlsLodGroup()
The gls_auto_lib.
Definition: group.h:52
GlsLodGroup(bool generateInstance=false)
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: gls_lod_group.h:80
Definition: bmpimage.h:46
virtual void InsertObject(DisplayObject *obj, bool reparent=true, bool recalculateBoundingbox=true, int loc=-1)