Changeset 3269 in Sophya for trunk/SophyaPI
- Timestamp:
- Jun 19, 2007, 4:14:55 PM (18 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/graphexecut.cc
r2781 r3269 285 285 string ph = ""; 286 286 mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph, 287 tokens[5], tokens[6], tokens[7], false); 287 tokens[5], tokens[6], ph, false, tokens[7], false); 288 } 289 else if (kw == "nt2dcn") { 290 if (tokens.size() < 4) { 291 cout << "Usage: nt2dcn nameobj color varx vary [errx erry wt label opt]" << endl; 292 return(0); 293 } 294 while (tokens.size() < 9) tokens.push_back(""); 295 string ph = ""; 296 mObjMgr->DisplayNT(tokens[1], tokens[2], tokens[3], ph, tokens[4], tokens[5], ph, 297 tokens[6], tokens[7], tokens[0], false, tokens[8], false); 298 } 299 else if (kw == "nt2dci") { 300 if (tokens.size() < 4) { 301 cout << "Usage: nt2dci nameobj color varx vary [errx erry wt label opt]" << endl; 302 return(0); 303 } 304 while (tokens.size() < 9) tokens.push_back(""); 305 string ph = ""; 306 mObjMgr->DisplayNT(tokens[1], tokens[2], tokens[3], ph, tokens[4], tokens[5], ph, 307 tokens[6], tokens[7], tokens[0], true, tokens[8], false); 288 308 } 289 309 else if (kw == "nt3d") { … … 685 705 usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple "; 686 706 usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]"; 687 usage += "\n Related commands: disp surf nt3d gfd2d vecplot"; 707 usage += "\n Related commands: disp surf nt2dcn nt2dci nt3d gfd2d vecplot"; 708 mpiac->RegisterCommand(kw, usage, this, grp); 709 kw = "nt2dcn"; 710 usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple "; 711 usage = " with colors specified by a column content (as color names) "; 712 usage += "\n Usage : nt2dcn nameobj color varx vary [errx erry wt label graphic_attributes]"; 713 usage += "\n Related commands: disp surf nt2d nt2dci nt3d gfd2d vecplot"; 714 mpiac->RegisterCommand(kw, usage, this, grp); 715 kw = "nt2dci"; 716 usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple "; 717 usage = " with colors specified by a column content (as color index) "; 718 usage += "\n Usage : nt2dci nameobj color varx vary [errx erry wt label graphic_attributes]"; 719 usage += "\n Related commands: disp surf nt2d nt2dci nt3d gfd2d vecplot"; 688 720 mpiac->RegisterCommand(kw, usage, this, grp); 689 721 kw = "nt3d"; -
trunk/SophyaPI/PIext/nobjmgr.cc
r2999 r3269 1407 1407 void NamedObjMgr::DisplayNT(string& nom, string& nmx, string& nmy, string& nmz, 1408 1408 string& erx, string& ery, string& erz, string& wt, 1409 string& label, string dopt, bool fg3d)1409 string& label, string& colornm, bool coloridx, string dopt, bool fg3d) 1410 1410 { 1411 1411 // Pas de display si option dopt = nodisp … … 1453 1453 pin->SelectLabel(label.c_str()); 1454 1454 pin->SelectErrBar(erx.c_str(), ery.c_str()); 1455 if (colornm.length() > 0) { // Juin 2007 : gestion de nom de colonne pour la couleur 1456 if (coloridx) pin->SelectColorByIndex(colornm.c_str()); 1457 else pin->SelectColorByName(colornm.c_str()); 1458 } 1455 1459 string titre = nmy + "%" + nmx; 1456 1460 wrsid = myImgApp->DispScDrawer( (PIDrawer*)pin, n1, dopt, titre, 0, fglock); -
trunk/SophyaPI/PIext/nobjmgr.h
r2999 r3269 86 86 virtual void DisplayNT(string & nom, string& nmx, string& nmy, string& nmz, 87 87 string& erx, string& ery, string& erz, string& wt, 88 string& label, string dopt="", bool fg3d=false); 88 string& label, string& colornm, bool coloridx=false, 89 string dopt="", bool fg3d=false); 89 90 virtual void DisplayGFD(string & nom, string& numvarx, string& numvary, 90 91 string& err, string dopt=""); -
trunk/SophyaPI/PIext/pintuple.cc
r3149 r3269 58 58 SelectErrBar(); 59 59 SelectLabel(NULL); 60 SelectColorByName(NULL); 61 SelectColorByIndex(NULL); 60 62 SetName("NTupleDrw"); 61 63 NptDraw = 0; … … 114 116 115 117 /* --Methode-- */ 118 void PINTuple::SelectColorByName(const char* pcolnm=NULL) 119 { 120 if (pcolnm == NULL) cnK = -1; 121 else { string name = pcolnm; cnK = mNT->ColumnIndex(name); } 122 if (cnK >= 0) ciK = -1; 123 } 124 125 /* --Methode-- */ 126 void PINTuple::SelectColorByIndex(const char* pcolidx=NULL) 127 { 128 if (pcolidx == NULL) ciK = -1; 129 else { string name = pcolidx; ciK = mNT->ColumnIndex(name); } 130 if (ciK >= 0) cnK = -1; 131 } 132 133 134 /* --Methode-- */ 116 135 void PINTuple::SelectErrBar(const char* erbx, const char* erby) 117 136 { … … 162 181 double dw = (wMax-wMin)/nWbins; 163 182 if (dw < 1.e-19) dw = 1.e-19; 183 184 // La couleur par defaut (pour le trace avec couleur specifie par nom de colonne (06/2007) 185 PIColors defcol = GetGraphicAtt().GetColor(); 186 if (defcol == PI_NotDefColor) defcol = PI_Black; 164 187 165 188 // Pour tracer des markers avec couleur en fonction de Wt (poids) … … 234 257 } 235 258 259 // Si on a specifie un nom de colonne pour la couleur (06/2007) 260 if ( (cnK >= 0) || (ciK >= 0) ) { 261 PIColors scol = defcol; 262 if (cnK > 0) 263 scol = PIGraphicAtt::ColNameToColor(mNT->GetCelltoString(i, cnK)); 264 else 265 scol = PIGraphicAtt::ColIndexToColor(mNT->GetCell(i, ciK)); 266 if (scol == PI_NotDefColor) scol = defcol; 267 g->SelForeground(scol); 268 } 269 236 270 // Trace d'une ligne reliant les points 237 271 if( connectPts ) { … … 273 307 274 308 if (stats) { // Trace de stats 309 g->SelForeground(defcol); 275 310 g->SelFontSz((YMax() - YMin())/30); 276 311 // La hauteur de la cellule -
trunk/SophyaPI/PIext/pintuple.h
r3149 r3269 22 22 virtual void SelectErrBar(const char* erbx=NULL, const char* erby=NULL); 23 23 virtual void SelectLabel(const char* plabel=NULL); 24 virtual void SelectColorByName(const char* pcolnm=NULL); 25 virtual void SelectColorByIndex(const char* pcolidx=NULL); 24 26 25 27 inline void ConnectPoints(bool fg=false) { connectPts = fg; } … … 56 58 int wK; // Index du nom de variable poids 57 59 int lK; // Index du nom de variable label (affiche en texte) 60 int cnK; // Index du nom de variable couleur (par nom de couleur) 61 int ciK; // Index du nom de variable couleur (par index de couleur) 58 62 double wMin, wMax; // Valeurs de poids min/max 59 63 bool mrkSzScale; // true -> Taille de markers variable suivant poids
Note:
See TracChangeset
for help on using the changeset viewer.