Changeset 486 in Sophya for trunk/SophyaPI/PIext/pintup3d.cc


Ignore:
Timestamp:
Oct 21, 1999, 2:22:56 PM (26 years ago)
Author:
ercodmgr
Message:

Adapatation a NTupleInterface::GetCelltoString() et ajout trace Label ds PINTuple/3D et Wt ds PINtuple3D - Reza 21/10/99

File:
1 edited

Legend:

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

    r440 r486  
    1010  mAdDO = ad;
    1111  SelectXYZ(NULL, NULL, NULL);
     12  SelectWt(NULL, 1);
    1213  SelectErrBar();
     14  SelectLabel(NULL);
    1315}
    1416
     
    2931if (pz == NULL) zK = -1;
    3032else { name = pz; zK = mNT->ColumnIndex(name); }
     33}
     34
     35/* --Methode-- */
     36void  PINTuple3D::SelectWt(const char* pw, int nbins)
     37{
     38nWbins = (nbins > 0) ? nbins : 10;
     39if (pw == NULL) wK = -1; 
     40else { string name = pw;   wK = mNT->ColumnIndex(name);  }
     41 
     42if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax);
     43else  { wMin = 0.; wMax = 1.; }
     44}
     45
     46/* --Methode-- */
     47void  PINTuple3D::SelectLabel(const char* plabel)
     48{
     49if (plabel == NULL) lK = -1;
     50else {  string name = plabel;  lK = mNT->ColumnIndex(name);  }
    3151}
    3252
     
    88108void PINTuple3D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    89109{
    90 double xp,yp,zp,xer,yer,zer;
     110double xp,yp,zp,wp,xer,yer,zer;
    91111double xl,yl,zl;
    92112int nok;
     
    106126if (mLAtt == PI_NotDefLineAtt)  g3->SelLine(PI_ThinLine);
    107127
     128//  Pour tracer des markers avec taille fonction de Wt (poids)
     129double dw = (wMax-wMin)/nWbins;
     130if (dw < 1.e-19) dw = 1.e19;
     131int msz,sz;
     132
     133PIMarker mrk;
     134if (wK >= 0)  mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_CircleMarker;
     135else   mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_DotMarker;
     136msz = mMSz;
     137if (msz < 1) msz = 1;
     138g->SelMarker(msz, mrk);
     139
    108140nok = 0; 
    109141xp = yp = zp = xl = yl = zl = 0;
     
    116148    g3->DrawLine3D(xl, yl, zl, xp, yp, zp);
    117149  nok++;
    118   g3->DrawMarker3D(xp, yp, zp);
    119150  if ( xebK >= 0 ) {
    120151    xer = mNT->GetCell(i, xebK);
     
    129160    g3->DrawLine3D(xp, yp, zp-zer, xp, yp, zp+zer);
    130161  }
     162  if (wK >= 0) { // Taille de marker en fonction du poids
     163    wp = mNT->GetCell(i, wK);
     164    sz = (int)((wp-wMin)/dw);
     165    if (sz < 0) sz = 0;
     166    if (sz > nWbins)  sz = nWbins;
     167    sz += msz;
     168    if (sz < 2)  g->SelMarker(sz, PI_DotMarker);
     169    else g->SelMarker(sz, mrk);
     170  }
     171  // Trace du marker
     172  if ((wK >= 0)||(lK < 0)||(mMrk != PI_NotDefMarker))  g3->DrawMarker3D(xp, yp, zp);
     173  // Trace eventuel du label
     174  if (lK >= 0) g3->DrawString3D(xp, yp, zp, mNT->GetCelltoString(i, lK).c_str());
    131175}
    132176
Note: See TracChangeset for help on using the changeset viewer.