1 /*****************************************************************************
5 ** Purpose: Header file for Document 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-2001 Kevin Rosenberg
12 ** $Id: docs.h,v 1.16 2001/01/30 02:20:50 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 ******************************************************************************/
35 #include "wx/docview.h"
38 #include "imagefile.h"
40 #include "projections.h"
43 class ProjectionFileView;
44 class PhantomFileView;
49 class ImageFileDocument: public wxDocument
52 DECLARE_DYNAMIC_CLASS(ImageFileDocument)
53 ImageFile m_imageFile;
57 virtual bool OnSaveDocument (const wxString& filename);
58 virtual bool OnOpenDocument (const wxString& filename);
59 virtual bool IsModified () const;
60 virtual void Modify (bool mod);
63 : m_bBadFileOpen(false)
66 virtual ~ImageFileDocument () {}
68 const ImageFile& getImageFile() const { return m_imageFile; }
70 ImageFile& getImageFile() { return m_imageFile; }
71 ImageFileView* getView() const;
72 bool getBadFileOpen() const { return m_bBadFileOpen; }
76 class ProjectionFileDocument: public wxDocument
79 DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
80 Projections m_projectionFile;
84 virtual bool OnSaveDocument (const wxString& filename);
85 virtual bool OnOpenDocument (const wxString& filename);
86 virtual bool IsModified () const;
87 virtual void Modify (bool mod);
89 ProjectionFileDocument ()
90 : m_bBadFileOpen(false)
93 virtual ~ProjectionFileDocument () {}
95 const Projections& getProjections () const { return m_projectionFile; }
96 Projections& getProjections () { return m_projectionFile; }
98 ProjectionFileView* getView() const;
99 bool getBadFileOpen() const { return m_bBadFileOpen; }
103 class PhantomFileDocument: public wxDocument
106 DECLARE_DYNAMIC_CLASS(PhantomFileDocument)
109 wxString m_namePhantom;
113 PhantomFileDocument ()
114 : m_idPhantom(Phantom::PHM_INVALID), m_bBadFileOpen(false)
117 virtual ~PhantomFileDocument ()
120 const int getPhantomID () const { return m_idPhantom; }
122 const wxString& getPhantomName () const { return m_namePhantom; }
124 const Phantom& getPhantom () const { return m_phantom; }
126 Phantom& getPhantom () { return m_phantom; }
128 virtual bool OnOpenDocument (const wxString& filename);
129 virtual bool OnSaveDocument (const wxString& filename);
130 virtual bool IsModified () const;
131 virtual void Modify (bool mod);
132 PhantomFileView* getView() const;
133 bool getBadFileOpen() const { return m_bBadFileOpen; }
137 class PlotFileDocument: public wxDocument
140 DECLARE_DYNAMIC_CLASS(PlotFileDocument)
147 : m_bBadFileOpen(false)
150 virtual ~PlotFileDocument ()
153 const wxString& getPlotName () const
154 { return m_namePlot; }
156 const PlotFile& getPlotFile () const
159 PlotFile& getPlotFile ()
162 virtual bool OnOpenDocument (const wxString& filename);
163 virtual bool OnSaveDocument (const wxString& filename);
164 virtual bool IsModified () const;
165 virtual void Modify (bool mod);
166 PlotFileView* getView() const;
167 bool getBadFileOpen() const { return m_bBadFileOpen; }
171 class TextFileDocument: public wxDocument
174 DECLARE_DYNAMIC_CLASS(TextFileDocument)
178 TextFileDocument(void)
179 : m_bBadFileOpen(false)
182 virtual ~TextFileDocument(void) {}
184 virtual bool OnSaveDocument(const wxString& filename);
185 virtual bool OnOpenDocument(const wxString& filename);
186 virtual bool IsModified(void) const;
188 wxTextCtrl* getTextCtrl();
190 TextFileView* getView() const;
191 bool getBadFileOpen() const { return m_bBadFileOpen; }