1/*
2---------------------------------------------------------------------------
3Open Asset Import Library (assimp)
4---------------------------------------------------------------------------
5
6Copyright (c) 2006-2017, assimp team
7
8
9All rights reserved.
10
11Redistribution and use of this software in source and binary forms,
12with or without modification, are permitted provided that the following
13conditions are met:
14
15* Redistributions of source code must retain the above
16 copyright notice, this list of conditions and the
17 following disclaimer.
18
19* Redistributions in binary form must reproduce the above
20 copyright notice, this list of conditions and the
21 following disclaimer in the documentation and/or other
22 materials provided with the distribution.
23
24* Neither the name of the assimp team, nor the names of its
25 contributors may be used to endorse or promote products
26 derived from this software without specific prior
27 written permission of the assimp team.
28
29THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40---------------------------------------------------------------------------
41*/
42
43/** @file ImporterRegistry.cpp
44
45Central registry for all postprocessing steps available. Do not edit this file
46directly (unless you are adding new steps), instead use the
47corresponding preprocessor flag to selectively disable steps.
48*/
49
50#include "ProcessHelper.h"
51
52#ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS
53# include "CalcTangentsProcess.h"
54#endif
55#ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
56# include "JoinVerticesProcess.h"
57#endif
58#if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
59# include "ConvertToLHProcess.h"
60#endif
61#ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
62# include "TriangulateProcess.h"
63#endif
64#ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS
65# include "GenFaceNormalsProcess.h"
66#endif
67#ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS
68# include "GenVertexNormalsProcess.h"
69#endif
70#ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS
71# include "RemoveVCProcess.h"
72#endif
73#ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS
74# include "SplitLargeMeshes.h"
75#endif
76#ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS
77# include "PretransformVertices.h"
78#endif
79#ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS
80# include "LimitBoneWeightsProcess.h"
81#endif
82#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
83# include "ValidateDataStructure.h"
84#endif
85#ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS
86# include "ImproveCacheLocality.h"
87#endif
88#ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS
89# include "FixNormalsStep.h"
90#endif
91#ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS
92# include "RemoveRedundantMaterials.h"
93#endif
94#ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
95# include "FindInvalidDataProcess.h"
96#endif
97#ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS
98# include "FindDegenerates.h"
99#endif
100#ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS
101# include "SortByPTypeProcess.h"
102#endif
103#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
104# include "ComputeUVMappingProcess.h"
105#endif
106#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
107# include "TextureTransform.h"
108#endif
109#ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS
110# include "FindInstancesProcess.h"
111#endif
112#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
113# include "OptimizeMeshes.h"
114#endif
115#ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
116# include "OptimizeGraph.h"
117#endif
118#ifndef ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS
119# include "SplitByBoneCountProcess.h"
120#endif
121#ifndef ASSIMP_BUILD_NO_DEBONE_PROCESS
122# include "DeboneProcess.h"
123#endif
124
125namespace Assimp {
126
127// ------------------------------------------------------------------------------------------------
128void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out)
129{
130 // ----------------------------------------------------------------------------
131 // Add an instance of each post processing step here in the order
132 // of sequence it is executed. Steps that are added here are not
133 // validated - as RegisterPPStep() does - all dependencies must be given.
134 // ----------------------------------------------------------------------------
135 out.reserve(25);
136#if (!defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS)
137 out.push_back( new MakeLeftHandedProcess());
138#endif
139#if (!defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS)
140 out.push_back( new FlipUVsProcess());
141#endif
142#if (!defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
143 out.push_back( new FlipWindingOrderProcess());
144#endif
145#if (!defined ASSIMP_BUILD_NO_REMOVEVC_PROCESS)
146 out.push_back( new RemoveVCProcess());
147#endif
148#if (!defined ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS)
149 out.push_back( new RemoveRedundantMatsProcess());
150#endif
151#if (!defined ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS)
152 out.push_back( new FindInstancesProcess());
153#endif
154#if (!defined ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS)
155 out.push_back( new OptimizeGraphProcess());
156#endif
157#if (!defined ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS)
158 out.push_back( new FindDegeneratesProcess());
159#endif
160#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
161 out.push_back( new ComputeUVMappingProcess());
162#endif
163#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
164 out.push_back( new TextureTransformStep());
165#endif
166#if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS)
167 out.push_back( new PretransformVertices());
168#endif
169#if (!defined ASSIMP_BUILD_NO_TRIANGULATE_PROCESS)
170 out.push_back( new TriangulateProcess());
171#endif
172#if (!defined ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS)
173 out.push_back( new SortByPTypeProcess());
174#endif
175#if (!defined ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS)
176 out.push_back( new FindInvalidDataProcess());
177#endif
178#if (!defined ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS)
179 out.push_back( new OptimizeMeshesProcess());
180#endif
181#if (!defined ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS)
182 out.push_back( new FixInfacingNormalsProcess());
183#endif
184#if (!defined ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS)
185 out.push_back( new SplitByBoneCountProcess());
186#endif
187#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
188 out.push_back( new SplitLargeMeshesProcess_Triangle());
189#endif
190#if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS)
191 out.push_back( new GenFaceNormalsProcess());
192#endif
193
194 // .........................................................................
195 // DON'T change the order of these five ..
196 // XXX this is actually a design weakness that dates back to the time
197 // when Importer would maintain the postprocessing step list exclusively.
198 // Now that others access it too, we need a better solution.
199 out.push_back( new ComputeSpatialSortProcess());
200 // .........................................................................
201
202#if (!defined ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS)
203 out.push_back( new GenVertexNormalsProcess());
204#endif
205#if (!defined ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS)
206 out.push_back( new CalcTangentsProcess());
207#endif
208#if (!defined ASSIMP_BUILD_NO_JOINVERTICES_PROCESS)
209 out.push_back( new JoinVerticesProcess());
210#endif
211
212 // .........................................................................
213 out.push_back( new DestroySpatialSortProcess());
214 // .........................................................................
215
216#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
217 out.push_back( new SplitLargeMeshesProcess_Vertex());
218#endif
219#if (!defined ASSIMP_BUILD_NO_DEBONE_PROCESS)
220 out.push_back( new DeboneProcess());
221#endif
222#if (!defined ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS)
223 out.push_back( new LimitBoneWeightsProcess());
224#endif
225#if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS)
226 out.push_back( new ImproveCacheLocalityProcess());
227#endif
228}
229
230}
231