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

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

Adaptation aux "normes DPC", introduction des classes CmdExecutor, ...
Fenetre d'aide en lignes, gestion de modules, ... Reza 11/05/99

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