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
c0d4db71
Commit
c0d4db71
authored
May 10, 2012
by
Alexander Wiebel
Browse files
[MERGE]
parents
06d2fa79
6084c618
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
93 additions
and
45 deletions
+93
-45
src/CMakeLists.txt
src/CMakeLists.txt
+4
-1
src/core/common/WLimits.h
src/core/common/WLimits.h
+4
-4
src/core/common/math/WMath.h
src/core/common/math/WMath.h
+0
-17
src/core/dataHandler/WDataSetTimeSeries.cpp
src/core/dataHandler/WDataSetTimeSeries.cpp
+3
-3
src/core/dataHandler/WDataSetTimeSeries.h
src/core/dataHandler/WDataSetTimeSeries.h
+2
-2
src/core/dataHandler/WThreadedTrackingFunction.cpp
src/core/dataHandler/WThreadedTrackingFunction.cpp
+1
-1
src/core/graphicsEngine/WGETexture.h
src/core/graphicsEngine/WGETexture.h
+0
-1
src/modules/bermanTracking/WMBermanTracking.cpp
src/modules/bermanTracking/WMBermanTracking.cpp
+1
-1
src/modules/splineSurface/WMSplineSurface.cpp
src/modules/splineSurface/WMSplineSurface.cpp
+1
-1
src/modules/writeMesh/WMWriteMesh.cpp
src/modules/writeMesh/WMWriteMesh.cpp
+4
-3
src/qt4gui/qt4/controlPanel/WQtControlPanel.cpp
src/qt4gui/qt4/controlPanel/WQtControlPanel.cpp
+55
-7
src/qt4gui/qt4/controlPanel/WQtControlPanel.h
src/qt4gui/qt4/controlPanel/WQtControlPanel.h
+6
-0
tools/cmake/OpenWalnut.cmake
tools/cmake/OpenWalnut.cmake
+12
-4
No files found.
src/CMakeLists.txt
View file @
c0d4db71
...
...
@@ -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/WLimits.h
View file @
c0d4db71
...
...
@@ -65,7 +65,7 @@ namespace wlimits
*
* \return True if the value is a NaN, false otherwise.
*/
template
<
typename
T
>
bool
is
nan
(
T
value
);
template
<
typename
T
>
bool
is
NaN
(
T
value
);
/**
* Determines if a number is considered as infinity or not.
...
...
@@ -76,15 +76,15 @@ namespace wlimits
*
* \return True if the value is infinity, false otherwise.
*/
template
<
typename
T
>
bool
is
i
nf
(
T
value
);
template
<
typename
T
>
bool
is
I
nf
(
T
value
);
}
template
<
typename
T
>
bool
wlimits
::
is
nan
(
T
value
)
template
<
typename
T
>
bool
wlimits
::
is
NaN
(
T
value
)
{
return
boost
::
math
::
isnan
(
value
);
}
template
<
typename
T
>
bool
wlimits
::
is
i
nf
(
T
value
)
template
<
typename
T
>
bool
wlimits
::
is
I
nf
(
T
value
)
{
return
boost
::
math
::
isinf
(
value
);
}
...
...
src/core/common/math/WMath.h
View file @
c0d4db71
...
...
@@ -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/core/dataHandler/WDataSetTimeSeries.cpp
View file @
c0d4db71
...
...
@@ -51,7 +51,7 @@ WDataSetTimeSeries::WDataSetTimeSeries( std::vector< boost::shared_ptr< WDataSet
{
WAssert
(
*
dit
,
""
);
WAssert
(
g
==
boost
::
shared_dynamic_cast
<
WGridRegular3D
>
(
(
*
dit
)
->
getGrid
()
),
""
);
WAssert
(
!
wlimits
::
is
nan
(
*
tit
),
""
);
WAssert
(
!
wlimits
::
is
NaN
(
*
tit
),
""
);
WAssert
(
d
==
(
*
dit
)
->
getValueSet
()
->
getDataType
(),
""
);
WAssert
(
(
*
dit
)
->
getValueSet
()
->
dimension
()
==
1
,
""
);
WAssert
(
(
*
dit
)
->
getValueSet
()
->
order
()
==
0
,
""
);
...
...
@@ -107,7 +107,7 @@ bool WDataSetTimeSeries::isTimeSlice( float time ) const
float
WDataSetTimeSeries
::
findNearestTimeSlice
(
float
time
)
const
{
WAssert
(
!
wlimits
::
is
nan
(
time
),
""
);
WAssert
(
!
wlimits
::
is
NaN
(
time
),
""
);
if
(
time
>
getMaxTime
()
)
{
return
getMaxTime
();
...
...
@@ -129,7 +129,7 @@ boost::shared_ptr< WDataSetScalar const > WDataSetTimeSeries::getDataSetPtrAtTim
boost
::
shared_ptr
<
WDataSetScalar
const
>
WDataSetTimeSeries
::
calcDataSetAtTime
(
float
time
,
std
::
string
const
&
name
)
const
{
WAssert
(
!
wlimits
::
is
nan
(
time
),
""
);
WAssert
(
!
wlimits
::
is
NaN
(
time
),
""
);
if
(
time
<
getMinTime
()
||
time
>
getMaxTime
()
)
{
return
boost
::
shared_ptr
<
WDataSetScalar
const
>
();
...
...
src/core/dataHandler/WDataSetTimeSeries.h
View file @
c0d4db71
...
...
@@ -263,8 +263,8 @@ Data_T WDataSetTimeSeries::interpolate( WVector3d const& pos, float time, bool*
{
static
const
float
inf
=
std
::
numeric_limits
<
float
>::
infinity
();
WAssert
(
success
,
""
);
WAssert
(
!
wlimits
::
is
nan
(
length
(
pos
)
),
""
);
WAssert
(
!
wlimits
::
is
nan
(
time
),
""
);
WAssert
(
!
wlimits
::
is
NaN
(
length
(
pos
)
),
""
);
WAssert
(
!
wlimits
::
is
NaN
(
time
),
""
);
if
(
time
<
getMinTime
()
||
time
>
getMaxTime
()
)
{
*
success
=
false
;
...
...
src/core/dataHandler/WThreadedTrackingFunction.cpp
View file @
c0d4db71
...
...
@@ -49,7 +49,7 @@ namespace wtracking
// find t such that job.first() + t * dir is a point on the boundary of the current voxel
double
t
=
getDistanceToBoundary
(
g
,
job
.
first
,
dir
);
WAssert
(
!
wlimits
::
is
i
nf
(
t
)
&&
!
wlimits
::
is
nan
(
t
),
"Warning in WTrackingUtility::followToNextVoxel NaN's or INF's occured"
);
WAssert
(
!
wlimits
::
is
I
nf
(
t
)
&&
!
wlimits
::
is
NaN
(
t
),
"Warning in WTrackingUtility::followToNextVoxel NaN's or INF's occured"
);
WAssert
(
t
>
0.0
,
""
);
WAssert
(
onBoundary
(
g
,
job
.
first
+
dir
*
t
),
""
);
...
...
src/core/graphicsEngine/WGETexture.h
View file @
c0d4db71
...
...
@@ -37,7 +37,6 @@
#include <osg/Texture3D>
#include "callbacks/WGEFunctorCallback.h"
#include "../common/WLimits.h"
#include "../common/WBoundingBox.h"
#include "../common/WProperties.h"
#include "../common/WPropertyHelper.h"
...
...
src/modules/bermanTracking/WMBermanTracking.cpp
View file @
c0d4db71
...
...
@@ -422,7 +422,7 @@ WSymmetricSphericalHarmonic WMBermanTracking::createRandomODF( std::size_t i )
// "-", because the residuals in the input dataset have differing sign
q
(
k
,
0
)
=
v
(
k
,
0
)
-
(
m_dataSetResidual
->
getValueAt
(
i
*
v
.
rows
()
+
z
)
/
(
sqrt
(
1.0
-
m_HMat
(
k
,
k
)
)
)
);
WAssert
(
!
wlimits
::
is
nan
(
q
(
k
,
0
)
),
""
);
WAssert
(
!
wlimits
::
is
NaN
(
q
(
k
,
0
)
),
""
);
}
// now calc new sh coeffs from the resampled hardi data
...
...
src/modules/splineSurface/WMSplineSurface.cpp
View file @
c0d4db71
...
...
@@ -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 @
c0d4db71
...
...
@@ -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
;
...
...
src/qt4gui/qt4/controlPanel/WQtControlPanel.cpp
View file @
c0d4db71
...
...
@@ -70,7 +70,8 @@
WQtControlPanel
::
WQtControlPanel
(
WMainWindow
*
parent
)
:
QDockWidget
(
"Control Panel"
,
parent
),
m_ignoreSelectionChange
(
false
),
m_activeModule
(
WModule
::
SPtr
()
)
m_activeModule
(
WModule
::
SPtr
()
),
m_previousTab
()
{
setObjectName
(
"Control Panel Dock"
);
...
...
@@ -874,6 +875,45 @@ void WQtControlPanel::setActiveModule( WModule::SPtr module, bool forceUpdate )
buildPropTab
(
module
->
getProperties
(),
module
->
getInformationProperties
()
);
}
// re-select the previous tab
bool
foundTab
=
false
;
std
::
map
<
QString
,
int
>
priorityList
;
if
(
m_previousTab
!=
""
)
{
// search the tab with the previous title
for
(
size_t
idx
=
0
;
idx
<
m_tabWidget
->
count
();
++
idx
)
{
if
(
m_tabWidget
->
tabText
(
idx
)
==
m_previousTab
)
{
m_tabWidget
->
setCurrentIndex
(
idx
);
foundTab
=
true
;
break
;
}
// keep track of the indices in the tab. we use this map later as priority list. Please not that we add 1 to the index. This ensures
// that the invalid index is 0, even if it is -1 in Qt.
priorityList
[
m_tabWidget
->
tabText
(
idx
)
]
=
idx
+
1
;
}
if
(
!
foundTab
)
{
// the tab does not exist anymore. We need to use our priority list
if
(
priorityList
[
"Settings"
]
!=
0
)
{
m_tabWidget
->
setCurrentIndex
(
priorityList
[
"Settings"
]
-
1
);
}
else
if
(
priorityList
[
"Information"
]
!=
0
)
{
m_tabWidget
->
setCurrentIndex
(
priorityList
[
"Settings"
]
-
1
);
}
else
{
// there is no info and no settings tab. Set the first tab.
m_tabWidget
->
setCurrentIndex
(
0
);
}
}
}
// update compatibles toolbar
createCompatibleButtons
(
module
);
...
...
@@ -943,13 +983,16 @@ void WQtControlPanel::buildPropTab( boost::shared_ptr< WProperties > props, boos
int
propIdx
=
addTabWidgetContent
(
tab
);
// select the property widget preferably
if
(
propIdx
!=
-
1
)
{
m_tabWidget
->
setCurrentIndex
(
propIdx
);
}
else
if
(
infoIdx
!=
-
1
)
if
(
m_previousTab
==
""
)
{
m_tabWidget
->
setCurrentIndex
(
infoIdx
);
if
(
propIdx
!=
-
1
)
{
m_tabWidget
->
setCurrentIndex
(
propIdx
);
}
else
if
(
infoIdx
!=
-
1
)
{
m_tabWidget
->
setCurrentIndex
(
infoIdx
);
}
}
}
...
...
@@ -1240,6 +1283,11 @@ QAction* WQtControlPanel::getMissingModuleAction() const
void
WQtControlPanel
::
clearAndDeleteTabs
()
{
if
(
m_tabWidget
->
currentIndex
()
!=
-
1
)
{
m_previousTab
=
m_tabWidget
->
tabText
(
m_tabWidget
->
currentIndex
()
);
}
m_tabWidget
->
setDisabled
(
true
);
QWidget
*
widget
;
while
(
(
widget
=
m_tabWidget
->
widget
(
0
)
))
...
...
src/qt4gui/qt4/controlPanel/WQtControlPanel.h
View file @
c0d4db71
...
...
@@ -379,6 +379,12 @@ private:
* The module currently active
*/
WModule
::
SPtr
m_activeModule
;
/**
* The title of the last selected tab in the control panel. This needs to be done using the tab name as the tab index is not consistent(
* depending on the number of tabs. Sometimes, some tabs are not visible).
*/
QString
m_previousTab
;
private
slots
:
/**
* function that gets called when a tree item is selected, on a new select that tab widget
...
...
tools/cmake/OpenWalnut.cmake
View file @
c0d4db71
...
...
@@ -244,11 +244,19 @@ ADD_DEFINITIONS( "-DBOOST_FILESYSTEM_VERSION=3" )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# OpenGL, at least 1.2
# See http://www.opengl.org
#
FIND_PACKAGE
(
OpenGL REQUIRED
)
# include the OpenGL header paths
INCLUDE_DIRECTORIES
(
${
OPENGL_INCLUDE_DIR
}
)
# Find OpenGL or OpenGL ES on Android
IF
(
ANDROID
)
# on Android, we rely on the fact the the GLES headers reside in the correct NDK search paths
# -> so we do not add the include dir directly. We only set the variables needed to fake a found OpenGL:
SET
(
OPENGL_FOUND ON
)
# link against GLES 2
SET
(
OPENGL_LIBRARIES
"GLESv2"
)
ELSE
()
FIND_PACKAGE
(
OpenGL REQUIRED
)
# include the OpenGL header paths
INCLUDE_DIRECTORIES
(
${
OPENGL_INCLUDE_DIR
}
)
ENDIF
()
# -----------------------------------------------------------------------------------------------------------------------------------------------
# OpenSceneGraph, at least 2.8.0
...
...
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