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