r148: *** empty log message ***
[ctsim.git] / src / views.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          view.h
5 **   Purpose:       Header file for View & Canvas routines of CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: views.h,v 1.2 2000/07/15 08:36:13 kevin Exp $
13 **
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.
17 **
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.
22 **
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 ******************************************************************************/
27
28 #ifdef __GNUG__
29 // #pragma interface
30 #endif
31
32 #ifndef __VIEWSH__
33 #define __VIEWSH__
34
35 #include "wx/wx.h"
36 #include "docs.h"
37 #include "imagefile.h"
38
39 class ImageFileCanvas;
40 class ImageFileView : public wxView
41 {
42     DECLARE_DYNAMIC_CLASS(ImageFileView)
43
44     wxMemoryDC m_memoryDC;
45     wxBitmap m_bitmap;
46
47 private:
48     ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
49     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
50
51     ImageFileCanvas *m_canvas;
52     wxFrame *m_frame;
53     bool m_bMinSpecified;
54     bool m_bMaxSpecified;
55     double m_minPixel;
56     double m_maxPixel;
57
58 public:
59     ImageFileView(void);
60     ~ImageFileView(void);
61
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
69     ImageFileDocument* GetDocument(void) 
70         { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
71
72     DECLARE_EVENT_TABLE()
73 };
74
75 class ImageFileCanvas: public wxScrolledWindow
76 {
77 public:
78     ImageFileView* m_pView;
79     
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);
83
84     DECLARE_EVENT_TABLE()
85 };
86
87
88 class ProjectionFileCanvas;
89 class ProjectionFileView : public wxView
90 {
91     DECLARE_DYNAMIC_CLASS(ProjectionFileView)
92
93     wxMemoryDC m_memoryDC;
94     wxBitmap m_bitmap;
95
96 private:
97     ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
98     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
99
100     ProjectionFileCanvas *m_canvas;
101     wxFrame *m_frame;
102
103 public:
104     ProjectionFileView(void);
105     ~ProjectionFileView(void);
106
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);
113
114     ProjectionFileDocument* GetDocument(void) 
115         { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
116     DECLARE_EVENT_TABLE()
117 };
118
119 class ProjectionFileCanvas: public wxScrolledWindow
120 {
121 public:
122     ProjectionFileView* m_pView;
123     
124     ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
125     virtual void OnDraw(wxDC& dc);
126 };
127
128
129 class PhantomCanvas;
130 class PhantomView : public wxView
131 {
132     DECLARE_DYNAMIC_CLASS(PhantomView)
133
134 private:
135     PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
136     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
137
138     PhantomCanvas *m_canvas;
139     wxFrame *m_frame;
140
141 public:
142     PhantomView(void);
143     ~PhantomView(void);
144
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);
152
153     PhantomDocument* GetDocument(void) 
154         { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
155
156     DECLARE_EVENT_TABLE()
157 };
158
159 class PhantomCanvas: public wxScrolledWindow
160 {
161 public:
162     PhantomView* m_pView;
163     
164     PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
165     virtual void OnDraw(wxDC& dc);
166
167 };
168
169
170 #endif
171