Coverage Report

Created: 2026-07-30 07:21

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