Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:30:10

0001 /*
0002 Open Asset Import Library (assimp)
0003 ----------------------------------------------------------------------
0004 
0005 Copyright (c) 2006-2024, assimp team
0006 
0007 
0008 All rights reserved.
0009 
0010 Redistribution and use of this software in source and binary forms,
0011 with or without modification, are permitted provided that the
0012 following conditions are met:
0013 
0014 * Redistributions of source code must retain the above
0015   copyright notice, this list of conditions and the
0016   following disclaimer.
0017 
0018 * Redistributions in binary form must reproduce the above
0019   copyright notice, this list of conditions and the
0020   following disclaimer in the documentation and/or other
0021   materials provided with the distribution.
0022 
0023 * Neither the name of the assimp team, nor the names of its
0024   contributors may be used to endorse or promote products
0025   derived from this software without specific prior
0026   written permission of the assimp team.
0027 
0028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0029 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0030 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0031 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0032 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0033 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0034 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0035 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0036 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0037 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0038 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0039 
0040 ----------------------------------------------------------------------
0041 */
0042 
0043 /** @file Defines a helper class to evaluate subdivision surfaces.*/
0044 #pragma once
0045 #ifndef AI_SUBDISIVION_H_INC
0046 #define AI_SUBDISIVION_H_INC
0047 
0048 #ifdef __GNUC__
0049 #   pragma GCC system_header
0050 #endif
0051 
0052 #include <assimp/types.h>
0053 
0054 struct aiMesh;
0055 
0056 namespace Assimp    {
0057 
0058 // ------------------------------------------------------------------------------
0059 /** Helper class to evaluate subdivision surfaces. Different algorithms
0060  *  are provided for choice. */
0061 // ------------------------------------------------------------------------------
0062 class ASSIMP_API Subdivider {
0063 public:
0064 
0065     /** Enumerates all supported subvidision algorithms */
0066     enum Algorithm  {
0067         CATMULL_CLARKE = 0x1
0068     };
0069 
0070     virtual ~Subdivider();
0071 
0072     // ---------------------------------------------------------------
0073     /** Create a subdivider of a specific type
0074      *
0075      *  @param algo Algorithm to be used for subdivision
0076      *  @return Subdivider instance. */
0077     static Subdivider* Create (Algorithm algo);
0078 
0079     // ---------------------------------------------------------------
0080     /** Subdivide a mesh using the selected algorithm
0081      *
0082      *  @param mesh First mesh to be subdivided. Must be in verbose
0083      *    format.
0084      *  @param out Receives the output mesh, allocated by me.
0085      *  @param num Number of subdivisions to perform.
0086      *  @param discard_input If true is passed, the input mesh is
0087      *    deleted after the subdivision is complete. This can
0088      *    improve performance because it allows the optimization
0089      *    to reuse the existing mesh for intermediate results.
0090      *  @pre out!=mesh*/
0091     virtual void Subdivide ( aiMesh* mesh,
0092         aiMesh*& out, unsigned int num,
0093         bool discard_input = false) = 0;
0094 
0095     // ---------------------------------------------------------------
0096     /** Subdivide multiple meshes using the selected algorithm. This
0097      *  avoids erroneous smoothing on objects consisting of multiple
0098      *  per-material meshes. Usually, most 3d modellers smooth on a
0099      *  per-object base, regardless the materials assigned to the
0100      *  meshes.
0101      *
0102      *  @param smesh Array of meshes to be subdivided. Must be in
0103      *    verbose format.
0104      *  @param nmesh Number of meshes in smesh.
0105      *  @param out Receives the output meshes. The array must be
0106      *    sufficiently large (at least @c nmesh elements) and may not
0107      *    overlap the input array. Output meshes map one-to-one to
0108      *    their corresponding input meshes. The meshes are allocated
0109      *    by the function.
0110      *  @param discard_input If true is passed, input meshes are
0111      *    deleted after the subdivision is complete. This can
0112      *    improve performance because it allows the optimization
0113      *    of reusing existing meshes for intermediate results.
0114      *  @param num Number of subdivisions to perform.
0115      *  @pre nmesh != 0, smesh and out may not overlap*/
0116     virtual void Subdivide (
0117         aiMesh** smesh,
0118         size_t nmesh,
0119         aiMesh** out,
0120         unsigned int num,
0121         bool discard_input = false) = 0;
0122 
0123 };
0124 
0125 inline Subdivider::~Subdivider() = default;
0126 
0127 } // end namespace Assimp
0128 
0129 
0130 #endif // !!  AI_SUBDISIVION_H_INC
0131