59 bool done()
const {
return nextVerts_.empty(); }
61 float doneDistance()
const {
return nextVerts_.empty() ? FLT_MAX : nextVerts_.top().distance; }
65 const VertBitSet* region_{
nullptr};
66 VertScalars vertDistanceMap_;
67 Vector<char,VertId> vertUpdatedTimes_;
68 std::priority_queue<VertDistance> nextVerts_;
69 std::optional<Vector3f> target_;
70 int maxVertUpdates_ = 3;
75 bool suggestVertDistance_( VertDistance c );
77 void suggestDistancesAround_( VertId v );
79 void considerLeftTriPath_( EdgeId e );
81 float metricToPenalty_(
float metric, VertId v )
const;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
this class is responsible for iterative construction of distance map along the surface
Definition MRSurfaceDistanceBuilder.h:36
MRMESH_API void addStartRegion(const VertBitSet ®ion, float startDistance)
initiates distance construction from given vertices with known start distance in all of them (region ...
MRMESH_API VertId growOne()
processes one more candidate vertex, which is returned
MRMESH_API void addStart(const MeshTriPoint &start)
initiates distance construction from triangle vertices surrounding given start point (they all will b...
MRMESH_API void addStartVertices(const HashMap< VertId, float > &startVertices)
initiates distance construction from given start vertices with values in them (these vertices will NO...
float doneDistance() const
returns path length till the next candidate vertex or maximum float value if all vertices have been r...
Definition MRSurfaceDistanceBuilder.h:61
MRMESH_API void setMaxVertUpdates(int v)
VertScalars takeDistanceMap()
takes ownership over constructed distance map
Definition MRSurfaceDistanceBuilder.h:55
bool done() const
returns true if further growth is impossible
Definition MRSurfaceDistanceBuilder.h:59
SurfaceDistanceBuilder(const Mesh &mesh, const Vector3f &target, const VertBitSet *region)
Definition MRSurfaceDistanceBuilder.h:39
MRMESH_API SurfaceDistanceBuilder(const Mesh &mesh, const VertBitSet *region)
bool operator<(const VertDistance &a, const VertDistance &b)
smaller distance to be the first
Definition MRSurfaceDistanceBuilder.h:29
Definition MRCameraOrientationPlugin.h:8
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMesh/MRMeshFwd.h:460
Definition MRMesh/MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRSurfaceDistanceBuilder.h:18
float distance
best known distance to reach this vertex
Definition MRSurfaceDistanceBuilder.h:22
VertDistance(VertId v, float d)
Definition MRSurfaceDistanceBuilder.h:25
VertId vert
vertex in question
Definition MRSurfaceDistanceBuilder.h:20