MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRGridSampling.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
5#include "MRId.h"
6#include "MRMesh/MRVector.h"
7#include <optional>
8
9namespace MR
10{
11
15MRMESH_API std::optional<VertBitSet> verticesGridSampling( const MeshPart& mp, float voxelSize, const ProgressCallback & cb = {} );
16
20MRMESH_API std::optional<VertBitSet> pointGridSampling( const PointCloud& cloud, float voxelSize, const ProgressCallback & cb = {} );
21
22
25{
27 const VertCoords* points{ nullptr };
29 const VertBitSet* validPoints{ nullptr };
31 const AffineXf3f* xf{ nullptr };
33 ObjId fakeObjId{};
34};
35
37{
38 ObjId objId;
39 VertId vId;
40
41 friend bool operator==( const ObjVertId&, const ObjVertId& ) = default;
42};
43
44using MultiObjsSamples = std::vector<ObjVertId>;
45
49MRMESH_API std::optional<MultiObjsSamples> multiModelGridSampling( const Vector<ModelPointsData, ObjId>& models, float voxelSize, const ProgressCallback& cb = {} );
50
51} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
MRMESH_API std::optional< VertBitSet > verticesGridSampling(const MeshPart &mp, float voxelSize, const ProgressCallback &cb={})
MRMESH_API std::optional< MultiObjsSamples > multiModelGridSampling(const Vector< ModelPointsData, ObjId > &models, float voxelSize, const ProgressCallback &cb={})
std::vector< ObjVertId > MultiObjsSamples
Definition MRMesh/MRGridSampling.h:44
MRMESH_API std::optional< VertBitSet > pointGridSampling(const PointCloud &cloud, float voxelSize, const ProgressCallback &cb={})
structure to contain pointers to model data
Definition MRMesh/MRGridSampling.h:25
const VertBitSet * validPoints
bitset of valid points
Definition MRMesh/MRGridSampling.h:29
const VertCoords * points
all points of model
Definition MRMesh/MRGridSampling.h:27
const AffineXf3f * xf
model world xf
Definition MRMesh/MRGridSampling.h:31
ObjId fakeObjId
if present this value will override ObjId in result ObjVertId
Definition MRMesh/MRGridSampling.h:33
Definition MRMesh/MRGridSampling.h:37
ObjId objId
Definition MRMesh/MRGridSampling.h:38
VertId vId
Definition MRMesh/MRGridSampling.h:39
friend bool operator==(const ObjVertId &, const ObjVertId &)=default
Definition MRMesh/MRPointCloud.h:16