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