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 |
|
---|
10 | static char *head_spherepos_h_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.h,v 1.1 1999-10-26 14:31:41 ansari Exp $";
|
---|
11 |
|
---|
12 | enum SphereCoordSysIds { SphereCoordSys_NEUTRAL =0,
|
---|
13 | SphereCoordSys_ROTATION =1,
|
---|
14 | SphereCoordSys_OTHER = 0xFFFF
|
---|
15 | };
|
---|
16 |
|
---|
17 | // We make this class a PPersist class, in order
|
---|
18 | // to be able to implement easily the persistence
|
---|
19 | // for pixelmaps
|
---|
20 | // To be changed later ($CHECK$ Reza 26/10/99)
|
---|
21 |
|
---|
22 | class SphereCoordSys : public PPersist {
|
---|
23 | public:
|
---|
24 |
|
---|
25 | SphereCoordSys();
|
---|
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 |
|
---|
32 | // METHODS FOR PERSISTENCE TO FOLLOW:
|
---|
33 | protected:
|
---|
34 | virtual void ReadSelf(PInPersist&);
|
---|
35 | virtual void WriteSelf(POutPersist&) const;
|
---|
36 |
|
---|
37 | private:
|
---|
38 | int id_;
|
---|
39 | string description_;
|
---|
40 | };
|
---|
41 |
|
---|
42 |
|
---|
43 | class SpherePosition : public UnitVector {
|
---|
44 | public:
|
---|
45 |
|
---|
46 | SpherePosition();
|
---|
47 | // cs should be created by new SphereCoordSys...
|
---|
48 | // It will be deleted by the destructor
|
---|
49 | SpherePosition(double theta, double phi, SphereCoordSys* cs = NULL);
|
---|
50 | SpherePosition(double x, double y, double z, SphereCoordSys* cs = NULL);
|
---|
51 | SpherePosition(const UnitVector& v, SphereCoordSys* cs = NULL);
|
---|
52 | virtual ~SpherePosition();
|
---|
53 |
|
---|
54 | inline double phi() const {return Phi(); }
|
---|
55 | inline double theta() const { return(Theta()); }
|
---|
56 | inline SphereCoordSys * GetCoordSys() const { return(cs_); }
|
---|
57 | virtual UnitVector Transform(const SphereCoordSys& cs) const ;
|
---|
58 |
|
---|
59 | virtual double Separation(const SpherePosition& gamma) const;
|
---|
60 |
|
---|
61 | protected:
|
---|
62 | SphereCoordSys* cs_;
|
---|
63 | };
|
---|
64 |
|
---|
65 | #endif
|
---|