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-2000 Kevin Rosenberg
12 ** $Id: docs.h,v 1.14 2001/01/26 05:37:24 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;
56 virtual bool OnSaveDocument (const wxString& filename);
57 virtual bool OnOpenDocument (const wxString& filename);
58 virtual bool IsModified () const;
59 virtual void Modify (bool mod);
61 ImageFileDocument () {}
62 virtual ~ImageFileDocument () {}
64 const ImageFile& getImageFile() const { return m_imageFile; }
66 ImageFile& getImageFile() { return m_imageFile; }
67 ImageFileView* getView() const;
71 class ProjectionFileDocument: public wxDocument
74 DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
75 Projections m_projectionFile;
78 virtual bool OnSaveDocument (const wxString& filename);
79 virtual bool OnOpenDocument (const wxString& filename);
80 virtual bool IsModified () const;
81 virtual void Modify (bool mod);
83 ProjectionFileDocument () {}
84 virtual ~ProjectionFileDocument () {}
86 const Projections& getProjections () const { return m_projectionFile; }
87 Projections& getProjections () { return m_projectionFile; }
89 ProjectionFileView* getView() const;
93 class PhantomFileDocument: public wxDocument
96 DECLARE_DYNAMIC_CLASS(PhantomFileDocument)
99 wxString m_namePhantom;
102 PhantomFileDocument ()
103 : m_idPhantom(Phantom::PHM_INVALID)
106 virtual ~PhantomFileDocument ()
109 const int getPhantomID () const { return m_idPhantom; }
111 const wxString& getPhantomName () const { return m_namePhantom; }
113 const Phantom& getPhantom () const { return m_phantom; }
115 Phantom& getPhantom () { return m_phantom; }
117 virtual bool OnOpenDocument (const wxString& filename);
118 virtual bool OnSaveDocument (const wxString& filename);
119 virtual bool IsModified () const;
120 virtual void Modify (bool mod);
121 PhantomFileView* getView() const;
125 class PlotFileDocument: public wxDocument
128 DECLARE_DYNAMIC_CLASS(PlotFileDocument)
136 virtual ~PlotFileDocument ()
139 const wxString& getPlotName () const
140 { return m_namePlot; }
142 const PlotFile& getPlotFile () const
145 PlotFile& getPlotFile ()
148 virtual bool OnOpenDocument (const wxString& filename);
149 virtual bool OnSaveDocument (const wxString& filename);
150 virtual bool IsModified () const;
151 virtual void Modify (bool mod);
152 PlotFileView* getView() const;
157 class TextFileDocument: public wxDocument
160 DECLARE_DYNAMIC_CLASS(TextFileDocument)
163 TextFileDocument(void) {}
164 virtual ~TextFileDocument(void) {}
166 virtual bool OnSaveDocument(const wxString& filename);
167 virtual bool OnOpenDocument(const wxString& filename);
168 virtual bool IsModified(void) const;
170 wxTextCtrl* getTextCtrl()
171 { return dynamic_cast<TextFileView*>(GetFirstView())->getTextCtrl(); }
173 TextFileView* getView() const;