source: Sophya/trunk/SophyaPI/PIext/pistdimgapp.cc@ 495

Last change on this file since 495 was 495, checked in by ercodmgr, 26 years ago

Portage -> DPPlanck , Reza+cmv 21/10/99

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