refactor: replace HRP with NVP in Cylinder serialization and add stream operators for TRS

This commit is contained in:
AndreaRigoni
2026-04-02 11:56:25 +00:00
parent 4435776484
commit 6068b62e39
3 changed files with 12 additions and 1 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ src/Python/uLib/__pycache__
src/Python/uLib/.nfs*
test_props.xml
test_props2.xml
test_boost.cpp

View File

@@ -86,7 +86,7 @@ public:
ar & HRP(Radius);
ar & HRP(Height);
ar & boost::serialization::make_hrp_enum("Axis", Axis, {"X", "Y", "Z"});
ar & HRP("TRS", boost::serialization::base_object<TRS>(*this));
ar & NVP("TRS", boost::serialization::base_object<TRS>(*this));
}
/** Sets the radius of the cylinder */

View File

@@ -287,6 +287,16 @@ public:
inline std::ostream& operator<<(std::ostream& os, const TRS& trs) {
os << trs.position << " " << trs.rotation << " " << trs.scaling;
return os;
}
inline std::istream& operator>>(std::istream& is, TRS& trs) {
is >> trs.position >> trs.rotation >> trs.scaling;
return is;
}
} // uLib