31 #include "../common/WAssert.h"
32 #include "../common/math/linearAlgebra/WPosition.h"
33 #include "../common/math/WSymmetricSphericalHarmonic.h"
34 #include "WDataSetSingle.h"
35 #include "WDataSetSphericalHarmonics.h"
41 boost::shared_ptr< WGrid > newGrid ) :
45 WAssert( newValueSet,
"No value set given." );
46 WAssert( newGrid,
"No grid given." );
114 h[0] = ( 1 - lambdaX ) * ( 1 - lambdaY ) * ( 1 - lambdaZ );
115 h[1] = ( lambdaX ) * ( 1 - lambdaY ) * ( 1 - lambdaZ );
116 h[2] = ( 1 - lambdaX ) * ( lambdaY ) * ( 1 - lambdaZ );
117 h[3] = ( lambdaX ) * ( lambdaY ) * ( 1 - lambdaZ );
118 h[4] = ( 1 - lambdaX ) * ( 1 - lambdaY ) * ( lambdaZ );
119 h[5] = ( lambdaX ) * ( 1 - lambdaY ) * ( lambdaZ );
120 h[6] = ( 1 - lambdaX ) * ( lambdaY ) * ( lambdaZ );
121 h[7] = ( lambdaX ) * ( lambdaY ) * ( lambdaZ );
125 for(
size_t i = 0; i < 8; ++i )
127 interpolatedCoefficients += h[i] *
m_valueSet->getWValueDouble( vertexIds[i] );
143 return "WDataSetSphericalHarmonics";
148 return "Contains factors for spherical harmonics.";
virtual const std::string getDescription() const
Gets the description for this prototype.
A grid that has parallelepiped cells which all have the same proportion.
boost::array< size_t, 8 > CellVertexArray
Convenience typedef for a boost::array< size_t, 8 >.
virtual const std::string getName() const
Gets the name of this prototype.
boost::shared_ptr< WValueSetBase > getValueSet() const
WSymmetricSphericalHarmonic< double > interpolate(const WPosition &pos, bool *success) const
Interpolates the field of spherical harmonics at the given position.
This only is a 3d double vector.
boost::shared_ptr< WGrid > getGrid() const
WDataSetSphericalHarmonics()
Construct an empty and unusable instance.
virtual bool isTexture() const
Determines whether this dataset can be used as a texture.
static boost::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
Class for symmetric spherical harmonics The index scheme of the coefficients/basis values is like in ...
A data set consisting of a set of values based on a grid.
WSymmetricSphericalHarmonic< double > getSphericalHarmonicAt(size_t index) const
Get the spherical harmonic on the given position in value set.
boost::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a boost::shared_ptr.
boost::shared_ptr< WValueSetBase > m_valueSet
The valueset of the data set.
static boost::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
virtual ~WDataSetSphericalHarmonics()
Destroys this DataSet instance.
boost::shared_ptr< WGridRegular3D > m_gridRegular3D
The regular 3d grid of the data set.
virtual WDataSetSingle::SPtr clone() const
Creates a copy (clone) of this instance.