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

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

flag KCC -> namespace std et CC_HAS_RTTI_SUPPORT Reza 26/9/99

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