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

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

Pb portage - Reza 03/08/99

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