Changeset 470 in Sophya for trunk/SophyaLib/Samba/pixelmap.h


Ignore:
Timestamp:
Oct 15, 1999, 5:43:30 PM (26 years ago)
Author:
ansari
Message:

versions templatees, NdataBlocks etc. 15-OCT-99-GLM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/pixelmap.h

    r228 r470  
    1515//      LocalMap
    1616
     17template<class T>
     18class PixelMap 
     19{
    1720
    18 class PixelMap : public PPersist {
    1921public:
    20    PixelMap():mInfo_(NULL) {}
    21    virtual ~PixelMap() {}
     22 
     23PixelMap():mInfo_(NULL) {};
     24virtual ~PixelMap() {};
     25 
     26// Number of pixels
     27virtual int_4 NbPixels() const=0;
    2228   
    23    // Number of pixels
    24    virtual int_4       NbPixels() const=0;
     29// Value of pixel number k
     30virtual T& PixVal(int_4 k)=0;
     31virtual T const& PixVal(int_4 k) const=0;
    2532   
    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;
     33// Index of pixel at (theta,phi)
     34virtual int_4 PixIndexSph(float theta, float phi) const=0;
    3235
    33    // Value of pixel number at (theta,phi)
    34    virtual r_8&        PixValSph(float theta, float phi)
     36// Value of pixel number at (theta,phi)
     37virtual T& PixValSph(float theta, float phi)
    3538                           {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;
     39virtual T const& PixValSph(float theta, float phi) const
     40                           {return PixVal(PixIndexSph(theta,phi));}
    4141
    42    // Pixel  (steradians)
    43    virtual r_8         PixSolAngle(int_4 k) const =0;
     42// Spherical coordinates of center of pixel number k
     43virtual void PixThetaPhi(int_4 k, float& theta, float& phi) const=0;
    4444
    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));}
     45// provides a integer characterizing the pixelization refinement
     46// (depending of the type of the map)             
     47virtual int_4 SizeIndex() const=0;
     48virtual char* TypeOfMap() const =0;
    5049
    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
     50// Pixel  (steradians)
     51virtual r_8 PixSolAngle(int_4 k) const =0;
     52
     53// Overloading of () to access pixel number k.
     54inline T& operator()(int_4 k) {return(PixVal(k));}
     55inline T const& operator()(int_4 k) const {return(PixVal(k));}
     56
     57// Note : no overloading of (float,float) to access pixel (theta,phi).
     58// overloading of (float,float) in SphericalMap
     59// overloading of (int,int)     in CartesianMap
    5460
    5561//++
    56 DVList&  Info()
     62DVList& Info()
    5763//
    58 //      Renvoie une rM-ifM-irence sur l'objet DVList AssociM-i
     64// Renvoie une reference sur l''objet DVList Associe
    5965//--
    60 {
    61 if (mInfo_ == NULL)  mInfo_ = new DVList;
    62 return(*mInfo_);
    63 }
     66  {
     67    if (mInfo_ == NULL)  mInfo_ = new DVList;
     68    return(*mInfo_);
     69  }
    6470
    65    protected :
     71const DVList*  ptrInfo() const
     72  {
     73    return mInfo_;
     74  }
    6675
    67   DVList* mInfo_;        // Infos (variables) attachees
     76protected :
     77
     78    DVList* mInfo_;        // Infos (variables) attachees
    6879};
    69 
    7080#endif
Note: See TracChangeset for help on using the changeset viewer.