Commit 1cf3269d authored by Mathias Goldau's avatar Mathias Goldau

[MERGE]

parents a6831840 edd88492
......@@ -11,6 +11,7 @@ schurade@spinat.cbs.mpg.de Ralph_Schurade
schurade Ralph_Schurade
ebaum Sebastian_Eichelbaum
eichelbaum@informatik.uni-leipzig.de Sebastian_Eichelbaum
Sebastian Eichelbaum = Sebastian_Eichelbaum
cornimueller Cornelius_Mueller
mam04cvr@studserv.uni-leipzig.de Cornelius_Mueller
hlawitschka@ucdavis.edu Mario_Hlawitschka
......@@ -20,6 +21,8 @@ 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
reichenbach@informatik.uni-leipzig.de Andre_Reichenbach
Andre Andre_Reichenbach
philips@informatik.uni-leipzig.de Stefan_Philips
frohl.robert@googlemail.com Robert_Frohl
dirk_albrecht@gmx.net Dirk_Albrecht
......@@ -27,4 +30,6 @@ albrecht Dirk_Albrecht
mstuber Marcus_Stuber
skiunke Sebastian_Kiunke
a_berres@informatik.uni-kl.de Anne_Berres
gsommer_by@gmx.de Gerald_Sommer
\ No newline at end of file
gsommer_by@gmx.de Gerald_Sommer
= Unknown___________________
root@openwalnut.com = Unknown___________________
\ No newline at end of file
......@@ -1417,7 +1417,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 = YES
HAVE_DOT = NO
# 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
......
......@@ -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 = YES
HAVE_DOT = NO
# 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
......
<h1>Welcome to OpenWalnut %OW_LIB_VERSION%!</h1>
<a href="http://www.openwalnut.org/projects/openwalnut/wiki/ReleaseNotes">Release Notes</a>
<br>
<br>
Hello User! New to OpenWalnut? Have a look at <a href="http://www.openwalnut.org">http://www.openwalnut.org</a>!
We provide
<ul>
<li> user-/video documentation,
<li> programming tutorials
<li> and the latest information on OpenWalnut.
</ul>
Do you have problems using OpenWalnut? Do not hesitate to ask:
<ul>
<li><a href="mailto:openwalnut@lists.informatik.uni-leipzig.de">Mailing list</a>
<li>IRC Chat on irc.freenode.net in #ow
</ul>
Found a bug? Do you have ideas for improvements? Please <a href="http://www.openwalnut.org/projects/openwalnut/wiki/Contribute">report</a> these issues! We can improve OpenWalnut only with your help and ideas.
<br><br>
<i>Thank you for using OpenWalnut!</i>
......@@ -5,5 +5,5 @@
## and project files.
## recommendation list:
recommended = 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,Fiber Display,Read Spherical Harmonics,Navigation Slices,Deterministic Tract Clustering using Gaussian Processes,Deterministic Tract to Gaussian Process Converter,Cluster Param Display,Write Tracts,Fiber Resampling,Grid Renderer
recommended = 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,Fiber Display,Read Spherical Harmonics,Navigation Slices,Deterministic Tract Clustering using Gaussian Processes,Deterministic Tract to Gaussian Process Converter,Cluster Param Display,Write Tracts,Fiber Resampling,Grid Renderer,Spatial Derivation,Scalar Operator,Vector Operator,Colormapper
......@@ -64,7 +64,7 @@ WColor OWCOMMON_EXPORT inverseColor( const WColor& other );
*/
namespace defaultColor
{
// \cond Supress_Doxygen
// \cond Suppress_Doxygen
static const WColor GREEN( 0.0, 1.0, 0.0, 1.0 ); //!< Default for green
static const WColor RED( 1.0, 0.0, 0.0, 1.0 ); //!< Default for red
static const WColor BLUE( 0.0, 0.0, 1.0, 1.0 ); //!< Default for blue
......
......@@ -191,7 +191,7 @@ namespace wlog
template< typename T > WStreamedLogger operator<<( const T& loggable );
// Doxygen should ignore the TypeDef below which are just an alias for std::endl etc.
// \cond Supress_Doxygen
// \cond Suppress_Doxygen
typedef std::basic_ostream< char, std::char_traits< char > > OutStreamType;
typedef OutStreamType& ( *StreamManipulatorFunctor )( OutStreamType& );
// \endcond
......
......@@ -406,6 +406,17 @@ public:
*/
virtual bool set( T value, bool suppressNotification = false );
/**
* Sets the specified value as recommended value. The difference to \ref set is simple. If some value was set using the method \ref set
* earlier, the \ref setRecommendedValue call is ignored. This is very useful in modules, where incoming data yields some useful default values
* but you do not want to overwrite a user-value which might have been set.
*
* \param value the new value to set if the user did not yet set the value
*
* \return true if value has been set successfully.
*/
virtual bool setRecommendedValue( T value );
protected:
/**
......@@ -439,13 +450,19 @@ protected:
boost::shared_ptr< ConstraintContainerType > m_constraints;
private:
/**
* This is true, if the user did not set a value until now using \ref set.
*/
bool m_notYetSet;
};
template < typename T >
WPropertyVariable< T >::WPropertyVariable( std::string name, std::string description, const T& initial ):
WFlag< T >( new WCondition(), initial ),
WPropertyBase( name, description ),
m_constraints( new ConstraintContainerType() )
m_constraints( new ConstraintContainerType() ),
m_notYetSet( true )
{
updateType();
......@@ -458,7 +475,8 @@ template < typename T >
WPropertyVariable< T >::WPropertyVariable( std::string name, std::string description, const T& initial, boost::shared_ptr< WCondition > condition ):
WFlag< T >( condition, initial ),
WPropertyBase( name, description ),
m_constraints( new ConstraintContainerType() )
m_constraints( new ConstraintContainerType() ),
m_notYetSet( true )
{
updateType();
......@@ -472,7 +490,8 @@ WPropertyVariable< T >::WPropertyVariable( std::string name, std::string descrip
PropertyChangeNotifierType notifier ):
WFlag< T >( new WCondition(), initial ),
WPropertyBase( name, description ),
m_constraints( new ConstraintContainerType() )
m_constraints( new ConstraintContainerType() ),
m_notYetSet( true )
{
updateType();
......@@ -492,7 +511,8 @@ WPropertyVariable< T >::WPropertyVariable( std::string name, std::string descrip
PropertyChangeNotifierType notifier ):
WFlag< T >( condition, initial ),
WPropertyBase( name, description ),
m_constraints( new ConstraintContainerType() )
m_constraints( new ConstraintContainerType() ),
m_notYetSet( true )
{
updateType();
......@@ -511,7 +531,8 @@ template < typename T >
WPropertyVariable< T >::WPropertyVariable( const WPropertyVariable< T >& from ):
WFlag< T >( from ),
WPropertyBase( from ),
m_constraints( new ConstraintContainerType() )
m_constraints( new ConstraintContainerType() ),
m_notYetSet( from.m_notYetSet )
{
// copy the constraints
......@@ -584,7 +605,7 @@ bool WPropertyVariable< T >::setAsString( std::string value )
{
// use the helper class which can handle different kinds of properties for us
PROPERTY_TYPE_HELPER::WStringConversion< T > h = PROPERTY_TYPE_HELPER::WStringConversion< T >();
return WFlag< T >::set( h.create( WFlag< T >::get(), value ) );
return set( h.create( WFlag< T >::get(), value ) );
}
catch( const boost::bad_lexical_cast &e )
{
......@@ -610,7 +631,7 @@ bool WPropertyVariable< T >::set( boost::shared_ptr< WPropertyBase > value )
boost::shared_ptr< WPropertyVariable< T > > v = boost::shared_dynamic_cast< WPropertyVariable< T > >( value );
if( v )
{
return WFlag< T >::set( v->get() );
return set( v->get() );
}
else
{
......@@ -621,9 +642,26 @@ bool WPropertyVariable< T >::set( boost::shared_ptr< WPropertyBase > value )
template < typename T >
bool WPropertyVariable< T >::set( T value, bool suppressNotification )
{
m_notYetSet = false;
return WFlag< T >::set( value, suppressNotification );
}
template < typename T >
bool WPropertyVariable< T >::setRecommendedValue( T value )
{
// NOTE: well this is quite problematic when used multi-threaded ...
if( m_notYetSet )
{
bool ret = set( value );
m_notYetSet = true;
return ret;
}
else
{
return false;
}
}
template < typename T >
bool WPropertyVariable< T >::ensureValidity( T newValidValue, bool suppressNotification )
{
......
......@@ -146,7 +146,7 @@ public:
m_second = normalize( m_second );
}
// \cond Supress_Doxygen
// \cond Suppress_Doxygen
// /**
// * Computes sample points on that plane.
// *
......
......@@ -41,7 +41,7 @@ template< typename T > class WValue
template< typename S > friend class WValue; //!< All WValues are friends of each other.
// We exclude this from doxygen since they are documented already as functions and I don't want to duplicate that documentation
// \cond Supress_Doxygen
// \cond Suppress_Doxygen
template< typename U > friend std::ostream& operator<<( std::ostream& os, const WValue< U > &rhs );
template< typename U > friend std::istream& operator>>( std::istream& in, WValue< U >& rhs );
// \endcond
......
......@@ -33,7 +33,7 @@
#include "../WMixinVector.h"
#include "WMixinVectorTraits.h"
// \cond Supress_Doxygen
// \cond Suppress_Doxygen
// This is just a dummy class to test if the default constructor is called when
// not specified by WMixinVector instanziation.
class A {public: A(){m_x = 3.1415;} bool operator==(double x){return m_x == x;} double m_x; }; // NOLINT
......
......@@ -66,6 +66,16 @@ struct DataType
{
};
/**
* Convert a runtime type to a C++ type
*
* \tparam rtType the runtime type
*/
template< int rtType >
struct DataTypeRT
{
};
/**
* Specialization for a specific datatype.
*/
......@@ -76,6 +86,16 @@ struct DataType< int8_t >
static dataType const type = W_DT_INT8;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_INT8 >
{
//! correct C++ type for this runtime type
typedef int8_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -86,6 +106,16 @@ struct DataType< uint8_t >
static dataType const type = W_DT_UINT8;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_UINT8 >
{
//! correct C++ type for this runtime type
typedef uint8_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -96,6 +126,16 @@ struct DataType< int16_t >
static dataType const type = W_DT_INT16;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_INT16 >
{
//! correct C++ type for this runtime type
typedef int16_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -106,6 +146,16 @@ struct DataType< uint16_t >
static dataType const type = W_DT_UINT16;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_UINT16 >
{
//! correct C++ type for this runtime type
typedef uint16_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -116,6 +166,16 @@ struct DataType< int32_t >
static dataType const type = W_DT_SIGNED_INT;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_SIGNED_INT >
{
//! correct C++ type for this runtime type
typedef int32_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -126,6 +186,16 @@ struct DataType< uint32_t >
static dataType const type = W_DT_UINT32;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_UINT32 >
{
//! correct C++ type for this runtime type
typedef uint32_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -136,6 +206,16 @@ struct DataType< int64_t >
static dataType const type = W_DT_INT64;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_INT64 >
{
//! correct C++ type for this runtime type
typedef int64_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -146,6 +226,16 @@ struct DataType< uint64_t >
static dataType const type = W_DT_UINT64;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_UINT64 >
{
//! correct C++ type for this runtime type
typedef uint64_t type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -156,6 +246,16 @@ struct DataType< float >
static dataType const type = W_DT_FLOAT;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_FLOAT >
{
//! correct C++ type for this runtime type
typedef float type;
};
/**
* Specialization for a specific datatype.
*/
......@@ -166,6 +266,16 @@ struct DataType< double >
static dataType const type = W_DT_DOUBLE;
};
/**
* Specialization for a specific type
*/
template<>
struct DataTypeRT< W_DT_DOUBLE >
{
//! correct C++ type for this runtime type
typedef double type;
};
enum qformOrientation
{
Left_to_Right,
......
......@@ -335,141 +335,6 @@ WPosition WDataSetFibers::getTangent( size_t fiber, size_t vertex ) const
return normalize( tangent );
}
/**
* Special helper functions for the saveSelected member function.
*/
namespace
{
/**
* converts an integer into a byte array and back
*/
union converterByteINT32
{
unsigned char b[4]; //!< the bytes
int i; //!< the int
};
/**
* converts a float into a byte array and back
*/
union converterByteFloat
{
unsigned char b[4]; //!< the bytes
float f; //!< the float
};
}
void WDataSetFibers::saveSelected( std::string filename, boost::shared_ptr< std::vector< bool > > active ) const
{
std::vector< float > pointsToSave;
std::vector< int > linesToSave;
std::vector< unsigned char > colorsToSave;
int pointIndex = 0;
int countLines = 0;
for( size_t l = 0; l < m_lineLengths->size(); ++l )
{
if( ( *active )[l] )
{
unsigned int pc = ( *m_lineStartIndexes )[l] * 3;
linesToSave.push_back( ( *m_lineLengths )[l] );
boost::shared_ptr< std::vector< float > > localColors =
boost::shared_static_cast< const ColorScheme >( ( *m_colors )[1] )->getColor();
for( size_t j = 0; j < ( *m_lineLengths )[l]; ++j )
{
// TODO(schurade): replace this with a permanent solution
pointsToSave.push_back( 160 - ( *m_vertices )[pc] );
colorsToSave.push_back( static_cast<unsigned char> ( ( *localColors )[pc] * 255 ) );
++pc;
pointsToSave.push_back( 200 - ( *m_vertices )[pc] );
colorsToSave.push_back( static_cast<unsigned char> ( ( *localColors )[pc] * 255 ) );
++pc;
pointsToSave.push_back( ( *m_vertices )[pc] );
colorsToSave.push_back( static_cast<unsigned char> ( ( *localColors )[pc] * 255 ) );
++pc;
linesToSave.push_back( pointIndex );
++pointIndex;
}
++countLines;
}
}
converterByteINT32 c;
converterByteFloat f;
std::vector< char > vBuffer;
std::string header1 = "# vtk DataFile Version 3.0\nvtk output\nBINARY\nDATASET POLYDATA\nPOINTS ";
header1 += boost::lexical_cast<std::string>( pointsToSave.size() / 3 );
header1 += " float\n";
for( unsigned int i = 0; i < header1.size(); ++i )
{
vBuffer.push_back( header1[i] );
}
for( unsigned int i = 0; i < pointsToSave.size(); ++i )
{
f.f = pointsToSave[i];
vBuffer.push_back( f.b[3] );
vBuffer.push_back( f.b[2] );
vBuffer.push_back( f.b[1] );
vBuffer.push_back( f.b[0] );
}
vBuffer.push_back( '\n' );
std::string header2 = "LINES " + boost::lexical_cast<std::string>( countLines ) + " " +
boost::lexical_cast<std::string>( linesToSave.size() ) + "\n";
for( unsigned int i = 0; i < header2.size(); ++i )
{
vBuffer.push_back( header2[i] );
}
for( unsigned int i = 0; i < linesToSave.size(); ++i )
{
c.i = linesToSave[i];
vBuffer.push_back( c.b[3] );
vBuffer.push_back( c.b[2] );
vBuffer.push_back( c.b[1] );
vBuffer.push_back( c.b[0] );
}
vBuffer.push_back( '\n' );
std::string header3 = "POINT_DATA ";
header3 += boost::lexical_cast<std::string>( pointsToSave.size() / 3 );
header3 += " float\n";
header3 += "COLOR_SCALARS scalars 3\n";
for( unsigned int i = 0; i < header3.size(); ++i )
{
vBuffer.push_back( header3[i] );
}
for( unsigned int i = 0; i < colorsToSave.size(); ++i )
{
vBuffer.push_back( colorsToSave[i] );
}
vBuffer.push_back( '\n' );
boost::filesystem::path p( filename );
boost::filesystem::ofstream ofs( p, std::ios_base::binary );
for( unsigned int i = 0; i < vBuffer.size(); ++i )
{
ofs << vBuffer[i];
}
}
WBoundingBox WDataSetFibers::getBoundingBox() const
{
return m_bb;
......
......@@ -347,14 +347,6 @@ public:
*/
WPosition getTangent( size_t fiber, size_t vertex ) const;
/**
* saves the selected fiber bundles to a file
*
*\param filename
* \param active bitfield of the fiber selection
*/
void saveSelected( std::string filename, boost::shared_ptr< std::vector< bool > > active ) const;
/**
* Get the bounding box.
* \return The bounding box of all lines.
......
......@@ -117,8 +117,9 @@ const std::string WDataSetSingle::getName() const
const std::string WDataSetSingle::getDescription() const
{
// TODO(all): write this
return "Please write me.";
return "A single dataset containing a number of WValues on a structured"
"grid. Single, in this case, means not time-dependent and not one type of"
"data for several subjects.";
}