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
15reproduced, in whole or part, in any form, or by any means of electronic,
16mechanical, or otherwise, without the written permission of DiSTI. Said
17permission may be derived through the purchase of applicable DiSTI product
18licenses which detail the distribution rights of this content and any
19Derivative Works based on this or other copyrighted DiSTI Software.
20
21 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
22AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
23PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
24AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
26PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
27
28 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
29IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
30INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
31DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
32INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
33INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
34OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
35EXCEED FIVE DOLLARS (US$5.00).
36
37 The aforementioned terms and restrictions are governed by the laws of the
38State 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
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/// Automatically link the runtime library plugin (on Windows).
68#define LIB_BASE_NAME "gls_advanced_mesh"
69#include "gls_auto_lib.h"
70#undef LIB_BASE_NAME
71
72namespace disti
73{
74#ifdef GLES
75class GlsGloFileAttribute;
76#endif
77class GlsResourceFileMgr;
78
79/// \details The GlsAdvancedMesh class. Implementation for high performance 3D models.
81{
82public:
83 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
84 typedef GlsGeometryResourceMesh _BaseClass; ///< Deprecated typedef for the base class.
85 typedef GlsGeometryResourceMesh BaseClass; ///< Typedef for the base class.
86 friend class GlsAdvancedMeshEditor;
87
88 /** Create a new GlsAdvancedMesh. */
90
91 /** Create a new GlsAdvancedMesh.
92 \param type The type of Resource to create.
93 */
95
96 /**
97 \param resource A pointer to a resource that this Mesh will link to
98 \pre resource must be valid
99 \post the resource interest count will be incremented.
100 */
102
103 /**
104 * Create from a resource id and reference to a resource manager
105 * \param resourceMgr - resource manager
106 * \param resourceId - the string identifier of the resource
107 */
108 GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( GlsResourceFileMgr& resourceMgr, const char* resourceId );
109
110 /** Copy constructor for GlsAdvancedMesh
111 * \param that The GlsAdvancedMesh to be copied from
112 * \param generateNames Whether or not to generate a new instance name
113 */
114 GLSGEN_GlsAdvancedMesh_EXPORT GlsAdvancedMesh( const GlsAdvancedMesh& that, const bool generateNames );
115
116 /** Destructs a GlsAdvancedMesh object */
118
119 /// \return A pointer to a new GlsAdvancedMesh object.
121
122 //////////////////////////////////////////////////
123 // Overridden base class methods
124 //////////////////////////////////////////////////
125
130
131#ifndef GLES
134#endif
135
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 */
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
168protected:
169 // GlsGeometryResourceMesh override
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 */
177#endif
178
179 Vector _lastGeometryBoundingVolumeCenter; ///< Center location stored for culling.
180 float _lastGeometryBoundingVolumeRadius; ///< 3D bounding volume stored for culling.
181
182 /**
183 Access shall be through the GetGlsGeometryResource method
184 */
186};
187
188} // namespace disti
189
190#endif
Definition: cull.h:50
Definition: display.h:96
Definition: dynamic_array.h:79
Definition: gls_advanced_mesh.h:81
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void SetGeometryResource(GlsGeometryResource *value)
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
float _lastGeometryBoundingVolumeRadius
3D bounding volume stored for culling.
Definition: gls_advanced_mesh.h:180
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
virtual GlsGeometryResource * GetRenderMesh() DISTI_METHOD_OVERRIDE
GlsGeometryResource * _geometryResource
Definition: gls_advanced_mesh.h:185
static DisplayObject * CreateInstance()
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
GlsGeometryResource * GetGeometryResource()
Definition: gls_advanced_mesh.h:163
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
Vector _lastGeometryBoundingVolumeCenter
Center location stored for culling.
Definition: gls_advanced_mesh.h:179
Definition: gls_geometry_resource_mesh.h:80
Definition: gls_geometry_resource.h:87
Definition: gls_glo_file.h:1243
Definition: gls_resource_file_mgr.h:26
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
Definition: vertex.h:85
#define GLSGEN_GlsAdvancedMesh_EXPORT
Provides support for creating DLLs.
Definition: gls_advanced_mesh.h:63
The gls_auto_lib.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:457
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
The disti::GlsGeometryResource class.
The disti::GlsGeometryResourceMesh class.
The disti::GlsRenderEffect class.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47