8da87b3c76a9b3e25a036673e09c2d22c6f3eb4f
[ctsim.git] / src / docs.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          docs.h
5 **   Purpose:       Header file for Document 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: docs.h,v 1.11 2001/01/03 22:01:50 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 __DOCSH__
33 #define __DOCSH__
34
35 #include "wx/docview.h"
36
37 #include "imagefile.h"
38 #include "phantom.h"
39 #include "projections.h"
40 #include "plotfile.h"
41
42 class ImageFileDocument: public wxDocument
43 {
44     DECLARE_DYNAMIC_CLASS(ImageFileDocument)
45 private:
46     ImageFile m_imageFile;
47
48 public:
49     virtual bool OnSaveDocument (const wxString& filename);
50     virtual bool OnOpenDocument (const wxString& filename);
51     virtual bool IsModified () const;
52     virtual bool OnCloseDocument ();
53     virtual void Modify (bool mod);
54     
55     ImageFileDocument () {}
56     ~ImageFileDocument () {}
57
58     const ImageFile& getImageFile() const
59         { return m_imageFile; }
60
61     ImageFile& getImageFile()
62         { return m_imageFile; }
63 };
64
65
66 class ProjectionFileDocument: public wxDocument
67 {
68     DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
69 private:
70     Projections m_projectionFile;
71
72 public:
73     virtual bool OnSaveDocument (const wxString& filename);
74     virtual bool OnOpenDocument (const wxString& filename);
75     virtual bool IsModified () const;
76     virtual bool OnCloseDocument ();
77     virtual void Modify (bool mod);
78     
79     ProjectionFileDocument () {}
80     ~ProjectionFileDocument () {}
81
82     const Projections& getProjections () const
83         { return m_projectionFile; }
84
85     Projections& getProjections ()
86         { return m_projectionFile; }
87 };
88
89
90 class PhantomDocument: public wxDocument
91 {
92     DECLARE_DYNAMIC_CLASS(PhantomDocument)
93
94 private:
95     Phantom m_phantom;
96     int m_idPhantom;
97     wxString m_namePhantom;
98
99 public:
100     PhantomDocument () 
101         : m_idPhantom(Phantom::PHM_INVALID)
102         {}
103
104     ~PhantomDocument () 
105         {}
106
107     const int getPhantomID () const
108         { return m_idPhantom; }
109
110     const wxString& getPhantomName () const
111         { return m_namePhantom; }
112
113     const Phantom& getPhantom () const
114         { return m_phantom; }
115
116     Phantom& getPhantom ()
117         { return m_phantom; }
118
119     virtual bool OnOpenDocument (const wxString& filename);
120     virtual bool OnSaveDocument (const wxString& filename);
121     virtual bool OnCloseDocument ();
122     virtual bool IsModified () const;
123     virtual void Modify (bool mod);
124 };
125
126
127 class PlotFileDocument: public wxDocument
128 {
129     DECLARE_DYNAMIC_CLASS(PlotFileDocument)
130
131 private:
132     PlotFile m_plot;
133     wxString m_namePlot;
134
135 public:
136     PlotFileDocument () 
137         {}
138
139     ~PlotFileDocument () 
140         {}
141
142     const wxString& getPlotName () const
143         { return m_namePlot; }
144
145     const PlotFile& getPlotFile () const
146         { return m_plot; }
147
148     PlotFile& getPlotFile ()
149         { return m_plot; }
150
151     virtual bool OnOpenDocument (const wxString& filename);
152     virtual bool OnSaveDocument (const wxString& filename);
153     virtual bool OnCloseDocument ();
154     virtual bool IsModified () const;
155     virtual void Modify (bool mod);
156 };
157
158
159 #endif