1 #ifndef PMPL_TETRAHEDRAL_BOUNDARY_H_
2 #define PMPL_TETRAHEDRAL_BOUNDARY_H_
34 const bool _check =
true);
37 const bool _check =
true);
41 virtual std::unique_ptr<Boundary>
Clone()
const override;
51 virtual std::
string Name() const noexcept override;
55 virtual
double GetMaxDist(const
double _r1 = 2., const
double _r2 = .5)
58 virtual const
Range<
double>&
GetRange(const
size_t _i) const override;
60 virtual const std::vector<
double>&
GetCenter() const noexcept override;
62 virtual
double GetVolume() const noexcept override;
70 virtual
void PushInside(std::vector<
double>& _sample) const noexcept override;
76 virtual
bool InBoundary(const Vector3d& _p) const override;
78 virtual
bool InBoundary(const std::vector<
double>& _v) const override;
86 virtual
double GetClearance(const Vector3d& _p) const override;
94 virtual
void SetCenter(const std::vector<
double>& _c) noexcept override;
96 virtual
void Translate(const Vector3d& _v) override;
98 virtual
void Translate(const std::vector<
double>& _t) override;
100 virtual
void ResetBoundary(const std::vector<std::pair<
double,
double>>& _bbx,
101 const
double _margin) override;
109 virtual
void Write(std::ostream& _os) const override;
121 friend std::ostream& operator<<(std::ostream& _os,
Definition: Boundary.h:30
Space
The types of space that can be modeled with boundaries.
Definition: Boundary.h:38
CGAL::Polyhedron_3< CGALKernel > CGALPolyhedron
Definition: Boundary.h:193
Definition: CountingStreamBuffer.h:20
Definition: GMSPolyhedron.h:42
An axis-aligned rectangular prism in n dimensions.
Definition: NBox.h:14
A tetrahedral bounding region in workspace.
Definition: TetrahedralBoundary.h:12
virtual CGALPolyhedron CGAL() const override
Create a CGAL polyhedron representation of this.
Definition: TetrahedralBoundary.cpp:303
virtual double GetClearance(const Vector3d &_p) const override
Definition: TetrahedralBoundary.cpp:214
virtual bool InBoundary(const Vector3d &_p) const override
Definition: TetrahedralBoundary.cpp:178
virtual std::string Name() const noexcept override
Get the name of the boundary type.
Definition: TetrahedralBoundary.cpp:66
double m_volume
The volume of the tetrahedron.
Definition: TetrahedralBoundary.h:152
virtual std::vector< double > GetRandomPoint() const override
Get a random point inside the boundary.
Definition: TetrahedralBoundary.cpp:116
std::array< Vector3d, 4 > m_normals
The normals of the tetrahedron.
Definition: TetrahedralBoundary.h:150
NBox m_bbx
The bounding box of the tetrahedron.
Definition: TetrahedralBoundary.h:151
virtual void Write(std::ostream &_os) const override
Definition: TetrahedralBoundary.cpp:295
std::array< Vector3d, 4 > ComputeNormals() const
Compute the normals. The first three are for faces touched by point 0.
Definition: TetrahedralBoundary.cpp:427
double ComputeVolume() const
Compute the volume.
Definition: TetrahedralBoundary.cpp:458
virtual double GetMaxDist(const double _r1=2., const double _r2=.5) const override
Definition: TetrahedralBoundary.cpp:80
virtual Vector3d GetClearancePoint(const Vector3d &_p) const override
Definition: TetrahedralBoundary.cpp:221
virtual const std::vector< double > & GetCenter() const noexcept override
Get the boundary's center point.
Definition: TetrahedralBoundary.cpp:100
std::array< Point3d, 4 > m_points
The vertices of the tetrahedron.
Definition: TetrahedralBoundary.h:149
NBox ComputeBBX() const
Compute the bounding box.
Definition: TetrahedralBoundary.cpp:439
virtual void Translate(const Vector3d &_v) override
Definition: TetrahedralBoundary.cpp:255
virtual double GetVolume() const noexcept override
Get the boundary's volume (Lebesgue Measure).
Definition: TetrahedralBoundary.cpp:108
virtual Boundary::Space Type() const noexcept override
Get the space type.
Definition: TetrahedralBoundary.cpp:59
virtual GMSPolyhedron MakePolyhedron() const override
Definition: TetrahedralBoundary.cpp:366
TetrahedralBoundary(const std::array< Point3d, 4 > &_pts, const bool _check=true)
Definition: TetrahedralBoundary.cpp:13
virtual const Range< double > & GetRange(const size_t _i) const override
Definition: TetrahedralBoundary.cpp:93
std::array< Vector3d, 6 > ComputeEdges() const
Definition: TetrahedralBoundary.cpp:414
virtual void PushInside(std::vector< double > &_sample) const noexcept override
Definition: TetrahedralBoundary.cpp:159
virtual void SetCenter(const std::vector< double > &_c) noexcept override
Definition: TetrahedralBoundary.cpp:240
virtual void ResetBoundary(const std::vector< std::pair< double, double >> &_bbx, const double _margin) override
Definition: TetrahedralBoundary.cpp:279
void OrderPoints() noexcept
Check that the points are in the correct order and fix if necessary.
Definition: TetrahedralBoundary.cpp:391
virtual ~TetrahedralBoundary() noexcept
virtual void Read(std::istream &_is, CountingStreamBuffer &_cbs) override
Definition: TetrahedralBoundary.cpp:288
virtual std::unique_ptr< Boundary > Clone() const override
Definition: TetrahedralBoundary.cpp:51
virtual size_t GetDimension() const noexcept override
Get the dimension of this boundary.
Definition: TetrahedralBoundary.cpp:73
A range of numeric values.
Definition: Range.h:17