Changeset 2373 in Sophya for trunk/SophyaPI/PIext/pintup3d.cc
- Timestamp:
- Apr 25, 2003, 3:36:47 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pintup3d.cc
r2350 r2373 48 48 mNT = nt; 49 49 mAdDO = ad; 50 UseSizeScale(true, 5); 51 UseColorScale(true); 50 52 SelectXYZ(NULL, NULL, NULL); 51 SelectWt(NULL , 1);53 SelectWt(NULL); 52 54 SelectErrBar(); 53 55 SelectLabel(NULL); … … 91 93 92 94 /* --Methode-- */ 93 void PINTuple3D::SelectWt(const char* pw, int nbins) 94 { 95 nWbins = (nbins > 0) ? nbins : 10; 95 void PINTuple3D::SelectWt(const char* pw) 96 { 96 97 if (pw == NULL) wK = -1; 97 98 else { string name = pw; wK = mNT->ColumnIndex(name); } … … 189 190 // Pour tracer des markers avec taille fonction de Wt (poids) 190 191 double dw = (wMax-wMin)/nWbins; 191 if (dw < 1.e-19) dw = 1.e19; 192 if (dw < 1.e-19) dw = 1.e-19; 193 // Pour tracer des markers avec couleur en fonction de Wt (poids) 194 PIColorMap * cmap = NULL; 195 double dwc = 1.; 196 double nwc = 1.; 197 bool revcmap; 198 CMapId mcmapid = GetGraphicAtt().GetColMapId(revcmap); 199 if( colorScale && (wK >= 0) && (mcmapid != CMAP_OTHER) ) { 200 cmap = new PIColorMap(mcmapid); 201 cmap->ReverseColorIndex(revcmap); 202 nwc = cmap->NCol(); 203 dwc = (wMax-wMin)/nwc; 204 } 205 192 206 int msz,sz; 193 207 … … 207 221 yp = mNT->GetCell(i, yK); 208 222 zp = mNT->GetCell(i, zK); 223 224 // Taille - couleur de marker en fonction du poids 225 if (wK >= 0) wp = mNT->GetCell(i, wK); 226 if (mrkSzScale && (wK >= 0)) { // Changement de taille 227 sz = (int)((wp-wMin)/dw); 228 if (sz < 0) sz = 0; 229 if (sz > nWbins) sz = nWbins; 230 sz += msz; 231 if (sz < 2) g->SelMarker(sz, PI_DotMarker); 232 else g->SelMarker(sz, mrk); 233 } 234 // Couleur du marker en fonction du poids 235 if( colorScale && (wK >= 0) && cmap ) { 236 int cid = (int)((wp-wMin)/dwc); 237 if (cid < 0) cid = 0; 238 if (cid >= nwc) cid = nwc-1; 239 g->SelForeground(*cmap, cid); 240 } 241 209 242 if ( (i > 0) && connectPts ) // On relie les points ... 210 243 g3->DrawLine3D(xl, yl, zl, xp, yp, zp); … … 221 254 zer = mNT->GetCell(i, zebK); 222 255 g3->DrawLine3D(xp, yp, zp-zer, xp, yp, zp+zer); 223 }224 if (wK >= 0) { // Taille de marker en fonction du poids225 wp = mNT->GetCell(i, wK);226 sz = (int)((wp-wMin)/dw);227 if (sz < 0) sz = 0;228 if (sz > nWbins) sz = nWbins;229 sz += msz;230 if (sz < 2) g->SelMarker(sz, PI_DotMarker);231 else g->SelMarker(sz, mrk);232 256 } 233 257 // Trace du marker … … 271 295 if (opts == "connectpoints") ConnectPoints(true); 272 296 else if (opts == "noconnectpoints") ConnectPoints(false); 297 else if (opts == "colorscale") UseColorScale(true); 298 else if (opts == "nocolorscale") UseColorScale(false); 299 else if (opts == "sizescale") UseSizeScale(true); 300 else if (opts == "nosizescale") UseSizeScale(false); 301 else if (opts.substr(0,10) == "sizescale=") { 302 int nbn = atoi(opts.substr(10).c_str()); 303 UseSizeScale(true, nbn); 304 } 273 305 else { 274 306 // Si option non decode … … 298 330 info += " connectpoints: The points are connected by a line \n"; 299 331 info += " noconnectpoints (this is the default) \n"; 332 info += " colorscale/nocolorscale (Use color scale for weight) \n"; 333 info += " sizescale/sizescale=nbins/nosizescale (Use marker size for weight) \n"; 300 334 info += " and usual color/line/marker/... attribute decoding \n"; 301 335 return;
Note:
See TracChangeset
for help on using the changeset viewer.