OGS
MinimalBoundingSphere.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <vector>
18
19#include "MathLib/Point3d.h"
20
21namespace GeoLib
22{
23
29{
30public:
32 explicit MinimalBoundingSphere(
33 MathLib::Point3d const& p,
34 double radius = std::numeric_limits<double>::epsilon());
39 MathLib::Point3d const& r);
42 MathLib::Point3d const& q,
43 MathLib::Point3d const& r,
44 MathLib::Point3d const& s);
46 explicit MinimalBoundingSphere(
47 std::vector<MathLib::Point3d*> const& points);
48
51
53 double getRadius() const { return _radius; }
54
57 double pointDistanceSquared(MathLib::Point3d const& pnt) const;
58
59private:
62
81 std::vector<MathLib::Point3d*> sphere_points,
82 std::size_t start_idx,
83 std::size_t length,
84 std::size_t n_boundary_points);
85
86 double _radius{-1};
87 MathLib::Point3d _center{{std::numeric_limits<double>::max(),
88 std::numeric_limits<double>::max(),
89 std::numeric_limits<double>::max()}};
90};
91
92} // namespace GeoLib
Definition of the Point3d class.
static MinimalBoundingSphere recurseCalculation(std::vector< MathLib::Point3d * > sphere_points, std::size_t start_idx, std::size_t length, std::size_t n_boundary_points)
MinimalBoundingSphere()
Constructor using no points.
double getRadius() const
Returns the radius of the sphere.
MathLib::Point3d getCenter() const
Returns the center point of the sphere.
double pointDistanceSquared(MathLib::Point3d const &pnt) const