Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
dccd2c56
Commit
dccd2c56
authored
May 09, 2012
by
Sebastian Eichelbaum
Browse files
[REMOVE] removed myisfinite used in two modules. This can be done using wlimits::isinf.
parent
ef6bec66
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
22 deletions
+9
-22
src/CMakeLists.txt
src/CMakeLists.txt
+4
-1
src/core/common/math/WMath.h
src/core/common/math/WMath.h
+0
-17
src/modules/splineSurface/WMSplineSurface.cpp
src/modules/splineSurface/WMSplineSurface.cpp
+1
-1
src/modules/writeMesh/WMWriteMesh.cpp
src/modules/writeMesh/WMWriteMesh.cpp
+4
-3
No files found.
src/CMakeLists.txt
View file @
dccd2c56
...
...
@@ -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
()
src/core/common/math/WMath.h
View file @
dccd2c56
...
...
@@ -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().
...
...
src/modules/splineSurface/WMSplineSurface.cpp
View file @
dccd2c56
...
...
@@ -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;
...
...
src/modules/writeMesh/WMWriteMesh.cpp
View file @
dccd2c56
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment