Commit 6184f5bf by Dirk Albrecht

[REVERT] Revert to version 3259. Modul Fiberdisplay didn't load after merge.

parent 74bf01b4
wiebel Alexander_Wiebel
wiebel@hegel.informatik.uni-leipzig.de Alexander_Wiebel
openwalnut@dergrosse.de Alexander_Wiebel
wiebel@openwalnut.org Alexander_Wiebel
wiebel_openwalnut@dergrosse.de Alexander_Wiebel
wiebel@bsv_2008a Alexander_Wiebel
math Mathias_Goldau
lmath@voltaire.informatik.uni-leipzig.de Mathias_Goldau
math@informatik.uni-leipzig.de Mathias_Goldau
schurade@spinat.cbs.mpg.de Ralph_Schurade
schurade Ralph_Schurade
ebaum Sebastian_Eichelbaum
eichelbaum@informatik.uni-leipzig.de Sebastian_Eichelbaum
......@@ -17,12 +15,4 @@ hlawitschka@ucdavis.edu Mario_Hlawitschka
mai02igw@informatik.uni-leipzig.de Robin_Ledig
mai02ifw@informatik.uni-leipzig.de Robin_Ledig
mai02igw@studserv.uni-leipzig.de Robin_Ledig
heine@informatik.uni-leipzig.de Christian_Heine
reichenbach@berkeley.informatik.uni-leipzig.de Andre_Reichenbach
reichenbach Andre_Reichenbach
philips@informatik.uni-leipzig.de Stefan_Philips
frohl.robert@googlemail.com Robert_Frohl
dirk_albrecht@gmx.net Dirk_Albrecht
albrecht Dirk_Albrecht
mstuber Marcus_Stuber
skiunke Sebastian_Kiunke
\ No newline at end of file
heine@informatik.uni-leipzig.de Christian_Heine
\ No newline at end of file
......@@ -7,7 +7,10 @@ the currect working directory to be project's main directory,
the following steps should do the trick:
> cd build
> cmake ../src
> ccmake ../src
PRESS 'c' for configuration
PRESS 'c' again for further configuration
PRESS 'g' to generate the build system including the Makefiles.
> make
Now the subdirectory "bin" of the "build" directory should contain an executable named walnut.
......
......@@ -31,7 +31,7 @@ PROJECT_NAME = OpenWalnut
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.1+
PROJECT_NUMBER = 1.0+
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......@@ -1030,7 +1030,7 @@ FORMULA_FONTSIZE = 10
# typically be disabled. For large projects the javascript based search engine
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = YES
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
......
......@@ -31,7 +31,7 @@ PROJECT_NAME = OpenWalnut
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.1+
PROJECT_NUMBER = 1.0+
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
......@@ -43,17 +43,17 @@ compatiblesToolBarStyle = 0 # this pref allows the compatibles toolbar to have a
# 2 -> left
# 3 -> right
# 4 -> hide completely
# 5 -> inside the control panel ( not possible for compatiblesToolBarPos! This will be mapped to right (=3) )
# 5 -> inside the dataset browser ( not possible for compatiblesToolBarPos! This will be mapped to right (=3) )
toolBarPos = 0 # default position of the toolbars
compatiblesToolBarPos = 0 # position of the compatibles toolbar (overrides toolBarPos)
####################################################################
# Control panel
# Dataset Browser
# combineTreeAndRoiAndTextureSorter = yes # should the module tree, ROI tree and the Texture Sorter be combined in ONE Tab widget?
# dsbWidth = 400 # the width of the control panel
# dsbInvisibleByDefault = yes # hide the control panel on startup. Can be shown using F9.
# dsbFloatingByDefault = yes # should the control panel be undocked on startup?
# dsbWidth = 400 # the width of the dataset browser
# dsbInvisibleByDefault = yes # hide the dataset browser on startup. Can be shown using F9.
# dsbFloatingByDefault = yes # should the dataset browser be undocked on startup?
####################################################################
# Other GUI settings
......
......@@ -12,7 +12,7 @@ allowOnlyOneFiberDataSet = yes # This will prevent you from accidently loading m
# default=HUD
## A list of modules that will be provided through the GUI.
## If the list is empty all available modules are provided.
whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbitrary Rois,Bounding Box,Distance Map Isosurface,Gauss Filtering,HUD,Isosurface,Isosurface Raytracer,LIC,Read Mesh,Voxelizer,Superquadric Glyphs,Triangle Mesh Renderer,Vector Plot,Write NIfTI
whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbitrary Rois,Bounding Box,Distance Map Isosurface,Gauss Filtering,HUD,Isosurface,Isosurface Raytracer,LIC,Mesh Reader,Voxelizer,Superquadric Glyphs,Triangle Mesh Renderer,Vector Plot,Write NIfTI
## Specify a ";" separated list of additional paths for modules. The order of appearance is the order of loading. The following additional rules apply here:
## 1. if the directory contains one or more libOWmodule_XYZ it/they get loaded
......@@ -49,17 +49,17 @@ compatiblesToolBarStyle = 0 # this pref allows the compatibles toolbar to have a
# 2 -> left
# 3 -> right
# 4 -> hide completely
# 5 -> inside the control panel ( not possible for compatiblesToolBarPos! This will be mapped to right (=3) )
# 5 -> inside the dataset browser ( not possible for compatiblesToolBarPos! This will be mapped to right (=3) )
toolBarPos = 0 # default position of the toolbars
compatiblesToolBarPos = 0 # position of the compatibles toolbar (overrides toolBarPos)
####################################################################
# Control panel
# Dataset Browser
# combineTreeAndRoiAndTextureSorter = yes # should the module tree, ROI tree and the Texture Sorter be combined in ONE Tab widget?
# dsbWidth = 400 # the width of the control panel
# dsbInvisibleByDefault = yes # hide the control panel on startup. Can be shown using F9.
# dsbFloatingByDefault = yes # should the control panel be undocked on startup?
# dsbWidth = 400 # the width of the dataset browser
# dsbInvisibleByDefault = yes # hide the dataset browser on startup. Can be shown using F9.
# dsbFloatingByDefault = yes # should the dataset browser be undocked on startup?
####################################################################
# Other GUI settings
......
......@@ -76,10 +76,9 @@ IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
FIND_PACKAGE( osgText ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgGA ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgSim ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgWidget ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( OpenThreads ${MIN_OSG_VERSION} REQUIRED )
SET( OPENSCENEGRAPH_LIBRARIES ${OSGDB_LIBRARY} ${OSGTEXT_LIBRARY} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSG_LIBRARY} ${OSGSIM_LIBRARY} ${OSGWIDGET_LIBRARY} ${OPENTHREADS_LIBRARY} )
SET( OPENSCENEGRAPH_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSGDB_INCLUDE_DIR} ${OSGTEXT_INCLUDE_DIR} ${OSGGA_INCLUDE_DIR} ${OSGVIEWER_INCLUDE_DIR} ${OSGUTIL_INCLUDE_DIR} ${OSGSIM_INCLUDE_DIR} ${OSGWIDGET_INCLUDE_DIR} ${OPENTHREADS_INCLUDE_DIR} )
SET( OPENSCENEGRAPH_LIBRARIES ${OSGDB_LIBRARY} ${OSGTEXT_LIBRARY} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSG_LIBRARY} ${OSGSIM_LIBRARY} ${OPENTHREADS_LIBRARY} )
SET( OPENSCENEGRAPH_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSGDB_INCLUDE_DIR} ${OSGTEXT_INCLUDE_DIR} ${OSGGA_INCLUDE_DIR} ${OSGVIEWER_INCLUDE_DIR} ${OSGUTIL_INCLUDE_DIR} ${OSGSIM_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 osgSim OpenThreads )
INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
......@@ -87,7 +86,7 @@ ELSE()
IF( NOT VERSION LESS 2.6.3 )
SET ( CMAKE_PREFIX_PATH "$ENV{ProgramFiles}/OpenSceneGraph" )
ENDIF()
FIND_PACKAGE( OpenSceneGraph ${MIN_OSG_VERSION} REQUIRED osgUtil osgDB osgViewer osgText osgGA osgSim osgWidget )
FIND_PACKAGE( OpenSceneGraph ${MIN_OSG_VERSION} REQUIRED osgUtil osgDB osgViewer osgText osgGA osgSim )
INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
ENDIF()
......@@ -99,36 +98,6 @@ IF( Teem_FOUND ) # we need to add the include path and lib path to allow the
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${Teem_LIBRARY_DIRS} )
ENDIF()
### OSSIM ###
FIND_PACKAGE( OSSIM QUIET )
IF( OSSIM_FOUND )
MESSAGE( STATUS "Found OSSIM." )
ADD_DEFINITIONS( -DUSEOSSIM )
INCLUDE_DIRECTORIES( ${OSSIM_INCLUDE_DIR} )
LINK_LIBRARIES( ${OSSIM_LIBRARY} )
# TODO(math): is an entry in link directories necessary?
# LINK_DIRECTORIES( ${OSSIM_LIBDIR} )
MARK_AS_ADVANCED( OSSIM_INCLUDEDIR )
MARK_AS_ADVANCED( OSSIM_LIBRARIES )
# MARK_AS_ADVANCED( OSSIM_LIBDIR )
ENDIF()
# insight toolkit (for image segmentation and registration)
#----------------------------------------------------------
FIND_PACKAGE( ITK QUIET )
OPTION( OW_USE_ITK "Use the insight toolkit for image segmentation" OFF )
IF( ITK_FOUND AND OW_USE_ITK )
INCLUDE( ${ITK_USE_FILE} )
ENDIF( ITK_FOUND AND OW_USE_ITK )
### Eigen #### (for the gauss process, the covariance matrices tend to be sparse and 20x20, but ~70.000 of them)
FIND_PACKAGE( Eigen3 QUIET )
IF( EIGEN3_FOUND )
MESSAGE( STATUS "Found Eigen3 in: ${EIGEN3_INCLUDE_DIR} with version: ${EIGEN3_VERSION}" )
MARK_AS_ADVANCED( EIGEN3_INCLUDE_DIR )
MARK_AS_ADVANCED( EIGEN3_VERSION )
ENDIF()
# other options:
#---------------
# Set default build type
......@@ -152,8 +121,6 @@ IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
SET( CMAKE_SHARED_LINKER_FLAGS " /STACK:10000000 /machine:I386 /NODEFAULTLIB:${EXCLUDE_LIBRARIES}" CACHE STRING "" FORCE )
SET( CMAKE_EXE_LINKER_FLAGS " /STACK:10000000 /machine:I386 /NODEFAULTLIB:${EXCLUDE_LIBRARIES}" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"NOMINMAX\"" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP" )
SET( CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows" )
ELSE()
# Unfortunately libstdc++'s header files don't work with mingw in ansi mode (basically libstdc++'s fault)
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
......@@ -172,11 +139,6 @@ ELSE()
SET( CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG -O0" CACHE STRING "" FORCE )
ENDIF()
IF( ITK_FOUND AND OW_USE_ITK )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOW_USE_ITK" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOW_USE_ITK" CACHE STRING "" FORCE )
ENDIF( ITK_FOUND AND OW_USE_ITK )
SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -DDEBUG -O2" CACHE STRING "" FORCE )
ADD_SUBDIRECTORY( dataHandler )
......@@ -209,11 +171,6 @@ ENDIF()
ADD_EXECUTABLE( walnut OpenWalnut.cpp version.h )
TARGET_LINK_LIBRARIES( walnut OWkernel OWdataHandler OWgui OWguiqt4 OWcommon OWge ${Boost_LIBRARIES} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( walnut PROPERTIES DEBUG_POSTFIX "d")
SET_TARGET_PROPERTIES( walnut PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
#---------- Shaders -------------
option( OW_COPY_SHADERS "This enables copying shaders with every make call." ON )
if( OW_COPY_SHADERS )
......@@ -295,17 +252,15 @@ ADD_CUSTOM_TARGET( tags DEPENDS ctags DEPENDS cscope )
#-------------------------------------------------------------------------------------------------------------
# Determines the number of cores available on this machine
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
SET( NUM_CORES_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../tools/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( numCores
SET( NUM_CORES_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../tools/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( numCores
COMMAND ${CMAKE_COMMAND} -E make_directory ${NUM_CORES_BINARY_DIR}
COMMAND cd ${NUM_CORES_BINARY_DIR} && ${CMAKE_COMMAND} ${NUM_CORES_SOURCE_DIR} > /dev/null
COMMAND $(MAKE) -C ${NUM_CORES_BINARY_DIR} > /dev/null
COMMENT "Determines the number of cores available on this machine"
)
ENDIF()
#-------------------------------------------------------------------------------------------------------------
# Checks style guide lines via the BrainLint tool against all source code files
......@@ -313,7 +268,6 @@ ENDIF()
# 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 )
FILE( GLOB_RECURSE STYLE_GLSL ${PROJECT_SOURCE_DIR}/*.glsl )
# Set dirs to exclude from stylecheck
SET( EXCLUDE_DIRS "/ext/nifti/;/dataHandler/io/biosig/;/dataHandler/io/biosigWin/;/dataHandler/io/biosig/XMLParser/;/dataHandler/io/biosigWin/XMLParser/;/ext/libeep/avr/;/ext/libeep/cnt/;/ext/libeep/eep/;/common/platformDependent/visualStudio/;/modules/lic/fibernavigator/;/modules/lic/fantom/" )
FOREACH( dirname ${EXCLUDE_DIRS} )
......@@ -345,7 +299,7 @@ ELSE()
ENDIF()
FILE( WRITE ${PROJECT_BINARY_DIR}/brainlintlist "" )
FOREACH( fname ${STYLE_CPP} ${STYLE_H} ${STYLE_GLSL} )
FOREACH( fname ${STYLE_CPP} ${STYLE_H} )
FILE( APPEND ${PROJECT_BINARY_DIR}/brainlintlist "${fname}\n" )
ENDFOREACH()
......
......@@ -36,10 +36,6 @@
* \par
* http://www.openwalnut.org
* \par
* There exist two versions of this API.
* A simple one at http://berkeley.informatik.uni-leipzig.de/api/
* and one with callgraphs at http://berkeley.informatik.uni-leipzig.de/apiFull/
* \par
* Copyright 2009-2010 OpenWalnut Community, BSV\@Uni-Leipzig and CNCF\@MPI-CBS.
* For more information see http://www.openwalnut.org/copying
*/
......@@ -49,9 +45,9 @@
*/
int main( int argc, char** argv )
{
std::cout << "OpenWalnut ( http://www.openwalnut.org )" << std::endl <<
"Build from: " << W_VERSION << std::endl << std::endl <<
"Copyright 2009-2010 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS\n"
std::cout << "OpenWalnut ( http://www.openwalnut.org )" << std::endl <<
"Build from: " << W_VERSION << std::endl << std::endl <<
"Copyright (C) 2009-2010 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS\n"
"For more information see http://www.openwalnut.org/copying\n"
"This program comes with ABSOLUTELY NO WARRANTY.\n"
"This is free software, and you are welcome to redistribute it\n"
......
......@@ -10,10 +10,6 @@ ADD_SUBDIRECTORY( math )
ADD_LIBRARY( OWcommon SHARED ${COMMON_SRC} ${COMMON_DATASTRUCTURES_SRC} ${COMMON_EXCEPTIONS_SRC} ${MATH_SRC} ${FIBERSIMILARITY_SRC} )
TARGET_LINK_LIBRARIES( OWcommon ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWcommon PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Set the prefix and suffix of dynamically loadable modules to match
# CMAKEs naming of them. The quotes are necessary so the shell doesn't mess
# with these defines. Unfortunately, the Visual Studio has problems handling
......
......@@ -22,7 +22,6 @@
//
//---------------------------------------------------------------------------
#include <cmath>
#include <cassert>
#include <string>
#include <vector>
......@@ -224,21 +223,3 @@ bool WColor::operator!=( const WColor &rhs ) const
{
return !( *this == rhs );
}
void WColor::inverse()
{
m_red = std::abs( 1. - m_red );
m_green = std::abs( 1. - m_green );
m_blue = std::abs( 1. - m_blue );
}
void WColor::average( const WColor& other )
{
m_red = ( m_red + other.getRed() ) / 2.0;
m_green = ( m_green + other.getGreen() ) / 2.0;
m_blue = ( m_blue + other.getBlue() ) / 2.0;
}
const WColor WColor::green( 0.0, 1.0, 0.0, 1.0 );
const WColor WColor::red( 1.0, 0.0, 0.0, 1.0 );
const WColor WColor::blue( 0.0, 0.0, 1.0, 1.0 );
......@@ -31,9 +31,6 @@
#include <string>
#include <vector>
#include <osg/Vec4>
#include "math/WVector3D.h"
#include "WExportCommon.h"
/**
......@@ -53,20 +50,6 @@ public:
WColor( float red = 0.0, float green = 0.0, float blue = 0.0, float alpha = 1.0 );
/**
* Casts a color to a vector comfortably.
*
* \return vector instance
*/
inline operator osg::Vec4f() const;
/**
* Casts a color to a vector comfortably. As the returned vector is three-dimensional, the alpha value is omitted.
*
* \return vector instance
*/
inline operator wmath::WVector3D() const;
/**
* Sets the green channel for this color
* \param green green value between [0,1]
*/
......@@ -126,18 +109,6 @@ public:
*/
void setRGB( double r, double g, double b );
/**
* Computes the inverse of this color in means of RGB space.
*/
void inverse();
/**
* Computes the arithmetic mean of this and the other color. This is done component wisely.
* For example red mixed with green will become yellow.
*
* \param other The other color to mix in here :D.
*/
void average( const WColor& other );
/**
* Compares two WColor instances on all four channels.
......@@ -157,10 +128,6 @@ public:
*/
bool operator!=( const WColor &rhs ) const;
static const WColor green; //!< Default for green
static const WColor red; //!< Default for red
static const WColor blue; //!< Default for blue
protected:
private:
float m_red; //!< Red channel
......@@ -179,19 +146,4 @@ std::ostream& operator<<( std::ostream& out, const WColor& c );
*/
std::istream& operator>>( std::istream& in, WColor& c );
inline WColor::operator osg::Vec4f() const
{
return osg::Vec4f( static_cast< float >( m_red ),
static_cast< float >( m_green ),
static_cast< float >( m_blue ),
static_cast< float >( m_alpha ) );
}
inline WColor::operator wmath::WVector3D() const
{
return wmath::WVector3D( static_cast< float >( m_red ),
static_cast< float >( m_green ),
static_cast< float >( m_blue ) );
}
#endif // WCOLOR_H
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// 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 "WDendrogram.h"
WDendrogram::WDendrogram( unsigned int numElements )
: m_tree( numElements, Node() )
{
}
WDendrogram::~WDendrogram()
{
}
WDendrogram::Node::Node()
{
parentTreeIdx = 0;
minTreeIdx = 0;
maxTreeIdx = 0;
dataIdx = 0;
height = 0.0;
}
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// 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/>.
//
//---------------------------------------------------------------------------
#ifndef WDENDROGRAM_H
#define WDENDROGRAM_H
#include <vector>
/**
* Hirachical binary tree datastructure with spatial layout information. Since
* join points in a dendrogram do normally not intersect a special index is
* needed. Additionally a parameter for each node and leaf, its height, is
* available.
*
* Each leaf and inner node will obtain a new index called TreeIndex, so the
* hirachy will not overlap or intersect. As a leaf already has an index we
* call this index the DataIndex. So a leaf with DataIndex 5 is the fifth data
* element in the dataset of which this dendrogram is used for. Where as a leaf
* with TreeIndex 5 is the fifth leaf from left.
*/
class WDendrogram
{
friend class WDendrogramTest;
public:
/**
* Creates a new Dendrogram with unjoined elements aka leafs.
*
* \param numElements The number of unjoined or initial elements
*
* TODO(math): Unsigned int is used to save memory here, but can't we use
* size_t (8bytes) => ask christian..
*/
explicit WDendrogram( unsigned int numElements );
/**
* Destructs a Dendrogram.
*/
virtual ~WDendrogram();
protected:
/**
* Representing a node inside of the Dendrogram.
*
* \note Be aware of the different kinds of indices used in here. See
* Description of the WDendrogram class for more details on TreeIndices and
* DataIndices.
*/
struct Node
{
/**
* Default constructor for a new node. So all members are an valid
* initial value: zero.
*/
Node();
/**
* The TreeIndex of the parent it belongs to.
*/
unsigned int parentTreeIdx;
/**
* All leafs grouped by this node have an bigger or equal TreeIndex
* then this \e minTreeIdx. In other words: The leftmost leaf of the
* subtree with this node as root has this TreeIndex.
*/
unsigned int minTreeIdx;
/**
* All leafs grouped by this node have an lower or equal TreeIndex then
* this \e maxTreeIdx. In other words: The rightmost leaf of the
* subtree with this node as root has this TreeIndex.
*/
unsigned int maxTreeIdx;
/**
* This is used to have a reference to the data element this node
* represents. For inner nodes clearly none exists, but for leafs this
* is the number inside of the dataset.
*/
unsigned int dataIdx;
/**
* The height of each node. Leafs have an default height of zero.
*/
double height;
};
private:
/**
* Save the whole dendrogram and keep track of the link from leafs to the
* dataset, as well as information of parents and leafs for each node.
*/
std::vector< Node > m_tree;
};
#endif // WDENDROGRAM_H
......@@ -35,10 +35,6 @@ template < typename T >
class WFlag
{
public:
/**
* The type for later access.
*/
typedef T ValueType;
/**
* Constructor. Uses a given condition to realize the wait/notify functionality. By using this constructor, the specified
......