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