diff --git a/modules/geom/src/vec3.hh b/modules/geom/src/vec3.hh index 1626bb2d5064df6b1873e799a16b1564143f5dee..47137476eb9aa8c2a9d6286de9da7954a97f269b 100644 --- a/modules/geom/src/vec3.hh +++ b/modules/geom/src/vec3.hh @@ -195,6 +195,10 @@ inline Vec3 operator/(Real d, const Vec3& v) return nrvo; } +// The following operator is among other things used to write vector +// data into info files. If its format is changed, the string to +// vector type cast in item_type_cast.hh has to be changed +// accordingly. inline std::ostream& operator<<(std::ostream& os, const Vec3& v) { os << "[" << v.x << ", " << v.y << ", " << v.z << "]"; diff --git a/modules/info/src/item_type_cast.hh b/modules/info/src/item_type_cast.hh index 33caf38679e92ebb10e1734118c953e5ef0254e4..0b364d575a31737eec8e0f6fa775d5b1a14956dd 100644 --- a/modules/info/src/item_type_cast.hh +++ b/modules/info/src/item_type_cast.hh @@ -99,7 +99,7 @@ template <> void set_new_type<IT_STRING,IT_BOOL>(EleImpl& item) template <> void set_new_type<IT_STRING,IT_VECTOR>(EleImpl& item) { static String num("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"); - boost::regex expression("\\(("+num+"),("+num+"),("+num+")\\)"); + boost::regex expression("\\[ *("+num+") *, *("+num+") *, *("+num+") *\\]"); boost::cmatch what; if(boost::regex_match(item.GetStringRepr().c_str(), what, expression)) {