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

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

Portage KCC (il faut functional pour less<>) Reza 5/8/99

  • Property svn:executable set to *
File size: 5.4 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>
[351]11#include <functional>
[347]12#if defined(__KCC__)
13using std::string ;
14#include <map.h>
[351]15#include <functional.h>
[347]16#endif
[165]17
18#include "pisysdep.h"
19
20#include PIAPP_H
21#include PIWIN_H
22#include PIMENU_H
23#include PIOPTMENU_H
24
25#include PISTDWDG_H
26
27#include PIFILECHO_H
28#include "picons.h"
29
30#include "piimage.h"
31#include "pi3ddrw.h"
32#include "nobjmgr.h"
33#include "piacmd.h"
34#include "pisiadw.h"
35#include "pistzwin.h"
36
37
38enum {Disp_Next=0, Disp_Win=1, Disp_Same=2, Disp_Stack=3};
39
40typedef map<long, PIWindow*, less<long> > WindMList;
41typedef map<long, PIBaseWdg*, less<long> > BWMList;
42typedef map<long, PIDrawer*, less<long> > DrwMList;
43
44class PIStdImgApp : public PIApplication {
45public:
46 PIStdImgApp(int narg=0, char* arg[]=NULL);
47 ~PIStdImgApp();
48
49 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
[194]50 virtual void SetReady();
51 virtual void SetBusy();
52 virtual void SetBlocked();
[165]53
[331]54 int DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid=0);
55 int DispScDrawer(PIDrawer* scd, string const & name, int opt, string title="", int oid=0);
56 int Disp3DDrawer(PIDrawer3D* scd, string const & name, int opt, string title="", int oid=0);
[165]57
[349]58 // Fonction d'ajout de texte (provisoire - Aout 99)
59 void AddText(string const & txt, double xp, double yp);
60
61
[165]62 void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
63 void CreateStackWin(int sx=0, int sy = 0);
64 PIWindow * GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom);
65 void SetZone(int nzx=1, int nzy=1);
66 void StackWinNext();
67
68 void DeleteWindow(PIWindow* w);
69 void DeleteBaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);
70 void DelWRsId(int k);
71 void CloseAllWindows();
72
73 inline NamedObjMgr* ObjMgr() { return mObjMgr; }
74 inline PIACmd* CmdInterpreter() { return mCmd; }
75
76 PIWindow* CurrentWindow() { return (mCurWin); };
77 PIBaseWdg* CurrentBaseWdg() { return (mCurWdg); };
78
79 inline PIPixmap* ZoomW() { return zoom; }
80 inline PIPixmap* GloVW() { return gimv; }
81 inline PICMapView* CMapVW() { return cmapv; }
82 inline PIConsole* GetConsole() { return mCons; }
83
[293]84 inline PIMenu* SpecialMenu() { return m[5]; }
85 inline PIMenu* ModulesMenu() { return m[6]; }
[165]86
87 inline ObjMgrWind* ObjMgrW() { return mObjmgrw; }
88 inline PPInMgrWind* PPInMgrW() { return mPpinmgrw; }
89
90// Redirection ou Non de StdOut/StdErr
91 void RedirectStdOutErr(bool fg = true);
[293]92 inline bool HasRedirectedStdOutErr() { return(redirecout); }
[165]93// Gestion des signaux
94 void CatchSignals(bool fg = true);
95
96// Gestion d attributs graphiques courants
97 void SetColAtt(PIColors fg=PI_NotDefColor,
98 PIColors bg=PI_NotDefColor);
99 void SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
100 void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
101 PIFontAtt fat=PI_NotDefFontAtt);
102 void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
103 void SetColMapId(CMapId cid=CMAP_OTHER);
104 void SetZoomAtt(int zoom=0);
[203]105 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
[331]106 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
107 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; }
[165]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
[293]133 PIMenu* m[7];
[165]134 PIMenu* mc;
135
136 PIPixmap* zoom;
137 PIPixmap* gimv;
138 PICMapView* cmapv;
139
140 PIFileChooser * pfc;
141
142 PIConsole* mCons;
[293]143 bool redirecout; // true if stdout/err redirected to mCons;
[165]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;
[203]171 unsigned int mAxesFlags, mSAxesFlags;
[331]172 double mXmin, mXmax, mYmin, mYmax;
173 double mSXmin, mSXmax, mSYmin, mSYmax;
174 bool mFXYlim, mSFXYlim;
[165]175
176 PIMessage mFCMsg; // Message for processing FileOpen
177 int mFgScSz; // Dlag ScreenSize
178 bool mFgCWImg; // true -> Current Widget is PIImage
179};
180
181#endif
Note: See TracBrowser for help on using the repository browser.