refactor: replace HRP with NVP in Cylinder serialization and add stream operators for TRS
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ src/Python/uLib/__pycache__
|
||||
src/Python/uLib/.nfs*
|
||||
test_props.xml
|
||||
test_props2.xml
|
||||
test_boost.cpp
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user