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

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

Bug ds CloseAllWindow - Reza 4/10/99

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