MeshLib
 
Loading...
Searching...
No Matches
MRCudaFastWindingNumber.h
Go to the documentation of this file.
1#pragma once
2#include "exports.h"
4#include "MRMesh/MRMesh.h"
5
6namespace MR
7{
8
9namespace Cuda
10{
11
12struct FastWindingNumberData;
13
17{
18 const Mesh & mesh_;
19 std::shared_ptr<FastWindingNumberData> data_;
20
21public:
23 MRCUDA_API FastWindingNumber( const Mesh& mesh );
24
25 // see methods' descriptions in IFastWindingNumber
26 MRCUDA_API void calcFromVector( std::vector<float>& res, const std::vector<Vector3f>& points, float beta, FaceId skipFace = {} ) override;
27 MRCUDA_API bool calcSelfIntersections( FaceBitSet& res, float beta, ProgressCallback cb ) override;
28 MRCUDA_API VoidOrErrStr calcFromGrid( std::vector<float>& res, const Vector3i& dims, const AffineXf3f& gridToMeshXf, float beta, ProgressCallback cb ) override;
29 MRCUDA_API float calcWithDistances( const Vector3f& p, float windingNumberThreshold, float beta, float maxDistSq, float minDistSq );
30 MRCUDA_API VoidOrErrStr calcFromGridWithDistances( std::vector<float>& res, const Vector3i& dims, const AffineXf3f& gridToMeshXf, float windingNumberThreshold, float beta, float maxDistSq, float minDistSq, ProgressCallback cb ) override;
31
32private:
33 bool prepareData_( ProgressCallback cb );
34};
35
36} // namespace Cuda
37} // namespace MR
int FaceId
Definition MRDotNet/MRMeshFwd.h:53
Definition MRDotNet/MRBitSet.h:39
Definition MRCudaFastWindingNumber.h:17
MRCUDA_API bool calcSelfIntersections(FaceBitSet &res, float beta, ProgressCallback cb) override
calculates winding numbers for all centers of mesh's triangles. if winding number is less than 0 or g...
MRCUDA_API void calcFromVector(std::vector< float > &res, const std::vector< Vector3f > &points, float beta, FaceId skipFace={}) override
calculates winding numbers in the points from given vector
MRCUDA_API float calcWithDistances(const Vector3f &p, float windingNumberThreshold, float beta, float maxDistSq, float minDistSq)
MRCUDA_API VoidOrErrStr calcFromGrid(std::vector< float > &res, const Vector3i &dims, const AffineXf3f &gridToMeshXf, float beta, ProgressCallback cb) override
calculates winding numbers in each point from a three-dimensional grid
MRCUDA_API VoidOrErrStr calcFromGridWithDistances(std::vector< float > &res, const Vector3i &dims, const AffineXf3f &gridToMeshXf, float windingNumberThreshold, float beta, float maxDistSq, float minDistSq, ProgressCallback cb) override
calculates distances with the sign obtained from winding number in each point from a three-dimensiona...
MRCUDA_API FastWindingNumber(const Mesh &mesh)
constructs this from AABB tree of given mesh;
Abstract class for fast approximate computation of generalized winding number for a mesh (using its A...
Definition MRFastWindingNumber.h:12
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
Definition MRCameraOrientationPlugin.h:7
Expected< void > VoidOrErrStr
return type for a void function that can produce an error string
Definition MRExpected.h:60
Definition MRMesh/MRMesh.h:23