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

Last change on this file since 3563 was 3563, checked in by ansari, 17 years ago

Ajout commande setdefafsz ds graphexecut.cc pour changer la valeur globale par defaut pour PIDrawer::AutoFontSizeFraction, Reza 29/01/2009

File size: 47.8 KB
RevLine 
[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-- */
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 }
[3563]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 }
[2781]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,
[3269]294 tokens[5], tokens[6], ph, false, tokens[7], false);
[2781]295 }
[3279]296else 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]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("");
[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 }
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);
[3546]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}
[3550]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}
[2781]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 }
[3546]370
[2781]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";
[3528]457usage += " multicol16 multicol64 rgb216cm rgb512cm rgb4096cm\n";
[2781]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";
[3528]463usage += " (ltyp=lin/log/sqrt/square/rgb)\n";
[3296]464usage += ">> autolut=alt[,ns[,min,max]] : AutoLut method selection \n";
[3456]465usage += " (alt=minmax/meansig/hispeak/histail/hisrng)\n";
[2781]466usage += ">> invx,invy,exchxy : image axes configuration\n";
467usage += "--- General purpose options:\n";
468usage += ">> stat,stats / nsta,nstat,nostat,nostats : Toggle statistic display\n";
469usage += ">> title,tit / notitle,notit -> Toggle automatic title display\n";
470usage += ">> Choose display window: next same win stack inset\n";
[3296]471usage += ">> for Axes / Axe labels / LogScale / xylimits / defdrrect\n";
472usage += " see setaxesatt command\n";
[2781]473usage += "\n";
474usage += " Related commands: setaxesatt setinsetlimits ";
475mpiac->RegisterCommand(kw, usage, this, grp);
476
477kw = "setaxesatt";
478usage = "To set default axes attributes \n Usage: setaxesatt att_list \n";
479usage += "Color/Line/Font attributes and axes attributes \n";
480usage += ">> Axes: axesnone stdaxes=defaxes=boxaxes boxaxesgrid \n";
481usage += " fineaxes fineaxesgrid centeredaxes finecenteredaxes \n";
482usage += " centeredaxesgrid finecenteredaxesgrid\n";
483usage += " axescenter=x0,y0 (only with centered axes, default \"axescenter=\")\n";
484usage += " grid nogrid labels nolabels \n";
485usage += " ticks noticks minorticks nominorticks \n";
486usage += " extticks intticks extintticks \n";
487usage += " nbticks=X_NTicks,Y_NTicks \n";
488usage += " tickslen=MajTickLenFrac,MinTickLenFrac \n";
489usage += ">> Axe labels font size: fixedfontsize/autofontsize=fszf \n";
490usage += " autofontsize=fsizef: Font size computed automatically \n";
491usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
492usage += ">> Scale type: linx liny logx logy -> Lin/Log Scales for 2D plots \n";
[3482]493usage += ">> AxeDirection: Reverse X/Y axe drawing direction \n";
494usage += " revax revay axelr axedu (or axerl/axeud -> revax/revay) \n";
[2781]495usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n";
496usage += ">> defdrrect=xmin,xmax,ymin,ymax -> Defines drawing rectangle 2-D plots \n";
497usage += " The rectangle is defined as a fraction of the widget size\n";
498mpiac->RegisterCommand(kw, usage, this, grp);
499
[3563]500kw = "setdefafsz";
501usage = "Define the Global Default value for PIDrawer AutoFontSize Fraction \n";
502usage += " Usage: setdefafsz value \n";
503usage += " 0<value<1 : default PIDrawer font size, as a fraction of the widget size\n";
504usage += " Its value can be set by the PIDEFAFSZFRAC environment variable \n";
505usage += " See also graphic attributes : fixedfontsize autofontsize=frac ";
506mpiac->RegisterCommand(kw, usage, this, grp);
507
[2781]508kw = "setinsetlimits";
509usage = "Define the display rectangle for drawers added as insets \n";
510usage += " over existing graphic objects - limits expressed as fraction \n";
[3355]511usage += " graphic object size (0. .. 1.) Xmax at right, YMax top \n ";
[2781]512usage += " Usage: setinsetlimits xmin xmax ymin ymax";
513usage += "\n Related commands: graphicatt /inset";
514mpiac->RegisterCommand(kw, usage, this, grp);
515
516kw = "drpanel";
517usage = "Creates a new 2D drawing zone for addtext, addline \n";
518usage += " Usage: drpanel xmin xmax ymin ymax [GrAtt] [Name]";
519usage += "\n Related commands: addtext addline addrect addcirc ...";
520mpiac->RegisterCommand(kw, usage, this, grp);
521
[3551]522grp = "Graphic-Elts";
523gdesc = "Simple graphic objects (lines, circles, text...) creation and display";
524mpiac->AddHelpGroup(grp, gdesc);
525
[2781]526kw = "addtext";
527usage = "Adds a text string to the current graphic object";
528usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
529usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
530usage += "\n Alt<E> to remove the added element";
531usage += "\n Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]";
532usage += "\n (use quotes '' for multi word text strings) ";
533usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
534usage += "\n Text position/direction attribute: ";
535usage += "\n horizleft horizcenter horizright";
536usage += "\n vertbottom vertcenter verttop ";
537usage += "\n textdirhoriz textdirvertup textdirvertdown ";
538usage += "\n Related commands: addctext addline addarrow addrect addfrect";
539usage += "\n addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt";
[3551]540mpiac->RegisterCommand(kw, usage, this, grp);
[2781]541
542kw = "addctext";
543usage = "Adds a composite text string with superscript and subscripts ";
544usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
545usage += "\n Usage: addctext x y Text sUp sDown [ColFontPosAtt] [UpDownFontAtt] [fgnc]";
546usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
547usage += "\n Related commands: addtext addline addrect ...";
548usage += "\n (See command addtext and graphicatt for more details)";
[3551]549mpiac->RegisterCommand(kw, usage, this, grp);
[2781]550
551kw = "addline";
552usage = "Adds a line to the current graphic object";
553usage += "\n at the specified position (+ graphic attribute)";
554usage += "\n The Base/AxesDrawer is used to handle added lines";
555usage += "\n Alt<E> to remove the added element";
556usage += "\n Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
557usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
558usage += "\n Related commands: addarrow addtext addrect addfrect ";
559usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]560mpiac->RegisterCommand(kw, usage, this, grp);
[2781]561
562kw = "addarrow";
563usage = "Adds an arrow to the current graphic object";
564usage += "\n at the specified position (+ graphic attribute)";
565usage += "\n The Base/AxesDrawer is used to handle added lines";
566usage += "\n Alt<E> to remove the added element";
567usage += "\n Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
568usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
569usage += "\n Related commands: addline addtext addrect addfrect ";
570usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]571mpiac->RegisterCommand(kw, usage, this, grp);
[2781]572kw = "addarrow_nc";
573
574kw = "addrect";
575usage = "Adds a rectangle to the current graphic object";
576usage += "\n between the specified positions (+ graphic attribute)";
577usage += "\n The Base/AxesDrawer is used to handle added rectangle";
578usage += "\n Alt<E> to remove added element";
579usage += "\n Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
580usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
581usage += "\n Related commands: addtext addline addarrow addfrect";
582usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]583mpiac->RegisterCommand(kw, usage, this, grp);
[2781]584
585kw = "addfrect";
586usage = "Adds a filled rectangle to the current graphic object";
587usage += "\n between the specified positions (+ graphic attribute)";
588usage += "\n The Base/AxesDrawer is used to handle added rectangle";
589usage += "\n Alt<E> to remove added element";
590usage += "\n Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
591usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
592usage += "\n Related commands: addtext addline addarrow addrect";
593usage += "\n addcirc addfcirc addpoly addfpoly graphicatt";
[3551]594mpiac->RegisterCommand(kw, usage, this, grp);
[2781]595
596kw = "addmarker";
597usage = "Adds a marker to the current graphic object";
598usage += "\n at the specified position (+ graphic attribute)";
599usage += "\n The Base/AxesDrawer is used to handle added circles";
600usage += "\n Alt<E> to remove added element";
601usage += "\n Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]";
602usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
603usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
604usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]605mpiac->RegisterCommand(kw, usage, this, grp);
[2781]606
607kw = "addcirc";
608usage = "Adds a circle to the current graphic object";
609usage += "\n with the specified center and radius (+ graphic attribute)";
610usage += "\n The Base/AxesDrawer is used to handle added circles";
611usage += "\n Alt<E> to remove added element";
612usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
613usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
614usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
615usage += "\n addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]616mpiac->RegisterCommand(kw, usage, this, grp);
[2781]617
618kw = "addfcirc";
619usage = "Adds a filled circle to the current graphic object";
620usage += "\n with the specified center and radius (+ graphic attribute)";
621usage += "\n The Base/AxesDrawer is used to handle added circles";
622usage += "\n Alt<E> to remove added element";
623usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
624usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
625usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
626usage += "\n addcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]627mpiac->RegisterCommand(kw, usage, this, grp);
[2781]628
629kw = "addoval";
630usage = "Adds an oval (ellipse) to the current graphic object";
631usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)";
632usage += "\n The Base/AxesDrawer is used to handle added rectangle";
633usage += "\n Alt<E> to remove added element";
634usage += "\n Usage: addoval xc yc dx dy [GraphicAtt] [fgnc=false/true]";
635usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
636usage += "\n Related commands: addfoval addline addarrow addfrect addcirc addfcirc";
637usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]638mpiac->RegisterCommand(kw, usage, this, grp);
[2781]639
640kw = "addfoval";
641usage = "Adds a filled oval (ellipse) to the current graphic object";
642usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)";
643usage += "\n The Base/AxesDrawer is used to handle added rectangle";
644usage += "\n Alt<E> to remove added element";
645usage += "\n Usage: addfoval xc yc dx dy [GraphicAtt] [fgnc=false/true]";
646usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
647usage += "\n Related commands: addoval addline addarrow addfrect addcirc addfcirc";
648usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[3551]649mpiac->RegisterCommand(kw, usage, this, grp);
[2781]650
651kw = "addarca";
652usage = "Adds an arc to the current graphic object";
653usage += "\n defined by the circle (center+radius), start angle and angular extension";
654usage += "\n Angles are specified in degrees";
655usage += "\n Usage: addarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
656usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
657usage += "\n Related commands: addtext addline addfarca addarc ...";
[3551]658mpiac->RegisterCommand(kw, usage, this, grp);
[2781]659
660kw = "addfarca";
661usage = "Adds a filled arc to the current graphic object";
662usage += "\n defined by the circle (center+radius), start angle and angular extension";
663usage += "\n Angles are specified in degrees";
664usage += "\n Usage: addfarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
665usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
666usage += "\n Related commands: addtext addline addarca addarc ...";
[3551]667mpiac->RegisterCommand(kw, usage, this, grp);
[2781]668
669kw = "addarc";
670usage = "Adds an arc to the current graphic object";
671usage += "\n defined by 3 points (+ graphic attribute)";
672usage += "\n The Base/AxesDrawer is used to handle added arcs";
673usage += "\n Alt<E> to remove the added element";
674usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
675usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
676usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
677usage += "\n addcirc addfcirc addfarc addarca addpoly addfpoly graphicatt";
[3551]678mpiac->RegisterCommand(kw, usage, this, grp);
[2781]679
680kw = "addfarc";
681usage = "Adds a filled arc to the current graphic object";
682usage += "\n defined by 3 points (+ graphic attribute)";
683usage += "\n The Base/AxesDrawer is used to handle added arcs";
684usage += "\n Alt<E> to remove added element";
685usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
686usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
687usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
688usage += "\n addcirc addfcirc addfarc addpoly addfpoly graphicatt";
[3551]689mpiac->RegisterCommand(kw, usage, this, grp);
[2781]690
691kw = "addpoly";
692usage = "Adds a polyline/polygon to the current graphic object";
693usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]";
694usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes";
695usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
696usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
697usage += "\n addcirc addfcirc addfarc graphicatt";
[3551]698mpiac->RegisterCommand(kw, usage, this, grp);
[2781]699
700kw = "addfpoly";
701usage = "Adds a filled polygon to the current graphic object";
702usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]";
703usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes";
704usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
705usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
706usage += "\n addcirc addfcirc addfarc graphicatt";
[3551]707mpiac->RegisterCommand(kw, usage, this, grp);
[2781]708
709kw = "settitle";
710usage = "Set the title string (top title / bottom title) for the current graphic object";
711usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
712usage += "\n Related commands: addtext graphicatt";
713mpiac->RegisterCommand(kw, usage, this, grp);
714
715kw = "addtitle";
716usage = "Set the title string (top title / bottom title) \n";
717usage += " alias for settitle ";
718mpiac->RegisterCommand(kw, usage, this, grp);
719
720kw = "setaxelabels";
721usage = "Set the X and Y axis labels for the current 2D graphic object \n";
722usage += "\n Usage: setaxelabels xLabel yLabel [ColorFntAtt]";
723usage += "\n Related commands: settitle addtext graphicatt";
724mpiac->RegisterCommand(kw, usage, this, grp);
725
726kw = "addaxelabels";
727usage = "Set the X and Y axis labels for the current 2D graphic object";
728usage += " alias for setaxelabels ";
729mpiac->RegisterCommand(kw, usage, this, grp);
730
731grp = "Obj. Display";
[3551]732gdesc = "Most useful commands to view and display objects ";
733mpiac->AddHelpGroup(grp, gdesc);
734
[2781]735kw = "disp";
736usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
737usage += "\n Related commands: surf nt2d nt3d vecplot";
738mpiac->RegisterCommand(kw, usage, this, grp);
739kw = "imag";
740usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
741usage += "\n Related commands: disp imagnav surf nt2d nt3d vecplot";
742mpiac->RegisterCommand(kw, usage, this, grp);
743kw = "imagnav";
744usage = "Displays an object as an image with the ImageNavigator viewer \n";
745usage += "Usage: imagnav nameobj [graphic_attributes]";
746usage += "\n Related commands: disp imag surf nt2d nt3d vecplot";
747mpiac->RegisterCommand(kw, usage, this, grp);
748kw = "surf";
749usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
750usage += "\n Related commands: disp nt2d nt3d vecplot";
751mpiac->RegisterCommand(kw, usage, this, grp);
752kw = "nt2d";
753usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
754usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
[3269]755usage += "\n Related commands: disp surf nt2dcn nt2dci nt3d gfd2d vecplot";
[2781]756mpiac->RegisterCommand(kw, usage, this, grp);
[3269]757kw = "nt2dcn";
758usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
759usage = " with colors specified by a column content (as color names) ";
760usage += "\n Usage : nt2dcn nameobj color varx vary [errx erry wt label graphic_attributes]";
761usage += "\n Related commands: disp surf nt2d nt2dci nt3d gfd2d vecplot";
762mpiac->RegisterCommand(kw, usage, this, grp);
763kw = "nt2dci";
764usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
765usage = " with colors specified by a column content (as color index) ";
766usage += "\n Usage : nt2dci nameobj color varx vary [errx erry wt label graphic_attributes]";
767usage += "\n Related commands: disp surf nt2d nt2dci nt3d gfd2d vecplot";
768mpiac->RegisterCommand(kw, usage, this, grp);
[2781]769kw = "nt3d";
770usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
771usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
772usage += "\n Related commands: disp surf nt2d gfd3d ";
773mpiac->RegisterCommand(kw, usage, this, grp);
774kw = "vecplot";
775usage = "Displays Points (X-Y) with coordinates defined by two vectors ";
776usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]";
777usage += "\n Related commands: disp nt2d ";
778mpiac->RegisterCommand(kw, usage, this, grp);
779
780kw = "bargraph";
781usage = "Bar-Graph view of a sequence of values ";
782usage += "\n Usage: bargraph ValueVarName [gr_opt] ";
783usage += "\n or bargraph ValueVarName LabelVarName ColPosVarName [gr_opt] ";
784usage += "\n ValueVarName,LabelVarName,ColPosVarName are PIACmd interpreter ";
785usage += "\n variable name (vectors) ";
786usage += "\n - ValueVarName: Sequence of values to be represented";
787usage += "\n - LabelVarName: Corresponding labels";
788usage += "\n - ColPosVarName: Corresponding colors or color,position pairs ";
789usage += "\n Use a dash (-) or ! as placeholder for LabelVarName/ColPosVarName";
790usage += "\n Specific graphic options: fill/nofill packfrac=value ";
791usage += "\n horizontalbars/verticalbars barvaluelabel/nobarvaluelabel";
792usage += "\n Related commands: disp nt2d vecplot ...";
793mpiac->RegisterCommand(kw, usage, this, grp);
794kw = "textdrawer";
795usage = "Multi line text darwer ";
796usage += "\n Usage : textdrawer LinesVarName AttVarName [gr_opt] ";
797usage += "\n LinesVarName,AttVarName are PIACmd interpreter variables";
798usage += "\n - LinesVarName: Lines to be displayed";
799usage += "\n - AttVarName: Corresponding font/marker/color attributes";
800usage += "\n Use a dash (-) or ! as placeholder for AttVarName";
801usage += "\n Specific graphic options: frame/noframe";
802usage += "\n Related commands: disp ... ";
803mpiac->RegisterCommand(kw, usage, this, grp);
804
[3551]805// Importation/affichage fichier format PI-RGB
[3546]806kw = "pirgbdisp";
807usage = "Read and display RGB-image object (PIPixRGBArray) from file ";
808usage += "\n Usage : pirgbdisp PI-RGB_FileName [gr_opt] ";
[3550]809usage += "\n gr_opt (def=rgb216cm):zoom, rgb4096cm rgb32768cm lut=rgb[,min,max]";
810usage += "\n Related commands: win2rgb wdg2rgb ";
[3546]811mpiac->RegisterCommand(kw, usage, this, grp);
[3551]812
813// Export to PI-RGB file
814grp = "GraphicExport";
815gdesc = "Commands to export graphics (widget/windows in postscript or PI-RGB image files";
816mpiac->AddHelpGroup(grp, gdesc);
817
[3550]818kw = "win2rgb";
819usage = " Export the current window to a PI-RGB file (.rgb)";
820usage += "\n Usage : win2rgb PI-RGB_FileName (.rgb)";
821usage += "\n Related commands: pirgbdisp wdg2rgb ";
822mpiac->RegisterCommand(kw, usage, this, grp);
823kw = "wdg2rgb";
824usage = " Export the current widget to a PI-RGB file (.rgb)";
825usage += "\n Usage : wdg2rgb PI-RGB_FileName (.rgb)";
826usage += "\n Related commands: pirgbdisp win2rgb ";
827mpiac->RegisterCommand(kw, usage, this, grp);
[2781]828
829// Ceci est maintenant obsolete, on garde pour info.
[3551]830grp = "Obj. Display";
[2781]831kw = "gfd2d";
832usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
833usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
834usage += "\n Related commands: gfd3d nt2d nt3d ";
835usage += "\n ----- OBSOLETE: utilisez nt2d -----";
836mpiac->RegisterCommand(kw, usage, this, grp);
837kw = "gfd3d";
838usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
839usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
840usage += "\n Related commands: gfd2d nt2d nt3d ";
841usage += "\n ----- OBSOLETE: utilisez nt3d -----";
842mpiac->RegisterCommand(kw, usage, this, grp);
843
844}
845
846
847/* --Methode-- */
848void PIAGraphicExecutor::RegisterPIGraphicsHelp(PIACmd* piac)
849// Methode pour enregistrer le Help des Widgets et Windows de piapp
850{
851string kw,grp,usage;
852
853grp = "Graphics";
854
855kw = "PIImage";
856usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
857usage += "and controls a zoom widget, as well as a global image view widget \n";
858usage += ">>>> Mouse controls : \n";
859usage += "o Button-1: Display current coordinates and pixel value\n";
860usage += " Position the cursor an refresh the zoom widget\n";
861usage += "o Button-2: Defines an image zone and positions the cursor \n";
862usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
863usage += ">>>> Keyboard controls : \n";
864usage += "o <Alt>R : Refresh display \n";
865usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
866usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
867usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n";
868usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
869usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
870usage += "o <Alt>X : Show/Hide the Cut Window \n";
871usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
872usage += "o <Alt>E : Removes the last added graphic element \n";
873usage += "o <Alt>+ or <Cntl>+ : Zoom in \n";
874usage += "o <Alt>- or <Cntl>- : Zoom out \n";
875usage += "o Cursor keys : Moves the image cursor \n";
876piac->RegisterHelp(kw, usage, grp);
877
878kw = "PIScDrawWdg";
879usage = "Manages display of 2-D drawers with interactive zoom \n";
880usage += ">>>> Mouse controls : \n";
881usage += "o Button-1: Display current coordinates \n";
882usage += "o Button-2: Defines a rectangle for zoom \n";
883usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
884usage += ">>>> Keyboard controls : \n";
885usage += "o <Alt>R : Refresh display \n";
886usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
887usage += " (2-D histograms, contour plot ...) \n";
888usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
889usage += " Drawer 0 manages the axes, as well as the added text \n";
890usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n";
891usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
892usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
893usage += "o <Alt>E : Removes the last added graphic element \n";
894usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
895usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n";
896usage += "o <Alt>L : Deactivate DX,DY print (see below)\n";
897usage += ">>>> Mouse + Keyboard controls : \n";
898usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
899piac->RegisterHelp(kw, usage, grp);
900
901kw = "PIDraw3DWdg";
902usage = "Manages display of 3-D objects (drawers) \n";
903usage += ">>>> Mouse controls : \n";
904usage += "o Button-2: Rotates the observer (camera) around object \n";
905usage += "o Shift-Button-2: Rotates object with camera fixed \n";
906usage += " The object rotation mode can be assigned to Button-2 with <Alt>S \n";
907usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
908usage += ">>>> Keyboard controls : \n";
909usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
910usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
911usage += " (2-D histograms, contour plot ...) \n";
912usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
913usage += " Drawer 0 manages the axes, as well as the added text \n";
914usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n";
915usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
916usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
917usage += "o <Alt>E : Removes the last added graphic element \n";
918usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
919usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
920piac->RegisterHelp(kw, usage, grp);
921
922kw = "Windows";
923usage = "Objects can be displayed in different windows, or overlayed on the \n";
924usage += "previous display. The graphics attributes next,win,stack,same control \n";
925usage += "the display window. \n";
926usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
927usage += " Graphic windows can be divided int zones. Object is displayed \n";
928usage += " in the next available position, removing a previously displayed \n";
929usage += " widget if necessary \n";
930usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
931usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
932usage += " A single widget is displayed a any time. Different widgets in a StackWindow \n";
933usage += " can be displayed using the stacknext command, as well as the StackTools item \n";
934usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
935usage += " be activated using the StackTools menu (Blink) \n";
936usage += "o Most objects can be also be displayed overlayed \n";
937usage += " on the last displayed widget (gr_att= same) \n";
[3355]938usage += " or by specifying a widget name samew=Widgetname \n";
939usage += "o The widget/window name can be specified (gr_att wname=Name) \n";
940usage += "o The overlay can be on a selected rectangle of the last \n";
941usage += " displayed widget (gr_att: inset or inset=fxmin,fxmax,fymin,fymax) \n";
[2781]942usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
943piac->RegisterHelp(kw, usage, grp);
944
945kw = "PIConsole";
946usage = "Text output area and command editing window (console) \n";
947usage += ">>>> Mouse controls : \n";
948usage += "o Button-1: Rectangle selection for copy/paste \n";
949usage += "o Button-2: Paste text in the command editing line \n";
950usage += "o Button-3: activate display option menu \n";
951usage += ">>>> Keyboard controls : \n";
952usage += "o <Alt>O : activate display option menu \n";
953usage += "o <Alt>V : Paste text in the command editing line \n";
954usage += "o <Alt>A : Selection of the whole window for copy \n";
955usage += "o <Alt>L : Command history (List of command history buffer) \n";
956usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
957usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
958usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
[3491]959usage += "o <Ctl>C : Stop/break command execution by PIACmd/Commander \n";
[2781]960usage += "o Cursor left,right : Command editing -> Move cursor \n";
961usage += "o Cursor Up,Down : recall command from history buffer \n";
962usage += "o Backspace,Del : Command editing \n";
963usage += "o <Return>,<Enter> : Execute command \n";
964piac->RegisterHelp(kw, usage, grp);
965}
966
967/* --Methode-- */
968int 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-- */
1032int 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}
Note: See TracBrowser for help on using the repository browser.