Add formatter for gp_Pnt

This commit is contained in:
wandererfan
2018-10-29 19:59:00 -04:00
committed by wmayer
parent aca61e829d
commit 47f4a9dacb
2 changed files with 11 additions and 0 deletions

View File

@@ -317,6 +317,16 @@ std::string DrawUtil::formatVector(const gp_Vec& v)
return result;
}
std::string DrawUtil::formatVector(const gp_Pnt& v)
{
std::string result;
std::stringstream builder;
builder << std::fixed << std::setprecision(3) ;
builder << " (" << v.X() << "," << v.Y() << "," << v.Z() << ") ";
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)

View File

@@ -73,6 +73,7 @@ class TechDrawExport DrawUtil {
static std::string formatVector(const Base::Vector2d& v);
static std::string formatVector(const gp_Dir& v);
static std::string formatVector(const gp_Vec& v);
static std::string formatVector(const gp_Pnt& v);
static bool vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2);
static Base::Vector3d toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint);
static bool checkParallel(const Base::Vector3d v1, const Base::Vector3d v2, double tolerance = FLT_EPSILON);