Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

231 lignes
8.2 KiB

  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2012, assimp 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 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 ImporterRegistry.cpp
  35. Central registry for all postprocessing steps available. Do not edit this file
  36. directly (unless you are adding new steps), instead use the
  37. corresponding preprocessor flag to selectively disable steps.
  38. */
  39. #include "AssimpPCH.h"
  40. #include "ProcessHelper.h"
  41. #ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS
  42. # include "CalcTangentsProcess.h"
  43. #endif
  44. #ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
  45. # include "JoinVerticesProcess.h"
  46. #endif
  47. #if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
  48. # include "ConvertToLHProcess.h"
  49. #endif
  50. #ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
  51. # include "TriangulateProcess.h"
  52. #endif
  53. #ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS
  54. # include "GenFaceNormalsProcess.h"
  55. #endif
  56. #ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS
  57. # include "GenVertexNormalsProcess.h"
  58. #endif
  59. #ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS
  60. # include "RemoveVCProcess.h"
  61. #endif
  62. #ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS
  63. # include "SplitLargeMeshes.h"
  64. #endif
  65. #ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS
  66. # include "PretransformVertices.h"
  67. #endif
  68. #ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS
  69. # include "LimitBoneWeightsProcess.h"
  70. #endif
  71. #ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
  72. # include "ValidateDataStructure.h"
  73. #endif
  74. #ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS
  75. # include "ImproveCacheLocality.h"
  76. #endif
  77. #ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS
  78. # include "FixNormalsStep.h"
  79. #endif
  80. #ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS
  81. # include "RemoveRedundantMaterials.h"
  82. #endif
  83. #ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
  84. # include "FindInvalidDataProcess.h"
  85. #endif
  86. #ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS
  87. # include "FindDegenerates.h"
  88. #endif
  89. #ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS
  90. # include "SortByPTypeProcess.h"
  91. #endif
  92. #ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
  93. # include "ComputeUVMappingProcess.h"
  94. #endif
  95. #ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
  96. # include "TextureTransform.h"
  97. #endif
  98. #ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS
  99. # include "FindInstancesProcess.h"
  100. #endif
  101. #ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
  102. # include "OptimizeMeshes.h"
  103. #endif
  104. #ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
  105. # include "OptimizeGraph.h"
  106. #endif
  107. #ifndef ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS
  108. # include "SplitByBoneCountProcess.h"
  109. #endif
  110. #ifndef ASSIMP_BUILD_NO_DEBONE_PROCESS
  111. # include "DeboneProcess.h"
  112. #endif
  113. namespace Assimp {
  114. // ------------------------------------------------------------------------------------------------
  115. void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out)
  116. {
  117. // ----------------------------------------------------------------------------
  118. // Add an instance of each post processing step here in the order
  119. // of sequence it is executed. Steps that are added here are not
  120. // validated - as RegisterPPStep() does - all dependencies must be given.
  121. // ----------------------------------------------------------------------------
  122. out.reserve(25);
  123. #if (!defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS)
  124. out.push_back( new MakeLeftHandedProcess());
  125. #endif
  126. #if (!defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS)
  127. out.push_back( new FlipUVsProcess());
  128. #endif
  129. #if (!defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
  130. out.push_back( new FlipWindingOrderProcess());
  131. #endif
  132. #if (!defined ASSIMP_BUILD_NO_REMOVEVC_PROCESS)
  133. out.push_back( new RemoveVCProcess());
  134. #endif
  135. #if (!defined ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS)
  136. out.push_back( new RemoveRedundantMatsProcess());
  137. #endif
  138. #if (!defined ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS)
  139. out.push_back( new FindInstancesProcess());
  140. #endif
  141. #if (!defined ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS)
  142. out.push_back( new OptimizeGraphProcess());
  143. #endif
  144. #if (!defined ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS)
  145. out.push_back( new FindDegeneratesProcess());
  146. #endif
  147. #ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
  148. out.push_back( new ComputeUVMappingProcess());
  149. #endif
  150. #ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
  151. out.push_back( new TextureTransformStep());
  152. #endif
  153. #if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS)
  154. out.push_back( new PretransformVertices());
  155. #endif
  156. #if (!defined ASSIMP_BUILD_NO_TRIANGULATE_PROCESS)
  157. out.push_back( new TriangulateProcess());
  158. #endif
  159. #if (!defined ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS)
  160. out.push_back( new SortByPTypeProcess());
  161. #endif
  162. #if (!defined ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS)
  163. out.push_back( new FindInvalidDataProcess());
  164. #endif
  165. #if (!defined ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS)
  166. out.push_back( new OptimizeMeshesProcess());
  167. #endif
  168. #if (!defined ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS)
  169. out.push_back( new FixInfacingNormalsProcess());
  170. #endif
  171. #if (!defined ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS)
  172. out.push_back( new SplitByBoneCountProcess());
  173. #endif
  174. #if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
  175. out.push_back( new SplitLargeMeshesProcess_Triangle());
  176. #endif
  177. #if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS)
  178. out.push_back( new GenFaceNormalsProcess());
  179. #endif
  180. // .........................................................................
  181. // DON'T change the order of these five ..
  182. // XXX this is actually a design weakness that dates back to the time
  183. // when Importer would maintain the postprocessing step list exclusively.
  184. // Now that others access it too, we need a better solution.
  185. out.push_back( new ComputeSpatialSortProcess());
  186. // .........................................................................
  187. #if (!defined ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS)
  188. out.push_back( new GenVertexNormalsProcess());
  189. #endif
  190. #if (!defined ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS)
  191. out.push_back( new CalcTangentsProcess());
  192. #endif
  193. #if (!defined ASSIMP_BUILD_NO_JOINVERTICES_PROCESS)
  194. out.push_back( new JoinVerticesProcess());
  195. #endif
  196. // .........................................................................
  197. out.push_back( new DestroySpatialSortProcess());
  198. // .........................................................................
  199. #if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
  200. out.push_back( new SplitLargeMeshesProcess_Vertex());
  201. #endif
  202. #if (!defined ASSIMP_BUILD_NO_DEBONE_PROCESS)
  203. out.push_back( new DeboneProcess());
  204. #endif
  205. #if (!defined ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS)
  206. out.push_back( new LimitBoneWeightsProcess());
  207. #endif
  208. #if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS)
  209. out.push_back( new ImproveCacheLocalityProcess());
  210. #endif
  211. }
  212. }