Commit cae43661 authored by Robert Frohl's avatar Robert Frohl

[CHANGE] - update for the module layouting graph

parent 6e081e93
......@@ -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
......@@ -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
......
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.
......
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
This diff is collapsed.
......@@ -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} ${OWExtNiftiIOName}
${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
......
......@@ -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/OpenWalnut";
m_docPath = m_appPath / "../share/doc/OpenWalnut";
m_configPath = m_appPath / "../etc/OpenWalnut";
m_sharePath = m_appPath / "../share/openwalnut";
m_docPath = m_appPath / "../share/doc";
m_configPath = m_appPath / "../share/openwalnut";
m_libPath = m_appPath / "../lib";
m_modulePath = m_libPath / "OpenWalnut";
m_modulePath = m_libPath / "openwalnut";
}
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;
......
......@@ -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
......
......@@ -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.
......
......@@ -24,7 +24,7 @@
#include <vector>
#include "ext/Eigen/SVD"
#include <Eigen/SVD>
#include "../WAssert.h"
#include "../WLimits.h"
......
......@@ -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 )
......
......@@ -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.
......
......@@ -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];
......
......@@ -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.
*/
......
......@@ -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"
/**
......
......@@ -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;
}
......@@ -96,6 +96,20 @@ public:
*/
void setPaintMode( int mode );
/**
* En-/Disables throwing.