[228] | 1 | #ifndef PIXELMAP_SEEN
|
---|
| 2 | #define PIXELMAP_SEEN
|
---|
| 3 |
|
---|
| 4 | #include "ppersist.h"
|
---|
| 5 | #include "dvlist.h"
|
---|
| 6 | #include <iostream.h>
|
---|
| 7 |
|
---|
| 8 | // General map of pixels on part of sphere or whole sphere
|
---|
| 9 | // Class hierarchy :
|
---|
| 10 | // PixelMap
|
---|
| 11 | // SphericalMap
|
---|
| 12 | // SphereThetaPhi
|
---|
| 13 | // SphereGorski
|
---|
| 14 | // SphereIco
|
---|
| 15 | // LocalMap
|
---|
| 16 |
|
---|
[470] | 17 | template<class T>
|
---|
| 18 | class PixelMap
|
---|
| 19 | {
|
---|
[228] | 20 |
|
---|
| 21 | public:
|
---|
[470] | 22 |
|
---|
| 23 | PixelMap():mInfo_(NULL) {};
|
---|
| 24 | virtual ~PixelMap() {};
|
---|
| 25 |
|
---|
| 26 | // Number of pixels
|
---|
[473] | 27 | virtual int NbPixels() const=0;
|
---|
[228] | 28 |
|
---|
[470] | 29 | // Value of pixel number k
|
---|
[473] | 30 | virtual T& PixVal(int k)=0;
|
---|
| 31 | virtual T const& PixVal(int k) const=0;
|
---|
[228] | 32 |
|
---|
[470] | 33 | // Index of pixel at (theta,phi)
|
---|
[473] | 34 | virtual int PixIndexSph(double theta, double phi) const=0;
|
---|
[228] | 35 |
|
---|
[470] | 36 | // Value of pixel number at (theta,phi)
|
---|
[473] | 37 | virtual T& PixValSph(double theta, double phi)
|
---|
[228] | 38 | {return PixVal(PixIndexSph(theta,phi));}
|
---|
[473] | 39 | virtual T const& PixValSph(double theta, double phi) const
|
---|
[470] | 40 | {return PixVal(PixIndexSph(theta,phi));}
|
---|
[228] | 41 |
|
---|
[470] | 42 | // Spherical coordinates of center of pixel number k
|
---|
[473] | 43 | virtual void PixThetaPhi(int k, double& theta, double& phi) const=0;
|
---|
[228] | 44 |
|
---|
[470] | 45 | // provides a integer characterizing the pixelization refinement
|
---|
| 46 | // (depending of the type of the map)
|
---|
[473] | 47 | virtual int SizeIndex() const=0;
|
---|
[470] | 48 | virtual char* TypeOfMap() const =0;
|
---|
[228] | 49 |
|
---|
[470] | 50 | // Pixel (steradians)
|
---|
[473] | 51 | virtual double PixSolAngle(int k) const =0;
|
---|
[228] | 52 |
|
---|
[470] | 53 | // Overloading of () to access pixel number k.
|
---|
[473] | 54 | inline T& operator()(int k) {return(PixVal(k));}
|
---|
| 55 | inline T const& operator()(int k) const {return(PixVal(k));}
|
---|
[470] | 56 |
|
---|
[473] | 57 | // Note : no overloading of (double,double) to access pixel (theta,phi).
|
---|
| 58 | // overloading of (double,double) in SphericalMap
|
---|
[470] | 59 | // overloading of (int,int) in CartesianMap
|
---|
| 60 |
|
---|
[228] | 61 | //++
|
---|
[470] | 62 | DVList& Info()
|
---|
[228] | 63 | //
|
---|
[470] | 64 | // Renvoie une reference sur l''objet DVList Associe
|
---|
[228] | 65 | //--
|
---|
[470] | 66 | {
|
---|
| 67 | if (mInfo_ == NULL) mInfo_ = new DVList;
|
---|
| 68 | return(*mInfo_);
|
---|
| 69 | }
|
---|
[228] | 70 |
|
---|
[470] | 71 | const DVList* ptrInfo() const
|
---|
| 72 | {
|
---|
| 73 | return mInfo_;
|
---|
| 74 | }
|
---|
[228] | 75 |
|
---|
[470] | 76 | protected :
|
---|
| 77 |
|
---|
| 78 | DVList* mInfo_; // Infos (variables) attachees
|
---|
[228] | 79 | };
|
---|
| 80 | #endif
|
---|