MeshLib Documentation
Loading...
Searching...
No Matches
MRDenseBox.h
Go to the documentation of this file.
1#pragma once
2#include "MRBox.h"
3#include "MRAffineXf3.h"
4#include "MRBestFit.h"
5#include "MRPointCloud.h"
6
7namespace MR
8{
15{
17 MRMESH_API DenseBox( const std::vector<Vector3f>& points, const AffineXf3f* xf = nullptr );
19 MRMESH_API DenseBox( const std::vector<Vector3f>& points, const std::vector<float>& weights, const AffineXf3f* xf = nullptr );
21 MRMESH_API DenseBox( const MeshPart& meshPart, const AffineXf3f* xf = nullptr );
23 MRMESH_API DenseBox( const PointCloud& points, const AffineXf3f* xf = nullptr );
25 MRMESH_API DenseBox( const Polyline3& line, const AffineXf3f* xf = nullptr );
26
28 MRMESH_API Vector3f center() const;
31 MRMESH_API Vector3f corner( const Vector3b& index ) const;
33 MRMESH_API bool contains( const Vector3f& pt ) const;
34
35 // Access members
36
38 const Box3f& box() const { return box_; }
40 const AffineXf3f& basisXf() const { return basisXf_; }
42 const AffineXf3f& basisXfInv() const { return basisXfInv_; }
43
44private:
46 void init_( const std::vector<Vector3f>& points, const std::vector<float>* weights = nullptr, const AffineXf3f* xf = nullptr );
48 void init_( const MeshPart& meshPart, const AffineXf3f* xf = nullptr );
50 void init_( const PointCloud& points, const AffineXf3f* xf = nullptr );
52 void init_( const Polyline3& line, const AffineXf3f* xf = nullptr );
53
54 Box3f box_;
55 AffineXf3f basisXf_;
56 AffineXf3f basisXfInv_;
57};
58
59}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRCameraOrientationPlugin.h:8
MRMESH_CLASS Vector3b
Definition MRMesh/MRMeshFwd.h:138
Definition MRDenseBox.h:15
const Box3f & box() const
return box in its space
Definition MRDenseBox.h:38
const AffineXf3f & basisXfInv() const
transform world space to box space
Definition MRDenseBox.h:42
MRMESH_API DenseBox(const MeshPart &meshPart, const AffineXf3f *xf=nullptr)
Include mesh part into this dense box.
MRMESH_API DenseBox(const std::vector< Vector3f > &points, const AffineXf3f *xf=nullptr)
Include given points into this dense box.
MRMESH_API Vector3f center() const
returns center of dense box
const AffineXf3f & basisXf() const
transform box space to world space
Definition MRDenseBox.h:40
MRMESH_API DenseBox(const Polyline3 &line, const AffineXf3f *xf=nullptr)
Include line into this dense box.
MRMESH_API DenseBox(const std::vector< Vector3f > &points, const std::vector< float > &weights, const AffineXf3f *xf=nullptr)
Include given weighed points into this dense box.
MRMESH_API bool contains(const Vector3f &pt) const
returns true if dense box contains given point
MRMESH_API Vector3f corner(const Vector3b &index) const
MRMESH_API DenseBox(const PointCloud &points, const AffineXf3f *xf=nullptr)
Include point into this dense box.
Definition MRMesh/MRPointCloud.h:16