r184: *** 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.7 2000/08/25 15:59: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_dMinPixel;
56     double m_dMaxPixel;
57
58 public:
59     ImageFileView(void);
60     virtual ~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 OnScaleAuto (wxCommandEvent& event);
68     void OnScaleMinMax (wxCommandEvent& event);
69
70     ImageFileDocument* GetDocument(void) 
71         { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
72
73     DECLARE_EVENT_TABLE()
74 };
75
76 class ImageFileCanvas: public wxScrolledWindow
77 {
78 public:
79     ImageFileView* m_pView;
80     
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);
84
85     DECLARE_EVENT_TABLE()
86 };
87
88
89 class ProjectionFileCanvas;
90 class ProjectionFileView : public wxView
91 {
92     DECLARE_DYNAMIC_CLASS(ProjectionFileView)
93
94     wxMemoryDC m_memoryDC;
95     wxBitmap m_bitmap;
96
97 private:
98     ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
99     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
100
101     ProjectionFileCanvas *m_canvas;
102     wxFrame *m_frame;
103
104 public:
105     ProjectionFileView(void);
106     virtual ~ProjectionFileView(void);
107
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);
114
115     ProjectionFileDocument* GetDocument(void) 
116         { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
117     DECLARE_EVENT_TABLE()
118 };
119
120 class ProjectionFileCanvas: public wxScrolledWindow
121 {
122 public:
123     ProjectionFileView* m_pView;
124     
125     ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
126     virtual void OnDraw(wxDC& dc);
127 };
128
129
130 class PhantomCanvas;
131 class PhantomView : public wxView
132 {
133     DECLARE_DYNAMIC_CLASS(PhantomView)
134
135 private:
136     PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
137     wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
138
139     PhantomCanvas *m_canvas;
140     wxFrame *m_frame;
141
142 public:
143     PhantomView(void);
144     virtual ~PhantomView(void);
145
146     bool OnCreate(wxDocument *doc, long flags);
147     void OnUpdate(wxView *sender, wxObject *hint = NULL);
148     bool OnClose (bool deleteWindow = true);
149     void OnDraw(wxDC* dc);
150     void OnProperties (wxCommandEvent& event);
151     void OnRasterize (wxCommandEvent& event);
152     void OnProjections (wxCommandEvent& event);
153
154     PhantomDocument* GetDocument(void) 
155         { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
156
157     DECLARE_EVENT_TABLE()
158 };
159
160 class PhantomCanvas: public wxScrolledWindow
161 {
162 public:
163     PhantomView* m_pView;
164     
165     PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
166
167     virtual void OnDraw(wxDC& dc);
168
169 };
170
171
172 #endif
173