d9997c89ceaac1c039cda12ddad73f6e5d13c037
[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.4 2000/07/22 15:45:33 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
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 (void) const;
52     virtual void Modify (bool mod);
53     
54     ImageFileDocument (void) {}
55     ~ImageFileDocument (void) {}
56
57     const ImageFile& getImageFile(void) const
58         { return m_imageFile; }
59
60     ImageFile& getImageFile(void)
61         { return m_imageFile; }
62 };
63
64
65 class ProjectionFileDocument: public wxDocument
66 {
67     DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
68 private:
69     Projections m_projectionFile;
70
71 public:
72     virtual bool OnSaveDocument (const wxString& filename);
73     virtual bool OnOpenDocument (const wxString& filename);
74     virtual bool IsModified (void) const;
75     virtual void Modify (bool mod);
76     
77     ProjectionFileDocument (void) {}
78     ~ProjectionFileDocument (void) {}
79
80     const Projections& getProjections (void) const
81         { return m_projectionFile; }
82
83     Projections& getProjections (void)
84         { return m_projectionFile; }
85 };
86
87
88 class PhantomDocument: public wxDocument
89 {
90     DECLARE_DYNAMIC_CLASS(PhantomDocument)
91
92 private:
93     Phantom m_phantom;
94     int m_idPhantom;
95     wxString m_namePhantom;
96
97 public:
98     PhantomDocument (void) 
99         : m_idPhantom(Phantom::PHM_INVALID)
100         {}
101
102     ~PhantomDocument (void) 
103         {}
104
105     const int getPhantomID (void) const
106         { return m_idPhantom; }
107
108     const wxString& getPhantomName (void) const
109         { return m_namePhantom; }
110
111     const Phantom& getPhantom (void) const
112         { return m_phantom; }
113
114     Phantom& getPhantom (void)
115         { return m_phantom; }
116
117     virtual bool OnOpenDocument (const wxString& filename);
118     virtual bool IsModified (void) const;
119     virtual void Modify (bool mod);
120 };
121
122
123 #endif