Assimp  v4.1. (December 2018)
CatmullClarkSubdivider Class Reference

Subdivider stub class to implement the Catmull-Clarke subdivision algorithm. More...

Inherits Assimp::Subdivider.

Classes

struct  Edge
 Intermediate description of an edge between two corners of a polygon. More...
 

Public Types

typedef std::map< uint64_t, EdgeEdgeMap
 
typedef std::vector< unsigned int > UIntVector
 
- Public Types inherited from Assimp::Subdivider
enum  Algorithm { CATMULL_CLARKE = 0x1 }
 Enumerates all supported subvidision algorithms. More...
 

Public Member Functions

void Subdivide (aiMesh **smesh, size_t nmesh, aiMesh **out, unsigned int num, bool discard_input)
 Subdivide multiple meshes using the selected algorithm. More...
 
void Subdivide (aiMesh *mesh, aiMesh *&out, unsigned int num, bool discard_input)
 Subdivide a mesh using the selected algorithm. More...
 
- Public Member Functions inherited from Assimp::Subdivider
virtual ~Subdivider ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Assimp::Subdivider
static SubdividerCreate (Algorithm algo)
 Create a subdivider of a specific type. More...
 

Detailed Description

Subdivider stub class to implement the Catmull-Clarke subdivision algorithm.

The implementation is basing on recursive refinement. Directly evaluating the result is also possible and much quicker, but it depends on lengthy matrix lookup tables.

Member Typedef Documentation

◆ EdgeMap

◆ UIntVector

typedef std::vector<unsigned int> CatmullClarkSubdivider::UIntVector

Member Function Documentation

◆ Subdivide() [1/2]

void CatmullClarkSubdivider::Subdivide ( aiMesh **  smesh,
size_t  nmesh,
aiMesh **  out,
unsigned int  num,
bool  discard_input 
)
virtual

Subdivide multiple meshes using the selected algorithm.

This avoids erroneous smoothing on objects consisting of multiple per-material meshes. Usually, most 3d modellers smooth on a per-object base, regardless the materials assigned to the meshes.

Parameters
smeshArray of meshes to be subdivided. Must be in verbose format.
nmeshNumber of meshes in smesh.
outReceives the output meshes. The array must be sufficiently large (at least nmesh elements) and may not overlap the input array. Output meshes map one-to-one to their corresponding input meshes. The meshes are allocated by the function.
discard_inputIf true is passed, input meshes are deleted after the subdivision is complete. This can improve performance because it allows the optimization of reusing existing meshes for intermediate results.
numNumber of subdivisions to perform.
Precondition
nmesh != 0, smesh and out may not overlap

Implements Assimp::Subdivider.

◆ Subdivide() [2/2]

void CatmullClarkSubdivider::Subdivide ( aiMesh mesh,
aiMesh *&  out,
unsigned int  num,
bool  discard_input 
)
virtual

Subdivide a mesh using the selected algorithm.

Parameters
meshFirst mesh to be subdivided. Must be in verbose format.
outReceives the output mesh, allocated by me.
numNumber of subdivisions to perform.
discard_inputIf true is passed, the input mesh is deleted after the subdivision is complete. This can improve performance because it allows the optimization to reuse the existing mesh for intermediate results.
Precondition
out!=mesh

Implements Assimp::Subdivider.


The documentation for this class was generated from the following file: