- Timestamp:
- Nov 4, 1999, 5:20:32 PM (26 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r546 r548 75 75 mImgApp->SetXYLimits(xmin, xmax, ymin, ymax); 76 76 } 77 else if (kw == "setinsetlimits") { 78 if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl; return(0); } 79 double xmin = atof(tokens[0].c_str()); 80 double xmax = atof(tokens[1].c_str()); 81 double ymin = atof(tokens[2].c_str()); 82 double ymax = atof(tokens[3].c_str()); 83 mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax); 84 } 77 85 else if (kw == "addtext") { 78 86 if (tokens.size() < 4) { cout << "Usage: addtext x y colfontatt txt" << endl; return(0); } … … 663 671 664 672 kw = "graphic_att"; 665 usage = "To change default graphic options \n Usage: gra tt att_list \n";673 usage = "To change default graphic options \n Usage: graphic_att att_list \n"; 666 674 usage += "att_list=def back to default values, Example: gratt red,circlemarker5"; 667 675 usage += "\n ------------------ Graphic attribute list ------------------ \n"; … … 686 694 usage += ">> XYLimits : xylimits -> Forces X-Y limits in 2-D plots \n"; 687 695 usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n"; 688 usage += ">> DisplayWindow: next same win stack \n";689 usage += " Related commands: setxylimits ";696 usage += ">> DisplayWindow: next same win stack inset \n"; 697 usage += " Related commands: setxylimits setinsetlimits"; 690 698 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 691 699 692 700 kw = "setxylimits"; 693 701 usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax"; 694 usage += "\n Related commands: gratt"; 702 usage += "\n Related commands: graphic_att"; 703 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 704 705 kw = "setinsetlimits"; 706 usage = "Define the display rectangle for drawers added as insets \n"; 707 usage += " over existing graphic objects - limits expressed as fraction \n"; 708 usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. "; 709 usage += " Usage: setinsetlimits xmin xmax ymin ymax"; 710 usage += "\n Related commands: graphic_att"; 695 711 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 696 712 … … 699 715 usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification"; 700 716 usage += "\n Usage: addtext x y ColFontAtt TextString"; 701 usage += "\n Related commands: gra tt";717 usage += "\n Related commands: graphic_att"; 702 718 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 703 719 … … 1101 1117 usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n"; 1102 1118 usage += " be activated using the StackTools menu (Blink) \n"; 1103 usage += "o Most objects can be also be displayed, overlayed on the last displayed widget (gr_att= same) \n"; 1104 usage += "\n Related commands: newwin zone stacknext gratt"; 1119 usage += "o Most objects can be also be displayed overlayed \n"; 1120 usage += " on the last displayed widget (gr_att= same) \n"; 1121 usage += "o The overlay can be on a selected rectangle of the \n"; 1122 usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n"; 1123 usage += "\n Related commands: newwin zone stacknext graphic_att setinsetlimits"; 1105 1124 piac->RegisterHelp(kw, usage, grp); 1106 1125 -
trunk/SophyaPI/PIext/pihisto.cc
r544 r548 65 65 if(hmax<=hmin) hmax += 1.; 66 66 SetLimits(mHisto->XMin(), mHisto->XMax(), hmin, hmax); 67 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 67 // SetAxesFlags(kBoxAxes | kExtTicks | kLabels); NE PAS faire Reza 11/99 68 68 } 69 69 … … 71 71 PIHisto::Draw(PIGraphicUC* g, double /*xmin*/, double /*ymin*/, double /*xmax*/, double /*ymax*/) 72 72 { 73 if (axesFlags != kAxesNone) DrawAxes(g); 74 73 75 bool oktrace = false; 74 76 if (!mHisto) return; … … 138 140 PIGrCoord a, d; 139 141 double cH = (double)g->GetFontHeight(a,d); 140 double cellHeight = cH * 3. 8;142 double cellHeight = cH * 3.6; 141 143 // double cellWidth = (XMax() - XMin()) * 0.23; 142 144 char label[50]; 143 sprintf(label, "N= %.8g ", mHisto->NData()); 144 label[11] ='\0'; 145 sprintf(label, "N= %8g ", mHisto->NData()); label[11] ='\0'; 145 146 double cellWidth = (double)g->CalcStringWidth(label) * 1.1; 146 g->DrawLine(XMax() - cellWidth, YMax(), 147 XMax() - cellWidth, YMax() - cellHeight); 148 g->DrawLine(XMax() - cellWidth, YMax() - cellHeight, 149 XMax() , YMax() - cellHeight); 150 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*1.2, label); 151 sprintf(label, "m= %.8g", mHisto->Mean()); 152 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*2.4, label); 153 sprintf(label, "s= %.8g", mHisto->Sigma()); 154 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*3.6, label); 147 double xu, yu; 148 xu = g->DeltaUCX(XMax(), - cellWidth); 149 yu = g->DeltaUCY(YMax(), - cellHeight); 150 g->DrawLine(xu, YMax(), xu, yu); 151 g->DrawLine(xu, yu, XMax(), yu); 152 xu = g->DeltaUCX(XMax(), - cellWidth*0.95); 153 yu = g->DeltaUCY(YMax(), - cH*1.15); 154 g->DrawString(xu, yu, label); 155 sprintf(label, "m= %8g", mHisto->Mean()); label[11] ='\0'; 156 yu = g->DeltaUCY(YMax(), - cH*2.3); 157 g->DrawString(xu, yu, label); 158 sprintf(label, "s= %8g", mHisto->Sigma()); label[11] ='\0'; 159 yu = g->DeltaUCY(YMax(), - cH*3.45); 160 g->DrawString(xu, yu, label); 155 161 156 162 } -
trunk/SophyaPI/PIext/pihisto2d.cc
r544 r548 176 176 if(!mHisto) return; 177 177 SetLimits(mHisto->XMin(), mHisto->XMax(), mHisto->YMin() , mHisto->YMax()); 178 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 178 // SetAxesFlags(kBoxAxes | kExtTicks | kLabels); Ne pas faire - Reza 11/99 179 179 } 180 180 … … 193 193 //-- 194 194 { 195 196 if (axesFlags != kAxesNone) DrawAxes(g); 197 195 198 if(!mHisto) return; 196 199 // Caracteristiques histogramme -
trunk/SophyaPI/PIext/pintuple.cc
r544 r548 134 134 135 135 SetLimits(xmin-dx, xmax+dx, ymin-dy, ymax+dy); 136 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 136 // SetAxesFlags(kBoxAxes | kExtTicks | kLabels); Ne pas faire - Reza 11/99 137 137 } 138 138 … … 146 146 147 147 if (!mNT) return; 148 if (axesFlags != kAxesNone) DrawAxes(g); 148 149 if ( (xK < 0) || (yK < 0) ) return; 149 150 if (mLAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine); … … 201 202 PIGrCoord a,d; 202 203 double cH = (double)g->GetFontHeight(a,d); 203 double cellHeight = cH * 1. 4;204 double cellHeight = cH * 1.3; 204 205 double cellWidth = (double)g->CalcStringWidth(label) * 1.1; 205 g->DrawLine(XMax() - cellWidth, YMax(), 206 XMax() - cellWidth, YMax() - cellHeight); 207 g->DrawLine(XMax() - cellWidth, YMax() - cellHeight, 208 XMax() , YMax() - cellHeight); 209 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*1.2, label); 206 double xu, yu; 207 xu = g->DeltaUCX(XMax(), - cellWidth); 208 yu = g->DeltaUCY(YMax(), - cellHeight); 209 g->DrawLine(xu, YMax(), xu, yu); 210 g->DrawLine(xu, yu, XMax(), yu); 211 xu = g->DeltaUCX(XMax(), - cellWidth*0.95); 212 yu = g->DeltaUCY(YMax(), - cH*1.15); 213 g->DrawString(xu, yu, label); 210 214 } 211 215 -
trunk/SophyaPI/PIext/pistdimgapp.cc
r506 r548 201 201 mZoom = 0; 202 202 mAxesFlags = kBoxAxes | kExtTicks | kLabels; 203 mXmin = mYmin = -1.;204 mXmax = mYmax = 1;203 SetXYLimits(-1, 1., -1., 1.); 204 SetInsetLimits(0.4, 0.6, 0.4, 0.6); 205 205 maXlog = maYlog = false; 206 206 SaveGraphicAtt(); … … 463 463 if ( mCmapid != CMAP_OTHER ) scd->SetColMapId(mCmapid); 464 464 465 if ( (opt == Disp_Same) && (mLastWdg) ) { 465 466 if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) ) opt = Disp_Next; 467 // Trace en superpoistion 468 if ( (opt == Disp_Same) && (mLastWdg) ) { 466 469 if (mLastWdg->kind() == PIScDrawWdg::ClassId) ((PIScDrawWdg*)mLastWdg)->AddScDrawer(scd, true); 467 470 else mLastWdg->AddDrawer(scd, true, true, true); 471 scd->Refresh(); 472 mDId++; 473 mDrwList[mDId] = scd; 474 return(-mDId); 475 } 476 // Trace en medaillon 477 else if ( (opt == Disp_Inset) && (mLastWdg) ) { 478 PIGrCoord x1, x2, y1, y2; 479 x1 = mIXmin; x2 = mIXmax; 480 y2 = 1.-mIYmin; y1 = 1.-mIYmax; 481 scd->SetAxesFlags(mAxesFlags); 482 scd->UpdateLimits(); 483 mLastWdg->AddDrawer(scd, x1, y1, x2, y2, true, false, true); 468 484 scd->Refresh(); 469 485 mDId++; … … 471 487 return(-mDId); 472 488 } 473 else if (opt == Disp_Same) opt = Disp_Next;474 489 475 490 PIWindow* win; … … 519 534 if ( mCmapid != CMAP_OTHER ) dr3->SetColMapId(mCmapid); 520 535 536 if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) ) opt = Disp_Next; 537 // Trace en superpoistion 521 538 if ( (opt == Disp_Same) && (mLastWdg) ) { 522 539 if (mLastWdg->kind() == PIDraw3DWdg::ClassId) ((PIDraw3DWdg*)mLastWdg)->AddDrawer3D(dr3, true); … … 527 544 return(-mDId); 528 545 } 529 else if (opt == Disp_Same) opt = Disp_Next; 546 // Trace en medaillon 547 else if ( (opt == Disp_Inset) && (mLastWdg) ) { 548 PIGrCoord x1, x2, y1, y2; 549 x1 = mIXmin; x2 = mIXmax; 550 y2 = 1.-mIYmin; y1 = 1.-mIYmax; 551 dr3->SetAxesFlags(mAxesFlags); 552 dr3->UpdateLimits(); 553 mLastWdg->AddDrawer(dr3, x1, y1, x2, y2, true, false, true); 554 dr3->Refresh(); 555 mDId++; 556 mDrwList[mDId] = dr3; 557 return(-mDId); 558 } 559 530 560 531 561 PIWindow* win; … … 1294 1324 1295 1325 /* --Methode-- */ 1326 void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax) 1327 { 1328 mIXmin = xmin; mIXmax= xmax; 1329 mIYmin = ymin; mIYmax= ymax; 1330 } 1331 1332 /* --Methode-- */ 1296 1333 void PIStdImgApp::SaveGraphicAtt() 1297 1334 { … … 1308 1345 mSXmin = mXmin; mSXmax = mXmax; 1309 1346 mSYmin = mYmin; mSYmax = mYmax; 1347 mSIXmin = mIXmin; mSIXmax = mIXmax; 1348 mSIYmin = mIYmin; mSIYmax = mIYmax; 1310 1349 mSFXYlim = mFXYlim; 1311 1350 mSaXlog = maXlog; … … 1328 1367 mXmin = mSXmin; mXmax = mSXmax; 1329 1368 mYmin = mSYmin; mYmax = mSYmax; 1369 mIXmin = mSIXmin; mIXmax = mSIXmax; 1370 mIYmin = mSIYmin; mIYmax = mSIYmax; 1330 1371 mFXYlim = mSFXYlim; 1331 1372 maXlog = mSaXlog; -
trunk/SophyaPI/PIext/pistdimgapp.h
r506 r548 31 31 32 32 33 enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3 };33 enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3, Disp_Inset=4}; 34 34 35 35 typedef map<long, PIWindow*, less<long> > WindMList; … … 101 101 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels); 102 102 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.); 103 void SetInsetLimits(double xmin=0.4, double xmax=0.6, double ymin=0.4, double ymax=0.6); 103 104 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; } 104 105 inline void SetXLogScale(bool logx=false) { maXlog = logx; } … … 171 172 double mXmin, mXmax, mYmin, mYmax; 172 173 double mSXmin, mSXmax, mSYmin, mSYmax; 174 double mIXmin, mIXmax, mIYmin, mIYmax; 175 double mSIXmin, mSIXmax, mSIYmin, mSIYmax; 173 176 bool mFXYlim, mSFXYlim; 174 177 bool maXlog, mSaXlog; -
trunk/SophyaPI/PIext/servnobjm.cc
r546 r548 1314 1314 if ( (grt[k] == "win") || (grt[k] == "w") ) ropt = Disp_Win; 1315 1315 else if ( (grt[k] == "same") || (grt[k] == "s") ) ropt = Disp_Same; 1316 else if ( (grt[k] == "inset") || (grt[k] == "ins") ) ropt = Disp_Inset; 1316 1317 else if ( (grt[k] == "stack") || (grt[k] == "st") ) ropt = Disp_Stack; 1317 1318 else fgcont = false;
Note:
See TracChangeset
for help on using the changeset viewer.