src
geometries
plane.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/plane.h
>
34
35
namespace
tesseract_geometry
36
{
37
Plane::Plane
(
double
a,
double
b,
double
c,
double
d) :
Geometry
(
GeometryType
::
PLANE
), a_(a), b_(b), c_(c), d_(d) {}
38
39
double
Plane::getA
()
const
{
return
a_
; }
40
double
Plane::getB
()
const
{
return
b_
; }
41
double
Plane::getC
()
const
{
return
c_
; }
42
double
Plane::getD
()
const
{
return
d_
; }
43
44
Geometry::Ptr
Plane::clone
()
const
{
return
std::make_shared<Plane>(
a_
,
b_
,
c_
,
d_
); }
45
46
bool
Plane::operator==
(
const
Plane
& rhs)
const
47
{
48
bool
equal =
true
;
49
equal &=
Geometry::operator==
(rhs);
50
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
a_
, rhs.
a_
);
51
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
b_
, rhs.
b_
);
52
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
c_
, rhs.
c_
);
53
equal &=
tesseract_common::almostEqualRelativeAndAbs
(
d_
, rhs.
d_
);
54
return
equal;
55
}
56
bool
Plane::operator!=
(
const
Plane
& rhs)
const
{
return
!
operator==
(rhs); }
57
58
template
<
class
Archive>
59
void
Plane::serialize
(Archive& ar,
const
unsigned
int
/*version*/
)
60
{
61
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Geometry
);
62
ar& BOOST_SERIALIZATION_NVP(
a_
);
63
ar& BOOST_SERIALIZATION_NVP(
b_
);
64
ar& BOOST_SERIALIZATION_NVP(
c_
);
65
ar& BOOST_SERIALIZATION_NVP(
d_
);
66
}
67
}
// namespace tesseract_geometry
68
69
#include <
tesseract_common/serialization.h
>
70
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
(
tesseract_geometry::Plane
)
71
BOOST_CLASS_EXPORT_IMPLEMENT(
tesseract_geometry::Plane
)
tesseract_geometry::Plane::getD
double getD() const
Definition:
plane.cpp:42
tesseract_geometry::Plane::d_
double d_
Definition:
plane.h:67
tesseract_geometry::Geometry::Ptr
std::shared_ptr< Geometry > Ptr
Definition:
geometry.h:72
tesseract_geometry::Geometry
Definition:
geometry.h:69
tesseract_geometry::Plane
Definition:
plane.h:44
utils.h
tesseract_geometry::GeometryType
GeometryType
Definition:
geometry.h:48
tesseract_geometry::Plane::b_
double b_
Definition:
plane.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_geometry::Plane::getA
double getA() const
Definition:
plane.cpp:39
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
tesseract_geometry::Plane::c_
double c_
Definition:
plane.h:66
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
plane.h
Tesseract Plane Geometry.
tesseract_geometry::Plane::getC
double getC() const
Definition:
plane.cpp:41
tesseract_geometry::Plane::operator!=
bool operator!=(const Plane &rhs) const
Definition:
plane.cpp:56
tesseract_geometry::Geometry::operator==
bool operator==(const Geometry &rhs) const
Definition:
geometry.cpp:48
tesseract_geometry::GeometryType::PLANE
@ PLANE
serialization.h
tesseract_geometry::Plane::clone
Geometry::Ptr clone() const override final
Create a copy of this shape.
Definition:
plane.cpp:44
tesseract_geometry::Plane::a_
double a_
Definition:
plane.h:64
tesseract_geometry::Plane::Plane
Plane()=default
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_geometry::Plane::operator==
bool operator==(const Plane &rhs) const
Definition:
plane.cpp:46
tesseract_geometry
Definition:
fwd.h:31
tesseract_geometry::Plane::serialize
void serialize(Archive &ar, const unsigned int version)
Definition:
plane.cpp:59
macros.h
tesseract_geometry::Plane::getB
double getB() const
Definition:
plane.cpp:40
tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46