vrshoot

view libs/assimp/assimp/defs.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line source
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
6 Copyright (c) 2006-2012, assimp team
8 All rights reserved.
10 Redistribution and use of this software in source and binary forms,
11 with or without modification, are permitted provided that the following
12 conditions are met:
14 * Redistributions of source code must retain the above
15 copyright notice, this list of conditions and the
16 following disclaimer.
18 * Redistributions in binary form must reproduce the above
19 copyright notice, this list of conditions and the
20 following disclaimer in the documentation and/or other
21 materials provided with the distribution.
23 * Neither the name of the assimp team, nor the names of its
24 contributors may be used to endorse or promote products
25 derived from this software without specific prior
26 written permission of the assimp team.
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 ---------------------------------------------------------------------------
40 */
42 /** @file aiDefines.h
43 * @brief Assimp build configuration setup. See the notes in the comment
44 * blocks to find out how to customize _your_ Assimp build.
45 */
47 #ifndef INCLUDED_AI_DEFINES_H
48 #define INCLUDED_AI_DEFINES_H
50 //////////////////////////////////////////////////////////////////////////
51 /* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific
52 * file format loader. The loader is be excluded from the
53 * build in this case. 'XX' stands for the most common file
54 * extension of the file format. E.g.:
55 * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
56 *
57 * If you're unsure about that, take a look at the implementation of the
58 * import plugin you wish to disable. You'll find the right define in the
59 * first lines of the corresponding unit.
60 *
61 * Other (mixed) configuration switches are listed here:
62 * ASSIMP_BUILD_NO_COMPRESSED_X
63 * - Disable support for compressed X files (zip)
64 * ASSIMP_BUILD_NO_COMPRESSED_BLEND
65 * - Disable support for compressed Blender files (zip)
66 * ASSIMP_BUILD_NO_COMPRESSED_IFC
67 * - Disable support for IFCZIP files (unzip)
68 */
69 //////////////////////////////////////////////////////////////////////////
71 #define ASSIMP_BUILD_NO_OWN_ZLIB
73 // let's disable anything we don't really need
74 #define ASSIMP_BUILD_NO_COMPRESSED_X
75 #define ASSIMP_BUILD_NO_COMPRESSED_BLEND
76 #define ASSIMP_BUILD_NO_COMPRESSED_IFC
77 #define ASSIMP_BUILD_NO_Q3BSP_IMPORTER
79 // disable various formats
80 #define ASSIMP_BUILD_NO_B3D_IMPORTER
81 #define ASSIMP_BUILD_NO_BVH_IMPORTER
82 #define ASSIMP_BUILD_NO_COB_IMPORTER
83 #define ASSIMP_BUILD_NO_CSM_IMPORTER
84 #define ASSIMP_BUILD_NO_DXF_IMPORTER
85 #define ASSIMP_BUILD_NO_HMP_IMPORTER
86 #define ASSIMP_BUILD_NO_IFC_IMPORTER
87 #define ASSIMP_BUILD_NO_IRR_IMPORTER
88 #define ASSIMP_BUILD_NO_IRRMESH_IMPORTER
89 #define ASSIMP_BUILD_NO_LWO_IMPORTER
90 #define ASSIMP_BUILD_NO_LWS_IMPORTER
91 #define ASSIMP_BUILD_NO_MD2_IMPORTER
92 #define ASSIMP_BUILD_NO_MDC_IMPORTER
93 #define ASSIMP_BUILD_NO_MDL_IMPORTER
94 #define ASSIMP_BUILD_NO_NDO_IMPORTER
95 #define ASSIMP_BUILD_NO_NFF_IMPORTER
96 #define ASSIMP_BUILD_NO_OFF_IMPORTER
97 #define ASSIMP_BUILD_NO_OGRE_IMPORTER
98 #define ASSIMP_BUILD_NO_PLY_IMPORTER
99 #define ASSIMP_BUILD_NO_Q3D_IMPORTER
100 #define ASSIMP_BUILD_NO_RAW_IMPORTER
101 #define ASSIMP_BUILD_NO_SMD_IMPORTER
102 #define ASSIMP_BUILD_NO_STL_IMPORTER
103 #define ASSIMP_BUILD_NO_TERRAGEN_IMPORTER
104 #define ASSIMP_BUILD_NO_3D_IMPORTER
105 #define ASSIMP_BUILD_NO_X_IMPORTER
106 #define ASSIMP_BUILD_NO_XGL_IMPORTER
108 // we don't really need assimp to be thread-safe (I think)
109 #define ASSIMP_BUILD_SINGLETHREADED
112 #ifndef ASSIMP_BUILD_NO_COMPRESSED_X
113 # define ASSIMP_BUILD_NEED_Z_INFLATE
114 #endif
116 #ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
117 # define ASSIMP_BUILD_NEED_Z_INFLATE
118 #endif
120 #ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
121 # define ASSIMP_BUILD_NEED_Z_INFLATE
122 # define ASSIMP_BUILD_NEED_UNZIP
123 #endif
125 #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
126 # define ASSIMP_BUILD_NEED_Z_INFLATE
127 # define ASSIMP_BUILD_NEED_UNZIP
128 #endif
130 //////////////////////////////////////////////////////////////////////////
131 /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
132 * post processing step. This is the current list of process names ('XX'):
133 * CALCTANGENTS
134 * JOINVERTICES
135 * TRIANGULATE
136 * GENFACENORMALS
137 * GENVERTEXNORMALS
138 * REMOVEVC
139 * SPLITLARGEMESHES
140 * PRETRANSFORMVERTICES
141 * LIMITBONEWEIGHTS
142 * VALIDATEDS
143 * IMPROVECACHELOCALITY
144 * FIXINFACINGNORMALS
145 * REMOVE_REDUNDANTMATERIALS
146 * OPTIMIZEGRAPH
147 * SORTBYPTYPE
148 * FINDINVALIDDATA
149 * TRANSFORMTEXCOORDS
150 * GENUVCOORDS
151 * ENTITYMESHBUILDER
152 * MAKELEFTHANDED
153 * FLIPUVS
154 * FLIPWINDINGORDER
155 * OPTIMIZEMESHES
156 * OPTIMIZEANIMS
157 * OPTIMIZEGRAPH
158 * GENENTITYMESHES
159 * FIXTEXTUREPATHS */
160 //////////////////////////////////////////////////////////////////////////
162 #ifdef _MSC_VER
163 # undef ASSIMP_API
165 //////////////////////////////////////////////////////////////////////////
166 /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
167 //////////////////////////////////////////////////////////////////////////
168 # ifdef ASSIMP_BUILD_DLL_EXPORT
169 # define ASSIMP_API __declspec(dllexport)
170 # define ASSIMP_API_WINONLY __declspec(dllexport)
171 # pragma warning (disable : 4251)
173 //////////////////////////////////////////////////////////////////////////
174 /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
175 * an external DLL under Windows. Default is static linkage. */
176 //////////////////////////////////////////////////////////////////////////
177 # elif (defined ASSIMP_DLL)
178 # define ASSIMP_API __declspec(dllimport)
179 # define ASSIMP_API_WINONLY __declspec(dllimport)
180 # else
181 # define ASSIMP_API
182 # define ASSIMP_API_WINONLY
183 # endif
185 /* Force the compiler to inline a function, if possible
186 */
187 # define AI_FORCE_INLINE __forceinline
189 /* Tells the compiler that a function never returns. Used in code analysis
190 * to skip dead paths (e.g. after an assertion evaluated to false). */
191 # define AI_WONT_RETURN __declspec(noreturn)
193 #elif defined(SWIG)
195 /* Do nothing, the relevant defines are all in AssimpSwigPort.i */
197 #else
199 # define AI_WONT_RETURN
201 # define ASSIMP_API __attribute__ ((visibility("default")))
202 # define ASSIMP_API_WINONLY
203 # define AI_FORCE_INLINE inline
204 #endif // (defined _MSC_VER)
206 #ifdef __cplusplus
207 /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
208 * in doxydocs.
209 */
210 # define C_STRUCT
211 # define C_ENUM
212 #else
213 //////////////////////////////////////////////////////////////////////////
214 /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
215 * is defined by Doxygen's preprocessor. The corresponding
216 * entries in the DOXYFILE are: */
217 //////////////////////////////////////////////////////////////////////////
218 #if 0
219 ENABLE_PREPROCESSING = YES
220 MACRO_EXPANSION = YES
221 EXPAND_ONLY_PREDEF = YES
222 SEARCH_INCLUDES = YES
223 INCLUDE_PATH =
224 INCLUDE_FILE_PATTERNS =
225 PREDEFINED = ASSIMP_DOXYGEN_BUILD=1
226 EXPAND_AS_DEFINED = C_STRUCT C_ENUM
227 SKIP_FUNCTION_MACROS = YES
228 #endif
229 //////////////////////////////////////////////////////////////////////////
230 /* Doxygen gets confused if we use c-struct typedefs to avoid
231 * the explicit 'struct' notation. This trick here has the same
232 * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need
233 * to typedef all structs/enums. */
234 //////////////////////////////////////////////////////////////////////////
235 # if (defined ASSIMP_DOXYGEN_BUILD)
236 # define C_STRUCT
237 # define C_ENUM
238 # else
239 # define C_STRUCT struct
240 # define C_ENUM enum
241 # endif
242 #endif
244 #if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
245 #error Currently, Borland is unsupported. Feel free to port Assimp.
247 // "W8059 Packgröße der Struktur geändert"
249 #endif
250 //////////////////////////////////////////////////////////////////////////
251 /* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp
252 * without boost. This is done by using a few workaround
253 * classes and brings some limitations (e.g. some logging won't be done,
254 * the library won't utilize threads or be threadsafe at all).
255 * This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */
256 //////////////////////////////////////////////////////////////////////////
257 #ifdef ASSIMP_BUILD_BOOST_WORKAROUND
259 // threading support requires boost
260 #ifndef ASSIMP_BUILD_SINGLETHREADED
261 # define ASSIMP_BUILD_SINGLETHREADED
262 #endif
264 #endif // !! ASSIMP_BUILD_BOOST_WORKAROUND
266 //////////////////////////////////////////////////////////////////////////
267 /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
268 * without threading support. The library doesn't utilize
269 * threads then and is itself not threadsafe.
270 * If this flag is specified boost::threads is *not* required. */
271 //////////////////////////////////////////////////////////////////////////
272 #ifndef ASSIMP_BUILD_SINGLETHREADED
273 # define ASSIMP_BUILD_SINGLETHREADED
274 #endif
276 #ifndef ASSIMP_BUILD_SINGLETHREADED
277 # define AI_C_THREADSAFE
278 #endif // !! ASSIMP_BUILD_SINGLETHREADED
280 #ifdef _DEBUG
281 # define ASSIMP_BUILD_DEBUG
282 #endif
284 //////////////////////////////////////////////////////////////////////////
285 /* Useful constants */
286 //////////////////////////////////////////////////////////////////////////
288 /* This is PI. Hi PI. */
289 #define AI_MATH_PI (3.141592653589793238462643383279 )
290 #define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
291 #define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
293 /* And this is to avoid endless casts to float */
294 #define AI_MATH_PI_F (3.1415926538f)
295 #define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f)
296 #define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f)
298 /* Tiny macro to convert from radians to degrees and back */
299 #define AI_DEG_TO_RAD(x) (x*0.0174532925f)
300 #define AI_RAD_TO_DEG(x) (x*57.2957795f)
302 /* Support for big-endian builds */
303 #if defined(__BYTE_ORDER__)
304 # if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
305 # if !defined(__BIG_ENDIAN__)
306 # define __BIG_ENDIAN__
307 # endif
308 # else /* little endian */
309 # if defined (__BIG_ENDIAN__)
310 # undef __BIG_ENDIAN__
311 # endif
312 # endif
313 #endif
314 #if defined(__BIG_ENDIAN__)
315 # define AI_BUILD_BIG_ENDIAN
316 #endif
318 #endif // !! INCLUDED_AI_DEFINES_H