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.3 2000/07/18 03:14:35 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;
62 bool OnCreate(wxDocument *doc, long flags);
63 void OnDraw(wxDC* dc);
64 void OnUpdate(wxView *sender, wxObject *hint = NULL);
65 bool OnClose (bool deleteWindow = true);
66 void OnProperties (wxCommandEvent& event);
67 void OnWindowAuto (wxCommandEvent& event);
68 void OnWindowMinMax (wxCommandEvent& event);
70 ImageFileDocument* GetDocument(void)
71 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
76 class ImageFileCanvas: public wxScrolledWindow
79 ImageFileView* m_pView;
81 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
82 virtual void OnDraw(wxDC& dc);
83 void OnMouseEvent(wxMouseEvent& event);
89 class ProjectionFileCanvas;
90 class ProjectionFileView : public wxView
92 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
94 wxMemoryDC m_memoryDC;
98 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
99 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
101 ProjectionFileCanvas *m_canvas;
105 ProjectionFileView(void);
106 ~ProjectionFileView(void);
108 bool OnCreate(wxDocument *doc, long flags);
109 void OnDraw(wxDC* dc);
110 void OnUpdate(wxView *sender, wxObject *hint = NULL);
111 bool OnClose (bool deleteWindow = true);
112 void OnProperties (wxCommandEvent& event);
113 void OnReconstruct (wxCommandEvent& event);
115 ProjectionFileDocument* GetDocument(void)
116 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
117 DECLARE_EVENT_TABLE()
120 class ProjectionFileCanvas: public wxScrolledWindow
123 ProjectionFileView* m_pView;
125 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
126 virtual void OnDraw(wxDC& dc);
131 class PhantomView : public wxView
133 DECLARE_DYNAMIC_CLASS(PhantomView)
136 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
137 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
139 PhantomCanvas *m_canvas;
146 bool OnCreate(wxDocument *doc, long flags);
147 void OnDraw(wxDC* dc);
148 void OnUpdate(wxView *sender, wxObject *hint = NULL);
149 bool OnClose (bool deleteWindow = true);
150 void OnProperties (wxCommandEvent& event);
151 void OnRasterize (wxCommandEvent& event);
152 void OnProjections (wxCommandEvent& event);
154 PhantomDocument* GetDocument(void)
155 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
157 DECLARE_EVENT_TABLE()
160 class PhantomCanvas: public wxScrolledWindow
163 PhantomView* m_pView;
165 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
166 virtual void OnDraw(wxDC& dc);