GL Studio C++ Runtime API
gls_advanced_mesh.h
Go to the documentation of this file.
1/// \file gls_advanced_mesh.h
2/// \brief The disti::GlsAdvancedMesh class.
3///
4/// \par Copyright Information
5///
6/// Copyright (c) 2017 by The DiSTI Corporation.<br>
7/// 12249 Science Drive; Suite 300<br>
8/// Orlando, Florida 32826<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#ifndef INCLUDED_GLS_ADVANCED_MESH_H
40#define INCLUDED_GLS_ADVANCED_MESH_H
41
42#ifdef _WIN32
43# include <windows.h>
44#endif
45
48#include "gls_render_effect.h"
50
51/// Provides support for creating DLLs.
52#if( defined( GLSGEN_EXPORT_GLSADVANCEDMESH ) || defined( GLSGEN_IMPORT_GLSADVANCEDMESH ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
53 && defined( _MSC_VER )
54# if defined( GLSGEN_EXPORT_GLSADVANCEDMESH ) || defined( GLS_EXPORT_GENERATED )
55# define GLSGEN_GlsAdvancedMesh_EXPORT __declspec( dllexport )
56# else
57# define GLSGEN_GlsAdvancedMesh_EXPORT __declspec( dllimport )
58# endif
59#else
60# define GLSGEN_GlsAdvancedMesh_EXPORT
61#endif
62///////////////////////////////////////////////////////////////////////////////
63
64/// Automatically link the runtime library plugin (on Windows).
65#define LIB_BASE_NAME "gls_advanced_mesh"
66#include "gls_auto_lib.h"
67#undef LIB_BASE_NAME
68
69namespace disti
70{
71#ifdef GLES
72class GlsGloFileAttribute;
73#endif
74class GlsResourceFileMgr;
75
76/// \details The GlsAdvancedMesh class. Implementation for high performance 3D models.
78{
79public:
80 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
81 typedef GlsGeometryResourceMesh _BaseClass; ///< Deprecated typedef for the base class.
82 typedef GlsGeometryResourceMesh BaseClass; ///< Typedef for the base class.
83 friend class GlsAdvancedMeshEditor;
84
85 /** Create a new GlsAdvancedMesh. */
87
88 /** Create a new GlsAdvancedMesh.
89 \param type The type of Resource to create.
90 */
92
93 /**
94 \param resource A pointer to a resource that this Mesh will link to
95 \pre resource must be valid
96 \post the resource interest count will be incremented.
97 */
99
100 /**
101 * Create from a resource id and reference to a resource manager
102 * \param resourceMgr - resource manager
103 * \param resourceId - the string identifier of the resource
104 */
105 GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsResourceFileMgr& resourceMgr, const char* resourceId );
106
107 /** Copy constructor for GlsAdvancedMesh
108 * \param that The GlsAdvancedMesh to be copied from
109 * \param generateNames Whether or not to generate a new instance name
110 */
111 GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsAdvancedMesh& that, const bool generateNames );
112
113 /** Destructs a GlsAdvancedMesh object */
115
116 /// \return A pointer to a new GlsAdvancedMesh object.
118
119 //////////////////////////////////////////////////
120 // Overridden base class methods
121 //////////////////////////////////////////////////
122
127
128#ifndef GLES
131#endif
132
134
135 //////////////////////////////////////////////////
136 // GlsAdvancedMesh specific operations
137 //////////////////////////////////////////////////
138
139 /**
140 Grab a pointer to the Resource. We do not copy the resource, we now
141 have at least two AdvancedMeshs that have interest in the same Geometry.
142 \param value a valid GeometryResource object
143 \pre
144 \post Interest in any previous geometry is decremented
145 Interest in this new geometry in incremented
146 */
148
149 /**
150 NOTE: THIS METHOD WAS RENAMED FROM GetGlsGeometryResource() BECAUSE THE INTERFACE CHANGED.
151 THE METHOD NO LONGER IMPLICITLY CALLS IncrementReference() SO THE CALLER SHOULD NOT
152 CALL DecrementReference() ANYMORE.
153
154 The the GlsGeometryResource for this mesh.
155
156 \return a pointer to the Geometry Resource
157 \pre _geometryResource must be allocated
158
159 NOTE: SEE COMMENTS ABOVE!!! */
161 {
162 return _geometryResource;
163 }
164
165protected:
166 // GlsGeometryResourceMesh override
168
169#ifdef GLES
170 /** Set a single attribute from the GLO file.
171 * \param data The attribute to set and its associated data.
172 */
174#endif
175
176 Vector _lastGeometryBoundingVolumeCenter; ///< Center location stored for culling.
177 float _lastGeometryBoundingVolumeRadius; ///< 3D bounding volume stored for culling.
178
179 /**
180 Access shall be through the GetGlsGeometryResource method
181 */
183};
184
185} // namespace disti
186
187#endif
Definition: cull.h:49
Definition: display.h:95
Definition: dynamic_array.h:79
Definition: gls_advanced_mesh.h:78
void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
void SetGeometryResource(GlsGeometryResource *value)
float _lastGeometryBoundingVolumeRadius
3D bounding volume stored for culling.
Definition: gls_advanced_mesh.h:177
void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
GlsGeometryResource * _geometryResource
Definition: gls_advanced_mesh.h:182
void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
static DisplayObject * CreateInstance()
GlsGeometryResource * GetRenderMesh() DISTI_METHOD_OVERRIDE
GlsGeometryResource * GetGeometryResource()
Definition: gls_advanced_mesh.h:160
DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
Vector _lastGeometryBoundingVolumeCenter
Center location stored for culling.
Definition: gls_advanced_mesh.h:176
Definition: gls_geometry_resource_mesh.h:78
Definition: gls_geometry_resource.h:86
Definition: gls_glo_file.h:1241
Definition: gls_resource_file_mgr.h:64
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:540
Definition: vertex.h:84
#define GLSGEN_GlsAdvancedMesh_EXPORT
Provides support for creating DLLs.
Definition: gls_advanced_mesh.h:60
The gls_auto_lib.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:487
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:221
The disti::GlsGeometryResource class.
The disti::GlsGeometryResourceMesh class.
The disti::GlsRenderEffect class.
Resource file manager interface.
Definition: bmpimage.h:46