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

Last change on this file since 3615 was 3572, checked in by cmv, 17 years ago

char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009

File size: 2.2 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
11
12namespace SOPHYA {
13
14
15class SphereCoordSys : public AnyDataObj {
16public:
17
[2973]18 enum SphereCoordSysIds { NEUTRAL =0,
19 ROTATION =1,
20 OTHER = 0xFFFF
21 };
22
[764]23 SphereCoordSys();
24 SphereCoordSys(const SphereCoordSys& a);
25 SphereCoordSys(int id, const string& description);
26 virtual ~SphereCoordSys();
27
28 virtual int Id() const {return id_; }
29 virtual string description() const {return description_; }
30 SphereCoordSys& operator = (const SphereCoordSys& a);
31
32
33private:
34 int id_;
35 string description_;
36};
37
38// Classe pour la gestion de persistance
39
40class FIO_SphereCoordSys : public PPersist {
41public:
42 FIO_SphereCoordSys();
43 FIO_SphereCoordSys(string const & filename);
44 FIO_SphereCoordSys(const SphereCoordSys & obj);
45 FIO_SphereCoordSys(SphereCoordSys * obj);
46 virtual ~FIO_SphereCoordSys();
47 virtual AnyDataObj* DataObj();
48 virtual void SetDataObj(AnyDataObj & o);
49 inline operator SphereCoordSys() { return(*dobj); }
50protected :
51 virtual void ReadSelf(PInPersist&);
52 virtual void WriteSelf(POutPersist&) const;
53 SphereCoordSys * dobj;
54 bool ownobj;
55};
56
57
58class SpherePosition : public UnitVector {
59public:
60
61 SpherePosition();
62// cs should be created by new SphereCoordSys...
63// It will be deleted by the destructor
64 SpherePosition(double theta, double phi, SphereCoordSys* cs = NULL);
65 SpherePosition(double x, double y, double z, SphereCoordSys* cs = NULL);
66 SpherePosition(const UnitVector& v, SphereCoordSys* cs = NULL);
67 virtual ~SpherePosition();
68
69 inline double phi() const {return Phi(); }
70 inline double theta() const { return(Theta()); }
71 inline SphereCoordSys * GetCoordSys() const { return(cs_); }
72 virtual UnitVector Transform(const SphereCoordSys& cs) const ;
73
74 virtual double Separation(const SpherePosition& gamma) const;
75
76protected:
77 SphereCoordSys* cs_;
78};
79
80} // Fin du namespace
81
82#endif
Note: See TracBrowser for help on using the repository browser.