MeshLib C++ Docs
Loading...
Searching...
No Matches
MRPointsToMeshProjector.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRAffineXf3.h"
5#include <cfloat>
6#include <string>
7
8namespace MR
9{
10
13{
14public:
15 virtual ~IPointsToMeshProjector() = default;
17 virtual void updateMeshData( const Mesh* mesh ) = 0;
19 virtual void findProjections( std::vector<MeshProjectionResult>& result, const std::vector<Vector3f>& points,
20 const AffineXf3f* worldXf = nullptr, const AffineXf3f* worldRefXf = nullptr,
21 float upDistLimitSq = FLT_MAX, float loDistLimitSq = 0.0f ) = 0;
22
24 virtual size_t projectionsHeapBytes( size_t numProjections ) const = 0;
25};
26
28{
31 float loDistLimitSq = 0;
32
35 float upDistLimitSq = FLT_MAX;
36
38 const AffineXf3f* refXf = nullptr;
39
41 const AffineXf3f* xf = nullptr;
42};
43
47[[nodiscard]] MRMESH_API VertScalars findSignedDistances(
48 const Mesh& refMesh,
49 const VertCoords & testPoints, const VertBitSet * validTestPoints = {},
50 const MeshProjectionParameters & params = {},
51 IPointsToMeshProjector * projector = {} );
52
56[[nodiscard]] MRMESH_API VertScalars findSignedDistances(
57 const Mesh& refMesh,
58 const Mesh& mesh,
59 const MeshProjectionParameters & params = {},
60 IPointsToMeshProjector * projector = {} );
61
64{
65 const Mesh* mesh_{ nullptr };
66public:
68 MRMESH_API virtual void updateMeshData( const Mesh* mesh ) override;
78 MRMESH_API virtual void findProjections( std::vector<MeshProjectionResult>& result, const std::vector<Vector3f>& points,
79 const AffineXf3f* objXf, const AffineXf3f* refObjXf,
80 float upDistLimitSq, float loDistLimitSq ) override;
81
83 MRMESH_API virtual size_t projectionsHeapBytes( size_t numProjections ) const override;
84};
85
86}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:83
Abstract class, computes the closest point on mesh to each of given points. Pure virtual functions mu...
Definition MRPointsToMeshProjector.h:13
virtual size_t projectionsHeapBytes(size_t numProjections) const =0
Returns amount of memory needed to compute projections.
virtual void updateMeshData(const Mesh *mesh)=0
Updates all data related to the referencing mesh.
virtual ~IPointsToMeshProjector()=default
virtual void findProjections(std::vector< MeshProjectionResult > &result, const std::vector< Vector3f > &points, const AffineXf3f *worldXf=nullptr, const AffineXf3f *worldRefXf=nullptr, float upDistLimitSq=FLT_MAX, float loDistLimitSq=0.0f)=0
Computes the closest point on mesh to each of given points.
Computes the closest point on mesh to each of given points on CPU.
Definition MRPointsToMeshProjector.h:64
virtual MRMESH_API size_t projectionsHeapBytes(size_t numProjections) const override
Returns amount of additional memory needed to compute projections.
virtual MRMESH_API void findProjections(std::vector< MeshProjectionResult > &result, const std::vector< Vector3f > &points, const AffineXf3f *objXf, const AffineXf3f *refObjXf, float upDistLimitSq, float loDistLimitSq) override
Computes the closest point on mesh to each of given points.
virtual MRMESH_API void updateMeshData(const Mesh *mesh) override
update all data related to the referencing mesh
MRMESH_API VertScalars findSignedDistances(const Mesh &refMesh, const VertCoords &testPoints, const VertBitSet *validTestPoints={}, const MeshProjectionParameters &params={}, IPointsToMeshProjector *projector={})
if projector is not given then CPU's computations will be used
Definition MRPointsToMeshProjector.h:28
float loDistLimitSq
Definition MRPointsToMeshProjector.h:31
const AffineXf3f * refXf
optional reference mesh to world transformation
Definition MRPointsToMeshProjector.h:38
const AffineXf3f * xf
optional test points to world transformation
Definition MRPointsToMeshProjector.h:41
float upDistLimitSq
Definition MRPointsToMeshProjector.h:35
Definition MRMesh/MRMesh.h:23