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:
84  DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
87  friend class GlsAdvancedMeshEditor;
88 
89  /** Create a new GlsAdvancedMesh. */
90  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( void );
91 
92  /** Create a new GlsAdvancedMesh.
93  \param type The type of Resource to create.
94  */
95  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsGeometryResource::TypeDesc& type );
96 
97  /**
98  \param resource A pointer to a resource that this Mesh will link to
99  \pre resource must be valid
100  \post the resource interest count will be incremented.
101  */
102  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsGeometryResource* resource );
103 
104  /**
105  * Create from a resource id and reference to a resource manager
106  * \param resourceMgr - resource manager
107  * \param resourceId - the string identifier of the resource
108  */
109  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsResourceFileMgr& resourceMgr, const char* resourceId );
110 
111  /** Copy constructor for GlsAdvancedMesh
112  * \param that The GlsAdvancedMesh to be copied from
113  * \param generateNames Whether or not to generate a new instance name
114  */
115  GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsAdvancedMesh& that, const bool generateNames );
116 
117  /** Destructs a GlsAdvancedMesh object */
118  virtual GLSGEN_GlsAdvancedMesh_EXPORT ~GlsAdvancedMesh();
119 
120  static GLSGEN_GlsAdvancedMesh_EXPORT DisplayObject* CreateInstance();
121 
122  //////////////////////////////////////////////////
123  // Overridden base class methods
124  //////////////////////////////////////////////////
125 
126  /* DisplayObject */
127  virtual GLSGEN_GlsAdvancedMesh_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
128  virtual GLSGEN_GlsAdvancedMesh_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
129  virtual GLSGEN_GlsAdvancedMesh_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
130  virtual GLSGEN_GlsAdvancedMesh_EXPORT void CopyGeometry( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
131 
132 #ifndef GLES
133  virtual GLSGEN_GlsAdvancedMesh_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
134  virtual GLSGEN_GlsAdvancedMesh_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
135 #endif
136 
137  virtual GLSGEN_GlsAdvancedMesh_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler ) DISTI_METHOD_OVERRIDE;
138  //virtual GLSGEN_GlsAdvancedMesh_EXPORT void Draw(void);
139 
140  //////////////////////////////////////////////////
141  // GlsAdvancedMesh specific operations
142  //////////////////////////////////////////////////
143 
144  /**
145  Grab a pointer to the Resource. We do not copy the resource, we now
146  have at least two AdvancedMeshs that have interest in the same Geometry.
147  \param value a valid GeometryResource object
148  \pre
149  \post Interest in any previous geometry is decremented
150  Interest in this new geometry in incremented
151  */
152  GLSGEN_GlsAdvancedMesh_EXPORT void SetGeometryResource( GlsGeometryResource* value );
153 
154  /**
155  NOTE: THIS METHOD WAS RENAMED FROM GetGlsGeometryResource() BECAUSE THE INTERFACE CHANGED.
156  THE METHOD NO LONGER IMPLICITLY CALLS IncrementReference() SO THE CALLER SHOULD NOT
157  CALL DecrementReference() ANYMORE.
158 
159  The the GlsGeometryResource for this mesh.
160 
161  \return a pointer to the Geometry Resource
162  \pre _geometryResource must be allocated
163 
164  NOTE: SEE COMMENTS ABOVE!!! */
166  {
167  return _geometryResource;
168  }
169 
170 protected:
171  // GlsGeometryResourceMesh override
172  virtual GLSGEN_GlsAdvancedMesh_EXPORT GlsGeometryResource* GetRenderMesh() DISTI_METHOD_OVERRIDE;
173 
174 #ifdef GLES
175  /** Set a single attribute from the GLO file.
176  * \param data The attribute to set and its associated data.
177  */
178  virtual GLSGEN_GlsAdvancedMesh_EXPORT void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
179 #endif
180 
181  Vector _lastGeometryBoundingVolumeCenter;
182  float _lastGeometryBoundingVolumeRadius;
183 
184  /**
185  Access shall be through the GetGlsGeometryResource method
186  */
188 };
189 
190 } // namespace disti
191 
192 #endif
Definition: cull.h:49
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
Definition: gls_geometry_resource.h:105
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:473
Definition: gls_resource_file_mgr.h:29
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
Definition: display.h:98
GlsGeometryResource * GetGeometryResource()
Definition: gls_advanced_mesh.h:165
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
void SetGeometryResource(GlsGeometryResource *value)
Definition: gls_advanced_mesh.h:81
Definition: gls_glo_file.h:988
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
Definition: gls_geometry_resource.h:86
The disti::GlsGeometryResourceMesh class.
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
The gls_auto_lib.
Definition: gls_geometry_resource_mesh.h:78
Definition: vertex.h:84
The disti::GlsGeometryResource class.
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
GlsGeometryResource * _geometryResource
Definition: gls_advanced_mesh.h:187
Definition: bmpimage.h:46
The disti::GlsRenderEffect class.