source: Sophya/trunk/SophyaLib/Samba/spherepos.h@ 518

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

Introduction de SpherePosition and SphereCoordSys, and Initiator for module Samba - Reza+I. Grivell 26/10/99

File size: 1.9 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
10static 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
12enum 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
22class SphereCoordSys : public PPersist {
23public:
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:
33protected:
34 virtual void ReadSelf(PInPersist&);
35 virtual void WriteSelf(POutPersist&) const;
36
37private:
38 int id_;
39 string description_;
40};
41
42
43class SpherePosition : public UnitVector {
44public:
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
61protected:
62 SphereCoordSys* cs_;
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.