Commit 5a758fbd authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 74ea9edc e795818b
......@@ -8,6 +8,9 @@
# default=HUD
#whiteList =Isosurface,Bounding Box, Direct Volume Rendering,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI # A list of modules that will be provided through the GUI. If the list is empty all available modules are provided.
## A list of modules that will be prevented from being present in the GUI.
blackList = Data Module
## 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
## 2. if the directory does not contain any libOWmodule_XYZ, the subdirectories get searched.
......
......@@ -11,6 +11,9 @@
## 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,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,Teem Glyphs
## A list of modules that will be prevented from being present in the GUI.
blackList = Data Module
## 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
## 2. if the directory does not contain any libOWmodule_XYZ, the subdirectories get searched.
......
......@@ -7,6 +7,9 @@ IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
ENDIF()
IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
ADD_DEFINITIONS( -DEIGEN_DONT_VECTORIZE -DEIGEN_DONT_ALIGN -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT )
ENDIF()
# append search path for FindModules:
#------------------------------------
......@@ -272,6 +275,7 @@ ADD_EXECUTABLE( walnut OpenWalnut.cpp version.h )
TARGET_LINK_LIBRARIES( walnut ${OWKernelName} ${OWDatahandlerName} ${OWguiName} ${OWguiqt4Name} ${OWCommonName} ${OWgeName} ${Boost_LIBRARIES} )
IF(MSVC_IDE)
ADD_DEFINITIONS( -DEIGEN_DONT_VECTORIZE -DEIGEN_DONT_ALIGN -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT )
SET_TARGET_PROPERTIES( walnut PROPERTIES DEBUG_POSTFIX "d")
SET_TARGET_PROPERTIES( walnut PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
......
FILE( GLOB COMMON_SRC "*.cpp" "*.h" )
FILE( GLOB COMMON_DATASTRUCTURES_SRC "datastructures/*.cpp" "datastructures/*.h" )
FILE( GLOB COMMON_EXCEPTIONS_SRC "exceptions/*.cpp" "exceptions/*.h" )
FILE( GLOB MATH_SRC "math/*.cpp" "math/*.h" )
FILE( GLOB_RECURSE MATH_SRC "math/*.cpp" "math/*.h" )
ADD_SUBDIRECTORY( datastructures )
ADD_SUBDIRECTORY( constraints )
......
......@@ -30,7 +30,7 @@
#include <osg/BoundingBox>
#include "exceptions/WInvalidBoundingBox.h"
#include "math/WVector3D.h"
#include "math/linearAlgebra/WLinearAlgebra.h"
/**
* Represents a \e axis \e parallel bounding box and provides some useful operations with them.
......@@ -296,6 +296,6 @@ inline const typename WBoundingBoxImpl< VT >::vec_type& WBoundingBoxImpl< VT >::
return osg::BoundingBoxImpl< VT >::_max;
}
typedef WBoundingBoxImpl< WVector3D > WBoundingBox;
typedef WBoundingBoxImpl< osg::Vec3 > WBoundingBox;
#endif // WBOUNDINGBOX_H
......@@ -26,6 +26,10 @@
#include <streambuf>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "exceptions/WFileNotFound.h"
......
......@@ -31,6 +31,10 @@
// #include <cstdio>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "WExportCommon.h"
......
......@@ -27,6 +27,10 @@
#include <vector>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
......
......@@ -28,6 +28,10 @@
#include <string>
#include <fstream>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
......
......@@ -25,6 +25,10 @@
#include <list>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "exceptions/WPropertyNameMalformed.h"
......
......@@ -29,20 +29,22 @@
#include <string>
#include <vector>
#include <boost/lexical_cast.hpp>
#include <string>
#include <list>
#include <utility>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include "math/WPosition.h"
#include "math/WMatrix.h"
#include "math/linearAlgebra/WLinearAlgebra.h"
#include "math/linearAlgebra/WMatrixFixed.h"
#include "math/linearAlgebra/WVectorFixed.h"
#include "WItemSelector.h"
#include "WColor.h"
#include "WAssert.h"
template < typename T >
class WPropertyVariable;
......@@ -103,9 +105,9 @@ namespace WPVBaseTypes
typedef std::string PV_STRING; //!< base type used for every WPVString
typedef boost::filesystem::path PV_PATH; //!< base type used for every WPVFilename
typedef WItemSelector PV_SELECTION; //!< base type used for every WPVSelection
typedef WPosition PV_POSITION; //!< base type used for every WPVPosition
typedef WPosition PV_POSITION; //!< base type used for every WPVPosition
typedef WColor PV_COLOR; //!< base type used for every WPVColor
typedef WMatrix4x4_2 PV_MATRIX4X4; //!< base type used for every WPVMatrix4X4
typedef WMatrix4d PV_MATRIX4X4; //!< base type used for every WPVMatrix4X4
/**
* Enum denoting the possible trigger states. It is used for trigger properties.
......@@ -548,7 +550,7 @@ namespace PROPERTY_TYPE_HELPER
*/
WPVBaseTypes::PV_MATRIX4X4 create( const WPVBaseTypes::PV_MATRIX4X4& /*old*/, const std::string str )
{
WMatrix4x4_2 c;
WMatrix4d c;
std::vector< std::string > tokens;
tokens = string_utils::tokenize( str, ";" );
WAssert( tokens.size() >= 16, "There weren't 16 values for a 4x4 Matrix" );
......
......@@ -33,6 +33,10 @@
#include <vector>
#include <set>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
#include <boost/lexical_cast.hpp>
......
......@@ -28,6 +28,10 @@
#include <algorithm>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "WExportCommon.h"
......
......@@ -49,7 +49,7 @@ namespace
// m[i] = new double[rsize];
for( size_t j = 0; j < rsize; ++j )
{
m[i][j] = q[i].distanceSquare( r[j] );
m[i][j] = length2( q[i] - r[j] );
}
}
// compute dt(q,r)
......
......@@ -28,7 +28,7 @@
#include <vector>
#include "../math/WLine.h"
#include "../math/WPosition.h"
#include "../math/linearAlgebra/WLinearAlgebra.h"
#include "../WExportCommon.h"
class WFiberTest;
......
......@@ -30,7 +30,7 @@
#include <cxxtest/TestSuite.h>
#include "../../math/WPosition.h"
#include "../../math/linearAlgebra/WLinearAlgebra.h"
#include "../WFiber.h"
#include "WFiberTraits.h"
......
FILE( GLOB MATH_SRC "*.cpp" "*.h" )
ADD_SUBDIRECTORY( linearAlgebra )
#remove OSSIM Helper files from list, if it isn't found
IF ( NOT OSSIM_FOUND )
LIST( REMOVE_ITEM MATH_SRC ${CMAKE_CURRENT_SOURCE_DIR}/WOSSIMHelper.h )
......
......@@ -27,7 +27,7 @@
#include "WGeometryFunctions.h"
void tesselateIcosahedron( std::vector< WVector3D >* vertices, std::vector< unsigned int >* triangles, unsigned int level )
void tesselateIcosahedron( std::vector< WVector3d >* vertices, std::vector< unsigned int >* triangles, unsigned int level )
{
WAssert( vertices, "Missing input vector." );
WAssert( triangles, "Missing input vector." );
......@@ -47,26 +47,26 @@ void tesselateIcosahedron( std::vector< WVector3D >* vertices, std::vector< unsi
// add icosahedron vertices
double phi = 0.5 * ( 1.0 + sqrt( 5.0 ) );
std::vector< WVector3D > g;
std::vector< WVector3d > g;
vertices->push_back( WVector3D( phi, 1, 0 ) ); // 0
vertices->push_back( WVector3D( -phi, 1, 0 ) ); // 1
vertices->push_back( WVector3D( phi, -1, 0 ) ); // 2
vertices->push_back( WVector3D( -phi, -1, 0 ) ); // 3
vertices->push_back( WVector3d( phi, 1, 0 ) ); // 0
vertices->push_back( WVector3d( -phi, 1, 0 ) ); // 1
vertices->push_back( WVector3d( phi, -1, 0 ) ); // 2
vertices->push_back( WVector3d( -phi, -1, 0 ) ); // 3
vertices->push_back( WVector3D( 1, 0, phi ) ); // 4
vertices->push_back( WVector3D( -1, 0, phi ) ); // 5
vertices->push_back( WVector3D( 1, 0, -phi ) ); // 6
vertices->push_back( WVector3D( -1, 0, -phi ) ); // 7
vertices->push_back( WVector3d( 1, 0, phi ) ); // 4
vertices->push_back( WVector3d( -1, 0, phi ) ); // 5
vertices->push_back( WVector3d( 1, 0, -phi ) ); // 6
vertices->push_back( WVector3d( -1, 0, -phi ) ); // 7
vertices->push_back( WVector3D( 0, phi, 1 ) ); // 8
vertices->push_back( WVector3D( 0, -phi, 1 ) ); // 9
vertices->push_back( WVector3D( 0, phi, -1 ) ); // 10
vertices->push_back( WVector3D( 0, -phi, -1 ) ); // 11
vertices->push_back( WVector3d( 0, phi, 1 ) ); // 8
vertices->push_back( WVector3d( 0, -phi, 1 ) ); // 9
vertices->push_back( WVector3d( 0, phi, -1 ) ); // 10
vertices->push_back( WVector3d( 0, -phi, -1 ) ); // 11
for( std::vector< WVector3D >::iterator it = vertices->begin(); it != vertices->end(); ++it )
for( std::vector< WVector3d >::iterator it = vertices->begin(); it != vertices->end(); ++it )
{
*it = it->normalized();
*it = normalize( *it );
}
// add triangle indices
......@@ -111,10 +111,10 @@ void tesselateIcosahedron( std::vector< WVector3D >* vertices, std::vector< unsi
utility::Edge e( ( *triangles )[ 3 * k + i ], ( *triangles )[ 3 * k + ( i + 1 ) % 3 ] );
if( edgeVertices.find( e ) == edgeVertices.end() )
{
WVector3D v0 = vertices->at( e.first );
WVector3D v1 = vertices->at( e.second );
WVector3D v = v0 + v1;
v = v.normalized();
WVector3d v0 = vertices->at( e.first );
WVector3d v1 = vertices->at( e.second );
WVector3d v = v0 + v1;
v = normalize( v );
vertices->push_back( v );
edgeVertices[ e ] = vertices->size() - 1;
}
......
......@@ -30,7 +30,7 @@
#include <vector>
#include "../WAssert.h"
#include "WVector3D.h"
#include "linearAlgebra/WLinearAlgebra.h"
namespace utility
{
......@@ -87,6 +87,6 @@ namespace utility
* \param[out] triangles The resulting triangles as a list of indices into the vertex vector.
* \param level The tesselation level.
*/
void OWCOMMON_EXPORT tesselateIcosahedron( std::vector< WVector3D >* vertices, std::vector< unsigned int >* triangles, unsigned int level );
void OWCOMMON_EXPORT tesselateIcosahedron( std::vector< WVector3d >* vertices, std::vector< unsigned int >* triangles, unsigned int level );
#endif // WGEOMETRYFUNCTIONS_H
......@@ -35,7 +35,7 @@
#include "../WStringUtils.h"
#include "WLine.h"
#include "WPolynomialEquationSolvers.h"
#include "WPosition.h"
#include "linearAlgebra/WLinearAlgebra.h"
WLine::WLine( const std::vector< WPosition > &points )
: WMixinVector< WPosition >( points )
......@@ -63,13 +63,13 @@ void WLine::reverseOrder()
double pathLength( const WLine& line )
{
double length = 0;
double len = 0;
// incase of size() <= 1 the for loop will not run!
for( size_t i = 1; i < line.size(); ++i )
{
length += ( line[i - 1] - line[i] ).norm();
len += length( line[i - 1] - line[i] );
}
return length;
return len;
}
void WLine::resampleByNumberOfPoints( size_t numPoints )
......@@ -85,14 +85,14 @@ void WLine::resampleByNumberOfPoints( size_t numPoints )
newLine.push_back( front() );
for( size_t i = 0; i < ( size() - 1 ); ++i )
{
remainingLength += ( at( i ) - at( i + 1 ) ).norm();
remainingLength += length( at( i ) - at( i + 1 ) );
while( ( remainingLength > newSegmentLength ) || std::abs( remainingLength - newSegmentLength ) < delta )
{
remainingLength -= newSegmentLength;
// TODO(math): fix numerical issuses: newSegmentLength may be wrong => great offset by many intraSegment sample points
// remainingLength may be wrong => ...
// Take a look at the unit test testNumericalStabilityOfResampling
WPosition newPoint = at( i + 1 ) + remainingLength * ( at( i ) - at( i + 1 ) ).normalized();
WPosition newPoint = at( i + 1 ) + remainingLength * normalize( at( i ) - at( i + 1 ) );
newLine.push_back( newPoint );
// std::cout << "line size so far" << newLine.size() << " lenght so far: " << newLine.pathLength() << std::endl;
// std::cout << numPoints - newLine.size() << std::endl;
......@@ -132,7 +132,7 @@ void WLine::removeAdjacentDuplicates()
newLine.push_back( front() );
for( const_iterator cit = begin()++; cit != end(); ++cit )
{
if( ( *cit - newLine.back() ).norm() > wlimits::DBL_EPS )
if( length( *cit - newLine.back() ) > wlimits::DBL_EPS )
{
newLine.push_back( *cit );
}
......@@ -153,14 +153,14 @@ void WLine::resampleBySegmentLength( double newSegmentLength )
newLine.push_back( front() );
for( size_t i = 1; i < size(); )
{
if( ( newLine.back() - ( *this )[i] ).norm() > newSegmentLength )
if( length( newLine.back() - ( *this )[i] ) > newSegmentLength )
{
const WVector3D& pred = ( *this )[i - 1];
const WPosition& pred = ( *this )[i - 1];
if( pred == newLine.back() )
{
// Then there is no triangle and the old Segment Length is bigger as the new segment
// length
newLine.push_back( newLine.back() + ( ( *this )[i] - pred ).normalized() * newSegmentLength );
newLine.push_back( newLine.back() + normalize( ( *this )[i] - pred ) * newSegmentLength );
continue;
}
else // this is the general case, and the point we search is inbetween the pred and the current position
......@@ -199,9 +199,9 @@ void WLine::resampleBySegmentLength( double newSegmentLength )
}
++i;
}
if( ( newLine.back() - ( *this )[size() - 1] ).norm() > newSegmentLength / 2.0 )
if( length( newLine.back() - ( *this )[size() - 1] ) > newSegmentLength / 2.0 )
{
WVector3D direction = ( ( *this )[size() - 1] - newLine.back() ).normalized();
WVector3d direction = normalize( ( *this )[size() - 1] - newLine.back() );
newLine.push_back( newLine.back() + direction * newSegmentLength );
}
this->WMixinVector< WPosition >::operator=( newLine );
......@@ -239,7 +239,7 @@ double maxSegmentLength( const WLine& line )
}
for( size_t i = 0; i < line.size() - 1; ++i )
{
result = std::max( result, ( line[i] - line[i+1] ).norm() );
result = std::max( result, static_cast< double >( length( line[i] - line[i+1] ) ) );
}
return result;
}
......
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