Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Ra::Core::Geometry::LoopSubdivider Class Reference

#include <Core/Geometry/LoopSubdivider.hpp>

Inherits OpenMesh::Subdivider::Uniform::SubdividerT< deprecated::TopologicalMesh, Scalar >.

+ Collaboration diagram for Ra::Core::Geometry::LoopSubdivider:

Public Member Functions

 LoopSubdivider (deprecated::TopologicalMesh &mesh)
 
const char * name (void) const override
 
void recompute (const Vector3Array &newCoarseVertices, const Vector3Array &newCoarseNormals, Vector3Array &newSubdivVertices, Vector3Array &newSubdivNormals, deprecated::TopologicalMesh &mesh)
 

Protected Member Functions

void init_weights (size_t max_valence)
 Pre-compute weights.
 
bool prepare (deprecated::TopologicalMesh &mesh) override
 
bool cleanup (deprecated::TopologicalMesh &mesh) override
 
bool subdivide (deprecated::TopologicalMesh &mesh, size_t n, const bool updatePoints=true) override
 

Detailed Description

This class implements the Loop subdivision algorithm

This class extends OpenMesh's LoopT subdivider to handle attributes.

Note
We here consider that boundary halfedges do not store attributes.

Definition at line 17 of file LoopSubdivider.hpp.

Member Function Documentation

◆ recompute()

void Ra::Core::Geometry::LoopSubdivider::recompute ( const Vector3Array &  newCoarseVertices,
const Vector3Array &  newCoarseNormals,
Vector3Array &  newSubdivVertices,
Vector3Array &  newSubdivNormals,
deprecated::TopologicalMesh mesh 
)

In the case one wants to apply the subdivision on the same mesh topology, but with a different geometry (e.g. for an animated character), one may want to just reapply the subdivision operations instead for performance reasons. This can be achieved with the following code:

// 1- apply subdivision once
Ra::Core::Geometry::TriangleMesh triangleMesh;
Ra::Core::LoopSubdivider subdiv( topoMesh );
subdiv( 2 );
// get back to TriangleMesh (mandatory before re-applying)
TriangleMesh subdividedMesh = topoMesh.toTriangleMesh();
// 2- re-apply operations on new geometry (new_vertices, new_normals)
m_subdivider.recompute( new_vertices, new_normals, subdividedMesh.vertices(),
subdividedMesh.normals(), topoMesh );

Definition at line 349 of file LoopSubdivider.cpp.

+ Here is the call graph for this function:

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