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

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

ajout option graphique revcmap pour inverser l'indexage des ColorMap - Reza 21/5/2001

  • Property svn:executable set to *
File size: 6.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
[548]33enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3, Disp_Inset=4};
[165]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);
[1131]55 // Fonction Ajout de titre de trace
56 void SetTitle(string const & titleup, string const & titledown);
[349]57
58
[165]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);
[368]68 bool CheckWRsId(int k);
[165]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
[293]82 inline PIMenu* SpecialMenu() { return m[5]; }
83 inline PIMenu* ModulesMenu() { return m[6]; }
[165]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);
[293]90 inline bool HasRedirectedStdOutErr() { return(redirecout); }
[165]91// Gestion des signaux
[374]92 void CatchSignals(bool fgfpe=true, bool fgsegv=true);
[165]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 SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
99 PIFontAtt fat=PI_NotDefFontAtt);
100 void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
[1504]101 inline void SetColMapId(CMapId cid=CMAP_OTHER) { mCmapid = cid; }
102 inline void SetReverseColMapFlag(bool fg=false) { mRevCmap = fg; }
[165]103 void SetZoomAtt(int zoom=0);
[203]104 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
[331]105 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
[548]106 void SetInsetLimits(double xmin=0.4, double xmax=0.6, double ymin=0.4, double ymax=0.6);
[558]107 void SetImageCenterPosition(int x=-1, int y=-1);
[331]108 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; }
[558]109 inline void UseImageCenter(bool fg=false) { mFImgCenter=fg; }
[506]110 inline void SetXLogScale(bool logx=false) { maXlog = logx; }
111 inline void SetYLogScale(bool logy=false) { maYlog = logy; }
[1131]112 inline void SetAutoAddTitle(bool aatit=true) { mAddTitle = aatit; }
[506]113
[165]114// Pour sauvegarder-restauration de l'etat des attributs graphiques
115 void SaveGraphicAtt();
116 void RestoreGraphicAtt();
117
118// Gestion fichiers PS
119 int num_eps;
120 PSFile *mpsfile;
121 string name_ps;
122
123// Gestion OUT-PPF
124 POutPersist* mPpfout;
125 string name_outppf;
126
127private:
128 void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
129 void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
130 void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
131 void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
132 void MBProcess5(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
133 void MBProcess6(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
134
135
136 NamedObjMgr* mObjMgr;
137 PIACmd* mCmd;
138
[293]139 PIMenu* m[7];
[165]140 PIMenu* mc;
141
142 PIPixmap* zoom;
143 PIPixmap* gimv;
144 PICMapView* cmapv;
145
[685]146 PIFileChooser * pfc_fits; // Pour les fichiers FITS
147 PIFileChooser * pfc_ppf; // Pour les PPF
148 PIFileChooser * pfc_ps; // Pour les PostScript
[165]149
150 PIConsole* mCons;
[293]151 bool redirecout; // true if stdout/err redirected to mCons;
[165]152
153 WindMList mWList;
154 BWMList mBWList;
155 DrwMList mDrwList;
156
157 int mWId,mDId,mBWId;
158
159 PIBaseWdg* mCurWdg;
160 PIBaseWdg* mLastWdg;
161 PIWindow* mCurWin;
162 PIZoneWindow* mGrW;
163 PIStackWindow* mStW;
164 int mGrIdx;
165 int mStIdx;
166
167 ObjMgrWind* mObjmgrw;
168 PPInMgrWind* mPpinmgrw;
169
170// Gestion d attributs graphiques courants, etat sauvegarde
171 PIColors mFCol, mBCol, mSFCol, mSBCol;
172 PILineAtt mLAtt, mSLAtt;
173 PIFontSize mFSz, mSFSz;
174 PIFontAtt mFAtt, mSFAtt;
175 int mMSz, mSMSz;
176 PIMarker mMrk,mSMrk;
177 CMapId mCmapid, mSCmapid;
[1504]178 bool mRevCmap, mSRevCmap;
[165]179 int mZoom, mSZoom;
[203]180 unsigned int mAxesFlags, mSAxesFlags;
[331]181 double mXmin, mXmax, mYmin, mYmax;
182 double mSXmin, mSXmax, mSYmin, mSYmax;
[548]183 double mIXmin, mIXmax, mIYmin, mIYmax;
184 double mSIXmin, mSIXmax, mSIYmin, mSIYmax;
[558]185 int mXImgCenter, mYImgCenter;
186 int mSXImgCenter, mSYImgCenter;
[331]187 bool mFXYlim, mSFXYlim;
[558]188 bool mFImgCenter, mSFImgCenter;
[506]189 bool maXlog, mSaXlog;
190 bool maYlog, mSaYlog;
[1131]191 bool mAddTitle, mSAddTitle;
[165]192
193 PIMessage mFCMsg; // Message for processing FileOpen
194 int mFgScSz; // Dlag ScreenSize
195 bool mFgCWImg; // true -> Current Widget is PIImage
196};
197
198#endif
Note: See TracBrowser for help on using the repository browser.