31 #include "../common/WAssert.h"
32 #include "../common/math/WSymmetricSphericalHarmonic.h"
33 #include "../common/math/linearAlgebra/WPosition.h"
34 #include "WDataSetSingle.h"
35 #include "WDataSetSphericalHarmonics.h"
41 std::shared_ptr< WGrid > newGrid ) :
44 m_gridRegular3D = std::dynamic_pointer_cast< WGridRegular3D >( newGrid );
45 WAssert( newValueSet,
"No value set given." );
46 WAssert( newGrid,
"No grid given." );
106 double lambdaX = localPos[0];
107 double lambdaY = localPos[1];
108 double lambdaZ = localPos[2];
120 h[0] = ( 1 - lambdaX ) * ( 1 - lambdaY ) * ( 1 - lambdaZ );
121 h[1] = ( lambdaX ) * ( 1 - lambdaY ) * ( 1 - lambdaZ );
122 h[2] = ( 1 - lambdaX ) * ( lambdaY ) * ( 1 - lambdaZ );
123 h[3] = ( lambdaX ) * ( lambdaY ) * ( 1 - lambdaZ );
124 h[4] = ( 1 - lambdaX ) * ( 1 - lambdaY ) * ( lambdaZ );
125 h[5] = ( lambdaX ) * ( 1 - lambdaY ) * ( lambdaZ );
126 h[6] = ( 1 - lambdaX ) * ( lambdaY ) * ( lambdaZ );
127 h[7] = ( lambdaX ) * ( lambdaY ) * ( lambdaZ );
131 for(
size_t i = 0; i < 8; ++i )
133 interpolatedCoefficients += h[i] *
m_valueSet->getWValueDouble( vertexIds[i] );
144 wlog::warn(
"WDataSetSphericalHarmonics" ) <<
"Invalid index. Must be smaller than " <<
m_valueSet->size();
150 return "WDataSetSphericalHarmonics";
155 return "Contains factors for spherical harmonics.";
A data set consisting of a set of values based on a grid.
std::shared_ptr< WValueSetBase > getValueSet() const
std::shared_ptr< WGrid > getGrid() const
std::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a std::shared_ptr.
std::shared_ptr< WValueSetBase > m_valueSet
The valueset of the data set.
virtual const std::string getDescription() const
Gets the description for this prototype.
WSymmetricSphericalHarmonic< double > interpolate(const WPosition &pos, bool *success) const
Interpolates the field of spherical harmonics at the given position.
virtual ~WDataSetSphericalHarmonics()
Destroys this DataSet instance.
static std::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
virtual WDataSetSingle::SPtr clone() const
Creates a copy (clone) of this instance.
virtual const std::string getName() const
Gets the name of this prototype.
std::shared_ptr< WGridRegular3D > m_gridRegular3D
The regular 3d grid of the data set.
static std::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
virtual bool isTexture() const
Determines whether this dataset can be used as a texture.
WDataSetSphericalHarmonics()
Construct an empty and unusable instance.
WSymmetricSphericalHarmonic< double > getSphericalHarmonicAt(size_t index) const
Get the spherical harmonic on the given position in value set.
boost::array< size_t, 8 > CellVertexArray
Convenience typedef for a boost::array< size_t, 8 >.
This only is a 3d double vector.
Class for symmetric spherical harmonics The index scheme of the coefficients/basis values is like in ...
Base class for all higher level values like tensors, vectors, matrices and so on.
WStreamedLogger warn(const std::string &source)
Logging a warning message.