- Timestamp:
- Oct 21, 1999, 2:22:56 PM (26 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r484 r486 340 340 341 341 else 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(""); 345 347 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); 354 350 } 355 351 else 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); 360 359 } 361 360 … … 825 824 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 826 825 kw = "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 "; 826 usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple "; 827 usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]"; 828 usage += "\n Related commands: disp surf nt3d gfd2d "; 835 829 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 836 830 kw = "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 "; 831 usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple "; 832 usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]"; 833 usage += "\n Related commands: disp surf nt2d gfd3d "; 841 834 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 842 835 -
trunk/SophyaPI/PIext/nobjmgr.cc
r466 r486 1021 1021 /* --Methode-- */ 1022 1022 void 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) 1024 1025 { 1025 1026 AnyDataObj* obj=GetObj(nom); … … 1049 1050 PINTuple3D* pin = new PINTuple3D(nt, false); 1050 1051 pin->SelectXYZ(nmx.c_str(), nmy.c_str(), nmz.c_str()); 1052 pin->SelectWt(wt.c_str()); 1053 pin->SelectLabel(label.c_str()); 1051 1054 pin->SelectErrBar(erx.c_str(), ery.c_str(), erz.c_str()); 1052 1055 string titre = nmz + "%" + nmy + "%" + nmz; … … 1056 1059 PINTuple* pin = new PINTuple(nt, false); 1057 1060 pin->SelectXY(nmx.c_str(), nmy.c_str()); 1061 pin->SelectWt(wt.c_str()); 1062 pin->SelectLabel(label.c_str()); 1058 1063 pin->SelectErrBar(erx.c_str(), ery.c_str()); 1059 if ( nmz.length()>0 ) pin->SelectWt(nmz.c_str());1060 1064 string titre = nmy + "%" + nmx; 1061 1065 wrsid = myImgApp->DispScDrawer( (PIDrawer*)pin, n1, opt, titre); -
trunk/SophyaPI/PIext/nobjmgr.h
r463 r486 69 69 virtual void DisplaySurf3D(string & nom, string dopt=""); 70 70 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); 73 73 virtual void DisplayGFD(string & nom, string& numvarx, string& numvary, 74 74 string& err, string dopt=""); -
trunk/SophyaPI/PIext/pintup3d.cc
r440 r486 10 10 mAdDO = ad; 11 11 SelectXYZ(NULL, NULL, NULL); 12 SelectWt(NULL, 1); 12 13 SelectErrBar(); 14 SelectLabel(NULL); 13 15 } 14 16 … … 29 31 if (pz == NULL) zK = -1; 30 32 else { name = pz; zK = mNT->ColumnIndex(name); } 33 } 34 35 /* --Methode-- */ 36 void PINTuple3D::SelectWt(const char* pw, int nbins) 37 { 38 nWbins = (nbins > 0) ? nbins : 10; 39 if (pw == NULL) wK = -1; 40 else { string name = pw; wK = mNT->ColumnIndex(name); } 41 42 if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax); 43 else { wMin = 0.; wMax = 1.; } 44 } 45 46 /* --Methode-- */ 47 void PINTuple3D::SelectLabel(const char* plabel) 48 { 49 if (plabel == NULL) lK = -1; 50 else { string name = plabel; lK = mNT->ColumnIndex(name); } 31 51 } 32 52 … … 88 108 void PINTuple3D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax) 89 109 { 90 double xp,yp,zp, xer,yer,zer;110 double xp,yp,zp,wp,xer,yer,zer; 91 111 double xl,yl,zl; 92 112 int nok; … … 106 126 if (mLAtt == PI_NotDefLineAtt) g3->SelLine(PI_ThinLine); 107 127 128 // Pour tracer des markers avec taille fonction de Wt (poids) 129 double dw = (wMax-wMin)/nWbins; 130 if (dw < 1.e-19) dw = 1.e19; 131 int msz,sz; 132 133 PIMarker mrk; 134 if (wK >= 0) mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_CircleMarker; 135 else mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_DotMarker; 136 msz = mMSz; 137 if (msz < 1) msz = 1; 138 g->SelMarker(msz, mrk); 139 108 140 nok = 0; 109 141 xp = yp = zp = xl = yl = zl = 0; … … 116 148 g3->DrawLine3D(xl, yl, zl, xp, yp, zp); 117 149 nok++; 118 g3->DrawMarker3D(xp, yp, zp);119 150 if ( xebK >= 0 ) { 120 151 xer = mNT->GetCell(i, xebK); … … 129 160 g3->DrawLine3D(xp, yp, zp-zer, xp, yp, zp+zer); 130 161 } 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()); 131 175 } 132 176 -
trunk/SophyaPI/PIext/pintup3d.h
r326 r486 13 13 virtual void UpdateLimits(); 14 14 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); 17 19 18 20 … … 22 24 int xK, yK, zK; // Index du nom de variable en X/Y/Z ds le ntuple 23 25 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) 24 30 25 31 }; -
trunk/SophyaPI/PIext/pintuple.cc
r344 r486 12 12 SelectWt(NULL, 1); 13 13 SelectErrBar(); 14 SelectLabel(NULL); 14 15 } 15 16 … … 39 40 if (wK >= 0) mNT->GetMinMax(wK, wMin, wMax); 40 41 else { wMin = 0.; wMax = 1.; } 42 } 43 44 /* --Methode-- */ 45 void PINTuple::SelectLabel(const char* plabel) 46 { 47 if (plabel == NULL) lK = -1; 48 else { string name = plabel; lK = mNT->ColumnIndex(name); } 41 49 } 42 50 … … 126 134 else g->SelMarker(sz, mrk); 127 135 } 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 129 141 } 130 142 -
trunk/SophyaPI/PIext/pintuple.h
r344 r486 20 20 virtual void SelectWt(const char* pw=NULL, int nbins=10); 21 21 virtual void SelectErrBar(const char* erbx=NULL, const char* erby=NULL); 22 virtual void SelectLabel(const char* plabel=NULL); 22 23 23 24 virtual void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax); … … 29 30 int xebK, yebK; // Index du nom de variable en ErrBarX/Y ds le ntuple 30 31 int wK; // Index du nom de variable poids 32 int lK; // Index du nom de variable label (affiche en texte) 31 33 double wMin, wMax; // Valeurs de poids min/max 32 34 int nWbins; // Nombre de bins pour le poids (Wt)
Note:
See TracChangeset
for help on using the changeset viewer.