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

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

A/ ajout des blocs foreach et ameliorations gestion des variables ($x)
pour l'interpreteur piacmd.
B/ Ajout PIStdImgApp::AddText et corrections diverses

Reza 05/08/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>
[347]11#if defined(__KCC__)
12using std::string ;
13#include <map.h>
14#endif
[165]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);
[194]48 virtual void SetReady();
49 virtual void SetBusy();
50 virtual void SetBlocked();
[165]51
[331]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);
[165]55
[349]56 // Fonction d'ajout de texte (provisoire - Aout 99)
57 void AddText(string const & txt, double xp, double yp);
58
59
[165]60 void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
61 void CreateStackWin(int sx=0, int sy = 0);
62 PIWindow * GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom);
63 void SetZone(int nzx=1, int nzy=1);
64 void StackWinNext();
65
66 void DeleteWindow(PIWindow* w);
67 void DeleteBaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);
68 void DelWRsId(int k);
69 void CloseAllWindows();
70
71 inline NamedObjMgr* ObjMgr() { return mObjMgr; }
72 inline PIACmd* CmdInterpreter() { return mCmd; }
73
74 PIWindow* CurrentWindow() { return (mCurWin); };
75 PIBaseWdg* CurrentBaseWdg() { return (mCurWdg); };
76
77 inline PIPixmap* ZoomW() { return zoom; }
78 inline PIPixmap* GloVW() { return gimv; }
79 inline PICMapView* CMapVW() { return cmapv; }
80 inline PIConsole* GetConsole() { return mCons; }
81
[293]82 inline PIMenu* SpecialMenu() { return m[5]; }
83 inline PIMenu* ModulesMenu() { return m[6]; }
[165]84
85 inline ObjMgrWind* ObjMgrW() { return mObjmgrw; }
86 inline PPInMgrWind* PPInMgrW() { return mPpinmgrw; }
87
88// Redirection ou Non de StdOut/StdErr
89 void RedirectStdOutErr(bool fg = true);
[293]90 inline bool HasRedirectedStdOutErr() { return(redirecout); }
[165]91// Gestion des signaux
92 void CatchSignals(bool fg = true);
93
94// Gestion d attributs graphiques courants
95 void SetColAtt(PIColors fg=PI_NotDefColor,
96 PIColors bg=PI_NotDefColor);
97 void SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
98 void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
99 PIFontAtt fat=PI_NotDefFontAtt);
100 void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
101 void SetColMapId(CMapId cid=CMAP_OTHER);
102 void SetZoomAtt(int zoom=0);
[203]103 void SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
[331]104 void SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
105 inline void UseXYLimits(bool fg=false) { mFXYlim=fg; }
[165]106// Pour sauvegarder-restauration de l'etat des attributs graphiques
107 void SaveGraphicAtt();
108 void RestoreGraphicAtt();
109
110// Gestion fichiers PS
111 int num_eps;
112 PSFile *mpsfile;
113 string name_ps;
114
115// Gestion OUT-PPF
116 POutPersist* mPpfout;
117 string name_outppf;
118
119private:
120 void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
121 void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
122 void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
123 void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
124 void MBProcess5(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
125 void MBProcess6(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
126
127
128 NamedObjMgr* mObjMgr;
129 PIACmd* mCmd;
130
[293]131 PIMenu* m[7];
[165]132 PIMenu* mc;
133
134 PIPixmap* zoom;
135 PIPixmap* gimv;
136 PICMapView* cmapv;
137
138 PIFileChooser * pfc;
139
140 PIConsole* mCons;
[293]141 bool redirecout; // true if stdout/err redirected to mCons;
[165]142
143 WindMList mWList;
144 BWMList mBWList;
145 DrwMList mDrwList;
146
147 int mWId,mDId,mBWId;
148
149 PIBaseWdg* mCurWdg;
150 PIBaseWdg* mLastWdg;
151 PIWindow* mCurWin;
152 PIZoneWindow* mGrW;
153 PIStackWindow* mStW;
154 int mGrIdx;
155 int mStIdx;
156
157 ObjMgrWind* mObjmgrw;
158 PPInMgrWind* mPpinmgrw;
159
160// Gestion d attributs graphiques courants, etat sauvegarde
161 PIColors mFCol, mBCol, mSFCol, mSBCol;
162 PILineAtt mLAtt, mSLAtt;
163 PIFontSize mFSz, mSFSz;
164 PIFontAtt mFAtt, mSFAtt;
165 int mMSz, mSMSz;
166 PIMarker mMrk,mSMrk;
167 CMapId mCmapid, mSCmapid;
168 int mZoom, mSZoom;
[203]169 unsigned int mAxesFlags, mSAxesFlags;
[331]170 double mXmin, mXmax, mYmin, mYmax;
171 double mSXmin, mSXmax, mSYmin, mSYmax;
172 bool mFXYlim, mSFXYlim;
[165]173
174 PIMessage mFCMsg; // Message for processing FileOpen
175 int mFgScSz; // Dlag ScreenSize
176 bool mFgCWImg; // true -> Current Widget is PIImage
177};
178
179#endif
Note: See TracBrowser for help on using the repository browser.