1/*
2Open Asset Import Library (assimp)
3----------------------------------------------------------------------
4
5Copyright (c) 2006-2017, assimp team
6
7All rights reserved.
8
9Redistribution and use of this software in source and binary forms,
10with or without modification, are permitted provided that the
11following conditions are met:
12
13* Redistributions of source code must retain the above
14 copyright notice, this list of conditions and the
15 following disclaimer.
16
17* Redistributions in binary form must reproduce the above
18 copyright notice, this list of conditions and the
19 following disclaimer in the documentation and/or other
20 materials provided with the distribution.
21
22* Neither the name of the assimp team, nor the names of its
23 contributors may be used to endorse or promote products
24 derived from this software without specific prior
25 written permission of the assimp team.
26
27THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
39----------------------------------------------------------------------
40*/
41
42/** @file Defines a post processing step to search an importer's output
43 for data that is obviously invalid */
44#ifndef AI_FINDINVALIDDATA_H_INC
45#define AI_FINDINVALIDDATA_H_INC
46
47#include "BaseProcess.h"
48#include <assimp/types.h>
49#include <assimp/anim.h>
50
51struct aiMesh;
52class FindInvalidDataProcessTest;
53namespace Assimp {
54
55// ---------------------------------------------------------------------------
56/** The FindInvalidData post-processing step. It searches the mesh data
57 * for parts that are obviously invalid and removes them.
58 *
59 * Originally this was a workaround for some models written by Blender
60 * which have zero normal vectors. */
61class ASSIMP_API FindInvalidDataProcess : public BaseProcess
62{
63public:
64
65 FindInvalidDataProcess();
66 ~FindInvalidDataProcess();
67
68public:
69
70 // -------------------------------------------------------------------
71 //
72 bool IsActive( unsigned int pFlags) const;
73
74 // -------------------------------------------------------------------
75 // Setup import settings
76 void SetupProperties(const Importer* pImp);
77
78 // -------------------------------------------------------------------
79 // Run the step
80 void Execute( aiScene* pScene);
81
82public:
83
84 // -------------------------------------------------------------------
85 /** Executes the postprocessing step on the given mesh
86 * @param pMesh The mesh to process.
87 * @return 0 - nothing, 1 - removed sth, 2 - please delete me */
88 int ProcessMesh( aiMesh* pMesh);
89
90 // -------------------------------------------------------------------
91 /** Executes the postprocessing step on the given animation
92 * @param anim The animation to process. */
93 void ProcessAnimation (aiAnimation* anim);
94
95 // -------------------------------------------------------------------
96 /** Executes the postprocessing step on the given anim channel
97 * @param anim The animation channel to process.*/
98 void ProcessAnimationChannel (aiNodeAnim* anim);
99
100private:
101 ai_real configEpsilon;
102};
103
104} // end of namespace Assimp
105
106#endif // AI_AI_FINDINVALIDDATA_H_INC
107