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.11 2000/12/18 09:31:26 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 OnScaleAuto (wxCommandEvent& event);
69 void OnScaleMinMax (wxCommandEvent& event);
74 ImageFileDocument* GetDocument(void)
75 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
80 class ImageFileCanvas: public wxScrolledWindow
83 ImageFileView* m_pView;
85 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
86 virtual void OnDraw(wxDC& dc);
87 void OnMouseEvent(wxMouseEvent& event);
93 class ProjectionFileCanvas;
94 class ProjectionFileView : public wxView
96 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
98 wxMemoryDC m_memoryDC;
102 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
103 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
105 ProjectionFileCanvas *m_canvas;
110 int m_iDefaultFilter;
111 int m_iDefaultFilterMethod;
112 double m_dDefaultFilterParam;
113 int m_iDefaultFilterGeneration;
114 int m_iDefaultZeropad;
115 int m_iDefaultInterpolation;
116 int m_iDefaultInterpParam;
117 int m_iDefaultBackprojector;
121 ProjectionFileView(void);
122 virtual ~ProjectionFileView(void);
124 bool OnCreate(wxDocument *doc, long flags);
125 void OnDraw(wxDC* dc);
126 void OnUpdate(wxView *sender, wxObject *hint = NULL);
127 bool OnClose (bool deleteWindow = true);
128 void OnProperties (wxCommandEvent& event);
129 void OnReconstruct (wxCommandEvent& event);
131 wxFrame* getFrame ()
\r
132 { return m_frame; }
\r
134 ProjectionFileDocument* GetDocument(void)
135 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
136 DECLARE_EVENT_TABLE()
139 class ProjectionFileCanvas: public wxScrolledWindow
142 ProjectionFileView* m_pView;
144 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
145 virtual void OnDraw(wxDC& dc);
150 class PhantomView : public wxView
152 DECLARE_DYNAMIC_CLASS(PhantomView)
155 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
156 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
158 PhantomCanvas *m_canvas;
163 int m_iDefaultNSample;
164 int m_iDefaultGeometry;
166 double m_dDefaultRotation;
167 double m_dDefaultFocalLength;
168 double m_dDefaultFieldOfView;
172 virtual ~PhantomView(void);
174 bool OnCreate(wxDocument *doc, long flags);
175 void OnUpdate(wxView *sender, wxObject *hint = NULL);
176 bool OnClose (bool deleteWindow = true);
177 void OnDraw(wxDC* dc);
178 void OnProperties (wxCommandEvent& event);
179 void OnRasterize (wxCommandEvent& event);
180 void OnProjections (wxCommandEvent& event);
182 PhantomDocument* GetDocument(void)
183 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
185 DECLARE_EVENT_TABLE()
188 class PhantomCanvas: public wxScrolledWindow
191 PhantomView* m_pView;
193 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
195 virtual void OnDraw(wxDC& dc);