Changeset 333 in Sophya for trunk/SophyaPI/PIext/pintuple.cc
- Timestamp:
- Jul 12, 1999, 1:12:29 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pintuple.cc
r326 r333 27 27 if (py == NULL) yK = -1; 28 28 else { name = py; yK = mNT->ColumnIndex(name); } 29 } 30 31 /* --Methode-- */ 32 void PINTuple::SelectWt(const char* pw, int nbins) 33 { 34 nWbins = (nbins > 0) ? nbins : 10; 35 if (pw == NULL) wK = -1; 36 else { string name = pw; wK = mNT->ColumnIndex(name); } 37 38 if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax); 39 else { wMin = 0.; wMax = 1.; } 29 40 } 30 41 … … 67 78 void PINTuple::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax) 68 79 { 69 double xp,yp,xer,yer ;80 double xp,yp,xer,yer,wp; 70 81 double xl,yl; 71 82 int nok; … … 74 85 if ( (xK < 0) || (yK < 0) ) return; 75 86 if (mLAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine); 87 88 // Pour tracer des markers avec taille fonction de Wt (poids) 89 double dw = (wMax-wMin)/nWbins; 90 if (dw < 1.e-19) dw = 1.e19; 91 int msz,sz; 92 93 PIMarker mrk; 94 if (wK >= 0) mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_CircleMarker; 95 else mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_DotMarker; 96 msz = mMSz; 97 if (msz < 1) msz = 1; 98 g->SelMarker(sz, mrk); 76 99 77 100 nok = 0; … … 93 116 if(yer>0.) g->DrawLine(xp, yp-yer, xp, yp+yer); 94 117 } 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 } 95 127 g->DrawMarker(xp, yp); 96 128 }
Note:
See TracChangeset
for help on using the changeset viewer.