Polar Functor is now templatized

This commit is contained in:
Paolo Cignoni 2008-12-15 13:16:00 +00:00
parent a9a17a0713
commit 0f0ac756e4
1 changed files with 4 additions and 3 deletions

View File

@ -35,9 +35,9 @@ namespace vcg{
namespace math{
template <typename ScalarType>
class PolarFunctor{
class DummyPolarFunctor{
public:
virtual ScalarType operator()(ScalarType theta, ScalarType phi) = 0;
inline ScalarType operator()(ScalarType theta, ScalarType phi) {return ScalarType(0);}
};
/**
@ -88,7 +88,8 @@ public :
else return SQRT_TWO * complex_spherical_harmonic_im(l, -m, theta, phi);
}
static SphericalHarmonics Project(PolarFunctor<ScalarType> * fun, unsigned n_samples)
template <typename PolarFunctor>
static SphericalHarmonics Project(PolarFunctor * fun, unsigned n_samples)
{
const ScalarType weight = 4 * M_PI;