14 #include <s11n.net/s11n/proxy/std/vector.hpp> 15 #include <s11n.net/s11n/s11nlite.hpp> 20 return new PolygonExport(polygon);
26 for (
auto &obj : polyg.getTriangleMesh()) {
28 m_triangles.push_back(static_cast<TriangleExport *>(obj->exportThis()));
41 typedef s11nlite::node_traits TR;
42 TR::class_name(dest,
"PolygonExport");
43 for (
auto el : m_triangles) {
44 if (!el)
return false;
47 res = res && s11n::list::serialize_list(dest,
"triangles", m_triangles);
48 res = res && s11n::list::serialize_list(dest,
"vertices",
m_vertices);
50 res && s11n::list::serialize_list(dest,
"hole_vertices",
m_hole_vertices);
55 typedef s11nlite::node_traits TR;
58 res && s11n::list::deserialize_list(src,
"triangles", this->m_triangles);
59 res = res && s11n::list::deserialize_list(src,
"vertices", this->
m_vertices);
60 res = res && s11n::list::deserialize_list(src,
"hole_vertices",
70 std::vector<TriangleConstPtr> mesh_triangles;
72 for (
auto obj : m_triangles) {
73 CollisionObject *loaded_obj_ptr = obj->loadObject();
74 if (!loaded_obj_ptr) {
81 if ((static_cast<const Shape *>(loaded_obj.get()))->type() !=
86 mesh_triangles.push_back(
87 std::static_pointer_cast<const Triangle>(loaded_obj));
virtual bool operator()(s11nlite::node_type &dest) const
PolygonExportStruct m_fields
std::vector< std::vector< Eigen::Vector2d > > m_hole_vertices
std::shared_ptr< const CollisionObject > CollisionObjectConstPtr
std::vector< ICollisionObjectExport_s11 * > m_triangles
int serialize(const test::BroadphaseFailureCCObj &bf_object, std::ostream &output_stream, const char *format=SERIALIZER_DEFAULT_FORMAT)
std::vector< Eigen::Vector2d > m_vertices
Polygon contains Triangles and Vertices.
CollisionObject * loadObject(void)