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

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

Ajout trace en medaillon - Reza 4/11/99

  • Property svn:executable set to *
File size: 5.7 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
56
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);
66 bool CheckWRsId(int k);
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
80 inline PIMenu* SpecialMenu() { return m[5]; }
81 inline PIMenu* ModulesMenu() { return m[6]; }
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);
88 inline bool HasRedirectedStdOutErr() { return(redirecout); }
89// Gestion des signaux
90 void CatchSignals(bool fgfpe=true, bool fgsegv=true);
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);
101 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
102 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
103 void SetInsetLimits(double xmin=0.4, double xmax=0.6, double ymin=0.4, double ymax=0.6);
104 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; }
105 inline void SetXLogScale(bool logx=false) { maXlog = logx; }
106 inline void SetYLogScale(bool logy=false) { maYlog = logy; }
107
108// Pour sauvegarder-restauration de l'etat des attributs graphiques
109 void SaveGraphicAtt();
110 void RestoreGraphicAtt();
111
112// Gestion fichiers PS
113 int num_eps;
114 PSFile *mpsfile;
115 string name_ps;
116
117// Gestion OUT-PPF
118 POutPersist* mPpfout;
119 string name_outppf;
120
121private:
122 void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
123 void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
124 void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
125 void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
126 void MBProcess5(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
127 void MBProcess6(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
128
129
130 NamedObjMgr* mObjMgr;
131 PIACmd* mCmd;
132
133 PIMenu* m[7];
134 PIMenu* mc;
135
136 PIPixmap* zoom;
137 PIPixmap* gimv;
138 PICMapView* cmapv;
139
140 PIFileChooser * pfc;
141
142 PIConsole* mCons;
143 bool redirecout; // true if stdout/err redirected to mCons;
144
145 WindMList mWList;
146 BWMList mBWList;
147 DrwMList mDrwList;
148
149 int mWId,mDId,mBWId;
150
151 PIBaseWdg* mCurWdg;
152 PIBaseWdg* mLastWdg;
153 PIWindow* mCurWin;
154 PIZoneWindow* mGrW;
155 PIStackWindow* mStW;
156 int mGrIdx;
157 int mStIdx;
158
159 ObjMgrWind* mObjmgrw;
160 PPInMgrWind* mPpinmgrw;
161
162// Gestion d attributs graphiques courants, etat sauvegarde
163 PIColors mFCol, mBCol, mSFCol, mSBCol;
164 PILineAtt mLAtt, mSLAtt;
165 PIFontSize mFSz, mSFSz;
166 PIFontAtt mFAtt, mSFAtt;
167 int mMSz, mSMSz;
168 PIMarker mMrk,mSMrk;
169 CMapId mCmapid, mSCmapid;
170 int mZoom, mSZoom;
171 unsigned int mAxesFlags, mSAxesFlags;
172 double mXmin, mXmax, mYmin, mYmax;
173 double mSXmin, mSXmax, mSYmin, mSYmax;
174 double mIXmin, mIXmax, mIYmin, mIYmax;
175 double mSIXmin, mSIXmax, mSIYmin, mSIYmax;
176 bool mFXYlim, mSFXYlim;
177 bool maXlog, mSaXlog;
178 bool maYlog, mSaYlog;
179
180 PIMessage mFCMsg; // Message for processing FileOpen
181 int mFgScSz; // Dlag ScreenSize
182 bool mFgCWImg; // true -> Current Widget is PIImage
183};
184
185#endif
Note: See TracBrowser for help on using the repository browser.