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{
12
13
16{
17public:
22
23 virtual ~IPointsToMeshProjector() = default;
25 virtual void updateMeshData( const Mesh* mesh ) = 0;
27 virtual void findProjections( std::vector<MeshProjectionResult>& result, const std::vector<Vector3f>& points,
28 const AffineXf3f* worldXf = nullptr, const AffineXf3f* worldRefXf = nullptr,
29 float upDistLimitSq = FLT_MAX, float loDistLimitSq = 0.0f ) = 0;
30
32 virtual size_t projectionsHeapBytes( size_t numProjections ) const = 0;
33};
34
36{
39 float loDistLimitSq = 0;
40
43 float upDistLimitSq = FLT_MAX;
44
46 const AffineXf3f* refXf = nullptr;
47
49 const AffineXf3f* xf = nullptr;
50};
51
55[[nodiscard]] MRMESH_API VertScalars findSignedDistances(
56 const Mesh& refMesh,
57 const VertCoords & testPoints, const VertBitSet * validTestPoints = {},
58 const MeshProjectionParameters & params = {},
59 IPointsToMeshProjector * projector = {} );
60
64[[nodiscard]] MRMESH_API VertScalars findSignedDistances(
65 const Mesh& refMesh,
66 const Mesh& mesh,
67 const MeshProjectionParameters & params = {},
68 IPointsToMeshProjector * projector = {} );
69
72{
73 const Mesh* mesh_{ nullptr };
74public:
76 MRMESH_API virtual void updateMeshData( const Mesh* mesh ) override;
86 MRMESH_API virtual void findProjections( std::vector<MeshProjectionResult>& result, const std::vector<Vector3f>& points,
87 const AffineXf3f* objXf, const AffineXf3f* refObjXf,
88 float upDistLimitSq, float loDistLimitSq ) override;
89
91 MRMESH_API virtual size_t projectionsHeapBytes( size_t numProjections ) const override;
92};
93
94}
#define MRMESH_API
Definition MRMeshFwd.h:82
#define MRMESH_CLASS
Definition MRMeshFwd.h:89
Computes the closest point on mesh to each of given points on CPU.
Definition MRPointsToMeshProjector.h:72
struct
Definition MRMeshFwd.h:186
float loDistLimitSq
Definition MRPointsToMeshProjector.h:39
virtual size_t projectionsHeapBytes(size_t numProjections) const =0
Returns amount of memory needed to compute projections.
virtual void updateMeshData(const Mesh *mesh) override
update all data related to the referencing mesh
IPointsToMeshProjector(const IPointsToMeshProjector &)=default
const AffineXf3f * refXf
optional reference mesh to world transformation
Definition MRPointsToMeshProjector.h:46
IPointsToMeshProjector()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
const AffineXf3f * xf
optional test points to world transformation
Definition MRPointsToMeshProjector.h:49
virtual void updateMeshData(const Mesh *mesh)=0
Updates all data related to the referencing mesh.
float upDistLimitSq
Definition MRPointsToMeshProjector.h:43
virtual size_t projectionsHeapBytes(size_t numProjections) const override
Returns amount of additional memory needed to compute projections.
IPointsToMeshProjector(IPointsToMeshProjector &&) noexcept=default
virtual 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.
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
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.
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRPointsToMeshProjector.h:36
Definition MRMeshProject.h:18
Definition MRMesh.h:23