00001 #ifndef _DENSITY_MAP_HPP_
00002 #define _DENSITY_MAP_HPP_
00003 #define ABS(x) ( ( x ) < 0 ? - (x) : (x) )
00004
00005 #include "facetsmap/staticmaillage.hpp"
00006 #include "facetsmap/params.hpp"
00007
00008 namespace jafar {
00009 namespace facetsmap {
00010 class Facet;
00011 class DensityMap : private StaticMaillage<double> {
00012 public:
00013 DensityMap() : StaticMaillage<double>() { }
00014 public:
00021 double computePotentiel(Facet* f);
00027 void updateDensity(Facet* f);
00031 double mapTotalValue();
00032 private:
00033 inline double computeValue(double v, int i, int j, double oo)
00034 {
00035 return MIN(v + (1. - (ABS(i) + ABS(j)) / (2.*oo)), 1.);
00036 }
00037 };
00038 };
00039 };
00040
00041
00042 #endif