1 /*****************************************************************************
5 ** Purpose: Header file for View & Canvas routines of CTSim program
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: July 2000
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: views.h,v 1.21 2001/01/02 05:34:57 kevin Exp $
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.
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.
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 ******************************************************************************/
37 #include "imagefile.h"
39 class ImageFileCanvas;
40 class ImageFileView : public wxView
42 DECLARE_DYNAMIC_CLASS(ImageFileView)
44 wxMemoryDC m_memoryDC;
48 ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
49 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
51 ImageFileCanvas *m_canvas;
57 double m_dAutoScaleFactor;
59 int m_iDefaultExportFormatID;
\r
63 virtual ~ImageFileView(void);
65 bool OnCreate(wxDocument *doc, long flags);
66 void OnDraw(wxDC* dc);
67 void OnUpdate(wxView *sender, wxObject *hint = NULL);
68 bool OnClose (bool deleteWindow = true);
\r
70 void OnScaleSize (wxCommandEvent& event);
71 void OnExport (wxCommandEvent& event);
\r
72 void OnProperties (wxCommandEvent& event);
73 void OnCompare (wxCommandEvent& event);
\r
74 void OnInvertValues (wxCommandEvent& event);
\r
75 void OnSquare (wxCommandEvent& event);
\r
76 void OnSquareRoot (wxCommandEvent& event);
\r
77 void OnLog (wxCommandEvent& event);
\r
78 void OnExp (wxCommandEvent& event);
\r
79 void OnAdd (wxCommandEvent& event);
\r
80 void OnSubtract (wxCommandEvent& event);
\r
81 void OnMultiply (wxCommandEvent& event);
\r
82 void OnDivide (wxCommandEvent& event);
\r
83 void OnFourier (wxCommandEvent& event);
\r
84 void OnInverseFourier (wxCommandEvent& event);
\r
85 void OnShuffleNaturalToFourierOrder (wxCommandEvent& event);
\r
86 void OnShuffleFourierToNaturalOrder (wxCommandEvent& event);
\r
88 void OnFFT (wxCommandEvent& event);
\r
89 void OnIFFT (wxCommandEvent& event);
\r
91 void OnMagnitude (wxCommandEvent& event);
\r
92 void OnPhase (wxCommandEvent& event);
\r
93 void OnScaleAuto (wxCommandEvent& event);
94 void OnScaleMinMax (wxCommandEvent& event);
95 void OnPlotRow (wxCommandEvent& event);
\r
96 void OnPlotCol (wxCommandEvent& event);
\r
97 void OnCompareRow (wxCommandEvent& event);
\r
98 void OnCompareCol (wxCommandEvent& event);
\r
100 wxFrame* getFrame()
\r
101 { return m_frame; }
\r
103 ImageFileDocument* GetDocument(void)
104 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
106 DECLARE_EVENT_TABLE()
109 class ImageFileCanvas: public wxScrolledWindow
116 ImageFileView* m_pView;
118 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
119 virtual void OnDraw(wxDC& dc);
120 void OnMouseEvent(wxMouseEvent& event);
122 void DrawRubberBandCursor (wxDC& dc, int x, int y);
\r
123 bool GetCurrentCursor (int& x, int& y);
\r
125 DECLARE_EVENT_TABLE()
129 class ProjectionFileCanvas;
130 class ProjectionFileView : public wxView
132 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
134 wxMemoryDC m_memoryDC;
138 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
139 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
141 ProjectionFileCanvas *m_canvas;
146 int m_iDefaultFilter;
147 int m_iDefaultFilterMethod;
148 double m_dDefaultFilterParam;
149 int m_iDefaultFilterGeneration;
150 int m_iDefaultZeropad;
151 int m_iDefaultInterpolation;
152 int m_iDefaultInterpParam;
153 int m_iDefaultBackprojector;
157 ProjectionFileView(void);
158 virtual ~ProjectionFileView(void);
160 bool OnCreate(wxDocument *doc, long flags);
161 void OnDraw(wxDC* dc);
162 void OnUpdate(wxView *sender, wxObject *hint = NULL);
163 bool OnClose (bool deleteWindow = true);
164 void OnProperties (wxCommandEvent& event);
165 void OnReconstruct (wxCommandEvent& event);
167 wxFrame* getFrame ()
\r
168 { return m_frame; }
\r
170 ProjectionFileDocument* GetDocument(void)
171 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
172 DECLARE_EVENT_TABLE()
175 class ProjectionFileCanvas: public wxScrolledWindow
178 ProjectionFileView* m_pView;
180 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
181 virtual void OnDraw(wxDC& dc);
186 class PhantomView : public wxView
188 DECLARE_DYNAMIC_CLASS(PhantomView)
191 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
192 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
194 PhantomCanvas *m_canvas;
199 int m_iDefaultNSample;
200 int m_iDefaultGeometry;
202 double m_dDefaultRotation;
203 double m_dDefaultFocalLength;
204 double m_dDefaultFieldOfView;
208 virtual ~PhantomView(void);
210 bool OnCreate(wxDocument *doc, long flags);
211 void OnUpdate(wxView *sender, wxObject *hint = NULL);
212 bool OnClose (bool deleteWindow = true);
213 void OnDraw(wxDC* dc);
214 void OnProperties (wxCommandEvent& event);
215 void OnRasterize (wxCommandEvent& event);
216 void OnProjections (wxCommandEvent& event);
218 PhantomDocument* GetDocument(void)
219 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
221 DECLARE_EVENT_TABLE()
224 class PhantomCanvas: public wxScrolledWindow
227 PhantomView* m_pView;
229 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
231 virtual void OnDraw(wxDC& dc);
235 class PlotFileCanvas;
236 class PlotFileView : public wxView
238 DECLARE_DYNAMIC_CLASS(PlotFileView)
241 PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
242 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
244 PlotFileCanvas *m_canvas;
247 bool m_bMinSpecified;
\r
248 bool m_bMaxSpecified;
\r
249 double m_dMinPixel;
\r
250 double m_dMaxPixel;
\r
251 double m_dAutoScaleFactor;
\r
255 virtual ~PlotFileView(void);
257 bool OnCreate(wxDocument *doc, long flags);
258 void OnDraw(wxDC* dc);
259 void OnUpdate(wxView *sender, wxObject *hint = NULL);
260 bool OnClose (bool deleteWindow = true);
261 void OnProperties (wxCommandEvent& event);
262 void OnScaleAuto (wxCommandEvent& event);
\r
263 void OnScaleMinMax (wxCommandEvent& event);
\r
268 PlotFileDocument* GetDocument(void)
269 { return dynamic_cast<PlotFileDocument*>(wxView::GetDocument()); }
271 DECLARE_EVENT_TABLE()
274 class PlotFileCanvas: public wxScrolledWindow
277 PlotFileView* m_pView;
279 PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
280 virtual void OnDraw(wxDC& dc);