source: Sophya/trunk/SophyaLib/Samba/pixelmap.h@ 470

Last change on this file since 470 was 470, checked in by ansari, 26 years ago

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

File size: 1.9 KB
Line 
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
17template<class T>
18class PixelMap
19{
20
21public:
22
23PixelMap():mInfo_(NULL) {};
24virtual ~PixelMap() {};
25
26// Number of pixels
27virtual int_4 NbPixels() const=0;
28
29// Value of pixel number k
30virtual T& PixVal(int_4 k)=0;
31virtual T const& PixVal(int_4 k) const=0;
32
33// Index of pixel at (theta,phi)
34virtual int_4 PixIndexSph(float theta, float phi) const=0;
35
36// Value of pixel number at (theta,phi)
37virtual T& PixValSph(float theta, float phi)
38 {return PixVal(PixIndexSph(theta,phi));}
39virtual T const& PixValSph(float theta, float phi) const
40 {return PixVal(PixIndexSph(theta,phi));}
41
42// Spherical coordinates of center of pixel number k
43virtual void PixThetaPhi(int_4 k, float& theta, float& phi) const=0;
44
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;
49
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
60
61//++
62DVList& Info()
63//
64// Renvoie une reference sur l''objet DVList Associe
65//--
66 {
67 if (mInfo_ == NULL) mInfo_ = new DVList;
68 return(*mInfo_);
69 }
70
71const DVList* ptrInfo() const
72 {
73 return mInfo_;
74 }
75
76protected :
77
78 DVList* mInfo_; // Infos (variables) attachees
79};
80#endif
Note: See TracBrowser for help on using the repository browser.