Changeset 548 in Sophya


Ignore:
Timestamp:
Nov 4, 1999, 5:20:32 PM (26 years ago)
Author:
ercodmgr
Message:

Ajout trace en medaillon - Reza 4/11/99

Location:
trunk/SophyaPI/PIext
Files:
7 edited

Legend:

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

    r546 r548  
    7575  mImgApp->SetXYLimits(xmin, xmax, ymin, ymax);
    7676  }
     77else 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  }
    7785else if (kw == "addtext") {
    7886  if (tokens.size() < 4) { cout << "Usage: addtext x y colfontatt txt" << endl;  return(0); }
     
    663671
    664672kw = "graphic_att";
    665 usage = "To change default graphic options \n  Usage: gratt att_list \n";
     673usage = "To change default graphic options \n  Usage: graphic_att att_list \n";
    666674usage += "att_list=def back to default values, Example: gratt red,circlemarker5";
    667675usage += "\n ------------------ Graphic attribute list ------------------ \n";
     
    686694usage += ">> XYLimits : xylimits  -> Forces X-Y limits in 2-D plots \n";
    687695usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
    688 usage += ">> DisplayWindow: next same win stack \n";
    689 usage += "   Related commands: setxylimits"; 
     696usage += ">> DisplayWindow: next same win stack inset \n";
     697usage += "   Related commands: setxylimits setinsetlimits"; 
    690698mpiac->RegisterCommand(kw, usage, this, "Graphics");
    691699
    692700kw = "setxylimits";
    693701usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax";
    694 usage += "\n  Related commands: gratt"; 
     702usage += "\n  Related commands: graphic_att"; 
     703mpiac->RegisterCommand(kw, usage, this, "Graphics");
     704
     705kw = "setinsetlimits";
     706usage = "Define the display rectangle for drawers added as insets \n";
     707usage += " over existing graphic objects - limits expressed as fraction \n"; 
     708usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
     709usage += " Usage: setinsetlimits xmin xmax ymin ymax";
     710usage += "\n  Related commands: graphic_att"; 
    695711mpiac->RegisterCommand(kw, usage, this, "Graphics");
    696712
     
    699715usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification";
    700716usage += "\n  Usage: addtext x y ColFontAtt TextString";
    701 usage += "\n  Related commands: gratt"; 
     717usage += "\n  Related commands: graphic_att"; 
    702718mpiac->RegisterCommand(kw, usage, this, "Graphics");
    703719
     
    11011117usage += "  in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
    11021118usage += "  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"; 
     1119usage += "o Most objects can be also be displayed overlayed \n";
     1120usage += "  on the last displayed widget (gr_att= same) \n";
     1121usage += "o The overlay can be on a selected rectangle of the \n"; 
     1122usage += "  last displayed widget (gr_att= inset) - See setinsetlimits\n";
     1123usage += "\n  Related commands: newwin zone stacknext graphic_att setinsetlimits"; 
    11051124piac->RegisterHelp(kw, usage, grp);
    11061125
  • trunk/SophyaPI/PIext/pihisto.cc

    r544 r548  
    6565  if(hmax<=hmin) hmax += 1.;
    6666  SetLimits(mHisto->XMin(), mHisto->XMax(), hmin, hmax);
    67   SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
     67//  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);   NE PAS faire Reza 11/99
    6868}
    6969
     
    7171PIHisto::Draw(PIGraphicUC* g, double /*xmin*/, double /*ymin*/, double /*xmax*/, double /*ymax*/)
    7272{
     73  if (axesFlags != kAxesNone) DrawAxes(g);
     74
    7375  bool oktrace = false;
    7476  if (!mHisto)  return; 
     
    138140  PIGrCoord a, d;
    139141  double cH = (double)g->GetFontHeight(a,d);
    140   double cellHeight = cH * 3.8;
     142  double cellHeight = cH * 3.6;
    141143//  double cellWidth  = (XMax() - XMin()) * 0.23;
    142144  char label[50];
    143   sprintf(label, "N= %.8g    ", mHisto->NData());
    144   label[11] ='\0';
     145  sprintf(label, "N= %8g    ", mHisto->NData());   label[11] ='\0';
    145146  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);
    155161                       
    156162}
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r544 r548  
    176176  if(!mHisto) return;
    177177  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
    179179}
    180180
     
    193193//--
    194194{
     195
     196if (axesFlags != kAxesNone) DrawAxes(g);
     197
    195198if(!mHisto) return;
    196199// Caracteristiques histogramme
  • trunk/SophyaPI/PIext/pintuple.cc

    r544 r548  
    134134 
    135135  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
    137137}
    138138
     
    146146
    147147if (!mNT) return;
     148if (axesFlags != kAxesNone) DrawAxes(g);
    148149if ( (xK < 0) || (yK < 0) )  return;
    149150if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
     
    201202  PIGrCoord a,d;
    202203  double cH = (double)g->GetFontHeight(a,d);
    203   double cellHeight = cH * 1.4;
     204  double cellHeight = cH * 1.3;
    204205  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);
    210214}
    211215
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r506 r548  
    201201mZoom = 0;
    202202mAxesFlags = kBoxAxes | kExtTicks | kLabels;
    203 mXmin = mYmin = -1.;
    204 mXmax = mYmax = 1;
     203SetXYLimits(-1, 1., -1., 1.);
     204SetInsetLimits(0.4, 0.6, 0.4, 0.6);
    205205maXlog = maYlog = false;
    206206SaveGraphicAtt();
     
    463463if ( mCmapid != CMAP_OTHER ) scd->SetColMapId(mCmapid);
    464464
    465 if ( (opt == Disp_Same) && (mLastWdg) ) {
     465
     466if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) )  opt = Disp_Next;
     467// Trace en superpoistion
     468if ( (opt == Disp_Same) && (mLastWdg) ) { 
    466469  if (mLastWdg->kind() == PIScDrawWdg::ClassId)  ((PIScDrawWdg*)mLastWdg)->AddScDrawer(scd, true);
    467470  else mLastWdg->AddDrawer(scd, true, true, true);
     471  scd->Refresh();
     472  mDId++;
     473  mDrwList[mDId] = scd;
     474  return(-mDId);   
     475}
     476// Trace en medaillon
     477else 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);
    468484  scd->Refresh();
    469485  mDId++;
     
    471487  return(-mDId);   
    472488}
    473 else if (opt == Disp_Same)  opt = Disp_Next;
    474489
    475490PIWindow* win;
     
    519534if ( mCmapid != CMAP_OTHER ) dr3->SetColMapId(mCmapid);
    520535
     536if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) )  opt = Disp_Next;
     537// Trace en superpoistion
    521538if ( (opt == Disp_Same) && (mLastWdg) ) {
    522539  if (mLastWdg->kind() == PIDraw3DWdg::ClassId)  ((PIDraw3DWdg*)mLastWdg)->AddDrawer3D(dr3, true);
     
    527544  return(-mDId);   
    528545}
    529 else if (opt == Disp_Same)  opt = Disp_Next;
     546// Trace en medaillon
     547else 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
    530560
    531561PIWindow* win;
     
    12941324
    12951325/* --Methode-- */
     1326void 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-- */
    12961333void PIStdImgApp::SaveGraphicAtt()
    12971334{
     
    13081345  mSXmin = mXmin;  mSXmax = mXmax;
    13091346  mSYmin = mYmin;  mSYmax = mYmax;
     1347  mSIXmin = mIXmin;  mSIXmax = mIXmax;
     1348  mSIYmin = mIYmin;  mSIYmax = mIYmax;
    13101349  mSFXYlim = mFXYlim;
    13111350  mSaXlog = maXlog;
     
    13281367  mXmin = mSXmin;  mXmax = mSXmax;
    13291368  mYmin = mSYmin;  mYmax = mSYmax;
     1369  mIXmin = mSIXmin;  mIXmax = mSIXmax;
     1370  mIYmin = mSIYmin;  mIYmax = mSIYmax;
    13301371  mFXYlim = mSFXYlim;
    13311372  maXlog = mSaXlog;
  • trunk/SophyaPI/PIext/pistdimgapp.h

    r506 r548  
    3131
    3232
    33 enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3};
     33enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3, Disp_Inset=4};
    3434
    3535typedef map<long, PIWindow*, less<long> > WindMList;
     
    101101     void  SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
    102102     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);
    103104     inline void  UseXYLimits(bool fg=false) {  mFXYlim=fg; }
    104105     inline void  SetXLogScale(bool logx=false) { maXlog = logx; }
     
    171172    double       mXmin, mXmax, mYmin, mYmax;
    172173    double       mSXmin, mSXmax, mSYmin, mSYmax;
     174    double       mIXmin, mIXmax, mIYmin, mIYmax;
     175    double       mSIXmin, mSIXmax, mSIYmin, mSIYmax;
    173176    bool         mFXYlim, mSFXYlim;
    174177    bool         maXlog, mSaXlog;
  • trunk/SophyaPI/PIext/servnobjm.cc

    r546 r548  
    13141314  if ( (grt[k] == "win") || (grt[k] == "w") )  ropt =  Disp_Win;
    13151315  else if ( (grt[k] == "same") || (grt[k] == "s") )  ropt = Disp_Same;
     1316  else if ( (grt[k] == "inset") || (grt[k] == "ins") )  ropt = Disp_Inset;
    13161317  else  if ( (grt[k] == "stack") || (grt[k] == "st") )  ropt = Disp_Stack;
    13171318  else fgcont = false;
Note: See TracChangeset for help on using the changeset viewer.