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.23 2001/01/02 13:57:30 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;
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);
70 void OnScaleSize (wxCommandEvent& event);
71 void OnExport (wxCommandEvent& event);
73 void OnProperties (wxCommandEvent& event);
74 void OnCompare (wxCommandEvent& event);
76 void OnInvertValues (wxCommandEvent& event);
77 void OnSquare (wxCommandEvent& event);
78 void OnSquareRoot (wxCommandEvent& event);
79 void OnLog (wxCommandEvent& event);
80 void OnExp (wxCommandEvent& event);
81 void OnAdd (wxCommandEvent& event);
82 void OnSubtract (wxCommandEvent& event);
83 void OnMultiply (wxCommandEvent& event);
84 void OnDivide (wxCommandEvent& event);
85 void OnFourier (wxCommandEvent& event);
86 void OnInverseFourier (wxCommandEvent& event);
87 void OnShuffleNaturalToFourierOrder (wxCommandEvent& event);
88 void OnShuffleFourierToNaturalOrder (wxCommandEvent& event);
91 void OnFFT (wxCommandEvent& event);
92 void OnIFFT (wxCommandEvent& event);
95 void OnMagnitude (wxCommandEvent& event);
96 void OnPhase (wxCommandEvent& event);
98 void OnScaleAuto (wxCommandEvent& event);
99 void OnScaleMinMax (wxCommandEvent& event);
100 void OnPlotRow (wxCommandEvent& event);
101 void OnPlotCol (wxCommandEvent& event);
102 void OnPlotHistogram (wxCommandEvent& event);
103 void OnCompareRow (wxCommandEvent& event);
104 void OnCompareCol (wxCommandEvent& event);
109 ImageFileDocument* GetDocument(void)
110 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
112 DECLARE_EVENT_TABLE()
115 class ImageFileCanvas: public wxScrolledWindow
123 ImageFileView* m_pView;
125 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
126 virtual void OnDraw(wxDC& dc);
127 void OnMouseEvent(wxMouseEvent& event);
128 void DrawRubberBandCursor (wxDC& dc, int x, int y);
129 bool GetCurrentCursor (int& x, int& y);
131 DECLARE_EVENT_TABLE()
135 class ProjectionFileCanvas;
136 class ProjectionFileView : public wxView
138 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
140 wxMemoryDC m_memoryDC;
144 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
145 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
147 ProjectionFileCanvas *m_canvas;
152 int m_iDefaultFilter;
153 int m_iDefaultFilterMethod;
154 double m_dDefaultFilterParam;
155 int m_iDefaultFilterGeneration;
156 int m_iDefaultZeropad;
157 int m_iDefaultInterpolation;
158 int m_iDefaultInterpParam;
159 int m_iDefaultBackprojector;
163 ProjectionFileView(void);
164 virtual ~ProjectionFileView(void);
166 bool OnCreate(wxDocument *doc, long flags);
167 void OnDraw(wxDC* dc);
168 void OnUpdate(wxView *sender, wxObject *hint = NULL);
169 bool OnClose (bool deleteWindow = true);
170 void OnProperties (wxCommandEvent& event);
171 void OnReconstruct (wxCommandEvent& event);
176 ProjectionFileDocument* GetDocument(void)
177 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
178 DECLARE_EVENT_TABLE()
181 class ProjectionFileCanvas: public wxScrolledWindow
184 ProjectionFileView* m_pView;
186 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
187 virtual void OnDraw(wxDC& dc);
192 class PhantomView : public wxView
194 DECLARE_DYNAMIC_CLASS(PhantomView)
197 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
198 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
200 PhantomCanvas *m_canvas;
205 int m_iDefaultNSample;
206 int m_iDefaultGeometry;
208 double m_dDefaultRotation;
209 double m_dDefaultFocalLength;
210 double m_dDefaultFieldOfView;
214 virtual ~PhantomView(void);
216 bool OnCreate(wxDocument *doc, long flags);
217 void OnUpdate(wxView *sender, wxObject *hint = NULL);
218 bool OnClose (bool deleteWindow = true);
219 void OnDraw(wxDC* dc);
220 void OnProperties (wxCommandEvent& event);
221 void OnRasterize (wxCommandEvent& event);
222 void OnProjections (wxCommandEvent& event);
224 PhantomDocument* GetDocument(void)
225 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
227 DECLARE_EVENT_TABLE()
230 class PhantomCanvas: public wxScrolledWindow
233 PhantomView* m_pView;
235 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
236 virtual void OnDraw(wxDC& dc);
239 class PlotFileCanvas;
240 class PlotFileView : public wxView
242 DECLARE_DYNAMIC_CLASS(PlotFileView)
245 PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
246 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
248 PlotFileCanvas *m_canvas;
252 bool m_bMinSpecified;
253 bool m_bMaxSpecified;
256 double m_dAutoScaleFactor;
260 virtual ~PlotFileView(void);
262 bool OnCreate(wxDocument *doc, long flags);
263 void OnDraw(wxDC* dc);
264 void OnUpdate(wxView *sender, wxObject *hint = NULL);
265 bool OnClose (bool deleteWindow = true);
266 void OnProperties (wxCommandEvent& event);
267 void OnScaleAuto (wxCommandEvent& event);
268 void OnScaleMinMax (wxCommandEvent& event);
273 PlotFileDocument* GetDocument(void)
274 { return dynamic_cast<PlotFileDocument*>(wxView::GetDocument()); }
276 DECLARE_EVENT_TABLE()
279 class PlotFileCanvas: public wxScrolledWindow
282 PlotFileView* m_pView;
284 PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
285 virtual void OnDraw(wxDC& dc);