source: Sophya/trunk/SophyaLib/SkyMap/spherepos.h@ 3174

Last change on this file since 3174 was 2973, checked in by ansari, 19 years ago

1/ Nettoyage+commentaires/doxygen ds Vector3d, UnitVector, LongLat,
SphereCoordSys ...
2/ Ajout de la classe angle pour faciliter les conversions rad<>deg<>arcmin
dans le fichier vector3d.h .cc
3/ nettoyage/uniformisation methodes print pour pixelmap, ajout de la
methode PixelMap<T>::Show()
4/ Ajout methodes SphericalMap<T>::HasSymThetaSlice() et
GetSymThetaSliceIndex(int_4 idx) et leurs implementations pour
SphereHEALPix et SphereThetaPhi en vue de l'optimisation du calcul
transforme Ylm
5/ Ajout methode ResolToSizeIndex ds SphereThetaPhi , SphereHEALPix et
SphereECP

Reza , 20 Juin 2006

File size: 2.3 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2#ifndef SPHEREPOS_H_SEEN
3#define SPHEREPOS_H_SEEN
4
5#include "machdefs.h"
6#include "ppersist.h"
7#include <string>
8#include "unitvector.h"
9#include "anydataobj.h"
10
11static char *head_spherepos_h_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.h,v 1.2 2006-06-20 16:01:48 ansari Exp $";
12
13namespace SOPHYA {
14
15
16class SphereCoordSys : public AnyDataObj {
17public:
18
19 enum SphereCoordSysIds { NEUTRAL =0,
20 ROTATION =1,
21 OTHER = 0xFFFF
22 };
23
24 SphereCoordSys();
25 SphereCoordSys(const SphereCoordSys& a);
26 SphereCoordSys(int id, const string& description);
27 virtual ~SphereCoordSys();
28
29 virtual int Id() const {return id_; }
30 virtual string description() const {return description_; }
31 SphereCoordSys& operator = (const SphereCoordSys& a);
32
33
34private:
35 int id_;
36 string description_;
37};
38
39// Classe pour la gestion de persistance
40
41class FIO_SphereCoordSys : public PPersist {
42public:
43 FIO_SphereCoordSys();
44 FIO_SphereCoordSys(string const & filename);
45 FIO_SphereCoordSys(const SphereCoordSys & obj);
46 FIO_SphereCoordSys(SphereCoordSys * obj);
47 virtual ~FIO_SphereCoordSys();
48 virtual AnyDataObj* DataObj();
49 virtual void SetDataObj(AnyDataObj & o);
50 inline operator SphereCoordSys() { return(*dobj); }
51protected :
52 virtual void ReadSelf(PInPersist&);
53 virtual void WriteSelf(POutPersist&) const;
54 SphereCoordSys * dobj;
55 bool ownobj;
56};
57
58
59class SpherePosition : public UnitVector {
60public:
61
62 SpherePosition();
63// cs should be created by new SphereCoordSys...
64// It will be deleted by the destructor
65 SpherePosition(double theta, double phi, SphereCoordSys* cs = NULL);
66 SpherePosition(double x, double y, double z, SphereCoordSys* cs = NULL);
67 SpherePosition(const UnitVector& v, SphereCoordSys* cs = NULL);
68 virtual ~SpherePosition();
69
70 inline double phi() const {return Phi(); }
71 inline double theta() const { return(Theta()); }
72 inline SphereCoordSys * GetCoordSys() const { return(cs_); }
73 virtual UnitVector Transform(const SphereCoordSys& cs) const ;
74
75 virtual double Separation(const SpherePosition& gamma) const;
76
77protected:
78 SphereCoordSys* cs_;
79};
80
81} // Fin du namespace
82
83#endif
Note: See TracBrowser for help on using the repository browser.