Collision Checker
serialize_point.cc
Go to the documentation of this file.
1 
3 
4 #if ENABLE_SERIALIZER
6 namespace collision {
7 namespace serialize {
8 ICollisionObjectExport *exportObject(const collision::Point &point) {
9  return new PointExport(point);
10 }
11 
12 PointExport::PointExport(const Point &point) {
13  m_fields.center_x = point.center_x();
14  m_fields.center_y = point.center_y();
15 }
16 
17 CollisionObject *PointExport::loadObject(void) {
18  return new Point(Eigen::Vector2d(m_fields.center_x, m_fields.center_y));
19 }
20 
21 bool PointExport::operator()(s11nlite::node_type &dest) const {
22  typedef s11nlite::node_traits TR;
23  TR::class_name(dest, "PointExport");
24  TR::set(dest, "center_x", m_fields.center_x);
25  TR::set(dest, "center_y", m_fields.center_y);
26 
27  return true;
28 }
29 bool PointExport::operator()(const s11nlite::node_type &src) {
30  typedef s11nlite::node_traits TR;
31  m_fields.center_x = TR::get(src, "center_x", double(0));
32 
33  m_fields.center_y = TR::get(src, "center_y", double(0));
34 
35  return true;
36 }
37 } // namespace serialize
38 } // namespace collision
39 #endif
CollisionObject * loadObject(void)
int serialize(const test::BroadphaseFailureCCObj &bf_object, std::ostream &output_stream, const char *format=SERIALIZER_DEFAULT_FORMAT)
virtual bool operator()(s11nlite::node_type &dest) const
A point in space.
Definition: point.h:18