X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Tool.cxx;h=f6f0f5a84525e887700d7357bb79c09c5822e1cd;hb=9c947f35615e69e9e54a8c4b074dd1f2be13689c;hp=def682d94cc6900d6cc1ad2aaccf967460f70edc;hpb=e423cfd15575a1feb27386b5516bd0c83bed5fe9;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Tool.cxx b/src/HYDROData/HYDROData_Tool.cxx index def682d9..f6f0f5a8 100644 --- a/src/HYDROData/HYDROData_Tool.cxx +++ b/src/HYDROData/HYDROData_Tool.cxx @@ -282,6 +282,14 @@ Quantity_Color HYDROData_Tool::toOccColor( const QColor& theColor ) return Quantity_Color( r, g, b, Quantity_TOC_RGB ); } +QColor HYDROData_Tool::toQtColor( const Quantity_Color& theColor ) +{ + int r = 255 * theColor.Red(); + int g = 255 * theColor.Green(); + int b = 255 * theColor.Blue(); + return QColor( r, g, b ); +} + std::ostream& operator<<( std::ostream& theStream, const QString& theText ) { theStream << theText.toStdString(); @@ -306,3 +314,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; + +}