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

Last change on this file since 179 was 165, checked in by ercodmgr, 27 years ago

Creation du module PIext en regroupant des fichiers de Drawer/Wdg pour
Objets ds PEIDA/Outils++, Images++, ... et des classes de ProgPI,
lie a piapp (PIStdImgApp, NamedObjMgr, ...) Reza 18/12/98

  • Property svn:executable set to *
File size: 4.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
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);
44
45 int DispImage(P2DArrayAdapter* nouv, string const & name, int opt);
46 int DispScDrawer(PIDrawer* scd, string const & name, int opt, string title="", bool h2d=false);
47 int Disp3DDrawer(PIDrawer3D* scd, string const & name, int opt, string title="");
48
49 void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
50 void CreateStackWin(int sx=0, int sy = 0);
51 PIWindow * GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom);
52 void SetZone(int nzx=1, int nzy=1);
53 void StackWinNext();
54
55 void DeleteWindow(PIWindow* w);
56 void DeleteBaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);
57 void DelWRsId(int k);
58 void CloseAllWindows();
59
60 inline NamedObjMgr* ObjMgr() { return mObjMgr; }
61 inline PIACmd* CmdInterpreter() { return mCmd; }
62
63 PIWindow* CurrentWindow() { return (mCurWin); };
64 PIBaseWdg* CurrentBaseWdg() { return (mCurWdg); };
65
66 inline PIPixmap* ZoomW() { return zoom; }
67 inline PIPixmap* GloVW() { return gimv; }
68 inline PICMapView* CMapVW() { return cmapv; }
69 inline PIConsole* GetConsole() { return mCons; }
70
71// inline CutTools* CutTC() { return mCutTC; } A reactiver plus tard ? Reza 08/98
72
73 inline ObjMgrWind* ObjMgrW() { return mObjmgrw; }
74 inline PPInMgrWind* PPInMgrW() { return mPpinmgrw; }
75
76// Redirection ou Non de StdOut/StdErr
77 void RedirectStdOutErr(bool fg = true);
78// Gestion des signaux
79 void CatchSignals(bool fg = true);
80
81// Gestion d attributs graphiques courants
82 void SetColAtt(PIColors fg=PI_NotDefColor,
83 PIColors bg=PI_NotDefColor);
84 void SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
85 void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
86 PIFontAtt fat=PI_NotDefFontAtt);
87 void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
88 void SetColMapId(CMapId cid=CMAP_OTHER);
89 void SetZoomAtt(int zoom=0);
90// Pour sauvegarder-restauration de l'etat des attributs graphiques
91 void SaveGraphicAtt();
92 void RestoreGraphicAtt();
93
94// Gestion fichiers PS
95 int num_eps;
96 PSFile *mpsfile;
97 string name_ps;
98
99// Gestion OUT-PPF
100 POutPersist* mPpfout;
101 string name_outppf;
102
103private:
104 void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
105 void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
106 void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
107 void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
108 void MBProcess5(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
109 void MBProcess6(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
110
111
112 NamedObjMgr* mObjMgr;
113 PIACmd* mCmd;
114
115 PIMenu* m[6];
116 PIMenu* mc;
117
118 PIPixmap* zoom;
119 PIPixmap* gimv;
120 PICMapView* cmapv;
121
122 PIFileChooser * pfc;
123
124// CutTools* mCutTC; // mTCId = 3 A reactiver plus tard ? Reza 08/98
125// PIContainer* mTC; A reactiver plus tard ? Reza 08/98
126
127 PIConsole* mCons;
128
129 WindMList mWList;
130 BWMList mBWList;
131 DrwMList mDrwList;
132
133 int mWId,mDId,mBWId;
134
135 PIBaseWdg* mCurWdg;
136 PIBaseWdg* mLastWdg;
137 PIWindow* mCurWin;
138 PIZoneWindow* mGrW;
139 PIStackWindow* mStW;
140 int mGrIdx;
141 int mStIdx;
142
143 ObjMgrWind* mObjmgrw;
144 PPInMgrWind* mPpinmgrw;
145
146// Gestion d attributs graphiques courants, etat sauvegarde
147 PIColors mFCol, mBCol, mSFCol, mSBCol;
148 PILineAtt mLAtt, mSLAtt;
149 PIFontSize mFSz, mSFSz;
150 PIFontAtt mFAtt, mSFAtt;
151 int mMSz, mSMSz;
152 PIMarker mMrk,mSMrk;
153 CMapId mCmapid, mSCmapid;
154 int mZoom, mSZoom;
155
156 PIMessage mFCMsg; // Message for processing FileOpen
157 int mFgScSz; // Dlag ScreenSize
158 bool mFgCWImg; // true -> Current Widget is PIImage
159};
160
161#endif
Note: See TracBrowser for help on using the repository browser.