cylinder.cpp
Go to the documentation of this file.
1 
27 #include <boost/serialization/access.hpp>
28 #include <boost/serialization/base_object.hpp>
29 #include <boost/serialization/nvp.hpp>
31 
32 #include <tesseract_common/utils.h>
34 
35 namespace tesseract_geometry
36 {
37 Cylinder::Cylinder(double radius, double length) : Geometry(GeometryType::CYLINDER), r_(radius), l_(length) {}
38 
39 double Cylinder::getRadius() const { return r_; }
40 double Cylinder::getLength() const { return l_; }
41 
42 Geometry::Ptr Cylinder::clone() const { return std::make_shared<Cylinder>(r_, l_); }
43 
44 bool Cylinder::operator==(const Cylinder& rhs) const
45 {
46  bool equal = true;
47  equal &= Geometry::operator==(rhs);
50  return equal;
51 }
52 bool Cylinder::operator!=(const Cylinder& rhs) const { return !operator==(rhs); }
53 
54 template <class Archive>
55 void Cylinder::serialize(Archive& ar, const unsigned int /*version*/)
56 {
57  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Geometry);
58  ar& BOOST_SERIALIZATION_NVP(r_);
59  ar& BOOST_SERIALIZATION_NVP(l_);
60 }
61 } // namespace tesseract_geometry
62 
65 BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_geometry::Cylinder)
tesseract_geometry::Cylinder::operator==
bool operator==(const Cylinder &rhs) const
Definition: cylinder.cpp:44
tesseract_geometry::Cylinder::getLength
double getLength() const
Definition: cylinder.cpp:40
tesseract_geometry::Geometry::Ptr
std::shared_ptr< Geometry > Ptr
Definition: geometry.h:72
tesseract_geometry::Geometry
Definition: geometry.h:69
utils.h
tesseract_geometry::GeometryType
GeometryType
Definition: geometry.h:48
tesseract_common::almostEqualRelativeAndAbs
bool almostEqualRelativeAndAbs(const Eigen::Ref< const Eigen::VectorXd > &v1, const Eigen::Ref< const Eigen::VectorXd > &v2, const Eigen::Ref< const Eigen::VectorXd > &max_diff, const Eigen::Ref< const Eigen::VectorXd > &max_rel_diff)
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
tesseract_geometry::Cylinder::getRadius
double getRadius() const
Definition: cylinder.cpp:39
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_geometry::Cylinder::l_
double l_
Definition: cylinder.h:63
tesseract_geometry::GeometryType::CYLINDER
@ CYLINDER
tesseract_geometry::Cylinder::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: cylinder.cpp:55
tesseract_geometry::Cylinder::clone
Geometry::Ptr clone() const override final
Create a copy of this shape.
Definition: cylinder.cpp:42
tesseract_geometry::Geometry::operator==
bool operator==(const Geometry &rhs) const
Definition: geometry.cpp:48
tesseract_geometry::Cylinder
Definition: cylinder.h:44
serialization.h
tesseract_geometry::Cylinder::Cylinder
Cylinder()=default
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_geometry::Cylinder::r_
double r_
Definition: cylinder.h:62
tesseract_geometry
Definition: fwd.h:31
macros.h
tesseract_geometry::Cylinder::operator!=
bool operator!=(const Cylinder &rhs) const
Definition: cylinder.cpp:52
cylinder.h
Tesseract Cylinder Geometry.


tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46