| [2781] | 1 | #include "sopnamsp.h" | 
|---|
|  | 2 | #include "piacmd.h" | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #include <stdio.h> | 
|---|
|  | 5 | #include <stdlib.h> | 
|---|
|  | 6 | #include <math.h> | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #include "graphexecut.h" | 
|---|
|  | 9 |  | 
|---|
|  | 10 | #include "strutilxx.h" | 
|---|
|  | 11 |  | 
|---|
|  | 12 | #include "pistdimgapp.h" | 
|---|
|  | 13 | #include "nobjmgr.h" | 
|---|
|  | 14 |  | 
|---|
|  | 15 | #include "nomgadapter.h" | 
|---|
|  | 16 | #include "piyfxdrw.h" | 
|---|
|  | 17 | #include "pibargraph.h" | 
|---|
|  | 18 | #include "pitxtdrw.h" | 
|---|
|  | 19 |  | 
|---|
|  | 20 |  | 
|---|
|  | 21 |  | 
|---|
|  | 22 | /* --Methode-- */ | 
|---|
|  | 23 | PIAGraphicExecutor::PIAGraphicExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app) | 
|---|
|  | 24 | { | 
|---|
|  | 25 | mpiac = piac; | 
|---|
|  | 26 | mObjMgr = omg; | 
|---|
|  | 27 | mImgApp = app; | 
|---|
|  | 28 | RegisterCommands(); | 
|---|
|  | 29 | } | 
|---|
|  | 30 |  | 
|---|
|  | 31 | PIAGraphicExecutor::~PIAGraphicExecutor() | 
|---|
|  | 32 | { | 
|---|
|  | 33 | } | 
|---|
|  | 34 |  | 
|---|
|  | 35 |  | 
|---|
|  | 36 | /* Macro pour tester si flag normalized coordinate est present */ | 
|---|
|  | 37 | #define _CkBoolNC_(_jk_) ((tokens.size()>_jk_) && (tokens[_jk_] == "true")) ? true : false; | 
|---|
|  | 38 |  | 
|---|
|  | 39 |  | 
|---|
|  | 40 | /* --Methode-- */ | 
|---|
|  | 41 | int PIAGraphicExecutor::Execute(string& kw, vector<string>& tokens, string& toks) | 
|---|
|  | 42 | { | 
|---|
|  | 43 | // >>>>>>>>>>> Fenetre graphique , changement d'attributs graphiques | 
|---|
|  | 44 | if (kw == "zone") { | 
|---|
|  | 45 | while (tokens.size() < 2) tokens.push_back("1"); | 
|---|
|  | 46 | int nx, ny; | 
|---|
|  | 47 | nx = ny = 1; | 
|---|
|  | 48 | nx = atoi(tokens[0].c_str());    ny = atoi(tokens[1].c_str()); | 
|---|
|  | 49 | if (mImgApp) { | 
|---|
|  | 50 | mImgApp->LockMutex();  // <ZThread> global event loop synchronisation | 
|---|
|  | 51 | mImgApp->SetZone(nx, ny); | 
|---|
|  | 52 | mImgApp->UnlockMutex(true);  // <ZThread> global event loop synchronisation | 
|---|
|  | 53 | } | 
|---|
|  | 54 | } | 
|---|
|  | 55 | else if (kw == "newwin") { | 
|---|
|  | 56 | int nx=1, ny=1; | 
|---|
|  | 57 | int sx=0, sy=0; | 
|---|
|  | 58 | //if(tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl;  return(0); } | 
|---|
|  | 59 | if(tokens.size() > 0) nx = atoi(tokens[0].c_str()); | 
|---|
|  | 60 | if(tokens.size() > 1) ny = atoi(tokens[1].c_str()); | 
|---|
|  | 61 | if(tokens.size() > 3) { | 
|---|
|  | 62 | sx = atoi(tokens[2].c_str()); | 
|---|
|  | 63 | sy = atoi(tokens[3].c_str()); | 
|---|
|  | 64 | } | 
|---|
|  | 65 | if (mImgApp) { | 
|---|
|  | 66 | mImgApp->LockMutex();   // <ZThread> global event loop synchronisation | 
|---|
|  | 67 | mImgApp->CreateGraphWin(nx, ny, sx, sy); | 
|---|
|  | 68 | mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation | 
|---|
|  | 69 | } | 
|---|
|  | 70 | } | 
|---|
|  | 71 | else if (kw == "stacknext") { | 
|---|
|  | 72 | mImgApp->LockMutex();  // <ZThread> global event loop synchronisation | 
|---|
|  | 73 | mImgApp->StackWinNext(); | 
|---|
|  | 74 | mImgApp->UnlockMutex(true);  // <ZThread> global event loop synchronisation | 
|---|
|  | 75 | } | 
|---|
|  | 76 | else if (kw == "graphicatt") { | 
|---|
|  | 77 | if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl;  return(0); } | 
|---|
|  | 78 | string opts = tokens[0]; | 
|---|
|  | 79 | if (tokens.size() > 1) | 
|---|
|  | 80 | for(unsigned int kt=1; kt<tokens.size(); kt++)  { opts += ' '; opts += tokens[kt]; } | 
|---|
|  | 81 | if (mImgApp) mImgApp->SetDefaultGraphicAttributes(opts); | 
|---|
|  | 82 | } | 
|---|
|  | 83 | else if (kw == "setaxesatt") { | 
|---|
|  | 84 | if (tokens.size() < 1) { cout << "Usage: setaxesatt attributes_list " << endl;  return(0); } | 
|---|
|  | 85 | string opts = tokens[0]; | 
|---|
|  | 86 | if (tokens.size() > 1) | 
|---|
|  | 87 | for(unsigned int kt=1; kt<tokens.size(); kt++)  { opts += ' '; opts += tokens[kt]; } | 
|---|
|  | 88 | if (mImgApp) mImgApp->SetDefaultAxesAttributes(opts); | 
|---|
|  | 89 | } | 
|---|
|  | 90 | else if (kw == "setinsetlimits") { | 
|---|
|  | 91 | if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl;  return(0); } | 
|---|
|  | 92 | double xmin = atof(tokens[0].c_str()); | 
|---|
|  | 93 | double xmax = atof(tokens[1].c_str()); | 
|---|
|  | 94 | double ymin = atof(tokens[2].c_str()); | 
|---|
|  | 95 | double ymax = atof(tokens[3].c_str()); | 
|---|
|  | 96 | mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax); | 
|---|
|  | 97 | } | 
|---|
|  | 98 | else if (kw == "drpanel") { | 
|---|
|  | 99 | if (tokens.size() < 4) { | 
|---|
|  | 100 | cout << "Usage: drpanel xmin xmax ymin ymax [gratt] [name]" << endl; | 
|---|
|  | 101 | return(0); | 
|---|
|  | 102 | } | 
|---|
|  | 103 | double xmin = atof(tokens[0].c_str()); | 
|---|
|  | 104 | double xmax = atof(tokens[1].c_str()); | 
|---|
|  | 105 | double ymin = atof(tokens[2].c_str()); | 
|---|
|  | 106 | double ymax = atof(tokens[3].c_str()); | 
|---|
|  | 107 | char buff[128]; | 
|---|
|  | 108 | sprintf(buff, "axesnone xylimits=%g,%g,%g,%g ", xmin, xmax, ymin, ymax); | 
|---|
|  | 109 | string sop = buff; | 
|---|
|  | 110 | if (tokens.size() > 4) sop += tokens[4]; | 
|---|
|  | 111 | string name; | 
|---|
|  | 112 | if (tokens.size() > 5) name = tokens[5]; | 
|---|
|  | 113 | PIFuncDrawer* gdr = new PIFuncDrawer(NULL); | 
|---|
|  | 114 | mImgApp->DispScDrawer(gdr, name, sop); | 
|---|
|  | 115 | } | 
|---|
|  | 116 | //---- Ajout d'elements graphiques | 
|---|
|  | 117 | else if (kw == "addtext") { | 
|---|
|  | 118 | if (tokens.size() < 3) { | 
|---|
|  | 119 | cout << "Usage: addtext x y txt [colfontatt] [fgnc]" << endl; | 
|---|
|  | 120 | return(0); | 
|---|
|  | 121 | } | 
|---|
|  | 122 | double xp = atof(tokens[0].c_str()); | 
|---|
|  | 123 | double yp = atof(tokens[1].c_str()); | 
|---|
|  | 124 | string txt = tokens[2]; | 
|---|
|  | 125 | string sop; | 
|---|
|  | 126 | if (tokens.size() > 3) sop = tokens[3]; | 
|---|
|  | 127 | bool fgnc = _CkBoolNC_(4); | 
|---|
|  | 128 | mImgApp->AddText(txt, xp, yp, sop, fgnc); | 
|---|
|  | 129 | } | 
|---|
|  | 130 | else if (kw == "addctext") { | 
|---|
|  | 131 | if (tokens.size() < 5) { | 
|---|
|  | 132 | cout << "Usage: addctext x y txt s_up s_dn [colfontatt] [updnfatt] [fgnc] " << endl; | 
|---|
|  | 133 | return(0); | 
|---|
|  | 134 | } | 
|---|
|  | 135 | double xp = atof(tokens[0].c_str()); | 
|---|
|  | 136 | double yp = atof(tokens[1].c_str()); | 
|---|
|  | 137 | string sop; | 
|---|
|  | 138 | if (tokens.size() > 5) sop = tokens[5]; | 
|---|
|  | 139 | string sopfss; | 
|---|
|  | 140 | if (tokens.size() > 6) sopfss = tokens[6]; | 
|---|
|  | 141 | bool fgnc = _CkBoolNC_(7); | 
|---|
|  | 142 | mImgApp->AddCompText(tokens[2], tokens[3], tokens[4], xp, yp, sop, sopfss, fgnc); | 
|---|
|  | 143 | } | 
|---|
|  | 144 | else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") || | 
|---|
|  | 145 | (kw == "addoval") || (kw == "addfoval") || | 
|---|
|  | 146 | (kw == "addarrow") ) { | 
|---|
|  | 147 | if (tokens.size() < 4) { | 
|---|
|  | 148 | if ( (kw == "addoval") || (kw == "addfoval") ) | 
|---|
|  | 149 | cout << "Usage  addoval/addfoval/addarrow xc yc dx dy [colatt] [fgnc]" << endl; | 
|---|
|  | 150 | else | 
|---|
|  | 151 | cout << "Usage: addline/addrect/addfrect/addarrow x1 y1 x2 y2 [colatt] [fgnc]" << endl; | 
|---|
|  | 152 | return(0); | 
|---|
|  | 153 | } | 
|---|
|  | 154 | double xp1 = atof(tokens[0].c_str()); | 
|---|
|  | 155 | double yp1 = atof(tokens[1].c_str()); | 
|---|
|  | 156 | double xp2 = atof(tokens[2].c_str()); | 
|---|
|  | 157 | double yp2 = atof(tokens[3].c_str()); | 
|---|
|  | 158 | string sop; | 
|---|
|  | 159 | if (tokens.size() > 4) sop = tokens[4]; | 
|---|
|  | 160 | bool fgnc = _CkBoolNC_(5); | 
|---|
|  | 161 | if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false, fgnc); | 
|---|
|  | 162 | else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true, fgnc); | 
|---|
|  | 163 | else { | 
|---|
|  | 164 | bool fgfill = ((kw == "addrect") || (kw == "addoval")) ? false : true; | 
|---|
|  | 165 | if ( (kw == "addrect") || (kw == "addfrect") ) | 
|---|
|  | 166 | mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill, fgnc); | 
|---|
|  | 167 | else  mImgApp->AddOval(xp1, yp1, xp2, yp2, sop, fgfill, fgnc); | 
|---|
|  | 168 | } | 
|---|
|  | 169 | } | 
|---|
|  | 170 | else if ((kw == "addcirc") || (kw == "addfcirc")) { | 
|---|
|  | 171 | if (tokens.size() < 3) { | 
|---|
|  | 172 | cout << "Usage: addcirc/addfcirc xc yc r [colatt] [fgnc]" << endl; | 
|---|
|  | 173 | return(0); | 
|---|
|  | 174 | } | 
|---|
|  | 175 | double xc = atof(tokens[0].c_str()); | 
|---|
|  | 176 | double yc = atof(tokens[1].c_str()); | 
|---|
|  | 177 | double rad = atof(tokens[2].c_str()); | 
|---|
|  | 178 | string sop; | 
|---|
|  | 179 | if (tokens.size() > 3) sop = tokens[3]; | 
|---|
|  | 180 | bool fgnc = _CkBoolNC_(4); | 
|---|
|  | 181 | bool fgfill = (kw == "addcirc") ? false : true; | 
|---|
|  | 182 | mImgApp->AddCircle(xc, yc, rad, sop, fgfill, fgnc); | 
|---|
|  | 183 | } | 
|---|
|  | 184 | else if ((kw == "addarca") || (kw == "addfarca")) { | 
|---|
|  | 185 | if (tokens.size() < 5) { | 
|---|
|  | 186 | cout << "Usage: addarca/addfarca xc yc r a da [colatt] [fgnc]" << endl; | 
|---|
|  | 187 | return(0); | 
|---|
|  | 188 | } | 
|---|
|  | 189 | double xc = atof(tokens[0].c_str()); | 
|---|
|  | 190 | double yc = atof(tokens[1].c_str()); | 
|---|
|  | 191 | double rad = atof(tokens[2].c_str()); | 
|---|
|  | 192 | double ang = atof(tokens[3].c_str()); | 
|---|
|  | 193 | double dang = atof(tokens[4].c_str()); | 
|---|
|  | 194 | string sop; | 
|---|
|  | 195 | if (tokens.size() > 5) sop = tokens[5]; | 
|---|
|  | 196 | bool fgnc = _CkBoolNC_(6); | 
|---|
|  | 197 | bool fgfill = (kw == "addarca") ? false : true; | 
|---|
|  | 198 | mImgApp->AddArc(xc, yc, rad, ang, dang, sop, fgfill, fgnc); | 
|---|
|  | 199 | } | 
|---|
|  | 200 | else if (kw == "addmarker") { | 
|---|
|  | 201 | if (tokens.size() < 2) { | 
|---|
|  | 202 | cout << "Usage: addmarker x y [gratt] [fgnc]" << endl; | 
|---|
|  | 203 | return(0); | 
|---|
|  | 204 | } | 
|---|
|  | 205 | double xm = atof(tokens[0].c_str()); | 
|---|
|  | 206 | double ym = atof(tokens[1].c_str()); | 
|---|
|  | 207 | string sop; | 
|---|
|  | 208 | if (tokens.size() > 2) sop = tokens[2]; | 
|---|
|  | 209 | bool fgnc = _CkBoolNC_(3); | 
|---|
|  | 210 | mImgApp->AddCircle(xm, ym, -1, sop, false, fgnc); | 
|---|
|  | 211 | } | 
|---|
|  | 212 | else if ((kw == "addarc") || (kw == "addfarc") ) { | 
|---|
|  | 213 | if (tokens.size() < 6) { | 
|---|
|  | 214 | cout << "Usage: addarc/addfarc x1 y1 x2 y2 x3 y3 [gratt] [fgnc]" << endl; | 
|---|
|  | 215 | return(0); | 
|---|
|  | 216 | } | 
|---|
|  | 217 | double x1 = atof(tokens[0].c_str()); | 
|---|
|  | 218 | double y1 = atof(tokens[1].c_str()); | 
|---|
|  | 219 | double x2 = atof(tokens[2].c_str()); | 
|---|
|  | 220 | double y2 = atof(tokens[3].c_str()); | 
|---|
|  | 221 | double x3 = atof(tokens[4].c_str()); | 
|---|
|  | 222 | double y3 = atof(tokens[5].c_str()); | 
|---|
|  | 223 | string sop; | 
|---|
|  | 224 | if (tokens.size() > 6) sop = tokens[6]; | 
|---|
|  | 225 | bool fgnc = _CkBoolNC_(7); | 
|---|
|  | 226 | bool fgfill = (kw == "addarc") ? false : true; | 
|---|
|  | 227 | mImgApp->AddArc(x1, y1, x2, y2, x3, y3, sop, fgfill, fgnc); | 
|---|
|  | 228 | } | 
|---|
|  | 229 | else if ((kw == "addpoly") || (kw == "addfpoly")) { | 
|---|
|  | 230 | if (tokens.size() < 1) { | 
|---|
|  | 231 | cout << "Usage: addpoly/addfpoly 'x1,y1 x2,y2 x3,y3 ...' [gratt] [fgnc]" << endl; | 
|---|
|  | 232 | return(0); | 
|---|
|  | 233 | } | 
|---|
|  | 234 | vector<string> sxy; | 
|---|
|  | 235 | vector<double> xpol, ypol; | 
|---|
|  | 236 | double xp, yp; | 
|---|
|  | 237 | FillVStringFrString(tokens[0], sxy); | 
|---|
|  | 238 | for(int jkk=0; jkk<sxy.size(); jkk++) { | 
|---|
|  | 239 | xp = yp = 0; | 
|---|
|  | 240 | if (sscanf(sxy[jkk].c_str(), "%lg,%lg", &xp, &yp) == 2) { | 
|---|
|  | 241 | xpol.push_back(xp); | 
|---|
|  | 242 | ypol.push_back(yp); | 
|---|
|  | 243 | } | 
|---|
|  | 244 | } | 
|---|
|  | 245 | string sop; | 
|---|
|  | 246 | if (tokens.size() > 1) sop = tokens[1]; | 
|---|
|  | 247 | bool fgnc = _CkBoolNC_(2); | 
|---|
|  | 248 | bool fgfill = (kw == "addpoly") ? false : true; | 
|---|
|  | 249 | mImgApp->AddPoly(xpol, ypol, sop, fgfill, fgnc); | 
|---|
|  | 250 | } | 
|---|
|  | 251 |  | 
|---|
|  | 252 |  | 
|---|
|  | 253 | else if ((kw == "settitle") || (kw == "addtitle")) { | 
|---|
|  | 254 | if (tokens.size() < 1) { cout << "Usage: settitle/addtitle TopTitle [BotTitle] [fontatt]" << endl;  return(0); } | 
|---|
|  | 255 | if(tokens.size()<2) tokens.push_back(""); | 
|---|
|  | 256 | string gropt; | 
|---|
|  | 257 | if(tokens.size()>2) gropt = tokens[2]; | 
|---|
|  | 258 | mImgApp->SetTitle(tokens[0], tokens[1], gropt); | 
|---|
|  | 259 | } | 
|---|
|  | 260 |  | 
|---|
|  | 261 | else if ((kw == "setaxelabels") || (kw == "addaxelabels")) { | 
|---|
|  | 262 | if (tokens.size() < 2) { cout << "Usage: setaxelabels/addaxelabels xLabel yLabel [fontatt]" << endl;  return(0); } | 
|---|
|  | 263 | string gropt; | 
|---|
|  | 264 | if(tokens.size()>2) gropt = tokens[2]; | 
|---|
|  | 265 | mImgApp->SetAxeLabels(tokens[0], tokens[1], gropt); | 
|---|
|  | 266 | } | 
|---|
|  | 267 |  | 
|---|
|  | 268 | // >>>>>>>>>>>  Affichage des objets | 
|---|
|  | 269 | else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") || (kw == "imagnav") ) { | 
|---|
|  | 270 | if (tokens.size() < 1) { cout << "Usage: disp/surf/imag/imagnav nameobj [opt]" << endl; return(0); } | 
|---|
|  | 271 | string opt = "next"; | 
|---|
|  | 272 | if (tokens.size() > 1)  opt = tokens[1]; | 
|---|
|  | 273 | if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt); | 
|---|
|  | 274 | else if (kw == "surf")  mObjMgr->DisplaySurf3D(tokens[0], opt); | 
|---|
|  | 275 | else if (kw == "imag")  mObjMgr->DisplayImage(tokens[0], opt, false); | 
|---|
|  | 276 | else if (kw == "imagnav")  mObjMgr->DisplayImage(tokens[0], opt, true); | 
|---|
|  | 277 | } | 
|---|
|  | 278 |  | 
|---|
|  | 279 | else if (kw == "nt2d") { | 
|---|
|  | 280 | if (tokens.size() < 3) { | 
|---|
|  | 281 | cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl; | 
|---|
|  | 282 | return(0); | 
|---|
|  | 283 | } | 
|---|
|  | 284 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
|  | 285 | string ph = ""; | 
|---|
|  | 286 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph, | 
|---|
|  | 287 | tokens[5], tokens[6], tokens[7], false); | 
|---|
|  | 288 | } | 
|---|
|  | 289 | else if (kw == "nt3d") { | 
|---|
|  | 290 | if (tokens.size() < 7) { | 
|---|
|  | 291 | cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl; | 
|---|
|  | 292 | return(0); | 
|---|
|  | 293 | } | 
|---|
|  | 294 | while (tokens.size() < 10) tokens.push_back(""); | 
|---|
|  | 295 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], | 
|---|
|  | 296 | tokens[6], tokens[7], tokens[8], tokens[9], true); | 
|---|
|  | 297 | } | 
|---|
|  | 298 | else if (kw == "vecplot") { | 
|---|
|  | 299 | if (tokens.size() < 2) { | 
|---|
|  | 300 | cout << "Usage: vecplot nameVecX nameVecY [opt]" << endl; | 
|---|
|  | 301 | return(0); | 
|---|
|  | 302 | } | 
|---|
|  | 303 | while (tokens.size() < 3) tokens.push_back(""); | 
|---|
|  | 304 | mObjMgr->DisplayVector(tokens[0], tokens[1], tokens[2]); | 
|---|
|  | 305 | } | 
|---|
|  | 306 | else if (kw == "bargraph") return BarGraph(kw, tokens); | 
|---|
|  | 307 | else if (kw == "textdrawer") return TextDrawer(kw, tokens); | 
|---|
|  | 308 |  | 
|---|
|  | 309 | // Obsolete : ne pas virer SVP, cmv 26/7/99 | 
|---|
|  | 310 | else if (kw == "gfd2d") { | 
|---|
|  | 311 | cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl; | 
|---|
|  | 312 | if(tokens.size()<2) | 
|---|
|  | 313 | {cout<<"Usage: gfd2d nomobj numvarx erreur=(x y xy) opt"<<endl; | 
|---|
|  | 314 | return(0);} | 
|---|
|  | 315 | string numvary = ""; | 
|---|
|  | 316 | string err = ""; | 
|---|
|  | 317 | string opt = "next"; | 
|---|
|  | 318 | if(tokens.size()>2) err = tokens[2]; | 
|---|
|  | 319 | if(tokens.size()>3) opt = tokens[3]; | 
|---|
|  | 320 | mObjMgr->DisplayGFD(tokens[0],tokens[1],numvary,err,opt); | 
|---|
|  | 321 | } | 
|---|
|  | 322 | else if (kw == "gfd3d") { | 
|---|
|  | 323 | cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl; | 
|---|
|  | 324 | if(tokens.size()<3) | 
|---|
|  | 325 | {cout<<"Usage: gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) opt"<<endl; | 
|---|
|  | 326 | return(0);} | 
|---|
|  | 327 | string err = ""; | 
|---|
|  | 328 | string opt = "next"; | 
|---|
|  | 329 | if(tokens.size()>3) err = tokens[3]; | 
|---|
|  | 330 | if(tokens.size()>4) opt = tokens[4]; | 
|---|
|  | 331 | mObjMgr->DisplayGFD(tokens[0],tokens[1],tokens[2],err,opt); | 
|---|
|  | 332 | } | 
|---|
|  | 333 |  | 
|---|
|  | 334 |  | 
|---|
|  | 335 | else  { | 
|---|
|  | 336 | cerr << "PIAGraphicExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl; | 
|---|
|  | 337 | return(-1); | 
|---|
|  | 338 | } | 
|---|
|  | 339 |  | 
|---|
|  | 340 | return(0); | 
|---|
|  | 341 | } | 
|---|
|  | 342 |  | 
|---|
|  | 343 | /* --Methode-- */ | 
|---|
|  | 344 | bool PIAGraphicExecutor::IsThreadable(string const & keyw) | 
|---|
|  | 345 | { | 
|---|
|  | 346 | return false; | 
|---|
|  | 347 | } | 
|---|
|  | 348 |  | 
|---|
|  | 349 |  | 
|---|
|  | 350 | /* --Methode-- */ | 
|---|
|  | 351 | void PIAGraphicExecutor::RegisterCommands() | 
|---|
|  | 352 | { | 
|---|
|  | 353 | string kw, usage, grp; | 
|---|
|  | 354 |  | 
|---|
|  | 355 | RegisterPIGraphicsHelp(mpiac); | 
|---|
|  | 356 |  | 
|---|
|  | 357 | grp = "Graphics"; | 
|---|
|  | 358 | string gdesc = "Basic graphics and object display commands"; | 
|---|
|  | 359 | mpiac->AddHelpGroup(grp, gdesc); | 
|---|
|  | 360 | kw = "zone"; | 
|---|
|  | 361 | usage = "To Divide the Graphic window \n  Usage: zone [nx=1 ny=1]"; | 
|---|
|  | 362 | usage += "\n  Related commands: newwin"; | 
|---|
|  | 363 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 364 | kw = "newwin"; | 
|---|
|  | 365 | usage = "To Create a New Graphic window, with zones \n"; | 
|---|
|  | 366 | usage += "  Window size can be specified \n"; | 
|---|
|  | 367 | usage += "    Usage: newwin [nx ny [sizeX sizeY]] "; | 
|---|
|  | 368 | usage += "\n  Related commands: zone"; | 
|---|
|  | 369 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 370 | kw = "stacknext"; | 
|---|
|  | 371 | usage = "Displays the next widget on stack window \n  Usage: stacknext"; | 
|---|
|  | 372 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 373 |  | 
|---|
|  | 374 | kw = "graphicatt"; | 
|---|
|  | 375 | usage = "To change default graphic options\n  Usage: graphicatt att_list\n"; | 
|---|
|  | 376 | usage += "att_list=def back to default values, Example: gratt 'red circlemarker5'"; | 
|---|
|  | 377 | usage += "\n ------------------ Graphic attribute list ------------------\n"; | 
|---|
|  | 378 | usage += ">> Colors: defcol black white grey red blue green yellow\n"; | 
|---|
|  | 379 | usage += "           magenta cyan turquoise navyblue orange siennared purple\n"; | 
|---|
|  | 380 | usage += "           limegreen gold violet violetred blueviolet darkviolet\n"; | 
|---|
|  | 381 | usage += "   or \"color=name\" \"fgcolor=name\" \"bgcolor=name\" ex: \"color=red\"\n"; | 
|---|
|  | 382 | usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline\n"; | 
|---|
|  | 383 | usage += "          thickdashedline dottedline thindottedline thickdottedline\n"; | 
|---|
|  | 384 | usage += "   or \"line=type,width\"   ex: \"line=dotted,7\"\n"; | 
|---|
|  | 385 | usage += ">> Fonts:\n"; | 
|---|
|  | 386 | usage += "   > Att: deffontatt normalfont boldfont italicfont bolditalicfont \n"; | 
|---|
|  | 387 | usage += "           smallfont smallboldfont smallitalicfont smallbolditalicfont\n"; | 
|---|
|  | 388 | usage += "           bigfont bigboldfont bigitalicfont bigbolditalicfont\n"; | 
|---|
|  | 389 | usage += "           hugefont  hugeboldfont hugeitalicfont hugebolditalicfont\n"; | 
|---|
|  | 390 | usage += "   > Names: deffont courierfont helveticafont timesfont symbolfont \n"; | 
|---|
|  | 391 | usage += "   or \"font=name,type,size\"   ex: \"font=courrier,bolditalic,10\"\n"; | 
|---|
|  | 392 | usage += ">> Marker: dotmarker<T>  plusmarker<T>  crossmarker<T> circlemarker<T>\n"; | 
|---|
|  | 393 | usage += "           fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T>\n"; | 
|---|
|  | 394 | usage += "           ftrianglemarker<T>  starmarker<T>  fstarmarker<T>\n"; | 
|---|
|  | 395 | usage += "       with <T> = 1 3 5 7 .. 15 , Example fboxmarker5 , plusmarker9 ...\n"; | 
|---|
|  | 396 | usage += "   or \"marker=type,size\"   ex: \"marker=plus,10\"\n"; | 
|---|
|  | 397 | usage += ">> ArrowMarker: basicarrow<T>  trianglearrow<T>  ftrianglearrow<T>\n"; | 
|---|
|  | 398 | usage += "                arrowshapedarrow<T> farrowshapedarrow<T>\n"; | 
|---|
|  | 399 | usage += "       with <T> = 5 7 .. 15 , Example trianglearrow7 ...\n"; | 
|---|
|  | 400 | usage += "   or \"arrow=type,size\"   ex: \"arrow=arrowshaped,10\"\n"; | 
|---|
|  | 401 | usage += "------ Specific options for image displays:\n"; | 
|---|
|  | 402 | usage += ">> ColorTables: defcmap  grey32  invgrey32  colrj32  colbr32\n"; | 
|---|
|  | 403 | usage += "                grey128  invgrey128  colrj128  colbr128\n"; | 
|---|
|  | 404 | usage += "                red32cm  green32cm  blue32cm  yellow32cm\n"; | 
|---|
|  | 405 | usage += "                orange32cm cyan32cm violet32cm\n"; | 
|---|
|  | 406 | usage += "                midas_pastel midas_heat midas_rainbow3 midas_bluered\n"; | 
|---|
|  | 407 | usage += "                midas_bluewhite midas_redwhite\n"; | 
|---|
|  | 408 | usage += "                multicol16 multicol64\n"; | 
|---|
|  | 409 | usage += ">> revcmap : reverse colorMap\n"; | 
|---|
|  | 410 | usage += ">> ZoomFactors :  zoomxN   ex: zoomx1 zoomx2 zoomx3 ...\n"; | 
|---|
|  | 411 | usage += "                  zoom/N   ex: zoom/2 zoom/3 zoom/4 ...\n"; | 
|---|
|  | 412 | usage += ">> imagecenter=ix,iy : Position the image in widget\n"; | 
|---|
|  | 413 | usage += ">> lut=ltyp,min,max : Sets LUT type and min/max\n"; | 
|---|
|  | 414 | usage += "                      (ltyp=lin/log/sqrt/square)\n"; | 
|---|
|  | 415 | usage += ">> invx,invy,exchxy : image axes configuration\n"; | 
|---|
|  | 416 | usage += ">> for Axes / Axe labels / LogScale / xylimits / defdrrect\n"; | 
|---|
|  | 417 | usage += "       see setaxesatt command\n"; | 
|---|
|  | 418 | usage += "--- General purpose options:\n"; | 
|---|
|  | 419 | usage += ">> stat,stats / nsta,nstat,nostat,nostats : Toggle statistic display\n"; | 
|---|
|  | 420 | usage += ">> title,tit / notitle,notit -> Toggle automatic title display\n"; | 
|---|
|  | 421 | usage += ">> Choose display window: next same win stack inset\n"; | 
|---|
|  | 422 | usage += "\n"; | 
|---|
|  | 423 | usage += "   Related commands: setaxesatt setinsetlimits "; | 
|---|
|  | 424 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 425 |  | 
|---|
|  | 426 | kw = "setaxesatt"; | 
|---|
|  | 427 | usage = "To set default axes attributes \n  Usage: setaxesatt att_list \n"; | 
|---|
|  | 428 | usage += "Color/Line/Font attributes and axes attributes \n"; | 
|---|
|  | 429 | usage += ">> Axes: axesnone stdaxes=defaxes=boxaxes boxaxesgrid \n"; | 
|---|
|  | 430 | usage += "         fineaxes fineaxesgrid centeredaxes finecenteredaxes \n"; | 
|---|
|  | 431 | usage += "         centeredaxesgrid finecenteredaxesgrid\n"; | 
|---|
|  | 432 | usage += "         axescenter=x0,y0 (only with centered axes, default \"axescenter=\")\n"; | 
|---|
|  | 433 | usage += "         grid nogrid labels nolabels  \n"; | 
|---|
|  | 434 | usage += "         ticks noticks minorticks nominorticks \n"; | 
|---|
|  | 435 | usage += "         extticks intticks extintticks \n"; | 
|---|
|  | 436 | usage += "         nbticks=X_NTicks,Y_NTicks  \n"; | 
|---|
|  | 437 | usage += "         tickslen=MajTickLenFrac,MinTickLenFrac \n"; | 
|---|
|  | 438 | usage += ">> Axe labels font size: fixedfontsize/autofontsize=fszf \n"; | 
|---|
|  | 439 | usage += "         autofontsize=fsizef: Font size computed automatically \n"; | 
|---|
|  | 440 | usage += "         fixedfontsize: Use font size attribute (BaseDrawer) \n"; | 
|---|
|  | 441 | usage += ">> Scale type: linx liny logx logy -> Lin/Log Scales for 2D plots \n"; | 
|---|
|  | 442 | usage += ">> xylimits=xmin,xmax,ymin,ymax  -> Forces X-Y limits in 2-D plots \n"; | 
|---|
|  | 443 | usage += ">> defdrrect=xmin,xmax,ymin,ymax -> Defines drawing rectangle 2-D plots \n"; | 
|---|
|  | 444 | usage += "          The rectangle is defined as a fraction of the widget size\n"; | 
|---|
|  | 445 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 446 |  | 
|---|
|  | 447 | kw = "setinsetlimits"; | 
|---|
|  | 448 | usage = "Define the display rectangle for drawers added as insets \n"; | 
|---|
|  | 449 | usage += " over existing graphic objects - limits expressed as fraction \n"; | 
|---|
|  | 450 | usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. "; | 
|---|
|  | 451 | usage += " Usage: setinsetlimits xmin xmax ymin ymax"; | 
|---|
|  | 452 | usage += "\n  Related commands: graphicatt /inset"; | 
|---|
|  | 453 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 454 |  | 
|---|
|  | 455 | kw = "drpanel"; | 
|---|
|  | 456 | usage = "Creates a new 2D drawing zone for addtext, addline \n"; | 
|---|
|  | 457 | usage += " Usage: drpanel xmin xmax ymin ymax [GrAtt] [Name]"; | 
|---|
|  | 458 | usage += "\n  Related commands: addtext addline addrect addcirc ..."; | 
|---|
|  | 459 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 460 |  | 
|---|
|  | 461 | kw = "addtext"; | 
|---|
|  | 462 | usage = "Adds a text string to the current graphic object"; | 
|---|
|  | 463 | usage += "\n at the specified position (+ color/font/pos/dir attributes) "; | 
|---|
|  | 464 | usage += "\n The Base/AxesDrawer is used to handle added text strings" ; | 
|---|
|  | 465 | usage += "\n Alt<E> to remove the added element"; | 
|---|
|  | 466 | usage += "\n  Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]"; | 
|---|
|  | 467 | usage += "\n  (use quotes '' for multi word text strings) "; | 
|---|
|  | 468 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 469 | usage += "\n Text position/direction attribute: "; | 
|---|
|  | 470 | usage += "\n      horizleft horizcenter horizright"; | 
|---|
|  | 471 | usage += "\n      vertbottom vertcenter verttop "; | 
|---|
|  | 472 | usage += "\n      textdirhoriz textdirvertup textdirvertdown "; | 
|---|
|  | 473 | usage += "\n  Related commands: addctext addline addarrow addrect addfrect"; | 
|---|
|  | 474 | usage += "\n      addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt"; | 
|---|
|  | 475 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 476 |  | 
|---|
|  | 477 | kw = "addctext"; | 
|---|
|  | 478 | usage = "Adds a composite text string with superscript and subscripts "; | 
|---|
|  | 479 | usage += "\n at the specified position (+ color/font/pos/dir attributes) "; | 
|---|
|  | 480 | usage += "\n  Usage: addctext x y Text sUp sDown [ColFontPosAtt] [UpDownFontAtt] [fgnc]"; | 
|---|
|  | 481 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 482 | usage += "\n  Related commands: addtext addline addrect ..."; | 
|---|
|  | 483 | usage += "\n      (See command addtext and graphicatt for more details)"; | 
|---|
|  | 484 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 485 |  | 
|---|
|  | 486 | kw = "addline"; | 
|---|
|  | 487 | usage = "Adds a line to the current graphic object"; | 
|---|
|  | 488 | usage += "\n at the specified position (+ graphic attribute)"; | 
|---|
|  | 489 | usage += "\n The Base/AxesDrawer is used to handle added lines"; | 
|---|
|  | 490 | usage += "\n Alt<E> to remove the added element"; | 
|---|
|  | 491 | usage += "\n  Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 492 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 493 | usage += "\n  Related commands: addarrow addtext addrect addfrect "; | 
|---|
|  | 494 | usage += "\n       addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 495 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 496 |  | 
|---|
|  | 497 | kw = "addarrow"; | 
|---|
|  | 498 | usage = "Adds an arrow to the current graphic object"; | 
|---|
|  | 499 | usage += "\n at the specified position (+ graphic attribute)"; | 
|---|
|  | 500 | usage += "\n The Base/AxesDrawer is used to handle added lines"; | 
|---|
|  | 501 | usage += "\n Alt<E> to remove the added element"; | 
|---|
|  | 502 | usage += "\n  Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 503 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 504 | usage += "\n  Related commands: addline addtext addrect addfrect "; | 
|---|
|  | 505 | usage += "\n       addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 506 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 507 | kw = "addarrow_nc"; | 
|---|
|  | 508 |  | 
|---|
|  | 509 | kw = "addrect"; | 
|---|
|  | 510 | usage = "Adds a rectangle to the current graphic object"; | 
|---|
|  | 511 | usage += "\n between the specified positions (+ graphic attribute)"; | 
|---|
|  | 512 | usage += "\n The Base/AxesDrawer is used to handle added rectangle"; | 
|---|
|  | 513 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 514 | usage += "\n  Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 515 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 516 | usage += "\n  Related commands: addtext addline addarrow addfrect"; | 
|---|
|  | 517 | usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 518 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 519 |  | 
|---|
|  | 520 | kw = "addfrect"; | 
|---|
|  | 521 | usage = "Adds a filled rectangle to the current graphic object"; | 
|---|
|  | 522 | usage += "\n between the specified positions (+ graphic attribute)"; | 
|---|
|  | 523 | usage += "\n The Base/AxesDrawer is used to handle added rectangle"; | 
|---|
|  | 524 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 525 | usage += "\n  Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 526 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 527 | usage += "\n  Related commands: addtext addline addarrow addrect"; | 
|---|
|  | 528 | usage += "\n       addcirc addfcirc addpoly addfpoly graphicatt"; | 
|---|
|  | 529 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 530 |  | 
|---|
|  | 531 | kw = "addmarker"; | 
|---|
|  | 532 | usage = "Adds a marker to the current graphic object"; | 
|---|
|  | 533 | usage += "\n at the specified position (+ graphic attribute)"; | 
|---|
|  | 534 | usage += "\n The Base/AxesDrawer is used to handle added circles"; | 
|---|
|  | 535 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 536 | usage += "\n  Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 537 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 538 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 539 | usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 540 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 541 |  | 
|---|
|  | 542 | kw = "addcirc"; | 
|---|
|  | 543 | usage = "Adds a circle to the current graphic object"; | 
|---|
|  | 544 | usage += "\n with the specified center and radius (+ graphic attribute)"; | 
|---|
|  | 545 | usage += "\n The Base/AxesDrawer is used to handle added circles"; | 
|---|
|  | 546 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 547 | usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 548 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 549 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 550 | usage += "\n       addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 551 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 552 |  | 
|---|
|  | 553 | kw = "addfcirc"; | 
|---|
|  | 554 | usage = "Adds a filled circle to the current graphic object"; | 
|---|
|  | 555 | usage += "\n with the specified center and radius (+ graphic attribute)"; | 
|---|
|  | 556 | usage += "\n The Base/AxesDrawer is used to handle added circles"; | 
|---|
|  | 557 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 558 | usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 559 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 560 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 561 | usage += "\n       addcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 562 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 563 |  | 
|---|
|  | 564 | kw = "addoval"; | 
|---|
|  | 565 | usage = "Adds an oval (ellipse) to the current graphic object"; | 
|---|
|  | 566 | usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)"; | 
|---|
|  | 567 | usage += "\n The Base/AxesDrawer is used to handle added rectangle"; | 
|---|
|  | 568 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 569 | usage += "\n  Usage: addoval xc yc dx dy [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 570 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 571 | usage += "\n  Related commands: addfoval addline addarrow addfrect addcirc addfcirc"; | 
|---|
|  | 572 | usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 573 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 574 |  | 
|---|
|  | 575 | kw = "addfoval"; | 
|---|
|  | 576 | usage = "Adds a filled oval (ellipse) to the current graphic object"; | 
|---|
|  | 577 | usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)"; | 
|---|
|  | 578 | usage += "\n The Base/AxesDrawer is used to handle added rectangle"; | 
|---|
|  | 579 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 580 | usage += "\n  Usage: addfoval xc yc dx dy [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 581 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 582 | usage += "\n  Related commands: addoval addline addarrow addfrect addcirc addfcirc"; | 
|---|
|  | 583 | usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 584 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 585 |  | 
|---|
|  | 586 | kw = "addarca"; | 
|---|
|  | 587 | usage = "Adds an arc to the current graphic object"; | 
|---|
|  | 588 | usage += "\n defined by the circle (center+radius), start angle and angular extension"; | 
|---|
|  | 589 | usage += "\n Angles are specified in degrees"; | 
|---|
|  | 590 | usage += "\n  Usage: addarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 591 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 592 | usage += "\n  Related commands: addtext addline addfarca addarc ..."; | 
|---|
|  | 593 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 594 |  | 
|---|
|  | 595 | kw = "addfarca"; | 
|---|
|  | 596 | usage = "Adds a filled arc to the current graphic object"; | 
|---|
|  | 597 | usage += "\n defined by the circle (center+radius), start angle and angular extension"; | 
|---|
|  | 598 | usage += "\n Angles are specified in degrees"; | 
|---|
|  | 599 | usage += "\n  Usage: addfarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 600 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 601 | usage += "\n  Related commands: addtext addline addarca addarc ..."; | 
|---|
|  | 602 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 603 |  | 
|---|
|  | 604 | kw = "addarc"; | 
|---|
|  | 605 | usage = "Adds an arc to the current graphic object"; | 
|---|
|  | 606 | usage += "\n defined by 3 points (+ graphic attribute)"; | 
|---|
|  | 607 | usage += "\n The Base/AxesDrawer is used to handle added arcs"; | 
|---|
|  | 608 | usage += "\n Alt<E> to remove the added element"; | 
|---|
|  | 609 | usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 610 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 611 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 612 | usage += "\n       addcirc addfcirc addfarc addarca addpoly addfpoly graphicatt"; | 
|---|
|  | 613 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 614 |  | 
|---|
|  | 615 | kw = "addfarc"; | 
|---|
|  | 616 | usage = "Adds a filled arc to the current graphic object"; | 
|---|
|  | 617 | usage += "\n defined by 3 points (+ graphic attribute)"; | 
|---|
|  | 618 | usage += "\n The Base/AxesDrawer is used to handle added arcs"; | 
|---|
|  | 619 | usage += "\n Alt<E> to remove added element"; | 
|---|
|  | 620 | usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 621 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 622 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 623 | usage += "\n       addcirc addfcirc addfarc addpoly addfpoly graphicatt"; | 
|---|
|  | 624 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 625 |  | 
|---|
|  | 626 | kw = "addpoly"; | 
|---|
|  | 627 | usage = "Adds a polyline/polygon to the current graphic object"; | 
|---|
|  | 628 | usage += "\n  Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 629 | usage += "\n  Coordinates specified as pairs x,y in a single word (use simple or double quotes"; | 
|---|
|  | 630 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 631 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 632 | usage += "\n       addcirc addfcirc addfarc  graphicatt"; | 
|---|
|  | 633 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 634 |  | 
|---|
|  | 635 | kw = "addfpoly"; | 
|---|
|  | 636 | usage = "Adds a filled polygon to the current graphic object"; | 
|---|
|  | 637 | usage += "\n  Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]"; | 
|---|
|  | 638 | usage += "\n  Coordinates specified as pairs x,y in a single word (use simple or double quotes"; | 
|---|
|  | 639 | usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; | 
|---|
|  | 640 | usage += "\n  Related commands: addtext addline addarrow addfrect addfrect"; | 
|---|
|  | 641 | usage += "\n       addcirc addfcirc addfarc  graphicatt"; | 
|---|
|  | 642 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); | 
|---|
|  | 643 |  | 
|---|
|  | 644 | kw = "settitle"; | 
|---|
|  | 645 | usage = "Set the title string (top title / bottom title) for the current graphic object"; | 
|---|
|  | 646 | usage += "\n  Usage: settitle TopTitle [BottomTitle] [fontAtt]"; | 
|---|
|  | 647 | usage += "\n  Related commands: addtext graphicatt"; | 
|---|
|  | 648 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 649 |  | 
|---|
|  | 650 | kw = "addtitle"; | 
|---|
|  | 651 | usage = "Set the title string (top title / bottom title) \n"; | 
|---|
|  | 652 | usage += "   alias for settitle "; | 
|---|
|  | 653 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 654 |  | 
|---|
|  | 655 | kw = "setaxelabels"; | 
|---|
|  | 656 | usage = "Set the X and Y axis labels for the current 2D graphic object \n"; | 
|---|
|  | 657 | usage += "\n  Usage: setaxelabels xLabel yLabel [ColorFntAtt]"; | 
|---|
|  | 658 | usage += "\n  Related commands: settitle addtext graphicatt"; | 
|---|
|  | 659 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 660 |  | 
|---|
|  | 661 | kw = "addaxelabels"; | 
|---|
|  | 662 | usage = "Set the X and Y axis labels for the current 2D graphic object"; | 
|---|
|  | 663 | usage += "   alias for setaxelabels "; | 
|---|
|  | 664 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 665 |  | 
|---|
|  | 666 | grp = "Obj. Display"; | 
|---|
|  | 667 | kw = "disp"; | 
|---|
|  | 668 | usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]"; | 
|---|
|  | 669 | usage += "\n  Related commands: surf nt2d nt3d vecplot"; | 
|---|
|  | 670 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 671 | kw = "imag"; | 
|---|
|  | 672 | usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]"; | 
|---|
|  | 673 | usage += "\n  Related commands: disp imagnav surf nt2d nt3d vecplot"; | 
|---|
|  | 674 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 675 | kw = "imagnav"; | 
|---|
|  | 676 | usage = "Displays an object as an image with the ImageNavigator viewer \n"; | 
|---|
|  | 677 | usage += "Usage: imagnav nameobj [graphic_attributes]"; | 
|---|
|  | 678 | usage += "\n  Related commands: disp imag surf nt2d nt3d vecplot"; | 
|---|
|  | 679 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 680 | kw = "surf"; | 
|---|
|  | 681 | usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]"; | 
|---|
|  | 682 | usage += "\n  Related commands: disp nt2d nt3d vecplot"; | 
|---|
|  | 683 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 684 | kw = "nt2d"; | 
|---|
|  | 685 | usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple "; | 
|---|
|  | 686 | usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]"; | 
|---|
|  | 687 | usage += "\n  Related commands: disp  surf  nt3d  gfd2d vecplot"; | 
|---|
|  | 688 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 689 | kw = "nt3d"; | 
|---|
|  | 690 | usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple "; | 
|---|
|  | 691 | usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]"; | 
|---|
|  | 692 | usage += "\n  Related commands: disp  surf  nt2d gfd3d "; | 
|---|
|  | 693 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 694 | kw = "vecplot"; | 
|---|
|  | 695 | usage = "Displays Points (X-Y) with coordinates defined by two vectors "; | 
|---|
|  | 696 | usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]"; | 
|---|
|  | 697 | usage += "\n  Related commands: disp nt2d "; | 
|---|
|  | 698 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 699 |  | 
|---|
|  | 700 | kw = "bargraph"; | 
|---|
|  | 701 | usage = "Bar-Graph view of a sequence of values "; | 
|---|
|  | 702 | usage += "\n Usage: bargraph ValueVarName [gr_opt]  "; | 
|---|
|  | 703 | usage += "\n    or  bargraph ValueVarName LabelVarName ColPosVarName [gr_opt] "; | 
|---|
|  | 704 | usage += "\n  ValueVarName,LabelVarName,ColPosVarName are PIACmd interpreter "; | 
|---|
|  | 705 | usage += "\n     variable name (vectors) "; | 
|---|
|  | 706 | usage += "\n - ValueVarName: Sequence of values to be represented"; | 
|---|
|  | 707 | usage += "\n - LabelVarName: Corresponding labels"; | 
|---|
|  | 708 | usage += "\n - ColPosVarName: Corresponding colors or color,position pairs "; | 
|---|
|  | 709 | usage += "\n Use a dash (-) or ! as placeholder for LabelVarName/ColPosVarName"; | 
|---|
|  | 710 | usage += "\n Specific graphic options: fill/nofill packfrac=value "; | 
|---|
|  | 711 | usage += "\n    horizontalbars/verticalbars  barvaluelabel/nobarvaluelabel"; | 
|---|
|  | 712 | usage += "\n Related commands: disp nt2d vecplot ..."; | 
|---|
|  | 713 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 714 | kw = "textdrawer"; | 
|---|
|  | 715 | usage = "Multi line text darwer "; | 
|---|
|  | 716 | usage += "\n Usage : textdrawer LinesVarName AttVarName [gr_opt] "; | 
|---|
|  | 717 | usage += "\n  LinesVarName,AttVarName are PIACmd interpreter variables"; | 
|---|
|  | 718 | usage += "\n - LinesVarName: Lines to be displayed"; | 
|---|
|  | 719 | usage += "\n - AttVarName: Corresponding font/marker/color attributes"; | 
|---|
|  | 720 | usage += "\n Use a dash (-) or ! as placeholder for AttVarName"; | 
|---|
|  | 721 | usage += "\n Specific graphic options: frame/noframe"; | 
|---|
|  | 722 | usage += "\n Related commands: disp ... "; | 
|---|
|  | 723 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 724 |  | 
|---|
|  | 725 |  | 
|---|
|  | 726 | // Ceci est maintenant obsolete, on garde pour info. | 
|---|
|  | 727 | kw = "gfd2d"; | 
|---|
|  | 728 | usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data "; | 
|---|
|  | 729 | usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]"; | 
|---|
|  | 730 | usage += "\n  Related commands: gfd3d nt2d nt3d "; | 
|---|
|  | 731 | usage += "\n  ----- OBSOLETE: utilisez nt2d -----"; | 
|---|
|  | 732 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 733 | kw = "gfd3d"; | 
|---|
|  | 734 | usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data "; | 
|---|
|  | 735 | usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]"; | 
|---|
|  | 736 | usage += "\n  Related commands: gfd2d nt2d nt3d "; | 
|---|
|  | 737 | usage += "\n  ----- OBSOLETE: utilisez nt3d -----"; | 
|---|
|  | 738 | mpiac->RegisterCommand(kw, usage, this, grp); | 
|---|
|  | 739 |  | 
|---|
|  | 740 | } | 
|---|
|  | 741 |  | 
|---|
|  | 742 |  | 
|---|
|  | 743 | /* --Methode-- */ | 
|---|
|  | 744 | void PIAGraphicExecutor::RegisterPIGraphicsHelp(PIACmd* piac) | 
|---|
|  | 745 | // Methode pour enregistrer le Help des Widgets et Windows de piapp | 
|---|
|  | 746 | { | 
|---|
|  | 747 | string kw,grp,usage; | 
|---|
|  | 748 |  | 
|---|
|  | 749 | grp = "Graphics"; | 
|---|
|  | 750 |  | 
|---|
|  | 751 | kw = "PIImage"; | 
|---|
|  | 752 | usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n"; | 
|---|
|  | 753 | usage += "and controls a zoom widget, as well as a global image view widget \n"; | 
|---|
|  | 754 | usage += ">>>> Mouse controls : \n"; | 
|---|
|  | 755 | usage += "o Button-1: Display current coordinates and pixel value\n"; | 
|---|
|  | 756 | usage += "  Position the cursor an refresh the zoom widget\n"; | 
|---|
|  | 757 | usage += "o Button-2: Defines an image zone and positions the cursor \n"; | 
|---|
|  | 758 | usage += "o Button-3: Moves the viewed portion of the array inside the window \n"; | 
|---|
|  | 759 | usage += ">>>> Keyboard controls : \n"; | 
|---|
|  | 760 | usage += "o <Alt>R : Refresh display \n"; | 
|---|
|  | 761 | usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n"; | 
|---|
|  | 762 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n"; | 
|---|
|  | 763 | usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n"; | 
|---|
|  | 764 | usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n"; | 
|---|
|  | 765 | usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n"; | 
|---|
|  | 766 | usage += "o <Alt>X : Show/Hide the Cut Window \n"; | 
|---|
|  | 767 | usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n"; | 
|---|
|  | 768 | usage += "o <Alt>E : Removes the last added graphic element \n"; | 
|---|
|  | 769 | usage += "o <Alt>+ or <Cntl>+ : Zoom in \n"; | 
|---|
|  | 770 | usage += "o <Alt>- or <Cntl>- : Zoom out \n"; | 
|---|
|  | 771 | usage += "o Cursor keys : Moves the image cursor \n"; | 
|---|
|  | 772 | piac->RegisterHelp(kw, usage, grp); | 
|---|
|  | 773 |  | 
|---|
|  | 774 | kw = "PIScDrawWdg"; | 
|---|
|  | 775 | usage = "Manages display of 2-D drawers with interactive zoom \n"; | 
|---|
|  | 776 | usage += ">>>> Mouse controls : \n"; | 
|---|
|  | 777 | usage += "o Button-1: Display current coordinates \n"; | 
|---|
|  | 778 | usage += "o Button-2: Defines a rectangle for zoom \n"; | 
|---|
|  | 779 | usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n"; | 
|---|
|  | 780 | usage += ">>>> Keyboard controls : \n"; | 
|---|
|  | 781 | usage += "o <Alt>R : Refresh display \n"; | 
|---|
|  | 782 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n"; | 
|---|
|  | 783 | usage += "           (2-D histograms, contour plot ...) \n"; | 
|---|
|  | 784 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n"; | 
|---|
|  | 785 | usage += "           Drawer 0 manages the axes, as well as the added text \n"; | 
|---|
|  | 786 | usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n"; | 
|---|
|  | 787 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n"; | 
|---|
|  | 788 | usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n"; | 
|---|
|  | 789 | usage += "o <Alt>E : Removes the last added graphic element \n"; | 
|---|
|  | 790 | usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n"; | 
|---|
|  | 791 | usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n"; | 
|---|
|  | 792 | usage += "o <Alt>L : Deactivate DX,DY print (see below)\n"; | 
|---|
|  | 793 | usage += ">>>> Mouse + Keyboard controls : \n"; | 
|---|
|  | 794 | usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n"; | 
|---|
|  | 795 | piac->RegisterHelp(kw, usage, grp); | 
|---|
|  | 796 |  | 
|---|
|  | 797 | kw = "PIDraw3DWdg"; | 
|---|
|  | 798 | usage = "Manages display of 3-D objects (drawers)  \n"; | 
|---|
|  | 799 | usage += ">>>> Mouse controls : \n"; | 
|---|
|  | 800 | usage += "o Button-2: Rotates the observer (camera) around object \n"; | 
|---|
|  | 801 | usage += "o Shift-Button-2: Rotates object with camera fixed \n"; | 
|---|
|  | 802 | usage += "  The object rotation mode can be assigned to Button-2 with <Alt>S \n"; | 
|---|
|  | 803 | usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n"; | 
|---|
|  | 804 | usage += ">>>> Keyboard controls : \n"; | 
|---|
|  | 805 | usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n"; | 
|---|
|  | 806 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n"; | 
|---|
|  | 807 | usage += "           (2-D histograms, contour plot ...) \n"; | 
|---|
|  | 808 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n"; | 
|---|
|  | 809 | usage += "           Drawer 0 manages the axes, as well as the added text \n"; | 
|---|
|  | 810 | usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n"; | 
|---|
|  | 811 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n"; | 
|---|
|  | 812 | usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n"; | 
|---|
|  | 813 | usage += "o <Alt>E : Removes the last added graphic element \n"; | 
|---|
|  | 814 | usage += "o <Alt>A : Activate/Deactivate axes drawing \n"; | 
|---|
|  | 815 | usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n"; | 
|---|
|  | 816 | piac->RegisterHelp(kw, usage, grp); | 
|---|
|  | 817 |  | 
|---|
|  | 818 | kw = "Windows"; | 
|---|
|  | 819 | usage = "Objects can be displayed in different windows, or overlayed on the \n"; | 
|---|
|  | 820 | usage += "previous display. The graphics attributes next,win,stack,same control \n"; | 
|---|
|  | 821 | usage += "the display window. \n"; | 
|---|
|  | 822 | usage += "o GraphicWindow : This is the default mode (gr_att=next)\n"; | 
|---|
|  | 823 | usage += "  Graphic windows can be divided int zones. Object is displayed \n"; | 
|---|
|  | 824 | usage += "  in the next available position, removing a previously displayed \n"; | 
|---|
|  | 825 | usage += "  widget if necessary \n"; | 
|---|
|  | 826 | usage += "o Window : An object is displayed in its own window (gr_att= win) \n"; | 
|---|
|  | 827 | usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n"; | 
|---|
|  | 828 | usage += "  A single widget is displayed a any time. Different widgets in a StackWindow \n"; | 
|---|
|  | 829 | usage += "  can be displayed using the stacknext command, as well as the StackTools item \n"; | 
|---|
|  | 830 | usage += "  in the Tools menu (from Menubar). An automatic cyclic display mode can also \n"; | 
|---|
|  | 831 | usage += "  be activated using the StackTools menu (Blink) \n"; | 
|---|
|  | 832 | usage += "o Most objects can be also be displayed overlayed \n"; | 
|---|
|  | 833 | usage += "  on the last displayed widget (gr_att= same) \n"; | 
|---|
|  | 834 | usage += "o The overlay can be on a selected rectangle of the \n"; | 
|---|
|  | 835 | usage += "  last displayed widget (gr_att= inset) - See setinsetlimits\n"; | 
|---|
|  | 836 | usage += "\n  Related commands: newwin zone stacknext graphicatt setinsetlimits"; | 
|---|
|  | 837 | piac->RegisterHelp(kw, usage, grp); | 
|---|
|  | 838 |  | 
|---|
|  | 839 | kw = "PIConsole"; | 
|---|
|  | 840 | usage = "Text output area and command editing window (console) \n"; | 
|---|
|  | 841 | usage += ">>>> Mouse controls : \n"; | 
|---|
|  | 842 | usage += "o Button-1: Rectangle selection for copy/paste \n"; | 
|---|
|  | 843 | usage += "o Button-2: Paste text in the command editing line \n"; | 
|---|
|  | 844 | usage += "o Button-3: activate display option menu \n"; | 
|---|
|  | 845 | usage += ">>>> Keyboard controls : \n"; | 
|---|
|  | 846 | usage += "o <Alt>O : activate display option menu   \n"; | 
|---|
|  | 847 | usage += "o <Alt>V : Paste text in the command editing line \n"; | 
|---|
|  | 848 | usage += "o <Alt>A : Selection of the whole window for copy \n"; | 
|---|
|  | 849 | usage += "o <Alt>L : Command history (List of command history buffer) \n"; | 
|---|
|  | 850 | usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n"; | 
|---|
|  | 851 | usage += "o <Ctl>E : Command editing -> Goto the end of line \n"; | 
|---|
|  | 852 | usage += "o <Ctl>K : Command editing -> Clear to the end of line \n"; | 
|---|
|  | 853 | usage += "o <Ctl>C : Command editing -> Clear the line \n"; | 
|---|
|  | 854 | usage += "o Cursor left,right : Command editing -> Move cursor \n"; | 
|---|
|  | 855 | usage += "o Cursor Up,Down : recall command from history buffer \n"; | 
|---|
|  | 856 | usage += "o Backspace,Del : Command editing \n"; | 
|---|
|  | 857 | usage += "o <Return>,<Enter> : Execute command \n"; | 
|---|
|  | 858 | piac->RegisterHelp(kw, usage, grp); | 
|---|
|  | 859 | } | 
|---|
|  | 860 |  | 
|---|
|  | 861 | /* --Methode-- */ | 
|---|
|  | 862 | int PIAGraphicExecutor::BarGraph(string& keyw, vector<string>& tokens) | 
|---|
|  | 863 | { | 
|---|
|  | 864 | //PAS necessaire pour le moment-- if (kw != "bargraph") return 2; | 
|---|
|  | 865 | if (tokens.size() < 1) { | 
|---|
|  | 866 | cout << "Usage: bargraph ValueVarName [gr_opt]" << endl; | 
|---|
|  | 867 | cout << "   or  bargraph ValueVarName LabelVarName ColPosVarName [gr_opt]" << endl; | 
|---|
|  | 868 | return(0); | 
|---|
|  | 869 | } | 
|---|
|  | 870 | PIBarGraph* bgd = NULL; | 
|---|
|  | 871 | vector<string> barvals; | 
|---|
|  | 872 | string gropt; | 
|---|
|  | 873 | if (!mpiac->GetVar(tokens[0], barvals)) { | 
|---|
|  | 874 | cout << "bargraph/Error: No variable with name " << tokens[0] << endl; | 
|---|
|  | 875 | return(1); | 
|---|
|  | 876 | } | 
|---|
|  | 877 | if (tokens.size() < 3) { | 
|---|
|  | 878 | bgd = new PIBarGraph; | 
|---|
|  | 879 | for(int k=0; k<barvals.size(); k++) | 
|---|
|  | 880 | bgd->AddBar(atof(barvals[k].c_str())); | 
|---|
|  | 881 | if (tokens.size() > 1)  gropt = tokens[1]; | 
|---|
|  | 882 | } | 
|---|
|  | 883 | else { | 
|---|
|  | 884 | vector<string> barlabs; | 
|---|
|  | 885 | if (!mpiac->GetVar(tokens[1], barlabs)) { | 
|---|
|  | 886 | cout << "bargraph/Warning: No variable with name "  << tokens[1] | 
|---|
|  | 887 | << " using Values as labels " << endl; | 
|---|
|  | 888 | barlabs = barvals; | 
|---|
|  | 889 | } | 
|---|
|  | 890 | vector<string> barcols; | 
|---|
|  | 891 | if (!mpiac->GetVar(tokens[2], barcols)) { | 
|---|
|  | 892 | cout << "bargraph/Warning: No variable with name "  << tokens[1] | 
|---|
|  | 893 | << " using default attributes " << endl; | 
|---|
|  | 894 | for(int kad=0; kad<barvals.size(); kad++) barcols.push_back(""); | 
|---|
|  | 895 | } | 
|---|
|  | 896 | if ( (barvals.size() != barlabs.size()) || | 
|---|
|  | 897 | (barvals.size() != barcols.size()) ) { | 
|---|
|  | 898 | cout << "bargraph/Error: Variables " << tokens[0] << "," << tokens[1] | 
|---|
|  | 899 | << "," << tokens[2] << " have different sizes" << endl; | 
|---|
|  | 900 | return(1); | 
|---|
|  | 901 | } | 
|---|
|  | 902 | bgd = new PIBarGraph; | 
|---|
|  | 903 | // Synchronisation necessaire a cause de PIGraphicAtt qui peuvent faire appel a des fontes (Pb Serveur X) | 
|---|
|  | 904 | mImgApp->LockMutex();   // <ZThread> global event loop synchronisation | 
|---|
|  | 905 | for(int k=0; k<barvals.size(); k++) { | 
|---|
|  | 906 | double id = k+1; | 
|---|
|  | 907 | size_t p = barcols[k].find(','); | 
|---|
|  | 908 | vector<string> sgra; | 
|---|
|  | 909 | if (p < barcols[k].length()-1) { | 
|---|
|  | 910 | mImgApp->ParseDisplayOption(barcols[k].substr(0, p), sgra); | 
|---|
|  | 911 | id = atof(barcols[k].substr(p+1).c_str()); | 
|---|
|  | 912 | } | 
|---|
|  | 913 | else  mImgApp->ParseDisplayOption(barcols[k], sgra); | 
|---|
|  | 914 | PIGraphicAtt gracol(sgra); | 
|---|
|  | 915 | bgd->AddBar(id, atof(barvals[k].c_str()), barlabs[k], gracol.GetColor()); | 
|---|
|  | 916 | } | 
|---|
|  | 917 | mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation | 
|---|
|  | 918 | if (tokens.size() > 3)  gropt = tokens[3]; | 
|---|
|  | 919 | } | 
|---|
|  | 920 | string grname = "BarGraph"; | 
|---|
|  | 921 | mImgApp->DispScDrawer(bgd, grname, gropt); | 
|---|
|  | 922 | return 0; | 
|---|
|  | 923 | } | 
|---|
|  | 924 |  | 
|---|
|  | 925 | /* --Methode-- */ | 
|---|
|  | 926 | int PIAGraphicExecutor::TextDrawer(string& keyw, vector<string>& tokens) | 
|---|
|  | 927 | { | 
|---|
|  | 928 | if (tokens.size() < 2) { | 
|---|
|  | 929 | cout << "Usage: textdrawer TextLinesVarName AttVarName [gr_opt]" << endl; | 
|---|
|  | 930 | return(0); | 
|---|
|  | 931 | } | 
|---|
|  | 932 | vector<string> txtlines; | 
|---|
|  | 933 | if (!mpiac->GetVar(tokens[0], txtlines)) { | 
|---|
|  | 934 | cout << "textdrawer/Error: No variable with name" << tokens[0] << endl; | 
|---|
|  | 935 | return(1); | 
|---|
|  | 936 | } | 
|---|
|  | 937 | vector<string> lineatt; | 
|---|
|  | 938 | if (!mpiac->GetVar(tokens[1], lineatt)) { | 
|---|
|  | 939 | cout << "textdrawer/Warning: No variable with name" << tokens[1] | 
|---|
|  | 940 | << " using default attributes " << endl; | 
|---|
|  | 941 | for(int kad=0; kad<txtlines.size(); kad++) lineatt.push_back(""); | 
|---|
|  | 942 | } | 
|---|
|  | 943 | if ( (txtlines.size() != lineatt.size()) ) { | 
|---|
|  | 944 | cout << "textdrawer/Error: Variables " << tokens[0] << "," << tokens[1] | 
|---|
|  | 945 | << " have different sizes" << endl; | 
|---|
|  | 946 | return(1); | 
|---|
|  | 947 | } | 
|---|
|  | 948 | PITextDrawer* txd = new PITextDrawer; | 
|---|
|  | 949 | // Synchronisation necessaire a cause de PIGraphicAtt qui peuvent faire appel a des fontes (Pb Serveur X) | 
|---|
|  | 950 | mImgApp->LockMutex();   // <ZThread> global event loop synchronisation | 
|---|
|  | 951 | for(int k=0; k<txtlines.size(); k++) { | 
|---|
|  | 952 | vector<string> sgra; | 
|---|
|  | 953 | mImgApp->ParseDisplayOption(lineatt[k], sgra); | 
|---|
|  | 954 | PIGraphicAtt gra(sgra); | 
|---|
|  | 955 | txd->AddLine(txtlines[k], gra); | 
|---|
|  | 956 | } | 
|---|
|  | 957 | mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation | 
|---|
|  | 958 | string grname = "TextDrawer"; | 
|---|
|  | 959 | string gropt = "inset "; | 
|---|
|  | 960 | if (tokens.size() > 2)  gropt += tokens[2]; | 
|---|
|  | 961 | mImgApp->DispScDrawer(txd, grname, gropt); | 
|---|
|  | 962 | return 0; | 
|---|
|  | 963 | } | 
|---|