if ( !isXOk || !isYOk || !isZOk )
return false;
- if ( isnan( aPoint.X() ) || isinf( aPoint.X() ) ||
- isnan( aPoint.Y() ) || isinf( aPoint.Y() ) ||
- isnan( aPoint.Z() ) || isinf( aPoint.Z() ) )
+ if ( HYDROData_Tool::IsNan( aPoint.X() ) || HYDROData_Tool::IsInf( aPoint.X() ) ||
+ HYDROData_Tool::IsNan( aPoint.Y() ) || HYDROData_Tool::IsInf( aPoint.Y() ) ||
+ HYDROData_Tool::IsNan( aPoint.Z() ) || HYDROData_Tool::IsInf( aPoint.Z() ) )
return false;
// Invert the z value if requested
#include "HYDROData_Document.h"
#include "HYDROData_Lambert93.h"
#include "HYDROData_OperationsFactory.h"
+#include "HYDROData_Tool.h"
#include <TDataStd_RealArray.hxx>
#include <TDataStd_ByteArray.hxx>
// Check the result
if ( !isDoubleOk ||
- isnan( aDoubleValue ) ||
- isinf( aDoubleValue ) ) {
+ HYDROData_Tool::IsNan( aDoubleValue ) ||
+ HYDROData_Tool::IsInf( aDoubleValue ) ) {
continue;
}
double aCoordX = aValX.RealValue();
double aCoordY = aValY.RealValue();
- if ( isnan( aCoordX ) || isinf( aCoordX ) ||
- isnan( aCoordY ) || isinf( aCoordY ) )
+ if ( HYDROData_Tool::IsNan( aCoordX ) || HYDROData_Tool::IsInf( aCoordX ) ||
+ HYDROData_Tool::IsNan( aCoordY ) || HYDROData_Tool::IsInf( aCoordY ) )
aRes = false;
if ( anIsParametric )
}
double aCoordZ = aValZ.RealValue();
- if ( isnan( aCoordZ ) || isinf( aCoordZ ) )
+ if ( HYDROData_Tool::IsNan( aCoordZ ) || HYDROData_Tool::IsInf( aCoordZ ) )
aRes = false;
ProfilePoint aPoint( aCoordX, aCoordY, aCoordZ );
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <limits>
+#include <math.h>
static int aMaxNameId = std::numeric_limits<int>::max();
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();
static Quantity_Color toOccColor( const QColor& );
static QColor toQtColor( const Quantity_Color& );
+
+ static bool IsNan( double theValue );
+ static bool IsInf( double theValue );
};
inline bool ValuesEquals( const double& theFirst, const double& theSecond )