Commit 3e69eb3d authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE #453] the dataset can deal with wvaluesets of any type now

parent d4495612
......@@ -36,12 +36,10 @@ boost::shared_ptr< WPrototyped > WDataSetSphericalHarmonics::m_prototype = boost
WDataSetSphericalHarmonics::WDataSetSphericalHarmonics( boost::shared_ptr< WValueSetBase > newValueSet,
boost::shared_ptr< WGrid > newGrid ) :
WDataSetSingle( newValueSet, newGrid )
WDataSetSingle( newValueSet, newGrid ), m_valueSet( newValueSet )
{
m_valueSet = boost::shared_dynamic_cast< WValueSet<double> >( newValueSet );
WAssert( newValueSet, "No value set given." );
WAssert( newGrid, "No grid given." );
WAssert( m_valueSet, "No WValueSet<double> given." );
}
WDataSetSphericalHarmonics::WDataSetSphericalHarmonics()
......@@ -109,7 +107,7 @@ wmath::WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::interpolate( cons
wmath::WValue< double > interpolatedCoefficients( m_valueSet->dimension() );
for( size_t i = 0; i < 8; ++i )
{
interpolatedCoefficients += h[i] * m_valueSet->getWValue( vertexIds[i] );
interpolatedCoefficients += h[i] * m_valueSet->getWValueDouble( vertexIds[i] );
}
*success = true;
......@@ -119,7 +117,7 @@ wmath::WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::interpolate( cons
wmath::WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::getSphericalHarmonicAt( size_t index ) const
{
if ( index < m_valueSet->size() ) return wmath::WSymmetricSphericalHarmonic( m_valueSet->getWValue( index ) );
if ( index < m_valueSet->size() ) return wmath::WSymmetricSphericalHarmonic( m_valueSet->getWValueDouble( index ) );
return wmath::WSymmetricSphericalHarmonic();
}
......
......@@ -117,7 +117,7 @@ protected:
static boost::shared_ptr< WPrototyped > m_prototype;
private:
boost::shared_ptr< WValueSet<double> > m_valueSet;
boost::shared_ptr< WValueSetBase > m_valueSet;
};
#endif // WDATASETSPHERICALHARMONICS_H
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