Commit 1bebb094 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 6516a08f d9271867
......@@ -14,6 +14,9 @@ eichelbaum@informatik.uni-leipzig.de Sebastian_Eichelbaum
Sebastian Eichelbaum = Sebastian_Eichelbaum
cornimueller Cornelius_Mueller
mam04cvr@studserv.uni-leipzig.de Cornelius_Mueller
hlawit Mario_Hlawitschka
hlawitschka@informatik.uni-leipzig.de Mario_Hlawitschka
hlawit@informatik.uni-leipzig.de Mario_Hlawitschka
hlawitschka@ucdavis.edu Mario_Hlawitschka
mai02igw@informatik.uni-leipzig.de Robin_Ledig
mai02ifw@informatik.uni-leipzig.de Robin_Ledig
......
......@@ -15,4 +15,4 @@
#VERSION=1.2.0
#VERSION=1.2.0+hgX -> replaces the X with the current revision number
#VERSUIB=1.2.0+hg1234 -> here, revision number was set by the build scripts for example.
VERSION=1.2.5+hgX
VERSION=1.3.0+hgX
......@@ -1419,7 +1419,7 @@ HIDE_UNDOC_RELATIONS = NO
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
HAVE_DOT = YES
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
......
......@@ -83,25 +83,25 @@ modules.
<h2><a name="Toolbar" />Toolbar</h2>
<table>
<tr><td><b>Icon</b></td><td><b>Name</b></td><td><b>Description</b></td></tr>
<tr><td><b>Icon&nbsp;</b></td><td><b>Name</b></td><td><b>Description</b></td></tr>
<tr><td><img src="icons/fileopen.png" width="20"></td><td>Load
Data</td><td>Loads data given in various formats like fibers (.fib), NIfTI
Dataset</td><td>Loads data given in various formats like fibers (.fib), NIfTI
images (.nii, .nii.gz) or EEG data (.cnt). Not all supported file formats
are available through this button and the dialog behind it. For some file
formats there are special modules for reading and/or writing them.</td></tr>
<tr><td><img src="icons/projOpen.png" width="20"></td><td>Load a project from
file</td><td>Opens a project file (.owp), and instantiates modules, sets their
<tr><td><img src="icons/projOpen.png" width="20"></td><td>Load Project</td><td>Opens a project file (.owp), and instantiates modules, sets their
connections and orients the scene accordingly.</td></tr>
<tr><td><img src="icons/disc.png" width="20"></td><td>Save current project to
file</td><td>Saves the current state (modules, connections, orientation of
<tr><td><img src="icons/disc.png" width="20"></td><td>Save Project</td><td>Saves the current state (modules, connections, orientation of
the scene) of OpenWalnut to a project file (.owp).</td></tr>
<tr><td><img src="icons/camera.png" width="20"></td><td>Reset main view</td><td>Rotates
<tr><td><img src="icons/image.png"
width="20"></td><td>Screenshot</td><td>Stores a snapshot image of
the main view.</td></tr>
<tr><td><img src="icons/camera.png" width="20"></td><td>Reset</td><td>Rotates
and scales the scene in the central 3D view to show the same orientation as
after program startup but zoomed to show all contents of the
scene.</td></tr>
<tr><td><img src="icons/box.png" width="20"></td><td>Create new
ROI box</td><td>Adds a new ROI box to the 3D scene and the ROI browser. See also: <a href="#ROIs">ROIs</a>.</td></tr>
<tr><td><img src="icons/box.png" width="20"></td><td>ROI</td><td>Adds a new ROI box to the 3D scene and the ROI browser. See also: <a href="#ROIs">ROIs</a>.</td></tr>
<tr><td><img src="icons/QuestionMarks.xpm" width="20"></td><td>Missing
module?</td><td>This opens the dialog that allows to customize the list of
modules that are allowed to appear in the <i>Compatible Modules</i> toolbar.</td></tr>
......
<h1>Welcome to OpenWalnut %OW_LIB_VERSION%!</h1>
<h1>Welcome to OpenWalnut %OW_LIB_VERSION% Development Version!</h1>
<a href="http://www.openwalnut.org/projects/openwalnut/wiki/ReleaseNotes">Release Notes</a>
<br>
<br>
......
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: openwalnut
Description: The OpenWalnut core library -- OpenWalnut is a tool for multi-modal medical and brain data visualization.
Version: 1.2.5
Cflags: -I${includedir}/openwalnut @EIGEN3_DEFINES@
Libs: -L${libdir} -lopenwalnut
Requires: openscenegraph eigen3
......@@ -6,11 +6,3 @@ The complete credit,copyright and ownership belongs to the
liberation-fonts project. See license.txt and COPYING as well as
AUTHORS for details.
arial.ttf:
==========
Due to a bug in OpenSceneGraph, we had to add some fonts here.
Especially arial.ttf. It is needed by the OSG Stat Display, where
the font filename cannot be changed. The file arial.ttf is a copy
of liberationSans-Bold.ttf. Sorry for that. Maybe this is fixed
some day.
......@@ -68,6 +68,9 @@ SETUP_LIB_INSTALL( ${LibName} ${OW_LIBRARY_DIR_RELATIVE} "CORE" )
# 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" )
# The core does also provide some nice pkg-config file. Set this up and configure it to contain the correct install prefix
SETUP_CONFIGURED_FILE( "core-dev" "lib/pkgconfig/openwalnut.pc" "CORE_DEV" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Test Setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -96,7 +99,7 @@ ADD_CUSTOM_TARGET( core_devdoc
# copy our own resources
IF( NOT OW_PACKAGE_NOCOPY_COREFONTS )
SETUP_RESOURCES( "core" "CORE" )
SETUP_GLOBAL_RESOURCES( "core" "CORE" )
ELSE()
# This is a hack which is quite debian specific. We do this here to avoid font duplicates since the ttf-liberation fonts are already
# available on Debian. If you need to modify this for another packaging thingy, please let me know (ebaum@informatik.uni-leipzig.d). We then
......@@ -106,8 +109,6 @@ ELSE()
COMPONENT "CORE" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E make_directory \${CMAKE_INSTALL_PREFIX}/share/openwalnut/fonts )"
COMPONENT "CORE" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink /usr/share/fonts/truetype/ttf-liberation/LiberationMono-Bold.ttf \${CMAKE_INSTALL_PREFIX}/share/openwalnut/fonts/arial.ttf )"
COMPONENT "CORE" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink /usr/share/fonts/truetype/ttf-liberation/LiberationMono-Bold.ttf \${CMAKE_INSTALL_PREFIX}/share/openwalnut/fonts/Bold.ttf )"
COMPONENT "CORE" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink /usr/share/fonts/truetype/ttf-liberation/LiberationMono-Italic.ttf \${CMAKE_INSTALL_PREFIX}/share/openwalnut/fonts/Italic.ttf )"
......
......@@ -26,11 +26,13 @@
#define WBOUNDINGBOX_H
#include <ostream>
#include <iomanip> // for setprecision
#include <cmath> // std::sqrt
#include <osg/BoundingBox>
#include "exceptions/WInvalidBoundingBox.h"
#include "math/linearAlgebra/WLinearAlgebra.h"
//#include "math/linearAlgebra/WLinearAlgebra.h"
/**
* Represents a \e axis \e parallel bounding box and provides some useful operations with them.
......
......@@ -32,6 +32,22 @@
#include "../common/WStringUtils.h"
#include "WColor.h"
// initialize static palette
namespace defaultColor
{
/** the default palette colors */
const WColor DefaultPalette[ 22 ]= {
// The standard colors
RED, GREEN, BLUE, YELLOW, ORANGE, PINK, CYAN,
// the slightly lighter standard colors
LIGHTRED, LIGHTGREEN, LIGHTBLUE, LIGHTYELLOW,
// the slighly darker standard colors
DARKRED, DARKGREEN, DARKBLUE, DARKYELLOW, VIOLET, TEAL,
// black-white
BLACK, GRAY25, GRAY50, GRAY75, WHITE
};
}
// This function is taken from VTK 5.4.2. Since its BSD licensed the license
// notice follows below. It is not taken from FAnToM since it seems more self
// documenting.
......
......@@ -44,6 +44,16 @@ class OWCOMMON_EXPORT WConditionSet: public WCondition
friend class WConditionSetTest;
public:
/**
* Shared pointer to instance of this class.
*/
typedef boost::shared_ptr< WConditionSet > SPtr;
/**
* Shared pointer to const instance of this class.
*/
typedef boost::shared_ptr< const WConditionSet > ConstSPtr;
/**
* Default constructor.
*/
......
......@@ -22,7 +22,7 @@
//
//---------------------------------------------------------------------------
#if ( defined( __linux__ ) && defined( __GNUC__ ) )
#if (( defined( __linux__ ) && defined( __GNUC__ )) || defined ( __APPLE__ ))
// This is highly platform dependent. Used for backtrace functionality.
#include <execinfo.h>
#include <cxxabi.h>
......@@ -105,7 +105,7 @@ std::string WException::getBacktrace() const
// print trace here
std::ostringstream o;
#if ( defined( __linux__ ) && defined( __GNUC__ ) )
#if (( defined( __linux__ ) && defined( __GNUC__ )) || defined( __APPLE__))
// This is highly platform dependent. It MIGHT also work on BSD and other unix.
// Automatic callstack backtrace
......
......@@ -60,7 +60,7 @@ public:
* \note condition can also be a WConditionOneShot.
* \param initial the initial value of this flag.
*/
WFlag( WCondition* condition, T initial );
WFlag( WCondition* condition, const T& initial );
/**
* Constructor. Uses a given condition to realize the wait/notify functionality. By using this constructor, the specified
......@@ -70,7 +70,7 @@ public:
* \note condition can also be a WConditionOneShot.
* \param initial the initial value of this flag.
*/
WFlag( boost::shared_ptr< WCondition > condition, T initial );
WFlag( boost::shared_ptr< WCondition > condition, const T& initial );
/**
* Copy constructor. Creates a deep copy of this property. As boost::signals2 and condition variables are non-copyable, new instances get
......@@ -95,21 +95,21 @@ public:
*
* \return the value.
*/
virtual const T get( bool resetChangeState = false );
virtual const T& get( bool resetChangeState = false );
/**
* Operator returns value of the flag.
*
* \return the value.
*/
virtual const T get() const;
virtual const T& get() const;
/**
* Operator returns value of the flag.
*
* \return the value.
*/
virtual const T operator()() const;
virtual const T& operator()() const;
/**
* Operator returns value of the flag. It does not reset the change flag.
......@@ -133,14 +133,14 @@ public:
*
* \note set( get() ) == true
*/
virtual bool set( T value, bool suppressNotification = false );
virtual bool set( const T& value, bool suppressNotification = false );
/**
* Sets the new value for this flag. Also notifies waiting threads.
*
* \param value the new value
*/
virtual void operator()( T value );
virtual void operator()( const T& value );
/**
* Returns the condition that is used by this flag.
......@@ -165,7 +165,7 @@ public:
*
* \return true if it is a valid/acceptable value.
*/
virtual bool accept( T newValue );
virtual bool accept( const T& newValue );
/**
* Tests whether a flag is currently valid. It is equal to accept( get() );
......@@ -216,7 +216,7 @@ private:
typedef WFlag< bool > WBoolFlag;
template < typename T >
WFlag< T >::WFlag( WCondition* condition, T initial ):
WFlag< T >::WFlag( WCondition* condition, const T& initial ):
m_condition( boost::shared_ptr< WCondition >( condition ) ),
m_valueChangeCondition( boost::shared_ptr< WCondition >( new WCondition() ) ),
m_flag( initial ),
......@@ -225,7 +225,7 @@ WFlag< T >::WFlag( WCondition* condition, T initial ):
}
template < typename T >
WFlag< T >::WFlag( boost::shared_ptr< WCondition > condition, T initial ):
WFlag< T >::WFlag( boost::shared_ptr< WCondition > condition, const T& initial ):
m_condition( condition ),
m_valueChangeCondition( boost::shared_ptr< WCondition >( new WCondition() ) ),
m_flag( initial ),
......@@ -248,13 +248,13 @@ WFlag< T >::~WFlag()
}
template < typename T >
const T WFlag< T >::operator()() const
const T& WFlag< T >::operator()() const
{
return get();
}
template < typename T >
const T WFlag< T >::get( bool resetChangeState )
const T& WFlag< T >::get( bool resetChangeState )
{
if( resetChangeState )
{
......@@ -264,7 +264,7 @@ const T WFlag< T >::get( bool resetChangeState )
}
template < typename T >
const T WFlag< T >::get() const
const T& WFlag< T >::get() const
{
return m_flag;
}
......@@ -282,13 +282,13 @@ void WFlag< T >::wait() const
}
template < typename T >
void WFlag< T >::operator()( T value )
void WFlag< T >::operator()( const T& value )
{
set( value );
}
template < typename T >
bool WFlag< T >::set( T value, bool suppressNotification )
bool WFlag< T >::set( const T& value, bool suppressNotification )
{
// if the value is the same as the current one -> do not notify but let the caller know "all ok"
if( m_flag == value )
......@@ -328,7 +328,7 @@ boost::shared_ptr< WCondition > WFlag< T >::getValueChangeCondition()
}
template < typename T >
bool WFlag< T >::accept( T /* newValue */ )
bool WFlag< T >::accept( const T& /* newValue */ )
{
// please implement this method in your class to modify the behaviour.
return true;
......
......@@ -22,4 +22,18 @@
//
//---------------------------------------------------------------------------
#include <limits>
#include "WLimits.h"
namespace wlimits
{
const double MAX_DOUBLE = std::numeric_limits< double >::max();
const float MAX_FLOAT = std::numeric_limits< float >::max();
const size_t MAX_SIZE_T = std::numeric_limits< size_t >::max();
const int32_t MAX_INT32_T = std::numeric_limits< int32_t >::max();
const double MIN_DOUBLE = std::numeric_limits< double >::min();
const double DBL_EPS = std::numeric_limits< double >::epsilon();
const float FLT_EPS = std::numeric_limits< float >::epsilon();
}
......@@ -28,34 +28,33 @@
#include <stdint.h> // since <cstdint> is part of c++0x upcoming standard
#include <cstddef>
#include <limits>
#include <boost/math/special_functions/fpclassify.hpp> // isnan, isinf
/**
* Project wide limits for different quantitities.
* Project wide limits for different quantities.
*/
namespace wlimits
{
static const double MAX_DOUBLE = std::numeric_limits< double >::max(); //!< Maximum double value
extern const double MAX_DOUBLE; //!< Maximum double value
static const float MAX_FLOAT = std::numeric_limits< float >::max(); //!< Maximum float value
extern const float MAX_FLOAT; //!< Maximum float value
static const size_t MAX_SIZE_T = std::numeric_limits< size_t >::max(); //!< Maximum size value
extern const size_t MAX_SIZE_T; //!< Maximum size value
static const int32_t MAX_INT32_T = std::numeric_limits< int32_t >::max(); //!< Maximum int32_t value
extern const int32_t MAX_INT32_T; //!< Maximum int32_t value
static const double MIN_DOUBLE = std::numeric_limits< double >::min(); //!< Positive minimum double value
extern const double MIN_DOUBLE; //!< Positive minimum double value
/**
* Smallest double such: 1.0 + DBL_EPS == 1.0 is still true.
*/
static const double DBL_EPS = std::numeric_limits< double >::epsilon();
extern const double DBL_EPS;
/**
* Smallest float such: 1.0 + FLT_EPS == 1.0 is still true.
*/
static const float FLT_EPS = std::numeric_limits< float >::epsilon();
extern const float FLT_EPS;
/**
* Determines if a number is considered as NaN (aka Not a Number) or not.
......
......@@ -25,6 +25,7 @@
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <boost/tokenizer.hpp>
......@@ -53,9 +54,10 @@ boost::shared_ptr< WPathHelper > WPathHelper::getPathHelper()
return m_instance;
}
void WPathHelper::setAppPath( boost::filesystem::path appPath )
void WPathHelper::setBasePaths( boost::filesystem::path appPath, boost::filesystem::path homePath )
{
m_appPath = appPath;
m_homePath = homePath;
m_sharePath = m_appPath / "../share/openwalnut";
m_docPath = m_appPath / "../share/doc";
m_configPath = m_appPath / "../share/openwalnut";
......@@ -94,6 +96,11 @@ boost::filesystem::path WPathHelper::getModulePath()
return getPathHelper()->m_modulePath;
}
boost::filesystem::path WPathHelper::getHomePath()
{
return getPathHelper()->m_homePath;
}
boost::filesystem::path WPathHelper::getLibPath()
{
return getPathHelper()->m_libPath;
......@@ -120,6 +127,7 @@ std::vector< boost::filesystem::path > WPathHelper::getAllModulePaths()
std::vector< boost::filesystem::path > paths;
// the first element always is the global search path
paths.push_back( getModulePath() );
paths.push_back( getHomePath() / "modules" );
// the environment variable stores the additional paths
std::string additionalPaths( getenv( "OW_MODULE_PATH" ) ? getenv( "OW_MODULE_PATH" ) : "" );
......@@ -133,6 +141,29 @@ std::vector< boost::filesystem::path > WPathHelper::getAllModulePaths()
paths.push_back( boost::filesystem::path( *it ) );
}
// add the additional paths
for( std::vector< boost::filesystem::path >::const_iterator it = getPathHelper()->m_additionalModulePaths.begin();
it != getPathHelper()->m_additionalModulePaths.end();
++it )
{
if( !std::count( paths.begin(), paths.end(), *it ) )
{
paths.push_back( *it );
}
}
return paths;
}
void WPathHelper::addAdditionalModulePath( const boost::filesystem::path& path )
{
if( !std::count( m_additionalModulePaths.begin(), m_additionalModulePaths.end(), path ) )
{
m_additionalModulePaths.push_back( path );
}
}
const std::vector< boost::filesystem::path >& WPathHelper::getAdditionalModulePaths() const
{
return m_additionalModulePaths;
}
......@@ -57,11 +57,13 @@ public:
static boost::shared_ptr< WPathHelper > getPathHelper();
/**
* Set the current application path. This should be called only once.
* Set the current application path. This should be called only once. The home path hereby is NOT the users home. It is an directory, where
* OW can write user specific data. A good default here is to specify USERHOME/.OpenWalnut for example.
*
* \param appPath the application path
* \param homePath the OW home path
*/
void setAppPath( boost::filesystem::path appPath );
void setBasePaths( boost::filesystem::path appPath, boost::filesystem::path homePath );
/**
* The path where the binary file resides in. This is for example /usr/bin.
......@@ -127,13 +129,37 @@ public:
static boost::filesystem::path getModulePath();
/**
* This returns a list of search paths for modules. This list is defined by the environment variable "OW_MODULE_PATH". All of these
* The path to the OW dir in the user's home. This will not be the home dir directly. It is something like $HOME/.OpenWalnut.
*
* \return OW home path
*/
static boost::filesystem::path getHomePath();
/**
* This returns a list of search paths for modules. This list is defined by the environment variable "OW_MODULE_PATH" and the list of additional
* module paths. All of these
* directories CAN contain modules. On startup, they get searched in the specified order.
*
* \return list of search paths for modules
*/
static std::vector< boost::filesystem::path > getAllModulePaths();
/**
* This method adds the given path to the list of module paths. This way, arbitrary paths can be specified to search for modules. Each path
* is searched recursively.
*
* \param path the path to add.
*/
void addAdditionalModulePath( const boost::filesystem::path& path );
/**
* Returns the list of paths added using addAdditionalModulePath. This does NOT contain the paths in OW_MODULE_PATH. Use getAllModulePaths
* for this.
*
* \return the list of additional paths
*/
const std::vector< boost::filesystem::path >& getAdditionalModulePaths() const;
/**
* The path to the OW libs. You normally should not need this.
*
......@@ -202,6 +228,17 @@ private:
*/
boost::filesystem::path m_libPath;
/**
* The path of a user specific OW directory.
*/
boost::filesystem::path m_homePath;
/**
* A list of additional paths to search for modules. This does not contain the paths in the environment variable OW_MODULE_PATH. This method
* is not thread-safe. You should only use it before the module factory loads the modules.
*/
std::vector< boost::filesystem::path > m_additionalModulePaths;
/**
* Singleton instance of WPathHelper.
*/
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment