00001 #ifndef COMPONENT_SPH_
00002 #define COMPONENT_SPH_
00003
00004 #include <vcg/math/spherical_harmonics.h>
00005
00006 namespace vcg {
00007 namespace vertex {
00008
00009 template <class A, class T> class Sph: public T
00010 {
00011 public:
00012 typedef A SphType;
00013 SphType &SH() { return _harmonics; }
00014 const SphType &cSH() const { return _harmonics; }
00015 template < class LeftV>
00016
00017 void ImportData(const LeftV & left ) { T::ImportData( left); }
00018 static bool HasSH() { return true; }
00019 static void Name(std::vector<std::string> & name){name.push_back(std::string("Spherical Harmonics"));T::Name(name);}
00020
00021 private:
00022 SphType _harmonics;
00023 };
00024
00025 template <class T> class Sph9f: public Sph<vcg::math::SphericalHarmonics<float, 3>, T> {
00026 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph9f"));T::Name(name);}
00027 };
00028
00029 template <class T> class Sph16f: public Sph<vcg::math::SphericalHarmonics<float, 4>, T> {
00030 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph16f"));T::Name(name);}
00031 };
00032
00033 template <class T> class Sph25f: public Sph<vcg::math::SphericalHarmonics<float, 5>, T> {
00034 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph25f"));T::Name(name);}
00035 };
00036
00037 template <class T> class Sph36f: public Sph<vcg::math::SphericalHarmonics<float, 6>, T> {
00038 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph36f"));T::Name(name);}
00039 };
00040
00041 template <class T> class Sph49f: public Sph<vcg::math::SphericalHarmonics<float, 7>, T> {
00042 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph49f"));T::Name(name);}
00043 };
00044
00045 template <class T> class Sph9d: public Sph<vcg::math::SphericalHarmonics<double, 3>, T> {
00046 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph9d"));T::Name(name);}
00047 };
00048
00049 template <class T> class Sph16d: public Sph<vcg::math::SphericalHarmonics<double, 4>, T> {
00050 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph16d"));T::Name(name);}
00051 };
00052
00053 template <class T> class Sph25d: public Sph<vcg::math::SphericalHarmonics<double, 5>, T> {
00054 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph25d"));T::Name(name);}
00055 };
00056
00057 template <class T> class Sph36d: public Sph<vcg::math::SphericalHarmonics<double, 6>, T> {
00058 public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Sph36d"));T::Name(name);}
00059 };
00060
00061 }}
00062
00063 #endif