2
Open Asset Import Library (ASSIMP)
3
----------------------------------------------------------------------
5
Copyright (c) 2006-2010, ASSIMP Development Team
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
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 Development 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
----------------------------------------------------------------------
41
/** @file Defines a helper class to evaluate subdivision surfaces.*/
42
#ifndef AI_SUBDISIVION_H_INC
43
#define AI_SUBDISIVION_H_INC
46
// ------------------------------------------------------------------------------
47
/** Helper class to evaluate subdivision surfaces. Different algorithms
48
* are provided for choice. */
49
// ------------------------------------------------------------------------------
50
class ASSIMP_API Subdivider
54
/** Enumerates all supported subvidision algorithms */
61
virtual ~Subdivider() {
66
// ---------------------------------------------------------------
67
/** Create a subdivider of a specific type
69
* @param algo Algorithm to be used for subdivision
70
* @return Subdivider instance. */
71
static Subdivider* Create (Algorithm algo);
73
// ---------------------------------------------------------------
74
/** Subdivide a mesh using the selected algorithm
76
* @param mesh First mesh to be subdivided. Must be in verbose
78
* @param out Receives the output mesh, allocated by me.
79
* @param num Number of subdivisions to perform.
80
* @param discard_input If true is passed, the input mesh is
81
* deleted after the subdivision is complete. This can
82
* improve performance because it allows the optimization
83
* to reuse the existing mesh for intermediate results.
85
virtual void Subdivide (const aiMesh* mesh,
86
aiMesh*& out, unsigned int num,
87
bool discard_input = false) = 0;
89
// ---------------------------------------------------------------
90
/** Subdivide multiple meshes using the selected algorithm. This
91
* avoids erroneous smoothing on objects consisting of multiple
92
* per-material meshes. Usually, most 3d modellers smooth on a
93
* per-object base, regardless the materials assigned to the
96
* @param smesh Array of meshes to be subdivided. Must be in
98
* @param nmesh Number of meshes in smesh.
99
* @param out Receives the output meshes. The array must be
100
* sufficiently large (at least @c nmesh elements) and may not
101
* overlap the input array. Output meshes map one-to-one to
102
* their corresponding input meshes. The meshes are allocated
104
* @param discard_input If true is passed, input meshes are
105
* deleted after the subdivision is complete. This can
106
* improve performance because it allows the optimization
107
* of reusing existing meshes for intermediate results.
108
* @param num Number of subdivisions to perform.
109
* @pre nmesh != 0, smesh and out may not overlap*/
110
virtual void Subdivide (
111
const aiMesh* const * smesh,
115
bool discard_input = false) = 0;
120
} // end namespace Assimp
123
#endif // !! AI_SUBDISIVION_H_INC