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

TTK processing package for the computation of Morse-Smale complexes. More...

#include <MorseSmaleComplex.h>

Inheritance diagram for ttk::MorseSmaleComplex:
ttk::Debug ttk::BaseClass ttkMorseSmaleComplex

Classes

struct  Output1Separatrices
 1-Separatrices point and cell data arrays More...
 
struct  Output2Separatrices
 2-Separatrices point and cell data arrays More...
 
struct  OutputCriticalPoints
 Critical points data arrays. More...
 
struct  OutputManifold
 Pointers to pre-allocated segmentation point data arrays. More...
 
struct  Separatrix
 

Public Member Functions

 MorseSmaleComplex ()
 
template<typename dataType , typename triangulationType >
int execute (OutputCriticalPoints &outCP, Output1Separatrices &outSeps1, Output2Separatrices &outSeps2, OutputManifold &outManifold, const dataType *const scalars, const size_t scalarsMTime, const SimplexId *const offsets, const triangulationType &triangulation)
 
void setComputeCriticalPoints (const bool state)
 
void setComputeSeparatrices1 (const bool doAscending, const bool doDescending, const bool doSaddleConnectors)
 
void setComputeSeparatrices2 (const bool doAscending, const bool doDescending)
 
void setComputeSegmentation (const bool doAscending, const bool doDescending, const bool doMorseSmale)
 
void setReturnSaddleConnectors (const bool state)
 
void setSaddleConnectorsPersistenceThreshold (const double threshold)
 
void preconditionTriangulation (AbstractTriangulation *const data)
 
- 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)
 

Protected Member Functions

template<typename triangulationType >
int getDescendingSeparatrices1 (const std::vector< SimplexId > &saddles, std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType >
int getAscendingSeparatrices1 (const std::vector< SimplexId > &saddles, std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType >
int getSaddleConnectors (const std::vector< SimplexId > &saddles2, std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType >
int setSeparatrices1 (Output1Separatrices &outSeps1, const std::vector< Separatrix > &separatrices, const SimplexId *const offsets, const triangulationType &triangulation) const
 
template<typename triangulationType >
int getDescendingSeparatrices2 (const std::vector< SimplexId > &saddles2, std::vector< Separatrix > &separatrices, std::vector< std::vector< SimplexId > > &separatricesSaddles, const triangulationType &triangulation) const
 
template<typename triangulationType >
int setDescendingSeparatrices2 (Output2Separatrices &outSeps2, const std::vector< Separatrix > &separatrices, const std::vector< std::vector< SimplexId > > &separatricesSaddles, const SimplexId *const offsets, const triangulationType &triangulation) const
 
template<typename triangulationType >
int getDualPolygon (const SimplexId edgeId, SimplexId *const polygon, const size_t polSize, const triangulationType &triangulation) const
 
template<typename triangulationType >
int sortDualPolygonVertices (SimplexId *const polygon, const size_t polSize, const triangulationType &triangulation) const
 
template<typename triangulationType >
int getAscendingSeparatrices2 (const std::vector< SimplexId > &saddles1, std::vector< Separatrix > &separatrices, std::vector< std::vector< SimplexId > > &separatricesSaddles, const triangulationType &triangulation) const
 
template<typename triangulationType >
int setAscendingSeparatrices2 (Output2Separatrices &outSeps2, const std::vector< Separatrix > &separatrices, const std::vector< std::vector< SimplexId > > &separatricesSaddles, const SimplexId *const offsets, const triangulationType &triangulation) const
 
void flattenSeparatricesVectors (std::vector< std::vector< Separatrix > > &separatrices) const
 Flatten the vectors of vectors into their first component.
 
template<typename triangulationType >
int setAscendingSegmentation (const std::vector< SimplexId > &maxima, SimplexId *const morseSmaleManifold, const triangulationType &triangulation) const
 
template<typename triangulationType >
int setDescendingSegmentation (const std::vector< SimplexId > &minima, SimplexId *const morseSmaleManifold, const triangulationType &triangulation) const
 
template<typename triangulationType >
int setFinalSegmentation (const SimplexId numberOfMaxima, const SimplexId *const ascendingManifold, const SimplexId *const descendingManifold, SimplexId *const morseSmaleManifold, const triangulationType &triangulation) const
 
template<typename dataType , typename triangulationType >
int returnSaddleConnectors (const double persistenceThreshold, const dataType *const scalars, const SimplexId *const offsets, const triangulationType &triangulation)
 
- 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)
 

Protected Attributes

dcg::DiscreteGradient discreteGradient_ {}
 
bool ComputeCriticalPoints {true}
 
bool ComputeAscendingSeparatrices1 {true}
 
bool ComputeDescendingSeparatrices1 {true}
 
bool ComputeSaddleConnectors {true}
 
bool ComputeAscendingSeparatrices2 {false}
 
bool ComputeDescendingSeparatrices2 {false}
 
bool ComputeAscendingSegmentation {true}
 
bool ComputeDescendingSegmentation {true}
 
bool ComputeFinalSegmentation {true}
 
bool ReturnSaddleConnectors {false}
 
double SaddleConnectorsPersistenceThreshold {}
 
bool ThresholdIsAbsolute {false}
 
bool ForceLoopFreeGradient {true}
 
- 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_
 

Additional Inherited Members

- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

TTK processing package for the computation of Morse-Smale complexes.

Author
Guillaume Favelier guill.nosp@m.aume.nosp@m..fave.nosp@m.lier.nosp@m.@lip6.nosp@m..fr
Julien Tierny julie.nosp@m.n.ti.nosp@m.erny@.nosp@m.lip6.nosp@m..fr
Date
February 2017.

Related publications
"The Topology ToolKit"
Julien Tierny, Guillaume Favelier, Joshua Levine, Charles Gueunet, Michael Michaux
IEEE Transactions on Visualization and Computer Graphics (Proc. of IEEE VIS 2017)
"Parallel Computation of 3D Morse-Smale Complexes"
Nithin Shivashankar, Vijay Natarajan
Proc. of EuroVis 2012.
Computer Graphics Forum, 2012.

See also
ttk::Triangulation
ttkMorseSmaleComplex.cpp for a usage example.

Online examples:

Definition at line 90 of file MorseSmaleComplex.h.

Constructor & Destructor Documentation

◆ MorseSmaleComplex()

ttk::MorseSmaleComplex::MorseSmaleComplex ( )

Definition at line 3 of file MorseSmaleComplex.cpp.

Member Function Documentation

◆ execute()

template<typename dataType , typename triangulationType >
int ttk::MorseSmaleComplex::execute ( OutputCriticalPoints outCP,
Output1Separatrices outSeps1,
Output2Separatrices outSeps2,
OutputManifold outManifold,
const dataType *const  scalars,
const size_t  scalarsMTime,
const SimplexId *const  offsets,
const triangulationType &  triangulation 
)
inline

Main function for computing the Morse-Smale complex.

Precondition
MorseSmaleComplex::preconditionTriangulation must be called prior to this.

Definition at line 428 of file MorseSmaleComplex.h.

◆ flattenSeparatricesVectors()

void ttk::MorseSmaleComplex::flattenSeparatricesVectors ( std::vector< std::vector< Separatrix > > &  separatrices) const
protected

Flatten the vectors of vectors into their first component.

Definition at line 7 of file MorseSmaleComplex.cpp.

◆ getAscendingSeparatrices1()

template<typename triangulationType >
int ttk::MorseSmaleComplex::getAscendingSeparatrices1 ( const std::vector< SimplexId > &  saddles,
std::vector< Separatrix > &  separatrices,
const triangulationType &  triangulation 
) const
protected

Compute the ascending 1-separatrices by reading into the discrete gradient.

Definition at line 676 of file MorseSmaleComplex.h.

◆ getAscendingSeparatrices2()

template<typename triangulationType >
int ttk::MorseSmaleComplex::getAscendingSeparatrices2 ( const std::vector< SimplexId > &  saddles1,
std::vector< Separatrix > &  separatrices,
std::vector< std::vector< SimplexId > > &  separatricesSaddles,
const triangulationType &  triangulation 
) const
protected

Compute the 2-separatrices by reading into the discrete gradient from the minima.

Definition at line 937 of file MorseSmaleComplex.h.

◆ getDescendingSeparatrices1()

template<typename triangulationType >
int ttk::MorseSmaleComplex::getDescendingSeparatrices1 ( const std::vector< SimplexId > &  saddles,
std::vector< Separatrix > &  separatrices,
const triangulationType &  triangulation 
) const
protected

Compute the descending 1-separatrices by reading into the discrete gradient.

Definition at line 631 of file MorseSmaleComplex.h.

◆ getDescendingSeparatrices2()

template<typename triangulationType >
int ttk::MorseSmaleComplex::getDescendingSeparatrices2 ( const std::vector< SimplexId > &  saddles2,
std::vector< Separatrix > &  separatrices,
std::vector< std::vector< SimplexId > > &  separatricesSaddles,
const triangulationType &  triangulation 
) const
protected

Compute the 2-separatrices by reading into the discrete gradient from the maxima.

Definition at line 978 of file MorseSmaleComplex.h.

◆ getDualPolygon()

template<typename triangulationType >
int ttk::MorseSmaleComplex::getDualPolygon ( const SimplexId  edgeId,
SimplexId *const  polygon,
const size_t  polSize,
const triangulationType &  triangulation 
) const
protected

Find all tetras in the star of edgeId

(primal: star of edgeId -> dual: vertices of polygon)

Definition at line 1021 of file MorseSmaleComplex.h.

◆ getSaddleConnectors()

template<typename triangulationType >
int ttk::MorseSmaleComplex::getSaddleConnectors ( const std::vector< SimplexId > &  saddles2,
std::vector< Separatrix > &  separatrices,
const triangulationType &  triangulation 
) const
protected

Compute the saddle-connectors by reading into the discrete gradient.

Definition at line 734 of file MorseSmaleComplex.h.

◆ preconditionTriangulation()

void ttk::MorseSmaleComplex::preconditionTriangulation ( AbstractTriangulation *const  data)
inline

Set the input triangulation and preprocess the needed mesh traversal queries.

Definition at line 239 of file MorseSmaleComplex.h.

◆ returnSaddleConnectors()

template<typename dataType , typename triangulationType >
int ttk::MorseSmaleComplex::returnSaddleConnectors ( const double  persistenceThreshold,
const dataType *const  scalars,
const SimplexId *const  offsets,
const triangulationType &  triangulation 
)
protected

Definition at line 1714 of file MorseSmaleComplex.h.

◆ setAscendingSegmentation()

template<typename triangulationType >
int ttk::MorseSmaleComplex::setAscendingSegmentation ( const std::vector< SimplexId > &  maxima,
SimplexId *const  morseSmaleManifold,
const triangulationType &  triangulation 
) const
protected

Compute the ascending manifold of the maxima.

Definition at line 1476 of file MorseSmaleComplex.h.

◆ setAscendingSeparatrices2()

template<typename triangulationType >
int ttk::MorseSmaleComplex::setAscendingSeparatrices2 ( Output2Separatrices outSeps2,
const std::vector< Separatrix > &  separatrices,
const std::vector< std::vector< SimplexId > > &  separatricesSaddles,
const SimplexId *const  offsets,
const triangulationType &  triangulation 
) const
protected

Compute the geometrical embedding of the ascending 2-separatrices.

Definition at line 1072 of file MorseSmaleComplex.h.

◆ setComputeCriticalPoints()

void ttk::MorseSmaleComplex::setComputeCriticalPoints ( const bool  state)
inline

Enable/Disable computation of the geometrical embedding of the critical points.

Definition at line 181 of file MorseSmaleComplex.h.

◆ setComputeSegmentation()

void ttk::MorseSmaleComplex::setComputeSegmentation ( const bool  doAscending,
const bool  doDescending,
const bool  doMorseSmale 
)
inline

Enable/Disable computation of the geometrical embedding of the manifolds of the critical points.

Definition at line 208 of file MorseSmaleComplex.h.

◆ setComputeSeparatrices1()

void ttk::MorseSmaleComplex::setComputeSeparatrices1 ( const bool  doAscending,
const bool  doDescending,
const bool  doSaddleConnectors 
)
inline

Enable/Disable computation of the geometrical embedding of the 1-separatrices.

Definition at line 188 of file MorseSmaleComplex.h.

◆ setComputeSeparatrices2()

void ttk::MorseSmaleComplex::setComputeSeparatrices2 ( const bool  doAscending,
const bool  doDescending 
)
inline

Enable/Disable computation of the geometrical embedding of the 2-separatrices (disabled by default).

Definition at line 199 of file MorseSmaleComplex.h.

◆ setDescendingSegmentation()

template<typename triangulationType >
int ttk::MorseSmaleComplex::setDescendingSegmentation ( const std::vector< SimplexId > &  minima,
SimplexId *const  morseSmaleManifold,
const triangulationType &  triangulation 
) const
protected

Compute the descending manifold of the minima.

Definition at line 1584 of file MorseSmaleComplex.h.

◆ setDescendingSeparatrices2()

template<typename triangulationType >
int ttk::MorseSmaleComplex::setDescendingSeparatrices2 ( Output2Separatrices outSeps2,
const std::vector< Separatrix > &  separatrices,
const std::vector< std::vector< SimplexId > > &  separatricesSaddles,
const SimplexId *const  offsets,
const triangulationType &  triangulation 
) const
protected

Compute the geometrical embedding of the descending 2-separatrices.

Definition at line 1292 of file MorseSmaleComplex.h.

◆ setFinalSegmentation()

template<typename triangulationType >
int ttk::MorseSmaleComplex::setFinalSegmentation ( const SimplexId  numberOfMaxima,
const SimplexId *const  ascendingManifold,
const SimplexId *const  descendingManifold,
SimplexId *const  morseSmaleManifold,
const triangulationType &  triangulation 
) const
protected

Compute the final combinatorial Morse-Smale complex segmentation.

Definition at line 1648 of file MorseSmaleComplex.h.

◆ setReturnSaddleConnectors()

void ttk::MorseSmaleComplex::setReturnSaddleConnectors ( const bool  state)
inline

Enable/Disable post-processing gradient reversal of the (saddle,...,saddle) vpaths under a given persistence threshold (disabled by default).

Definition at line 221 of file MorseSmaleComplex.h.

◆ setSaddleConnectorsPersistenceThreshold()

void ttk::MorseSmaleComplex::setSaddleConnectorsPersistenceThreshold ( const double  threshold)
inline

Set the threshold value for post-processing of (saddle,...,saddle) vpaths gradient reversal (default value is 0.0).

Definition at line 231 of file MorseSmaleComplex.h.

◆ setSeparatrices1()

template<typename triangulationType >
int ttk::MorseSmaleComplex::setSeparatrices1 ( Output1Separatrices outSeps1,
const std::vector< Separatrix > &  separatrices,
const SimplexId *const  offsets,
const triangulationType &  triangulation 
) const
protected

Compute the geometrical embedding of the 1-separatrices.

Definition at line 796 of file MorseSmaleComplex.h.

◆ sortDualPolygonVertices()

template<typename triangulationType >
int ttk::MorseSmaleComplex::sortDualPolygonVertices ( SimplexId *const  polygon,
const size_t  polSize,
const triangulationType &  triangulation 
) const
protected

Sort the polygon vertices to be clockwise

Definition at line 1037 of file MorseSmaleComplex.h.

Member Data Documentation

◆ ComputeAscendingSegmentation

bool ttk::MorseSmaleComplex::ComputeAscendingSegmentation {true}
protected

Definition at line 412 of file MorseSmaleComplex.h.

◆ ComputeAscendingSeparatrices1

bool ttk::MorseSmaleComplex::ComputeAscendingSeparatrices1 {true}
protected

Definition at line 407 of file MorseSmaleComplex.h.

◆ ComputeAscendingSeparatrices2

bool ttk::MorseSmaleComplex::ComputeAscendingSeparatrices2 {false}
protected

Definition at line 410 of file MorseSmaleComplex.h.

◆ ComputeCriticalPoints

bool ttk::MorseSmaleComplex::ComputeCriticalPoints {true}
protected

Definition at line 406 of file MorseSmaleComplex.h.

◆ ComputeDescendingSegmentation

bool ttk::MorseSmaleComplex::ComputeDescendingSegmentation {true}
protected

Definition at line 413 of file MorseSmaleComplex.h.

◆ ComputeDescendingSeparatrices1

bool ttk::MorseSmaleComplex::ComputeDescendingSeparatrices1 {true}
protected

Definition at line 408 of file MorseSmaleComplex.h.

◆ ComputeDescendingSeparatrices2

bool ttk::MorseSmaleComplex::ComputeDescendingSeparatrices2 {false}
protected

Definition at line 411 of file MorseSmaleComplex.h.

◆ ComputeFinalSegmentation

bool ttk::MorseSmaleComplex::ComputeFinalSegmentation {true}
protected

Definition at line 414 of file MorseSmaleComplex.h.

◆ ComputeSaddleConnectors

bool ttk::MorseSmaleComplex::ComputeSaddleConnectors {true}
protected

Definition at line 409 of file MorseSmaleComplex.h.

◆ discreteGradient_

dcg::DiscreteGradient ttk::MorseSmaleComplex::discreteGradient_ {}
protected

Definition at line 404 of file MorseSmaleComplex.h.

◆ ForceLoopFreeGradient

bool ttk::MorseSmaleComplex::ForceLoopFreeGradient {true}
protected

Definition at line 419 of file MorseSmaleComplex.h.

◆ ReturnSaddleConnectors

bool ttk::MorseSmaleComplex::ReturnSaddleConnectors {false}
protected

Definition at line 416 of file MorseSmaleComplex.h.

◆ SaddleConnectorsPersistenceThreshold

double ttk::MorseSmaleComplex::SaddleConnectorsPersistenceThreshold {}
protected

Definition at line 417 of file MorseSmaleComplex.h.

◆ ThresholdIsAbsolute

bool ttk::MorseSmaleComplex::ThresholdIsAbsolute {false}
protected

Definition at line 418 of file MorseSmaleComplex.h.


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