vrshoot

diff libs/assimp/PostStepRegistry.cpp @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/assimp/PostStepRegistry.cpp	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,229 @@
     1.4 +/*
     1.5 +---------------------------------------------------------------------------
     1.6 +Open Asset Import Library (assimp)
     1.7 +---------------------------------------------------------------------------
     1.8 +
     1.9 +Copyright (c) 2006-2012, assimp team
    1.10 +
    1.11 +All rights reserved.
    1.12 +
    1.13 +Redistribution and use of this software in source and binary forms, 
    1.14 +with or without modification, are permitted provided that the following 
    1.15 +conditions are met:
    1.16 +
    1.17 +* Redistributions of source code must retain the above
    1.18 +  copyright notice, this list of conditions and the
    1.19 +  following disclaimer.
    1.20 +
    1.21 +* Redistributions in binary form must reproduce the above
    1.22 +  copyright notice, this list of conditions and the
    1.23 +  following disclaimer in the documentation and/or other
    1.24 +  materials provided with the distribution.
    1.25 +
    1.26 +* Neither the name of the assimp team, nor the names of its
    1.27 +  contributors may be used to endorse or promote products
    1.28 +  derived from this software without specific prior
    1.29 +  written permission of the assimp team.
    1.30 +
    1.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    1.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    1.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    1.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    1.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
    1.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    1.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    1.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.42 +---------------------------------------------------------------------------
    1.43 +*/
    1.44 +
    1.45 +/** @file ImporterRegistry.cpp
    1.46 +
    1.47 +Central registry for all postprocessing steps available. Do not edit this file
    1.48 +directly (unless you are adding new steps), instead use the
    1.49 +corresponding preprocessor flag to selectively disable steps.
    1.50 +*/
    1.51 +
    1.52 +#include "AssimpPCH.h"
    1.53 +
    1.54 +#ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS
    1.55 +#	include "CalcTangentsProcess.h"
    1.56 +#endif
    1.57 +#ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
    1.58 +#	include "JoinVerticesProcess.h"
    1.59 +#endif
    1.60 +#if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
    1.61 +#	include "ConvertToLHProcess.h"
    1.62 +#endif
    1.63 +#ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
    1.64 +#	include "TriangulateProcess.h"
    1.65 +#endif
    1.66 +#ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS
    1.67 +#	include "GenFaceNormalsProcess.h"
    1.68 +#endif
    1.69 +#ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS
    1.70 +#	include "GenVertexNormalsProcess.h"
    1.71 +#endif
    1.72 +#ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS
    1.73 +#	include "RemoveVCProcess.h"
    1.74 +#endif
    1.75 +#ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS
    1.76 +#	include "SplitLargeMeshes.h"
    1.77 +#endif
    1.78 +#ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS
    1.79 +#	include "PretransformVertices.h"
    1.80 +#endif
    1.81 +#ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS
    1.82 +#	include "LimitBoneWeightsProcess.h"
    1.83 +#endif
    1.84 +#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
    1.85 +#	include "ValidateDataStructure.h"
    1.86 +#endif
    1.87 +#ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS
    1.88 +#	include "ImproveCacheLocality.h"
    1.89 +#endif
    1.90 +#ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS
    1.91 +#	include "FixNormalsStep.h"
    1.92 +#endif
    1.93 +#ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS
    1.94 +#	include "RemoveRedundantMaterials.h"
    1.95 +#endif
    1.96 +#ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
    1.97 +#	include "FindInvalidDataProcess.h"
    1.98 +#endif
    1.99 +#ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS
   1.100 +#	include "FindDegenerates.h"
   1.101 +#endif
   1.102 +#ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS
   1.103 +#	include "SortByPTypeProcess.h"
   1.104 +#endif
   1.105 +#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
   1.106 +#	include "ComputeUVMappingProcess.h"
   1.107 +#endif
   1.108 +#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
   1.109 +#	include "TextureTransform.h"
   1.110 +#endif
   1.111 +#ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS
   1.112 +#	include "FindInstancesProcess.h"
   1.113 +#endif
   1.114 +#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
   1.115 +#	include "OptimizeMeshes.h"
   1.116 +#endif
   1.117 +#ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
   1.118 +#	include "OptimizeGraph.h"
   1.119 +#endif
   1.120 +#ifndef ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS
   1.121 +#	include "SplitByBoneCountProcess.h"
   1.122 +#endif
   1.123 +#ifndef ASSIMP_BUILD_NO_DEBONE_PROCESS
   1.124 +#	include "DeboneProcess.h"
   1.125 +#endif
   1.126 +
   1.127 +namespace Assimp {
   1.128 +
   1.129 +// ------------------------------------------------------------------------------------------------
   1.130 +void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out)
   1.131 +{
   1.132 +	// ----------------------------------------------------------------------------
   1.133 +	// Add an instance of each post processing step here in the order 
   1.134 +	// of sequence it is executed. Steps that are added here are not
   1.135 +	// validated - as RegisterPPStep() does - all dependencies must be given.
   1.136 +	// ----------------------------------------------------------------------------
   1.137 +	out.reserve(25);
   1.138 +#if (!defined ASSIMP_BUILD_NO_REMOVEVC_PROCESS)
   1.139 +	out.push_back( new RemoveVCProcess());
   1.140 +#endif
   1.141 +#if (!defined ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS)
   1.142 +	out.push_back( new RemoveRedundantMatsProcess());
   1.143 +#endif
   1.144 +#if (!defined ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS)
   1.145 +	out.push_back( new FindInstancesProcess());
   1.146 +#endif
   1.147 +#if (!defined ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS)
   1.148 +	out.push_back( new OptimizeGraphProcess());
   1.149 +#endif
   1.150 +#if (!defined ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS)
   1.151 +	out.push_back( new OptimizeMeshesProcess());
   1.152 +#endif
   1.153 +#if (!defined ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS)
   1.154 +	out.push_back( new FindDegeneratesProcess());
   1.155 +#endif
   1.156 +#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
   1.157 +	out.push_back( new ComputeUVMappingProcess());
   1.158 +#endif
   1.159 +#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
   1.160 +	out.push_back( new TextureTransformStep());
   1.161 +#endif
   1.162 +#if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS)
   1.163 +	out.push_back( new PretransformVertices());
   1.164 +#endif
   1.165 +#if (!defined ASSIMP_BUILD_NO_TRIANGULATE_PROCESS)
   1.166 +	out.push_back( new TriangulateProcess());
   1.167 +#endif
   1.168 +#if (!defined ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS)
   1.169 +	out.push_back( new SortByPTypeProcess());
   1.170 +#endif
   1.171 +#if (!defined ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS)
   1.172 +	out.push_back( new FindInvalidDataProcess());
   1.173 +#endif
   1.174 +#if (!defined ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS)
   1.175 +	out.push_back( new FixInfacingNormalsProcess());
   1.176 +#endif
   1.177 +#if (!defined ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS)
   1.178 +	out.push_back( new SplitByBoneCountProcess());
   1.179 +#endif
   1.180 +#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
   1.181 +	out.push_back( new SplitLargeMeshesProcess_Triangle());
   1.182 +#endif
   1.183 +#if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS)
   1.184 +	out.push_back( new GenFaceNormalsProcess());
   1.185 +#endif
   1.186 +
   1.187 +	// .........................................................................
   1.188 +	// DON'T change the order of these five ..
   1.189 +	// XXX this is actually a design weakness that dates back to the time
   1.190 +	// when Importer would maintain the postprocessing step list exclusively.
   1.191 +	// Now that others access it too, we need a better solution.
   1.192 +	out.push_back( new ComputeSpatialSortProcess());
   1.193 +	// .........................................................................
   1.194 +
   1.195 +#if (!defined ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS)
   1.196 +	out.push_back( new GenVertexNormalsProcess());
   1.197 +#endif
   1.198 +#if (!defined ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS)
   1.199 +	out.push_back( new CalcTangentsProcess());
   1.200 +#endif
   1.201 +#if (!defined ASSIMP_BUILD_NO_JOINVERTICES_PROCESS)
   1.202 +	out.push_back( new JoinVerticesProcess());
   1.203 +#endif
   1.204 +
   1.205 +	// .........................................................................
   1.206 +	out.push_back( new DestroySpatialSortProcess());
   1.207 +	// .........................................................................
   1.208 +
   1.209 +#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
   1.210 +	out.push_back( new SplitLargeMeshesProcess_Vertex());
   1.211 +#endif
   1.212 +#if (!defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS)
   1.213 +	out.push_back( new MakeLeftHandedProcess());
   1.214 +#endif
   1.215 +#if (!defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS)
   1.216 +	out.push_back( new FlipUVsProcess());
   1.217 +#endif
   1.218 +#if (!defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
   1.219 +	out.push_back( new FlipWindingOrderProcess());
   1.220 +#endif
   1.221 +#if (!defined ASSIMP_BUILD_DEBONE_PROCESS)
   1.222 +	out.push_back( new DeboneProcess());
   1.223 +#endif
   1.224 +#if (!defined ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS)
   1.225 +	out.push_back( new LimitBoneWeightsProcess());
   1.226 +#endif
   1.227 +#if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS)
   1.228 +	out.push_back( new ImproveCacheLocalityProcess());
   1.229 +#endif
   1.230 +}
   1.231 +
   1.232 +}