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

TTK processing package for Marching Tetra/Triangles computations. More...

#include <MarchingTetrahedra.h>

Inheritance diagram for ttk::MarchingTetrahedra:
ttk::Debug ttk::BaseClass ttkMarchingTetrahedra

Public Types

enum class  SURFACE_MODE { SM_SEPARATORS = 0 , SM_BOUNDARIES = 1 , SM_BOUNDARIES_DETAILED = 2 }
 Type of 2-separatrix output. More...
 

Public Member Functions

 MarchingTetrahedra ()
 
template<typename dataType , typename triangulationType >
int execute (const dataType *const scalars, const triangulationType &triangulation)
 
template<typename triangulationType >
int computeMarchingCases_2D (unsigned char *const tetCases, size_t *const numEdges, const unsigned long long *const scalars, const size_t *const triangleCounter, const triangulationType &triangulation) const
 
template<typename triangulationType >
int writeSeparators_2D (const unsigned char *const tetCases, const size_t *numEdges, const unsigned long long *const scalars, const triangulationType &triangulation)
 
template<typename triangulationType >
int writeBoundaries_2D (const unsigned char *const tetCases, const size_t *numEdges, const unsigned long long *const scalars, const triangulationType &triangulation)
 
template<typename triangulationType >
int writeBoundariesDetailed_2D (const unsigned char *const tetCases, const size_t *numEdges, const unsigned long long *const scalars, const triangulationType &triangulation)
 
template<typename triangulationType >
int computeMarchingCases_3D (unsigned char *const tetCases, size_t *const numTriangles, const unsigned long long *const scalars, const size_t *const triangleCounter, const triangulationType &triangulation) const
 
template<typename triangulationType >
int writeSeparators_3D (const unsigned char *const tetCases, const size_t *numTriangles, const unsigned long long *const scalars, const triangulationType &triangulation)
 
template<typename triangulationType >
int writeBoundaries_3D (const unsigned char *const tetCases, const size_t *numTriangles, const unsigned long long *const scalars, const triangulationType &triangulation)
 
template<typename triangulationType >
int writeBoundariesDetailed_3D (const unsigned char *const tetCases, const size_t *numTriangles, const unsigned long long *const scalars, const triangulationType &triangulation)
 
- 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

SURFACE_MODE SurfaceMode {SURFACE_MODE::SM_SEPARATORS}
 
SimplexId output_numberOfPoints_ {}
 
SimplexId output_numberOfCells_ {}
 
std::vector< float > output_points_
 
std::vector< unsigned long long > output_cells_labels_
 
std::vector< SimplexIdoutput_cells_connectivity_
 
- 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 Marching Tetra/Triangles computations.

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

Given an input scalar field with labels attached to the point data this class executes the marching tetrahedra/triangles algorithm. It has three options that either separate each label with a single separating geometry inbetween two labels, or a separating geometry enclosing each label (detailed and fast mode).

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
ttkMarchingTetrahedra.cpp for a usage example.

Online examples:

Definition at line 130 of file MarchingTetrahedra.h.

Member Enumeration Documentation

◆ SURFACE_MODE

Type of 2-separatrix output.

Enumerator
SM_SEPARATORS 
SM_BOUNDARIES 
SM_BOUNDARIES_DETAILED 

Definition at line 135 of file MarchingTetrahedra.h.

Constructor & Destructor Documentation

◆ MarchingTetrahedra()

ttk::MarchingTetrahedra::MarchingTetrahedra ( )

Definition at line 3 of file MarchingTetrahedra.cpp.

Member Function Documentation

◆ computeMarchingCases_2D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::computeMarchingCases_2D ( unsigned char *const  tetCases,
size_t *const  numEdges,
const unsigned long long *const  scalars,
const size_t *const  triangleCounter,
const triangulationType &  triangulation 
) const

Computes a binary code for each tetrahedron and counts the number of triangles generated, depending on the triangleCounter used.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[out]tetCasesBinary codes
[out]numEdgesNumber of triangles generated per thread
[in]scalarsScalars
[in]triangleCounterTable with binary code to number of triangles
[in]triangulationTriangulation
Returns
int

Definition at line 385 of file MarchingTetrahedra.h.

◆ computeMarchingCases_3D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::computeMarchingCases_3D ( unsigned char *const  tetCases,
size_t *const  numTriangles,
const unsigned long long *const  scalars,
const size_t *const  triangleCounter,
const triangulationType &  triangulation 
) const

Computes a binary code for each tetrahedron and counts the number of triangles generated, depending on the triangleCounter used.

Template Parameters
triangulationTypeTriangulation
Parameters
[out]tetCasesBinary codes
[out]numTrianglesNumber of triangles generated per thread
[in]scalarsScalars
[in]triangleCounterTable with binary code to number of triangles
[in]triangulationTriangulation
Returns
int

Definition at line 922 of file MarchingTetrahedra.h.

◆ execute()

template<typename dataType , typename triangulationType >
int ttk::MarchingTetrahedra::execute ( const dataType *const  scalars,
const triangulationType &  triangulation 
)
inline

Main function for the Marching tetrahedra computation.

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

Definition at line 307 of file MarchingTetrahedra.h.

◆ writeBoundaries_2D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::writeBoundaries_2D ( const unsigned char *const  tetCases,
const size_t *  numEdges,
const unsigned long long *const  scalars,
const triangulationType &  triangulation 
)

Writes the geometry of all Triangles to the ouputVariables set by setOutput. 2D basin boundaries.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[in]tetCasesBinary codes
[in]numEdgesNumber of edges generated per thread
[in]scalarsScalars
[in]triangulationTriangulation
Returns
int

Definition at line 603 of file MarchingTetrahedra.h.

◆ writeBoundaries_3D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::writeBoundaries_3D ( const unsigned char *const  tetCases,
const size_t *  numTriangles,
const unsigned long long *const  scalars,
const triangulationType &  triangulation 
)

Writes the geometry of all Triangles to the ouputVariables set by setOutput. 3D basin boundaries.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[in]tetCasesBinary codes
[in]numTrianglesNumber of triangles generated per thread
[in]scalarsScalars
[in]triangulationTriangulation
Returns
int

Definition at line 1301 of file MarchingTetrahedra.h.

◆ writeBoundariesDetailed_2D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::writeBoundariesDetailed_2D ( const unsigned char *const  tetCases,
const size_t *  numEdges,
const unsigned long long *const  scalars,
const triangulationType &  triangulation 
)

Writes the geometry of all Triangles to the ouputVariables set by setOutput. 2D detailed basin boundaries.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[in]tetCasesBinary codes
[in]numEdgesNumber of edges generated per thread
[in]scalarsScalars
[in]triangulationTriangulation
Returns
int

Definition at line 710 of file MarchingTetrahedra.h.

◆ writeBoundariesDetailed_3D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::writeBoundariesDetailed_3D ( const unsigned char *const  tetCases,
const size_t *  numTriangles,
const unsigned long long *const  scalars,
const triangulationType &  triangulation 
)

Writes the geometry of all Triangles to the ouputVariables set by setOutput. 3D detailed basin boundaries.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[in]tetCasesBinary codes
[in]numTrianglesNumber of triangles generated per thread
[in]scalarsScalars
[in]triangulationTriangulation
Returns
int

Definition at line 1418 of file MarchingTetrahedra.h.

◆ writeSeparators_2D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::writeSeparators_2D ( const unsigned char *const  tetCases,
const size_t *  numEdges,
const unsigned long long *const  scalars,
const triangulationType &  triangulation 
)

Writes the geometry of all Triangles to the ouputVariables set by setOutput. 2D basin separators.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[in]tetCasesBinary codes
[in]numEdgesNumber of edges generated per thread
[in]scalarsScalars
[in]triangulationTriangulation
Returns
int

Definition at line 443 of file MarchingTetrahedra.h.

◆ writeSeparators_3D()

template<typename triangulationType >
int ttk::MarchingTetrahedra::writeSeparators_3D ( const unsigned char *const  tetCases,
const size_t *  numTriangles,
const unsigned long long *const  scalars,
const triangulationType &  triangulation 
)

Writes the geometry of all Triangles to the ouputVariables set by setOutput. 3D basin separators.

Template Parameters
triangulationTypeTriangulationtype
Parameters
[in]tetCasesBinary codes
[in]numTrianglesNumber of triangles generated per thread
[in]scalarsScalars
[in]triangulationTriangulation
Returns
int

Definition at line 989 of file MarchingTetrahedra.h.

Member Data Documentation

◆ output_cells_connectivity_

std::vector<SimplexId> ttk::MarchingTetrahedra::output_cells_connectivity_
protected

Definition at line 302 of file MarchingTetrahedra.h.

◆ output_cells_labels_

std::vector<unsigned long long> ttk::MarchingTetrahedra::output_cells_labels_
protected

Definition at line 301 of file MarchingTetrahedra.h.

◆ output_numberOfCells_

SimplexId ttk::MarchingTetrahedra::output_numberOfCells_ {}
protected

Definition at line 299 of file MarchingTetrahedra.h.

◆ output_numberOfPoints_

SimplexId ttk::MarchingTetrahedra::output_numberOfPoints_ {}
protected

Definition at line 298 of file MarchingTetrahedra.h.

◆ output_points_

std::vector<float> ttk::MarchingTetrahedra::output_points_
protected

Definition at line 300 of file MarchingTetrahedra.h.

◆ SurfaceMode

SURFACE_MODE ttk::MarchingTetrahedra::SurfaceMode {SURFACE_MODE::SM_SEPARATORS}
protected

Definition at line 295 of file MarchingTetrahedra.h.


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