sphere.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 Sphere::Sphere(double r) : Geometry(GeometryType::SPHERE), r_(r) {}
38 
39 double Sphere::getRadius() const { return r_; }
40 
41 Geometry::Ptr Sphere::clone() const { return std::make_shared<Sphere>(r_); }
42 
43 bool Sphere::operator==(const Sphere& rhs) const
44 {
45  bool equal = true;
46  equal &= Geometry::operator==(rhs);
48  return equal;
49 }
50 bool Sphere::operator!=(const Sphere& rhs) const { return !operator==(rhs); }
51 
52 template <class Archive>
53 void Sphere::serialize(Archive& ar, const unsigned int /*version*/)
54 {
55  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Geometry);
56  ar& BOOST_SERIALIZATION_NVP(r_);
57 }
58 } // namespace tesseract_geometry
59 
62 BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_geometry::Sphere)
tesseract_geometry::Geometry::Ptr
std::shared_ptr< Geometry > Ptr
Definition: geometry.h:72
tesseract_geometry::Geometry
Definition: geometry.h:69
tesseract_geometry::Sphere
Definition: sphere.h:44
sphere.h
Tesseract Sphere Geometry.
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_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_geometry::Sphere::operator!=
bool operator!=(const Sphere &rhs) const
Definition: sphere.cpp:50
tesseract_geometry::Sphere::clone
Geometry::Ptr clone() const override final
Create a copy of this shape.
Definition: sphere.cpp:41
tesseract_geometry::Geometry::operator==
bool operator==(const Geometry &rhs) const
Definition: geometry.cpp:48
tesseract_geometry::Sphere::getRadius
double getRadius() const
Definition: sphere.cpp:39
serialization.h
tesseract_geometry::GeometryType::SPHERE
@ SPHERE
tesseract_geometry::Sphere::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: sphere.cpp:53
tesseract_geometry::Sphere::operator==
bool operator==(const Sphere &rhs) const
Definition: sphere.cpp:43
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_geometry
Definition: fwd.h:31
tesseract_geometry::Sphere::r_
double r_
Definition: sphere.h:61
macros.h
tesseract_geometry::Sphere::Sphere
Sphere()=default


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