Add formatVector for Vector2d
This commit is contained in:
parent
7959d846fc
commit
fad1edb9ce
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <Base/Tools2D.h>
|
||||
#include <Base/Vector3D.h>
|
||||
#include <Base/Matrix.h>
|
||||
|
||||
|
@ -59,6 +60,7 @@ class TechDrawExport DrawUtil {
|
|||
static bool fpCompare(const double& d1, const double& d2);
|
||||
static Base::Vector3d vertex2Vector(const TopoDS_Vertex& v);
|
||||
static std::string formatVector(const Base::Vector3d& v);
|
||||
static std::string formatVector(const Base::Vector2d& 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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user