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.19 2000/12/29 20:18:59 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;
61 virtual ~ImageFileView(void);
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 OnInvertValues (wxCommandEvent& event);
\r
70 void OnSquare (wxCommandEvent& event);
\r
71 void OnSquareRoot (wxCommandEvent& event);
\r
72 void OnLog (wxCommandEvent& event);
\r
73 void OnExp (wxCommandEvent& event);
\r
74 void OnFourier (wxCommandEvent& event);
\r
75 void OnInverseFourier (wxCommandEvent& event);
\r
76 void OnMagnitude (wxCommandEvent& event);
\r
77 void OnPhase (wxCommandEvent& event);
\r
78 void OnScaleAuto (wxCommandEvent& event);
79 void OnScaleMinMax (wxCommandEvent& event);
80 void OnPlotRow (wxCommandEvent& event);
\r
81 void OnPlotCol (wxCommandEvent& event);
\r
82 void OnCompareRow (wxCommandEvent& event);
\r
83 void OnCompareCol (wxCommandEvent& event);
\r
88 ImageFileDocument* GetDocument(void)
89 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
94 class ImageFileCanvas: public wxScrolledWindow
101 ImageFileView* m_pView;
103 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
104 virtual void OnDraw(wxDC& dc);
105 void OnMouseEvent(wxMouseEvent& event);
107 void DrawRubberBandCursor (wxDC& dc, int x, int y);
\r
108 bool GetCurrentCursor (int& x, int& y);
\r
110 DECLARE_EVENT_TABLE()
114 class ProjectionFileCanvas;
115 class ProjectionFileView : public wxView
117 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
119 wxMemoryDC m_memoryDC;
123 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
124 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
126 ProjectionFileCanvas *m_canvas;
131 int m_iDefaultFilter;
132 int m_iDefaultFilterMethod;
133 double m_dDefaultFilterParam;
134 int m_iDefaultFilterGeneration;
135 int m_iDefaultZeropad;
136 int m_iDefaultInterpolation;
137 int m_iDefaultInterpParam;
138 int m_iDefaultBackprojector;
142 ProjectionFileView(void);
143 virtual ~ProjectionFileView(void);
145 bool OnCreate(wxDocument *doc, long flags);
146 void OnDraw(wxDC* dc);
147 void OnUpdate(wxView *sender, wxObject *hint = NULL);
148 bool OnClose (bool deleteWindow = true);
149 void OnProperties (wxCommandEvent& event);
150 void OnReconstruct (wxCommandEvent& event);
152 wxFrame* getFrame ()
\r
153 { return m_frame; }
\r
155 ProjectionFileDocument* GetDocument(void)
156 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
157 DECLARE_EVENT_TABLE()
160 class ProjectionFileCanvas: public wxScrolledWindow
163 ProjectionFileView* m_pView;
165 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
166 virtual void OnDraw(wxDC& dc);
171 class PhantomView : public wxView
173 DECLARE_DYNAMIC_CLASS(PhantomView)
176 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
177 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
179 PhantomCanvas *m_canvas;
184 int m_iDefaultNSample;
185 int m_iDefaultGeometry;
187 double m_dDefaultRotation;
188 double m_dDefaultFocalLength;
189 double m_dDefaultFieldOfView;
193 virtual ~PhantomView(void);
195 bool OnCreate(wxDocument *doc, long flags);
196 void OnUpdate(wxView *sender, wxObject *hint = NULL);
197 bool OnClose (bool deleteWindow = true);
198 void OnDraw(wxDC* dc);
199 void OnProperties (wxCommandEvent& event);
200 void OnRasterize (wxCommandEvent& event);
201 void OnProjections (wxCommandEvent& event);
203 PhantomDocument* GetDocument(void)
204 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
206 DECLARE_EVENT_TABLE()
209 class PhantomCanvas: public wxScrolledWindow
212 PhantomView* m_pView;
214 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
216 virtual void OnDraw(wxDC& dc);
220 class PlotFileCanvas;
221 class PlotFileView : public wxView
223 DECLARE_DYNAMIC_CLASS(PlotFileView)
226 PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
227 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
229 PlotFileCanvas *m_canvas;
232 bool m_bMinSpecified;
\r
233 bool m_bMaxSpecified;
\r
234 double m_dMinPixel;
\r
235 double m_dMaxPixel;
\r
236 double m_dAutoScaleFactor;
\r
240 virtual ~PlotFileView(void);
242 bool OnCreate(wxDocument *doc, long flags);
243 void OnDraw(wxDC* dc);
244 void OnUpdate(wxView *sender, wxObject *hint = NULL);
245 bool OnClose (bool deleteWindow = true);
246 void OnProperties (wxCommandEvent& event);
247 void OnScaleAuto (wxCommandEvent& event);
\r
248 void OnScaleMinMax (wxCommandEvent& event);
\r
253 PlotFileDocument* GetDocument(void)
254 { return dynamic_cast<PlotFileDocument*>(wxView::GetDocument()); }
256 DECLARE_EVENT_TABLE()
259 class PlotFileCanvas: public wxScrolledWindow
262 PlotFileView* m_pView;
264 PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
265 virtual void OnDraw(wxDC& dc);