MeshLib C++ Docs
Loading...
Searching...
No Matches

this class is responsible for iterative construction of distance map along the surface More...

#include <MRMesh/MRSurfaceDistanceBuilder.h>

Public Member Functions

 SurfaceDistanceBuilder (const Mesh &mesh, const VertBitSet *region)
 SurfaceDistanceBuilder (const Mesh &mesh, const Vector3f &target, const VertBitSet *region)
void addStartRegion (const VertBitSet &region, float startDistance)
void addStartVertices (const HashMap< VertId, float > &startVertices)
void addStartEdgesAndPoints (const UndirectedEdgeBitSet &startEdges, const VertBitSet &startPoints, float startDistance)
void addStart (const MeshTriPoint &start)
void setMaxVertUpdates (int v)
void setNoLocalMinima (bool on)
VertId growOne ()
 processes one more candidate vertex, which is returned
VertScalars takeDistanceMap ()
 takes ownership over constructed distance map
bool done () const
 returns true if further growth is impossible
float doneDistance () const
 returns path length till the next candidate vertex or maximum float value if all vertices have been reached

Detailed Description

this class is responsible for iterative construction of distance map along the surface

Constructor & Destructor Documentation

◆ SurfaceDistanceBuilder() [1/2]

MR::SurfaceDistanceBuilder::SurfaceDistanceBuilder ( const Mesh & mesh,
const VertBitSet * region )

◆ SurfaceDistanceBuilder() [2/2]

MR::SurfaceDistanceBuilder::SurfaceDistanceBuilder ( const Mesh & mesh,
const Vector3f & target,
const VertBitSet * region )
inline

Member Function Documentation

◆ addStart()

void MR::SurfaceDistanceBuilder::addStart ( const MeshTriPoint & start)

initiates distance construction from triangle vertices surrounding given start point (they all will be returned by growOne); the distances are from this point, each call adds a separate point

◆ addStartEdgesAndPoints()

void MR::SurfaceDistanceBuilder::addStartEdgesAndPoints ( const UndirectedEdgeBitSet & startEdges,
const VertBitSet & startPoints,
float startDistance )

initiates distance construction from given start edges and start points with known start distance in all of them (their vertices will NOT be returned by growOne); the start edges connected by vertices make lines or regions; each start point is a point never united with other starts, even if it is one edge away from them, unless it is an end of a start edge

◆ addStartRegion()

void MR::SurfaceDistanceBuilder::addStartRegion ( const VertBitSet & region,
float startDistance )

initiates distance construction from given vertices with known start distance in all of them (region vertices will NOT be returned by growOne); the vertices connected by mesh edges make lines or regions, each isolated vertex is a point

◆ addStartVertices()

void MR::SurfaceDistanceBuilder::addStartVertices ( const HashMap< VertId, float > & startVertices)

initiates distance construction from given start vertices with values in them (these vertices will NOT be returned by growOne if values in them are not decreased); the vertices connected by mesh edges make lines or regions (a line with different values is handled as a region), each isolated vertex is a point

◆ done()

bool MR::SurfaceDistanceBuilder::done ( ) const
inline

returns true if further growth is impossible

◆ doneDistance()

float MR::SurfaceDistanceBuilder::doneDistance ( ) const
inline

returns path length till the next candidate vertex or maximum float value if all vertices have been reached

◆ growOne()

VertId MR::SurfaceDistanceBuilder::growOne ( )

processes one more candidate vertex, which is returned

◆ setMaxVertUpdates()

void MR::SurfaceDistanceBuilder::setMaxVertUpdates ( int v)

the maximum amount of times vertex distance can be updated in [1,255], 3 by default; the more the better obtuse triangles are handled

◆ setNoLocalMinima()

void MR::SurfaceDistanceBuilder::setNoLocalMinima ( bool on)
inline

if true, then a distance computed in a triangle is always larger than the smaller distance in its other two vertices, so every reached vertex except the vertices around the start has a neighbor with smaller distance, and the steepest descent from any reached point arrives to the start; distances near the start and near obtuse or thin triangles become larger, and some distances computed from them can become a bit smaller

◆ takeDistanceMap()

VertScalars MR::SurfaceDistanceBuilder::takeDistanceMap ( )
inline

takes ownership over constructed distance map


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