Changeset 205 in Sophya


Ignore:
Timestamp:
Mar 1, 1999, 6:05:59 PM (27 years ago)
Author:
ercodmgr
Message:

1/ Adaptation pour passage en double de trace en coordonnees graphiques
User (UC) (float -> double)
2/ Adaptation pour passage en double pour les ArrayAdapter

Reza 1/03/99

Location:
trunk/SophyaPI/PIext
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pigfd1.cc

    r165 r205  
    4747dx = 0.02*(xmax-xmin);
    4848dy = 0.02*(ymax-ymin);
    49 SetLimits((float)xmin-dx,(float)xmax+dx,(float)ymin-dy,(float)ymax+dy);
     49SetLimits((double)xmin-dx,(double)xmax+dx,(double)ymin-dy,(double)ymax+dy);
    5050SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
    5151}
    5252
    5353/* --Methode-- */
    54 void PIGenFitDat::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
     54void PIGenFitDat::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    5555{
    5656if (!mGFD) return;
     
    5959// On plotte les barre d'erreurs ligne demandee explicitement
    6060if(mLAtt!=PI_NotDefLineAtt) SelectErrBar(true,true);
    61 float xp,yp,er;
     61double xp,yp,er;
    6262for (int i=0; i<mGFD->NData(); i++) {
    6363  xp = mGFD->Absc(VarX,i);
  • trunk/SophyaPI/PIext/pigfd1.h

    r165 r205  
    1010  virtual           ~PIGenFitDat();
    1111 
    12   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     12  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    1313  virtual void       UpdateLimits();
    1414 
  • trunk/SophyaPI/PIext/pigfd2.cc

    r185 r205  
    4848if(zmax<=zmin) zmax = zmin+1.;
    4949// Voir commentaires pintuple3d.cc
    50 float D = xmax-xmin;
     50double D = xmax-xmin;
    5151if (D < (ymax-ymin))  D = ymax-ymin;
    5252D *= 1.4;
     
    6161
    6262/* --Methode-- */
    63 void PIGenFitDat3D::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
     63void PIGenFitDat3D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    6464{
    6565// On trace les axes - En attendant de faire mieux - Reza 8/12/98
     
    8181if (mLAtt == PI_NotDefLineAtt)  g3->SelLine(PI_ThinLine);
    8282
    83 float xp,yp,zp,er;
     83double xp,yp,zp,er;
    8484for (int i=0; i<mGFD->NData(); i++) {
    8585  xp = mGFD->Absc(VarX,i);
  • trunk/SophyaPI/PIext/pigfd2.h

    r165 r205  
    1010  virtual           ~PIGenFitDat3D();
    1111 
    12   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     12  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    1313  virtual void       UpdateLimits();
    1414 
  • trunk/SophyaPI/PIext/pihisto.cc

    r203 r205  
    3838
    3939void
    40 PIHisto::Draw(PIGraphicUC* g, float /*xmin*/, float /*ymin*/, float /*xmax*/, float /*ymax*/)
     40PIHisto::Draw(PIGraphicUC* g, double /*xmin*/, double /*ymin*/, double /*xmax*/, double /*ymax*/)
    4141{
    4242  bool oktrace = false;
     
    4646    // Marqeurs definis OU HBProf => marqueurs+Erreurs si il y en a
    4747    if (mLAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine);
    48     float x1,y1, x2,y2;
    49     float bw = mHisto->BinWidth();
     48    double x1,y1, x2,y2;
     49    double bw = mHisto->BinWidth();
    5050    for (int i=0; i<mHisto->NBins(); i++) {
    5151      if(mHisto->Error(i)>0.) {
     
    6868  }
    6969  if (mLAtt != PI_NotDefLineAtt) {
    70     float x1,y1, x2, y2;
     70    double x1,y1, x2, y2;
    7171    x1 = mHisto->BinLowEdge(0);
    7272    y1 = 0;
     
    8585  if( !oktrace ) {
    8686    for(int i=0; i<mHisto->NBins(); i++) {
    87       float left   = mHisto->BinLowEdge(i);
    88       float width  = mHisto->BinWidth();
    89       float bottom = 0;
    90       float height = (*mHisto)(i);
     87      double left   = mHisto->BinLowEdge(i);
     88      double width  = mHisto->BinWidth();
     89      double bottom = 0;
     90      double height = (*mHisto)(i);
    9191      g->DrawFBox(left,bottom,width,height);
    9292      g->DrawLine(left, bottom, left, bottom + height); // Au moins une ligne...
     
    103103  //  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    104104  g->SelLine(PI_ThinLine);
    105   float cellHeight = (YMax() - YMin()) * 0.05;
    106   float cellWidth  = (XMax() - XMin()) * 0.23;
     105  double cellHeight = (YMax() - YMin()) * 0.05;
     106  double cellWidth  = (XMax() - XMin()) * 0.23;
    107107  g->DrawLine(XMax() - cellWidth, YMax(),
    108108                       XMax() - cellWidth, YMax() - cellHeight);
  • trunk/SophyaPI/PIext/pihisto.h

    r165 r205  
    99                     PIHisto(Histo* histo, bool ad=false);
    1010  virtual           ~PIHisto();
    11   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     11  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    1212  virtual void       UpdateLimits();
    1313  virtual void       DrawStats(PIGraphicUC* g);
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r165 r205  
    157157
    158158//++
    159 void PIHisto2D::Draw(PIGraphicUC* g,float,float, float, float)
     159void PIHisto2D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    160160//
    161161//      Dessin de l'histogramme.
     
    164164if(!mHisto) return;
    165165// Caracteristiques histogramme
    166 float dx = mHisto->WBinX(),dy = mHisto->WBinY();
    167 float p1dx,p1dy;
     166double dx = mHisto->WBinX(),dy = mHisto->WBinY();
     167double p1dx,p1dy;
    168168g->DGrC2UC(1.f,1.f,p1dx,p1dy);
    169169
     
    197197int FontSize = g->GetFontSize();
    198198if(mTypDisp==2) {
    199   float dxg,dyg,dg;
     199  double dxg,dyg,dg;
    200200  g->DUC2GrC(dx,dy,dxg,dyg);
    201201  dg =(dxg<dyg) ? dxg : dyg;
     
    235235  }
    236236
     237// Pour ne pas dessiner en dehors des axes
     238  if ( (left0+dx/2. < xmin) || (left0+dx/2. > xmax) ||
     239         (bottom0+dy/2. < ymin) || (bottom0+dy/2. > ymax) ) continue;
     240
    237241  // Dessin proprement dit selon le choix graphique.
    238242  if(mTypDisp==0) {
    239243    //..... carres de tailles variables
    240     float left   = left0   + 0.5*(1.-fracred)*dx, width  = fracred*dx;
    241     float bottom = bottom0 + 0.5*(1.-fracred)*dy, height = fracred*dy;
     244    double left   = left0   + 0.5*(1.-fracred)*dx, width  = fracred*dx;
     245    double bottom = bottom0 + 0.5*(1.-fracred)*dy, height = fracred*dy;
    242246    if (cmap) g->DrawFBox(left,bottom,width,height);
    243247    else      g->DrawBox(left,bottom,width,height);
     
    246250    int ipt  = int( (float) npt *frac );
    247251    for(int k=0;k<ipt;k++) {
    248       float x = left0 + frand01()*dx;
    249       float y = bottom0 + frand01()*dy;
     252      double x = left0 + frand01()*dx;
     253      double y = bottom0 + frand01()*dy;
    250254      g->DrawMarker(x,y);
    251255    }
     
    254258    char c[2];
    255259    c[0] = HPrint2(frac); c[1]='\0';
    256     float x = left0 + dx/2.;
    257     float y = bottom0 + dy/2.;
     260    double x = left0 + dx/2.;
     261    double y = bottom0 + dy/2.;
    258262    g->DrawString(x,y,c);
    259263  } else if(mTypDisp==3) {
     
    283287  // Une boite dans le coin superieur droit
    284288  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    285   float cellHeight = (YMax() - YMin()) * 0.05;
    286   float cellWidth  = (XMax() - XMin()) * 0.23;
     289  double cellHeight = (YMax() - YMin()) * 0.05;
     290  double cellWidth  = (XMax() - XMin()) * 0.23;
    287291  g->DrawLine(XMax() - cellWidth, YMax(),
    288292                       XMax() - cellWidth, YMax() - cellHeight);
     
    331335//--
    332336{
    333 float dx = mHisto->WBinX(),dy = mHisto->WBinY();
    334 float dxg,dyg;
     337double dx = mHisto->WBinX(),dy = mHisto->WBinY();
     338double dxg,dyg;
    335339g->DUC2GrC(dx,dy,dxg,dyg);
    336340int np = (int) dxg * (int) dyg;
     
    413417
    414418//++
    415 string  PIH2DWdg::GetClickText(float x, float y)
     419string  PIH2DWdg::GetClickText(double x, double y)
    416420//
    417421//      Quand on click (and drag) le bouton-1, affichage
  • trunk/SophyaPI/PIext/pihisto2d.h

    r165 r205  
    2121          void       UseFrac(float frmin=0.1, float frmax=0.9);
    2222          void       Print(int lp=0);
    23   virtual void       Draw(PIGraphicUC* g,float xmin,float ymin,float xmax,float ymax);
     23  virtual void       Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
    2424  virtual void       UpdateLimits();
    2525  virtual void       DrawStats(PIGraphicUC* g);
     
    6464  inline PIHisto2D*  GetPIHisto() {return mPih;}
    6565
    66   virtual string     GetClickText(float x, float y);
     66  virtual string     GetClickText(double x, double y);
    6767  virtual void       But3Press(int x, int y);
    6868
  • trunk/SophyaPI/PIext/pimgadapter.h

    r165 r205  
    1212
    1313  virtual         ~RzImageAdapter() { if (aDel) delete mImg; }
    14   virtual float   Value(int ix, int iy) { return mImg->FValue(ix, iy); }
     14  virtual double  Value(int ix, int iy) { return mImg->FValue(ix, iy); }
    1515
    1616protected :
     
    2727
    2828  virtual         ~ImageAdapter() { if (aDel) delete mImg; }
    29   virtual float   Value(int ix, int iy) { return((*mImg)(ix, iy)); }
     29  virtual double  Value(int ix, int iy) { return((*mImg)(ix, iy)); }
    3030
    3131protected :
  • trunk/SophyaPI/PIext/pintup3d.cc

    r185 r205  
    6262// Distance D = Max(xmax-xmin,ymin-ymax)*2
    6363// Observateur en O = X+D, Yc+2*D
    64   float D = xmax-xmin;
     64  double D = xmax-xmin;
    6565  if (D < (ymax-ymin))  D = ymax-ymin;
    6666  D *= 1.4;
     
    8484
    8585/* --Methode-- */
    86 void PINTuple3D::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
     86void PINTuple3D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    8787{
    88 float xp,yp,zp,xer,yer,zer;
     88double xp,yp,zp,xer,yer,zer;
    8989int nok;
    9090
  • trunk/SophyaPI/PIext/pintup3d.h

    r165 r205  
    1010  virtual           ~PINTuple3D();
    1111 
    12   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     12  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    1313  virtual void       UpdateLimits();
    1414 
  • trunk/SophyaPI/PIext/pintuple.cc

    r165 r205  
    6363
    6464/* --Methode-- */
    65 void PINTuple::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
     65void PINTuple::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    6666{
    67 float xp,yp,xer,yer;
     67double xp,yp,xer,yer;
    6868int nok;
    6969
  • trunk/SophyaPI/PIext/pintuple.h

    r165 r205  
    1010  virtual           ~PINTuple();
    1111 
    12   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     12  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    1313  virtual void       UpdateLimits();
    1414 
  • trunk/SophyaPI/PIext/pipodrw.cc

    r165 r205  
    3131
    3232void
    33 PIGFFDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
     33PIGFFDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double/*ymin*/, double/*xmax*/, double/*ymax*/)
    3434{
    3535  PIGrCoord x1, x2, y1, y2;
    3636  g->GetGrSpace(x1, x2, y1, y2);
    37   float xMax = x2;
    38   float xMin = x1;
    39   float yMax = y2;
    40   float yMin = y1;
    41   float xStep = (xMax - xMin)/100;
    42   float xOld = xMin;
    43   float yOld = 0;
    44 //  float yOld = f->Value(&xMin, mParms);
    45   for (float x = xMin+xStep; x<xMax; x+=xStep) {
    46    float y = 0; // $CHECK$
    47 //    float y = f->Value(&x, mParms);
     37  double xMax = x2;
     38  double xMin = x1;
     39  double yMax = y2;
     40  double yMin = y1;
     41  double xStep = (xMax - xMin)/100;
     42  double xOld = xMin;
     43  double yOld = 0;
     44//  double yOld = f->Value(&xMin, mParms);
     45  for (double x = xMin+xStep; x<xMax; x+=xStep) {
     46   double y = 0; // $CHECK$
     47//    double y = f->Value(&x, mParms);
    4848    if (y>yMin && yOld>yMin &&
    4949        y<yMax && yOld<yMax)
     
    7272
    7373/* --Methode-- */
    74 float POVectorAdapter::Value(int i)
     74double POVectorAdapter::Value(int i)
    7575{
    7676return((*mVec)(i));
     
    9696
    9797/* --Methode-- */
    98 float POH2DAdapter::Value(int ix, int iy)
     98double POH2DAdapter::Value(int ix, int iy)
    9999{
    100100return((*mH2d)(ix, iy));
     
    120120
    121121/* --Methode-- */
    122 float POMatrixAdapter::Value(int ix, int iy)
     122double POMatrixAdapter::Value(int ix, int iy)
    123123{
    124124// Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col) 
  • trunk/SophyaPI/PIext/pipodrw.h

    r165 r205  
    2020  virtual           ~PIGFFDrawer();
    2121 
    22   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     22  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    2323  virtual void       SetParms(double const*);
    2424protected:
     
    3434                  POVectorAdapter(Vector* v, bool ad=false);
    3535  virtual         ~POVectorAdapter();
    36   virtual float   Value(int i);
     36  virtual double  Value(int i);
    3737
    3838protected:
     
    4747  virtual         ~POH2DAdapter();
    4848
    49   virtual float   Value(int ix, int iy);   
     49  virtual double  Value(int ix, int iy);   
    5050
    5151protected:
     
    6161  virtual         ~POMatrixAdapter();
    6262
    63   virtual float   Value(int ix, int iy);   
     63  virtual double  Value(int ix, int iy);   
    6464
    6565protected:
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r203 r205  
    199199int i;
    200200
     201delete mc;
    201202for(i=0; i<6; i++) 
    202203  if (m[i]) delete m[i];
    203 delete mc;
    204204
    205205WindMList::iterator it;
  • trunk/SophyaPI/PIext/pistlist.cc

    r165 r205  
    4343
    4444  // Commencer par trouver nos limites
    45   float dx, dy;
     45  double dx, dy;
    4646  double x1, x2, y1, y2;
    4747  mStL->CalcXYLimits(x1, x2, y1, y2);
     
    5656
    5757/* --Methode-- */
    58 void PIStarList::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
     58void PIStarList::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    5959{
    6060BStar *sti;
    61 float xp,yp,flx;
     61double xp,yp;
     62float flx;
    6263int sz;
    6364char buff[128];
     
    8586  if (mDspFV) { 
    8687    sprintf(buff," F=%g", flx);
    87     float dx,dy;
     88    double dx,dy;
    8889    g->DGrC2UC(sz, 4, dx, dy);
    8990    g->DrawString(xp+dx, yp-dy, buff);
  • trunk/SophyaPI/PIext/pistlist.h

    r165 r205  
    1010  virtual           ~PIStarList();
    1111 
    12   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     12  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    1313  virtual void       UpdateLimits();
    1414 
Note: See TracChangeset for help on using the changeset viewer.