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
9f1713b5
Commit
9f1713b5
authored
Sep 16, 2009
by
Sebastian Eichelbaum
Browse files
[MERGE]
parents
bd2b2f21
a11cba97
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
295 additions
and
874 deletions
+295
-874
src/CMakeLists.txt
src/CMakeLists.txt
+111
-119
src/dataHandler/WDataHandler.cpp
src/dataHandler/WDataHandler.cpp
+6
-2
src/dataHandler/WDataHandler.h
src/dataHandler/WDataHandler.h
+7
-1
src/dataHandler/WDataSet.cpp
src/dataHandler/WDataSet.cpp
+12
-5
src/dataHandler/WDataSet.h
src/dataHandler/WDataSet.h
+13
-8
src/dataHandler/WDataSetMultiple.h
src/dataHandler/WDataSetMultiple.h
+2
-2
src/dataHandler/WDataSetSingle.cpp
src/dataHandler/WDataSetSingle.cpp
+2
-4
src/dataHandler/WDataSetSingle.h
src/dataHandler/WDataSetSingle.h
+2
-3
src/dataHandler/WDataSetTimeDependent.h
src/dataHandler/WDataSetTimeDependent.h
+2
-2
src/dataHandler/WEEG.cpp
src/dataHandler/WEEG.cpp
+2
-3
src/dataHandler/WEEG.h
src/dataHandler/WEEG.h
+2
-3
src/dataHandler/WMetaInfo.cpp
src/dataHandler/WMetaInfo.cpp
+0
-352
src/dataHandler/WMetaInfo.h
src/dataHandler/WMetaInfo.h
+0
-295
src/dataHandler/WRecording.h
src/dataHandler/WRecording.h
+2
-2
src/dataHandler/WSubject.cpp
src/dataHandler/WSubject.cpp
+19
-1
src/dataHandler/WSubject.h
src/dataHandler/WSubject.h
+23
-1
src/dataHandler/io/WLoaderBiosig.cpp
src/dataHandler/io/WLoaderBiosig.cpp
+15
-7
src/dataHandler/io/WLoaderEEGASCII.cpp
src/dataHandler/io/WLoaderEEGASCII.cpp
+16
-10
src/dataHandler/io/WLoaderNIfTI.cpp
src/dataHandler/io/WLoaderNIfTI.cpp
+59
-52
src/dataHandler/io/WLoaderNIfTI.h
src/dataHandler/io/WLoaderNIfTI.h
+0
-2
No files found.
src/CMakeLists.txt
View file @
9f1713b5
...
...
@@ -2,75 +2,44 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT
(
OpenWalnut
)
# Include local CMake modules
# append search path for FindModules:
#------------------------------------
LIST
(
APPEND CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/../tools/CMakeModules
)
# include custom CMake commands like assert
INCLUDE
(
${
PROJECT_SOURCE_DIR
}
/../tools/CMakeModules/Utils.cmake
)
# First of all find out which platform we are on and set our own platform variable
SET
(
OPENWALNUT_PLATFORM_LINUX
"Linux"
)
SET
(
OPENWALNUT_PLATFORM_WINDOWS
"Windows"
)
# platform dependend stuff:
#--------------------------
IF
(
CMAKE_HOST_SYSTEM MATCHES Linux
)
SET
(
OPENWALNUT_PLATFORM
${
OPENWALNUT_PLATFORM_LINUX
}
CACHE STRING
"The platform we are building on."
)
ENDIF
(
CMAKE_HOST_SYSTEM MATCHES Linux
)
IF
(
CMAKE_HOST_SYSTEM MATCHES Windows
)
SET
(
OPENWALNUT_PLATFORM
${
OPENWALNUT_PLATFORM_WINDOWS
}
CACHE STRING
"The platform we are building on."
)
ENDIF
(
CMAKE_HOST_SYSTEM MATCHES Windows
)
SET
(
LIBRARY_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
/lib CACHE PATH
"The libraries will be put into this directory."
)
ELSEIF
(
CMAKE_HOST_SYSTEM MATCHES Windows
)
SET
(
LIBRARY_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
/bin CACHE PATH
"The libraries will be put into this directory."
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"Could not determine platform type! (expected Linux or Windows)!"
)
ENDIF
()
# Package dependencies:
#----------------------
### BOOST ###
SET
(
Boost_USE_MULTITHREAD ON
)
IF
(
CMAKE_BUILD_TYPE STREQUAL
"Static"
)
IF
(
CMAKE_BUILD_TYPE STREQUAL
"Static"
)
SET
(
Boost_USE_STATIC_LIBS ON
)
ENDIF
(
CMAKE_BUILD_TYPE STREQUAL
"Static"
)
ENDIF
(
CMAKE_BUILD_TYPE STREQUAL
"Static"
)
# To see which boost libs we currently use, you may run the following command
# in the trunk/src directory on a linux box to make some investigations:
# grep -i include `find . -type f` | grep boost | awk '{print $2}' | sort | uniq
FIND_PACKAGE
(
Boost 1.36.0 REQUIRED program_options thread
)
include_directories
(
${
Boost_INCLUDE_DIR
}
)
FIND_PACKAGE
(
Boost REQUIRED program_options thread
)
ASSERT_GE_VERSION
(
"Boost"
"
${
Boost_MAJOR_VERSION
}
.
${
Boost_MINOR_VERSION
}
.
${
Boost_SUBMINOR_VERSION
}
"
1.36.0
)
INCLUDE_DIRECTORIES
(
${
Boost_INCLUDE_DIR
}
)
### OpenGL ###
FIND_PACKAGE
(
OpenGL REQUIRED
)
### CxxTest ###
FIND_PACKAGE
(
CxxTest QUIET
)
MARK_AS_ADVANCED
(
CXXTEST_PERL_TESTGEN_EXECUTABLE
)
FIND_PACKAGE
(
osg REQUIRED
)
FIND_PACKAGE
(
osgUtil REQUIRED
)
FIND_PACKAGE
(
osgDB REQUIRED
)
FIND_PACKAGE
(
osgViewer REQUIRED
)
FIND_PACKAGE
(
osgGA REQUIRED
)
FIND_PACKAGE
(
OpenThreads REQUIRED
)
# Platform dependencies
IF
(
OPENWALNUT_PLATFORM MATCHES
${
OPENWALNUT_PLATFORM_WINDOWS
}
)
SET
(
LIBRARY_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
/bin
CACHE PATH
"The libraries will be put into this directory."
)
ELSE
(
OPENWALNUT_PLATFORM MATCHES
${
OPENWALNUT_PLATFORM_WINDOWS
}
)
SET
(
LIBRARY_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
/lib
CACHE PATH
"The libraries will be put into this directory."
)
ENDIF
(
OPENWALNUT_PLATFORM MATCHES
${
OPENWALNUT_PLATFORM_WINDOWS
}
)
MARK_AS_ADVANCED
(
LIBRARY_OUTPUT_PATH
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
/bin CACHE PATH
"The executables will be put into this directory."
)
MARK_AS_ADVANCED
(
EXECUTABLE_OUTPUT_PATH
)
# Set default build type
IF
(
NOT CMAKE_BUILD_TYPE
)
SET
(
CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo Static"
FORCE
)
ENDIF
(
NOT CMAKE_BUILD_TYPE
)
# Enable unit tests via CxxTest
MARK_AS_ADVANCED
(
CXXTEST_PERL_TESTGEN_EXECUTABLE
)
IF
(
CXXTEST_FOUND
)
INCLUDE_DIRECTORIES
(
${
CXXTEST_INCLUDE_DIR
}
)
# Package settings:
...
...
@@ -79,9 +48,35 @@ IF( CXXTEST_FOUND )
ENABLE_TESTING
()
ENDIF
(
CXXTEST_FOUND
)
### OpenSceneGraph ###
SET
(
MIN_OSG_VERSION 2.8.0
)
FIND_PACKAGE
(
osg
${
MIN_OSG_VERSION
}
REQUIRED
)
FIND_PACKAGE
(
osgUtil
${
MIN_OSG_VERSION
}
REQUIRED
)
FIND_PACKAGE
(
osgDB
${
MIN_OSG_VERSION
}
REQUIRED
)
FIND_PACKAGE
(
osgViewer
${
MIN_OSG_VERSION
}
REQUIRED
)
FIND_PACKAGE
(
osgGA
${
MIN_OSG_VERSION
}
REQUIRED
)
FIND_PACKAGE
(
OpenThreads
${
MIN_OSG_VERSION
}
REQUIRED
)
SET
(
OPENSCENEGRAPH_LIBRARIES
${
OSGDB_LIBRARY
}
${
OSGGA_LIBRARY
}
${
OSGUTIL_LIBRARY
}
${
OSGVIEWER_LIBRARY
}
${
OSG_LIBRARY
}
${
OPENTHREADS_LIBRARY
}
)
SET
(
OPENSCENEGRAPH_INCLUDE_DIRS
${
OSG_INCLUDE_DIR
}
${
OSGDB_INCLUDE_DIR
}
${
OSGGA_INCLUDE_DIR
}
${
OSGVIEWER_INCLUDE_DIR
}
${
OSGUTIL_INCLUDE_DIR
}
${
OPENTHREADS_INCLUDE_DIR
}
)
# When new cmake version available >=2.6.4 we may use this the line below instead the stuff above
# FIND_PACKAGE( OpenSceneGraph 2.8.0 REQUIRED osgDB osgUtil osgGA osgViewer OpenThreads )
INCLUDE_DIRECTORIES
(
${
OPENSCENEGRAPH_INCLUDE_DIRS
}
)
# other options:
#---------------
# Set default build type
IF
(
NOT CMAKE_BUILD_TYPE
)
SET
(
CMAKE_BUILD_TYPE Release
CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo Static"
FORCE
)
ENDIF
(
NOT CMAKE_BUILD_TYPE
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
/bin CACHE PATH
"The executables will be put into this directory."
)
MARK_AS_ADVANCED
(
LIBRARY_OUTPUT_PATH
)
MARK_AS_ADVANCED
(
EXECUTABLE_OUTPUT_PATH
)
# Global compiler flags:
#-----------------------
--------------------------------------------------------------------------------------
#-----------------------
# -Wno-long-long since on Ubuntu 8.10 it won't compile without it
# -ansi force ISO-C++98 compliance (not GNU++98)
SET
(
CMAKE_CXX_FLAGS
"-pedantic -ansi -Wall -Wextra -Wno-long-long"
CACHE STRING
""
FORCE
)
...
...
@@ -91,9 +86,7 @@ SET( CMAKE_CXX_FLAGS_STATIC "-O3" CACHE STRING "" FORCE )
MARK_AS_ADVANCED
(
CMAKE_CXX_FLAGS_STATIC
)
SET
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-g -DDEBUG -O2"
CACHE STRING
""
FORCE
)
INCLUDE_DIRECTORIES
(
${
OSG_INCLUDE_DIR
}
${
OSGDB_INCLUDE_DIR
}
${
OSGGA_INCLUDE_DIR
}
${
OSGVIEWER_INCLUDE_DIR
}
${
OSGUTIL_INCLUDE_DIR
}
${
OPENTHREADS_INCLUDE_DIR
}
)
IF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Static"
)
IF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Static"
)
ADD_SUBDIRECTORY
(
math
)
ADD_SUBDIRECTORY
(
dataHandler
)
ADD_SUBDIRECTORY
(
graphicsEngine
)
...
...
@@ -102,12 +95,12 @@ IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
ADD_SUBDIRECTORY
(
kernel
)
ADD_SUBDIRECTORY
(
common
)
ADD_EXECUTABLE
(
walnut OpenWalnut.cpp utils/WOptionHandler.cpp
)
TARGET_LINK_LIBRARIES
(
walnut kernel dataHandler guiqt4 common
${
Boost_LIBRARIES
}
${
OPENTHREADS_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
walnut kernel dataHandler guiqt4 common
${
Boost_LIBRARIES
}
)
ELSE
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Static"
)
ELSE
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Static"
)
FILE
(
GLOB_RECURSE ALL_SRC
${
PROJECT_SOURCE_DIR
}
/*.cpp
)
FILE
(
GLOB NIFTI_SRC
"dataHandler/io/nifti/*.c"
)
ADD_DEFINITIONS
(
-DHAVE_ZLIB
)
ADD_DEFINITIONS
(
-DHAVE_ZLIB
)
# Package dependencies:
FIND_PACKAGE
(
Qt4 REQUIRED
)
...
...
@@ -117,120 +110,119 @@ ELSE ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
INCLUDE_DIRECTORIES
(
${
QT_INCLUDE_DIR
}
)
# Libraries for linking:
SET
(
QT_LINK_LIBRARIES
${
QT_QTCORE_LIBRARY
}
${
QT_QTGUI_LIBRARY
}
${
QT_QTOPENGL_LIBRARY
}
)
SET
(
QT_LINK_LIBRARIES
${
QT_QTCORE_LIBRARY
}
${
QT_QTGUI_LIBRARY
}
${
QT_QTOPENGL_LIBRARY
}
)
# add here all classes that inherit from QObject
SET
(
GUI_QT4_MOC_HDRS
gui/qt4/WMainWindow.h
)
SET
(
GUI_QT4_MOC_HDRS gui/qt4/WMainWindow.h
)
QT4_WRAP_CPP
(
GUI_QT4_MOC_SRCS
${
GUI_QT4_MOC_HDRS
}
)
QT4_WRAP_CPP
(
GUI_QT4_MOC_SRCS
${
GUI_QT4_MOC_HDRS
}
)
ADD_EXECUTABLE
(
walnut
${
ALL_SRC
}
${
NIFTI_SRC
}
${
GUI_QT4_MOC_SRCS
}
)
TARGET_LINK_LIBRARIES
(
walnut
${
Boost_LIBRARIES
}
${
OSG_LIBRARIES
}
${
QT_LINK_LIBRARIES
}
${
GLEW_LIBRARY
}
)
ENDIF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Static"
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
CMAKE_BINARY_DIR
}
/bin/shaders
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_SOURCE_DIR
}
/modules/navigationSlices/slice.vs
${
CMAKE_BINARY_DIR
}
/bin/shaders/
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_SOURCE_DIR
}
/modules/navigationSlices/slice.fs
${
CMAKE_BINARY_DIR
}
/bin/shaders/
)
# Special targets:
#-------------------------------------------------------------------------------------------------------------
# Creates API via Doxygen
ADD_CUSTOM_TARGET
(
doc
COMMAND doxygen
${
PROJECT_SOURCE_DIR
}
/../doc/developer/doxygenConfig
COMMAND chmod -R g+r
${
PROJECT_SOURCE_DIR
}
/../doc/developer/html
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/..
COMMENT
"Build doxygen documentation"
VERBATIM
)
ADD_CUSTOM_TARGET
(
doc
COMMAND doxygen
${
PROJECT_SOURCE_DIR
}
/../doc/developer/doxygenConfig
COMMAND chmod -R g+r
${
PROJECT_SOURCE_DIR
}
/../doc/developer/html
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/..
COMMENT
"Build doxygen documentation"
VERBATIM
)
#-------------------------------------------------------------------------------------------------------------
# Uses ctags to create source tags, usable in many editors like VIM or Emacs
ADD_CUSTOM_COMMAND
(
OUTPUT ctags
COMMAND ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/
COMMENT
"Build ctags tagfile"
ADD_CUSTOM_COMMAND
(
OUTPUT ctags
COMMAND ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/
COMMENT
"Build ctags tagfile"
)
#-------------------------------------------------------------------------------------------------------------
# Uses cscope to create several source graphs (dependency, call, caller, ...), usable in many editors like VIM or Emacs
ADD_CUSTOM_COMMAND
(
OUTPUT cscope
COMMAND cscope -R -b
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/
COMMENT
"Build cscope tagfile"
ADD_CUSTOM_COMMAND
(
OUTPUT cscope
COMMAND cscope -R -b
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/
COMMENT
"Build cscope tagfile"
)
#-------------------------------------------------------------------------------------------------------------
# The command "make tags" creates ctags and cscope tag files
ADD_CUSTOM_TARGET
(
tags
DEPENDS ctags
DEPENDS cscope
)
ADD_CUSTOM_TARGET
(
tags DEPENDS ctags DEPENDS cscope
)
#-------------------------------------------------------------------------------------------------------------
# Checks style guide lines via the BrainLint tool against all source code files
# The output is colored when variable CMAKE_COLOR_MAKEFILE is set to ON,
# noncolored if it is set to OFF
FILE
(
GLOB_RECURSE STYLE_CPP
${
PROJECT_SOURCE_DIR
}
/*.cpp
)
FILE
(
GLOB_RECURSE STYLE_H
${
PROJECT_SOURCE_DIR
}
/*.h
)
#-------------------------------------------------------------------------------------------------------------
#Set dirs to exclude from stylecheck
SET
(
EXCLUDE_DIRS
"/dataHandler/io/nifti/;/dataHandler/io/biosig/;/dataHandler/io/biosig/XMLParser/"
)
FILE
(
GLOB_RECURSE STYLE_CPP
${
PROJECT_SOURCE_DIR
}
/*.cpp
)
FILE
(
GLOB_RECURSE STYLE_H
${
PROJECT_SOURCE_DIR
}
/*.h
)
# Set dirs to exclude from stylecheck
SET
(
EXCLUDE_DIRS
"/dataHandler/io/nifti/;/dataHandler/io/biosig/;/dataHandler/io/biosig/XMLParser/"
)
FOREACH
(
dirname
${
EXCLUDE_DIRS
}
)
FILE
(
GLOB EXCLUDE_H
${
PROJECT_SOURCE_DIR
}${
dirname
}
*.h
)
FILE
(
GLOB EXCLUDE_CPP
${
PROJECT_SOURCE_DIR
}${
dirname
}
*.cpp
)
FOREACH
(
fname
${
EXCLUDE_H
}
)
LIST
(
REMOVE_ITEM STYLE_H
${
fname
}
)
LIST
(
REMOVE_ITEM STYLE_H
${
fname
}
)
ENDFOREACH
(
fname
)
FOREACH
(
fname
${
EXCLUDE_CPP
}
)
LIST
(
REMOVE_ITEM STYLE_CPP
${
fname
}
)
LIST
(
REMOVE_ITEM STYLE_CPP
${
fname
}
)
ENDFOREACH
(
fname
)
ENDFOREACH
(
dirname
)
IF
(
CMAKE_COLOR_MAKEFILE
)
ADD_CUSTOM_TARGET
(
stylecheck
COMMAND
${
PROJECT_SOURCE_DIR
}
/../tools/brainlint.py --color
${
STYLE_CPP
}
${
STYLE_H
}
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMENT
"Check if code complies to CodingStandard"
)
ELSE
(
CMAKE_COLOR_MAKEFILE
)
ADD_CUSTOM_TARGET
(
stylecheck
COMMAND
${
PROJECT_SOURCE_DIR
}
/../tools/brainlint.py
${
STYLE_CPP
}
${
STYLE_H
}
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMENT
"Check if code complies to CodingStandard and use noncolored output for violation messages"
)
ENDIF
(
CMAKE_COLOR_MAKEFILE
)
ADD_CUSTOM_TARGET
(
stylecheck
COMMAND
${
PROJECT_SOURCE_DIR
}
/../tools/brainlint.py --color
${
STYLE_CPP
}
${
STYLE_H
}
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMENT
"Check if code complies to CodingStandard"
)
ELSE
()
ADD_CUSTOM_TARGET
(
stylecheck
COMMAND
${
PROJECT_SOURCE_DIR
}
/../tools/brainlint.py
${
STYLE_CPP
}
${
STYLE_H
}
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMENT
"Check if code complies to CodingStandard and use noncolored output for violation messages"
)
ENDIF
()
#-------------------------------------------------------------------------------------------------------------
# Prints the verbose output of the test runners, so you may identify the source of error early, if any
ADD_CUSTOM_TARGET
(
vtest
COMMAND make test ARGS=
"-V"
COMMENT
"Runs the test in verboseness to see what actually went wrong"
)
ADD_CUSTOM_TARGET
(
vtest
COMMAND make test ARGS=
"-V"
COMMENT
"Runs the test in verboseness to see what actually went wrong"
)
#-------------------------------------------------------------------------------------------------------------
# Removes all tests thus forcing them to be recompiled during the next "make"
ADD_CUSTOM_TARGET
(
cleantest
COMMAND rm -f
${
PROJECT_BINARY_DIR
}
/*/*_test.cc
COMMENT
"Remove all tests to force them to be recompiled"
)
ADD_CUSTOM_TARGET
(
cleantest
COMMAND rm -f
${
PROJECT_BINARY_DIR
}
/*/*_test.cc
COMMENT
"Remove all tests to force them to be recompiled"
)
#-------------------------------------------------------------------------------------------------------------
# Checks if all is well to commit (aka commitCheck, cicheck)
ADD_CUSTOM_TARGET
(
cicheck
COMMAND make test && make stylecheck
COMMENT
"Checks if all is well to commit"
)
ADD_CUSTOM_TARGET
(
cicheck
COMMAND make test && make stylecheck
COMMENT
"Checks if all is well to commit"
)
#-------------------------------------------------------------------------------------------------------------
# Copies fixtures used for tests to the binary directory (where they are expected).
ADD_CUSTOM_TARGET
(
fixtures
ALL
COMMAND cp -rf
${
PROJECT_SOURCE_DIR
}
/dataHandler/test/fixtures
${
PROJECT_BINARY_DIR
}
/dataHandler/
COMMENT
"Copy fixtures to the right place."
)
COMMAND cp -rf
${
PROJECT_SOURCE_DIR
}
/dataHandler/test/fixtures
${
PROJECT_BINARY_DIR
}
/dataHandler/
COMMENT
"Copy fixtures to the right place."
)
#-------------------------------------------------------------------------------------------------------------
# Makes many special make targets in comination.
ADD_CUSTOM_TARGET
(
many
cmake . && make all -j4 && make fixtures && make stylecheck && make test && make doc
COMMENT
"Make many special make targets in combination."
)
COMMENT
"Make many special make targets in combination."
)
src/dataHandler/WDataHandler.cpp
View file @
9f1713b5
...
...
@@ -34,13 +34,17 @@ WDataHandler::WDataHandler()
}
boost
::
shared_ptr
<
const
WSubject
>
WDataHandler
::
getSubject
(
const
unsigned
int
subjectId
)
const
boost
::
shared_ptr
<
WSubject
>
WDataHandler
::
getSubject
(
const
unsigned
int
subjectId
)
const
{
if
(
subjectId
>=
m_subjects
.
size
()
)
throw
WNoSuchDataSetException
(
"Index too large."
);
return
m_subjects
.
at
(
subjectId
);
}
boost
::
shared_ptr
<
WSubject
>
WDataHandler
::
operator
[](
size_t
subjectId
)
const
{
return
getSubject
(
subjectId
);
}
void
WDataHandler
::
addSubject
(
boost
::
shared_ptr
<
WSubject
>
newSubject
)
{
...
...
@@ -59,7 +63,7 @@ void WDataHandler::loadDataSets( std::vector< std::string > fileNames )
WLoaderManager
lm
;
for
(
size_t
i
=
0
;
i
<
fileNames
.
size
()
;
++
i
)
{
// TODO(
wiebel
): need to associate the dataset to its subject
// TODO(wiebel): need to associate the dataset to its subject
lm
.
load
(
fileNames
[
i
],
shared_from_this
()
);
}
}
src/dataHandler/WDataHandler.h
View file @
9f1713b5
...
...
@@ -55,7 +55,13 @@ public:
* Get the pointer to the i'th WSubject. The return type is const since we
* want to ensure that each subject cannot modified after retrival.
*/
boost
::
shared_ptr
<
const
WSubject
>
getSubject
(
const
unsigned
int
subjectId
)
const
;
boost
::
shared_ptr
<
WSubject
>
getSubject
(
const
unsigned
int
subjectId
)
const
;
/**
* Returns a to the i'th WSubject. The return type is const since we
* want to ensure that each subject cannot modified after retrival.
*/
boost
::
shared_ptr
<
WSubject
>
operator
[](
size_t
subjectId
)
const
;
/**
* Insert a new WSubject referenced by a pointer.
...
...
src/dataHandler/WDataSet.cpp
View file @
9f1713b5
...
...
@@ -21,16 +21,23 @@
//
//---------------------------------------------------------------------------
#include <string>
#include "WDataSet.h"
WDataSet
::
WDataSet
(
boost
::
shared_ptr
<
WMetaInfo
>
newMetaInfo
)
:
m_metaInfo
(
newMetaInfo
)
WDataSet
::
WDataSet
()
:
m_fileName
(
""
)
{
}
void
WDataSet
::
setFileName
(
const
std
::
string
fileName
)
{
assert
(
newMetaInfo
);
assert
(
fileName
!=
""
);
m_fileName
=
fileName
;
}
boo
st
::
s
hared_ptr
<
WMetaInfo
>
WDataSet
::
get
MetaInfo
()
const
st
d
::
s
tring
WDataSet
::
get
FileName
()
const
{
return
m_
metaInfo
;
return
m_
fileName
;
}
src/dataHandler/WDataSet.h
View file @
9f1713b5
...
...
@@ -24,10 +24,9 @@
#ifndef WDATASET_H
#define WDATASET_H
#include <string>
#include <boost/shared_ptr.hpp>
class
WMetaInfo
;
/**
* Base class for all data set types. This class has a number of subclasses
* specifying the different types of data sets. Two of dataset type reprent
...
...
@@ -42,7 +41,7 @@ public:
* Since every DataSet should have a MetaInfo, we ensure hereby you never
* go without one.
*/
explicit
WDataSet
(
boost
::
shared_ptr
<
WMetaInfo
>
newMetaInfo
);
WDataSet
(
);
/**
* Since WDataSet is a base class and thus should be polymorphic we add
...
...
@@ -53,16 +52,22 @@ public:
}
/**
*
R
et
urns
the
MetaInfo object for
this
D
ata
Set
.
*
S
et the
name of the file that
this
d
ata
set stems from
.
*/
boost
::
shared_ptr
<
WMetaInfo
>
getMetaInfo
()
const
;
void
setFileName
(
const
std
::
string
fileName
)
;
protected:
/**
*
Stores meta information like name, dimension, etc. for
this
D
ata
Set
.
*
Get the name of the file that
this
d
ata
set stems from
.
*/
boost
::
shared_ptr
<
WMetaInfo
>
m_metaInfo
;
std
::
string
getFileName
()
const
;
protected:
private:
/**
* Name of the file this data set was loaded from. This information
* may allow hollowing data sets later.
*/
std
::
string
m_fileName
;
};
#endif // WDATASET_H
src/dataHandler/WDataSetMultiple.h
View file @
9f1713b5
...
...
@@ -37,8 +37,8 @@ public:
* Dummy constructor.
* TODO(wiebel): implement this
*/
explicit
WDataSetMultiple
(
boost
::
shared_ptr
<
WMetaInfo
>
newMetaInfo
)
:
WDataSet
(
newMetaInfo
)
explicit
WDataSetMultiple
()
:
WDataSet
()
{
// TODO(wiebel): implement this
};
...
...
src/dataHandler/WDataSetSingle.cpp
View file @
9f1713b5
...
...
@@ -26,13 +26,11 @@
#include "WGrid.h"
WDataSetSingle
::
WDataSetSingle
(
boost
::
shared_ptr
<
WValueSetBase
>
newValueSet
,
boost
::
shared_ptr
<
WGrid
>
newGrid
,
boost
::
shared_ptr
<
WMetaInfo
>
newMetaInfo
)
:
WDataSet
(
newMetaInfo
)
boost
::
shared_ptr
<
WGrid
>
newGrid
)
:
WDataSet
()
{
assert
(
newValueSet
);
assert
(
newGrid
);
assert
(
newMetaInfo
);
assert
(
newValueSet
->
size
()
==
newGrid
->
size
()
);
m_valueSet
=
newValueSet
;
...
...
src/dataHandler/WDataSetSingle.h
View file @
9f1713b5
...
...
@@ -39,11 +39,10 @@ class WDataSetSingle : public WDataSet
{
public:
/**
* Constructs an instance out of a value set
, grid and meta information
.
* Constructs an instance out of a value set
and a grid
.
*/
WDataSetSingle
(
boost
::
shared_ptr
<
WValueSetBase
>
newValueSet
,
boost
::
shared_ptr
<
WGrid
>
newGrid
,
boost
::
shared_ptr
<
WMetaInfo
>
newMetaInfo
);
boost
::
shared_ptr
<
WGrid
>
newGrid
);
/**
* Destroys this DataSet instance
...
...
src/dataHandler/WDataSetTimeDependent.h
View file @
9f1713b5
...
...
@@ -37,8 +37,8 @@ public:
* Dummy constructor.
* TODO(wiebel): implement this
*/
explicit
WDataSetTimeDependent
(
boost
::
shared_ptr
<
WMetaInfo
>
newMetaInfo
)
:
WDataSet
(
newMetaInfo
)
explicit
WDataSetTimeDependent
()
:
WDataSet
()
{
// TODO(wiebel): implement this
};
...
...
src/dataHandler/WEEG.cpp
View file @
9f1713b5
...
...
@@ -25,11 +25,10 @@
#include "../common/WLimits.h"
WEEG
::
WEEG
(
boost
::
shared_ptr
<
WMetaInfo
>
metaInfo
,
const
WEEGSegmentArray
&
data
,
WEEG
::
WEEG
(
const
WEEGSegmentArray
&
data
,
const
WEEGElectrodeLibrary
&
electrodeLib
,
const
WEEGChannelLabels
&
channelLabels
)
:
WRecording
(
metaInfo
)
:
WRecording
()
{
assert
(
data
.
size
()
<=
wlimits
::
MAX_RECORDING_SEGMENTS
);
assert
(
data
.
size
()
>
0
);
// ensure that ther is really data
...
...
src/dataHandler/WEEG.h
View file @
9f1713b5
...
...
@@ -32,7 +32,7 @@
///======================================
// TODO(
wiebel
): use this szuff or remove it
// TODO(wiebel): use this szuff or remove it
#include "../math/WPosition.h"
typedef
double
dummyType
;
class
WEEGElectrodeObject
...
...
@@ -72,8 +72,7 @@ public:
/**
* TODO(wiebel): Document this!
*/
explicit
WEEG
(
boost
::
shared_ptr
<
WMetaInfo
>
metaInfo
,
const
WEEGSegmentArray
&
data
,
explicit
WEEG
(
const
WEEGSegmentArray
&
data
,
const
WEEGElectrodeLibrary
&
electrodeLib
,
const
WEEGChannelLabels
&
channelLabels
);
...
...
src/dataHandler/WMetaInfo.cpp
deleted
100644 → 0
View file @
bd2b2f21
//---------------------------------------------------------------------------
//
// Project: OpenWalnut
//
// Copyright 2009 SomeCopyrightowner
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <string>
#include <vector>
#include "WMetaInfo.h"
WMetaInfo
::
WMetaInfo
()
:
m_name
(
""
),
m_fileName
(
""
),
m_dataType
(
0
),
m_valueDim
(
0
),
m_nx
(
0
),
m_ny
(
0
),
m_nz
(
0
),
m_dx
(
0.0
),
m_dy
(
0.0
),
m_dz
(
0.0
),
m_xyzUnits
(
0
),
m_xyzUnitsName
(
""
),
m_qformCode
(
0
),
m_qformCodeName
(
""
),
// m_qtoXyzMatrix
// m_qtoIjkMatrix
m_quaternB
(
0.0
),
m_quaternC
(
0.0
),
m_quaternD
(
0.0
),
m_qoffsetX
(
0.0
),
m_qoffsetY
(
0.0
),
m_qoffsetZ
(
0.0
),
m_qfac
(
0.0
),
m_qformOrientationI
(
0
),
m_qformOrientationJ
(
0
),
m_qformOrientationK
(
0
),
m_freqDim
(
0
),
m_phaseDim
(
0
),
m_sliceDim
(
0
)
{
}
std
::
string
WMetaInfo
::
getName
()
const
{
return
m_name
;
}
void
WMetaInfo
::
setName
(
std
::
string
name
)
{
m_name
=
name
;
}