GL Studio C++ Runtime 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) 2017 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 
49 #include "gls_geometry_resource.h"
51 #include "gls_render_effect.h"
52 #include "gls_resource_file_mgr.h"
53 
54 //////////////////// Provides support for creating DLLs ////////////////////////
55 #if( defined( GLSGEN_EXPORT_GLSADVANCEDMESH ) || defined( GLSGEN_IMPORT_GLSADVANCEDMESH ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
56  && defined( _MSC_VER )
57 # if defined( GLSGEN_EXPORT_GLSADVANCEDMESH ) || defined( GLS_EXPORT_GENERATED )
58 # define GLSGEN_GlsAdvancedMesh_EXPORT __declspec( dllexport )
59 # else
60 # define GLSGEN_GlsAdvancedMesh_EXPORT __declspec( dllimport )
61 # endif
62 #else
63 # define GLSGEN_GlsAdvancedMesh_EXPORT
64 #endif
65 ///////////////////////////////////////////////////////////////////////////////
66 
67 #define LIB_BASE_NAME "gls_advanced_mesh"
68 #include "gls_auto_lib.h"
69 #undef LIB_BASE_NAME
70 
71 namespace disti
72 {
73 #ifdef GLES
74 // Forward Declaration
75 class GlsGloFileAttribute;
76 #endif
77 
78 // forward decl
79 class GlsResourceFileMgr;
80 
82 {
83 public:
85  friend class GlsAdvancedMeshEditor;
86 
87  /** Create a new GlsAdvancedMesh. */
88  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( void );
89 
90  /** Create a new GlsAdvancedMesh.
91  \param type The type of Resource to create.
92  */
93  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsGeometryResource::TypeDesc& type );
94 
95  /**
96  \param resource A pointer to a resource that this Mesh will link to
97  \pre resource must be valid
98  \post the resource interest count will be incremented.
99  */
100  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsGeometryResource* resource );
101 
102  /**
103  * Create from a resource id and reference to a resource manager
104  * \param resourceMgr - resource manager
105  * \param resourceId - the string identifier of the resource
106  */
107  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsResourceFileMgr& resourceMgr, const char* resourceId );
108 
109  /** Copy constructor for GlsAdvancedMesh
110  * \param that The GlsAdvancedMesh to be copied from
111  * \param generateNames Whether or not to generate a new instance name
112  */
113  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsAdvancedMesh& that, const bool generateNames );
114 
115  /** Destructs a GlsAdvancedMesh object */
116  virtual GLSGEN_GlsAdvancedMesh_EXPORT ~GlsAdvancedMesh();
117 
118  static GLSGEN_GlsAdvancedMesh_EXPORT DisplayObject* CreateInstance();
119 
120  //////////////////////////////////////////////////
121  // Overridden base class methods
122  //////////////////////////////////////////////////
123 
124  /* DisplayObject */
125  virtual GLSGEN_GlsAdvancedMesh_EXPORT void SetAvailableAttributes( unsigned int value );
126  virtual GLSGEN_GlsAdvancedMesh_EXPORT DisplayObject* CloneObject( bool generateNames = false );
127  virtual GLSGEN_GlsAdvancedMesh_EXPORT void CopyProperties( DisplayObject* src );
128  virtual GLSGEN_GlsAdvancedMesh_EXPORT void CopyGeometry( DisplayObject* src );
129 
130 #ifndef GLES
131  virtual GLSGEN_GlsAdvancedMesh_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL );
132  virtual GLSGEN_GlsAdvancedMesh_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array );
133 #endif
134 
135  virtual GLSGEN_GlsAdvancedMesh_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler );
136  //virtual GLSGEN_GlsAdvancedMesh_EXPORT void Draw(void);
137 
138  //////////////////////////////////////////////////
139  // GlsAdvancedMesh specific operations
140  //////////////////////////////////////////////////
141 
142  /**
143  Grab a pointer to the Resource. We do not copy the resource, we now
144  have at least two AdvancedMeshs that have interest in the same Geometry.
145  \param value a valid GeometryResource object
146  \pre
147  \post Interest in any previous geometry is decremented
148  Interest in this new geometry in incremented
149  */
150  GLSGEN_GlsAdvancedMesh_EXPORT void SetGeometryResource( GlsGeometryResource* value );
151 
152  /**
153  NOTE: THIS METHOD WAS RENAMED FROM GetGlsGeometryResource() BECAUSE THE INTERFACE CHANGED.
154  THE METHOD NO LONGER IMPLICITLY CALLS IncrementReference() SO THE CALLER SHOULD NOT
155  CALL DecrementReference() ANYMORE.
156 
157  The the GlsGeometryResource for this mesh.
158 
159  \return a pointer to the Geometry Resource
160  \pre _geometryResource must be allocated
161 
162  NOTE: SEE COMMENTS ABOVE!!! */
164  {
165  return _geometryResource;
166  }
167 
168 protected:
169  // GlsGeometryResourceMesh override
170  virtual GLSGEN_GlsAdvancedMesh_EXPORT GlsGeometryResource* GetRenderMesh();
171 
172 #ifdef GLES
173  /** Set a single attribute from the GLO file.
174  * \param data The attribute to set and its associated data.
175  */
176  virtual GLSGEN_GlsAdvancedMesh_EXPORT void SetFromGloData( GlsGloFileAttribute& data );
177 #endif
178 
179  Vector _lastGeometryBoundingVolumeCenter;
180  float _lastGeometryBoundingVolumeRadius;
181 
182  /**
183  Access shall be through the GetGlsGeometryResource method
184  */
186 };
187 
188 } // namespace disti
189 
190 #endif
Definition: cull.h:49
Definition: gls_geometry_resource.h:101
Definition: dynamic_array.h:62
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:278
Definition: gls_resource_file_mgr.h:29
virtual void SetAvailableAttributes(unsigned int value)
Definition: display.h:97
GlsGeometryResource * GetGeometryResource()
Definition: gls_advanced_mesh.h:163
void SetGeometryResource(GlsGeometryResource *value)
Definition: gls_advanced_mesh.h:81
Definition: gls_glo_file.h:835
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void CopyProperties(DisplayObject *src)
Definition: gls_geometry_resource.h:82
The disti::GlsGeometryResourceMesh class.
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
The gls_auto_lib.
Definition: gls_geometry_resource_mesh.h:78
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
Definition: vertex.h:83
The disti::GlsGeometryResource class.
GlsGeometryResource * _geometryResource
Definition: gls_advanced_mesh.h:185
virtual void CopyGeometry(DisplayObject *src)
Definition: bmpimage.h:46
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
The disti::GlsRenderEffect class.