Changeset 2237 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Oct 30, 2002, 12:54:57 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto2d.cc
r2234 r2237 268 268 269 269 // gestion Couleurs. 270 PIColors fgcoul = GetGraphicAtt().GetFgColor(); 271 PIColors bgcoul = GetGraphicAtt().GetBgColor(); 270 272 PIColorMap* cmap=NULL; 271 PIColors coul = g->GetForeground();272 273 int ncol = 0; 273 274 if (mFgCol) { … … 280 281 // gestion epaisseur de ligne 281 282 PILineAtt LineAtt = GetGraphicAtt().GetLineAtt(); 282 if(LineAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine);283 if(LineAtt == PI_NotDefLineAtt) GetGraphicAtt().SetLineAtt(PI_ThinLine); 283 284 284 285 // gestion Markers ou plot avec des points. 285 PIMarker Mk = g->GetMarker();286 int MkSz = g->GetMarkerSize();286 PIMarker Mk = GetGraphicAtt().GetMarker(); 287 int MkSz = GetGraphicAtt().GetMarkerSize(); 287 288 int npt = 1; 288 289 if(mTypDisp==1) { … … 292 293 293 294 // gestion Font. 294 PIFontAtt FontAtt = g->GetFont().GetFontAtt();295 int FontSize = g->GetFont().GetFontSize();295 PIFontAtt FontAtt = GetGraphicAtt().GetFontAtt(); 296 int FontSize = GetGraphicAtt().GetFontSzPt(); 296 297 if(mTypDisp==2) { 297 298 double dxg,dyg,dg; … … 299 300 dg =(dxg<dyg) ? dxg : dyg; 300 301 int npix = (int) (dg*0.9); if(npix<8) npix = 8; 301 //printf("PIHisto2D::Draw_Font H dx=%g dy=%g, G dx=%g dy=%g, npix = %g,%d\n" 302 // ,dx,dy,dxg,dyg,dg,npix); 303 g->SelFontSzPt(npix,PI_RomanFont); 302 g->SelFontSzPt(npix,FontAtt); 304 303 fracmin = 0; 305 304 } 306 307 // Print();308 305 309 306 // Plot de l'histogramme … … 358 355 double x = left0 + dx/2.; 359 356 double y = bottom0 + dy/2.; 360 g->DrawString(x,y,c );357 g->DrawString(x,y,c,PI_HorizontalCenter|PI_VerticalCenter); 361 358 } else if(mTypDisp==3) { 362 359 //..... carres de tailles fixes (avec gestion de continuite) … … 368 365 369 366 // Remise dans les conditions ulterieures pour la suite du graphique. 370 g->SelMarker(MkSz,Mk);371 g->SelForeground(coul);367 GetGraphicAtt().SetMarkerAtt(MkSz,Mk); 368 GetGraphicAtt().SetColAtt(fgcoul,bgcoul); 372 369 g->SelFontSzPt(FontSize,FontAtt); 373 g->SelLine(LineAtt);370 GetGraphicAtt().SetLineAtt(LineAtt); 374 371 if (cmap) delete cmap; 375 372 … … 497 494 //-- 498 495 { 496 // Decodage des options generales pidrawer 499 497 int optsz1 = opt.size(); 500 498 if(optsz1<1) return(0); … … 502 500 if(optsz1-ndec1<1) return(ndec1); // si tout a ete decode 503 501 502 // Options generales pidrawer interessant le display Histo2D 503 bool rev; 504 if(GetGraphicAtt().GetColMapId(rev) != CMAP_OTHER) { 505 UseColors(true,GetGraphicAtt().GetColMapId(),rev); 506 } else UseColors(false); 507 508 // Decodage des options propres au display Histo2D 504 509 vector<string> udopt; // On gardera ici les options non decodees 505 510 unsigned int k = 0; … … 543 548 if(q<opts.length()-1) sscanf(opts.substr(q+1).c_str(),"%g",&fmax); 544 549 UseFrac(fmin,fmax); 545 } else if(opts.substr(0,6)=="h2col=") {546 bool fcol=Color(); CMapId cmid=ColMap(); bool rmap=IsColMapRev();547 if(opts.find(",rev")<opts.length()-1) rmap=true;548 if(opts.find(",nor")<opts.length()-1) rmap=false;549 for(int k=0; k<PIColorMap::NumberStandardColorMaps(); k++) {550 string cn=PIColorMap::GetStandardColorMapName(k);551 for(unsigned int j=0; j<cn.length(); j++) cn[j]=tolower(cn[j]);552 if(opts.find(cn)<opts.length()-1)553 {fcol=true; cmid=PIColorMap::GetStandardColorMapId(k); break;}554 }555 UseColors(fcol,cmid,rmap);556 550 } else { 557 551 ndec--; … … 560 554 } 561 555 } 556 562 557 // S'il faut supprimer les options decodees, on remplace l'argument opt 563 558 // par le vecteur des options non decodees. 564 559 if (rmdecopt) opt = udopt; 560 565 561 // Liste des options si demande 566 562 if(listopt) Print(); 563 567 564 return(ndec+ndec1); 568 565 } … … 589 586 info += "- h2scale=lin/log[,logscale]: choose linear or logarithmic scale\n"; 590 587 info += "- h2dyn=[hmin][,hmax]: choose histogramme range for display\n"; 591 info += "- h2col=[colname][,colsigne] : color table\n"; 592 info += " colname: name of color table (ex: grey32,midas_heat,...)\n"; 593 info += " (see general graphicatt description)\n"; 594 info += " colsigne: reverse (\"rev\") or normal (\"nor\") color table\n"; 588 info += "- use general key to define color table (ex: grey32,midas_heat,...)\n"; 589 info += " (see general graphicatt description)\n"; 590 info += "- use key \"revcmap\" to reverse color table\n"; 595 591 info += "- h2frac=[fmin][,fmax]: choose sub-range display [0,1]\n"; 596 592 return; … … 830 826 if(dbg) printf("H2WinArg::Show() mH2DDrw=%p\n",mH2DDrw); 831 827 // Pour recuperer les valeurs du Drawer sur lequel on fait ALT-O 832 /*833 if(mH2DDrw) {834 mFgCol = mH2DDrw->Color();835 mCmap = mH2DDrw->ColMap(); mRevCmap = mH2DDrw->IsColMapRev();836 mTypScal = mH2DDrw->TypScale(); mLogScale = mH2DDrw->LogScale();837 mTypDisp = mH2DDrw->TypDisplay(); mFPoints = mH2DDrw->FPoints();838 mHMin = mH2DDrw->HMin(); mHMax = mH2DDrw->HMax();839 mFracMin = mH2DDrw->FMin(); mFracMax = mH2DDrw->FMax();840 SetText();841 }842 */843 828 PIWindow::Show(); 844 829 return;
Note:
See TracChangeset
for help on using the changeset viewer.