Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::Geometry::LoopSubdivider Class Reference

#include <Core/Geometry/LoopSubdivider.hpp>

+ 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.

Constructor & Destructor Documentation

◆ LoopSubdivider() [1/2]

Ra::Core::Geometry::LoopSubdivider::LoopSubdivider ( )
inline

Definition at line 32 of file LoopSubdivider.hpp.

◆ LoopSubdivider() [2/2]

Ra::Core::Geometry::LoopSubdivider::LoopSubdivider ( deprecated::TopologicalMesh & mesh)
inlineexplicit

Definition at line 34 of file LoopSubdivider.hpp.

◆ ~LoopSubdivider()

Ra::Core::Geometry::LoopSubdivider::~LoopSubdivider ( )
inline

Definition at line 36 of file LoopSubdivider.hpp.

Member Function Documentation

◆ cleanup()

bool Ra::Core::Geometry::LoopSubdivider::cleanup ( deprecated::TopologicalMesh & mesh)
overrideprotected

Definition at line 23 of file LoopSubdivider.cpp.

◆ init_weights()

void Ra::Core::Geometry::LoopSubdivider::init_weights ( size_t max_valence)
inlineprotected

Pre-compute weights.

Definition at line 69 of file LoopSubdivider.hpp.

+ Here is the call graph for this function:

◆ name()

const char * Ra::Core::Geometry::LoopSubdivider::name ( void ) const
inlineoverride

Definition at line 39 of file LoopSubdivider.hpp.

◆ prepare()

bool Ra::Core::Geometry::LoopSubdivider::prepare ( deprecated::TopologicalMesh & mesh)
overrideprotected

Definition at line 7 of file LoopSubdivider.cpp.

◆ 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 );
const NormalAttribHandle::Container & normals() const
Access the vertices normals.
const PointAttribHandle::Container & vertices() const
Access the vertices positions.

Definition at line 349 of file LoopSubdivider.cpp.

+ Here is the call graph for this function:

◆ subdivide()

bool Ra::Core::Geometry::LoopSubdivider::subdivide ( deprecated::TopologicalMesh & mesh,
size_t n,
const bool updatePoints = true )
overrideprotected

Definition at line 30 of file LoopSubdivider.cpp.


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