1 | #include "machdefs.h"
|
---|
2 | #include <stdlib.h>
|
---|
3 | #include <stdio.h>
|
---|
4 | #include <string.h>
|
---|
5 |
|
---|
6 | #include <typeinfo>
|
---|
7 |
|
---|
8 | #include <string>
|
---|
9 | #include <vector>
|
---|
10 |
|
---|
11 | #include "strutil.h"
|
---|
12 | #include "timing.h"
|
---|
13 | #include "perrors.h"
|
---|
14 | #include "ctimer.h"
|
---|
15 |
|
---|
16 | #include "psighand.h"
|
---|
17 |
|
---|
18 | #include "cimage.h" // pour pouvoir faire extract
|
---|
19 |
|
---|
20 | #include "pistdimgapp.h"
|
---|
21 | #include "pihisto2d.h"
|
---|
22 | #include "psfile.h"
|
---|
23 | #include "piimgtools.h"
|
---|
24 | #include "pidrwtools.h"
|
---|
25 |
|
---|
26 | #include "pistzwin.h"
|
---|
27 |
|
---|
28 | #include "piinit.h"
|
---|
29 | #include "piversion.h"
|
---|
30 | #include "piaversion.h"
|
---|
31 |
|
---|
32 |
|
---|
33 | static char ImgDir[256];
|
---|
34 | static char WorkDir[256];
|
---|
35 |
|
---|
36 |
|
---|
37 | /* ........................................................... */
|
---|
38 | /* Classe PIStdImgApp */
|
---|
39 | /* ........................................................... */
|
---|
40 |
|
---|
41 | /* --Methode-- */
|
---|
42 | PIStdImgApp::PIStdImgApp(int narg, char* arg[])
|
---|
43 | : PIApplication(420, 320, narg, arg)
|
---|
44 | {
|
---|
45 |
|
---|
46 | // Les menus
|
---|
47 | m[0] = new PIMenu(Menubar(),"Fichier");
|
---|
48 | m[0]->AppendItem("Help", 10100);
|
---|
49 | m[0]->AppendItem("Open-Fits", 10120);
|
---|
50 | m[0]->AppendItem("Open-PPF", 10130);
|
---|
51 | m[0]->AppendItem("Close", 10110);
|
---|
52 | m[0]->AppendItem("delete", 10111);
|
---|
53 | // m[0]->AppendItem("Options", 10101);
|
---|
54 | m[0]->AppendItem("Exit", 10105);
|
---|
55 |
|
---|
56 | m[1] = new PIMenu(Menubar(),"Objets");
|
---|
57 | m[1]->AppendItem("ObjectManager", 10201);
|
---|
58 | m[1]->AppendItem("OpenOutPPF", 10220);
|
---|
59 | m[1]->AppendItem("CloseOutPPF", 10230);
|
---|
60 |
|
---|
61 | m[2] = new PIMenu(Menubar(),"Tools");
|
---|
62 | m[2]->AppendItem("Show ImageTools", 10301);
|
---|
63 | m[2]->AppendItem("Show DrawerTools", 10302);
|
---|
64 | m[2]->AppendItem("Ext.Pave", 10304);
|
---|
65 | m[2]->AppendItem("Ext.Pave+Org", 10305);
|
---|
66 | m[2]->SetSensitivityMsg(10305, false);
|
---|
67 | m[2]->AppendItem("Cuts X,Y", 10306);
|
---|
68 | m[2]->SetSensitivityMsg(10306, false);
|
---|
69 | mc = new PIMenu(m[2], "StackTools");
|
---|
70 | mc->AppendItem("DispNext", 10320);
|
---|
71 | mc->AppendItem("Blink 0.5s", 10321);
|
---|
72 | mc->AppendItem("Blink 1s", 10322);
|
---|
73 | mc->AppendItem("Blink 2s", 10324);
|
---|
74 | mc->AppendItem("Stop Blink", 10329);
|
---|
75 | mc->AppendItem("RemoveCurrent", 10330);
|
---|
76 | m[2]->AppendPDMenu(mc);
|
---|
77 | m[2]->SetSensitivity("StackTools", false);
|
---|
78 |
|
---|
79 | m[3] = new PIMenu(Menubar(),"Window");
|
---|
80 | m[3]->AppendItem("StackWindow", 10400);
|
---|
81 | m[3]->AppendItem("Window", 10411);
|
---|
82 | m[3]->AppendItem("Window 2x1", 10421);
|
---|
83 | m[3]->AppendItem("Window 1x2", 10412);
|
---|
84 | m[3]->AppendItem("Window 2x2", 10422);
|
---|
85 | m[3]->AppendItem("Window 3x1", 10431);
|
---|
86 | m[3]->AppendItem("Window 3x3", 10433);
|
---|
87 | m[3]->AppendItem("Cur->LastWdg", 10441);
|
---|
88 |
|
---|
89 | m[4] = new PIMenu(Menubar(),"PostScript");
|
---|
90 | m[4]->AppendItem("OpenPS", 10501);
|
---|
91 | m[4]->AppendItem("ClosePS", 10505);
|
---|
92 | m[4]->AppendItem("Window->PS", 10511);
|
---|
93 | m[4]->AppendItem("Image->PS", 10515);
|
---|
94 | m[4]->AppendItem("Window->EPS", 10512);
|
---|
95 | m[4]->AppendItem("Image->EPS", 10516);
|
---|
96 | m[4]->SetSensitivityMsg(10515, false);
|
---|
97 | m[4]->SetSensitivityMsg(10516, false);
|
---|
98 |
|
---|
99 | m[5] = new PIMenu(Menubar(),"Special");
|
---|
100 | m[5]->AppendItem("CloseAll", 10601);
|
---|
101 | m[5]->AppendCheckItem("Red.Out/Err", 10602);
|
---|
102 | m[5]->AppendCheckItem("Catch SigFPE", 10603);
|
---|
103 | m[5]->AppendCheckItem("Catch SigSEGV", 10604);
|
---|
104 | m[5]->AppendCheckItem("ObjMgr Verb", 10605);
|
---|
105 |
|
---|
106 | m[6] = new PIMenu(Menubar(),"Modules");
|
---|
107 |
|
---|
108 | AppendMenu(m[0]);
|
---|
109 | AppendMenu(m[1]);
|
---|
110 | AppendMenu(m[2]);
|
---|
111 | AppendMenu(m[3]);
|
---|
112 | AppendMenu(m[4]);
|
---|
113 | AppendMenu(m[5]);
|
---|
114 | // AppendMenu(m[6]); Menu Modules vide pour le moment
|
---|
115 |
|
---|
116 | int scsx, scsy;
|
---|
117 | ScreenSz(scsx, scsy);
|
---|
118 | if (scsy <= 600) mFgScSz = 0;
|
---|
119 | else if (scsy <= 800) mFgScSz = 1;
|
---|
120 | else if (scsy <= 1024) mFgScSz = 2;
|
---|
121 | else mFgScSz = 3;
|
---|
122 | int msx = 420+mFgScSz*60;
|
---|
123 | int msy = 320+mFgScSz*40;
|
---|
124 | MainWin()->SetSize(msx, msy);
|
---|
125 |
|
---|
126 | int bss = 100+mFgScSz*15;
|
---|
127 | gimv = new PIPixmap(MainWin(), "GloV", bss, bss, 5, 5);
|
---|
128 | gimv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free);
|
---|
129 | zoom = new PIPixmap(MainWin(), "Zoom", bss, bss, bss+10, 5);
|
---|
130 | zoom->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free);
|
---|
131 | cmapv = new PICMapView(MainWin(), "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10);
|
---|
132 | cmapv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
133 |
|
---|
134 | int cpy = bss+10+14+mFgScSz*2+5;
|
---|
135 |
|
---|
136 | // Creation d'une console avec gestion des commandes
|
---|
137 | mCons = new PIConsole(MainWin(), "Console", 30200, 512, 132, msx, msy-cpy, 0, cpy );
|
---|
138 | mCons->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed);
|
---|
139 | mCons->AcceptCmd(true, 50);
|
---|
140 | redirecout = false;
|
---|
141 | // RedirectStdOutErr(true); pas par defaut
|
---|
142 |
|
---|
143 | mObjMgr = new NamedObjMgr;
|
---|
144 | mCmd = new PIACmd(mObjMgr, this);
|
---|
145 |
|
---|
146 | // Pas trop de message de la part de NamedObjMgr
|
---|
147 | m[5]->SetStateMsg(10605, false);
|
---|
148 | mObjMgr->SetVerbose(false);
|
---|
149 |
|
---|
150 | char* varenv;
|
---|
151 | ImgDir[0] = WorkDir[0] = '\0';
|
---|
152 | if ( (varenv=getenv("PEIDA_IMAGES")) != NULL ) strncpy(ImgDir, varenv, 256);
|
---|
153 | if ( (varenv=getenv("PEIDA_WORK")) != NULL ) strncpy(WorkDir, varenv, 256);
|
---|
154 |
|
---|
155 | pfc = new PIFileChooser(this,"FileChooser", 5000);
|
---|
156 |
|
---|
157 | mObjmgrw = new ObjMgrWind(this);
|
---|
158 | mPpinmgrw = new PPInMgrWind(this);
|
---|
159 |
|
---|
160 | // Attention : A faire apres creation de ObjMgrWind !!!
|
---|
161 | mObjMgr->SetImgApp(this);
|
---|
162 |
|
---|
163 | // Gestion des feneteres widgets et drawers
|
---|
164 | mWId = mDId = mBWId = 0;
|
---|
165 | mCurWin = NULL;
|
---|
166 | mCurWdg = NULL;
|
---|
167 | mLastWdg = NULL;
|
---|
168 | mGrW = NULL;
|
---|
169 | mStW = NULL;
|
---|
170 | mGrIdx = mStIdx = -1;
|
---|
171 |
|
---|
172 | mFCMsg = 0;
|
---|
173 | mFgCWImg = false;
|
---|
174 |
|
---|
175 | // Gestion fichiers PS
|
---|
176 | num_eps = 0;
|
---|
177 | name_ps = "";
|
---|
178 | name_ps = "pia.ps";
|
---|
179 | mpsfile = new PSFile(name_ps.c_str(),PI_Portrait, PI_A4, 2., 2.);
|
---|
180 |
|
---|
181 | // Gestion OUT-PPF
|
---|
182 | mPpfout = NULL;
|
---|
183 | name_outppf = "";
|
---|
184 |
|
---|
185 | // Attributs graphiques courants
|
---|
186 | mFCol = mBCol = PI_NotDefColor;
|
---|
187 | mLAtt = PI_NotDefLineAtt;
|
---|
188 | mFSz = PI_NotDefFontSize;
|
---|
189 | mFAtt = PI_NotDefFontAtt;
|
---|
190 | mMSz = -1;
|
---|
191 | mMrk = PI_NotDefMarker;
|
---|
192 | mCmapid = CMAP_OTHER;
|
---|
193 | mZoom = 0;
|
---|
194 | mAxesFlags = kBoxAxes | kExtTicks | kLabels;
|
---|
195 | SetXYLimits(-1, 1., -1., 1.);
|
---|
196 | mFXYlim = false;
|
---|
197 | SetInsetLimits(0.4, 0.6, 0.4, 0.6);
|
---|
198 | SetImageCenterPosition(-1,-1);
|
---|
199 | mFImgCenter = false;
|
---|
200 | maXlog = maYlog = false;
|
---|
201 | SaveGraphicAtt();
|
---|
202 |
|
---|
203 | // Initialisation
|
---|
204 | PIAppInitiator * piai = new PIAppInitiator(this);
|
---|
205 |
|
---|
206 | char buff[128];
|
---|
207 | mCons->AddStr(" ............ starting piapp .............\n", PIVA_Blue );
|
---|
208 | #ifdef SANS_EVOLPLANCK
|
---|
209 | sprintf(buff, "Version: piapp=%g PI=%g PEIDA=%g \n", (double)PIAPP_VERSIONNUMBER,
|
---|
210 | (double)PI_VERSIONNUMBER, (float)PeidaVersion());
|
---|
211 | #else
|
---|
212 | sprintf(buff, "Version: piapp=%g PI=%g SOPHYA=%g \n", (double)PIAPP_VERSIONNUMBER,
|
---|
213 | (double)PI_VERSIONNUMBER, piai->Version());
|
---|
214 | #endif
|
---|
215 | mCons->AddStr(buff, PIVA_Blue );
|
---|
216 | mCons->AddStr(" ..........................................\n", PIVA_Blue );
|
---|
217 | // PrintPeidaVersion();
|
---|
218 |
|
---|
219 | SetReady();
|
---|
220 | }
|
---|
221 |
|
---|
222 | /* --Methode-- */
|
---|
223 | PIStdImgApp::~PIStdImgApp()
|
---|
224 | {
|
---|
225 | int i;
|
---|
226 |
|
---|
227 | // Destrucion de tous les objets de NameObjMgr
|
---|
228 | string patt = "/*/*";
|
---|
229 | mObjMgr->DelObjects(patt, true);
|
---|
230 |
|
---|
231 | delete mc;
|
---|
232 | for(i=0; i<7; i++)
|
---|
233 | if (m[i]) delete m[i];
|
---|
234 |
|
---|
235 | WindMList::iterator it;
|
---|
236 | for(it = mWList.begin(); it != mWList.end(); it++) delete (*it).second;
|
---|
237 |
|
---|
238 | delete mObjMgr;
|
---|
239 | delete mCmd;
|
---|
240 |
|
---|
241 | delete zoom;
|
---|
242 | delete gimv;
|
---|
243 | delete cmapv;
|
---|
244 |
|
---|
245 | delete pfc;
|
---|
246 |
|
---|
247 | delete mCons;
|
---|
248 |
|
---|
249 | delete mObjmgrw;
|
---|
250 | delete mPpinmgrw;
|
---|
251 |
|
---|
252 | // Les fichiers
|
---|
253 | if (mpsfile) delete mpsfile;
|
---|
254 | if (mPpfout) delete mPpfout;
|
---|
255 |
|
---|
256 | }
|
---|
257 |
|
---|
258 | /* --Methode-- */
|
---|
259 | void PIStdImgApp::Process(PIMessage msg, PIMsgHandler* sender, void* data)
|
---|
260 | {
|
---|
261 | PIWdg *sndw;
|
---|
262 | PIMessage tmsg, smm;
|
---|
263 |
|
---|
264 | tmsg = msg;
|
---|
265 | msg = UserMsg(msg);
|
---|
266 | smm = ModMsg(tmsg);
|
---|
267 |
|
---|
268 | //printf("SuperDebug: msg=%d Mod=%d State=%d\n", (int)msg, (int)smm, (int)GetState());
|
---|
269 | if ((GetState()) && (msg != mFCMsg)) { PIBeep(); return; }
|
---|
270 |
|
---|
271 | // Messages active-window
|
---|
272 | if (smm == PIMsg_Active)
|
---|
273 | {
|
---|
274 | sndw = dynamic_cast<PIWdg *>(sender);
|
---|
275 | switch(sndw->kind())
|
---|
276 | {
|
---|
277 | case PIWindow::ClassId :
|
---|
278 | mCurWin = dynamic_cast<PIWindow *>(sndw);
|
---|
279 | break;
|
---|
280 |
|
---|
281 | case PIScDrawWdg::ClassId :
|
---|
282 | case PIDraw3DWdg::ClassId :
|
---|
283 | mCurWdg = dynamic_cast<PIBaseWdg *>(sender);
|
---|
284 | // cerr << "*DBG11* ImgTools -> NonSensitive " << sndw->kind() << endl;
|
---|
285 | if (mFgCWImg) {
|
---|
286 | // cerr << "*DBG* ImgTools -> NonSensitive " << endl;
|
---|
287 | m[2]->SetSensitivityMsg(10305, false);
|
---|
288 | m[2]->SetSensitivityMsg(10306, false);
|
---|
289 | m[4]->SetSensitivityMsg(10515, false);
|
---|
290 | m[4]->SetSensitivityMsg(10516, false);
|
---|
291 | mFgCWImg = false;
|
---|
292 | }
|
---|
293 | break;
|
---|
294 | case PIImage::ClassId :
|
---|
295 | mCurWdg = dynamic_cast<PIBaseWdg *>(sender);
|
---|
296 | if (!mFgCWImg) {
|
---|
297 | // cerr << "*DBG* ImgTools -> Sensitive " << endl;
|
---|
298 | m[2]->SetSensitivityMsg(10305, true);
|
---|
299 | m[2]->SetSensitivityMsg(10306, true);
|
---|
300 | m[4]->SetSensitivityMsg(10515, true);
|
---|
301 | m[4]->SetSensitivityMsg(10516, true);
|
---|
302 | mFgCWImg = true;
|
---|
303 | }
|
---|
304 | break;
|
---|
305 | /*
|
---|
306 | default :
|
---|
307 | mCurWdg = NULL;
|
---|
308 | if (mFgCWImg) {
|
---|
309 | m[2]->SetSensitivityMsg(10305, false);
|
---|
310 | m[2]->SetSensitivityMsg(10306, false);
|
---|
311 | m[4]->SetSensitivityMsg(10515, false);
|
---|
312 | m[4]->SetSensitivityMsg(10516, false);
|
---|
313 | mFgCWImg = false;
|
---|
314 | }
|
---|
315 | break;
|
---|
316 | */
|
---|
317 | }
|
---|
318 | }
|
---|
319 | // Message window-close
|
---|
320 | else if (smm == PIMsg_Close)
|
---|
321 | {
|
---|
322 | sndw = (PIWdg *)sender;
|
---|
323 | if(sndw->kind() == PIWindow::ClassId)
|
---|
324 | {
|
---|
325 | mCurWin = (PIWindow *)sender;
|
---|
326 | if (mCurWin == mStW) m[2]->SetSensitivity("StackTools", false);
|
---|
327 | DeleteWindow(mCurWin);
|
---|
328 | }
|
---|
329 | else
|
---|
330 | printf("PIStdImgApp/Bug ? CloseMsd received from NonWindow (%d %d %lx) \n",
|
---|
331 | (int)tmsg, (int)sndw->kind(), (long)sender);
|
---|
332 | }
|
---|
333 |
|
---|
334 | // Traitement des messages des menus
|
---|
335 | else if ( (msg >= 10100) && (msg < 10200) ) MBProcess1(msg, sender, data);
|
---|
336 | else if ( (msg >= 10200) && (msg < 10300) ) MBProcess2(msg, sender, data);
|
---|
337 | else if ( (msg >= 10300) && (msg < 10400) ) MBProcess3(msg, sender, data);
|
---|
338 | else if ( (msg >= 10400) && (msg < 10500) ) MBProcess4(msg, sender, data);
|
---|
339 | else if ( (msg >= 10500) && (msg < 10600) ) MBProcess5(msg, sender, data);
|
---|
340 | else if ( (msg >= 10600) && (msg < 10700) ) MBProcess6(msg, sender, data);
|
---|
341 | else if ( msg == 30200 ) { // Objet PIConsole
|
---|
342 | string s = mCons->GetCmdString();
|
---|
343 | string s2 = "\nExecuting " + s + "\n";
|
---|
344 | mCons->AddStr(s2.c_str(), PIVA_Blue, true);
|
---|
345 | SetBusy();
|
---|
346 | #ifdef SANS_EVOLPLANCK
|
---|
347 | TRY {
|
---|
348 | mCmd->Interpret(s);
|
---|
349 | } CATCH(merr) {
|
---|
350 | fflush(stdout);
|
---|
351 | cout << endl;
|
---|
352 | cerr << endl;
|
---|
353 | string es = PeidaExc(merr);
|
---|
354 | cerr << "PIStdImgApp::Process()/ Cmd->Do() Exception :" << es << " (" << merr << ")" << endl ;
|
---|
355 | }
|
---|
356 | #else
|
---|
357 | try {
|
---|
358 | mCmd->Interpret(s);
|
---|
359 | }
|
---|
360 | catch ( PException exc ) {
|
---|
361 | fflush(stdout);
|
---|
362 | cout << endl;
|
---|
363 | cerr << endl;
|
---|
364 | cerr << "PIStdImgApp::Process()/ Cmd->Interpret() Exception :" << exc.Msg() << endl;
|
---|
365 | }
|
---|
366 | #endif
|
---|
367 | SetReady();
|
---|
368 | }
|
---|
369 |
|
---|
370 | else printf("PIStdImgApp::Process() BUG?? Msg %d (%d-%d) \n",
|
---|
371 | (int)tmsg,(int)msg,(int)smm);
|
---|
372 |
|
---|
373 |
|
---|
374 | return;
|
---|
375 | }
|
---|
376 |
|
---|
377 | /* --Methode-- */
|
---|
378 | void PIStdImgApp::SetReady()
|
---|
379 | {
|
---|
380 | mCons->SetSensitive();
|
---|
381 | gimv->SetSensitive();
|
---|
382 | PIApplication::SetReady();
|
---|
383 | }
|
---|
384 |
|
---|
385 | /* --Methode-- */
|
---|
386 | void PIStdImgApp::SetBusy()
|
---|
387 | {
|
---|
388 | mCons->SetUnSensitive();
|
---|
389 | gimv->SetUnSensitive();
|
---|
390 | PIApplication::SetBusy();
|
---|
391 | }
|
---|
392 |
|
---|
393 | /* --Methode-- */
|
---|
394 | void PIStdImgApp::SetBlocked()
|
---|
395 | {
|
---|
396 | mCons->SetUnSensitive();
|
---|
397 | gimv->SetUnSensitive();
|
---|
398 | PIApplication::SetBlocked();
|
---|
399 | }
|
---|
400 |
|
---|
401 |
|
---|
402 | /* --Methode-- */
|
---|
403 | int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid)
|
---|
404 | {
|
---|
405 | PIImage* pii;
|
---|
406 | PIWindow* win;
|
---|
407 | int sx, sy, px, py, flag;
|
---|
408 |
|
---|
409 | if (nouv == NULL)
|
---|
410 | {
|
---|
411 | printf("PIStdImgApp::DispImage_Error Cannot Display NULL image \n");
|
---|
412 | return(-1);
|
---|
413 | }
|
---|
414 |
|
---|
415 | if ( (nouv->XSize() <= 0) || (nouv->YSize() <= 0))
|
---|
416 | {
|
---|
417 | printf("PIStdImgApp::DispImage_Error Pb Size Sz=%d*%d \n",
|
---|
418 | nouv->XSize(), nouv->YSize());
|
---|
419 | return(-1);
|
---|
420 | }
|
---|
421 |
|
---|
422 | int zm = 1;
|
---|
423 | if (mZoom == 0) { // Facteur de zoom auto
|
---|
424 | zm = (nouv->XSize() > nouv->YSize()) ? nouv->XSize() : nouv->YSize();
|
---|
425 | zm = (zm >= 250) ? 250/zm : 1;
|
---|
426 | }
|
---|
427 | else zm = mZoom;
|
---|
428 |
|
---|
429 | if (zm == 0) zm = 1;
|
---|
430 | if (zm < -10) zm = -10;
|
---|
431 | if (zm > 10) zm = 10;
|
---|
432 |
|
---|
433 | if (zm > 0) { sx = nouv->XSize()*zm; sy = nouv->YSize()*zm; }
|
---|
434 | else {
|
---|
435 | sx = (int)((float)nouv->XSize()*(-1./float(zm)));
|
---|
436 | sy = (int)((float)nouv->YSize()*(-1./float(zm)));
|
---|
437 | }
|
---|
438 | if (sx > 400+mFgScSz*100) sx = 400+mFgScSz*100;
|
---|
439 | if (sy > 400+mFgScSz*100) sy = 400+mFgScSz*100;
|
---|
440 | px = py = 0;
|
---|
441 | win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str());
|
---|
442 | pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py);
|
---|
443 | pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
|
---|
444 | pii->SetZoomWin(zoom, false);
|
---|
445 | pii->SetGloVWin(gimv, false);
|
---|
446 | pii->SetCMapWin(cmapv, false);
|
---|
447 | pii->SetZoom(zm, false);
|
---|
448 | if ( mCmapid != CMAP_OTHER ) pii->SetColMapId(mCmapid, false);
|
---|
449 | pii->ShowCursor(true);
|
---|
450 | pii->SetUserData(NULL, oid);
|
---|
451 | // Centrage eventuel du pave
|
---|
452 | if (mFImgCenter && (mXImgCenter > 0) && (mYImgCenter > 0)) {
|
---|
453 | pii->SetImage(nouv, false);
|
---|
454 | pii->SetPave(mXImgCenter, mYImgCenter, true, true);
|
---|
455 | }
|
---|
456 | else pii->SetImage(nouv, true);
|
---|
457 | // printf("!!DBG!! PIImage Pos= %d %d Size= %d %d \n", pii->XPos(), pii->YPos(), pii->XSize(), pii->YSize() );
|
---|
458 | mCurWin = win;
|
---|
459 | mCurWdg = pii;
|
---|
460 | mLastWdg = pii;
|
---|
461 | mBWId++;
|
---|
462 | mBWList[mBWId] = pii;
|
---|
463 | return(mBWId);
|
---|
464 | }
|
---|
465 |
|
---|
466 |
|
---|
467 | /* --Methode-- */
|
---|
468 | int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, int opt, string title, int oid)
|
---|
469 | {
|
---|
470 | if (scd == NULL)
|
---|
471 | {
|
---|
472 | printf("PIStdImgApp::DispScDrawer_Error Cannot Add NULL ScDrawer \n");
|
---|
473 | return(-1);
|
---|
474 | }
|
---|
475 |
|
---|
476 | // Changement d'attributs graphiques courants du drawer
|
---|
477 | if (mFCol != PI_NotDefColor) scd->SetColAtt(mFCol, mBCol);
|
---|
478 | if (mLAtt != PI_NotDefLineAtt) scd->SetLineAtt(mLAtt);
|
---|
479 | if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) scd->SetFontAtt(mFSz, mFAtt);
|
---|
480 | if ( (mMrk != PI_NotDefMarker) && (mMSz >= 0) ) scd->SetMarkerAtt(mMSz, mMrk);
|
---|
481 | if ( mCmapid != CMAP_OTHER ) scd->SetColMapId(mCmapid);
|
---|
482 |
|
---|
483 |
|
---|
484 | if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) ) opt = Disp_Next;
|
---|
485 | // Trace en superpoistion
|
---|
486 | if ( (opt == Disp_Same) && (mLastWdg) ) {
|
---|
487 | if (mLastWdg->kind() == PIScDrawWdg::ClassId) ((PIScDrawWdg*)mLastWdg)->AddScDrawer(scd, true);
|
---|
488 | else mLastWdg->AddDrawer(scd, true, true, true);
|
---|
489 | scd->Refresh();
|
---|
490 | mDId++;
|
---|
491 | mDrwList[mDId] = scd;
|
---|
492 | return(-mDId);
|
---|
493 | }
|
---|
494 | // Trace en medaillon
|
---|
495 | else if ( (opt == Disp_Inset) && (mLastWdg) ) {
|
---|
496 | PIGrCoord x1, x2, y1, y2;
|
---|
497 | x1 = mIXmin; x2 = mIXmax;
|
---|
498 | y2 = 1.-mIYmin; y1 = 1.-mIYmax;
|
---|
499 | scd->SetAxesFlags(mAxesFlags);
|
---|
500 | if (maXlog || maYlog) scd->SetLogScale(maXlog, maYlog); // Echelle log
|
---|
501 | if (mFXYlim) // Forcage limites XY
|
---|
502 | scd->SetLimits(mXmin, mXmax, mYmin, mYmax);
|
---|
503 | else scd->UpdateLimits();
|
---|
504 | mLastWdg->AddDrawer(scd, x1, y1, x2, y2, true, false, true);
|
---|
505 | scd->Refresh();
|
---|
506 | mDId++;
|
---|
507 | mDrwList[mDId] = scd;
|
---|
508 | return(-mDId);
|
---|
509 | }
|
---|
510 |
|
---|
511 | PIWindow* win;
|
---|
512 | PIScDrawWdg* scw;
|
---|
513 | int sx, sy, px, py, flag;
|
---|
514 | sx = 200+mFgScSz*100;
|
---|
515 | sy = 200+mFgScSz*100;
|
---|
516 | win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str());
|
---|
517 | if (typeid(*scd) != typeid(PIHisto2D))
|
---|
518 | scw = new PIScDrawWdg(win, (char *)name.c_str(), sx, sy, px, py);
|
---|
519 | else scw = new PIH2DWdg(win, (char *)name.c_str(), sx, sy, px, py);
|
---|
520 | scw->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
|
---|
521 | scw->SetUserData(NULL, oid);
|
---|
522 | if (maXlog || maYlog) scw->SetLogScale(maXlog, maYlog); // Echelle log
|
---|
523 | if (mFXYlim) // Forcage limites XY
|
---|
524 | scw->SetLimits(mXmin, mXmax, mYmin, mYmax);
|
---|
525 | scw->SetAxesFlags(mAxesFlags);
|
---|
526 |
|
---|
527 | if (typeid(*scd) != typeid(PIHisto2D)) scw->AddScDrawer(scd, true);
|
---|
528 | else ((PIH2DWdg*)scw)->SetPIHisto((PIHisto2D*)scd);
|
---|
529 | // Titre du plot
|
---|
530 | if (title.length() <= 0) title = name; string t2="";
|
---|
531 | scw->SetTitles(title, t2);
|
---|
532 | // scw->Refresh(); ? Pas necessaire Reza 19/08/98, 05/05/99 $CHECK$
|
---|
533 | mCurWin = win;
|
---|
534 | mCurWdg = scw;
|
---|
535 | mLastWdg = scw;
|
---|
536 | mBWId++;
|
---|
537 | mBWList[mBWId] = scw;
|
---|
538 | return(mBWId);
|
---|
539 | }
|
---|
540 |
|
---|
541 | /* --Methode-- */
|
---|
542 | int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, int opt, string title, int oid)
|
---|
543 | {
|
---|
544 | if (dr3 == NULL)
|
---|
545 | {
|
---|
546 | printf("PIStdImgApp::Disp3DDrawer_Error Cannot Add NULL 3DDrawer \n");
|
---|
547 | return(-1);
|
---|
548 | }
|
---|
549 |
|
---|
550 | // Changement d'attributs graphiques courants du drawer
|
---|
551 | if (mFCol != PI_NotDefColor) dr3->SetColAtt(mFCol, mBCol);
|
---|
552 | if (mLAtt != PI_NotDefLineAtt) dr3->SetLineAtt(mLAtt);
|
---|
553 | if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) dr3->SetFontAtt(mFSz, mFAtt);
|
---|
554 | if ( (mMrk != PI_NotDefMarker) && (mMSz >= 0) ) dr3->SetMarkerAtt(mMSz, mMrk);
|
---|
555 | if ( mCmapid != CMAP_OTHER ) dr3->SetColMapId(mCmapid);
|
---|
556 |
|
---|
557 | if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) ) opt = Disp_Next;
|
---|
558 | // Trace en superpoistion
|
---|
559 | if ( (opt == Disp_Same) && (mLastWdg) ) {
|
---|
560 | if (mLastWdg->kind() == PIDraw3DWdg::ClassId) ((PIDraw3DWdg*)mLastWdg)->AddDrawer3D(dr3, true);
|
---|
561 | else mLastWdg->AddDrawer(dr3, true, true, true);
|
---|
562 | dr3->Refresh();
|
---|
563 | mDId++;
|
---|
564 | mDrwList[mDId] = dr3;
|
---|
565 | return(-mDId);
|
---|
566 | }
|
---|
567 | // Trace en medaillon
|
---|
568 | else if ( (opt == Disp_Inset) && (mLastWdg) ) {
|
---|
569 | PIGrCoord x1, x2, y1, y2;
|
---|
570 | x1 = mIXmin; x2 = mIXmax;
|
---|
571 | y2 = 1.-mIYmin; y1 = 1.-mIYmax;
|
---|
572 | dr3->SetAxesFlags(mAxesFlags);
|
---|
573 | dr3->UpdateLimits();
|
---|
574 | mLastWdg->AddDrawer(dr3, x1, y1, x2, y2, true, false, true);
|
---|
575 | dr3->Refresh();
|
---|
576 | mDId++;
|
---|
577 | mDrwList[mDId] = dr3;
|
---|
578 | return(-mDId);
|
---|
579 | }
|
---|
580 |
|
---|
581 |
|
---|
582 | PIWindow* win;
|
---|
583 | int sx, sy, px, py, flag;
|
---|
584 | sx = 200+mFgScSz*100;
|
---|
585 | sy = 200+mFgScSz*100;
|
---|
586 | win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str());
|
---|
587 | PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *)name.c_str(), sx, sy, px, py);
|
---|
588 | wd3->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
|
---|
589 | wd3->SetUserData(NULL, oid);
|
---|
590 | wd3->AddDrawer3D(dr3, true);
|
---|
591 | // Titre du plot
|
---|
592 | if (title.length() <= 0) title = name; string t2="";
|
---|
593 | wd3->SetTitles(title, t2);
|
---|
594 | // wd3->Refresh(); ?Pas necessaire $CHECK$ 05/05/99
|
---|
595 | mCurWin = win;
|
---|
596 | mCurWdg = wd3;
|
---|
597 | mLastWdg = wd3;
|
---|
598 | mBWId++;
|
---|
599 | mBWList[mBWId] = wd3;
|
---|
600 | return(mBWId);
|
---|
601 | }
|
---|
602 |
|
---|
603 | /* --Methode-- */
|
---|
604 | void PIStdImgApp::AddText(string const & txt, double xp, double yp)
|
---|
605 | {
|
---|
606 | if (!mLastWdg) return;
|
---|
607 | PIElDrawer *eld=NULL;
|
---|
608 | PIScDrawWdg* sdw=NULL;
|
---|
609 | PIDraw3DWdg* w3d=NULL;
|
---|
610 | PIImage* imgw;
|
---|
611 | switch(mLastWdg->kind()) {
|
---|
612 | case PIScDrawWdg::ClassId :
|
---|
613 | sdw = dynamic_cast<PIScDrawWdg *>(mLastWdg);
|
---|
614 | if (sdw) eld = sdw->BaseDrawer();
|
---|
615 | break;
|
---|
616 | case PIDraw3DWdg::ClassId :
|
---|
617 | w3d = dynamic_cast<PIDraw3DWdg *>(mLastWdg);
|
---|
618 | if (w3d) eld = w3d->BaseDrawer();
|
---|
619 | break;
|
---|
620 | case PIImage::ClassId :
|
---|
621 | imgw = dynamic_cast<PIImage *>(mLastWdg);
|
---|
622 | if (imgw) eld = imgw->MyElDrawer();
|
---|
623 | break;
|
---|
624 | default :
|
---|
625 | break;
|
---|
626 | }
|
---|
627 | if (eld) {
|
---|
628 | if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) eld->SetFontAtt(mFSz, mFAtt);
|
---|
629 | eld->ElAddText(xp,yp,txt.c_str(),mFCol);
|
---|
630 | eld->Refresh();
|
---|
631 | }
|
---|
632 | }
|
---|
633 |
|
---|
634 | /* --Methode-- */
|
---|
635 | void PIStdImgApp::CreateGraphWin(int nx, int ny, int sx, int sy)
|
---|
636 | {
|
---|
637 | if (nx < 1) nx = 1;
|
---|
638 | if (ny < 1) ny = 1;
|
---|
639 | if (nx > 8) nx = 8;
|
---|
640 | if (ny > 8) ny = 8;
|
---|
641 | if ( (sx < 50) && (sy < 50) ) sx = sy = 400+mFgScSz*100;
|
---|
642 | char buff[64];
|
---|
643 | mWId++;
|
---|
644 | int px, py;
|
---|
645 | MainWin()->GetScreenPos(px, py);
|
---|
646 | sprintf(buff, "PI-GraphicWin (%d)",mWId);
|
---|
647 | PIZoneWindow* win = new PIZoneWindow(this, buff, PIWK_normal, nx, ny, sx, sy, px+MainWin()->XSize()+30, 0);
|
---|
648 | win->SetUserData(NULL, ny*10+nx); // UserFlag= nY*10 + nX
|
---|
649 | mWList[mWId*10+1] = (PIWindow*)win;
|
---|
650 | win->SetAutoDelChilds(true);
|
---|
651 | // win->Show();
|
---|
652 | mGrW = win;
|
---|
653 | mGrIdx = 0;
|
---|
654 | }
|
---|
655 |
|
---|
656 | /* --Methode-- */
|
---|
657 | void PIStdImgApp::CreateStackWin(int sx, int sy)
|
---|
658 | {
|
---|
659 | if ( (sx < 50) && (sy < 50) ) sx = sy = 300+mFgScSz*100;
|
---|
660 | char buff[64];
|
---|
661 | mWId++;
|
---|
662 | int px, py;
|
---|
663 | MainWin()->GetScreenPos(px, py);
|
---|
664 | sprintf(buff, "PI-StackWin (%d)",mWId);
|
---|
665 | PIStackWindow* win = new PIStackWindow(this, buff, PIWK_normal, sx, sy, px+MainWin()->XSize()+30, 100);
|
---|
666 | win->SetUserData(NULL, 9999); // UserFlag= 9999
|
---|
667 | mWList[mWId*10+2] = (PIWindow*)win;
|
---|
668 | win->SetAutoDelChilds(true);
|
---|
669 | // win->Show();
|
---|
670 | mStW = win;
|
---|
671 | m[2]->SetSensitivity("StackTools", true);
|
---|
672 | mStIdx = 0;
|
---|
673 | }
|
---|
674 |
|
---|
675 | /* --Methode-- */
|
---|
676 | PIWindow* PIStdImgApp::GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom)
|
---|
677 | {
|
---|
678 | PIWindow* rw;
|
---|
679 |
|
---|
680 | switch (typ) {
|
---|
681 | case Disp_Next : // Fenetre graphique courante
|
---|
682 | {
|
---|
683 | if (mGrW == NULL) CreateGraphWin();
|
---|
684 | int nx, ny;
|
---|
685 | mGrW->NbZone(nx, ny);
|
---|
686 | PIWdg* nw = mGrW->NextChildPosSize(px, py, sx, sy);
|
---|
687 | // cerr << "**DBG** PIStdImgApp::GetWindow() DispNext : nw = " << (long)nw << endl;
|
---|
688 | if (nw) DeleteBaseWidget((PIBaseWdg*)nw, false, false);
|
---|
689 | flag = mGrIdx;
|
---|
690 | mGrIdx = (mGrIdx+1)%(nx*ny);
|
---|
691 | rw = mGrW;
|
---|
692 | break;
|
---|
693 | }
|
---|
694 |
|
---|
695 | case Disp_Stack : // Fenetre de type stack (empilement)
|
---|
696 | {
|
---|
697 | if (mStW == NULL) CreateStackWin(sx, sy);
|
---|
698 | px = py = 0;
|
---|
699 | sx = mStW->XSize();
|
---|
700 | sy = mStW->YSize();
|
---|
701 | flag = mStIdx;
|
---|
702 | mStIdx++;
|
---|
703 | rw = mStW;
|
---|
704 | }
|
---|
705 | break;
|
---|
706 |
|
---|
707 | default : // Fenetre ordinaire
|
---|
708 | {
|
---|
709 | int pwx, pwy;
|
---|
710 | MainWin()->GetScreenPos(pwx, pwy);
|
---|
711 | if ( (sx < 50) && (sy < 50) ) sx = sy = 300+mFgScSz*100;
|
---|
712 | rw = new PIWindow(this, nom, PIWK_normal, sx, sy, pwx+MainWin()->XSize()+30, 300);
|
---|
713 | rw->SetUserData(NULL, 0); // UserFlag= 0
|
---|
714 | mWId++;
|
---|
715 | mWList[mWId*10] = rw;
|
---|
716 | rw->SetAutoDelChilds(true);
|
---|
717 | // rw->Show();
|
---|
718 | px = py = 0;
|
---|
719 | flag = 0;
|
---|
720 | break;
|
---|
721 | }
|
---|
722 | }
|
---|
723 |
|
---|
724 | rw->Show();
|
---|
725 | mCurWin = rw;
|
---|
726 | return(rw);
|
---|
727 | }
|
---|
728 |
|
---|
729 | /* --Methode-- */
|
---|
730 | void PIStdImgApp::SetZone(int nzx, int nzy)
|
---|
731 | {
|
---|
732 | if (!mGrW) CreateGraphWin(nzx, nzy);
|
---|
733 | else {
|
---|
734 | int k;
|
---|
735 | PIWdg* cwd;
|
---|
736 | for(k=0; k<mGrW->NbChilds(); k++) {
|
---|
737 | if ((cwd = mGrW->GetChild(k)) == NULL) continue;
|
---|
738 | DeleteBaseWidget((PIBaseWdg*)cwd, false, false);
|
---|
739 | }
|
---|
740 | mGrW->SetZone(nzx, nzy);
|
---|
741 | }
|
---|
742 | }
|
---|
743 |
|
---|
744 | /* --Methode-- */
|
---|
745 | void PIStdImgApp::StackWinNext()
|
---|
746 | {
|
---|
747 | if (mStW) mStW->DispNext();
|
---|
748 | }
|
---|
749 |
|
---|
750 | /* --Methode-- */
|
---|
751 | void PIStdImgApp::DeleteWindow(PIWindow* w)
|
---|
752 | {
|
---|
753 | if (w == NULL) return;
|
---|
754 | w->Hide();
|
---|
755 | bool ownwindow=false; // To Check if this is one of our windows
|
---|
756 | WindMList::iterator it;
|
---|
757 | for(it = mWList.begin(); it != mWList.end(); it++)
|
---|
758 | if ((*it).second == w) { mWList.erase(it); ownwindow = true; break; }
|
---|
759 | if (w == mGrW) { mGrW = NULL; mGrIdx = -1; }
|
---|
760 | if (w == mStW) { mStW = NULL; mStIdx = -1; m[2]->SetSensitivity("StackTools", false); }
|
---|
761 | if (w == mCurWin) mCurWin = NULL;
|
---|
762 |
|
---|
763 | if (!ownwindow) return; // We do nothing if this is not a window we have created ...
|
---|
764 |
|
---|
765 | int k;
|
---|
766 | PIWdg* cwd;
|
---|
767 | for(k=0; k<w->NbChilds(); k++) {
|
---|
768 | if ((cwd = w->GetChild(k)) == NULL) continue;
|
---|
769 | DeleteBaseWidget((PIBaseWdg*)cwd,false,false);
|
---|
770 | }
|
---|
771 | delete w;
|
---|
772 | return;
|
---|
773 | }
|
---|
774 |
|
---|
775 | /* --Methode-- */
|
---|
776 | void PIStdImgApp::DeleteBaseWidget(PIBaseWdg* w, bool dw, bool dwin)
|
---|
777 | {
|
---|
778 | if (w == NULL) return;
|
---|
779 | BWMList::iterator it;
|
---|
780 | for(it = mBWList.begin(); it != mBWList.end(); it++)
|
---|
781 | if ((*it).second == w) { mBWList.erase(it); break; }
|
---|
782 | int k;
|
---|
783 | PIDrawer* drw;
|
---|
784 | for(k=0; k<w->NbDrawers(); k++) {
|
---|
785 | if ((drw = w->GetDrawer(k)) == NULL) continue;
|
---|
786 | DrwMList::iterator itt;
|
---|
787 | for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++)
|
---|
788 | if ((*itt).second == drw) { mDrwList.erase(itt); break; }
|
---|
789 | }
|
---|
790 |
|
---|
791 | if (w == mCurWdg) {
|
---|
792 | mCurWdg = NULL;
|
---|
793 | if (mFgCWImg) {
|
---|
794 | m[4]->SetSensitivityMsg(10515, false);
|
---|
795 | m[4]->SetSensitivityMsg(10516, false);
|
---|
796 | mFgCWImg = false;
|
---|
797 | }
|
---|
798 | }
|
---|
799 |
|
---|
800 | if (w == mLastWdg) mLastWdg = NULL;
|
---|
801 |
|
---|
802 | PIWdg* pw=NULL;
|
---|
803 | if (dwin) pw = (PIWdg*)(w->Parent());
|
---|
804 | //DBG printf("DeleteBaseWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin);
|
---|
805 | if (dw) delete w;
|
---|
806 | if (pw && (pw->kind() == PIWindow::ClassId )) {
|
---|
807 | PIWindow* pww = (PIWindow*) pw;
|
---|
808 | if ((pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0))
|
---|
809 | DeleteWindow((PIWindow*)pw);
|
---|
810 | }
|
---|
811 | return;
|
---|
812 | }
|
---|
813 |
|
---|
814 |
|
---|
815 |
|
---|
816 | /* --Methode-- */
|
---|
817 | void PIStdImgApp::DelWRsId(int k)
|
---|
818 | {
|
---|
819 | //DBG cerr << "-DBG- PIStdImgApp::DelWRsId(" << k << ")" << endl;
|
---|
820 | if (k > 0) { // C'est un BaseWidget
|
---|
821 | BWMList::iterator it;
|
---|
822 | it = mBWList.find(k);
|
---|
823 | if (it == mBWList.end()) return;
|
---|
824 | PIBaseWdg* wd = (*it).second;
|
---|
825 | //DBG cerr << "-DBG- PIStdImgApp::DelWRsId Deleting BaseWidget " << (long)(wd) << endl ;
|
---|
826 | DeleteBaseWidget(wd, true, true);
|
---|
827 | }
|
---|
828 | else { // C'est un drawer
|
---|
829 | DrwMList::iterator it;
|
---|
830 | it = mDrwList.find(-k);
|
---|
831 | if (it == mDrwList.end()) return;
|
---|
832 | delete (*it).second;
|
---|
833 | mDrwList.erase(it);
|
---|
834 | // cerr << "+DBG+ PIStdImgApp::DelWRsId Deleting Drawer " << (long)((*it).second) << endl ;
|
---|
835 | }
|
---|
836 | }
|
---|
837 | /* --Methode-- */
|
---|
838 | bool PIStdImgApp::CheckWRsId(int k)
|
---|
839 | {
|
---|
840 | if (k > 0) { // C'est un BaseWidget
|
---|
841 | BWMList::iterator it;
|
---|
842 | it = mBWList.find(k);
|
---|
843 | if (it == mBWList.end()) return(false);
|
---|
844 | else return(true);
|
---|
845 | }
|
---|
846 | else { // C'est un drawer
|
---|
847 | DrwMList::iterator it;
|
---|
848 | it = mDrwList.find(-k);
|
---|
849 | if (it == mDrwList.end()) return(false);
|
---|
850 | else return(true);
|
---|
851 | }
|
---|
852 | }
|
---|
853 |
|
---|
854 |
|
---|
855 | /* --Methode-- */
|
---|
856 | void PIStdImgApp::RedirectStdOutErr(bool fg)
|
---|
857 | {
|
---|
858 | if (fg) {
|
---|
859 | RedirectOutStream(mCons);
|
---|
860 | RedirectErrStream(mCons);
|
---|
861 | m[5]->SetStateMsg(10602, true);
|
---|
862 | redirecout = true;
|
---|
863 | }
|
---|
864 | else {
|
---|
865 | RedirectOutStream(NULL);
|
---|
866 | RedirectErrStream(NULL);
|
---|
867 | m[5]->SetStateMsg(10602, false);
|
---|
868 | redirecout = false;
|
---|
869 | }
|
---|
870 | return;
|
---|
871 | }
|
---|
872 |
|
---|
873 | /* --Methode-- */
|
---|
874 | void PIStdImgApp::CatchSignals(bool fgfpe, bool fgsegv)
|
---|
875 | {
|
---|
876 | PeidaConfigureSignalhandling(fgfpe, fgsegv, true, true);
|
---|
877 | m[5]->SetStateMsg(10603, fgfpe);
|
---|
878 | m[5]->SetStateMsg(10604, fgsegv);
|
---|
879 | }
|
---|
880 |
|
---|
881 | /* --Methode-- */
|
---|
882 | void PIStdImgApp::CloseAllWindows()
|
---|
883 | {
|
---|
884 | WindMList::iterator it;
|
---|
885 | for(it = mWList.begin(); it != mWList.end(); it++) delete (*it).second;
|
---|
886 | mWList.clear();
|
---|
887 | mBWList.clear();
|
---|
888 | mDrwList.clear();
|
---|
889 | mGrW = NULL;
|
---|
890 | mStW = NULL;
|
---|
891 | mCurWin = NULL;
|
---|
892 | mCurWdg = NULL;
|
---|
893 | mLastWdg = NULL;
|
---|
894 | m[4]->SetSensitivityMsg(10515, false);
|
---|
895 | m[4]->SetSensitivityMsg(10516, false);
|
---|
896 | }
|
---|
897 |
|
---|
898 | /* --Methode-- */
|
---|
899 | void PIStdImgApp::MBProcess1(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
900 | {
|
---|
901 |
|
---|
902 | switch(msg)
|
---|
903 | {
|
---|
904 | case 10100 :
|
---|
905 | mCmd->ShowHelpWindow();
|
---|
906 | break;
|
---|
907 |
|
---|
908 | case 10120 :
|
---|
909 | pfc->SetPath(ImgDir);
|
---|
910 | pfc->AcceptNewFile(false);
|
---|
911 | mFCMsg = 10125;
|
---|
912 | pfc->SetMsg(mFCMsg);
|
---|
913 | SetBlocked();
|
---|
914 | pfc->Show();
|
---|
915 | break;
|
---|
916 |
|
---|
917 | case 10125 :
|
---|
918 | SetBusy();
|
---|
919 | if (data) {
|
---|
920 | string nomobj="";
|
---|
921 | ObjMgr()->ReadFits(pfc->GetFileName(), nomobj);
|
---|
922 | ObjMgr()->DisplayObj(nomobj, "win");
|
---|
923 | }
|
---|
924 | mFCMsg = 0;
|
---|
925 | SetReady();
|
---|
926 | break;
|
---|
927 |
|
---|
928 | case 10130 :
|
---|
929 | pfc->SetPath(WorkDir);
|
---|
930 | pfc->AcceptNewFile(false);
|
---|
931 | mFCMsg = 10135;
|
---|
932 | pfc->SetMsg(mFCMsg);
|
---|
933 | SetBlocked();
|
---|
934 | pfc->Show();
|
---|
935 | break;
|
---|
936 |
|
---|
937 | case 10135 :
|
---|
938 | mFCMsg = 0;
|
---|
939 | if (data) {
|
---|
940 | PPInMgrW()->SetFile(pfc->GetFileName());
|
---|
941 | PPInMgrW()->Show();
|
---|
942 | }
|
---|
943 | SetReady();
|
---|
944 | break;
|
---|
945 |
|
---|
946 | case 10110 :
|
---|
947 | DeleteWindow(mCurWin);
|
---|
948 | break;
|
---|
949 |
|
---|
950 | case 10111 :
|
---|
951 | if (mCurWdg) {
|
---|
952 | int oid = mCurWdg->UserFlag();
|
---|
953 | DeleteBaseWidget(mCurWdg);
|
---|
954 | mObjMgr->DelObj_Id(oid);
|
---|
955 | }
|
---|
956 | break;
|
---|
957 |
|
---|
958 | case 10105:
|
---|
959 | Stop();
|
---|
960 | break;
|
---|
961 |
|
---|
962 | }
|
---|
963 | return;
|
---|
964 | }
|
---|
965 |
|
---|
966 |
|
---|
967 |
|
---|
968 | /* --Methode-- */
|
---|
969 | void PIStdImgApp::MBProcess2(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
970 | {
|
---|
971 |
|
---|
972 | switch (msg) {
|
---|
973 | case 10201 :
|
---|
974 | ObjMgrW()->Show();
|
---|
975 | break;
|
---|
976 |
|
---|
977 | case 10220 :
|
---|
978 | pfc->SetPath(WorkDir);
|
---|
979 | pfc->AcceptNewFile(true);
|
---|
980 | mFCMsg = 10225;
|
---|
981 | pfc->SetMsg(mFCMsg);
|
---|
982 | SetBlocked();
|
---|
983 | pfc->Show();
|
---|
984 | break;
|
---|
985 |
|
---|
986 | case 10225 :
|
---|
987 | SetBusy();
|
---|
988 | if (data) {
|
---|
989 | if (mPpfout) {
|
---|
990 | printf("PIStdImg/Info: Closing POutPersist-File %s \n", name_outppf.c_str());
|
---|
991 | delete mPpfout;
|
---|
992 | }
|
---|
993 | name_outppf = pfc->GetFileName();
|
---|
994 | mPpfout = NULL;
|
---|
995 | printf("PIStdImg/Info: Opening POutPersist-File %s \n", name_outppf.c_str());
|
---|
996 | mPpfout = new POutPersist(name_outppf);
|
---|
997 | }
|
---|
998 | mFCMsg = 0;
|
---|
999 | SetReady();
|
---|
1000 | break;
|
---|
1001 |
|
---|
1002 | case 10230 :
|
---|
1003 | if (!mPpfout) break;
|
---|
1004 | printf("PIStdImg/Info: Closing POutPersist-File %s \n", name_outppf.c_str());
|
---|
1005 | delete mPpfout;
|
---|
1006 | name_outppf = "";
|
---|
1007 | mPpfout = NULL;
|
---|
1008 | break;
|
---|
1009 |
|
---|
1010 |
|
---|
1011 | default:
|
---|
1012 | cerr << "PIStdImgApp::MBProcess2() BUG?? Msg= " << msg << endl;
|
---|
1013 | break;
|
---|
1014 | }
|
---|
1015 |
|
---|
1016 | return;
|
---|
1017 | }
|
---|
1018 |
|
---|
1019 | /* --Methode-- */
|
---|
1020 | void PIStdImgApp::MBProcess3(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
|
---|
1021 | {
|
---|
1022 |
|
---|
1023 | switch (msg) {
|
---|
1024 | case 10301 :
|
---|
1025 | PIImgTools::ShowPIImgTools();
|
---|
1026 | break;
|
---|
1027 | case 10302 :
|
---|
1028 | PIDrwTools::ShowPIDrwTools();
|
---|
1029 | break;
|
---|
1030 |
|
---|
1031 | case 10304 :
|
---|
1032 | case 10305 :
|
---|
1033 | {
|
---|
1034 | PIImage* curpimg = NULL;
|
---|
1035 | if (!mCurWdg) return;
|
---|
1036 | if (mCurWdg->kind() != PIImage::ClassId) return;
|
---|
1037 | curpimg = (PIImage*)mCurWdg;
|
---|
1038 | if (curpimg == NULL) return;
|
---|
1039 | P2DArrayAdapter* img = curpimg->Image();
|
---|
1040 | if (img == NULL) return;
|
---|
1041 | int dx = curpimg->XSzPave();
|
---|
1042 | int dy = curpimg->YSzPave();
|
---|
1043 | int x0 = curpimg->XPave()-dx/2;
|
---|
1044 | int y0 = curpimg->YPave()-dy/2;
|
---|
1045 | if (x0 < 0) x0 = 0;
|
---|
1046 | if (y0 < 0) y0 = 0;
|
---|
1047 | int x1 = x0+dx;
|
---|
1048 | int y1 = y0+dy;
|
---|
1049 | if (x1 > img->XSize()) x1 = img->XSize();
|
---|
1050 | if (y1 > img->YSize()) y1 = img->YSize();
|
---|
1051 | dx = x1-x0; dy = y1-y0;
|
---|
1052 | ImageR4* pim = new ImageR4(dx, dy);
|
---|
1053 | int ii, jj;
|
---|
1054 | for(jj=0; jj<dy; jj++)
|
---|
1055 | for(ii=0; ii<dx; ii++) (*pim)(ii,jj) = (*img)(ii+x0, jj+y0);
|
---|
1056 | if (msg == 10305) { // Calcul des coordonnees du sous-pave
|
---|
1057 | double xc1, yc1;
|
---|
1058 | img->Coord(x0, y0, xc1, yc1);
|
---|
1059 | pim->SetOrg((int)xc1, (int)yc1);
|
---|
1060 | }
|
---|
1061 | string nom = mCurWdg->Nom() + "_pave";
|
---|
1062 | ObjMgr()->AddObj(pim, nom);
|
---|
1063 | ObjMgr()->DisplayObj(nom, "w");
|
---|
1064 | break;
|
---|
1065 | }
|
---|
1066 |
|
---|
1067 | case 10306 :
|
---|
1068 | {
|
---|
1069 | PIImage* curpimg = NULL;
|
---|
1070 | if (!mCurWdg) return;
|
---|
1071 | if (mCurWdg->kind() != PIImage::ClassId) return;
|
---|
1072 | curpimg = (PIImage*)mCurWdg;
|
---|
1073 | if (curpimg == NULL) return;
|
---|
1074 | curpimg->ShowCuts(true);
|
---|
1075 | break;
|
---|
1076 | }
|
---|
1077 |
|
---|
1078 | case 10320 :
|
---|
1079 | if (mStW) mStW->DispNext();
|
---|
1080 | break;
|
---|
1081 |
|
---|
1082 | case 10321 :
|
---|
1083 | case 10322 :
|
---|
1084 | case 10324 :
|
---|
1085 | // case 10328 :
|
---|
1086 | if (mStW) mStW->StartAutoDisp((msg-10320)*500);
|
---|
1087 | break;
|
---|
1088 |
|
---|
1089 | case 10329 :
|
---|
1090 | if (mStW) mStW->StopAutoDisp();
|
---|
1091 | break;
|
---|
1092 |
|
---|
1093 | case 103330 :
|
---|
1094 | if (mStW) {
|
---|
1095 | PIWdg* cw = mStW->CurrentWdg();
|
---|
1096 | if (cw) DeleteBaseWidget((PIBaseWdg*)cw);
|
---|
1097 | }
|
---|
1098 | break;
|
---|
1099 |
|
---|
1100 | default:
|
---|
1101 | cerr << "PIStdImgApp::MBProcess3() BUG?? Msg= " << msg << endl;
|
---|
1102 | break;
|
---|
1103 | }
|
---|
1104 | return;
|
---|
1105 | }
|
---|
1106 |
|
---|
1107 | /* --Methode-- */
|
---|
1108 | void PIStdImgApp::MBProcess4(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
|
---|
1109 | {
|
---|
1110 |
|
---|
1111 | switch (msg) {
|
---|
1112 |
|
---|
1113 | case 10400 :
|
---|
1114 | CreateStackWin();
|
---|
1115 | break;
|
---|
1116 |
|
---|
1117 | case 10411 :
|
---|
1118 | CreateGraphWin(1,1);
|
---|
1119 | break;
|
---|
1120 | case 10421 :
|
---|
1121 | CreateGraphWin(1,2);
|
---|
1122 | break;
|
---|
1123 | case 10412 :
|
---|
1124 | CreateGraphWin(2,1);
|
---|
1125 | break;
|
---|
1126 | case 10422 :
|
---|
1127 | CreateGraphWin(2,2);
|
---|
1128 | break;
|
---|
1129 | case 10431 :
|
---|
1130 | CreateGraphWin(1,3);
|
---|
1131 | break;
|
---|
1132 | case 10433 :
|
---|
1133 | CreateGraphWin(3,3);
|
---|
1134 | break;
|
---|
1135 | case 10441 :
|
---|
1136 | if (mCurWdg) {
|
---|
1137 | mLastWdg = mCurWdg;
|
---|
1138 | cout << " Using current widget as last-widget (display same) " << endl;
|
---|
1139 | }
|
---|
1140 | else cout << " No current widget - select widget with mouse " << endl;
|
---|
1141 | break;
|
---|
1142 | default:
|
---|
1143 | cerr << "PIStdImgApp::MBProcess4() BUG?? Msg= " << msg << endl;
|
---|
1144 | break;
|
---|
1145 | }
|
---|
1146 | return;
|
---|
1147 | }
|
---|
1148 |
|
---|
1149 |
|
---|
1150 | /* --Methode-- */
|
---|
1151 | void PIStdImgApp::MBProcess5(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
1152 | {
|
---|
1153 | char nomps[64],strg[512];
|
---|
1154 | PSFile *mps;
|
---|
1155 | int sxt, syt, syo, syo1, sx[4], sy[4];
|
---|
1156 |
|
---|
1157 | switch (msg)
|
---|
1158 | {
|
---|
1159 | case 10501 :
|
---|
1160 | pfc->SetPath(WorkDir);
|
---|
1161 | pfc->AcceptNewFile(true);
|
---|
1162 | mFCMsg = 10525;
|
---|
1163 | pfc->SetMsg(mFCMsg);
|
---|
1164 | SetBlocked();
|
---|
1165 | pfc->Show();
|
---|
1166 | break;
|
---|
1167 |
|
---|
1168 | case 10525 :
|
---|
1169 | SetBusy();
|
---|
1170 | if (data) {
|
---|
1171 | if (mpsfile) {
|
---|
1172 | printf("PIStdImg/Info: Closing PS-File %s \n", name_ps.c_str());
|
---|
1173 | delete mpsfile;
|
---|
1174 | }
|
---|
1175 | name_ps = pfc->GetFileName();
|
---|
1176 | printf("PIStdImg/Info: Opening PS-File %s \n", name_ps.c_str());
|
---|
1177 | mpsfile = new PSFile(name_ps.c_str(), PI_Portrait, PI_A4, 2., 2.);
|
---|
1178 | }
|
---|
1179 | mFCMsg = 0;
|
---|
1180 | SetReady();
|
---|
1181 | break;
|
---|
1182 |
|
---|
1183 | case 10505 :
|
---|
1184 | if (!mpsfile) break;
|
---|
1185 | printf("PIStdImg/Info: Closing PS-File %s \n", name_ps.c_str());
|
---|
1186 | delete mpsfile;
|
---|
1187 | mpsfile = NULL;
|
---|
1188 | name_ps = "";
|
---|
1189 | break;
|
---|
1190 |
|
---|
1191 | case 10511 : // Window -> PS
|
---|
1192 | case 10512 : // Window -> EPS
|
---|
1193 | if (CurrentWindow() == NULL) break;
|
---|
1194 | if (msg == 10512)
|
---|
1195 | {
|
---|
1196 | num_eps++;
|
---|
1197 | sprintf(nomps,"pia%d.eps", num_eps);
|
---|
1198 | printf("PIStdImg/Info: Creating EPSFile %s (CurWin-> EPS) \n", nomps);
|
---|
1199 | mps = new PSFile(nomps);
|
---|
1200 | }
|
---|
1201 | else {
|
---|
1202 | if (mpsfile == NULL) {
|
---|
1203 | name_ps = "pia.ps";
|
---|
1204 | mpsfile = new PSFile(name_ps.c_str(), PI_Portrait, PI_A4, 0., 0.);
|
---|
1205 | printf("PIStdImg/Info: File PS %s opened \n", name_ps.c_str());
|
---|
1206 | }
|
---|
1207 | printf("PIStdImg/Info: CurWin-> PSFile %s\n", name_ps.c_str());
|
---|
1208 | mps = mpsfile;
|
---|
1209 | }
|
---|
1210 | CurrentWindow()->PSPrint(mps,0,0);
|
---|
1211 |
|
---|
1212 | if (msg == 10512) delete mps; // fichier eps
|
---|
1213 | break;
|
---|
1214 |
|
---|
1215 | case 10515 : // Image -> PS
|
---|
1216 | case 10516 : // Image -> EPS
|
---|
1217 | {
|
---|
1218 | PIImage* curpimg = NULL;
|
---|
1219 | if (!mCurWdg) return;
|
---|
1220 | if (mCurWdg->kind() != PIImage::ClassId) return;
|
---|
1221 | curpimg = (PIImage*)mCurWdg;
|
---|
1222 | if (curpimg == NULL) return;
|
---|
1223 | if (msg == 10516)
|
---|
1224 | {
|
---|
1225 | num_eps++;
|
---|
1226 | sprintf(nomps,"pia%d.eps", num_eps);
|
---|
1227 | printf("PIStdImg/Info: Creating EPSFile %s (CurImage-> EPS)\n", nomps);
|
---|
1228 | mps = new PSFile(nomps);
|
---|
1229 | }
|
---|
1230 | else {
|
---|
1231 | if (mpsfile == NULL) {
|
---|
1232 | name_ps = "pia.ps";
|
---|
1233 | mpsfile = new PSFile(name_ps.c_str(),PI_Portrait, PI_A4, 2., 2.);
|
---|
1234 | printf("PIStdImg/Info: File PS %s opened \n", name_ps.c_str());
|
---|
1235 | }
|
---|
1236 | printf("PIStdImg/Info: CurImage-> PSFile %s\n", name_ps.c_str());
|
---|
1237 | mps = mpsfile;
|
---|
1238 | }
|
---|
1239 |
|
---|
1240 | sx[0] = gimv->XSize();
|
---|
1241 | sy[0] = gimv->YSize();
|
---|
1242 | sx[1] = zoom->XSize();
|
---|
1243 | sy[1] = zoom->YSize();
|
---|
1244 | sx[2] = cmapv->XSize();
|
---|
1245 | sy[2] = cmapv->YSize();
|
---|
1246 | sx[3] = curpimg->XSize();
|
---|
1247 | sy[3] = curpimg->YSize();
|
---|
1248 | if (sy[1] > sy[0]) { syo1 = sy[1]+50; syo = sy[1]+sy[2]+60; }
|
---|
1249 | else { syo1 = sy[0]+50; syo = sy[0]+sy[2]+60; }
|
---|
1250 | syt = sy[3]+syo;
|
---|
1251 | sxt = sx[3];
|
---|
1252 | if (sxt < (sx[0]+sx[1]+20)) sxt = sx[0]+sx[1]+20;
|
---|
1253 | if (sxt < sx[2]) sxt = sx[2];
|
---|
1254 |
|
---|
1255 | // Pour ecrire le titre
|
---|
1256 | mps->NewPage((float)sxt, (float)syt, PI_Portrait);
|
---|
1257 | mps->NewBloc(0,0, (float)sxt, 30., (float)sxt, 30.);
|
---|
1258 | sprintf(strg,"Image: %s - Pave %d %d \n", curpimg->Nom().c_str(),
|
---|
1259 | curpimg->XPave(), curpimg->YPave());
|
---|
1260 | mps->DrawString(10., 25., strg, PI_Black, PI_DefaultFont, PI_BoldFont, 20);
|
---|
1261 | mps->EndBloc();
|
---|
1262 |
|
---|
1263 | // Les quatre fenetres glovimage, zoom, cmap, image
|
---|
1264 | gimv->PSPrint(mps, -gimv->XPos(), -gimv->YPos()+40);
|
---|
1265 | zoom->PSPrint(mps, -zoom->XPos()+sx[0]+20, -zoom->YPos()+40);
|
---|
1266 | cmapv->PSPrint(mps, -cmapv->XPos(), -cmapv->YPos()+syo1);
|
---|
1267 | curpimg->PSPrint(mps, -curpimg->XPos(), -curpimg->YPos()+syo);
|
---|
1268 |
|
---|
1269 | if (msg == 10516) delete mps; // fichier eps
|
---|
1270 | break;
|
---|
1271 | }
|
---|
1272 |
|
---|
1273 | default:
|
---|
1274 | cerr << "PIStdImgApp::MBProcess5() BUG?? Msg= " << msg << endl;
|
---|
1275 | break;
|
---|
1276 | }
|
---|
1277 |
|
---|
1278 | }
|
---|
1279 |
|
---|
1280 |
|
---|
1281 | /* --Methode-- */
|
---|
1282 | void PIStdImgApp::MBProcess6(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
1283 | {
|
---|
1284 | switch (msg) {
|
---|
1285 | case 10601:
|
---|
1286 | CloseAllWindows();
|
---|
1287 | break;
|
---|
1288 | case 10602:
|
---|
1289 | RedirectStdOutErr(*((bool*)data));
|
---|
1290 | break;
|
---|
1291 | case 10603:
|
---|
1292 | case 10604:
|
---|
1293 | CatchSignals(m[5]->GetStateMsg(10603), m[5]->GetStateMsg(10604));
|
---|
1294 | break;
|
---|
1295 | case 10605:
|
---|
1296 | mObjMgr->SetVerbose(m[5]->GetStateMsg(10605));
|
---|
1297 | break;
|
---|
1298 | default:
|
---|
1299 | cerr << "PIStdImgApp::MBProcess6() BUG?? Msg= " << msg << endl;
|
---|
1300 | break;
|
---|
1301 | }
|
---|
1302 | return;
|
---|
1303 | }
|
---|
1304 |
|
---|
1305 |
|
---|
1306 | /* --Methode-- */
|
---|
1307 | void PIStdImgApp::SetColAtt(PIColors fg, PIColors bg)
|
---|
1308 | {
|
---|
1309 | mFCol = fg;
|
---|
1310 | mBCol = bg;
|
---|
1311 | }
|
---|
1312 | /* --Methode-- */
|
---|
1313 | void PIStdImgApp::SetLineAtt(PILineAtt lat)
|
---|
1314 | {
|
---|
1315 | mLAtt = lat;
|
---|
1316 | }
|
---|
1317 | /* --Methode-- */
|
---|
1318 | void PIStdImgApp::SetFontAtt(PIFontSize fsz, PIFontAtt fat)
|
---|
1319 | {
|
---|
1320 | mFSz = fsz;
|
---|
1321 | mFAtt = fat;
|
---|
1322 | }
|
---|
1323 | /* --Methode-- */
|
---|
1324 | void PIStdImgApp::SetMarkerAtt(int sz, PIMarker mrk)
|
---|
1325 | {
|
---|
1326 | mMSz = sz;
|
---|
1327 | mMrk = mrk;
|
---|
1328 | }
|
---|
1329 | /* --Methode-- */
|
---|
1330 | void PIStdImgApp::SetColMapId(CMapId cid)
|
---|
1331 | {
|
---|
1332 | mCmapid = cid;
|
---|
1333 | }
|
---|
1334 | /* --Methode-- */
|
---|
1335 | void PIStdImgApp::SetZoomAtt(int zoom)
|
---|
1336 | {
|
---|
1337 | if ( (zoom > 10) || (zoom < -10) ) zoom = 0;
|
---|
1338 | mZoom = zoom;
|
---|
1339 | }
|
---|
1340 | /* --Methode-- */
|
---|
1341 | void PIStdImgApp::SetAxesAtt(unsigned int axfl)
|
---|
1342 | {
|
---|
1343 | mAxesFlags = axfl;
|
---|
1344 | }
|
---|
1345 | /* --Methode-- */
|
---|
1346 | void PIStdImgApp::SetXYLimits(double xmin, double xmax, double ymin, double ymax)
|
---|
1347 | {
|
---|
1348 | mXmin = xmin; mXmax= xmax;
|
---|
1349 | mYmin = ymin; mYmax= ymax;
|
---|
1350 | }
|
---|
1351 | /* --Methode-- */
|
---|
1352 | void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax)
|
---|
1353 | {
|
---|
1354 | mIXmin = xmin; mIXmax= xmax;
|
---|
1355 | mIYmin = ymin; mIYmax= ymax;
|
---|
1356 | }
|
---|
1357 | /* --Methode-- */
|
---|
1358 | void PIStdImgApp::SetImageCenterPosition(int x, int y)
|
---|
1359 | {
|
---|
1360 | mXImgCenter = x; mYImgCenter = y;
|
---|
1361 | }
|
---|
1362 |
|
---|
1363 | /* --Methode-- */
|
---|
1364 | void PIStdImgApp::SaveGraphicAtt()
|
---|
1365 | {
|
---|
1366 | mSFCol = mFCol;
|
---|
1367 | mSBCol = mBCol;
|
---|
1368 | mSLAtt = mLAtt;
|
---|
1369 | mSFSz = mFSz;
|
---|
1370 | mSFAtt = mFAtt;
|
---|
1371 | mSMSz = mMSz;
|
---|
1372 | mSMrk = mMrk;
|
---|
1373 | mSCmapid = mCmapid;
|
---|
1374 | mSZoom = mZoom;
|
---|
1375 | mSAxesFlags = mAxesFlags;
|
---|
1376 | mSXmin = mXmin; mSXmax = mXmax;
|
---|
1377 | mSYmin = mYmin; mSYmax = mYmax;
|
---|
1378 | mSIXmin = mIXmin; mSIXmax = mIXmax;
|
---|
1379 | mSIYmin = mIYmin; mSIYmax = mIYmax;
|
---|
1380 | mSFXYlim = mFXYlim;
|
---|
1381 | mSXImgCenter = mXImgCenter;
|
---|
1382 | mSYImgCenter = mYImgCenter;
|
---|
1383 | mSFImgCenter = mFImgCenter;
|
---|
1384 | mSaXlog = maXlog;
|
---|
1385 | mSaYlog = maYlog;
|
---|
1386 | }
|
---|
1387 |
|
---|
1388 | /* --Methode-- */
|
---|
1389 | void PIStdImgApp::RestoreGraphicAtt()
|
---|
1390 | {
|
---|
1391 | mFCol = mSFCol;
|
---|
1392 | mBCol = mSBCol;
|
---|
1393 | mLAtt = mSLAtt;
|
---|
1394 | mFSz = mSFSz;
|
---|
1395 | mFAtt = mSFAtt;
|
---|
1396 | mMSz = mSMSz;
|
---|
1397 | mMrk = mSMrk;
|
---|
1398 | mCmapid = mSCmapid;
|
---|
1399 | mZoom = mSZoom;
|
---|
1400 | mAxesFlags = mSAxesFlags;
|
---|
1401 | mXmin = mSXmin; mXmax = mSXmax;
|
---|
1402 | mYmin = mSYmin; mYmax = mSYmax;
|
---|
1403 | mIXmin = mSIXmin; mIXmax = mSIXmax;
|
---|
1404 | mIYmin = mSIYmin; mIYmax = mSIYmax;
|
---|
1405 | mFXYlim = mSFXYlim;
|
---|
1406 | mXImgCenter = mSXImgCenter;
|
---|
1407 | mYImgCenter = mSYImgCenter;
|
---|
1408 | mFImgCenter = mSFImgCenter;
|
---|
1409 | maXlog = mSaXlog;
|
---|
1410 | maYlog = mSaYlog;
|
---|
1411 | }
|
---|