| 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 | 
 | 
|---|
| 17 | 
 | 
|---|
| 18 | class PixelMap : public PPersist {
 | 
|---|
| 19 | public:
 | 
|---|
| 20 |    PixelMap():mInfo_(NULL) {}
 | 
|---|
| 21 |    virtual ~PixelMap() {}
 | 
|---|
| 22 |    
 | 
|---|
| 23 |    // Number of pixels
 | 
|---|
| 24 |    virtual int_4       NbPixels() const=0;
 | 
|---|
| 25 |    
 | 
|---|
| 26 |    // Value of pixel number k
 | 
|---|
| 27 |    virtual r_8&        PixVal(int_4 k)=0;
 | 
|---|
| 28 |    virtual r_8 const&  PixVal(int_4 k) const=0;
 | 
|---|
| 29 |    
 | 
|---|
| 30 |    // Index of pixel at (theta,phi)
 | 
|---|
| 31 |    virtual int_4       PixIndexSph(float theta, float phi) const=0;
 | 
|---|
| 32 | 
 | 
|---|
| 33 |    // Value of pixel number at (theta,phi)
 | 
|---|
| 34 |    virtual r_8&        PixValSph(float theta, float phi)
 | 
|---|
| 35 |                            {return PixVal(PixIndexSph(theta,phi));}
 | 
|---|
| 36 |    virtual r_8 const&  PixValSph(float theta, float phi) const
 | 
|---|
| 37 |                            {return PixVal(PixIndexSph(theta,phi));}                           
 | 
|---|
| 38 |    
 | 
|---|
| 39 |    // Spherical coordinates of center of pixel number k
 | 
|---|
| 40 |    virtual void        PixThetaPhi(int_4 k, float& theta, float& phi) const=0;
 | 
|---|
| 41 | 
 | 
|---|
| 42 |    // Pixel  (steradians)
 | 
|---|
| 43 |    virtual r_8         PixSolAngle(int_4 k) const =0; 
 | 
|---|
| 44 | 
 | 
|---|
| 45 |    // Overloading of () to access pixel number k.
 | 
|---|
| 46 |    inline  r_8&        operator()(int_4 k)
 | 
|---|
| 47 |                           {return(PixVal(k));}
 | 
|---|
| 48 |    inline  r_8 const&  operator()(int_4 k) const
 | 
|---|
| 49 |                           {return(PixVal(k));}
 | 
|---|
| 50 | 
 | 
|---|
| 51 |    // Note : no overloading of (float,float) to access pixel (theta,phi).
 | 
|---|
| 52 |    // overloading of (float,float) in SphericalMap
 | 
|---|
| 53 |    // overloading of (int,int)     in CartesianMap
 | 
|---|
| 54 | 
 | 
|---|
| 55 | //++
 | 
|---|
| 56 | DVList&  Info()
 | 
|---|
| 57 | //
 | 
|---|
| 58 | //      Renvoie une rM-ifM-irence sur l'objet DVList AssociM-i
 | 
|---|
| 59 | //--
 | 
|---|
| 60 | {
 | 
|---|
| 61 | if (mInfo_ == NULL)  mInfo_ = new DVList;
 | 
|---|
| 62 | return(*mInfo_);
 | 
|---|
| 63 | }
 | 
|---|
| 64 | 
 | 
|---|
| 65 |    protected :
 | 
|---|
| 66 | 
 | 
|---|
| 67 |   DVList* mInfo_;        // Infos (variables) attachees 
 | 
|---|
| 68 | };
 | 
|---|
| 69 | 
 | 
|---|
| 70 | #endif
 | 
|---|