r310: plotfile updates
[ctsim.git] / src / views.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          view.h
5 **   Purpose:       Header file for View & Canvas routines of CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: views.h,v 1.15 2000/12/21 03:40:58 kevin Exp $
13 **
14 **  This program is free software; you can redistribute it and/or modify
15 **  it under the terms of the GNU General Public License (version 2) as
16 **  published by the Free Software Foundation.
17 **
18 **  This program is distributed in the hope that it will be useful,
19 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 **  GNU General Public License for more details.
22 **
23 **  You should have received a copy of the GNU General Public License
24 **  along with this program; if not, write to the Free Software
25 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 ******************************************************************************/
27
28 #ifdef __GNUG__
29 // #pragma interface
30 #endif
31
32 #ifndef __VIEWSH__
33 #define __VIEWSH__
34
35 #include "wx/wx.h"
36 #include "docs.h"
37 #include "imagefile.h"
38
39 class ImageFileCanvas;
40 class ImageFileView : public wxView
41 {
42     DECLARE_DYNAMIC_CLASS(ImageFileView)
43
44     wxMemoryDC m_memoryDC;
45     wxBitmap m_bitmap;
46
47 private:
48     ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
49     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
50
51     ImageFileCanvas *m_canvas;
52     wxFrame *m_frame;
53     bool m_bMinSpecified;
54     bool m_bMaxSpecified;
55     double m_dMinPixel;
56     double m_dMaxPixel;
57     double m_dAutoScaleFactor;
58
59 public:
60     ImageFileView(void);
61     virtual ~ImageFileView(void);
62
63     bool OnCreate(wxDocument *doc, long flags);
64     void OnDraw(wxDC* dc);
65     void OnUpdate(wxView *sender, wxObject *hint = NULL);
66     bool OnClose (bool deleteWindow = true);
67     void OnProperties (wxCommandEvent& event);
68     void OnCompare (wxCommandEvent& event);\r
69     void OnScaleAuto (wxCommandEvent& event);
70     void OnScaleMinMax (wxCommandEvent& event);
71         void OnPlotRow (wxCommandEvent& event);\r
72         void OnPlotCol (wxCommandEvent& event);\r
73 \r
74         wxFrame* getFrame()\r
75         { return m_frame; }\r
76
77     ImageFileDocument* GetDocument(void) 
78         { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
79
80     DECLARE_EVENT_TABLE()
81 };
82
83 class ImageFileCanvas: public wxScrolledWindow
84 {
85 private:\r
86         int m_xCursor;\r
87         int m_yCursor;\r
88 \r
89 public:
90     ImageFileView* m_pView;
91     
92     ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
93     virtual void OnDraw(wxDC& dc);
94     void OnMouseEvent(wxMouseEvent& event);
95 \r
96         void DrawRubberBandCursor (wxDC& dc, int x, int y);\r
97         bool GetCurrentCursor (int& x, int& y);\r
98
99     DECLARE_EVENT_TABLE()
100 };
101
102
103 class ProjectionFileCanvas;
104 class ProjectionFileView : public wxView
105 {
106     DECLARE_DYNAMIC_CLASS(ProjectionFileView)
107
108     wxMemoryDC m_memoryDC;
109     wxBitmap m_bitmap;
110
111 private:
112     ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
113     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
114
115     ProjectionFileCanvas *m_canvas;
116     wxFrame *m_frame;
117
118     int m_iDefaultNX;
119     int m_iDefaultNY;
120     int m_iDefaultFilter;
121     int m_iDefaultFilterMethod;
122     double m_dDefaultFilterParam;
123     int m_iDefaultFilterGeneration;
124     int m_iDefaultZeropad;
125     int m_iDefaultInterpolation;
126     int m_iDefaultInterpParam;
127     int m_iDefaultBackprojector;
128     int m_iDefaultTrace;
129
130 public:
131     ProjectionFileView(void);
132     virtual ~ProjectionFileView(void);
133
134     bool OnCreate(wxDocument *doc, long flags);
135     void OnDraw(wxDC* dc);
136     void OnUpdate(wxView *sender, wxObject *hint = NULL);
137     bool OnClose (bool deleteWindow = true);
138     void OnProperties (wxCommandEvent& event);
139     void OnReconstruct (wxCommandEvent& event);
140 \r
141         wxFrame* getFrame ()\r
142         { return m_frame; }\r
143
144     ProjectionFileDocument* GetDocument(void) 
145         { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
146     DECLARE_EVENT_TABLE()
147 };
148
149 class ProjectionFileCanvas: public wxScrolledWindow
150 {
151 public:
152     ProjectionFileView* m_pView;
153     
154     ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
155     virtual void OnDraw(wxDC& dc);
156 };
157
158
159 class PhantomCanvas;
160 class PhantomView : public wxView
161 {
162     DECLARE_DYNAMIC_CLASS(PhantomView)
163
164 private:
165     PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
166     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
167
168     PhantomCanvas *m_canvas;
169     wxFrame *m_frame;
170
171     int m_iDefaultNDet;
172     int m_iDefaultNView;
173     int m_iDefaultNSample;
174     int m_iDefaultGeometry;
175     int m_iDefaultTrace;
176     double m_dDefaultRotation;
177     double m_dDefaultFocalLength;
178     double m_dDefaultFieldOfView;
179
180 public:
181     PhantomView(void);
182     virtual ~PhantomView(void);
183
184     bool OnCreate(wxDocument *doc, long flags);
185     void OnUpdate(wxView *sender, wxObject *hint = NULL);
186     bool OnClose (bool deleteWindow = true);
187     void OnDraw(wxDC* dc);
188     void OnProperties (wxCommandEvent& event);
189     void OnRasterize (wxCommandEvent& event);
190     void OnProjections (wxCommandEvent& event);
191
192     PhantomDocument* GetDocument(void) 
193         { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
194
195     DECLARE_EVENT_TABLE()
196 };
197
198 class PhantomCanvas: public wxScrolledWindow
199 {
200 public:
201     PhantomView* m_pView;
202     
203     PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
204
205     virtual void OnDraw(wxDC& dc);
206
207 };
208
209 class PlotFileCanvas;
210 class PlotFileView : public wxView
211 {
212     DECLARE_DYNAMIC_CLASS(PlotFileView)
213
214 private:
215     PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
216     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
217
218     PlotFileCanvas *m_canvas;
219     wxFrame *m_frame;
220     bool m_bMinSpecified;\r
221     bool m_bMaxSpecified;\r
222     double m_dMinPixel;\r
223     double m_dMaxPixel;\r
224     double m_dAutoScaleFactor;\r
225
226 public:
227     PlotFileView(void);
228     virtual ~PlotFileView(void);
229
230     bool OnCreate(wxDocument *doc, long flags);
231     void OnDraw(wxDC* dc);
232     void OnUpdate(wxView *sender, wxObject *hint = NULL);
233     bool OnClose (bool deleteWindow = true);
234     void OnProperties (wxCommandEvent& event);
235     void OnScaleAuto (wxCommandEvent& event);\r
236     void OnScaleMinMax (wxCommandEvent& event);\r
237
238         wxFrame* getFrame ()
239         { return m_frame; }
240
241     PlotFileDocument* GetDocument(void) 
242         { return dynamic_cast<PlotFileDocument*>(wxView::GetDocument()); }
243
244     DECLARE_EVENT_TABLE()
245 };
246
247 class PlotFileCanvas: public wxScrolledWindow
248 {
249 public:
250     PlotFileView* m_pView;
251     
252     PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
253     virtual void OnDraw(wxDC& dc);
254 };
255
256
257
258 #endif
259