vrshoot
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/assimp/assimp/defs.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,318 @@ 1.4 +/* 1.5 +--------------------------------------------------------------------------- 1.6 +Open Asset Import Library (assimp) 1.7 +--------------------------------------------------------------------------- 1.8 + 1.9 +Copyright (c) 2006-2012, assimp team 1.10 + 1.11 +All rights reserved. 1.12 + 1.13 +Redistribution and use of this software in source and binary forms, 1.14 +with or without modification, are permitted provided that the following 1.15 +conditions are met: 1.16 + 1.17 +* Redistributions of source code must retain the above 1.18 + copyright notice, this list of conditions and the 1.19 + following disclaimer. 1.20 + 1.21 +* Redistributions in binary form must reproduce the above 1.22 + copyright notice, this list of conditions and the 1.23 + following disclaimer in the documentation and/or other 1.24 + materials provided with the distribution. 1.25 + 1.26 +* Neither the name of the assimp team, nor the names of its 1.27 + contributors may be used to endorse or promote products 1.28 + derived from this software without specific prior 1.29 + written permission of the assimp team. 1.30 + 1.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.42 +--------------------------------------------------------------------------- 1.43 +*/ 1.44 + 1.45 +/** @file aiDefines.h 1.46 + * @brief Assimp build configuration setup. See the notes in the comment 1.47 + * blocks to find out how to customize _your_ Assimp build. 1.48 + */ 1.49 + 1.50 +#ifndef INCLUDED_AI_DEFINES_H 1.51 +#define INCLUDED_AI_DEFINES_H 1.52 + 1.53 + ////////////////////////////////////////////////////////////////////////// 1.54 + /* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific 1.55 + * file format loader. The loader is be excluded from the 1.56 + * build in this case. 'XX' stands for the most common file 1.57 + * extension of the file format. E.g.: 1.58 + * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader. 1.59 + * 1.60 + * If you're unsure about that, take a look at the implementation of the 1.61 + * import plugin you wish to disable. You'll find the right define in the 1.62 + * first lines of the corresponding unit. 1.63 + * 1.64 + * Other (mixed) configuration switches are listed here: 1.65 + * ASSIMP_BUILD_NO_COMPRESSED_X 1.66 + * - Disable support for compressed X files (zip) 1.67 + * ASSIMP_BUILD_NO_COMPRESSED_BLEND 1.68 + * - Disable support for compressed Blender files (zip) 1.69 + * ASSIMP_BUILD_NO_COMPRESSED_IFC 1.70 + * - Disable support for IFCZIP files (unzip) 1.71 + */ 1.72 + ////////////////////////////////////////////////////////////////////////// 1.73 + 1.74 +#define ASSIMP_BUILD_NO_OWN_ZLIB 1.75 + 1.76 +// let's disable anything we don't really need 1.77 +#define ASSIMP_BUILD_NO_COMPRESSED_X 1.78 +#define ASSIMP_BUILD_NO_COMPRESSED_BLEND 1.79 +#define ASSIMP_BUILD_NO_COMPRESSED_IFC 1.80 +#define ASSIMP_BUILD_NO_Q3BSP_IMPORTER 1.81 + 1.82 +// disable various formats 1.83 +#define ASSIMP_BUILD_NO_B3D_IMPORTER 1.84 +#define ASSIMP_BUILD_NO_BVH_IMPORTER 1.85 +#define ASSIMP_BUILD_NO_COB_IMPORTER 1.86 +#define ASSIMP_BUILD_NO_CSM_IMPORTER 1.87 +#define ASSIMP_BUILD_NO_DXF_IMPORTER 1.88 +#define ASSIMP_BUILD_NO_HMP_IMPORTER 1.89 +#define ASSIMP_BUILD_NO_IFC_IMPORTER 1.90 +#define ASSIMP_BUILD_NO_IRR_IMPORTER 1.91 +#define ASSIMP_BUILD_NO_IRRMESH_IMPORTER 1.92 +#define ASSIMP_BUILD_NO_LWO_IMPORTER 1.93 +#define ASSIMP_BUILD_NO_LWS_IMPORTER 1.94 +#define ASSIMP_BUILD_NO_MD2_IMPORTER 1.95 +#define ASSIMP_BUILD_NO_MDC_IMPORTER 1.96 +#define ASSIMP_BUILD_NO_MDL_IMPORTER 1.97 +#define ASSIMP_BUILD_NO_NDO_IMPORTER 1.98 +#define ASSIMP_BUILD_NO_NFF_IMPORTER 1.99 +#define ASSIMP_BUILD_NO_OFF_IMPORTER 1.100 +#define ASSIMP_BUILD_NO_OGRE_IMPORTER 1.101 +#define ASSIMP_BUILD_NO_PLY_IMPORTER 1.102 +#define ASSIMP_BUILD_NO_Q3D_IMPORTER 1.103 +#define ASSIMP_BUILD_NO_RAW_IMPORTER 1.104 +#define ASSIMP_BUILD_NO_SMD_IMPORTER 1.105 +#define ASSIMP_BUILD_NO_STL_IMPORTER 1.106 +#define ASSIMP_BUILD_NO_TERRAGEN_IMPORTER 1.107 +#define ASSIMP_BUILD_NO_3D_IMPORTER 1.108 +#define ASSIMP_BUILD_NO_X_IMPORTER 1.109 +#define ASSIMP_BUILD_NO_XGL_IMPORTER 1.110 + 1.111 +// we don't really need assimp to be thread-safe (I think) 1.112 +#define ASSIMP_BUILD_SINGLETHREADED 1.113 + 1.114 + 1.115 +#ifndef ASSIMP_BUILD_NO_COMPRESSED_X 1.116 +# define ASSIMP_BUILD_NEED_Z_INFLATE 1.117 +#endif 1.118 + 1.119 +#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND 1.120 +# define ASSIMP_BUILD_NEED_Z_INFLATE 1.121 +#endif 1.122 + 1.123 +#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC 1.124 +# define ASSIMP_BUILD_NEED_Z_INFLATE 1.125 +# define ASSIMP_BUILD_NEED_UNZIP 1.126 +#endif 1.127 + 1.128 +#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER 1.129 +# define ASSIMP_BUILD_NEED_Z_INFLATE 1.130 +# define ASSIMP_BUILD_NEED_UNZIP 1.131 +#endif 1.132 + 1.133 + ////////////////////////////////////////////////////////////////////////// 1.134 + /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific 1.135 + * post processing step. This is the current list of process names ('XX'): 1.136 + * CALCTANGENTS 1.137 + * JOINVERTICES 1.138 + * TRIANGULATE 1.139 + * GENFACENORMALS 1.140 + * GENVERTEXNORMALS 1.141 + * REMOVEVC 1.142 + * SPLITLARGEMESHES 1.143 + * PRETRANSFORMVERTICES 1.144 + * LIMITBONEWEIGHTS 1.145 + * VALIDATEDS 1.146 + * IMPROVECACHELOCALITY 1.147 + * FIXINFACINGNORMALS 1.148 + * REMOVE_REDUNDANTMATERIALS 1.149 + * OPTIMIZEGRAPH 1.150 + * SORTBYPTYPE 1.151 + * FINDINVALIDDATA 1.152 + * TRANSFORMTEXCOORDS 1.153 + * GENUVCOORDS 1.154 + * ENTITYMESHBUILDER 1.155 + * MAKELEFTHANDED 1.156 + * FLIPUVS 1.157 + * FLIPWINDINGORDER 1.158 + * OPTIMIZEMESHES 1.159 + * OPTIMIZEANIMS 1.160 + * OPTIMIZEGRAPH 1.161 + * GENENTITYMESHES 1.162 + * FIXTEXTUREPATHS */ 1.163 + ////////////////////////////////////////////////////////////////////////// 1.164 + 1.165 +#ifdef _MSC_VER 1.166 +# undef ASSIMP_API 1.167 + 1.168 + ////////////////////////////////////////////////////////////////////////// 1.169 + /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */ 1.170 + ////////////////////////////////////////////////////////////////////////// 1.171 +# ifdef ASSIMP_BUILD_DLL_EXPORT 1.172 +# define ASSIMP_API __declspec(dllexport) 1.173 +# define ASSIMP_API_WINONLY __declspec(dllexport) 1.174 +# pragma warning (disable : 4251) 1.175 + 1.176 + ////////////////////////////////////////////////////////////////////////// 1.177 + /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in 1.178 + * an external DLL under Windows. Default is static linkage. */ 1.179 + ////////////////////////////////////////////////////////////////////////// 1.180 +# elif (defined ASSIMP_DLL) 1.181 +# define ASSIMP_API __declspec(dllimport) 1.182 +# define ASSIMP_API_WINONLY __declspec(dllimport) 1.183 +# else 1.184 +# define ASSIMP_API 1.185 +# define ASSIMP_API_WINONLY 1.186 +# endif 1.187 + 1.188 + /* Force the compiler to inline a function, if possible 1.189 + */ 1.190 +# define AI_FORCE_INLINE __forceinline 1.191 + 1.192 + /* Tells the compiler that a function never returns. Used in code analysis 1.193 + * to skip dead paths (e.g. after an assertion evaluated to false). */ 1.194 +# define AI_WONT_RETURN __declspec(noreturn) 1.195 + 1.196 +#elif defined(SWIG) 1.197 + 1.198 + /* Do nothing, the relevant defines are all in AssimpSwigPort.i */ 1.199 + 1.200 +#else 1.201 + 1.202 +# define AI_WONT_RETURN 1.203 + 1.204 +# define ASSIMP_API __attribute__ ((visibility("default"))) 1.205 +# define ASSIMP_API_WINONLY 1.206 +# define AI_FORCE_INLINE inline 1.207 +#endif // (defined _MSC_VER) 1.208 + 1.209 +#ifdef __cplusplus 1.210 + /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up 1.211 + * in doxydocs. 1.212 + */ 1.213 +# define C_STRUCT 1.214 +# define C_ENUM 1.215 +#else 1.216 + ////////////////////////////////////////////////////////////////////////// 1.217 + /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD 1.218 + * is defined by Doxygen's preprocessor. The corresponding 1.219 + * entries in the DOXYFILE are: */ 1.220 + ////////////////////////////////////////////////////////////////////////// 1.221 +#if 0 1.222 + ENABLE_PREPROCESSING = YES 1.223 + MACRO_EXPANSION = YES 1.224 + EXPAND_ONLY_PREDEF = YES 1.225 + SEARCH_INCLUDES = YES 1.226 + INCLUDE_PATH = 1.227 + INCLUDE_FILE_PATTERNS = 1.228 + PREDEFINED = ASSIMP_DOXYGEN_BUILD=1 1.229 + EXPAND_AS_DEFINED = C_STRUCT C_ENUM 1.230 + SKIP_FUNCTION_MACROS = YES 1.231 +#endif 1.232 + ////////////////////////////////////////////////////////////////////////// 1.233 + /* Doxygen gets confused if we use c-struct typedefs to avoid 1.234 + * the explicit 'struct' notation. This trick here has the same 1.235 + * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need 1.236 + * to typedef all structs/enums. */ 1.237 + ////////////////////////////////////////////////////////////////////////// 1.238 +# if (defined ASSIMP_DOXYGEN_BUILD) 1.239 +# define C_STRUCT 1.240 +# define C_ENUM 1.241 +# else 1.242 +# define C_STRUCT struct 1.243 +# define C_ENUM enum 1.244 +# endif 1.245 +#endif 1.246 + 1.247 +#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__)) 1.248 +#error Currently, Borland is unsupported. Feel free to port Assimp. 1.249 + 1.250 +// "W8059 Packgröße der Struktur geändert" 1.251 + 1.252 +#endif 1.253 + ////////////////////////////////////////////////////////////////////////// 1.254 + /* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp 1.255 + * without boost. This is done by using a few workaround 1.256 + * classes and brings some limitations (e.g. some logging won't be done, 1.257 + * the library won't utilize threads or be threadsafe at all). 1.258 + * This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */ 1.259 + ////////////////////////////////////////////////////////////////////////// 1.260 +#ifdef ASSIMP_BUILD_BOOST_WORKAROUND 1.261 + 1.262 + // threading support requires boost 1.263 +#ifndef ASSIMP_BUILD_SINGLETHREADED 1.264 +# define ASSIMP_BUILD_SINGLETHREADED 1.265 +#endif 1.266 + 1.267 +#endif // !! ASSIMP_BUILD_BOOST_WORKAROUND 1.268 + 1.269 + ////////////////////////////////////////////////////////////////////////// 1.270 + /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp 1.271 + * without threading support. The library doesn't utilize 1.272 + * threads then and is itself not threadsafe. 1.273 + * If this flag is specified boost::threads is *not* required. */ 1.274 + ////////////////////////////////////////////////////////////////////////// 1.275 +#ifndef ASSIMP_BUILD_SINGLETHREADED 1.276 +# define ASSIMP_BUILD_SINGLETHREADED 1.277 +#endif 1.278 + 1.279 +#ifndef ASSIMP_BUILD_SINGLETHREADED 1.280 +# define AI_C_THREADSAFE 1.281 +#endif // !! ASSIMP_BUILD_SINGLETHREADED 1.282 + 1.283 +#ifdef _DEBUG 1.284 +# define ASSIMP_BUILD_DEBUG 1.285 +#endif 1.286 + 1.287 + ////////////////////////////////////////////////////////////////////////// 1.288 + /* Useful constants */ 1.289 + ////////////////////////////////////////////////////////////////////////// 1.290 + 1.291 +/* This is PI. Hi PI. */ 1.292 +#define AI_MATH_PI (3.141592653589793238462643383279 ) 1.293 +#define AI_MATH_TWO_PI (AI_MATH_PI * 2.0) 1.294 +#define AI_MATH_HALF_PI (AI_MATH_PI * 0.5) 1.295 + 1.296 +/* And this is to avoid endless casts to float */ 1.297 +#define AI_MATH_PI_F (3.1415926538f) 1.298 +#define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f) 1.299 +#define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f) 1.300 + 1.301 +/* Tiny macro to convert from radians to degrees and back */ 1.302 +#define AI_DEG_TO_RAD(x) (x*0.0174532925f) 1.303 +#define AI_RAD_TO_DEG(x) (x*57.2957795f) 1.304 + 1.305 +/* Support for big-endian builds */ 1.306 +#if defined(__BYTE_ORDER__) 1.307 +# if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 1.308 +# if !defined(__BIG_ENDIAN__) 1.309 +# define __BIG_ENDIAN__ 1.310 +# endif 1.311 +# else /* little endian */ 1.312 +# if defined (__BIG_ENDIAN__) 1.313 +# undef __BIG_ENDIAN__ 1.314 +# endif 1.315 +# endif 1.316 +#endif 1.317 +#if defined(__BIG_ENDIAN__) 1.318 +# define AI_BUILD_BIG_ENDIAN 1.319 +#endif 1.320 + 1.321 +#endif // !! INCLUDED_AI_DEFINES_H