1 /*****************************************************************************
5 ** Purpose: Top-level routines for 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: ctsim.h,v 1.24 2001/01/13 10:14:06 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 ******************************************************************************/
39 // #define CTSIM_MDI 1
46 class ImageFileDocument;
54 #include "wx/docview.h"
55 #include "wx/textctrl.h"
57 #include "dlgezplot.h"
60 // Define a new frame for main window
62 class MainFrame: public wxMDIParentFrame
64 class MainFrame: public wxDocParentFrame
67 DECLARE_CLASS(MainFrame)
70 wxMenu* m_pWindowMenu;
72 enum { MAX_WINDOW_MENUITEMS = 20 };
73 wxMenuItem* m_apWindowMenuItems[MAX_WINDOW_MENUITEMS];
74 wxDocument* m_apWindowMenuData[MAX_WINDOW_MENUITEMS];
76 int m_iDefaultPhantomID;
77 int m_iDefaultFilterID;
78 int m_iDefaultFilterDomainID;
79 unsigned int m_iDefaultFilterXSize;
80 unsigned int m_iDefaultFilterYSize;
81 double m_dDefaultFilterParam;
82 double m_dDefaultFilterBandwidth;
83 double m_dDefaultFilterInputScale;
84 double m_dDefaultFilterOutputScale;
88 MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
90 void OnAbout (wxCommandEvent& event);
91 void OnHelpContents (wxCommandEvent& event);
92 void OnCreatePhantom (wxCommandEvent& event);
94 void OnCreateFilter (wxCommandEvent& event);
95 void OnExit (wxCommandEvent& event);
97 void OnUpdateUI (wxUpdateUIEvent& event);
102 void OnWindowMenu0 (wxCommandEvent& event);
103 void OnWindowMenu1 (wxCommandEvent& event);
104 void OnWindowMenu2 (wxCommandEvent& event);
105 void OnWindowMenu3 (wxCommandEvent& event);
106 void OnWindowMenu4 (wxCommandEvent& event);
107 void OnWindowMenu5 (wxCommandEvent& event);
108 void OnWindowMenu6 (wxCommandEvent& event);
109 void OnWindowMenu7 (wxCommandEvent& event);
110 void OnWindowMenu8 (wxCommandEvent& event);
111 void OnWindowMenu9 (wxCommandEvent& event);
112 void OnWindowMenu10 (wxCommandEvent& event);
113 void OnWindowMenu11 (wxCommandEvent& event);
114 void OnWindowMenu12 (wxCommandEvent& event);
115 void OnWindowMenu13 (wxCommandEvent& event);
116 void OnWindowMenu14 (wxCommandEvent& event);
117 void OnWindowMenu15 (wxCommandEvent& event);
118 void OnWindowMenu16 (wxCommandEvent& event);
119 void OnWindowMenu17 (wxCommandEvent& event);
120 void OnWindowMenu18 (wxCommandEvent& event);
121 void OnWindowMenu19 (wxCommandEvent& event);
123 void DoWindowMenu (int iMenuPosition, wxCommandEvent& event);
125 DECLARE_EVENT_TABLE()
130 class CTSimApp: public wxApp
136 MainFrame* getMainFrame() const
139 { return m_pFrame->getLog(); }
140 wxDocManager* getDocManager()
141 { return m_docManager; }
143 wxString getUntitledFilename();
145 EZPlotDialog* makeEZPlotDialog()
146 { return new EZPlotDialog (m_pFrame); }
148 void getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector<ImageFileDocument*>& vecIF);
150 bool getSetModifyNewDocs() const
153 void setIconForFrame (wxFrame* pFrame);
156 wxDocManager* m_docManager;
159 void usage (const char* program);
161 static struct option ctsimOptions[];
163 enum { O_HELP, O_VERSION };
166 DECLARE_APP(CTSimApp)
168 extern class CTSimApp* theApp;
172 MAINMENU_HELP_ABOUT = 500,
173 MAINMENU_WINDOW_BASE,
174 MAINMENU_HELP_CONTENTS,
175 MAINMENU_FILE_CREATE_PHANTOM,
177 MAINMENU_FILE_CREATE_FILTER,
180 PJMENU_FILE_PROPERTIES,
181 PJMENU_RECONSTRUCT_FBP,
182 PJMENU_RECONSTRUCT_FOURIER,
183 PJMENU_CONVERT_POLAR,
184 PJMENU_CONVERT_FFT_POLAR,
187 IFMENU_FILE_PROPERTIES,
193 IFMENU_PLOT_HISTOGRAM,
195 IFMENU_VIEW_SCALE_AUTO,
196 IFMENU_VIEW_SCALE_MINMAX,
197 IFMENU_VIEW_SCALE_FULL,
199 IFMENU_COMPARE_IMAGES,
202 IFMENU_IMAGE_SCALESIZE,
204 IFMENU_IMAGE_SUBTRACT,
205 IFMENU_IMAGE_MULTIPLY,
208 IFMENU_FILTER_INVERTVALUES,
210 IFMENU_FILTER_SQUARE,
213 IFMENU_FILTER_FOURIER,
214 IFMENU_FILTER_INVERSE_FOURIER,
217 IFMENU_FILTER_FFT_ROWS,
218 IFMENU_FILTER_FFT_COLS,
219 IFMENU_FILTER_IFFT_ROWS,
220 IFMENU_FILTER_IFFT_COLS,
221 IFMENU_FILTER_MAGNITUDE,
223 IFMENU_FILTER_SHUFFLENATURALTOFOURIERORDER,
224 IFMENU_FILTER_SHUFFLEFOURIERTONATURALORDER,
226 PHMMENU_FILE_PROPERTIES,
227 PHMMENU_PROCESS_RASTERIZE,
228 PHMMENU_PROCESS_PROJECTIONS,
230 PLOTMENU_VIEW_SCALE_MINMAX,
231 PLOTMENU_VIEW_SCALE_AUTO,
232 PLOTMENU_VIEW_SCALE_FULL,