Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
cae43661
Commit
cae43661
authored
Jul 02, 2011
by
Robert Frohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CHANGE] - update for the module layouting graph
parent
6e081e93
Changes
70
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
2113 additions
and
704 deletions
+2113
-704
.hgchurn
.hgchurn
+2
-1
.hgignore
.hgignore
+1
-0
README
README
+50
-5
VERSION
VERSION
+9
-1
src/CMakeLists.txt
src/CMakeLists.txt
+160
-41
src/core/CMakeLists.txt
src/core/CMakeLists.txt
+47
-14
src/core/common/WPathHelper.cpp
src/core/common/WPathHelper.cpp
+9
-35
src/core/common/WPathHelper.h
src/core/common/WPathHelper.h
+1
-8
src/core/common/WPredicateHelper.h
src/core/common/WPredicateHelper.h
+26
-0
src/core/common/math/WLinearAlgebraFunctions.cpp
src/core/common/math/WLinearAlgebraFunctions.cpp
+1
-1
src/core/common/math/WMatrix.h
src/core/common/math/WMatrix.h
+3
-0
src/core/common/math/linearAlgebra/WMatrixEigen.h
src/core/common/math/linearAlgebra/WMatrixEigen.h
+2
-2
src/core/common/math/linearAlgebra/WMatrixFixed.h
src/core/common/math/linearAlgebra/WMatrixFixed.h
+78
-4
src/core/common/math/linearAlgebra/test/WMatrixFixed_test.h
src/core/common/math/linearAlgebra/test/WMatrixFixed_test.h
+88
-0
src/core/dataHandler/io/WReaderNIfTI.h
src/core/dataHandler/io/WReaderNIfTI.h
+3
-1
src/core/graphicsEngine/WGEZoomTrackballManipulator.cpp
src/core/graphicsEngine/WGEZoomTrackballManipulator.cpp
+11
-2
src/core/graphicsEngine/WGEZoomTrackballManipulator.h
src/core/graphicsEngine/WGEZoomTrackballManipulator.h
+14
-0
src/core/graphicsEngine/WGraphicsEngine.cpp
src/core/graphicsEngine/WGraphicsEngine.cpp
+21
-10
src/core/graphicsEngine/WGraphicsEngine.h
src/core/graphicsEngine/WGraphicsEngine.h
+14
-0
src/core/graphicsEngine/WTriangleMesh.cpp
src/core/graphicsEngine/WTriangleMesh.cpp
+6
-0
src/core/graphicsEngine/WTriangleMesh.h
src/core/graphicsEngine/WTriangleMesh.h
+8
-0
src/core/kernel/WKernel.cpp
src/core/kernel/WKernel.cpp
+0
-26
src/core/kernel/WModule.cpp
src/core/kernel/WModule.cpp
+1
-1
src/core/kernel/WModule.h
src/core/kernel/WModule.h
+10
-0
src/core/kernel/WModuleFactory.cpp
src/core/kernel/WModuleFactory.cpp
+20
-0
src/core/kernel/WModuleFactory.h
src/core/kernel/WModuleFactory.h
+10
-1
src/core/kernel/WModuleLoader.cpp
src/core/kernel/WModuleLoader.cpp
+15
-3
src/ext/CMakeLists.txt
src/ext/CMakeLists.txt
+1
-7
src/ext/biosig/CMakeLists.txt
src/ext/biosig/CMakeLists.txt
+11
-4
src/ext/biosigWin/CMakeLists.txt
src/ext/biosigWin/CMakeLists.txt
+11
-3
src/ext/libeep/CMakeLists.txt
src/ext/libeep/CMakeLists.txt
+13
-5
src/ext/nifti/CMakeLists.txt
src/ext/nifti/CMakeLists.txt
+16
-4
src/modules/HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.cpp
...HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.cpp
+0
-1
src/modules/detTractClustering/CMakeLists.txt
src/modules/detTractClustering/CMakeLists.txt
+1
-1
src/modules/effectiveConnectivityCluster/WMEffectiveConnectivityCluster.cpp
...iveConnectivityCluster/WMEffectiveConnectivityCluster.cpp
+0
-1
src/modules/eigenSystem/WMEigenSystem.h
src/modules/eigenSystem/WMEigenSystem.h
+1
-1
src/modules/gaussProcesses/WGaussProcess.cpp
src/modules/gaussProcesses/WGaussProcess.cpp
+2
-1
src/modules/gaussProcesses/WGaussProcess.h
src/modules/gaussProcesses/WGaussProcess.h
+2
-1
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+0
-9
src/modules/modules-others.toolbox
src/modules/modules-others.toolbox
+1
-0
src/modules/readMesh/WMReadMesh.cpp
src/modules/readMesh/WMReadMesh.cpp
+339
-122
src/modules/readMesh/WMReadMesh.h
src/modules/readMesh/WMReadMesh.h
+15
-0
src/modules/splineSurface/WMSplineSurface.cpp
src/modules/splineSurface/WMSplineSurface.cpp
+0
-1
src/modules/template/WMTemplate.cpp
src/modules/template/WMTemplate.cpp
+2
-0
src/modules/writeMesh/WMWriteMesh.cpp
src/modules/writeMesh/WMWriteMesh.cpp
+143
-28
src/modules/writeMesh/WMWriteMesh.h
src/modules/writeMesh/WMWriteMesh.h
+20
-1
src/modules/writeMesh/test/WMWriteMesh_test.h
src/modules/writeMesh/test/WMWriteMesh_test.h
+3
-3
src/modules/writeNIfTI/WMWriteNIfTI.cpp
src/modules/writeNIfTI/WMWriteNIfTI.cpp
+3
-1
src/modules/writeTracts/WMWriteTracts.cpp
src/modules/writeTracts/WMWriteTracts.cpp
+342
-6
src/modules/writeTracts/WMWriteTracts.h
src/modules/writeTracts/WMWriteTracts.h
+26
-0
src/qt4gui/CMakeLists.txt
src/qt4gui/CMakeLists.txt
+27
-11
src/qt4gui/OpenWalnut.cpp
src/qt4gui/OpenWalnut.cpp
+78
-10
src/qt4gui/icons/WIcons.xpm
src/qt4gui/icons/WIcons.xpm
+6
-0
src/qt4gui/qt4/WIconManager.cpp
src/qt4gui/qt4/WIconManager.cpp
+17
-1
src/qt4gui/qt4/WIconManager.h
src/qt4gui/qt4/WIconManager.h
+8
-0
src/qt4gui/qt4/WMainWindow.cpp
src/qt4gui/qt4/WMainWindow.cpp
+146
-135
src/qt4gui/qt4/WMainWindow.h
src/qt4gui/qt4/WMainWindow.h
+18
-9
src/qt4gui/qt4/WQt4Gui.cpp
src/qt4gui/qt4/WQt4Gui.cpp
+18
-64
src/qt4gui/qt4/WQt4Gui.h
src/qt4gui/qt4/WQt4Gui.h
+16
-13
src/qt4gui/qt4/WQtCombinerActionList.cpp
src/qt4gui/qt4/WQtCombinerActionList.cpp
+2
-31
src/qt4gui/qt4/WQtCombinerActionList.h
src/qt4gui/qt4/WQtCombinerActionList.h
+16
-3
src/qt4gui/qt4/WQtCombinerToolbar.cpp
src/qt4gui/qt4/WQtCombinerToolbar.cpp
+10
-33
src/qt4gui/qt4/WQtCombinerToolbar.h
src/qt4gui/qt4/WQtCombinerToolbar.h
+2
-1
src/qt4gui/qt4/WQtGLWidget.cpp
src/qt4gui/qt4/WQtGLWidget.cpp
+56
-5
src/qt4gui/qt4/WQtGLWidget.h
src/qt4gui/qt4/WQtGLWidget.h
+42
-6
src/qt4gui/qt4/WQtToolBar.cpp
src/qt4gui/qt4/WQtToolBar.cpp
+4
-8
src/qt4gui/qt4/WQtToolBar.h
src/qt4gui/qt4/WQtToolBar.h
+5
-4
src/qt4gui/qt4/controlPanel/WQtControlPanel.cpp
src/qt4gui/qt4/controlPanel/WQtControlPanel.cpp
+45
-13
src/qt4gui/qt4/controlPanel/WQtControlPanel.h
src/qt4gui/qt4/controlPanel/WQtControlPanel.h
+32
-0
src/qt4gui/qt4/guiElements/WQtModuleOneToOneCombinerAction.cpp
...t4gui/qt4/guiElements/WQtModuleOneToOneCombinerAction.cpp
+3
-1
No files found.
.hgchurn
View file @
cae43661
...
...
@@ -26,4 +26,5 @@ dirk_albrecht@gmx.net Dirk_Albrecht
albrecht Dirk_Albrecht
mstuber Marcus_Stuber
skiunke Sebastian_Kiunke
a_berres@informatik.uni-kl.de Anne_Berres
\ No newline at end of file
a_berres@informatik.uni-kl.de Anne_Berres
gsommer_by@gmx.de Gerald_Sommer
\ No newline at end of file
.hgignore
View file @
cae43661
...
...
@@ -7,6 +7,7 @@ syntax: glob
# switch to regexp syntax.
syntax: regexp
^doc/core/html
^doc/developer/html
^doc/developer/man
^doc/developer/doxyerror.log
...
...
README
View file @
cae43661
We keep this README short, since we have much documentation and information
online. So, for detailed information have a look at http://www.openwalnut.org.
OpenWalnut
==========
OpenWalnut is an open source tool for multi-modal medical and brain data
visualization. Its universality allows it to be easily extended and used in a
large variety of application cases. It is both, a tool for the scientific user
and a powerful framework for the visualization researcher. OpenWalnut is
licensed under the terms of the GNU Lesser General Public License. Written
entirely in Standard C++ and using a number of portable libraries (e.g.
OpenSceneGraph and Qt), it runs on all Windows platforms, OSX, and
GNU/Linux operating systems.
- please refer to http://www.openwalnut.org for extensive documentation
and information.
AUTHORS AND CONTRIBUTORS
========================
See the files "AUTHORS" and "CONTRIBUTORS".
LICENSE
=======
We provide dual licensing. You can choose to use either GPLv3 or LGPLv3.
See "COPYING" and "COPYING.LESSER".
CONTACT
=======
...
...
@@ -19,9 +42,25 @@ If you have questions, comments, problems or find Bugs, contact us using:
follow the instructions.
* IRC: Occasionally you can contact us at irc.freenode.net #ow.
INSTALLING
==========
You have several options for installing OpenWalnut.
* Build it -> see next section
* Download a binary archive from our website and extract it
* Inside the extracted directory, run bin/openwalnut
* Download one of our binary packages for your distribution
* Check the NeuroDebian repository
* We are currently working on a OpenWalnut package which is intended to be
released in NeuroDebian (http://neuro.debian.net/)
BUILDING
========
As you currently read this README, we presume that you already have the source.
If not, check http://www.openwalnut.org. There, you can download source archives
and get the URL to our mercurial repository.
Required Dependencies:
----------------------
...
...
@@ -38,12 +77,18 @@ by using the common routine:
cd build
cmake ../src
make
make install -- this is optional
make install -- this is optional
and installs everything.
After that, OpenWalnut can be used inside the build directory.
Compilation on Windows:
-----------------------
If you want to install only a part of OpenWalnut, you can issue
make list_install_tarets
The listed targets will then only install the specified part.
Compilation on Windows and Mac:
-------------------------------
This is a little bit more complicated. We give you a step-by-step explanation
on http://www.openwalnut.org.
...
...
VERSION
View file @
cae43661
CHECKOUT
# OW Version File. This file specifies the version. The line VERSION=X.Y.Z is
# used and parsed. If you do not want a version, comment it out.
#
# IMPORTANT: If you modify the file, cmake re-creates the version header. But
# it is not able to set all library version. Please re-run cmake if
# you change something here.
#
# NOTE: do not add a space after #. The current CMake script will fail.
#VERSION=1.3.0
src/CMakeLists.txt
View file @
cae43661
This diff is collapsed.
Click to expand it.
src/core/CMakeLists.txt
View file @
cae43661
...
...
@@ -48,7 +48,7 @@ COLLECT_COMPILE_FILES( "${CMAKE_CURRENT_SOURCE_DIR}" TARGET_CPP_FILES TARGET_H_F
# Setup the target
ADD_LIBRARY
(
${
LibName
}
SHARED
${
TARGET_CPP_FILES
}
${
TARGET_H_FILES
}
${
OW_VERSION_HEADER
}
)
TARGET_LINK_LIBRARIES
(
${
LibName
}
${
OWExtBioSigName
}
${
OWExtEEPName
}
${
OWExtNiftiName
}
TARGET_LINK_LIBRARIES
(
${
LibName
}
${
OWExtBioSigName
}
${
OWExtEEPName
}
${
OWExtNifti
IO
Name
}
${
Boost_LIBRARIES
}
${
CMAKE_DL_LIBS
}
${
OPENGL_gl_LIBRARY
}
${
OPENSCENEGRAPH_LIBRARIES
}
)
...
...
@@ -56,20 +56,19 @@ TARGET_LINK_LIBRARIES( ${LibName} ${OWExtBioSigName} ${OWExtEEPName} ${OWExtNift
# NOTE: this needs to be placed AFTER ADD_EXECUTABLE or ADD_LIBRARY
SETUP_USE_VERSION_HEADER
(
${
LibName
}
)
# Do not forget the install targets
INSTALL
(
TARGETS
${
LibName
}
ARCHIVE
# NOTE: this is needed on windows
DESTINATION
${
OW_LIBRARY_DIR_RELATIVE
}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY
# NOTE: this is needed for all the others
DESTINATION
${
OW_LIBRARY_DIR_RELATIVE
}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
# Set the version of the library.
SET_TARGET_PROPERTIES
(
${
LibName
}
PROPERTIES
VERSION
${
OW_VERSION
}
SOVERSION
${
OW_SOVERSION
}
)
# Do not forget the install targets
SETUP_LIB_INSTALL
(
${
LibName
}
${
OW_LIBRARY_DIR_RELATIVE
}
"CORE"
)
# Core contains the headers which are needed for any developer release. Install them.
# NOTE: do not use ${TARGET_H_FILES}. The command requires a list
SETUP_DEV_INSTALL
(
${
LibName
}
${
OW_LIBRARY_DIR_RELATIVE
}
TARGET_H_FILES
"include/openwalnut/core"
"CORE_DEV"
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Test Setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
...
...
@@ -77,12 +76,46 @@ INSTALL( TARGETS ${LibName}
# Setup tests of this target
SETUP_TESTS
(
"
${
TARGET_TEST_FILES
}
"
"
${
LibName
}
"
""
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Doxygen Release documentation
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# NOTE: this full documentation also includes call/caller graphs, colaboration graphs and nicer inheritance graphs
# but needs "dot" from graphviz to render them.
SET
(
DEVDOC_DIR
"
${
PROJECT_SOURCE_DIR
}
/../doc/core/html"
)
ADD_CUSTOM_TARGET
(
core_devdoc
COMMAND doxygen
${
PROJECT_SOURCE_DIR
}
/../doc/core/doxygenConfig
COMMAND chmod -R g+r
${
DEVDOC_DIR
}
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/..
COMMENT
"Build verbose doxygen documentation for core"
VERBATIM
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Copy local resources
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# copy our own resources
SETUP_RESOURCES
(
"core"
"CORE"
)
# where to put doc files?
# NOTE: the doc path should match the SONAME of lib. Use this command to query a proper name:
# objdump -p libopenwalnut.so | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -e's/\([0-9]\)\.so\./\1-/; s/\.so\.//'
SET
(
OW_DOC_DIR_RELATIVE
"share/doc/libopenwalnut1"
)
SETUP_COMMON_DOC
(
${
OW_DOC_DIR_RELATIVE
}
"CORE"
)
# Also add an install target for this
INSTALL
(
DIRECTORY
${
DEVDOC_DIR
}
DESTINATION
${
OW_DOC_DIR_RELATIVE
}
COMPONENT
"CORE_DOC"
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Copy Shaders
# ---------------------------------------------------------------------------------------------------------------------------------------------------
COLLECT_SHADER_FILES
(
${
CMAKE_CURRENT_SOURCE_DIR
}
TARGET_GLSL_FILES
)
SETUP_SHADERS
(
"
${
TARGET_GLSL_FILES
}
"
"
${
OW_SHARE_DIR_RELATIVE
}
/shaders"
)
SETUP_SHADERS
(
"
${
TARGET_GLSL_FILES
}
"
"
${
OW_SHARE_DIR_RELATIVE
}
/shaders"
"CORE"
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
...
...
src/core/common/WPathHelper.cpp
View file @
cae43661
...
...
@@ -28,8 +28,6 @@
#include <boost/tokenizer.hpp>
#include "WPreferences.h"
#include "WPathHelper.h"
// path helper instance as singleton
...
...
@@ -58,11 +56,11 @@ boost::shared_ptr< WPathHelper > WPathHelper::getPathHelper()
void
WPathHelper
::
setAppPath
(
boost
::
filesystem
::
path
appPath
)
{
m_appPath
=
appPath
;
m_sharePath
=
m_appPath
/
"../share/
OpenW
alnut"
;
m_docPath
=
m_appPath
/
"../share/doc
/OpenWalnut
"
;
m_configPath
=
m_appPath
/
"../
etc/OpenW
alnut"
;
m_sharePath
=
m_appPath
/
"../share/
openw
alnut"
;
m_docPath
=
m_appPath
/
"../share/doc"
;
m_configPath
=
m_appPath
/
"../
share/openw
alnut"
;
m_libPath
=
m_appPath
/
"../lib"
;
m_modulePath
=
m_libPath
/
"
OpenW
alnut"
;
m_modulePath
=
m_libPath
/
"
openw
alnut"
;
}
boost
::
filesystem
::
path
WPathHelper
::
getAppPath
()
...
...
@@ -70,26 +68,6 @@ boost::filesystem::path WPathHelper::getAppPath()
return
getPathHelper
()
->
m_appPath
;
}
boost
::
filesystem
::
path
WPathHelper
::
getConfigFile
()
{
namespace
fs
=
boost
::
filesystem
;
// I know that this work only for linux, but it should not break anything elsewhere.
// Thus, we prefer the file in the home directory now.
std
::
string
homeDir
=
getenv
(
"HOME"
)
?
getenv
(
"HOME"
)
:
""
;
std
::
string
linuxDefault
=
homeDir
+
"/.walnut.cfg"
;
boost
::
filesystem
::
path
configFile
;
if
(
fs
::
exists
(
linuxDefault
)
)
{
configFile
=
boost
::
filesystem
::
path
(
linuxDefault
);
}
else
{
configFile
=
getPathHelper
()
->
m_configPath
/
"walnut.cfg"
;
}
return
configFile
;
}
boost
::
filesystem
::
path
WPathHelper
::
getFontPath
()
{
return
getPathHelper
()
->
m_sharePath
/
"fonts"
;
...
...
@@ -103,9 +81,9 @@ boost::filesystem::path WPathHelper::getShaderPath()
WPathHelper
::
Fonts
WPathHelper
::
getAllFonts
()
{
Fonts
fonts
;
fonts
.
Regular
=
getFontPath
()
/
"
LiberationMono-
Regular.ttf"
;
fonts
.
Bold
=
getFontPath
()
/
"
LiberationMono-
Bold.ttf"
;
fonts
.
Italic
=
getFontPath
()
/
"
LiberationMono-
Italic.ttf"
;
fonts
.
Regular
=
getFontPath
()
/
"Regular.ttf"
;
fonts
.
Bold
=
getFontPath
()
/
"Bold.ttf"
;
fonts
.
Italic
=
getFontPath
()
/
"Italic.ttf"
;
fonts
.
Default
=
fonts
.
Bold
;
return
fonts
;
...
...
@@ -143,12 +121,8 @@ std::vector< boost::filesystem::path > WPathHelper::getAllModulePaths()
// the first element always is the global search path
paths
.
push_back
(
getModulePath
()
);
std
::
string
additionalPaths
=
""
;
if
(
!
WPreferences
::
getPreference
<
std
::
string
>
(
"modules.path"
,
&
additionalPaths
)
)
{
// no config option found.
return
paths
;
}
// the environment variable stores the additional paths
std
::
string
additionalPaths
(
getenv
(
"OW_MODULE_PATH"
)
?
getenv
(
"OW_MODULE_PATH"
)
:
""
);
// separate list of additional paths:
typedef
boost
::
tokenizer
<
boost
::
char_separator
<
char
>
>
tokenizer
;
...
...
src/core/common/WPathHelper.h
View file @
cae43661
...
...
@@ -69,13 +69,6 @@ public:
*/
static
boost
::
filesystem
::
path
getAppPath
();
/**
* The path of the configuration file walnut.cfg. Always use this file to parse configurations.
*
* \return the config file.
*/
static
boost
::
filesystem
::
path
getConfigFile
();
/**
* The path where font files reside in.
*
...
...
@@ -133,7 +126,7 @@ public:
static
boost
::
filesystem
::
path
getModulePath
();
/**
* This returns a list of search paths for modules. This list is defined by the
"modules.path" - option in walnut.cfg
. All of these
* This returns a list of search paths for modules. This list is defined by the
environment variable "OW_MODULE_PATH"
. All of these
* directories CAN contain modules. On startup, they get searched in the specified order.
*
* \return list of search paths for modules
...
...
src/core/common/WPredicateHelper.h
View file @
cae43661
...
...
@@ -36,6 +36,32 @@
*/
namespace
WPredicateHelper
{
/**
* Predicate which is always true. Useful if you want to ignore something all the time.
*
* @tparam T the value type to check
*
* \return always true.
*/
template
<
typename
T
>
bool
alwaysTrue
(
const
T
&
/* obj */
)
{
return
true
;
}
/**
* Predicate which is always false. Useful if you want to ignore something all the time.
*
* @tparam T the value type to check
*
* \return always false.
*/
template
<
typename
T
>
bool
alwaysFalse
(
const
T
&
/* obj */
)
{
return
false
;
}
/**
* This class tests against the getName() method of the instances of type T. Many, many, many many many classes in OpenWalnut provide a getName()
* method. This predicate can check against a defined name. Useful for searching.
...
...
src/core/common/math/WLinearAlgebraFunctions.cpp
View file @
cae43661
...
...
@@ -24,7 +24,7 @@
#include <vector>
#include
"ext/Eigen/SVD"
#include
<Eigen/SVD>
#include "../WAssert.h"
#include "../WLimits.h"
...
...
src/core/common/math/WMatrix.h
View file @
cae43661
...
...
@@ -172,6 +172,9 @@ public:
*/
WMatrix
transposed
()
const
;
/**
* Resets the matrix components to zero.
*/
void
setZero
()
{
for
(
size_t
i
=
0
;
i
<
this
->
size
();
++
i
)
...
...
src/core/common/math/linearAlgebra/WMatrixEigen.h
View file @
cae43661
...
...
@@ -27,8 +27,8 @@
#define EIGEN_DONT_ALIGN_STATICALLY
#include
"ext/Eigen/Core"
#include
"ext/Eigen/LU"
#include
<Eigen/Core>
#include
<Eigen/LU>
/**
* A double matrix of dynamic size. Heap-allocated.
...
...
src/core/common/math/linearAlgebra/WMatrixFixed.h
View file @
cae43661
...
...
@@ -43,8 +43,8 @@
#include <osg/Matrixd>
// Needed for conversion: Eigen3 Types
#include
"ext/Eigen/Core"
#include
"ext/Eigen/LU"
// needed for the inverse() function
#include
<Eigen/Core>
#include
<Eigen/LU>
// needed for the inverse() function
#include "../../WDefines.h"
#include "../../WStringUtils.h"
...
...
@@ -362,6 +362,80 @@ public:
return
result
;
}
/**
* Set a row to a specific vector.
*
* \tparam RHSValueT Value type of the given matrix
* \tparam ValueStoreT Value store of the given matrix
*
* \param index the index of the row you want to set
* \param vec the values to set for the row
*
*/
template
<
typename
RHSValueT
,
ValueStoreTemplate
RHSValueStoreT
>
void
setRowVector
(
size_t
index
,
const
WMatrixFixed
<
RHSValueT
,
Rows
,
1
,
RHSValueStoreT
>&
vec
)
{
for
(
size_t
col
=
0
;
col
<
Cols
;
col
++
)
{
at
(
index
,
col
)
=
vec
(
col
,
0
);
}
}
/**
* Get a vector containing a specific row
*
* \param index the index of the row
*
* \return the row as a vector
*/
WMatrixFixed
<
ValueT
,
Cols
,
1
,
ValueStoreT
>
getRowVector
(
size_t
index
)
const
{
WMatrixFixed
<
ValueT
,
Cols
,
1
>
result
;
for
(
size_t
col
=
0
;
col
<
Cols
;
col
++
)
{
result
(
col
,
0
)
=
at
(
index
,
col
);
}
return
result
;
}
/**
* Set a column to a specific vector.
*
* \tparam RHSValueT Value type of the given matrix
* \tparam ValueStoreT Value store of the given matrix
*
* \param index the index of the column you want to set
* \param vec the values to set for the column
*
*/
template
<
typename
RHSValueT
,
ValueStoreTemplate
RHSValueStoreT
>
void
setColumnVector
(
size_t
index
,
const
WMatrixFixed
<
RHSValueT
,
Rows
,
1
,
RHSValueStoreT
>&
vec
)
{
for
(
size_t
row
=
0
;
row
<
Rows
;
row
++
)
{
at
(
row
,
index
)
=
vec
(
row
,
0
);
}
}
/**
* Get a vector containing a specific column
*
* \param index the index of the column
*
* \return the column as a vector
*/
WMatrixFixed
<
ValueT
,
Rows
,
1
>
getColumnVector
(
size_t
index
)
const
{
WMatrixFixed
<
ValueT
,
Rows
,
1
>
result
;
for
(
size_t
row
=
0
;
row
<
Rows
;
row
++
)
{
result
(
row
,
0
)
=
at
(
row
,
index
);
}
return
result
;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Conversion
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -584,7 +658,7 @@ public:
BOOST_STATIC_ASSERT
(
Rows
==
4
);
BOOST_STATIC_ASSERT
(
Cols
==
1
);
operator
[](
0
)
=
m
[
1
];
operator
[](
0
)
=
m
[
0
];
operator
[](
1
)
=
m
[
1
];
operator
[](
2
)
=
m
[
2
];
operator
[](
3
)
=
m
[
3
];
...
...
@@ -600,7 +674,7 @@ public:
BOOST_STATIC_ASSERT
(
Rows
==
4
);
BOOST_STATIC_ASSERT
(
Cols
==
1
);
operator
[](
0
)
=
m
[
1
];
operator
[](
0
)
=
m
[
0
];
operator
[](
1
)
=
m
[
1
];
operator
[](
2
)
=
m
[
2
];
operator
[](
3
)
=
m
[
3
];
...
...
src/core/common/math/linearAlgebra/test/WMatrixFixed_test.h
View file @
cae43661
...
...
@@ -171,6 +171,94 @@ public:
TS_ASSERT_THROWS
(
matrix
.
at
(
-
1
,
0
),
WOutOfBounds
);
}
/**
* Check if getRowVector() returns the correct contents.
*/
void
testGetRowVector
()
{
WMatrixFixed
<
int
,
3
,
3
>
matrix
;
matrix
(
0
,
0
)
=
1
;
matrix
(
0
,
1
)
=
2
;
matrix
(
0
,
2
)
=
3
;
matrix
(
1
,
0
)
=
4
;
matrix
(
1
,
1
)
=
5
;
matrix
(
1
,
2
)
=
6
;
matrix
(
2
,
0
)
=
7
;
matrix
(
2
,
1
)
=
8
;
matrix
(
2
,
2
)
=
9
;
WMatrixFixed
<
int
,
3
,
1
>
rowVector
;
rowVector
(
0
,
0
)
=
matrix
(
0
,
0
);
rowVector
(
1
,
0
)
=
matrix
(
0
,
1
);
rowVector
(
2
,
0
)
=
matrix
(
0
,
2
);
TS_ASSERT_EQUALS
(
matrix
.
getRowVector
(
0
)(
0
,
0
),
rowVector
(
0
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
.
getRowVector
(
0
)(
0
,
1
),
rowVector
(
1
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
.
getRowVector
(
0
)(
0
,
2
),
rowVector
(
2
,
0
)
);
}
/**
* Check if getColumnVector() returns the correct contents.
*/
void
testGetColVector
()
{
WMatrixFixed
<
int
,
3
,
3
>
matrix
;
matrix
(
0
,
0
)
=
1
;
matrix
(
0
,
1
)
=
2
;
matrix
(
0
,
2
)
=
3
;
matrix
(
1
,
0
)
=
4
;
matrix
(
1
,
1
)
=
5
;
matrix
(
1
,
2
)
=
6
;
matrix
(
2
,
0
)
=
7
;
matrix
(
2
,
1
)
=
8
;
matrix
(
2
,
2
)
=
9
;
WMatrixFixed
<
int
,
3
,
1
>
colVector
;
colVector
(
0
,
0
)
=
matrix
(
0
,
1
);
colVector
(
1
,
0
)
=
matrix
(
1
,
1
);
colVector
(
2
,
0
)
=
matrix
(
2
,
1
);
TS_ASSERT_EQUALS
(
matrix
.
getColumnVector
(
1
)(
0
,
0
),
colVector
.
at
(
0
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
.
getColumnVector
(
1
)(
1
,
0
),
colVector
.
at
(
1
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
.
getColumnVector
(
1
)(
2
,
0
),
colVector
.
at
(
2
,
0
)
);
}
/**
* Check if setRowVector() sets the matrix contents correctly.
*/
void
testSetRowVector
()
{
WMatrixFixed
<
int
,
3
,
1
>
rowVector
;
rowVector
(
0
,
0
)
=
1
;
rowVector
(
1
,
0
)
=
2
;
rowVector
(
2
,
0
)
=
3
;
WMatrixFixed
<
int
,
3
,
3
>
matrix
;
matrix
.
setRowVector
(
0
,
rowVector
);
TS_ASSERT_EQUALS
(
matrix
(
0
,
0
),
rowVector
(
0
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
(
0
,
1
),
rowVector
(
1
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
(
0
,
2
),
rowVector
(
2
,
0
)
);
}
/**
* Check if setColumnVector() sets the matrix contents correctly.
*/
void
testSetColVector
()
{
WMatrixFixed
<
int
,
3
,
1
>
colVector
;
colVector
(
0
,
0
)
=
2
;
colVector
(
1
,
0
)
=
5
;
colVector
(
2
,
0
)
=
8
;
WMatrixFixed
<
int
,
3
,
3
>
matrix
;
matrix
.
setColumnVector
(
1
,
colVector
);
TS_ASSERT_EQUALS
(
matrix
(
0
,
1
),
colVector
(
0
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
(
1
,
1
),
colVector
(
1
,
0
)
);
TS_ASSERT_EQUALS
(
matrix
(
2
,
1
),
colVector
(
2
,
0
)
);
}
/**
* The zero function should return a matrix that contains only zeros.
*/
...
...
src/core/dataHandler/io/WReaderNIfTI.h
View file @
cae43661
...
...
@@ -27,13 +27,15 @@
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <nifti1_io.h>
#include "WReader.h"
#include "../WDataSet.h"
#include "../../common/math/WMatrix.h"
#include "ext/nifti/nifti1_io.h"
#include "../WExportDataHandler.h"
/**
...
...
src/core/graphicsEngine/WGEZoomTrackballManipulator.cpp
View file @
cae43661
...
...
@@ -22,7 +22,6 @@
//
//---------------------------------------------------------------------------
#include "../common/WPreferences.h"
#include "WGEZoomTrackballManipulator.h"
#include "WGraphicsEngine.h"
...
...
@@ -33,7 +32,6 @@ WGEZoomTrackballManipulator::WGEZoomTrackballManipulator():
m_paintMode
(
0
)
{
setTrackballSize
(
.3
);
// changes the effect of a mouse move for rotation
WPreferences
::
getPreference
(
"ge.zoomTrackballManipulator.allowThrow"
,
&
m_allowThrow
);
}
void
WGEZoomTrackballManipulator
::
setByMatrix
(
const
osg
::
Matrixd
&
matrix
)
...
...
@@ -161,3 +159,14 @@ void WGEZoomTrackballManipulator::setPaintMode( int mode )
{
m_paintMode
=
mode
;
}
void
WGEZoomTrackballManipulator
::
setThrow
(
bool
allowThrow
)
{
m_allowThrow
=
allowThrow
;
}
bool
WGEZoomTrackballManipulator
::
getThrow
()
const
{
return
m_allowThrow
;
}
src/core/graphicsEngine/WGEZoomTrackballManipulator.h
View file @
cae43661
...
...
@@ -96,6 +96,20 @@ public:
*/
void
setPaintMode
(
int
mode
);
/**
* En-/Disables throwing.