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

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

mise a jour de persistances par objets delegues

File size: 2.3 KB
RevLine 
[518]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"
[701]9#include "anydataobj.h"
[518]10
[701]11static char *head_spherepos_h_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.h,v 1.4 2000-01-04 14:27:11 ansari Exp $";
[518]12
[552]13namespace SOPHYA {
[529]14
[518]15enum SphereCoordSysIds { SphereCoordSys_NEUTRAL =0,
16 SphereCoordSys_ROTATION =1,
17 SphereCoordSys_OTHER = 0xFFFF
18};
19
20
[701]21class SphereCoordSys : public AnyDataObj {
[518]22public:
23
[701]24 SphereCoordSys();
25 SphereCoordSys(const SphereCoordSys& a);
[518]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_; }
[701]31 SphereCoordSys& operator = (const SphereCoordSys& a);
[518]32
33
34private:
35 int id_;
36 string description_;
37};
38
[701]39// Classe pour la gestion de persistance
[518]40
[701]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 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
[518]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
[529]80} // Fin du namespace
81
[518]82#endif
Note: See TracBrowser for help on using the repository browser.