vrshoot

view libs/assimp/PostStepRegistry.cpp @ 1:e7ca128b8713

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