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

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

Modifs pour echelle Log - Reza 25/10/99

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