add_scene_graph_command.cpp
Go to the documentation of this file.
1 
28 #include <boost/serialization/access.hpp>
29 #include <boost/serialization/nvp.hpp>
30 #include <boost/serialization/shared_ptr.hpp>
31 #include <memory>
32 #include <string>
34 
36 #include <tesseract_common/utils.h>
39 
40 namespace tesseract_environment
41 {
43 
46  , scene_graph_(scene_graph.clone())
47  , joint_(nullptr)
48  , prefix_(std::move(prefix))
49 {
50 }
51 
53  const tesseract_scene_graph::Joint& joint,
54  std::string prefix)
56  , scene_graph_(scene_graph.clone())
57  , joint_(std::make_shared<tesseract_scene_graph::Joint>(joint.clone()))
58  , prefix_(std::move(prefix))
59 {
60 }
61 
62 const std::shared_ptr<const tesseract_scene_graph::SceneGraph>& AddSceneGraphCommand::getSceneGraph() const
63 {
64  return scene_graph_;
65 }
66 const std::shared_ptr<const tesseract_scene_graph::Joint>& AddSceneGraphCommand::getJoint() const { return joint_; }
67 const std::string& AddSceneGraphCommand::getPrefix() const { return prefix_; }
68 
70 {
71  bool equal = true;
72  equal &= Command::operator==(rhs);
75  equal &= prefix_ == rhs.prefix_;
76  return equal;
77 }
78 bool AddSceneGraphCommand::operator!=(const AddSceneGraphCommand& rhs) const { return !operator==(rhs); }
79 
80 template <class Archive>
81 void AddSceneGraphCommand::serialize(Archive& ar, const unsigned int /*version*/)
82 {
83  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Command);
84  ar& BOOST_SERIALIZATION_NVP(scene_graph_);
85  ar& BOOST_SERIALIZATION_NVP(joint_);
86  ar& BOOST_SERIALIZATION_NVP(prefix_);
87 }
88 } // namespace tesseract_environment
89 
92 BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_environment::AddSceneGraphCommand)
graph.h
tesseract_environment::Command::operator==
bool operator==(const Command &rhs) const
Definition: command.cpp:60
tesseract_environment
Definition: command.h:45
tesseract_environment::CommandType::ADD_SCENE_GRAPH
@ ADD_SCENE_GRAPH
tesseract_environment::Command
Definition: command.h:83
utils.h
tesseract_environment::AddSceneGraphCommand::AddSceneGraphCommand
AddSceneGraphCommand()
Definition: add_scene_graph_command.cpp:42
tesseract_common::pointersEqual
bool pointersEqual(const std::shared_ptr< T > &p1, const std::shared_ptr< T > &p2)
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
joint.h
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
add_scene_graph_command.h
Used to add scene graph to the environment.
tesseract_scene_graph::SceneGraph
tesseract_environment::AddSceneGraphCommand::scene_graph_
std::shared_ptr< const tesseract_scene_graph::SceneGraph > scene_graph_
Definition: add_scene_graph_command.h:87
tesseract_environment::AddSceneGraphCommand::getPrefix
const std::string & getPrefix() const
Definition: add_scene_graph_command.cpp:67
tesseract_environment::AddSceneGraphCommand::operator!=
bool operator!=(const AddSceneGraphCommand &rhs) const
Definition: add_scene_graph_command.cpp:78
serialization.h
tesseract_environment::AddSceneGraphCommand::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: add_scene_graph_command.cpp:81
tesseract_environment::AddSceneGraphCommand::prefix_
std::string prefix_
Definition: add_scene_graph_command.h:89
tesseract_environment::AddSceneGraphCommand::getSceneGraph
const std::shared_ptr< const tesseract_scene_graph::SceneGraph > & getSceneGraph() const
Definition: add_scene_graph_command.cpp:62
tesseract_environment::AddSceneGraphCommand
Definition: add_scene_graph_command.h:46
TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_environment::AddSceneGraphCommand::operator==
bool operator==(const AddSceneGraphCommand &rhs) const
Definition: add_scene_graph_command.cpp:69
tesseract_environment::AddSceneGraphCommand::joint_
std::shared_ptr< const tesseract_scene_graph::Joint > joint_
Definition: add_scene_graph_command.h:88
tesseract_scene_graph::Joint
tesseract_environment::AddSceneGraphCommand::getJoint
const std::shared_ptr< const tesseract_scene_graph::Joint > & getJoint() const
Definition: add_scene_graph_command.cpp:66
macros.h
tesseract_scene_graph
tesseract_environment::CommandType
CommandType
Definition: command.h:47


tesseract_environment
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:21