Add formatVector for Vector2d

This commit is contained in:
WandererFan
2017-01-11 09:44:37 -05:00
parent 7741854152
commit 7a78e8f7b3
2 changed files with 12 additions and 1 deletions

View File

@@ -277,6 +277,16 @@ std::string DrawUtil::formatVector(const Base::Vector3d& v)
return result;
}
std::string DrawUtil::formatVector(const Base::Vector2d& v)
{
std::string result;
std::stringstream builder;
builder << std::fixed << std::setprecision(3) ;
builder << " (" << v.x << "," << v.y << ") ";
result = builder.str();
return result;
}
//! compare 2 vectors for sorting - true if v1 < v2
bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
{
@@ -293,7 +303,6 @@ bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
return result;
}
//!convert fromPoint in coordinate system fromSystem to reference coordinate system
Base::Vector3d DrawUtil::toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint)
{