Commit dccd2c56 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[REMOVE] removed myisfinite used in two modules. This can be done using wlimits::isinf.

parent ef6bec66
......@@ -152,5 +152,8 @@ ENDIF()
# Modules
# build modules
ADD_SUBDIRECTORY( modules )
OPTION( OW_MODULE_BUILD "Enable this to build the modules." ON )
IF( OW_MODULE_BUILD )
ADD_SUBDIRECTORY( modules )
ENDIF()
......@@ -29,7 +29,6 @@
#include <boost/math/constants/constants.hpp>
#include "WLine.h"
#include "WPlane.h"
#include "linearAlgebra/WLinearAlgebra.h"
......@@ -50,22 +49,6 @@ const float piFloat = boost::math::constants::pi<float>();
*/
const double piDouble = boost::math::constants::pi<double>();
/**
* Tests whether the number stored in the parameter is finite.
* \param number the number to be tested
*/
inline int myIsfinite( double number )
{
#if defined( __linux__ ) || defined( __APPLE__ )
// C99 defines isfinite() as a macro.
return std::isfinite(number);
#elif defined( _WIN32 )
// Microsoft Visual C++ and Borland C++ Builder use _finite().
return _finite(number);
#else
WAssert( false, "isfinite not provided on this platform or platform not known." );
#endif
}
/**
* Checks if the triangle intersects with the given plane. If you are interested in the points of
* intersection if any \see intersection().
......
......@@ -291,7 +291,7 @@ bool WMSplineSurface::save() const
// for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
// {
// point = m_triMesh->getVertex( i );
// if( !( myIsfinite( point[0] ) && myIsfinite( point[1] ) && myIsfinite( point[2] ) ) )
// if( !( !wlimits::isinf( point[0] ) && !wlimits::isinf( point[1] ) && !wlimits::isinf( point[2] ) ) )
// {
// WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Marching Cubes", LL_ERROR );
// return false;
......
......@@ -29,6 +29,7 @@
#include "core/common/WStringUtils.h"
#include "core/common/math/WMath.h"
#include "core/common/WPathHelper.h"
#include "core/common/WLimits.h"
#include "core/kernel/WKernel.h"
#include "WMWriteMesh.xpm"
#include "WMWriteMesh.h"
......@@ -186,7 +187,7 @@ bool WMWriteMesh::saveVTKASCII() const
for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{
point = m_triMesh->getVertex( i );
if( !( myIsfinite( point[0] ) && myIsfinite( point[1] ) && myIsfinite( point[2] ) ) )
if( !( !wlimits::isinf( point[0] ) && !wlimits::isinf( point[1] ) && !wlimits::isinf( point[2] ) ) )
{
WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Write Mesh", LL_ERROR );
return false;
......@@ -267,7 +268,7 @@ bool WMWriteMesh::saveJson()
for( size_t i = 0; i < meshes[k]->vertSize() - 1; ++i )
{
point = meshes[k]->getVertex( i );
if( !( myIsfinite( point[0] ) && myIsfinite( point[1] ) && myIsfinite( point[2] ) ) )
if( !( !wlimits::isinf( point[0] ) && !wlimits::isinf( point[1] ) && !wlimits::isinf( point[2] ) ) )
{
WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Write Mesh", LL_ERROR );
return false;
......@@ -282,7 +283,7 @@ bool WMWriteMesh::saveJson()
for( size_t i = 0; i < meshes[k]->vertSize() - 1; ++i )
{
normal = meshes[k]->getNormal( i );
if( !( myIsfinite( normal[0] ) && myIsfinite( normal[1] ) && myIsfinite( normal[2] ) ) )
if( !( !wlimits::isinf( normal[0] ) && !wlimits::isinf( normal[1] ) && !wlimits::isinf( normal[2] ) ) )
{
WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Write Mesh", LL_ERROR );
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment