14struct PointsProjectionResult
33 float upDistLimitSq = FLT_MAX,
35 float loDistLimitSq = 0,
36 VertPredicate skipCb = {} );
47 float upDistLimitSq = FLT_MAX,
49 float loDistLimitSq = 0,
51 VertPredicate skipCb = {} );
60 float upDistLimitSq = FLT_MAX,
62 float loDistLimitSq = 0 );
75struct FindProjectionOnPointsSettings
78 const BitSet*
valid =
nullptr;
80 const AffineXf3f*
xf =
nullptr;
95 virtual ~IPointsProjector() =
default;
98 virtual Expected<void>
setPointCloud(
const PointCloud& pointCloud ) = 0;
101 virtual Expected<void> findProjections( std::vector<PointsProjectionResult>& results,
102 const std::vector<Vector3f>& points,
const FindProjectionOnPointsSettings& settings )
const = 0;
105 virtual size_t projectionsHeapBytes(
size_t numProjections )
const = 0;
109class MRMESH_CLASS PointsProjector :
public IPointsProjector
113 MRMESH_API Expected<void> setPointCloud(
const PointCloud& pointCloud )
override;
116 MRMESH_API Expected<void> findProjections( std::vector<PointsProjectionResult>& results,
117 const std::vector<Vector3f>& points,
const FindProjectionOnPointsSettings& settings )
const override;
120 MRMESH_API virtual size_t projectionsHeapBytes(
size_t numProjections )
const override;
122 const PointCloud* pointCloud_{
nullptr };
#define MRMESH_API
Definition MRMeshFwd.h:80
#define MRMESH_CLASS
Definition MRMeshFwd.h:87
Definition MRAABBTreePoints.h:16
std::vector<V>-like container that is 1) resized without initialization of its elements,...
Definition MRBuffer.h:54
the class stores some number of smallest elements from a larger number of candidates
Definition MRFewSmallest.h:14
new unsafe ref float loDistLimitSq
new unsafe ref bool skipSameIndex
new unsafe MR.Std.Function_BoolFuncFromFloat cb
new unsafe MR.? ConstBox_AffineXf3f xf
new unsafe ref float upDistLimitSq
new unsafe MR.? Const_BitSet valid
unsafe void setPointCloud(MR.Const_PointCloud pointCloud)
Definition MRPointCloudPart.h:10
Definition MRMesh/MRPointCloud.h:17
Definition MRPointsProject.h:15
new unsafe ref float distSq
new unsafe ref MR.VertId vId
unsafe PointsProjectionResult()
MRMESH_API void findFewClosestPoints(const Vector3f &pt, const PointCloud &pc, FewSmallest< PointsProjectionResult > &res, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0)
finds a number of the closest points in the cloud (as configured in
MRMESH_API Buffer< VertId > findNClosestPointsPerPoint(const PointCloud &pc, int numNei, const ProgressCallback &progress={})
finds given number of closest points (excluding itself) to each valid point in the cloud;
MRMESH_API PointsProjectionResult findProjectionOnPoints(const Vector3f &pt, const PointCloudPart &pcp, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, VertPredicate skipCb={})
computes the closest point on point cloud to given point
MRMESH_API VertPair findTwoClosestPoints(const PointCloud &pc, const ProgressCallback &progress={})
finds two closest points (first id < second id) in whole point cloud
Definition MRCameraOrientationPlugin.h:8