Skip to content

Commit

Permalink
[core] Fix serialization of geometry meshes.
Browse files Browse the repository at this point in the history
  • Loading branch information
duburcqa committed Nov 21, 2024
1 parent 9a0d6e6 commit 2684b76
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions core/src/io/serialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,17 @@ namespace boost::serialization
}
ar & make_nvp("nodeType", nodeType);

#define UPCAST_FROM_TYPENAME(TYPENAME, CLASS) \
case hpp::fcl::NODE_TYPE::TYPENAME: \
if (Archive::is_loading::value) \
{ \
geom.geometry = std::make_shared<CLASS>(); \
} \
ar & make_nvp("geometry", static_cast<CLASS &>(*geom.geometry)); \
break;
#define UPCAST_FROM_TYPENAME(TYPENAME, CLASS) \
case hpp::fcl::NODE_TYPE::TYPENAME: \
{ \
if (Archive::is_loading::value) \
{ \
geom.geometry = std::make_shared<CLASS>(); \
} \
auto geometryDerived = std::dynamic_pointer_cast<CLASS>(geom.geometry); \
ar & make_nvp("geometry", geometryDerived); \
break; \
}

switch (nodeType)
{ // clang-format off
Expand Down

0 comments on commit 2684b76

Please sign in to comment.