TTK
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
ttk::SurfaceGeometrySmoother Class Reference

TTK VTK-filter for smoothing meshes on surfaces. More...

#include <SurfaceGeometrySmoother.h>

Inheritance diagram for ttk::SurfaceGeometrySmoother:
ttk::Debug ttk::BaseClass ttkSurfaceGeometrySmoother

Classes

struct  Point
 
struct  ProjectionInput
 Stores the findProjection() input. More...
 
struct  ProjectionResult
 Stores the findProjection() result. More...
 

Public Member Functions

 SurfaceGeometrySmoother ()
 
 ~SurfaceGeometrySmoother () override=default
 
void preconditionTriangulationToSmooth (AbstractTriangulation *const triangulation)
 
void preconditionTriangulationSurface (AbstractTriangulation *const triangulation)
 
template<typename triangulationType0 , typename triangulationType1 >
int execute (float *const outputCoords, const float *const inputCoords, const char *const mask, const SimplexId *const vertsId, const int nIter, const triangulationType0 &triangulationToSmooth, const triangulationType1 &triangulationSurface) const
 
template<typename triangulationType >
ttk::SurfaceGeometrySmoother::Point computeSurfaceNormalAtPoint (const SimplexId a, const triangulationType &triangulation) const
 
template<typename triangulationType0 , typename triangulationType1 >
ttk::SurfaceGeometrySmoother::ProjectionResult findProjection (const ProjectionInput &pi, VisitedMask &trianglesTested, std::vector< float > &dists, std::stack< SimplexId > &trianglesToTest, const bool reverseProjection, const triangulationType0 &triangulationToSmooth, const triangulationType1 &triangulation) const
 
- Public Member Functions inherited from ttk::Debug
 Debug ()
 
 ~Debug () override
 
virtual int setDebugLevel (const int &debugLevel)
 
int setWrapper (const Wrapper *wrapper) override
 
int printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
void setDebugMsgPrefix (const std::string &prefix)
 
- Public Member Functions inherited from ttk::BaseClass
 BaseClass ()
 
virtual ~BaseClass ()=default
 
int getThreadNumber () const
 
virtual int setThreadNumber (const int threadNumber)
 
virtual int setWrapper (const Wrapper *wrapper)
 

Protected Member Functions

template<typename triangulationType0 , typename triangulationType1 >
int relaxProject (std::vector< Point > &outputPoints, std::vector< Point > &tmpStorage, std::vector< SimplexId > &nearestVertexId, std::vector< bool > &trianglesTested, std::vector< SimplexId > &visitedTriangles, std::vector< float > &dists, const char *const mask, const triangulationType0 &triangulationToSmooth, const triangulationType1 &triangulationSurface) const
 
template<typename triangulationType0 , typename triangulationType1 >
ProjectionResult findProjection (const ProjectionInput &pi, VisitedMask &trianglesTested, std::vector< float > &dists, std::stack< SimplexId > &trianglesToTest, const bool reverseProjection, const triangulationType0 &triangulationToSmooth, const triangulationType1 &triangulationSurface) const
 
template<typename triangulationType >
Point relax (const SimplexId a, std::vector< ttk::SurfaceGeometrySmoother::Point > &outputPoints, const triangulationType &triangulationToSmooth) const
 Computes the barycenter of a given point's neighbors.
 
Point projectOnTrianglePlane (const Point &p, const Point &a, const Point &normTri) const
 Compute euclidean projection in a triangle plane.
 
Point projectOnEdge (const Point &p, const Point &a, const Point &b) const
 Compute euclidean projection on a 3D segment.
 
template<typename triangulationType >
SimplexId getNearestSurfaceVertex (const Point &pa, std::vector< float > &dists, const triangulationType &triangulation) const
 Find nearest vertex on the surface.
 
Point computeTriangleNormal (const Point a, const Point b, const Point c) const
 Compute normal vector to triangle.
 
template<typename triangulationType >
Point computeSurfaceNormalAtPoint (const SimplexId a, const triangulationType &triangulation) const
 Compute (mean) surface normal at given surface vertex.
 
- Protected Member Functions inherited from ttk::Debug
int printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const
 
int welcomeMsg (std::ostream &stream)
 

Additional Inherited Members

- Protected Attributes inherited from ttk::Debug
int debugLevel_
 
std::string debugMsgPrefix_
 
std::string debugMsgNamePrefix_
 
- Protected Attributes inherited from ttk::BaseClass
bool lastObject_
 
int threadNumber_
 
Wrapperwrapper_
 
- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

TTK VTK-filter for smoothing meshes on surfaces.

Author
Pierre Guillou pierr.nosp@m.e.gu.nosp@m.illou.nosp@m.@lip.nosp@m.6.fr
Date
March 2022.

ttk::GeometrySmoother with a twist! This class smoothes and projects a 1D or a 2D mesh onto a 2D closed triangulated surface.

See also
ttkSurfaceGeometrySmoother.cpp for a usage example.

Online examples:

Definition at line 37 of file SurfaceGeometrySmoother.h.

Constructor & Destructor Documentation

◆ SurfaceGeometrySmoother()

ttk::SurfaceGeometrySmoother::SurfaceGeometrySmoother ( )

Definition at line 3 of file SurfaceGeometrySmoother.cpp.

◆ ~SurfaceGeometrySmoother()

ttk::SurfaceGeometrySmoother::~SurfaceGeometrySmoother ( )
overridedefault

Member Function Documentation

◆ computeSurfaceNormalAtPoint() [1/2]

template<typename triangulationType >
Point ttk::SurfaceGeometrySmoother::computeSurfaceNormalAtPoint ( const SimplexId  a,
const triangulationType &  triangulation 
) const
protected

Compute (mean) surface normal at given surface vertex.

Parameters
[in]aSurface vertex id
[in]triangulationMesh
Returns
Mean of surface normals in star of a

◆ computeSurfaceNormalAtPoint() [2/2]

template<typename triangulationType >
ttk::SurfaceGeometrySmoother::Point ttk::SurfaceGeometrySmoother::computeSurfaceNormalAtPoint ( const SimplexId  a,
const triangulationType &  triangulation 
) const

Definition at line 274 of file SurfaceGeometrySmoother.h.

◆ computeTriangleNormal()

Point ttk::SurfaceGeometrySmoother::computeTriangleNormal ( const Point  a,
const Point  b,
const Point  c 
) const
inlineprotected

Compute normal vector to triangle.

Parameters
[in]aFirst triangle vertex coordinates
[in]bSecond triangle vertex coordinates
[in]cThird triangle vertex coordinates
Returns
Triangle unitary normal

Definition at line 234 of file SurfaceGeometrySmoother.h.

◆ execute()

template<typename triangulationType0 , typename triangulationType1 >
int ttk::SurfaceGeometrySmoother::execute ( float *const  outputCoords,
const float *const  inputCoords,
const char *const  mask,
const SimplexId *const  vertsId,
const int  nIter,
const triangulationType0 &  triangulationToSmooth,
const triangulationType1 &  triangulationSurface 
) const

Definition at line 647 of file SurfaceGeometrySmoother.h.

◆ findProjection() [1/2]

template<typename triangulationType0 , typename triangulationType1 >
ttk::SurfaceGeometrySmoother::ProjectionResult ttk::SurfaceGeometrySmoother::findProjection ( const ProjectionInput pi,
VisitedMask trianglesTested,
std::vector< float > &  dists,
std::stack< SimplexId > &  trianglesToTest,
const bool  reverseProjection,
const triangulationType0 &  triangulationToSmooth,
const triangulationType1 &  triangulation 
) const

Definition at line 383 of file SurfaceGeometrySmoother.h.

◆ findProjection() [2/2]

template<typename triangulationType0 , typename triangulationType1 >
ProjectionResult ttk::SurfaceGeometrySmoother::findProjection ( const ProjectionInput pi,
VisitedMask trianglesTested,
std::vector< float > &  dists,
std::stack< SimplexId > &  trianglesToTest,
const bool  reverseProjection,
const triangulationType0 &  triangulationToSmooth,
const triangulationType1 &  triangulationSurface 
) const
protected

◆ getNearestSurfaceVertex()

template<typename triangulationType >
SimplexId ttk::SurfaceGeometrySmoother::getNearestSurfaceVertex ( const Point pa,
std::vector< float > &  dists,
const triangulationType &  triangulation 
) const
inlineprotected

Find nearest vertex on the surface.

Parameters
[in]paInput point
[in]distsPre-allocated distances vector
[in]triangulationSurface triangulation
Returns
Nearest vertex id on the surface

Definition at line 214 of file SurfaceGeometrySmoother.h.

◆ preconditionTriangulationSurface()

void ttk::SurfaceGeometrySmoother::preconditionTriangulationSurface ( AbstractTriangulation *const  triangulation)
inline

Definition at line 52 of file SurfaceGeometrySmoother.h.

◆ preconditionTriangulationToSmooth()

void ttk::SurfaceGeometrySmoother::preconditionTriangulationToSmooth ( AbstractTriangulation *const  triangulation)
inline

Definition at line 43 of file SurfaceGeometrySmoother.h.

◆ projectOnEdge()

Point ttk::SurfaceGeometrySmoother::projectOnEdge ( const Point p,
const Point a,
const Point b 
) const
inlineprotected

Compute euclidean projection on a 3D segment.

Parameters
[in]pPoint to be projected
[in]aFirst segment vertex coordinates
[in]bSecond segment vertex coordinates
Returns
Projection coordinates

Definition at line 196 of file SurfaceGeometrySmoother.h.

◆ projectOnTrianglePlane()

Point ttk::SurfaceGeometrySmoother::projectOnTrianglePlane ( const Point p,
const Point a,
const Point normTri 
) const
inlineprotected

Compute euclidean projection in a triangle plane.

Parameters
[in]pPoint to be projected
[in]aTriangle vertex coordinates
[in]normTriTriangle normal vector
Returns
Projection coordinates

Definition at line 180 of file SurfaceGeometrySmoother.h.

◆ relax()

template<typename triangulationType >
Point ttk::SurfaceGeometrySmoother::relax ( const SimplexId  a,
std::vector< ttk::SurfaceGeometrySmoother::Point > &  outputPoints,
const triangulationType &  triangulationToSmooth 
) const
inlineprotected

Computes the barycenter of a given point's neighbors.

Parameters
[in]aInput point index
[in]outputPointsCoordinates storage
[in]triangulationToSmoothTo get neighbors
Returns
Neighbors barycenter coordinates

Definition at line 159 of file SurfaceGeometrySmoother.h.

◆ relaxProject()

template<typename triangulationType0 , typename triangulationType1 >
int ttk::SurfaceGeometrySmoother::relaxProject ( std::vector< Point > &  outputPoints,
std::vector< Point > &  tmpStorage,
std::vector< SimplexId > &  nearestVertexId,
std::vector< bool > &  trianglesTested,
std::vector< SimplexId > &  visitedTriangles,
std::vector< float > &  dists,
const char *const  mask,
const triangulationType0 &  triangulationToSmooth,
const triangulationType1 &  triangulationSurface 
) const
protected

Definition at line 598 of file SurfaceGeometrySmoother.h.


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