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

Last change on this file since 1570 was 1569, checked in by ansari, 24 years ago

Gestion des attributs de nom de fontes - Reza 6/7/2001

  • Property svn:executable set to *
File size: 6.5 KB
Line 
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>
11#include <functional>
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, Disp_Inset=4};
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);
45 virtual void SetReady();
46 virtual void SetBusy();
47 virtual void SetBlocked();
48
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);
52
53 // Fonction d'ajout de texte (provisoire - Aout 99)
54 void AddText(string const & txt, double xp, double yp);
55 // Fonction Ajout de titre de trace
56 void SetTitle(string const & titleup, string const & titledown);
57
58
59 void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
60 void CreateStackWin(int sx=0, int sy = 0);
61 PIWindow * GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom);
62 void SetZone(int nzx=1, int nzy=1);
63 void StackWinNext();
64
65 void DeleteWindow(PIWindow* w);
66 void DeleteBaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);
67 void DelWRsId(int k);
68 bool CheckWRsId(int k);
69 void CloseAllWindows();
70
71 inline NamedObjMgr* ObjMgr() { return mObjMgr; }
72 inline PIACmd* CmdInterpreter() { return mCmd; }
73
74 PIWindow* CurrentWindow() { return (mCurWin); };
75 PIBaseWdg* CurrentBaseWdg() { return (mCurWdg); };
76
77 inline PIPixmap* ZoomW() { return zoom; }
78 inline PIPixmap* GloVW() { return gimv; }
79 inline PICMapView* CMapVW() { return cmapv; }
80 inline PIConsole* GetConsole() { return mCons; }
81
82 inline PIMenu* SpecialMenu() { return m[5]; }
83 inline PIMenu* ModulesMenu() { return m[6]; }
84
85 inline ObjMgrWind* ObjMgrW() { return mObjmgrw; }
86 inline PPInMgrWind* PPInMgrW() { return mPpinmgrw; }
87
88// Redirection ou Non de StdOut/StdErr
89 void RedirectStdOutErr(bool fg = true);
90 inline bool HasRedirectedStdOutErr() { return(redirecout); }
91// Gestion des signaux
92 void CatchSignals(bool fgfpe=true, bool fgsegv=true);
93
94// Gestion d attributs graphiques courants
95 void SetColAtt(PIColors fg=PI_NotDefColor,
96 PIColors bg=PI_NotDefColor);
97 void SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
98 void SetFontName(PIFontName fn=PI_DefaultFont);
99 void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
100 PIFontAtt fat=PI_NotDefFontAtt);
101 void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
102 inline void SetColMapId(CMapId cid=CMAP_OTHER) { mCmapid = cid; }
103 inline void SetReverseColMapFlag(bool fg=false) { mRevCmap = fg; }
104 void SetZoomAtt(int zoom=0);
105 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
106 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
107 void SetInsetLimits(double xmin=0.4, double xmax=0.6, double ymin=0.4, double ymax=0.6);
108 void SetImageCenterPosition(int x=-1, int y=-1);
109 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; }
110 inline void UseImageCenter(bool fg=false) { mFImgCenter=fg; }
111 inline void SetXLogScale(bool logx=false) { maXlog = logx; }
112 inline void SetYLogScale(bool logy=false) { maYlog = logy; }
113 inline void SetAutoAddTitle(bool aatit=true) { mAddTitle = aatit; }
114
115// Pour sauvegarder-restauration de l'etat des attributs graphiques
116 void SaveGraphicAtt();
117 void RestoreGraphicAtt();
118
119// Gestion fichiers PS
120 int num_eps;
121 PSFile *mpsfile;
122 string name_ps;
123
124// Gestion OUT-PPF
125 POutPersist* mPpfout;
126 string name_outppf;
127
128private:
129 void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
130 void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
131 void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
132 void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
133 void MBProcess5(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
134 void MBProcess6(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
135
136
137 NamedObjMgr* mObjMgr;
138 PIACmd* mCmd;
139
140 PIMenu* m[7];
141 PIMenu* mc;
142
143 PIPixmap* zoom;
144 PIPixmap* gimv;
145 PICMapView* cmapv;
146
147 PIFileChooser * pfc_fits; // Pour les fichiers FITS
148 PIFileChooser * pfc_ppf; // Pour les PPF
149 PIFileChooser * pfc_ps; // Pour les PostScript
150
151 PIConsole* mCons;
152 bool redirecout; // true if stdout/err redirected to mCons;
153
154 WindMList mWList;
155 BWMList mBWList;
156 DrwMList mDrwList;
157
158 int mWId,mDId,mBWId;
159
160 PIBaseWdg* mCurWdg;
161 PIBaseWdg* mLastWdg;
162 PIWindow* mCurWin;
163 PIZoneWindow* mGrW;
164 PIStackWindow* mStW;
165 int mGrIdx;
166 int mStIdx;
167
168 ObjMgrWind* mObjmgrw;
169 PPInMgrWind* mPpinmgrw;
170
171// Gestion d attributs graphiques courants, etat sauvegarde
172 PIColors mFCol, mBCol, mSFCol, mSBCol;
173 PILineAtt mLAtt, mSLAtt;
174 PIFontName mFName, mSFName;
175 PIFontSize mFSz, mSFSz;
176 PIFontAtt mFAtt, mSFAtt;
177 int mMSz, mSMSz;
178 PIMarker mMrk,mSMrk;
179 CMapId mCmapid, mSCmapid;
180 bool mRevCmap, mSRevCmap;
181 int mZoom, mSZoom;
182 unsigned int mAxesFlags, mSAxesFlags;
183 double mXmin, mXmax, mYmin, mYmax;
184 double mSXmin, mSXmax, mSYmin, mSYmax;
185 double mIXmin, mIXmax, mIYmin, mIYmax;
186 double mSIXmin, mSIXmax, mSIYmin, mSIYmax;
187 int mXImgCenter, mYImgCenter;
188 int mSXImgCenter, mSYImgCenter;
189 bool mFXYlim, mSFXYlim;
190 bool mFImgCenter, mSFImgCenter;
191 bool maXlog, mSaXlog;
192 bool maYlog, mSaYlog;
193 bool mAddTitle, mSAddTitle;
194
195 PIMessage mFCMsg; // Message for processing FileOpen
196 int mFgScSz; // Dlag ScreenSize
197 bool mFgCWImg; // true -> Current Widget is PIImage
198};
199
200#endif
Note: See TracBrowser for help on using the repository browser.