Changeset 333 in Sophya for trunk/SophyaPI/PIext/pintuple.cc


Ignore:
Timestamp:
Jul 12, 1999, 1:12:29 PM (26 years ago)
Author:
ercodmgr
Message:

Trace de NTuple en 2D avec Marker de taille proportionnelle a Weight
Introduction des repertoires dans la gestion d'objets NameObjMgr
Reorganisation NamedObjMgr et Services2NObjMgr, ajout de commandes , ...
Reza 12/7/99

File:
1 edited

Legend:

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

    r326 r333  
    2727if (py == NULL) yK = -1;
    2828else { name = py; yK = mNT->ColumnIndex(name); }
     29}
     30
     31/* --Methode-- */
     32void  PINTuple::SelectWt(const char* pw, int nbins)
     33{
     34nWbins = (nbins > 0) ? nbins : 10;
     35if (pw == NULL) wK = -1; 
     36else { string name = pw;   wK = mNT->ColumnIndex(name);  }
     37 
     38if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax);
     39else  { wMin = 0.; wMax = 1.; }
    2940}
    3041
     
    6778void PINTuple::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    6879{
    69 double xp,yp,xer,yer;
     80double xp,yp,xer,yer,wp;
    7081double xl,yl;
    7182int nok;
     
    7485if ( (xK < 0) || (yK < 0) )  return;
    7586if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
     87
     88//  Pour tracer des markers avec taille fonction de Wt (poids)
     89double dw = (wMax-wMin)/nWbins;
     90if (dw < 1.e-19) dw = 1.e19;
     91int msz,sz;
     92
     93PIMarker mrk;
     94if (wK >= 0)  mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_CircleMarker;
     95else   mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_DotMarker;
     96msz = mMSz;
     97if (msz < 1) msz = 1;
     98g->SelMarker(sz, mrk);
    7699
    77100nok = 0; 
     
    93116    if(yer>0.) g->DrawLine(xp, yp-yer, xp, yp+yer);
    94117  }
     118  if (wK >= 0) { // Taille de marker en fonction du poids
     119    wp = mNT->GetCell(i, wK);
     120    sz = (int)((wp-wMin)/dw);
     121    if (sz < 0) sz = 0;
     122    if (sz > nWbins)  sz = nWbins;
     123    sz += msz;
     124    if (sz < 2)  g->SelMarker(sz, PI_DotMarker);
     125    else g->SelMarker(sz, mrk);
     126  }
    95127  g->DrawMarker(xp, yp);
    96128}
Note: See TracChangeset for help on using the changeset viewer.