source: Sophya/trunk/SophyaPI/PIext/graphexecut.cc@ 4038

Last change on this file since 4038 was 3720, checked in by ansari, 16 years ago

Modif mineure ajout description des options d'affichage tableaux cdreal,cdimag,cdphase ds graphexecut.cc, Reza 28/12/2009

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