source: Sophya/trunk/SophyaPI/PIext/pistdimgapp.h@ 544

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

Modifs pour echelle Log - Reza 25/10/99

  • Property svn:executable set to *
File size: 5.5 KB
RevLine 
[165]1// This may look like C code, but it is really -*- C++ -*-
2// Standard Image App R. Ansari 97-98
3// LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
4
5#ifndef PISTIMGAPP_H_SEEN
6#define PISTIMGAPP_H_SEEN
7
8#include <string.h>
9#include <string>
10#include <map>
[351]11#include <functional>
[165]12
13#include "pisysdep.h"
14
15#include PIAPP_H
16#include PIWIN_H
17#include PIMENU_H
18#include PIOPTMENU_H
19
20#include PISTDWDG_H
21
22#include PIFILECHO_H
23#include "picons.h"
24
25#include "piimage.h"
26#include "pi3ddrw.h"
27#include "nobjmgr.h"
28#include "piacmd.h"
29#include "pisiadw.h"
30#include "pistzwin.h"
31
32
33enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3};
34
35typedef map<long, PIWindow*, less<long> > WindMList;
36typedef map<long, PIBaseWdg*, less<long> > BWMList;
37typedef map<long, PIDrawer*, less<long> > DrwMList;
38
39class PIStdImgApp : public PIApplication {
40public:
41 PIStdImgApp(int narg=0, char* arg[]=NULL);
42 ~PIStdImgApp();
43
44 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
[194]45 virtual void SetReady();
46 virtual void SetBusy();
47 virtual void SetBlocked();
[165]48
[331]49 int DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid=0);
50 int DispScDrawer(PIDrawer* scd, string const & name, int opt, string title="", int oid=0);
51 int Disp3DDrawer(PIDrawer3D* scd, string const & name, int opt, string title="", int oid=0);
[165]52
[349]53 // Fonction d'ajout de texte (provisoire - Aout 99)
54 void AddText(string const & txt, double xp, double yp);
55
56
[165]57 void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
58 void CreateStackWin(int sx=0, int sy = 0);
59 PIWindow * GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom);
60 void SetZone(int nzx=1, int nzy=1);
61 void StackWinNext();
62
63 void DeleteWindow(PIWindow* w);
64 void DeleteBaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);
65 void DelWRsId(int k);
[368]66 bool CheckWRsId(int k);
[165]67 void CloseAllWindows();
68
69 inline NamedObjMgr* ObjMgr() { return mObjMgr; }
70 inline PIACmd* CmdInterpreter() { return mCmd; }
71
72 PIWindow* CurrentWindow() { return (mCurWin); };
73 PIBaseWdg* CurrentBaseWdg() { return (mCurWdg); };
74
75 inline PIPixmap* ZoomW() { return zoom; }
76 inline PIPixmap* GloVW() { return gimv; }
77 inline PICMapView* CMapVW() { return cmapv; }
78 inline PIConsole* GetConsole() { return mCons; }
79
[293]80 inline PIMenu* SpecialMenu() { return m[5]; }
81 inline PIMenu* ModulesMenu() { return m[6]; }
[165]82
83 inline ObjMgrWind* ObjMgrW() { return mObjmgrw; }
84 inline PPInMgrWind* PPInMgrW() { return mPpinmgrw; }
85
86// Redirection ou Non de StdOut/StdErr
87 void RedirectStdOutErr(bool fg = true);
[293]88 inline bool HasRedirectedStdOutErr() { return(redirecout); }
[165]89// Gestion des signaux
[374]90 void CatchSignals(bool fgfpe=true, bool fgsegv=true);
[165]91
92// Gestion d attributs graphiques courants
93 void SetColAtt(PIColors fg=PI_NotDefColor,
94 PIColors bg=PI_NotDefColor);
95 void SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
96 void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
97 PIFontAtt fat=PI_NotDefFontAtt);
98 void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
99 void SetColMapId(CMapId cid=CMAP_OTHER);
100 void SetZoomAtt(int zoom=0);
[203]101 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
[331]102 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
103 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; }
[506]104 inline void SetXLogScale(bool logx=false) { maXlog = logx; }
105 inline void SetYLogScale(bool logy=false) { maYlog = logy; }
106
[165]107// Pour sauvegarder-restauration de l'etat des attributs graphiques
108 void SaveGraphicAtt();
109 void RestoreGraphicAtt();
110
111// Gestion fichiers PS
112 int num_eps;
113 PSFile *mpsfile;
114 string name_ps;
115
116// Gestion OUT-PPF
117 POutPersist* mPpfout;
118 string name_outppf;
119
120private:
121 void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
122 void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
123 void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
124 void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
125 void MBProcess5(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
126 void MBProcess6(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
127
128
129 NamedObjMgr* mObjMgr;
130 PIACmd* mCmd;
131
[293]132 PIMenu* m[7];
[165]133 PIMenu* mc;
134
135 PIPixmap* zoom;
136 PIPixmap* gimv;
137 PICMapView* cmapv;
138
139 PIFileChooser * pfc;
140
141 PIConsole* mCons;
[293]142 bool redirecout; // true if stdout/err redirected to mCons;
[165]143
144 WindMList mWList;
145 BWMList mBWList;
146 DrwMList mDrwList;
147
148 int mWId,mDId,mBWId;
149
150 PIBaseWdg* mCurWdg;
151 PIBaseWdg* mLastWdg;
152 PIWindow* mCurWin;
153 PIZoneWindow* mGrW;
154 PIStackWindow* mStW;
155 int mGrIdx;
156 int mStIdx;
157
158 ObjMgrWind* mObjmgrw;
159 PPInMgrWind* mPpinmgrw;
160
161// Gestion d attributs graphiques courants, etat sauvegarde
162 PIColors mFCol, mBCol, mSFCol, mSBCol;
163 PILineAtt mLAtt, mSLAtt;
164 PIFontSize mFSz, mSFSz;
165 PIFontAtt mFAtt, mSFAtt;
166 int mMSz, mSMSz;
167 PIMarker mMrk,mSMrk;
168 CMapId mCmapid, mSCmapid;
169 int mZoom, mSZoom;
[203]170 unsigned int mAxesFlags, mSAxesFlags;
[331]171 double mXmin, mXmax, mYmin, mYmax;
172 double mSXmin, mSXmax, mSYmin, mSYmax;
173 bool mFXYlim, mSFXYlim;
[506]174 bool maXlog, mSaXlog;
175 bool maYlog, mSaYlog;
[165]176
177 PIMessage mFCMsg; // Message for processing FileOpen
178 int mFgScSz; // Dlag ScreenSize
179 bool mFgCWImg; // true -> Current Widget is PIImage
180};
181
182#endif
Note: See TracBrowser for help on using the repository browser.