Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
sphere.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_GEOMETRY_SPHERE_H
27#define TESSERACT_GEOMETRY_SPHERE_H
28
31#include <boost/serialization/access.hpp>
32#include <boost/serialization/export.hpp>
33#include <memory>
35
37
38namespace tesseract_geometry
39{
40class Sphere : public Geometry
41{
42public:
43 using Ptr = std::shared_ptr<Sphere>;
44 using ConstPtr = std::shared_ptr<const Sphere>;
45
46 explicit Sphere(double r) : Geometry(GeometryType::SPHERE), r_(r) {}
47 Sphere() = default;
48 ~Sphere() override = default;
49
50 double getRadius() const { return r_; }
51
52 Geometry::Ptr clone() const override final { return std::make_shared<Sphere>(r_); }
53 bool operator==(const Sphere& rhs) const;
54 bool operator!=(const Sphere& rhs) const;
55
56private:
57 double r_{ 0 };
58
60 template <class Archive>
61 void serialize(Archive& ar, const unsigned int version); // NOLINT
62};
63} // namespace tesseract_geometry
64
65BOOST_CLASS_EXPORT_KEY2(tesseract_geometry::Sphere, "Sphere")
66#endif
Definition: geometry.h:60
std::shared_ptr< Geometry > Ptr
Definition: geometry.h:62
Definition: sphere.h:41
double r_
Definition: sphere.h:57
Sphere(double r)
Definition: sphere.h:46
bool operator!=(const Sphere &rhs) const
Definition: sphere.cpp:45
void serialize(Archive &ar, const unsigned int version)
Definition: sphere.cpp:48
~Sphere() override=default
std::shared_ptr< Sphere > Ptr
Definition: sphere.h:43
Geometry::Ptr clone() const override final
Create a copy of this shape.
Definition: sphere.h:52
double getRadius() const
Definition: sphere.h:50
bool operator==(const Sphere &rhs) const
Definition: sphere.cpp:38
std::shared_ptr< const Sphere > ConstPtr
Definition: sphere.h:44
friend class boost::serialization::access
Definition: sphere.h:59
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: geometry.h:39
GeometryType
Definition: geometry.h:41
@ SPHERE
Definition: geometry.h:43
Tesseract Geometries.