TTK
|
TTK discreteGradient processing package. More...
#include <DiscreteGradient.h>
Public Member Functions | |
DiscreteGradient () | |
template<typename triangulationType > | |
int | buildGradient (const triangulationType &triangulation, bool bypassCache=false, const std::vector< bool > *updateMask=nullptr) |
void | setInputScalarField (const void *const data, const size_t mTime) |
void | preconditionTriangulation (AbstractTriangulation *const data) |
void | setLocalGradient () |
Use local storage instead of cache. | |
void | setInputOffsets (const SimplexId *const data) |
int | getDimensionality () const |
int | getNumberOfDimensions () const |
template<typename triangulationType > | |
SimplexId | getNumberOfCells (const int dimension, const triangulationType &triangulation) const |
template<typename triangulationType > | |
bool | isBoundary (const Cell &cell, const triangulationType &triangulation) const |
bool | isCellCritical (const int cellDim, const SimplexId cellId) const |
bool | isCellCritical (const Cell &cell) const |
template<typename triangulationType > | |
SimplexId | getPairedCell (const Cell &cell, const triangulationType &triangulation, bool isReverse=false) const |
template<typename triangulationType > | |
int | getAscendingPath (const Cell &cell, std::vector< Cell > &vpath, const triangulationType &triangulation, const bool enableCycleDetector=false) const |
template<typename triangulationType > | |
int | getDescendingPath (const Cell &cell, std::vector< Cell > &vpath, const triangulationType &triangulation) const |
template<typename triangulationType > | |
bool | getDescendingPathThroughWall (const Cell &saddle2, const Cell &saddle1, const std::vector< bool > &isVisited, std::vector< Cell > *const vpath, const triangulationType &triangulation, const bool stopIfMultiConnected=false, const bool enableCycleDetector=false) const |
template<typename triangulationType > | |
bool | getAscendingPathThroughWall (const Cell &saddle1, const Cell &saddle2, const std::vector< bool > &isVisited, std::vector< Cell > *const vpath, const triangulationType &triangulation, const bool stopIfMultiConnected=false, const bool enableCycleDetector=false, bool *const cycleFound=nullptr) const |
template<typename triangulationType > | |
bool | detectGradientCycle (const Cell &cell, const triangulationType &triangulation) const |
template<typename triangulationType > | |
int | getDescendingWall (const Cell &cell, VisitedMask &mask, const triangulationType &triangulation, std::vector< Cell > *const wall=nullptr, std::vector< SimplexId > *const saddles=nullptr) const |
template<typename triangulationType > | |
int | getAscendingWall (const Cell &cell, VisitedMask &mask, const triangulationType &triangulation, std::vector< Cell > *const wall=nullptr, std::vector< SimplexId > *const saddles=nullptr) const |
template<typename triangulationType > | |
SimplexId | getCellGreaterVertex (const Cell c, const triangulationType &triangulation) const |
template<typename triangulationType > | |
SimplexId | getCellLowerVertex (const Cell c, const triangulationType &triangulation) const |
template<typename triangulationType > | |
int | setCriticalPoints (const std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, std::vector< std::array< float, 3 > > &points, std::vector< char > &cellDimensions, std::vector< SimplexId > &cellIds, std::vector< char > &isOnBoundary, std::vector< SimplexId > &PLVertexIdentifiers, const triangulationType &triangulation) const |
template<typename triangulationType > | |
int | setCriticalPoints (std::vector< std::array< float, 3 > > &points, std::vector< char > &cellDimensions, std::vector< SimplexId > &cellIds, std::vector< char > &isOnBoundary, std::vector< SimplexId > &PLVertexIdentifiers, const triangulationType &triangulation) const |
template<typename triangulationType > | |
int | getCriticalPoints (std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, const triangulationType &triangulation) const |
int | setManifoldSize (const std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, const SimplexId *const ascendingManifold, const SimplexId *const descendingManifold, std::vector< SimplexId > &manifoldSize) const |
template<typename triangulationType > | |
int | setGradientGlyphs (std::vector< std::array< float, 3 > > &points, std::vector< char > &points_pairOrigins, std::vector< char > &cells_pairTypes, std::vector< SimplexId > &cellsIds, std::vector< char > &cellsDimensions, const triangulationType &triangulation) const |
template<typename dataType , typename triangulationType > | |
dataType | getPersistence (const Cell &up, const Cell &down, const dataType *const scalars, const triangulationType &triangulation) const |
bool | isMinimum (const Cell &cell) const |
bool | isSaddle1 (const Cell &cell) const |
bool | isSaddle2 (const Cell &cell) const |
bool | isMaximum (const Cell &cell) const |
template<typename triangulationType > | |
int | reverseAscendingPath (const std::vector< Cell > &vpath, const triangulationType &triangulation) const |
template<typename triangulationType > | |
int | reverseDescendingPath (const std::vector< Cell > &vpath, const triangulationType &triangulation) const |
template<typename triangulationType > | |
int | reverseAscendingPathOnWall (const std::vector< Cell > &vpath, const triangulationType &triangulation, bool cancelReversal=false) const |
template<typename triangulationType > | |
int | reverseDescendingPathOnWall (const std::vector< Cell > &vpath, const triangulationType &triangulation) const |
template<typename triangulationType > | |
ttk::SimplexId | getCellGreaterVertex (const Cell c, const triangulationType &triangulation) const |
template<typename triangulationType > | |
ttk::SimplexId | getCellLowerVertex (const Cell c, const triangulationType &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) |
Static Public Member Functions | |
static void | clearCache (const AbstractTriangulation &triangulation) |
Protected Attributes | |
int | dimensionality_ {-1} |
SimplexId | numberOfVertices_ {} |
AbstractTriangulation::gradientType | localGradient_ {} |
AbstractTriangulation::gradientKeyType | inputScalarField_ {} |
AbstractTriangulation::gradientType * | gradient_ {} |
const SimplexId * | inputOffsets_ {} |
Protected Attributes inherited from ttk::Debug | |
int | debugLevel_ |
std::string | debugMsgPrefix_ |
std::string | debugMsgNamePrefix_ |
Protected Attributes inherited from ttk::BaseClass | |
bool | lastObject_ |
int | threadNumber_ |
Wrapper * | wrapper_ |
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 |
TTK discreteGradient processing package.
Compute and manage a discrete gradient of a function on a triangulation. TTK assumes that the input dataset is made of only one connected component.
DiscreteGradient is a TTK processing package that handles discrete gradient (in the sense of Discrete Morse Theory).
DiscreteGradient is a TTK processing package that handles discrete gradient (in the sense of Discrete Morse Theory).
Definition at line 88 of file DiscreteGradient.h.
|
inline |
Definition at line 91 of file DiscreteGradient.h.
int DiscreteGradient::buildGradient | ( | const triangulationType & | triangulation, |
bool | bypassCache = false , |
||
const std::vector< bool > * | updateMask = nullptr |
||
) |
Compute the initial gradient field of the input scalar function on the
triangulation.
Definition at line 36 of file DiscreteGradient_Template.h.
|
inlinestatic |
Definition at line 151 of file DiscreteGradient.h.
bool DiscreteGradient::detectGradientCycle | ( | const Cell & | cell, |
const triangulationType & | triangulation | ||
) | const |
Detect the presence of a cycle on a edge-triangle path starting from an edge.
Definition at line 1546 of file DiscreteGradient_Template.h.
int DiscreteGradient::getAscendingPath | ( | const Cell & | cell, |
std::vector< Cell > & | vpath, | ||
const triangulationType & | triangulation, | ||
const bool | enableCycleDetector = false |
||
) | const |
Return the VPath coming from the given cell.
Definition at line 1308 of file DiscreteGradient_Template.h.
bool DiscreteGradient::getAscendingPathThroughWall | ( | const Cell & | saddle1, |
const Cell & | saddle2, | ||
const std::vector< bool > & | isVisited, | ||
std::vector< Cell > *const | vpath, | ||
const triangulationType & | triangulation, | ||
const bool | stopIfMultiConnected = false , |
||
const bool | enableCycleDetector = false , |
||
bool *const | cycleFound = nullptr |
||
) | const |
Return the VPath coming from the given 1-saddle restricted to the
2-separatrice of the 2-saddle.
Definition at line 1427 of file DiscreteGradient_Template.h.
int DiscreteGradient::getAscendingWall | ( | const Cell & | cell, |
VisitedMask & | mask, | ||
const triangulationType & | triangulation, | ||
std::vector< Cell > *const | wall = nullptr , |
||
std::vector< SimplexId > *const | saddles = nullptr |
||
) | const |
Return the 2-separatrice coming from the given 1-saddle.
Definition at line 1650 of file DiscreteGradient_Template.h.
SimplexId ttk::dcg::DiscreteGradient::getCellGreaterVertex | ( | const Cell | c, |
const triangulationType & | triangulation | ||
) | const |
Get the vertex id of with the maximum scalar field value on the given cell.
ttk::SimplexId ttk::dcg::DiscreteGradient::getCellGreaterVertex | ( | const Cell | c, |
const triangulationType & | triangulation | ||
) | const |
Definition at line 1916 of file DiscreteGradient_Template.h.
SimplexId ttk::dcg::DiscreteGradient::getCellLowerVertex | ( | const Cell | c, |
const triangulationType & | triangulation | ||
) | const |
Get the vertex id of with the minimum scalar field value on the given cell.
ttk::SimplexId ttk::dcg::DiscreteGradient::getCellLowerVertex | ( | const Cell | c, |
const triangulationType & | triangulation | ||
) | const |
Definition at line 1979 of file DiscreteGradient_Template.h.
int DiscreteGradient::getCriticalPoints | ( | std::array< std::vector< SimplexId >, 4 > & | criticalCellsByDim, |
const triangulationType & | triangulation | ||
) | const |
Get the output critical points as a STL vector of cells.
Definition at line 175 of file DiscreteGradient_Template.h.
int DiscreteGradient::getDescendingPath | ( | const Cell & | cell, |
std::vector< Cell > & | vpath, | ||
const triangulationType & | triangulation | ||
) | const |
Return the VPath terminating at the given cell.
Definition at line 1154 of file DiscreteGradient_Template.h.
bool DiscreteGradient::getDescendingPathThroughWall | ( | const Cell & | saddle2, |
const Cell & | saddle1, | ||
const std::vector< bool > & | isVisited, | ||
std::vector< Cell > *const | vpath, | ||
const triangulationType & | triangulation, | ||
const bool | stopIfMultiConnected = false , |
||
const bool | enableCycleDetector = false |
||
) | const |
Return the VPath terminating at the given 2-saddle restricted to the
2-separatrice of the 1-saddle.
Definition at line 1202 of file DiscreteGradient_Template.h.
int DiscreteGradient::getDescendingWall | ( | const Cell & | cell, |
VisitedMask & | mask, | ||
const triangulationType & | triangulation, | ||
std::vector< Cell > *const | wall = nullptr , |
||
std::vector< SimplexId > *const | saddles = nullptr |
||
) | const |
Return the 2-separatrice terminating at the given 2-saddle.
Definition at line 1587 of file DiscreteGradient_Template.h.
int DiscreteGradient::getDimensionality | ( | ) | const |
Get the dimensionality of the triangulation.
Definition at line 7 of file DiscreteGradient.cpp.
SimplexId DiscreteGradient::getNumberOfCells | ( | const int | dimension, |
const triangulationType & | triangulation | ||
) | const |
Get the number of cells of the given dimension.
Definition at line 216 of file DiscreteGradient_Template.h.
int DiscreteGradient::getNumberOfDimensions | ( | ) | const |
Get the number of dimensions available for the cells in the
triangulation (equal to dimensionality+1).
Definition at line 11 of file DiscreteGradient.cpp.
SimplexId DiscreteGradient::getPairedCell | ( | const Cell & | cell, |
const triangulationType & | triangulation, | ||
bool | isReverse = false |
||
) | const |
Return the identifier of the cell paired to the cell given by the user
in the gradient.
Definition at line 1060 of file DiscreteGradient_Template.h.
dataType DiscreteGradient::getPersistence | ( | const Cell & | up, |
const Cell & | down, | ||
const dataType *const | scalars, | ||
const triangulationType & | triangulation | ||
) | const |
Compute the difference of function values of a pair of cells.
Definition at line 25 of file DiscreteGradient_Template.h.
bool DiscreteGradient::isBoundary | ( | const Cell & | cell, |
const triangulationType & | triangulation | ||
) | const |
Return true if the given cell is at boundary, false otherwise.
Definition at line 1047 of file DiscreteGradient_Template.h.
bool DiscreteGradient::isCellCritical | ( | const Cell & | cell | ) | const |
Definition at line 204 of file DiscreteGradient.cpp.
bool DiscreteGradient::isCellCritical | ( | const int | cellDim, |
const SimplexId | cellId | ||
) | const |
Return true if the given cell is a critical point regarding the
discrete gradient, false otherwise.
Definition at line 174 of file DiscreteGradient.cpp.
bool DiscreteGradient::isMaximum | ( | const Cell & | cell | ) | const |
Return true if the given cell is a maximum regarding the discrete
gradient, false otherwise.
Definition at line 158 of file DiscreteGradient.cpp.
bool DiscreteGradient::isMinimum | ( | const Cell & | cell | ) | const |
Return true if the given cell is a minimum regarding the discrete
gradient, false otherwise.
Definition at line 132 of file DiscreteGradient.cpp.
bool DiscreteGradient::isSaddle1 | ( | const Cell & | cell | ) | const |
Return true if the given cell is a 1-saddle regarding the discrete
gradient, false otherwise.
Definition at line 140 of file DiscreteGradient.cpp.
bool DiscreteGradient::isSaddle2 | ( | const Cell & | cell | ) | const |
Return true if the given cell is a 2-saddle regarding the discrete
gradient, false otherwise.
Definition at line 149 of file DiscreteGradient.cpp.
|
inline |
Preprocess all the required connectivity requests on the triangulation.
Definition at line 123 of file DiscreteGradient.h.
int DiscreteGradient::reverseAscendingPath | ( | const std::vector< Cell > & | vpath, |
const triangulationType & | triangulation | ||
) | const |
Reverse the given ascending VPath.
Definition at line 1715 of file DiscreteGradient_Template.h.
int DiscreteGradient::reverseAscendingPathOnWall | ( | const std::vector< Cell > & | vpath, |
const triangulationType & | triangulation, | ||
bool | cancelReversal = false |
||
) | const |
Reverse the given ascending VPath restricted on a 2-separatrice.
Definition at line 1823 of file DiscreteGradient_Template.h.
int DiscreteGradient::reverseDescendingPath | ( | const std::vector< Cell > & | vpath, |
const triangulationType & | triangulation | ||
) | const |
Reverse the given descending VPath.
Definition at line 1784 of file DiscreteGradient_Template.h.
int DiscreteGradient::reverseDescendingPathOnWall | ( | const std::vector< Cell > & | vpath, |
const triangulationType & | triangulation | ||
) | const |
Reverse the given descending VPath restricted on a 2-separatrice.
Definition at line 1876 of file DiscreteGradient_Template.h.
int DiscreteGradient::setCriticalPoints | ( | const std::array< std::vector< SimplexId >, 4 > & | criticalCellsByDim, |
std::vector< std::array< float, 3 > > & | points, | ||
std::vector< char > & | cellDimensions, | ||
std::vector< SimplexId > & | cellIds, | ||
std::vector< char > & | isOnBoundary, | ||
std::vector< SimplexId > & | PLVertexIdentifiers, | ||
const triangulationType & | triangulation | ||
) | const |
Build the geometric embedding of the given STL vector of cells. The output vectors are modified accordingly. This function needs the following internal pointers to be set: outputCriticalPoints_numberOfPoints_ outputCriticalPoints_points_ inputScalarField_
Definition at line 100 of file DiscreteGradient_Template.h.
int DiscreteGradient::setCriticalPoints | ( | std::vector< std::array< float, 3 > > & | points, |
std::vector< char > & | cellDimensions, | ||
std::vector< SimplexId > & | cellIds, | ||
std::vector< char > & | isOnBoundary, | ||
std::vector< SimplexId > & | PLVertexIdentifiers, | ||
const triangulationType & | triangulation | ||
) | const |
Detect the critical points and build their geometric embedding. The output vectors are modified accordingly.
Definition at line 158 of file DiscreteGradient_Template.h.
int DiscreteGradient::setGradientGlyphs | ( | std::vector< std::array< float, 3 > > & | points, |
std::vector< char > & | points_pairOrigins, | ||
std::vector< char > & | cells_pairTypes, | ||
std::vector< SimplexId > & | cellsIds, | ||
std::vector< char > & | cellsDimensions, | ||
const triangulationType & | triangulation | ||
) | const |
Build the glyphs representing the discrete gradient vector field.
Definition at line 2042 of file DiscreteGradient_Template.h.
|
inline |
Set the input offset function.
data
buffer prior to any computation (the VTK wrapper already includes a mechanism to automatically generate such a preconditioned buffer). Definition at line 172 of file DiscreteGradient.h.
|
inline |
Set the input scalar function.
The first parameter is a pointer to the scalar field buffer (often provided by ttkUtils::GetVoidPointer()), the second one is a timestamp representing the last modification time of the scalar field (often provided by vtkObject::GetMTime()).
Definition at line 115 of file DiscreteGradient.h.
|
inline |
Use local storage instead of cache.
Definition at line 158 of file DiscreteGradient.h.
int DiscreteGradient::setManifoldSize | ( | const std::array< std::vector< SimplexId >, 4 > & | criticalCellsByDim, |
const SimplexId *const | ascendingManifold, | ||
const SimplexId *const | descendingManifold, | ||
std::vector< SimplexId > & | manifoldSize | ||
) | const |
Compute manifold size for critical extrema
Definition at line 208 of file DiscreteGradient.cpp.
|
protected |
Definition at line 539 of file DiscreteGradient.h.
|
protected |
Definition at line 548 of file DiscreteGradient.h.
|
protected |
Definition at line 549 of file DiscreteGradient.h.
|
protected |
Definition at line 545 of file DiscreteGradient.h.
|
protected |
Definition at line 543 of file DiscreteGradient.h.
|
protected |
Definition at line 540 of file DiscreteGradient.h.