Changeset 486 in Sophya for trunk


Ignore:
Timestamp:
Oct 21, 1999, 2:22:56 PM (26 years ago)
Author:
ercodmgr
Message:

Adapatation a NTupleInterface::GetCelltoString() et ajout trace Label ds PINTuple/3D et Wt ds PINtuple3D - Reza 21/10/99

Location:
trunk/SophyaPI/PIext
Files:
7 edited

Legend:

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

    r484 r486  
    340340
    341341else if (kw == "nt2d") {
    342   if (tokens.size() < 5) { cout << "Usage: nt2d nameobj varx vary errx erry opt" << endl; return(0); }
    343   string opt = "n";
    344   if (tokens.size() > 5)  opt = tokens[5];
     342  if (tokens.size() < 3) {
     343    cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl;
     344    return(0);
     345  }
     346  while (tokens.size() < 8) tokens.push_back("");
    345347  string ph = "";
    346   mObjMgr->DisplayNT(tokens[0],tokens[1],tokens[2], ph, tokens[3], tokens[4], ph, opt);
    347   }
    348 else if (kw == "nt2dw") {
    349   if (tokens.size() < 6) { cout << "Usage: nt2dw nameobj varx vary varz errx erry opt" << endl; return(0); }
    350   string opt = "n";
    351   if (tokens.size() > 6)  opt = tokens[6];
    352   string ph = "";
    353   mObjMgr->DisplayNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], ph, opt, false);
     348  mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph,
     349                     tokens[5], tokens[6], tokens[7], false);
    354350  }
    355351else if (kw == "nt3d") {
    356   if (tokens.size() < 7) { cout << "Usage: nt3d nameobj varx vary varz errx erry errz opt" << endl; return(0); }
    357   string opt = "n";
    358   if (tokens.size() > 7)  opt = tokens[7];
    359   mObjMgr->DisplayNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], opt, true);
     352  if (tokens.size() < 7) {
     353    cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl;
     354    return(0);
     355  }
     356  while (tokens.size() < 10) tokens.push_back("");
     357  mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5],
     358                     tokens[6], tokens[7], tokens[8], tokens[9], true);
    360359  }
    361360
     
    825824mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    826825kw = "nt2d";
    827 usage = "Displays Points (X-Y) [with error-bars] from an NTuple ";
    828 usage += "\n Usage : nt2d nameobj varx vary [errx erry] [graphic_attributes]";
    829 usage += "\n  Related commands: disp  surf  nt2dw nt3d  gfd2d "; 
    830 mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    831 kw = "nt2dw";
    832 usage = "Displays Points (X-Y) with weight [with error-bars] from an NTuple ";
    833 usage += "\n Usage : nt2d nameobj varx vary varz [errx erry] [graphic_attributes]";
    834 usage += "\n  Related commands: disp  surf  nt2d nt3d  gfd2d "; 
     826usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
     827usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
     828usage += "\n  Related commands: disp  surf  nt3d  gfd2d "; 
    835829mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    836830kw = "nt3d";
    837 usage = "Displays 3D-Points (X-Y-Z) [with error-bars] from an NTuple ";
    838 usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz] [graphic_attributes]";
    839 usage += "\n  Related commands: disp  surf  nt2d nt2dw  gfd3d "; 
    840 usage += "\n  Related commands: disp  surf  nt2d nt2dw "; 
     831usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
     832usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
     833usage += "\n  Related commands: disp  surf  nt2d gfd3d "; 
    841834mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    842835
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r466 r486  
    10211021/* --Methode-- */
    10221022void NamedObjMgr::DisplayNT(string& nom, string& nmx, string& nmy, string& nmz,
    1023                             string& erx, string& ery, string& erz, string dopt, bool fg3d)
     1023                            string& erx, string& ery, string& erz, string& wt,
     1024                            string& label, string dopt, bool fg3d)
    10241025{
    10251026AnyDataObj* obj=GetObj(nom);
     
    10491050  PINTuple3D* pin = new PINTuple3D(nt, false);
    10501051  pin->SelectXYZ(nmx.c_str(), nmy.c_str(), nmz.c_str());
     1052  pin->SelectWt(wt.c_str());
     1053  pin->SelectLabel(label.c_str());
    10511054  pin->SelectErrBar(erx.c_str(), ery.c_str(), erz.c_str());
    10521055  string titre = nmz + "%" + nmy + "%" + nmz;
     
    10561059  PINTuple* pin = new PINTuple(nt, false);
    10571060  pin->SelectXY(nmx.c_str(), nmy.c_str());
     1061  pin->SelectWt(wt.c_str());
     1062  pin->SelectLabel(label.c_str());
    10581063  pin->SelectErrBar(erx.c_str(), ery.c_str());
    1059   if ( nmz.length()>0 ) pin->SelectWt(nmz.c_str());
    10601064  string titre = nmy + "%" + nmx;
    10611065  wrsid = myImgApp->DispScDrawer( (PIDrawer*)pin, n1, opt, titre);
  • trunk/SophyaPI/PIext/nobjmgr.h

    r463 r486  
    6969  virtual void          DisplaySurf3D(string & nom, string dopt="");
    7070  virtual void          DisplayNT(string & nom, string& nmx, string& nmy, string& nmz, 
    71                                   string& erx, string& ery, string& erz,
    72                                   string dopt="", bool fg3d=false);
     71                                  string& erx, string& ery, string& erz, string& wt,
     72                                  string& label, string dopt="", bool fg3d=false);
    7373  virtual void          DisplayGFD(string & nom, string& numvarx, string& numvary,
    7474                                   string& err, string dopt="");
  • trunk/SophyaPI/PIext/pintup3d.cc

    r440 r486  
    1010  mAdDO = ad;
    1111  SelectXYZ(NULL, NULL, NULL);
     12  SelectWt(NULL, 1);
    1213  SelectErrBar();
     14  SelectLabel(NULL);
    1315}
    1416
     
    2931if (pz == NULL) zK = -1;
    3032else { name = pz; zK = mNT->ColumnIndex(name); }
     33}
     34
     35/* --Methode-- */
     36void  PINTuple3D::SelectWt(const char* pw, int nbins)
     37{
     38nWbins = (nbins > 0) ? nbins : 10;
     39if (pw == NULL) wK = -1; 
     40else { string name = pw;   wK = mNT->ColumnIndex(name);  }
     41 
     42if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax);
     43else  { wMin = 0.; wMax = 1.; }
     44}
     45
     46/* --Methode-- */
     47void  PINTuple3D::SelectLabel(const char* plabel)
     48{
     49if (plabel == NULL) lK = -1;
     50else {  string name = plabel;  lK = mNT->ColumnIndex(name);  }
    3151}
    3252
     
    88108void PINTuple3D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    89109{
    90 double xp,yp,zp,xer,yer,zer;
     110double xp,yp,zp,wp,xer,yer,zer;
    91111double xl,yl,zl;
    92112int nok;
     
    106126if (mLAtt == PI_NotDefLineAtt)  g3->SelLine(PI_ThinLine);
    107127
     128//  Pour tracer des markers avec taille fonction de Wt (poids)
     129double dw = (wMax-wMin)/nWbins;
     130if (dw < 1.e-19) dw = 1.e19;
     131int msz,sz;
     132
     133PIMarker mrk;
     134if (wK >= 0)  mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_CircleMarker;
     135else   mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_DotMarker;
     136msz = mMSz;
     137if (msz < 1) msz = 1;
     138g->SelMarker(msz, mrk);
     139
    108140nok = 0; 
    109141xp = yp = zp = xl = yl = zl = 0;
     
    116148    g3->DrawLine3D(xl, yl, zl, xp, yp, zp);
    117149  nok++;
    118   g3->DrawMarker3D(xp, yp, zp);
    119150  if ( xebK >= 0 ) {
    120151    xer = mNT->GetCell(i, xebK);
     
    129160    g3->DrawLine3D(xp, yp, zp-zer, xp, yp, zp+zer);
    130161  }
     162  if (wK >= 0) { // Taille de marker en fonction du poids
     163    wp = mNT->GetCell(i, wK);
     164    sz = (int)((wp-wMin)/dw);
     165    if (sz < 0) sz = 0;
     166    if (sz > nWbins)  sz = nWbins;
     167    sz += msz;
     168    if (sz < 2)  g->SelMarker(sz, PI_DotMarker);
     169    else g->SelMarker(sz, mrk);
     170  }
     171  // Trace du marker
     172  if ((wK >= 0)||(lK < 0)||(mMrk != PI_NotDefMarker))  g3->DrawMarker3D(xp, yp, zp);
     173  // Trace eventuel du label
     174  if (lK >= 0) g3->DrawString3D(xp, yp, zp, mNT->GetCelltoString(i, lK).c_str());
    131175}
    132176
  • trunk/SophyaPI/PIext/pintup3d.h

    r326 r486  
    1313  virtual void       UpdateLimits();
    1414 
    15           void       SelectXYZ(const char* px, const char* py, const char* pz);
    16           void       SelectErrBar(const char* erbx=NULL, const char* erby=NULL, const char* erbz=NULL);
     15  virtual void       SelectXYZ(const char* px, const char* py, const char* pz);
     16  virtual void       SelectWt(const char* pw=NULL, int nbins=10);
     17  virtual void       SelectErrBar(const char* erbx=NULL, const char* erby=NULL, const char* erbz=NULL);
     18  virtual void       SelectLabel(const char* plabel);
    1719
    1820       
     
    2224  int xK, yK, zK;           // Index du nom de variable en X/Y/Z ds le ntuple
    2325  int xebK, yebK, zebK;     // Index du nom de variable en ErrBarX/Y/Z ds le ntuple
     26  int wK;                   // Index du nom de variable poids
     27  int lK;                   // Index du nom de variable label (affiche en texte)
     28  double wMin, wMax;        // Valeurs de poids min/max
     29  int nWbins;               // Nombre de bins pour le poids (Wt)
    2430
    2531};
  • trunk/SophyaPI/PIext/pintuple.cc

    r344 r486  
    1212  SelectWt(NULL, 1);
    1313  SelectErrBar();
     14  SelectLabel(NULL);
    1415}
    1516
     
    3940if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax);
    4041else  { wMin = 0.; wMax = 1.; }
     42}
     43
     44/* --Methode-- */
     45void  PINTuple::SelectLabel(const char* plabel)
     46{
     47if (plabel == NULL) lK = -1;
     48else {  string name = plabel;  lK = mNT->ColumnIndex(name);  }
    4149}
    4250
     
    126134    else g->SelMarker(sz, mrk);
    127135  }
    128   g->DrawMarker(xp, yp);
     136  // Trace du marker
     137  if ((wK >= 0)||(lK < 0)||(mMrk != PI_NotDefMarker))  g->DrawMarker(xp, yp);
     138  // Trace eventuel du label
     139  if (lK >= 0) g->DrawString(xp, yp, mNT->GetCelltoString(i, lK).c_str());
     140
    129141}
    130142
  • trunk/SophyaPI/PIext/pintuple.h

    r344 r486  
    2020  virtual void       SelectWt(const char* pw=NULL, int nbins=10);
    2121  virtual void       SelectErrBar(const char* erbx=NULL, const char* erby=NULL);
     22  virtual void       SelectLabel(const char* plabel=NULL);
    2223
    2324  virtual void       AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
     
    2930  int xebK, yebK;      // Index du nom de variable en ErrBarX/Y ds le ntuple
    3031  int wK;              // Index du nom de variable poids
     32  int lK;              // Index du nom de variable label (affiche en texte)
    3133  double wMin, wMax;        // Valeurs de poids min/max
    3234  int nWbins;               // Nombre de bins pour le poids (Wt)
Note: See TracChangeset for help on using the changeset viewer.