Commit fe3a93c8 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 2f970956 7871500a
......@@ -27,9 +27,6 @@
#include <string>
#include "WException.h"
/**
* Implements assertion logic.
*
......
......@@ -28,7 +28,6 @@
#include <exception>
#include <list>
#include <string>
#include <sstream>
#include "WTerminalColor.h"
......
......@@ -26,8 +26,7 @@
#define WTERMINALCOLOR_H
#include <string>
#include <iosfwd>
/**
* Helper class to provide a convenient way to colorize output on the console.
......
......@@ -33,11 +33,10 @@ class WException;
/**
* Enum of all possible signals WThreadedRunner instances can emit.
*/
typedef enum
enum THREAD_SIGNAL
{
WTHREAD_ERROR // error during execution
}
THREAD_SIGNAL;
};
// **************************************************************************************************************************
// Types
......
......@@ -27,6 +27,7 @@
#include <algorithm>
#include <cassert>
#include <sstream>
#include <vector>
#include "../exceptions/WOutOfBounds.h"
......
......@@ -24,11 +24,13 @@
#include <stdint.h>
#include <cmath>
#include <vector>
#include <boost/math/special_functions/spherical_harmonic.hpp>
#include "core/common/WLogger.h"
#include "core/common/math/WGeometryFunctions.h"
#include "../exceptions/WPreconditionNotMet.h"
#include "linearAlgebra/WLinearAlgebra.h"
#include "WLinearAlgebraFunctions.h"
......@@ -464,8 +466,27 @@ WMatrix<double> WSymmetricSphericalHarmonic::calcFRTMatrix( size_t order )
return result;
}
WMatrix< double > WSymmetricSphericalHarmonic::calcSHToTensorSymMatrix( std::size_t order )
{
std::vector< WVector3d > vertices;
std::vector< unsigned int > triangles;
// calc necessary tesselation level
int level = static_cast< int >( log( static_cast< float >( ( order + 1 ) * ( order + 2 ) ) ) / 2.0f + 1.0f );
tesselateIcosahedron( &vertices, &triangles, level );
std::vector< WUnitSphereCoordinates > orientations;
for( std::vector< WVector3d >::const_iterator cit = vertices.begin(); cit != vertices.end(); cit++ )
{
// avoid linear dependent orientations
if( ( *cit )[ 0 ] >= 0.0001 )
{
orientations.push_back( WUnitSphereCoordinates( *cit ) );
}
}
return WSymmetricSphericalHarmonic::calcSHToTensorSymMatrix( order, orientations );
}
WMatrix< double > WSymmetricSphericalHarmonic::calcSHToTensorSymMatrix( std::size_t order,
const std::vector< WUnitSphereCoordinates >& orientations )
const std::vector< WUnitSphereCoordinates >& orientations )
{
std::size_t numElements = ( order + 1 ) * ( order + 2 ) / 2;
WPrecondEquals( order % 2, 0u );
......
......@@ -232,6 +232,15 @@ public:
*/
static WMatrix<double> calcFRTMatrix( size_t order );
/**
* Calculates a matrix that converts spherical harmonics to symmetric tensors of equal or lower order.
*
* \param order The order of the symmetric tensor.
*
* \return the conversion matrix
*/
static WMatrix< double > calcSHToTensorSymMatrix( std::size_t order );
/**
* Calculates a matrix that converts spherical harmonics to symmetric tensors of equal or lower order.
*
......
......@@ -23,6 +23,7 @@
//---------------------------------------------------------------------------
#include <vector>
#include <cmath>
#include "WCreateColorArraysThread.h"
......@@ -87,7 +88,7 @@ void WCreateColorArraysThread::threadMain()
if( b < 0.0 )
b *= -1.0;
float norm = sqrt( r * r + g * g + b * b );
float norm = std::sqrt( r * r + g * g + b * b );
r *= 1.0 / norm;
g *= 1.0 / norm;
b *= 1.0 / norm;
......@@ -105,7 +106,7 @@ void WCreateColorArraysThread::threadMain()
lasty = (*m_vertices)[pc + 1];
lastz = (*m_vertices)[pc + 2];
float norm = sqrt( rr * rr + gg * gg + bb * bb );
float norm = std::sqrt( rr * rr + gg * gg + bb * bb );
rr *= 1.0 / norm;
gg *= 1.0 / norm;
bb *= 1.0 / norm;
......
......@@ -34,14 +34,13 @@ class WException;
/**
* Enum of all possible signals WModule instances can emit.
*/
typedef enum
enum MODULE_SIGNAL
{
WM_ASSOCIATED, // module got associated to a container
WM_READY, // module ready
WM_ERROR, // error during execution
WM_REMOVED // removed from the container
}
MODULE_SIGNAL;
};
// **************************************************************************************************************************
// Types
......
......@@ -27,9 +27,18 @@
#include <QtGui/QToolBar>
#ifndef Q_MOC_RUN
// There is an issue with the moc compiler and some boost headers where
// moc for qt versions < 5.0 is not able to do a macro substitution.
// The issue occurs in the boost library versions 1.48 and higher,
// and is tested in boost version 1.52 using moc version 4.8.4
// Excluding the relevant headers removes the problem.
#include "core/kernel/WModuleCombinerTypes.h"
#endif
#ifndef Q_MOC_RUN
#include "WQtCombinerActionList.h"
#endif
#include "WQtToolBarBase.h"
class WMainWindow;
......
......@@ -30,7 +30,14 @@
#include <QtGui/QAction>
#include <QtGui/QMessageBox>
#ifndef Q_MOC_RUN
// There is an issue with the moc compiler and some boost headers where
// moc for qt versions < 5.0 is not able to do a macro substitution.
// The issue occurs in the boost library versions 1.48 and higher,
// and is tested in boost version 1.52 using moc version 4.8.4
// Excluding the relevant headers removes the problem.
#include "WQt4Gui.h"
#endif
class WMainWindow;
......
......@@ -44,9 +44,16 @@
#include "WPropertyTransferFunctionWidget.h"
#include "WPropertyStructWidget.h"
#ifndef Q_MOC_RUN
// There is an issue with the moc compiler and some boost headers where
// moc for qt versions < 5.0 is not able to do a macro substitution.
// The issue occurs in the boost library versions 1.48 and higher,
// and is tested in boost version 1.52 using moc version 4.8.4
// Excluding the relevant headers removes the problem.
#include "core/common/WPropertyVariable.h"
#include "core/common/WPropertyStruct.h"
#include "core/common/WPropertyGroupBase.h"
#endif
/**
* Container widget to contain a number of properties for the module context in the control panel.
......
......@@ -247,7 +247,7 @@ _CPP_HEADERS = frozenset([
# Other heders which are include like system headers, starting with a '<'
_OTHER_HEADERS = frozenset([
'QtGui', 'QtCore', 'QtWebKit', 'QtOpenGL', 'GL', 'cxxtest', 'boost', 'osg','osgText', 'osgViewer', 'osgDB', 'osgUtil', 'osgGA', 'osgSim', 'Eigen', 'matrix'
'QtGui', 'QtCore', 'QtWebKit', 'QtOpenGL', 'GL', 'cxxtest', 'boost', 'osg','osgText', 'osgViewer', 'osgDB', 'osgUtil', 'osgGA', 'osgSim', 'Eigen', 'matrix', 'core', 'CL'
])
# Assertion macros. These are defined in base/logging.h and
......
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