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

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

Reorganisation - Creation du module SkyMap (Loacl/Spherical maps ...) - Reza 2/3/2000

File size: 2.4 KB
RevLine 
[764]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.1.1.1 2000-03-02 17:05:39 ansari Exp $";
12
13namespace SOPHYA {
14
15enum SphereCoordSysIds { SphereCoordSys_NEUTRAL =0,
16 SphereCoordSys_ROTATION =1,
17 SphereCoordSys_OTHER = 0xFFFF
18};
19
20
21class SphereCoordSys : public AnyDataObj {
22public:
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.