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.17 2000/12/29 15:45:06 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 OnFFTMagnitude (wxCommandEvent& event);
\r
75 void OnFFTPhase (wxCommandEvent& event);
\r
76 void OnScaleAuto (wxCommandEvent& event);
77 void OnScaleMinMax (wxCommandEvent& event);
78 void OnPlotRow (wxCommandEvent& event);
\r
79 void OnPlotCol (wxCommandEvent& event);
\r
80 void OnCompareRow (wxCommandEvent& event);
\r
81 void OnCompareCol (wxCommandEvent& event);
\r
86 ImageFileDocument* GetDocument(void)
87 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
92 class ImageFileCanvas: public wxScrolledWindow
99 ImageFileView* m_pView;
101 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
102 virtual void OnDraw(wxDC& dc);
103 void OnMouseEvent(wxMouseEvent& event);
105 void DrawRubberBandCursor (wxDC& dc, int x, int y);
\r
106 bool GetCurrentCursor (int& x, int& y);
\r
108 DECLARE_EVENT_TABLE()
112 class ProjectionFileCanvas;
113 class ProjectionFileView : public wxView
115 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
117 wxMemoryDC m_memoryDC;
121 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
122 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
124 ProjectionFileCanvas *m_canvas;
129 int m_iDefaultFilter;
130 int m_iDefaultFilterMethod;
131 double m_dDefaultFilterParam;
132 int m_iDefaultFilterGeneration;
133 int m_iDefaultZeropad;
134 int m_iDefaultInterpolation;
135 int m_iDefaultInterpParam;
136 int m_iDefaultBackprojector;
140 ProjectionFileView(void);
141 virtual ~ProjectionFileView(void);
143 bool OnCreate(wxDocument *doc, long flags);
144 void OnDraw(wxDC* dc);
145 void OnUpdate(wxView *sender, wxObject *hint = NULL);
146 bool OnClose (bool deleteWindow = true);
147 void OnProperties (wxCommandEvent& event);
148 void OnReconstruct (wxCommandEvent& event);
150 wxFrame* getFrame ()
\r
151 { return m_frame; }
\r
153 ProjectionFileDocument* GetDocument(void)
154 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
155 DECLARE_EVENT_TABLE()
158 class ProjectionFileCanvas: public wxScrolledWindow
161 ProjectionFileView* m_pView;
163 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
164 virtual void OnDraw(wxDC& dc);
169 class PhantomView : public wxView
171 DECLARE_DYNAMIC_CLASS(PhantomView)
174 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
175 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
177 PhantomCanvas *m_canvas;
182 int m_iDefaultNSample;
183 int m_iDefaultGeometry;
185 double m_dDefaultRotation;
186 double m_dDefaultFocalLength;
187 double m_dDefaultFieldOfView;
191 virtual ~PhantomView(void);
193 bool OnCreate(wxDocument *doc, long flags);
194 void OnUpdate(wxView *sender, wxObject *hint = NULL);
195 bool OnClose (bool deleteWindow = true);
196 void OnDraw(wxDC* dc);
197 void OnProperties (wxCommandEvent& event);
198 void OnRasterize (wxCommandEvent& event);
199 void OnProjections (wxCommandEvent& event);
201 PhantomDocument* GetDocument(void)
202 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
204 DECLARE_EVENT_TABLE()
207 class PhantomCanvas: public wxScrolledWindow
210 PhantomView* m_pView;
212 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
214 virtual void OnDraw(wxDC& dc);
218 class PlotFileCanvas;
219 class PlotFileView : public wxView
221 DECLARE_DYNAMIC_CLASS(PlotFileView)
224 PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
225 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
228 PlotFileCanvas *m_canvas;
230 bool m_bMinSpecified;
\r
231 bool m_bMaxSpecified;
\r
232 double m_dMinPixel;
\r
233 double m_dMaxPixel;
\r
234 double m_dAutoScaleFactor;
\r
238 virtual ~PlotFileView(void);
240 bool OnCreate(wxDocument *doc, long flags);
241 void OnDraw(wxDC* dc);
242 void OnUpdate(wxView *sender, wxObject *hint = NULL);
243 bool OnClose (bool deleteWindow = true);
244 void OnProperties (wxCommandEvent& event);
245 void OnScaleAuto (wxCommandEvent& event);
\r
246 void OnScaleMinMax (wxCommandEvent& event);
\r
251 PlotFileDocument* GetDocument(void)
252 { return dynamic_cast<PlotFileDocument*>(wxView::GetDocument()); }
254 DECLARE_EVENT_TABLE()
257 class PlotFileCanvas: public wxScrolledWindow
260 PlotFileView* m_pView;
262 PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
263 virtual void OnDraw(wxDC& dc);