vrshoot

view libs/assimp/ScenePreprocessor.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line source
1 /*
2 Open Asset Import Library (assimp)
3 ----------------------------------------------------------------------
5 Copyright (c) 2006-2012, assimp team
6 All rights reserved.
8 Redistribution and use of this software in source and binary forms,
9 with or without modification, are permitted provided that the
10 following conditions are met:
12 * Redistributions of source code must retain the above
13 copyright notice, this list of conditions and the
14 following disclaimer.
16 * Redistributions in binary form must reproduce the above
17 copyright notice, this list of conditions and the
18 following disclaimer in the documentation and/or other
19 materials provided with the distribution.
21 * Neither the name of the assimp team, nor the names of its
22 contributors may be used to endorse or promote products
23 derived from this software without specific prior
24 written permission of the assimp team.
26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 ----------------------------------------------------------------------
39 */
41 /** @file Defines a post processing step to search all meshes for
42 degenerated faces */
43 #ifndef AI_SCENE_PREPROCESSOR_H_INC
44 #define AI_SCENE_PREPROCESSOR_H_INC
46 class ScenePreprocessorTest;
47 namespace Assimp {
49 // ----------------------------------------------------------------------------------
50 /** ScenePreprocessor: Preprocess a scene before any post-processing
51 * steps are executed.
52 *
53 * The step computes data that needn't necessarily be provided by the
54 * importer, such as aiMesh::mPrimitiveTypes.
55 */
56 // ----------------------------------------------------------------------------------
57 class ScenePreprocessor
58 {
59 // Make ourselves a friend of the corresponding test unit.
60 friend class ::ScenePreprocessorTest;
61 public:
63 // ----------------------------------------------------------------
64 /** Default c'tpr. Use SetScene() to assign a scene to the object.
65 */
66 ScenePreprocessor()
67 : scene (NULL)
68 {}
70 /** Constructs the object and assigns a specific scene to it
71 */
72 ScenePreprocessor(aiScene* _scene)
73 : scene (_scene)
74 {}
76 // ----------------------------------------------------------------
77 /** Assign a (new) scene to the object.
78 *
79 * One 'SceneProcessor' can be used for multiple scenes.
80 * Call ProcessScene to have the scene preprocessed.
81 * @param sc Scene to be processed.
82 */
83 void SetScene (aiScene* sc) {
84 scene = sc;
85 }
87 // ----------------------------------------------------------------
88 /** Preprocess the current scene
89 */
90 void ProcessScene ();
92 protected:
94 // ----------------------------------------------------------------
95 /** Preprocess an animation in the scene
96 * @param anim Anim to be preprocessed.
97 */
98 void ProcessAnimation (aiAnimation* anim);
101 // ----------------------------------------------------------------
102 /** Preprocess a mesh in the scene
103 * @param mesh Mesh to be preprocessed.
104 */
105 void ProcessMesh (aiMesh* mesh);
107 protected:
109 //! Scene we're currently working on
110 aiScene* scene;
111 };
114 } // ! end namespace Assimp
116 #endif // include guard