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