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.2 2000/07/15 08:36:13 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);
69 ImageFileDocument* GetDocument(void)
70 { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
75 class ImageFileCanvas: public wxScrolledWindow
78 ImageFileView* m_pView;
80 ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
81 virtual void OnDraw(wxDC& dc);
82 void OnMouseEvent(wxMouseEvent& event);
88 class ProjectionFileCanvas;
89 class ProjectionFileView : public wxView
91 DECLARE_DYNAMIC_CLASS(ProjectionFileView)
93 wxMemoryDC m_memoryDC;
97 ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
98 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
100 ProjectionFileCanvas *m_canvas;
104 ProjectionFileView(void);
105 ~ProjectionFileView(void);
107 bool OnCreate(wxDocument *doc, long flags);
108 void OnDraw(wxDC* dc);
109 void OnUpdate(wxView *sender, wxObject *hint = NULL);
110 bool OnClose (bool deleteWindow = true);
111 void OnProperties (wxCommandEvent& event);
112 void OnReconstruct (wxCommandEvent& event);
114 ProjectionFileDocument* GetDocument(void)
115 { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
116 DECLARE_EVENT_TABLE()
119 class ProjectionFileCanvas: public wxScrolledWindow
122 ProjectionFileView* m_pView;
124 ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
125 virtual void OnDraw(wxDC& dc);
130 class PhantomView : public wxView
132 DECLARE_DYNAMIC_CLASS(PhantomView)
135 PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
136 wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
138 PhantomCanvas *m_canvas;
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 OnRasterize (wxCommandEvent& event);
151 void OnProjections (wxCommandEvent& event);
153 PhantomDocument* GetDocument(void)
154 { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
156 DECLARE_EVENT_TABLE()
159 class PhantomCanvas: public wxScrolledWindow
162 PhantomView* m_pView;
164 PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
165 virtual void OnDraw(wxDC& dc);