GL Studio API
gls_advanced_mesh.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsAdvancedMesh class.
3 
4 
5  \par Copyright Information
6 
7  Copyright (c) 2015 by The DiSTI Corporation.<br>
8  11301 Corporate Blvd; Suite 100<br>
9  Orlando, Florida 32817<br>
10  USA<br>
11  <br>
12  All rights reserved.<br>
13 
14  This Software contains proprietary trade secrets of DiSTI and may not be
15 reproduced, in whole or part, in any form, or by any means of electronic,
16 mechanical, or otherwise, without the written permission of DiSTI. Said
17 permission may be derived through the purchase of applicable DiSTI product
18 licenses which detail the distribution rights of this content and any
19 Derivative Works based on this or other copyrighted DiSTI Software.
20 
21  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
22 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
23 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
24 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
26 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
27 
28  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
29 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
30 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
31 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
32 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
33 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
34 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
35 EXCEED FIVE DOLLARS (US$5.00).
36 
37  The aforementioned terms and restrictions are governed by the laws of the
38 State of Florida and the United States of America.
39 
40 */
41 
42 #ifndef INCLUDED_GLS_ADVANCED_MESH_H
43 #define INCLUDED_GLS_ADVANCED_MESH_H
44 
45 #ifdef _WIN32
46  #include <windows.h>
47 #endif
48 
50 #include "gls_geometry_resource.h"
51 #include "gls_resource_file_mgr.h"
52 #include "gls_render_effect.h"
53 
54 //////////////////// Provides support for creating DLLs ////////////////////////
55 #if (defined(GLSGEN_EXPORT_GLSADVANCEDMESH) || \
56  defined(GLSGEN_IMPORT_GLSADVANCEDMESH) || \
57  defined(GLS_EXPORT_GENERATED) || \
58  defined(GLS_IMPORT_GENERATED)) \
59  && defined(_MSC_VER)
60 # if defined(GLSGEN_EXPORT_GLSADVANCEDMESH) || defined(GLS_EXPORT_GENERATED)
61 # define GLSGEN_GlsAdvancedMesh_EXPORT __declspec(dllexport)
62 # else
63 # define GLSGEN_GlsAdvancedMesh_EXPORT __declspec(dllimport)
64 # endif
65 #else
66 # define GLSGEN_GlsAdvancedMesh_EXPORT
67 #endif
68 ///////////////////////////////////////////////////////////////////////////////
69 
70 #define LIB_BASE_NAME "gls_advanced_mesh"
71 #include "gls_auto_lib.h"
72 #undef LIB_BASE_NAME
73 
74 namespace disti
75 {
76 #ifdef GLES
77 // Forward Declaration
78 class GlsGloFileAttribute;
79 #endif
80 
81 // forward decl
82 class GlsResourceFileMgr;
83 
85 {
86 public:
87 
89  friend class GlsAdvancedMeshEditor;
90 
91  /** Create a new GlsAdvancedMesh. */
92  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh(void);
93 
94  /** Create a new GlsAdvancedMesh.
95  \param type The type of Resource to create.
96  */
97  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh(const GlsGeometryResource::TypeDesc& type);
98 
99  /**
100  \param resource A pointer to a resource that this Mesh will link to
101  \pre resource must be valid
102  \post the resource interest count will be incremented.
103  */
104  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh(GlsGeometryResource *resource);
105 
106  /**
107  * Create from a resource id and reference to a resource manager
108  * \param resourceMgr - resource manager
109  * \param resourceId - the string identifier of the resource
110  */
111  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsResourceFileMgr& resourceMgr, const char* resourceId);
112 
113  /** Copy constructor for GlsAdvancedMesh
114  * \param that The GlsAdvancedMesh to be copied from
115  * \param generateNames Whether or not to generate a new instance name
116  */
117  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsAdvancedMesh& that, const bool generateNames );
118 
119  /** Destructs a GlsAdvancedMesh object */
120  virtual GLSGEN_GlsAdvancedMesh_EXPORT ~GlsAdvancedMesh();
121 
122  static GLSGEN_GlsAdvancedMesh_EXPORT DisplayObject* CreateInstance();
123 
124  //////////////////////////////////////////////////
125  // Overridden base class methods
126  //////////////////////////////////////////////////
127 
128  /* DisplayObject */
129  virtual GLSGEN_GlsAdvancedMesh_EXPORT void SetAvailableAttributes(unsigned int value);
130  virtual GLSGEN_GlsAdvancedMesh_EXPORT DisplayObject* CloneObject(bool generateNames = false);
131  virtual GLSGEN_GlsAdvancedMesh_EXPORT void CopyProperties(DisplayObject *src);
132  virtual GLSGEN_GlsAdvancedMesh_EXPORT void CopyGeometry(DisplayObject *src);
133 
134 #ifndef GLES
135  virtual GLSGEN_GlsAdvancedMesh_EXPORT InterfaceListType* GetCppInterfaceDescription(InterfaceListType* addToThisList= NULL );
136  virtual GLSGEN_GlsAdvancedMesh_EXPORT void GetCppInterfaceDescriptionFree(InterfaceListType* array);
137 #endif
138 
139  virtual GLSGEN_GlsAdvancedMesh_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices,Culler &culler );
140  //virtual GLSGEN_GlsAdvancedMesh_EXPORT void Draw(void);
141 
142  //////////////////////////////////////////////////
143  // GlsAdvancedMesh specific operations
144  //////////////////////////////////////////////////
145 
146 
147  /**
148  Grab a pointer to the Resource. We do not copy the resource, we now
149  have at least two AdvancedMeshs that have interest in the same Geometry.
150  \param value a valid GeometryResource object
151  \pre
152  \post Interest in any previous geometry is decremented
153  Interest in this new geometry in incremented
154  */
155  GLSGEN_GlsAdvancedMesh_EXPORT void SetGeometryResource(GlsGeometryResource* value );
156 
157  /**
158  NOTE: THIS METHOD WAS RENAMED FROM GetGlsGeometryResource() BECAUSE THE INTERFACE CHANGED.
159  THE METHOD NO LONGER IMPLICITLY CALLS IncrementReference() SO THE CALLER SHOULD NOT
160  CALL DecrementReference() ANYMORE.
161 
162  The the GlsGeometryResource for this mesh.
163 
164  \return a pointer to the Geometry Resource
165  \pre _geometryResource must be allocated
166 
167  NOTE: SEE COMMENTS ABOVE!!! */
169  {
170  return _geometryResource;
171  }
172 
173 protected:
174 
175  // GlsGeometryResourceMesh override
176  virtual GLSGEN_GlsAdvancedMesh_EXPORT GlsGeometryResource* GetRenderMesh();
177 
178 #ifdef GLES
179  /** Set a single attribute from the GLO file.
180  * \param data The attribute to set and its associated data.
181  */
182  virtual GLSGEN_GlsAdvancedMesh_EXPORT void SetFromGloData(GlsGloFileAttribute &data);
183 #endif
184 
185  Vector _lastGeometryBoundingVolumeCenter;
186  float _lastGeometryBoundingVolumeRadius;
187 
188 
189  /**
190  Access shall be through the GetGlsGeometryResource method
191  */
193 };
194 
195 
196 
197 } // namespace disti
198 
199 #endif
Definition: cull.h:50
Definition: gls_geometry_resource.h:106
Definition: dynamic_array.h:63
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:289
Definition: gls_resource_file_mgr.h:32
virtual void SetAvailableAttributes(unsigned int value)
Definition: display.h:98
GlsGeometryResource * GetGeometryResource()
Definition: gls_advanced_mesh.h:168
void SetGeometryResource(GlsGeometryResource *value)
Definition: gls_advanced_mesh.h:84
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void CopyProperties(DisplayObject *src)
Definition: gls_geometry_resource.h:86
The disti::GlsGeometryResourceMesh class.
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
The gls_auto_lib.
Definition: gls_geometry_resource_mesh.h:82
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
Definition: vertex.h:84
The disti::GlsGeometryResource class.
GlsGeometryResource * _geometryResource
Definition: gls_advanced_mesh.h:192
virtual void CopyGeometry(DisplayObject *src)
Definition: bmpimage.h:46
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
The disti::GlsRenderEffect class.