src
geometries
box.cpp
Go to the documentation of this file.
1
25
#include <
tesseract_common/macros.h
>
26
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
27
#include <boost/serialization/access.hpp>
28
#include <boost/serialization/base_object.hpp>
29
#include <boost/serialization/nvp.hpp>
30
TESSERACT_COMMON_IGNORE_WARNINGS_POP
31
32
#include <
tesseract_common/utils.h
>
33
#include <
tesseract_geometry/impl/box.h
>
34
35
namespace
tesseract_geometry
36
{
37
Box::Box
(
double
x,
double
y,
double
z) :
Geometry
(
GeometryType
::
BOX
), x_(x), y_(y), z_(z) {}
38
39
double
Box::getX
()
const
{
return
x_
; }
40
double
Box::getY
()
const
{
return
y_
; }
41
double
Box::getZ
()
const
{
return
z_
; }
42
43
Geometry::Ptr
Box::clone
()
const
{
return
std::make_shared<Box>(
x_
,
y_
,
z_
); }
44
45
bool
Box::operator==
(
const
Box
& rhs)
const
46
{
47
bool
equal =
true
;
48
equal &=
Geometry::operator==
(rhs);
49
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
x_
, rhs.
x_
);
50
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
y_
, rhs.
y_
);
51
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
z_
, rhs.
z_
);
52
return
equal;
53
}
54
bool
Box::operator!=
(
const
Box
& rhs)
const
{
return
!
operator==
(rhs); }
55
56
template
<
class
Archive>
57
void
Box::serialize
(Archive& ar,
const
unsigned
int
/*version*/
)
58
{
59
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Geometry
);
60
ar& BOOST_SERIALIZATION_NVP(
x_
);
61
ar& BOOST_SERIALIZATION_NVP(
y_
);
62
ar& BOOST_SERIALIZATION_NVP(
z_
);
63
}
64
}
// namespace tesseract_geometry
65
66
#include <
tesseract_common/serialization.h
>
67
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
(
tesseract_geometry::Box
)
68
BOOST_CLASS_EXPORT_IMPLEMENT(
tesseract_geometry::Box
)
tesseract_geometry::Box::getZ
double getZ() const
Definition:
box.cpp:41
tesseract_geometry::Geometry::Ptr
std::shared_ptr< Geometry > Ptr
Definition:
geometry.h:72
tesseract_geometry::Box::getY
double getY() const
Definition:
box.cpp:40
tesseract_geometry::Geometry
Definition:
geometry.h:69
utils.h
tesseract_geometry::GeometryType
GeometryType
Definition:
geometry.h:48
tesseract_geometry::Box::z_
double z_
Definition:
box.h:65
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::Box::operator==
bool operator==(const Box &rhs) const
Definition:
box.cpp:45
box.h
Tesseract Box Geometry.
tesseract_geometry::Box::operator!=
bool operator!=(const Box &rhs) const
Definition:
box.cpp:54
tesseract_geometry::Box::serialize
void serialize(Archive &ar, const unsigned int version)
Definition:
box.cpp:57
tesseract_geometry::Geometry::operator==
bool operator==(const Geometry &rhs) const
Definition:
geometry.cpp:48
serialization.h
tesseract_geometry::Box::x_
double x_
Definition:
box.h:63
tesseract_geometry::Box::getX
double getX() const
Definition:
box.cpp:39
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_geometry::GeometryType::BOX
@ BOX
tesseract_geometry
Definition:
fwd.h:31
tesseract_geometry::Box::y_
double y_
Definition:
box.h:64
macros.h
tesseract_geometry::Box::Box
Box()=default
tesseract_geometry::Box
Definition:
box.h:44
tesseract_geometry::Box::clone
Geometry::Ptr clone() const override final
Create a copy of this shape.
Definition:
box.cpp:43
tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46