geometry.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>
30 #include <boost/uuid/random_generator.hpp>
31 #include <boost/uuid/uuid_serialize.hpp>
32 #include <boost/uuid/uuid_io.hpp>
35 
37 
38 namespace tesseract_geometry
39 {
40 Geometry::Geometry(GeometryType type) : type_(type), uuid_(boost::uuids::random_generator()()) {}
41 
43 
44 void Geometry::setUUID(const boost::uuids::uuid& uuid) { uuid_ = uuid; }
45 
46 const boost::uuids::uuid& Geometry::getUUID() const { return uuid_; }
47 
48 bool Geometry::operator==(const Geometry& rhs) const { return (type_ == rhs.type_ && uuid_ == rhs.uuid_); }
49 bool Geometry::operator!=(const Geometry& rhs) const { return !operator==(rhs); } // LCOV_EXCL_LINE
50 
51 template <class Archive>
52 void Geometry::serialize(Archive& ar, const unsigned int /*version*/)
53 {
54  ar& boost::serialization::make_nvp("type", type_);
55  ar& boost::serialization::make_nvp("uuid", uuid_);
56 }
57 } // namespace tesseract_geometry
58 
tesseract_geometry::Geometry::Geometry
Geometry(GeometryType type=GeometryType::UNINITIALIZED)
Definition: geometry.cpp:40
tesseract_geometry::Geometry::getUUID
const boost::uuids::uuid & getUUID() const
Get the geometry UUID.
Definition: geometry.cpp:46
tesseract_geometry::Geometry::uuid_
boost::uuids::uuid uuid_
The uuid of the shape.
Definition: geometry.h:102
tesseract_geometry::Geometry
Definition: geometry.h:69
geometry.h
Tesseract Geometries.
tesseract_geometry::GeometryType
GeometryType
Definition: geometry.h:48
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
boost
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_geometry::Geometry::operator==
bool operator==(const Geometry &rhs) const
Definition: geometry.cpp:48
serialization.h
tesseract_geometry::Geometry::operator!=
bool operator!=(const Geometry &rhs) const
Definition: geometry.cpp:49
tesseract_geometry::Geometry::type_
GeometryType type_
The type of the shape.
Definition: geometry.h:99
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_geometry::Geometry::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: geometry.cpp:52
type
type
tesseract_geometry::Geometry::getType
GeometryType getType() const
Get the geometry type.
Definition: geometry.cpp:42
tesseract_geometry::Geometry::setUUID
void setUUID(const boost::uuids::uuid &uuid)
Set the geometry UUID.
Definition: geometry.cpp:44
tesseract_geometry
Definition: fwd.h:31
macros.h


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