Index: trunk/SophyaLib/Samba/Makefile
===================================================================
--- trunk/SophyaLib/Samba/Makefile	(revision 517)
+++ trunk/SophyaLib/Samba/Makefile	(revision 518)
@@ -3,7 +3,7 @@
 all: $(LIB)libSamba.a
 clean:
-	rm -f $(OBJ)anagen.o $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)lambuilder.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)scan.o $(OBJ)spheregorski.o $(OBJ)spherethetaphi.o $(OBJ)syngen.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
-	rm $(LIB)libSamba.a
-$(LIB)libSamba.a : $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)scan.o $(OBJ)spheregorski.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
+	rm -f $(OBJ)ana2fast.o $(OBJ)anagen.o $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)lambuilder.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)sambainit.o $(OBJ)scan.o $(OBJ)spheregorski.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)syn2fast.o $(OBJ)syngen.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
+	rm -f $(LIB)libSamba.a
+$(LIB)libSamba.a : $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)sambainit.o $(OBJ)scan.o $(OBJ)spheregorski.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -11,23 +11,4 @@
 endif 
  
-$(OBJ)anagen.o: anagen.cc anagen.h $(INC)cvector.h \
- $(INC)matrix.h \
- $(INC)peida.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)pexceptions.h \
- $(INC)fmath.h \
- $(INC)ppersist.h \
- $(INC)md5.h sphericalmap.h \
- $(INC)nbmath.h pixelmap.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)ndatablock.h lambuilder.h \
- $(INC)fftserver.h
 $(OBJ)bruit.o: bruit.cc $(INC)fmath.h bruit.h \
  $(INC)nbrandom.h \
@@ -66,4 +47,9 @@
  $(INC)ndatablock.h unitvector.h vector3d.h \
  longlat.h utilgeom.h $(INC)timing.h
+$(OBJ)sambainit.o: sambainit.cc sambainit.h \
+ $(INC)outilsinit.h \
+ $(INC)peidainit.h \
+ $(INC)machdefs.h \
+ $(INC)pclassids.h
 $(OBJ)scan.o: scan.cc $(INC)machdefs.h \
  $(INC)pclassids.h scan.h \
@@ -90,4 +76,11 @@
  $(INC)strutil.h \
  $(INC)piocmplx.h
+$(OBJ)spherepos.o: spherepos.cc spherepos.h \
+ $(INC)machdefs.h \
+ $(INC)pclassids.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)md5.h unitvector.h vector3d.h \
+ longlat.h utilgeom.h
 $(OBJ)spherethetaphi.o: spherethetaphi.cc spherethetaphi.h sphericalmap.h \
  $(INC)nbmath.h \
@@ -104,23 +97,4 @@
  $(INC)ndatablock.h \
  $(INC)piocmplx.h
-$(OBJ)syngen.o: syngen.cc syngen.h $(INC)cvector.h \
- $(INC)matrix.h \
- $(INC)peida.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)pexceptions.h \
- $(INC)fmath.h \
- $(INC)ppersist.h \
- $(INC)md5.h sphericalmap.h \
- $(INC)nbmath.h pixelmap.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)ndatablock.h lambuilder.h \
- $(INC)fftserver.h
 $(OBJ)unitvector.o: unitvector.cc unitvector.h vector3d.h longlat.h \
  utilgeom.h
Index: trunk/SophyaLib/Samba/Samba.o.list
===================================================================
--- trunk/SophyaLib/Samba/Samba.o.list	(revision 517)
+++ trunk/SophyaLib/Samba/Samba.o.list	(revision 518)
@@ -5,6 +5,8 @@
 longlat.o
 mlobe.o
+sambainit.o
 scan.o
 spheregorski.o
+spherepos.o
 spherethetaphi.o
 unitvector.o
Index: trunk/SophyaLib/Samba/exclude
===================================================================
--- trunk/SophyaLib/Samba/exclude	(revision 517)
+++ trunk/SophyaLib/Samba/exclude	(revision 518)
@@ -1,1 +1,5 @@
 lambuilder.cc
+ana2fast.cc
+anagen.cc
+syngen.cc
+syn2fast.cc
Index: trunk/SophyaLib/Samba/lambuilder.cc
===================================================================
--- trunk/SophyaLib/Samba/lambuilder.cc	(revision 517)
+++ trunk/SophyaLib/Samba/lambuilder.cc	(revision 518)
@@ -2,4 +2,6 @@
 #include "lambuilder.h"
 #include <iostream.h>
+
+double Lambda2Builder::bignorm = 1.e268; // = 1e-20*1.d288
 
 Lambda2Builder::Lambda2Builder(){}
Index: trunk/SophyaLib/Samba/lambuilder.h
===================================================================
--- trunk/SophyaLib/Samba/lambuilder.h	(revision 517)
+++ trunk/SophyaLib/Samba/lambuilder.h	(revision 518)
@@ -36,5 +36,6 @@
   double fm2_;
   //  static const double bignorm=1e-20*HUGE_VAL;
-  static const double bignorm=1e-20*1.d288;
+//  static const double bignorm=1e-20*1.d288;
+  static const double bignorm;
 };
 
Index: trunk/SophyaLib/Samba/localmap.cc
===================================================================
--- trunk/SophyaLib/Samba/localmap.cc	(revision 517)
+++ trunk/SophyaLib/Samba/localmap.cc	(revision 518)
@@ -220,4 +220,12 @@
 //++
 template<class T>
+bool LocalMap<T>::ContainsSph(double theta, double phi) const
+//--
+{
+  return(true);  // $CHECK$  A MODIFIER - Reza 26/10/99
+}
+
+//++
+template<class T>
 int LocalMap<T>::PixIndexSph(double theta,double phi) const
 //
@@ -591,4 +599,8 @@
     }
 
+// Let's Read the SphereCoordSys object  -- ATTENTIOn - $CHECK$
+  SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject());
+  dobj->SetCoordSys(cs);
+
   // Pour savoir s'il y avait un DVList Info associe
   char strg[256];
@@ -651,4 +663,7 @@
     }
 
+// Let's write the SphereCoordSys object
+  dobj->GetCoordSys()->Write(os);
+  
   char strg[256];
   int nSzX= dobj->Size_x();
Index: trunk/SophyaLib/Samba/localmap.h
===================================================================
--- trunk/SophyaLib/Samba/localmap.h	(revision 517)
+++ trunk/SophyaLib/Samba/localmap.h	(revision 518)
@@ -1,2 +1,3 @@
+// This may look like C code, but it is really -*- C++ -*-
 #ifndef LOCALMAP_SEEN
 #define LOCALMAP_SEEN
@@ -63,4 +64,6 @@
 virtual T const& PixVal(int k) const;
 
+/* Return true if teta,phi in map  */
+virtual bool ContainsSph(double theta, double phi) const;
 /* return the index of pixel at (theta,phi) */
 virtual int PixIndexSph(double theta,double phi) const;
Index: trunk/SophyaLib/Samba/pixelmap.h
===================================================================
--- trunk/SophyaLib/Samba/pixelmap.h	(revision 517)
+++ trunk/SophyaLib/Samba/pixelmap.h	(revision 518)
@@ -1,2 +1,3 @@
+// This may look like C code, but it is really -*- C++ -*-
 #ifndef PIXELMAP_SEEN
 #define PIXELMAP_SEEN
@@ -4,4 +5,5 @@
 #include "ppersist.h" 
 #include "dvlist.h"
+#include "spherepos.h"
 #include <iostream.h>
 
@@ -21,7 +23,14 @@
 public:
   
-PixelMap():mInfo_(NULL) {};
-virtual ~PixelMap() {};
-  
+              PixelMap(SphereCoordSys* cs = NULL) : mInfo_(NULL) 
+                    { if (cs) cs_ = cs; else cs = new SphereCoordSys; }
+virtual       ~PixelMap() 
+                    { if (mInfo_) delete mInfo_; if (cs_) delete cs_; }
+
+// Set/Change/Get the coordinate system
+virtual void  SetCoordSys(SphereCoordSys* cs)
+                    { if (cs) { delete cs_;  cs_ = cs; } }
+inline SphereCoordSys* GetCoordSys() const { return(cs_); }
+
 // Number of pixels
 virtual int NbPixels() const=0;
@@ -30,7 +39,14 @@
 virtual T& PixVal(int k)=0;
 virtual T const& PixVal(int k) const=0;
-   
+
+// Map s coverage
+virtual bool ContainsSph(double theta, double phi) const=0;
+virtual bool Contains(const SpherePosition& spos) const;
+
 // Index of pixel at (theta,phi)
 virtual int PixIndexSph(double theta, double phi) const=0;
+// Index of pixel at a sky-position 
+virtual int PixIndex(const SpherePosition& spos);
+
 
 // Value of pixel number at (theta,phi)
@@ -55,4 +71,11 @@
 inline T const& operator()(int k) const {return(PixVal(k));}
 
+// Overloading of () to access pixel at a sky position .
+inline T& operator()(const SpherePosition& spos) 
+                     { return(PixVal(PixIndex(spos))); }
+inline T const& operator()(const SpherePosition& spos) const 
+                     { return(PixVal(PixIndex(spos))); }
+
+
 // Note : no overloading of (double,double) to access pixel (theta,phi).
 // overloading of (double,double) in SphericalMap
@@ -75,6 +98,22 @@
 
 protected :
-
+    SphereCoordSys *cs_;   // Coordinate system used in the map
     DVList* mInfo_;        // Infos (variables) attachees 
 };
+
+
+template <class T>
+int PixelMap<T>::PixIndex(const SpherePosition& spos)
+{
+UnitVector v = spos.Transform(*cs_);
+return(PixIndexSph(v.Theta(), v.Phi()));
+}
+
+template <class T>
+bool PixelMap<T>::Contains(const SpherePosition& spos) const
+{
+UnitVector v = spos.Transform(*cs_);
+return(ContainsSph(v.Theta(), v.Phi()));
+}
+
 #endif
Index: trunk/SophyaLib/Samba/sambainit.cc
===================================================================
--- trunk/SophyaLib/Samba/sambainit.cc	(revision 518)
+++ trunk/SophyaLib/Samba/sambainit.cc	(revision 518)
@@ -0,0 +1,45 @@
+// Classe d'initialisation du module Outils++ 
+#include <unistd.h>
+
+#include "sambainit.h"
+#include "ppersist.h"
+#include "objfio.h"
+#include "spherethetaphi.h"
+#include "spheregorski.h"
+#include "spherepos.h"
+
+int SambaInitiator::FgInit = 0;
+
+SambaInitiator::SambaInitiator()
+  : PeidaOutilsInitiator()
+{
+  SambaInitiator::FgInit++;
+  if (SambaInitiator::FgInit > 1)  return;
+
+//   Enregistrement des classes PPersist du modules Outils++
+  
+  PPRegister(SphereCoordSys);
+
+  PPRegister(FIO_SphereThetaPhi<float>);
+  PPRegister(FIO_SphereThetaPhi<double>);
+  PPRegister(FIO_SphereThetaPhi< complex<float> >);
+  PPRegister(FIO_SphereThetaPhi< complex<double> >);
+
+  PPRegister(FIO_SphereGorski<float>);
+  PPRegister(FIO_SphereGorski<double>);
+  PPRegister(FIO_SphereGorski< complex<float> >);
+  PPRegister(FIO_SphereGorski< complex<double> >);
+
+
+}
+
+SambaInitiator::~SambaInitiator()
+{
+  SambaInitiator::FgInit--;
+}
+
+
+// On met un objet initiator en statique, pour les loaders qui savent 
+// appeler le constructeur des objets statiques   Reza 08/98
+static SambaInitiator s_sambainit_;
+
Index: trunk/SophyaLib/Samba/sambainit.h
===================================================================
--- trunk/SophyaLib/Samba/sambainit.h	(revision 518)
+++ trunk/SophyaLib/Samba/sambainit.h	(revision 518)
@@ -0,0 +1,23 @@
+// This may look like C code, but it is really -*- C++ -*-
+// Classe d'initialiseur du module Outils++
+
+#ifndef SAMBAINIT_H_SEEN
+#define SAMBAINIT_H_SEEN
+
+
+// Classe d''initialisation pour les modules de PEIDA++
+#include "outilsinit.h"
+
+class SambaInitiator : public PeidaOutilsInitiator {
+private:
+  static int FgInit;
+public:
+  			SambaInitiator();
+  virtual		~SambaInitiator();
+};
+
+#undef PeidaInit
+#define PeidaInit() SambaInitiator _sambainitiator_
+
+#endif
+
Index: trunk/SophyaLib/Samba/spheregorski.cc
===================================================================
--- trunk/SophyaLib/Samba/spheregorski.cc	(revision 517)
+++ trunk/SophyaLib/Samba/spheregorski.cc	(revision 518)
@@ -452,4 +452,13 @@
 //++
 template<class T>
+bool SphereGorski<T>::ContainsSph(double theta, double phi) const
+//--
+{
+return(true);
+}
+
+/* --Methode-- */
+//++
+template<class T>
 int SphereGorski<T>::PixIndexSph(double theta,double phi) const
 
@@ -890,6 +899,6 @@
   //  return ( ipf + face_num*pow(nside,2));//    ! in {0, 12*nside**2 - 1}
   // $CHECK$  Reza 25/10/99 , pow remplace par *
-  //  ipf = ipf / ((ns_max/nside)*(ns_max/nside)); //  ! in {0, nside**2 - 1}
-  //  return ( ipf + face_num*(nside*nside);//    ! in {0, 12*nside**2 - 1}
+  ipf = ipf / ((ns_max/nside)*(ns_max/nside));
+  return (ipf + face_num*nside*nside);
 }
 
@@ -1138,4 +1147,8 @@
     }
 
+// Let's Read the SphereCoordSys object  -- ATTENTIOn - $CHECK$
+  SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject());
+  dobj->SetCoordSys(cs);
+
   // Pour savoir s'il y avait un DVList Info associe
   char strg[256];
@@ -1177,4 +1190,7 @@
       return;
     }
+
+// Let's write the SphereCoordSys object
+  dobj->GetCoordSys()->Write(os);
 
   char strg[256];
Index: trunk/SophyaLib/Samba/spheregorski.h
===================================================================
--- trunk/SophyaLib/Samba/spheregorski.h	(revision 517)
+++ trunk/SophyaLib/Samba/spheregorski.h	(revision 518)
@@ -37,4 +37,6 @@
 void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const;
 
+/* Return true if teta,phi in map  */
+virtual bool ContainsSph(double theta, double phi) const;
 /* Indice "RING" du pixel vers lequel pointe une direction definie par 
 ses  coordonnees spheriques */                                    
Index: trunk/SophyaLib/Samba/spherepos.cc
===================================================================
--- trunk/SophyaLib/Samba/spherepos.cc	(revision 518)
+++ trunk/SophyaLib/Samba/spherepos.cc	(revision 518)
@@ -0,0 +1,70 @@
+#include "spherepos.h"
+
+static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.cc,v 1.1 1999-10-26 14:31:40 ansari Exp $";
+
+
+//................. SphereCoordSys class .................
+
+SphereCoordSys::SphereCoordSys(){
+  id_ = SphereCoordSys_NEUTRAL;
+  description_ = "NEUTRAL SphereCoordSystem";
+}
+
+SphereCoordSys::SphereCoordSys(int id, const string& description){
+  id_ = id;
+  description_ = description;
+}
+
+// Temporary implementation of PPersist::
+// To be changed later ($CHECK$  Reza 26/10/99) 
+void SphereCoordSys::ReadSelf(PInPersist& is)
+{
+uint_8 itab[3];
+is.Get(itab, 3);
+id_ = itab[1];
+is.GetStr(description_);
+}
+
+void SphereCoordSys::WriteSelf(POutPersist& os) const
+{
+//  On ecrit 3 uint_8 
+//  0 : Numero de version,  1 : Id,  2  reserve a l
+uint_8 itab[3];
+itab[0] = 1;
+itab[1] = id_;
+itab[2] = 0;
+os.Put(itab, 3);
+os.PutStr(description_);
+}
+
+//................. SpherePosition class .................
+
+SpherePosition::SpherePosition() 
+        : UnitVector()
+{
+  cs_ = new SphereCoordSys;
+}
+
+SpherePosition::SpherePosition(double theta, double phi, SphereCoordSys* cs)
+        : UnitVector(theta, phi)
+{
+if (cs == NULL) cs_ = new SphereCoordSys;
+else cs_ = cs;
+}
+
+SpherePosition::SpherePosition(double x, double y, double z, SphereCoordSys* cs)
+        : UnitVector(x, y, z)
+{
+if (cs == NULL) cs_ = new SphereCoordSys;
+else cs_ = cs;
+}
+
+UnitVector SpherePosition::Transform(const SphereCoordSys& cs) const
+{
+return(*this);
+}
+
+double SpherePosition::Separation(const SpherePosition& gamma) const 
+{
+return(this->SepAngle(gamma));
+}
Index: trunk/SophyaLib/Samba/spherepos.h
===================================================================
--- trunk/SophyaLib/Samba/spherepos.h	(revision 518)
+++ trunk/SophyaLib/Samba/spherepos.h	(revision 518)
@@ -0,0 +1,65 @@
+// This may look like C code, but it is really -*- C++ -*-
+#ifndef SPHEREPOS_H_SEEN
+#define SPHEREPOS_H_SEEN
+
+#include "machdefs.h"
+#include "ppersist.h"
+#include <string>
+#include "unitvector.h"
+
+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 $";
+
+enum SphereCoordSysIds { SphereCoordSys_NEUTRAL =0, 
+                         SphereCoordSys_ROTATION =1,
+                         SphereCoordSys_OTHER = 0xFFFF
+};
+
+// We make this class a PPersist class, in order
+// to be able to implement easily the persistence 
+// for pixelmaps
+// To be changed later ($CHECK$  Reza 26/10/99) 
+ 
+class SphereCoordSys : public PPersist {
+public:
+  
+                 SphereCoordSys();
+                 SphereCoordSys(int id, const string& description);
+  virtual        ~SphereCoordSys();
+
+  virtual int    Id() const {return id_; }
+  virtual string description() const {return description_; }
+
+    // METHODS FOR PERSISTENCE TO FOLLOW:
+protected:
+  virtual void       ReadSelf(PInPersist&);
+  virtual void       WriteSelf(POutPersist&) const;
+
+private:
+  int id_;
+  string description_;
+};
+
+
+class SpherePosition : public UnitVector {
+public:
+  
+                 SpherePosition();
+// cs should be created by new SphereCoordSys...
+// It will be deleted by the destructor
+                 SpherePosition(double theta, double phi, SphereCoordSys* cs = NULL);
+                 SpherePosition(double x, double y, double z, SphereCoordSys* cs = NULL);
+                 SpherePosition(const UnitVector& v, SphereCoordSys* cs = NULL);
+  virtual        ~SpherePosition();
+
+  inline double  phi() const {return Phi(); }
+  inline double  theta() const { return(Theta()); }
+  inline SphereCoordSys *   GetCoordSys() const { return(cs_); } 
+  virtual UnitVector Transform(const SphereCoordSys& cs) const ;
+
+  virtual double     Separation(const SpherePosition& gamma) const;
+
+protected:
+  SphereCoordSys* cs_;
+};
+
+#endif
Index: trunk/SophyaLib/Samba/spherethetaphi.cc
===================================================================
--- trunk/SophyaLib/Samba/spherethetaphi.cc	(revision 517)
+++ trunk/SophyaLib/Samba/spherethetaphi.cc	(revision 518)
@@ -183,4 +183,13 @@
 //++
 template <class T>
+bool SphereThetaPhi<T>::ContainsSph(double theta, double phi) const
+//--
+{
+  return(true);
+}
+
+/* --Methode-- */
+//++
+template <class T>
 int SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const
 
@@ -713,4 +722,8 @@
     }
 
+// Let's Read the SphereCoordSys object  -- ATTENTIOn - $CHECK$
+  SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject());
+  dobj->SetCoordSys(cs);
+
   // Pour savoir s'il y avait un DVList Info associe
   char strg[256];
@@ -767,4 +780,7 @@
     }
 
+// Let's write the SphereCoordSys object
+  dobj->GetCoordSys()->Write(os);
+  
   char strg[256];
   int mNTheta= dobj->SizeIndex();
Index: trunk/SophyaLib/Samba/spherethetaphi.h
===================================================================
--- trunk/SophyaLib/Samba/spherethetaphi.h	(revision 517)
+++ trunk/SophyaLib/Samba/spherethetaphi.h	(revision 518)
@@ -32,4 +32,6 @@
 virtual T const& PixVal(int k) const;
 
+/* Return true if teta,phi in map  */
+virtual bool ContainsSph(double theta, double phi) const;
 /* retourne l'indice du pixel a (theta,phi) */ 
 virtual int PixIndexSph(double theta, double phi) const;
Index: trunk/SophyaLib/Samba/unitvector.h
===================================================================
--- trunk/SophyaLib/Samba/unitvector.h	(revision 517)
+++ trunk/SophyaLib/Samba/unitvector.h	(revision 518)
@@ -17,9 +17,13 @@
   UnitVector(const Vector3d&);
   
-  Vector3d& operator=(const Vector3d&);
-  Vector3d& operator+=(const Vector3d&);
-  Vector3d& operator-=(const Vector3d&);
-  Vector3d operator+(const Vector3d&) const;
-  Vector3d operator-(const Vector3d&) const;
+  virtual Vector3d& operator=(const Vector3d&);
+  virtual Vector3d& operator+=(const Vector3d&);
+  virtual Vector3d& operator-=(const Vector3d&);
+  virtual Vector3d operator+(const Vector3d&) const;
+  virtual Vector3d operator-(const Vector3d&) const;
+
+  virtual Vector3d& operator+=(double d) { return Vector3d::operator+= (d); }
+  virtual Vector3d operator+(double d) const { return Vector3d::operator+ (d); }
+  virtual Vector3d operator-(double d) const { return Vector3d::operator- (d); }
 
   void Print(ostream& os) const;
Index: trunk/SophyaLib/Samba/vector3d.h
===================================================================
--- trunk/SophyaLib/Samba/vector3d.h	(revision 517)
+++ trunk/SophyaLib/Samba/vector3d.h	(revision 518)
@@ -31,42 +31,45 @@
   Vector3d(const Vector3d&);
 
-  void Setxyz(double x, double y, double z);
-  void SetThetaPhi(double theta,  double phi);
-  void ThetaPhi2xyz();
-  void xyz2ThetaPhi();
-  double Theta() const {return _theta;}
-  double Phi() const {return _phi;}
-  double X() const {return _x;}
-  double Y() const {return _y;}
-  double Z() const {return _z;}
+//   To manipulate the vector
+  virtual void Setxyz(double x, double y, double z);
+  virtual void SetThetaPhi(double theta,  double phi);
+  virtual void ThetaPhi2xyz();
+  virtual void xyz2ThetaPhi();
 
-  Vector3d& Normalize();
-  double Norm() const;
+// Acces to coordinates
+  inline double Theta() const {return _theta;}
+  inline double Phi() const {return _phi;}
+  inline double X() const {return _x;}
+  inline double Y() const {return _y;}
+  inline double Z() const {return _z;}
+
+  virtual Vector3d& Normalize();
+  virtual double Norm() const;
 
   // produit scalaire
-  double Psc(const Vector3d&) const;
+  virtual double Psc(const Vector3d&) const;
 
   // ecart angulaire entre 2 vecteurs dans [0,Pi]
-  double SepAngle(const Vector3d&) const;
+  virtual double SepAngle(const Vector3d&) const;
 
   // produit vectoriel
-  Vector3d Vect(const Vector3d&) const;
+  virtual Vector3d Vect(const Vector3d&) const;
 
   // vecteur perpendiculaire de meme phi
-  Vector3d VperpPhi() const;
+  virtual Vector3d VperpPhi() const;
 
   // vecteur perpendiculaire de meme theta
-  Vector3d VperpTheta() const;
+  virtual Vector3d VperpTheta() const;
 
-  Vector3d ETheta() const;
-  Vector3d EPhi() const;
+  virtual Vector3d ETheta() const;
+  virtual Vector3d EPhi() const;
 
-  // rotations d'Euler
-  Vector3d Euler(double, double, double) const;
+  // rotations d Euler
+  virtual Vector3d Euler(double, double, double) const;
 
   // rotation inverse
   Vector3d InvEuler(double, double, double) const;
 
-  // rotation d'angle phi autour d'un axe omega (regle du tire-bouchon)
+  // rotation d angle phi autour d'un axe omega (regle du tire-bouchon)
   Vector3d Rotate(const Vector3d& omega,double phi);
 
@@ -77,14 +80,16 @@
   virtual Vector3d operator-(const Vector3d&) const;
 
-  Vector3d& operator+=(double);
-  Vector3d& operator/=(double);
-  Vector3d& operator*=(double);
+  virtual Vector3d& operator+=(double);
+  virtual Vector3d& operator/=(double);
+  virtual Vector3d& operator*=(double);
 
-  Vector3d operator+(double) const;
-  Vector3d operator-(double) const;
-  Vector3d operator*(double) const;
-  Vector3d operator/(double) const;
-  Vector3d operator^(const Vector3d&) const; // produit vectoriel
-  double operator*(const Vector3d&) const; // produit scalaire
+  virtual Vector3d operator+(double) const;
+  virtual Vector3d operator-(double) const;
+  virtual Vector3d operator*(double) const;
+  virtual Vector3d operator/(double) const;
+
+  virtual Vector3d operator^(const Vector3d&) const; // produit vectoriel
+  virtual double operator*(const Vector3d&) const; // produit scalaire
+
   bool operator==(const Vector3d&);
   
