Changeset 574 in Sophya


Ignore:
Timestamp:
Nov 12, 1999, 4:03:09 PM (26 years ago)
Author:
ansari
Message:

ajout arg share ds constructeurs, et methode ContainsSph ds localmap.cc et operateur = , Reza 12/11/99

Location:
trunk/SophyaLib/Samba
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/localmap.cc

    r568 r574  
    107107//++
    108108template<class T>
    109 LocalMap<T>::LocalMap(const LocalMap<T>& lm)
     109LocalMap<T>::LocalMap(const LocalMap<T>& lm, bool share)
     110  : pixels_(lm.pixels_, share)
     111
    110112//
    111113//    copy constructor
     
    131133  tgAngleX_= lm.tgAngleX_;
    132134  tgAngleY_= lm.tgAngleY_;
    133   pixels_= lm.pixels_;
    134135}
    135136
     
    210211    }
    211212  return *(pixels_.Data()+k);
     213}
     214
     215template<class T>
     216bool LocalMap<T>::ContainsSph(double theta, double phi) const
     217{
     218// $CHECK$  Reza 11/11/99 - A modifier
     219return(true);
    212220}
    213221
     
    281289  // retour au plan utilisateur
    282290  ReferenceToUser(theta, phi);
     291}
     292
     293template <class T>
     294T LocalMap<T>::SetPixels(T v)
     295{
     296pixels_.Reset(v);
     297return(v);
    283298}
    284299 
     
    584599//--
    585600{
    586   dobj= new LocalMap<T>(obj);
     601  dobj= new LocalMap<T>(obj, true);
    587602  ownobj= true;
    588603}
  • trunk/SophyaLib/Samba/localmap.h

    r568 r574  
    6666LocalMap();
    6767LocalMap(int nx, int ny);
    68 LocalMap(const LocalMap<T>& lm);
     68LocalMap(const LocalMap<T>& lm, bool share=false);
    6969virtual ~LocalMap();
    7070
     
    9898/*!    Return (theta, phi) coordinates of pixel with index k */
    9999virtual void PixThetaPhi(int k,double& theta,double& phi) const;
     100
     101/*! Set all pixels to value v */
     102virtual T SetPixels(T v);
    100103
    101104/* return the Pixel Solid angle  (steradians) */
  • trunk/SophyaLib/Samba/pixelmap.h

    r568 r574  
    8484// overloading of (int,int)     in CartesianMap
    8585
     86/*! Setting pixel values to a constant */
     87virtual T SetPixels(T v);
     88inline T operator = (T v) { return(SetPixels(v)); }
     89                     
    8690//++
    8791DVList& Info()
     
    118122return(ContainsSph(v.Theta(), v.Phi()));
    119123}
     124template <class T>
     125T PixelMap<T>::SetPixels(T v)
     126{
     127int k;
     128for(k=0; k<NbPixels(); k++) PixVal(k) = v;
     129return(v);
     130}
    120131
    121132#endif
  • trunk/SophyaLib/Samba/spheregorski.cc

    r565 r574  
    211211//++
    212212template<class T>
    213 SphereGorski<T>::SphereGorski(const SphereGorski<T>& s)
    214 
     213SphereGorski<T>::SphereGorski(const SphereGorski<T>& s, bool share)
     214  : pixels_(s.pixels_, share)
    215215//    copy constructor
    216216//--
     
    222222  nPix_ = s.nPix_;
    223223  omeg_ = s.omeg_;
    224 
    225   pixels_= s.pixels_;
    226 
    227224}
    228225
     
    495492{
    496493  pix2ang_ring(nSide_,k,theta,phi);
     494}
     495
     496template <class T>
     497T SphereGorski<T>::SetPixels(T v)
     498{
     499pixels_.Reset(v);
     500return(v);
    497501}
    498502
     
    11171121FIO_SphereGorski<T>::FIO_SphereGorski(const SphereGorski<T>& obj)
    11181122{
    1119   dobj= new SphereGorski<T>(obj);
     1123  dobj= new SphereGorski<T>(obj, true);
    11201124  ownobj= true;
    11211125}
  • trunk/SophyaLib/Samba/spheregorski.h

    r565 r574  
    6565*/
    6666SphereGorski(int m);
    67 SphereGorski(const SphereGorski<T>& s);
     67SphereGorski(const SphereGorski<T>& s, bool share=false);
    6868//!     Destructor
    6969virtual ~SphereGorski();
     
    104104/* Coordonnees spheriques du milieu du pixel d'indice "RING" k   */
    105105virtual void PixThetaPhi(int k,double& theta,double& phi) const;
     106
     107/*! Set all pixels to value v */
     108virtual T SetPixels(T v);
    106109
    107110/* Pixel Solid angle  (steradians) */
  • trunk/SophyaLib/Samba/spherethetaphi.cc

    r565 r574  
    6161
    6262template <class T>
    63 SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s)
     63SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s, bool share)
     64  : pixels_(s.pixels_ , share)
    6465{
    6566  if(s.mInfo_) mInfo_= new DVList(*s.mInfo_);
     
    193194{
    194195  double dphi;
    195   int i,j,k;
     196  int i,k;
    196197  bool fgzn = false;
    197198
     
    238239  phi= DeuxPi/(double)NPhi_[i]*(double)(k+.5);
    239240  if (fgzn) phi= DeuxPi-phi;
     241}
     242
     243template <class T>
     244T SphereThetaPhi<T>::SetPixels(T v)
     245{
     246pixels_.Reset(v);
     247return(v);
    240248}
    241249
     
    483491//--
    484492{
    485   int ntotpix,i,j;
     493  int ntotpix,j;
    486494 
    487495  // Decodage et controle des arguments d'appel :
     
    685693FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(const SphereThetaPhi<T>& obj)
    686694{
    687   dobj= new SphereThetaPhi<T>(obj);
     695  dobj= new SphereThetaPhi<T>(obj, true);
    688696  ownobj= true;
    689697}
  • trunk/SophyaLib/Samba/spherethetaphi.h

    r565 r574  
    3232*/
    3333SphereThetaPhi(int m);
    34 SphereThetaPhi(const SphereThetaPhi<T>& s);
     34SphereThetaPhi(const SphereThetaPhi<T>& s, bool share=false);
    3535virtual ~SphereThetaPhi();
    3636
     
    5656/*!   Return (theta,phi) coordinates of middle of  pixel with  index k */
    5757virtual void PixThetaPhi(int k, double& theta, double& phi) const;
     58
     59/*! Setting pixel values to a constant */
     60virtual T SetPixels(T v);
    5861
    5962/* retourne/fixe l'angle Solide de Pixel   (steradians) */
Note: See TracChangeset for help on using the changeset viewer.