aiDefines.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (ASSIMP)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2008, ASSIMP Development Team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the ASSIMP team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the ASSIMP Development Team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /** @file aiDefines.h
  35. * @brief Assimp build configuration setup. See the notes in the comment
  36. * blocks to find out how to customize _your_ Assimp build.
  37. */
  38. #ifndef INCLUDED_AI_DEFINES_H
  39. #define INCLUDED_AI_DEFINES_H
  40. //////////////////////////////////////////////////////////////////////////
  41. /* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific
  42. * file format loader. The loader is be excluded from the
  43. * build in this case. 'XX' stands for the most common file
  44. * extension of the file format. E.g.:
  45. * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
  46. *
  47. * If you're unsure about that, take a look at the implementation of the
  48. * import plugin you wish to disable. You'll find the right define in the
  49. * first lines of the corresponding unit.
  50. *
  51. * Other (mixed) configuration switches are listed here:
  52. * ASSIMP_BUILD_NO_COMPRESSED_X
  53. * - Disable support for compressed X files */
  54. //////////////////////////////////////////////////////////////////////////
  55. #ifndef ASSIMP_BUILD_NO_COMPRESSED_X
  56. # define ASSIMP_BUILD_NEED_Z_INFLATE
  57. #endif
  58. //////////////////////////////////////////////////////////////////////////
  59. /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
  60. * post processing step. This is the current list of process names ('XX'):
  61. * CALCTANGENTS
  62. * JOINVERTICES
  63. * TRIANGULATE
  64. * GENFACENORMALS
  65. * GENVERTEXNORMALS
  66. * REMOVEVC
  67. * SPLITLARGEMESHES
  68. * PRETRANSFORMVERTICES
  69. * LIMITBONEWEIGHTS
  70. * VALIDATEDS
  71. * IMPROVECACHELOCALITY
  72. * FIXINFACINGNORMALS
  73. * REMOVE_REDUNDANTMATERIALS
  74. * OPTIMIZEGRAPH
  75. * SORTBYPTYPE
  76. * FINDINVALIDDATA
  77. * TRANSFORMTEXCOORDS
  78. * GENUVCOORDS
  79. * ENTITYMESHBUILDER
  80. * MAKELEFTHANDED
  81. * FLIPUVS
  82. * FLIPWINDINGORDER
  83. * OPTIMIZEMESHES
  84. * OPTIMIZEANIMS
  85. * OPTIMIZEGRAPH
  86. * GENENTITYMESHES
  87. * FIXTEXTUREPATHS */
  88. //////////////////////////////////////////////////////////////////////////
  89. // Compiler specific includes and definitions
  90. #if (defined _MSC_VER)
  91. # undef ASSIMP_API
  92. //////////////////////////////////////////////////////////////////////////
  93. /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
  94. //////////////////////////////////////////////////////////////////////////
  95. # if (defined ASSIMP_BUILD_DLL_EXPORT)
  96. # define ASSIMP_API __declspec(dllexport)
  97. # pragma warning (disable : 4251)
  98. //////////////////////////////////////////////////////////////////////////
  99. /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
  100. * an external DLL under Windows. Default is static linkage. */
  101. //////////////////////////////////////////////////////////////////////////
  102. # elif (defined ASSIMP_DLL)
  103. # define ASSIMP_API __declspec(dllimport)
  104. # else
  105. # define ASSIMP_API
  106. # endif
  107. /* Force the compiler to inline a function, if supported
  108. */
  109. # define AI_FORCE_INLINE __forceinline
  110. #else
  111. # define ASSIMP_API
  112. # define AI_FORCE_INLINE inline
  113. #endif // (defined _MSC_VER)
  114. #ifdef __cplusplus
  115. /* No explicit 'struct' and 'enum' tags for C++, we don't want to
  116. * confuse the _AI_ of our IDE.
  117. */
  118. # define C_STRUCT
  119. # define C_ENUM
  120. #else
  121. //////////////////////////////////////////////////////////////////////////
  122. /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
  123. * is defined by Doxygen's preprocessor. The corresponding
  124. * entries in the DOXYFILE are: */
  125. //////////////////////////////////////////////////////////////////////////
  126. #if 0
  127. ENABLE_PREPROCESSING = YES
  128. MACRO_EXPANSION = YES
  129. EXPAND_ONLY_PREDEF = YES
  130. SEARCH_INCLUDES = YES
  131. INCLUDE_PATH =
  132. INCLUDE_FILE_PATTERNS =
  133. PREDEFINED = ASSIMP_DOXYGEN_BUILD=1
  134. EXPAND_AS_DEFINED = C_STRUCT C_ENUM
  135. SKIP_FUNCTION_MACROS = YES
  136. #endif
  137. //////////////////////////////////////////////////////////////////////////
  138. /* Doxygen gets confused if we use c-struct typedefs to avoid
  139. * the explicit 'struct' notation. This trick here has the same
  140. * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need
  141. * to typedef all structs/enums. */
  142. //////////////////////////////////////////////////////////////////////////
  143. # if (defined ASSIMP_DOXYGEN_BUILD)
  144. # define C_STRUCT
  145. # define C_ENUM
  146. # else
  147. # define C_STRUCT struct
  148. # define C_ENUM enum
  149. # endif
  150. #endif
  151. #if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
  152. #error Currently Borland is unsupported. Feel free to port Assimp.
  153. // "W8059 Packgröße der Struktur geändert"
  154. #endif
  155. //////////////////////////////////////////////////////////////////////////
  156. /* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp
  157. * without boost. This is done by using a few workaround
  158. * classes and brings some limitations (e.g. some logging won't be done,
  159. * the library won't utilize threads or be threadsafe at all).
  160. * This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */
  161. //////////////////////////////////////////////////////////////////////////
  162. #ifdef ASSIMP_BUILD_BOOST_WORKAROUND
  163. // threading support requires boost
  164. #ifndef ASSIMP_BUILD_SINGLETHREADED
  165. # define ASSIMP_BUILD_SINGLETHREADED
  166. #endif
  167. #endif // !! ASSIMP_BUILD_BOOST_WORKAROUND
  168. //////////////////////////////////////////////////////////////////////////
  169. /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
  170. * without threading support. The library doesn't utilize
  171. * threads then and is itself not threadsafe.
  172. * If this flag is specified boost::threads is *not* required. */
  173. //////////////////////////////////////////////////////////////////////////
  174. #ifndef ASSIMP_BUILD_SINGLETHREADED
  175. # define ASSIMP_BUILD_SINGLETHREADED
  176. #endif
  177. #ifndef ASSIMP_BUILD_SINGLETHREADED
  178. # define AI_C_THREADSAFE
  179. #endif // !! ASSIMP_BUILD_SINGLETHREADED
  180. #if (defined _DEBUG || defined DEBUG) // one of the two should be defined ..
  181. # define ASSIMP_BUILD_DEBUG
  182. #endif
  183. /* This is PI. Hi PI. */
  184. #define AI_MATH_PI (3.141592653589793238462643383279 )
  185. #define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
  186. #define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
  187. /* And this is to avoid endless (float) casts */
  188. #define AI_MATH_PI_F (3.1415926538f)
  189. #define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f)
  190. #define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f)
  191. /* Tiny macro to convert from radians to degrees and back */
  192. #define AI_DEG_TO_RAD(x) (x*0.0174532925f)
  193. #define AI_RAD_TO_DEG(x) (x*57.2957795f)
  194. #endif // !! INCLUDED_AI_DEFINES_H