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

TTK contourAroundPoint processing package. More...

#include <ContourAroundPoint.hpp>

Inheritance diagram for ttk::ContourAroundPoint:
ttk::Debug ttk::BaseClass ttkContourAroundPoint

Public Member Functions

 ContourAroundPoint ()
 
 ~ContourAroundPoint () override=default
 
template<class triangulationType = AbstractTriangulation>
int setInputField (triangulationType *triangulation, void *scalars, double sizeFilter, double radius=0.)
 
int setInputPoints (float *coords, float *scalars, float *isovals, int *flags, std::size_t np)
 
template<class scalarT >
int execute () const
 
template<class Triang >
int setInputField (Triang *triangulation, void *scalars, double sizeFilter, double radius)
 
template<class Triang >
ttk::SimplexId findInpFldVert (SimplexId p) 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)
 

Protected Member Functions

template<class triangulationType = AbstractTriangulation>
SimplexId findInpFldVert (SimplexId p) const
 
template<class triangulationType = AbstractTriangulation>
float compDist2 (SimplexId v, SimplexId p) const
 
template<typename scalarT , class triangulationType = AbstractTriangulation>
void handleOneInpPt (SimplexId vBeg, float isoval, int flag, float scalar) const
 
template<typename scalarT , class triangulationType = AbstractTriangulation>
void extendOutFld (const std::set< SimplexId > &inpEdges, float isoval, int flag) const
 
template<typename scalarT , class triangulationType = AbstractTriangulation>
void extendOutPts (const std::vector< SimplexId > &vertices, float isoval, int flag, float scalar) const
 
template<class triangulationType = AbstractTriangulation>
double compRadius ()
 Set and return _radius.
 
- 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 Member Functions

template<class PointIterable , class WeightIterable >
static std::array< double, std::tuple_size< typename PointIterable::value_type >::value > average (const PointIterable &pts, const WeightIterable &ws)
 

Protected Attributes

double _radius = 0.
 
void * _inpFldTriang = nullptr
 
void * _inpFldScalars = nullptr
 
SimplexId _inpDimMax = 0
 
std::size_t _sizeMin = 0
 
float * _inpPtsCoords = nullptr
 
float * _inpPtsScalars = nullptr
 
float * _inpPtsIsovals = nullptr
 
int * _inpPtsFlags = nullptr
 
std::size_t _inpPtsNum = 0
 
std::vector< LongSimplexId_outContoursCinfos
 
SimplexId _outContoursNc = 0
 
std::vector< float > _outContoursCoords
 
std::vector< float > _outContoursScalars
 
std::vector< int > _outContoursFlags
 
std::vector< float > _outCentroidsCoords
 
std::vector< float > _outCentroidsScalars
 
std::vector< int > _outCentroidsFlags
 
- 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 contourAroundPoint processing package.

Author
Christopher Kappe kappe.nosp@m.@cs..nosp@m.uni-k.nosp@m.l.de
Date
January 25, 2019

ContourAroundPoint is a TTK processing package that takes a scalar field on the input and produces a scalar field on the output.

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

Definition at line 26 of file ContourAroundPoint.hpp.

Constructor & Destructor Documentation

◆ ContourAroundPoint()

ttk::ContourAroundPoint::ContourAroundPoint ( )
inline

Definition at line 29 of file ContourAroundPoint.hpp.

◆ ~ContourAroundPoint()

ttk::ContourAroundPoint::~ContourAroundPoint ( )
overridedefault

Member Function Documentation

◆ average()

template<class PointIterable , class WeightIterable >
std::array< double, std::tuple_size< typename PointIterable::value_type >::value > ttk::ContourAroundPoint::average ( const PointIterable &  pts,
const WeightIterable &  ws 
)
staticprotected

PointIterable and WeightIterable must provide random access. PointIterable must contain sth. like a tuple, pair or array.

Definition at line 600 of file ContourAroundPoint.hpp.

◆ compDist2()

template<class Triang >
float ttk::ContourAroundPoint::compDist2 ( SimplexId  v,
SimplexId  p 
) const
protected

Compute the squared distance between input field vertex v and input point p.

Definition at line 270 of file ContourAroundPoint.hpp.

◆ compRadius()

template<class triangulationType = AbstractTriangulation>
double ttk::ContourAroundPoint::compRadius ( )
inlineprotected

Set and return _radius.

Definition at line 123 of file ContourAroundPoint.hpp.

◆ execute()

template<class scalarT >
int ttk::ContourAroundPoint::execute ( ) const

Execute the package.

Precondition
setupDomain.
Returns
0 upon success, negative values otherwise.

Definition at line 224 of file ContourAroundPoint.hpp.

◆ extendOutFld()

template<typename scalarT , class Triang >
void ttk::ContourAroundPoint::extendOutFld ( const std::set< SimplexId > &  inpEdges,
float  isoval,
int  flag 
) const
protected

Extract the contour from the input edges that intersect it. inpEdges may be empty.

Definition at line 363 of file ContourAroundPoint.hpp.

◆ extendOutPts()

template<typename scalarT , class Triang >
void ttk::ContourAroundPoint::extendOutPts ( const std::vector< SimplexId > &  vertices,
float  isoval,
int  flag,
float  scalar 
) const
protected

Compute one point based on the vertices within one contoured region. vertices must contain at least one vertex.

Definition at line 451 of file ContourAroundPoint.hpp.

◆ findInpFldVert() [1/2]

template<class triangulationType = AbstractTriangulation>
SimplexId ttk::ContourAroundPoint::findInpFldVert ( SimplexId  p) const
protected

Given one of the input points, find the nearest vertex in the input field. N.B.: Typically, the points are actually vertices of the input field.

◆ findInpFldVert() [2/2]

template<class Triang >
ttk::SimplexId ttk::ContourAroundPoint::findInpFldVert ( SimplexId  p) const

Definition at line 282 of file ContourAroundPoint.hpp.

◆ handleOneInpPt()

template<typename scalarT , class Triang >
void ttk::ContourAroundPoint::handleOneInpPt ( SimplexId  vBeg,
float  isoval,
int  flag,
float  scalar 
) const
protected

Definition at line 300 of file ContourAroundPoint.hpp.

◆ setInputField() [1/2]

template<class Triang >
int ttk::ContourAroundPoint::setInputField ( Triang *  triangulation,
void *  scalars,
double  sizeFilter,
double  radius 
)

Definition at line 182 of file ContourAroundPoint.hpp.

◆ setInputField() [2/2]

template<class triangulationType = AbstractTriangulation>
int ttk::ContourAroundPoint::setInputField ( triangulationType *  triangulation,
void *  scalars,
double  sizeFilter,
double  radius = 0. 
)

Setup a (valid) triangulation object for this TTK base object.

Precondition
This function should be called prior to any usage of this TTK object, in a clearly distinct pre-processing step that involves no traversal or computation at all. An error will be returned otherwise.
Note
It is recommended to exclude this pre-processing function from any time performance measurement. Therefore, it is recommended to call this function ONLY in the pre-processing steps of your program. Note however, that your triangulation object must be valid when calling this function (i.e. you should have filled it at this point, see the setInput*() functions of ttk::Triangulation). See ttkContourAroundPoint for further examples.
Parameters
triangulationPointer to a valid triangulation.
scalarsScalar for each vertex.
sizeFilter0 --> all pass, 10000 none pass.
radiusIf all vertices lie on a sphere and the output is supposed to do so as well, pass the radius of the sphere here or -1 to have it computed. The default 0 signals that the data is not spherical.
Returns
0 upon success, negative values otherwise.
See also
ttk::Triangulation

◆ setInputPoints()

int ttk::ContourAroundPoint::setInputPoints ( float *  coords,
float *  scalars,
float *  isovals,
int *  flags,
std::size_t  np 
)

Input the point data (e.g. from the wrapped algorithm).

Parameters
coords3D point coordinates in an interleaved array.
scalarsScalar value for each point.
isovalsIsovalue corresponding to each point.
flagsisMax-flag for each point.
npNumber of points.
Returns
0 upon success, negative values otherwise.

Definition at line 5 of file ContourAroundPoint.cpp.

Member Data Documentation

◆ _inpDimMax

SimplexId ttk::ContourAroundPoint::_inpDimMax = 0
protected

Definition at line 144 of file ContourAroundPoint.hpp.

◆ _inpFldScalars

void* ttk::ContourAroundPoint::_inpFldScalars = nullptr
protected

Definition at line 141 of file ContourAroundPoint.hpp.

◆ _inpFldTriang

void* ttk::ContourAroundPoint::_inpFldTriang = nullptr
protected

Definition at line 140 of file ContourAroundPoint.hpp.

◆ _inpPtsCoords

float* ttk::ContourAroundPoint::_inpPtsCoords = nullptr
protected

Definition at line 149 of file ContourAroundPoint.hpp.

◆ _inpPtsFlags

int* ttk::ContourAroundPoint::_inpPtsFlags = nullptr
protected

Definition at line 154 of file ContourAroundPoint.hpp.

◆ _inpPtsIsovals

float* ttk::ContourAroundPoint::_inpPtsIsovals = nullptr
protected

Definition at line 151 of file ContourAroundPoint.hpp.

◆ _inpPtsNum

std::size_t ttk::ContourAroundPoint::_inpPtsNum = 0
protected

Definition at line 155 of file ContourAroundPoint.hpp.

◆ _inpPtsScalars

float* ttk::ContourAroundPoint::_inpPtsScalars = nullptr
protected

Definition at line 150 of file ContourAroundPoint.hpp.

◆ _outCentroidsCoords

std::vector<float> ttk::ContourAroundPoint::_outCentroidsCoords
mutableprotected

Definition at line 165 of file ContourAroundPoint.hpp.

◆ _outCentroidsFlags

std::vector<int> ttk::ContourAroundPoint::_outCentroidsFlags
mutableprotected

Definition at line 167 of file ContourAroundPoint.hpp.

◆ _outCentroidsScalars

std::vector<float> ttk::ContourAroundPoint::_outCentroidsScalars
mutableprotected

Definition at line 166 of file ContourAroundPoint.hpp.

◆ _outContoursCinfos

std::vector<LongSimplexId> ttk::ContourAroundPoint::_outContoursCinfos
mutableprotected

Definition at line 159 of file ContourAroundPoint.hpp.

◆ _outContoursCoords

std::vector<float> ttk::ContourAroundPoint::_outContoursCoords
mutableprotected

Definition at line 161 of file ContourAroundPoint.hpp.

◆ _outContoursFlags

std::vector<int> ttk::ContourAroundPoint::_outContoursFlags
mutableprotected

Definition at line 163 of file ContourAroundPoint.hpp.

◆ _outContoursNc

SimplexId ttk::ContourAroundPoint::_outContoursNc = 0
mutableprotected

Definition at line 160 of file ContourAroundPoint.hpp.

◆ _outContoursScalars

std::vector<float> ttk::ContourAroundPoint::_outContoursScalars
mutableprotected

Definition at line 162 of file ContourAroundPoint.hpp.

◆ _radius

double ttk::ContourAroundPoint::_radius = 0.
protected

If greater than 0, means the coordinates are supposed to lie on a sphere with fixed radius.

Definition at line 136 of file ContourAroundPoint.hpp.

◆ _sizeMin

std::size_t ttk::ContourAroundPoint::_sizeMin = 0
protected

Definition at line 147 of file ContourAroundPoint.hpp.


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