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

TTK processing package for the computation of Morse-Smale segmentations using Path Compression. More...

#include <PathCompression.h>

Inheritance diagram for ttk::PathCompression:
ttk::Debug ttk::BaseClass ttkPathCompression

Classes

struct  OutputSegmentation
 Pointers to pre-allocated segmentation point data arrays. More...
 

Public Member Functions

 PathCompression ()
 
void preconditionTriangulation (AbstractTriangulation *const data)
 
template<typename triangulationType >
int execute (OutputSegmentation &outSegmentation, const SimplexId *const orderArray, const triangulationType &triangulation)
 Main function for computing the Morse-Smale complex.
 
template<typename triangulationType >
int computePathCompression (SimplexId *const ascSegmentation, SimplexId *const dscSegmentation, const SimplexId *const orderArray, const triangulationType &triangulation) const
 Compute the ascending and descending segmentation in one run.
 
template<typename triangulationType >
int computePathCompressionSingle (SimplexId *const segmentation, const bool computeAscending, const SimplexId *const orderArray, const triangulationType &triangulation) const
 Compute the ascending or descending segmentation.
 
void setComputeSegmentation (const bool doAscending, const bool doDescending, const bool doMorseSmale)
 
template<typename triangulationType >
int computeMSHash (SimplexId *const morseSmaleSegmentation, const SimplexId *const ascSegmentation, const SimplexId *const dscSegmentation, const triangulationType &triangulation) const
 Computes a MS segmentation hash.
 
- 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 Attributes

bool ComputeAscendingSegmentation {true}
 
bool ComputeDescendingSegmentation {true}
 
bool ComputeMSSegmentationHash {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

- 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)
 
- 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 segmentations using Path Compression.

Author
Robin G. C. Maack maack.nosp@m.@rpt.nosp@m.u.de
Date
May 2023.

Given an input order field, this class computes its ascending and descending segmentation by assigning every vertex to its minimum or maximum in gradient or inverse gradient direction. For convienience a hash (no hash collision detection) of both segmentations can be created to represent the Morse-Smale segmentation.

Related publication
"Parallel Computation of Piecewise Linear Morse-Smale Segmentations"
Robin G. C. Maack, Jonas Lukasczyk, Julien Tierny, Hans Hagen, Ross Maciejewski, Christoph Garth
IEEE Transactions on Visualization and Computer Graphics

See also
ttkPathCompression.cpp for a usage example

Online examples:

Definition at line 65 of file PathCompression.h.

Constructor & Destructor Documentation

◆ PathCompression()

ttk::PathCompression::PathCompression ( )

Definition at line 3 of file PathCompression.cpp.

Member Function Documentation

◆ computeMSHash()

template<typename triangulationType >
int ttk::PathCompression::computeMSHash ( SimplexId *const  morseSmaleSegmentation,
const SimplexId *const  ascSegmentation,
const SimplexId *const  dscSegmentation,
const triangulationType &  triangulation 
) const

Computes a MS segmentation hash.

Computes a hash from the ascending and descending segmentation as keys. The function does not check for hash conflicts.

Template Parameters
triangulationTypetype of triangulation
Parameters
[out]morseSmaleSegmentation
[out]ascSegmentationascending segmentation
[out]dscSegmentationdescending segmentation
[in]triangulationtriangulation
Returns
0 on success

Definition at line 414 of file PathCompression.h.

◆ computePathCompression()

template<typename triangulationType >
int ttk::PathCompression::computePathCompression ( SimplexId *const  ascSegmentation,
SimplexId *const  dscSegmentation,
const SimplexId *const  orderArray,
const triangulationType &  triangulation 
) const

Compute the ascending and descending segmentation in one run.

This function computes the ascending and descending segmentation on the order field. First, the ascending and descending segmentation is set to the largest and smallest neighbor of each vertex. Then, using path compression, the vertices are assigned to their minimum/maximum in positive/negative gradient direction.

Template Parameters
triangulationTypetype of triangulation
Parameters
[out]ascSegmentationascending segmentation
[out]dscSegmentationdescending segmentation
[in]orderArrayorder array
[in]triangulationtriangulation
Returns
0 on success

Definition at line 228 of file PathCompression.h.

◆ computePathCompressionSingle()

template<typename triangulationType >
int ttk::PathCompression::computePathCompressionSingle ( SimplexId *const  segmentation,
const bool  computeAscending,
const SimplexId *const  orderArray,
const triangulationType &  triangulation 
) const

Compute the ascending or descending segmentation.

This function computes the ascending or descending segmentation on the order field. First, the ascending or descending segmentation is set to the largest or smallest neighbor of each vertex. Then, using path compression, the vertices are assigned to their minimum/maximum in positive/negative gradient direction.

Template Parameters
triangulationTypetype of triangulation
Parameters
[out]segmentationsegmentation
[in]computeAscendingcompute the ascending or descending segmentation
[in]orderArrayorder array
[in]triangulationtriangulation
Returns
0 on success

Definition at line 321 of file PathCompression.h.

◆ execute()

template<typename triangulationType >
int ttk::PathCompression::execute ( OutputSegmentation outSegmentation,
const SimplexId *const  orderArray,
const triangulationType &  triangulation 
)
inline

Main function for computing the Morse-Smale complex.

Template Parameters
triangulationTypetype of triangulation
Parameters
[out]outSegmentationsegmentations as a struct
[in]orderArrayorder field
[in]triangulationtriangulation
Precondition
PathCompression::preconditionTriangulation must be called prior to this.
Returns
0 on success

Definition at line 190 of file PathCompression.h.

◆ preconditionTriangulation()

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

Compute necessary triangulation information

Definition at line 79 of file PathCompression.h.

◆ setComputeSegmentation()

void ttk::PathCompression::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 151 of file PathCompression.h.

Member Data Documentation

◆ ComputeAscendingSegmentation

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

Definition at line 179 of file PathCompression.h.

◆ ComputeDescendingSegmentation

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

Definition at line 182 of file PathCompression.h.

◆ ComputeMSSegmentationHash

bool ttk::PathCompression::ComputeMSSegmentationHash {true}
protected

Definition at line 185 of file PathCompression.h.


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