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.27 2001/01/18 18:09:35 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"
58 #include "wx/html/helpctrl.h"
59 #include "dlgezplot.h"
62 // Define a new frame for main window
64 class MainFrame: public wxMDIParentFrame
66 class MainFrame: public wxDocParentFrame
69 DECLARE_CLASS(MainFrame)
72 wxMenu* m_pWindowMenu;
74 enum { MAX_WINDOW_MENUITEMS = 20 };
75 wxMenuItem* m_apWindowMenuItems[MAX_WINDOW_MENUITEMS];
76 wxDocument* m_apWindowMenuData[MAX_WINDOW_MENUITEMS];
78 int m_iDefaultPhantomID;
79 int m_iDefaultFilterID;
80 int m_iDefaultFilterDomainID;
81 unsigned int m_iDefaultFilterXSize;
82 unsigned int m_iDefaultFilterYSize;
83 double m_dDefaultFilterParam;
84 double m_dDefaultFilterBandwidth;
85 double m_dDefaultFilterInputScale;
86 double m_dDefaultFilterOutputScale;
89 wxWinHelpController m_help;
91 wxHtmlHelpController m_help;
96 MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
99 wxWinHelpController& getHelpController()
102 wxHtmlHelpController& getHelpController()
105 void showHelp (int commandID);
107 void OnAbout (wxCommandEvent& event);
108 void OnHelpTopics (wxCommandEvent& event);
109 void OnHelpContents (wxCommandEvent& event);
110 void OnCreatePhantom (wxCommandEvent& event);
112 void OnCreateFilter (wxCommandEvent& event);
113 void OnExit (wxCommandEvent& event);
115 void OnUpdateUI (wxUpdateUIEvent& event);
120 void OnWindowMenu0 (wxCommandEvent& event);
121 void OnWindowMenu1 (wxCommandEvent& event);
122 void OnWindowMenu2 (wxCommandEvent& event);
123 void OnWindowMenu3 (wxCommandEvent& event);
124 void OnWindowMenu4 (wxCommandEvent& event);
125 void OnWindowMenu5 (wxCommandEvent& event);
126 void OnWindowMenu6 (wxCommandEvent& event);
127 void OnWindowMenu7 (wxCommandEvent& event);
128 void OnWindowMenu8 (wxCommandEvent& event);
129 void OnWindowMenu9 (wxCommandEvent& event);
130 void OnWindowMenu10 (wxCommandEvent& event);
131 void OnWindowMenu11 (wxCommandEvent& event);
132 void OnWindowMenu12 (wxCommandEvent& event);
133 void OnWindowMenu13 (wxCommandEvent& event);
134 void OnWindowMenu14 (wxCommandEvent& event);
135 void OnWindowMenu15 (wxCommandEvent& event);
136 void OnWindowMenu16 (wxCommandEvent& event);
137 void OnWindowMenu17 (wxCommandEvent& event);
138 void OnWindowMenu18 (wxCommandEvent& event);
139 void OnWindowMenu19 (wxCommandEvent& event);
141 void DoWindowMenu (int iMenuPosition, wxCommandEvent& event);
143 DECLARE_EVENT_TABLE()
148 class CTSimApp: public wxApp
154 MainFrame* getMainFrame() const
157 { return m_pFrame->getLog(); }
158 wxDocManager* getDocManager()
159 { return m_docManager; }
161 wxString getUntitledFilename();
163 EZPlotDialog* makeEZPlotDialog()
164 { return new EZPlotDialog (m_pFrame); }
166 void getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector<ImageFileDocument*>& vecIF);
168 bool getSetModifyNewDocs() const
171 void setIconForFrame (wxFrame* pFrame);
174 wxDocManager* m_docManager;
177 void usage (const char* program);
179 static struct option ctsimOptions[];
181 enum { O_HELP, O_VERSION };
184 DECLARE_APP(CTSimApp)
186 extern class CTSimApp* theApp;
189 MAINMENU_WINDOW_BASE = 500,
190 MAINMENU_HELP_ABOUT = 600,
191 MAINMENU_HELP_CONTENTS,
192 MAINMENU_HELP_TOPICS,
193 MAINMENU_FILE_CREATE_PHANTOM,
195 MAINMENU_FILE_CREATE_FILTER,
198 PJMENU_FILE_PROPERTIES,
199 PJMENU_RECONSTRUCT_FBP,
200 PJMENU_RECONSTRUCT_FOURIER,
201 PJMENU_CONVERT_POLAR,
202 PJMENU_CONVERT_FFT_POLAR,
205 IFMENU_FILE_PROPERTIES,
211 IFMENU_PLOT_HISTOGRAM,
213 IFMENU_VIEW_SCALE_AUTO,
214 IFMENU_VIEW_SCALE_MINMAX,
215 IFMENU_VIEW_SCALE_FULL,
217 IFMENU_COMPARE_IMAGES,
220 IFMENU_IMAGE_SCALESIZE,
222 IFMENU_IMAGE_SUBTRACT,
223 IFMENU_IMAGE_MULTIPLY,
226 IFMENU_FILTER_INVERTVALUES,
228 IFMENU_FILTER_SQUARE,
231 IFMENU_FILTER_FOURIER,
232 IFMENU_FILTER_INVERSE_FOURIER,
235 IFMENU_FILTER_FFT_ROWS,
236 IFMENU_FILTER_FFT_COLS,
237 IFMENU_FILTER_IFFT_ROWS,
238 IFMENU_FILTER_IFFT_COLS,
239 IFMENU_FILTER_MAGNITUDE,
241 IFMENU_FILTER_SHUFFLENATURALTOFOURIERORDER,
242 IFMENU_FILTER_SHUFFLEFOURIERTONATURALORDER,
244 PHMMENU_FILE_PROPERTIES,
245 PHMMENU_PROCESS_RASTERIZE,
246 PHMMENU_PROCESS_PROJECTIONS,
248 PLOTMENU_VIEW_SCALE_MINMAX,
249 PLOTMENU_VIEW_SCALE_AUTO,
250 PLOTMENU_VIEW_SCALE_FULL,