X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Tool.cxx;h=7d1339241db68abd290f6b348fa52791943294ba;hb=d398a8be8e0b0259b476b358d53d234ce4c82379;hp=051fdc917852ca3e767f5fb7970eeecb82232445;hpb=fb0d542a0fb78f0084af11451080811d9e080871;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Tool.cxx b/src/HYDROData/HYDROData_Tool.cxx index 051fdc91..7d133924 100644 --- a/src/HYDROData/HYDROData_Tool.cxx +++ b/src/HYDROData/HYDROData_Tool.cxx @@ -40,6 +40,7 @@ #include #include #include +#include static int aMaxNameId = std::numeric_limits::max(); @@ -290,6 +291,24 @@ QColor HYDROData_Tool::toQtColor( const Quantity_Color& theColor ) return QColor( r, g, b ); } +bool HYDROData_Tool::IsNan( double theValue ) +{ +#ifdef WIN32 + return _isnan( theValue ); +#else + return isnan( theValue ); +#endif +} + +bool HYDROData_Tool::IsInf( double theValue ) +{ +#ifdef WIN32 + return (!_finite( theValue ) ); +#else + return isinf( theValue ); +#endif +} + std::ostream& operator<<( std::ostream& theStream, const QString& theText ) { theStream << theText.toStdString(); @@ -314,3 +333,17 @@ std::ostream& operator<<( std::ostream& theStream, const TopoDS_Face& theFace ) return theStream; } +std::ostream& operator<<( std::ostream& theStream, const gp_XY& theXY ) +{ + theStream << "(" << theXY.X() << "; " << theXY.Y() << ")"; + return theStream; +} + +bool operator == ( const gp_XY& thePoint1, const gp_XY& thePoint2 ) +{ + const double EPS = 1E-3; + return + fabs( thePoint1.X() - thePoint2.X() ) < EPS && + fabs( thePoint1.Y() - thePoint2.Y() ) < EPS; + +}