r570: no message
[ctsim.git] / src / dialogs.cpp
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          dialogs.cpp
5 **   Purpose:       Dialog routines for CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (c) 1983-2001 Kevin Rosenberg
11 **
12 **  $Id: dialogs.cpp,v 1.39 2001/02/22 00:56:50 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 implementation
30 #endif
31
32 // For compilers that support precompilation, includes "wx/wx.h".
33 #include "wx/wxprec.h"
34
35 #ifdef __BORLANDC__
36 #pragma hdrstop
37 #endif
38
39 #ifndef WX_PRECOMP
40 #include "wx/wx.h"
41 #endif
42
43 #if !wxUSE_DOC_VIEW_ARCHITECTURE
44 #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
45 #endif
46
47 #include "wx/statline.h"
48 #include "wx/sizer.h"
49 #include "dialogs.h"
50 #include "ctsim.h"
51 #include "ct.h"
52 #include "docs.h"
53 #include "views.h"
54 #include "imagefile.h"
55
56 #if defined(MSVC) || HAVE_SSTREAM
57 #include <sstream>
58 #else
59 #include <sstream_subst>
60 #endif
61
62
63 ///////////////////////////////////////////////////////////////////////
64 // CLASS IMPLEMENTATION
65 //    StringValueAndTitleListBox
66 ///////////////////////////////////////////////////////////////////////
67
68 StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
69 : wxListBox ()
70 {
71   wxString* psTitle = new wxString [nChoices];
72   for (int i = 0; i < nChoices; i++)
73     psTitle[i] = aszTitle[i];
74   
75   Create (pParent, -1, wxDefaultPosition, wxSize(-1,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
76   
77   m_ppszValues = aszValue;
78   delete [] psTitle;
79 };
80
81 const char*
82 StringValueAndTitleListBox::getSelectionStringValue () const
83 {
84   return m_ppszValues[GetSelection()];
85 }
86
87 StringValueAndTitleRadioBox::StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[])
88 : wxRadioBox ()
89 {
90   wxString* psTitle = new wxString [nChoices];
91   for (int i = 0; i < nChoices; i++)
92     psTitle[i] = aszTitle[i];
93   
94   Create (pParent, -1, strTitle, wxDefaultPosition, wxDefaultSize, nChoices, psTitle, 1, wxRA_SPECIFY_COLS);
95   
96   m_ppszValues = aszValue;
97   delete [] psTitle;
98 };
99
100 const char*
101 StringValueAndTitleRadioBox::getSelectionStringValue () const
102 {
103   return m_ppszValues[GetSelection()];
104 }
105
106 ///////////////////////////////////////////////////////////////////////
107 // CLASS IMPLEMENTATION
108 //    DialogGetPhantom
109 ///////////////////////////////////////////////////////////////////////
110
111 DialogGetPhantom::DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom)
112 : wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
113 {
114   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
115   
116   pTopSizer->Add (new wxStaticText (this, -1, "Select Phantom"), 0, wxCENTER | wxALL, 5);
117   
118   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
119   
120   m_pRadioBoxPhantom = new StringValueAndTitleRadioBox (this, _T("Phantom"), Phantom::getPhantomCount(), Phantom::getPhantomTitleArray(), Phantom::getPhantomNameArray());
121   m_pRadioBoxPhantom->SetSelection (iDefaultPhantom);
122   pTopSizer->Add (m_pRadioBoxPhantom, 0, wxALL | wxALIGN_CENTER);
123   
124   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
125   
126   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
127   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
128   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
129   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
130   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
131   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PHANTOM);
132   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
133
134   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
135   pButtonOk->SetDefault();
136   
137   SetAutoLayout (true);
138   SetSizer (pTopSizer);
139   pTopSizer->Fit (this);
140   pTopSizer->SetSizeHints (this);
141 }
142
143 const char*
144 DialogGetPhantom::getPhantom()
145 {
146   return m_pRadioBoxPhantom->getSelectionStringValue();
147 }
148
149
150 ///////////////////////////////////////////////////////////////////////
151 // CLASS IMPLEMENTATION
152 //    DialogGetComparisonImage
153 ///////////////////////////////////////////////////////////////////////
154
155 DialogGetComparisonImage::DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)
156 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)
157 {
158   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
159   
160   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxALL, 5);
161   
162   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
163   
164   int iNImages = m_rVecIF.size();
165   wxString* pstrImages = new wxString [iNImages];
166   for (int i = 0; i < iNImages; i++) {
167     ImageFileView* pView = dynamic_cast<ImageFileView*>(m_rVecIF[i]->GetFirstView());
168     if (pView)
169       pstrImages[i] = pView->getFrame()->GetTitle();
170   }
171
172   m_pListBoxImageChoices = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, iNImages, pstrImages, wxLB_SINGLE);
173   delete [] pstrImages;
174
175   m_pListBoxImageChoices->SetSelection (0);
176   pTopSizer->Add (m_pListBoxImageChoices, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
177   
178   if (bShowMakeDifference) {
179     m_pMakeDifferenceImage = new wxCheckBox (this, -1, "Make Difference Image");
180     m_pMakeDifferenceImage->SetValue (FALSE);
181     pTopSizer->Add (m_pMakeDifferenceImage, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
182   } else
183     m_pMakeDifferenceImage = NULL;
184
185   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
186   
187   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
188   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
189   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
190   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
191   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
192   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_COMPARISON);
193   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
194   
195   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
196   pButtonOk->SetDefault();
197   
198   SetAutoLayout (true);
199   SetSizer (pTopSizer);
200   pTopSizer->Fit (this);
201   pTopSizer->SetSizeHints (this);
202 }
203
204 ImageFileDocument*
205 DialogGetComparisonImage::getImageFileDocument()
206 {
207   return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];
208 }
209
210 bool
211 DialogGetComparisonImage::getMakeDifferenceImage()
212 {
213   if (m_pMakeDifferenceImage)
214     return m_pMakeDifferenceImage->GetValue();
215   else
216     return false;
217 }
218
219
220 /////////////////////////////////////////////////////////////////////
221 // CLASS DiaglogPreferences Implementation
222 /////////////////////////////////////////////////////////////////////
223
224 DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTitle, 
225                    bool bAdvancedOptions, bool bAskDeleteNewDocs, bool bVerboseLogging, bool bStartupTips)
226 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
227 {
228   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
229   
230   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
231   
232   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
233
234   m_pCBAdvancedOptions = new wxCheckBox (this, -1, "Advanced Options", wxDefaultPosition, wxSize(250, 25), 0);
235   m_pCBAdvancedOptions->SetValue (bAdvancedOptions);
236   pTopSizer->Add (m_pCBAdvancedOptions, 0, wxALIGN_CENTER_VERTICAL);
237
238   m_pCBAskDeleteNewDocs = new wxCheckBox (this, -1, "Ask \"Save New Documents\" Before Closing", wxDefaultPosition, wxSize(250, 25), 0);
239   m_pCBAskDeleteNewDocs->SetValue (bAskDeleteNewDocs);
240   pTopSizer->Add (m_pCBAskDeleteNewDocs, 0, wxALIGN_CENTER_VERTICAL);
241
242   m_pCBVerboseLogging = new wxCheckBox (this, -1, "Verbose Logging", wxDefaultPosition, wxSize(250, 25), 0);
243   m_pCBVerboseLogging->SetValue (bVerboseLogging);
244   pTopSizer->Add (m_pCBVerboseLogging, 0, wxALIGN_CENTER_VERTICAL);
245
246   m_pCBStartupTips = new wxCheckBox (this, -1, "Show Tips at Start", wxDefaultPosition, wxSize(250, 25), 0);
247   m_pCBStartupTips->SetValue (bStartupTips);
248   pTopSizer->Add (m_pCBStartupTips, 0, wxALIGN_CENTER_VERTICAL);
249
250   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
251   
252   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
253   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
254   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
255   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
256   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
257   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PREFERENCES);
258   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
259   
260   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
261   pButtonOk->SetDefault();
262   
263   SetAutoLayout (true);
264   SetSizer (pTopSizer);
265   pTopSizer->Fit (this);
266   pTopSizer->SetSizeHints (this);
267 }
268
269 DialogPreferences::~DialogPreferences ()
270 {
271 }
272
273 bool
274 DialogPreferences::getAdvancedOptions ()
275 {
276   return static_cast<bool>(m_pCBAdvancedOptions->GetValue());
277 }
278
279 bool
280 DialogPreferences::getAskDeleteNewDocs ()
281 {
282   return static_cast<bool>(m_pCBAskDeleteNewDocs->GetValue());
283 }
284
285 bool
286 DialogPreferences::getVerboseLogging ()
287 {
288   return static_cast<bool>(m_pCBVerboseLogging->GetValue());
289 }
290
291 bool
292 DialogPreferences::getStartupTips ()
293 {
294   return static_cast<bool>(m_pCBStartupTips->GetValue());
295 }
296
297
298 /////////////////////////////////////////////////////////////////////
299 // CLASS DiaglogGetMinMax Implementation
300 /////////////////////////////////////////////////////////////////////
301
302 DialogGetMinMax::DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin, double dDefaultMax)
303 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
304 {
305   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
306   
307   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
308   
309   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
310   
311   std::ostringstream os;
312   os << dDefaultMin;
313   m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
314   std::ostringstream osMax;
315   osMax << dDefaultMax;
316   m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
317   
318   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
319   pGridSizer->Add (new wxStaticText (this, -1, "Minimum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
320   pGridSizer->Add (m_pTextCtrlMin, 0, wxALIGN_CENTER_VERTICAL);
321   pGridSizer->Add (new wxStaticText (this, -1, "Maximum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
322   pGridSizer->Add (m_pTextCtrlMax, 0, wxALIGN_CENTER_VERTICAL);
323   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
324   
325   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
326   
327   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
328   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
329   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
330   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
331   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
332   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_MINMAX);
333   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
334   
335   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
336   pButtonOk->SetDefault();
337   
338   SetAutoLayout (true);
339   SetSizer (pTopSizer);
340   pTopSizer->Fit (this);
341   pTopSizer->SetSizeHints (this);
342 }
343
344 DialogGetMinMax::~DialogGetMinMax ()
345 {
346 }
347
348 double
349 DialogGetMinMax::getMinimum ()
350 {
351   wxString strCtrl = m_pTextCtrlMin->GetValue();
352   double dValue;
353   if (strCtrl.ToDouble (&dValue))
354     return dValue;
355   else
356     return (m_dDefaultMin);
357 }
358
359 double
360 DialogGetMinMax::getMaximum ()
361 {
362   wxString strCtrl = m_pTextCtrlMax->GetValue();
363   double dValue;
364   if (strCtrl.ToDouble (&dValue))
365     return dValue;
366   else
367     return (m_dDefaultMax);
368 }
369
370
371 /////////////////////////////////////////////////////////////////////
372 // CLASS DialogAutoScaleParameters IMPLEMENTATION
373 /////////////////////////////////////////////////////////////////////
374
375 DialogAutoScaleParameters::DialogAutoScaleParameters (wxWindow *pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor)
376 : wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_dMean(mean), m_dMode(mode), m_dMedian(median), m_dStdDev(stddev)
377 {
378   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
379   
380   pTopSizer->Add (new wxStaticText (this, -1, "Auto Scale Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
381   
382   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
383   
384   wxString asTitle[] = {"Median", "Mode", "Mean"};
385   
386   m_pRadioBoxCenter = new wxRadioBox (this, -1, _T("Center"), wxDefaultPosition, wxDefaultSize, 3, asTitle, 1, wxRA_SPECIFY_COLS);
387   m_pRadioBoxCenter->SetSelection (0);
388   pTopSizer->Add (m_pRadioBoxCenter, 0, wxALL | wxALIGN_CENTER);
389   
390   wxGridSizer *pGridSizer = new wxGridSizer (2);
391   pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
392   std::ostringstream osDefaultFactor;
393   osDefaultFactor << dDefaultScaleFactor;
394   m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
395   pGridSizer->Add (m_pTextCtrlStdDevFactor, 0, wxALIGN_CENTER_VERTICAL);
396   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
397   
398   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
399   
400   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
401   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
402   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
403   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
404   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
405   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_AUTOSCALE);
406   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
407   
408   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
409   pButtonOk->SetDefault();
410   
411   SetAutoLayout (true);
412   SetSizer (pTopSizer);
413   pTopSizer->Fit (this);
414   pTopSizer->SetSizeHints (this);
415 }
416
417 bool
418 DialogAutoScaleParameters::getMinMax (double* pMin, double* pMax)
419 {
420   int iCenter = m_pRadioBoxCenter->GetSelection();
421   double dCenter = m_dMedian;
422   if (iCenter == 1)
423     dCenter = m_dMode;
424   else if (iCenter == 2)
425     dCenter = m_dMode;
426   
427   wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
428   double dValue;
429   if (! sStddevFactor.ToDouble (&dValue)) {
430     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
431     return false;
432   }
433   double dHalfWidth = dValue * m_dStdDev / 2;
434   *pMin = dCenter - dHalfWidth;
435   *pMax = dCenter + dHalfWidth;
436   *theApp->getLog() << "Setting minimum to " << *pMin << " and maximum to " << *pMax << "\n";
437   
438   return true;
439 }
440
441 double
442 DialogAutoScaleParameters::getAutoScaleFactor ()
443 {
444   wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
445   double dValue = 1.;
446   if (! sStddevFactor.ToDouble (&dValue)) {
447     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
448   }
449   
450   return dValue;
451 }
452
453
454
455 /////////////////////////////////////////////////////////////////////
456 // CLASS IDENTIFICATION
457 //
458 // DialogGetRasterParameters
459 /////////////////////////////////////////////////////////////////////
460
461 DialogGetRasterParameters::DialogGetRasterParameters 
462    (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples, double dDefaultViewRatio)
463 : wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
464 {
465   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
466   
467   pTopSizer->Add (new wxStaticText (this, -1, "Set Rasterization Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
468   
469   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
470     
471   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
472   std::ostringstream os;
473   os << iDefaultXSize;
474   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
475   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
476   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
477   std::ostringstream osYSize;
478   osYSize << iDefaultYSize;
479   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
480   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
481   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
482   std::ostringstream osViewRatio;
483   osViewRatio << dDefaultViewRatio;
484   m_pTextCtrlViewRatio = new wxTextCtrl (this, -1, osViewRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
485   pGridSizer->Add (new wxStaticText (this, -1, "View Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
486   pGridSizer->Add (m_pTextCtrlViewRatio, 0, wxALIGN_CENTER_VERTICAL);
487   std::ostringstream osNSamples;
488   osNSamples << iDefaultNSamples;
489   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
490   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Pixel"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
491   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
492
493   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
494   
495   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
496   
497   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
498   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
499   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
500   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
501   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
502   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_RASTERIZE);
503   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
504
505   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
506   pButtonOk->SetDefault();
507   
508   SetAutoLayout (true);
509   SetSizer (pTopSizer);
510   pTopSizer->Fit (this);
511   pTopSizer->SetSizeHints (this);
512 }
513
514 DialogGetRasterParameters::~DialogGetRasterParameters ()
515 {
516 }
517
518
519 unsigned int
520 DialogGetRasterParameters::getXSize ()
521 {
522   wxString strCtrl = m_pTextCtrlXSize->GetValue();
523   unsigned long lValue;
524   if (strCtrl.ToULong (&lValue))
525     return lValue;
526   else
527     return (m_iDefaultXSize);
528 }
529
530 unsigned int
531 DialogGetRasterParameters::getYSize ()
532 {
533   wxString strCtrl = m_pTextCtrlYSize->GetValue();
534   unsigned long lValue;
535   if (strCtrl.ToULong (&lValue))
536     return lValue;
537   else
538     return (m_iDefaultYSize);
539 }
540
541 unsigned int
542 DialogGetRasterParameters::getNSamples ()
543 {
544   wxString strCtrl = m_pTextCtrlNSamples->GetValue();
545   unsigned long lValue;
546   if (strCtrl.ToULong (&lValue))
547     return lValue;
548   else
549     return (m_iDefaultNSamples);
550 }
551
552 double
553 DialogGetRasterParameters::getViewRatio ()
554 {
555   wxString strCtrl = m_pTextCtrlViewRatio->GetValue();
556   double dValue;
557   if (strCtrl.ToDouble (&dValue))
558     return dValue;
559   else
560     return (m_dDefaultViewRatio);
561 }
562
563
564 /////////////////////////////////////////////////////////////////////
565 // CLASS IDENTIFICATION
566 //
567 // DialogGetProjectionParameters
568 /////////////////////////////////////////////////////////////////////
569
570
571 DialogGetProjectionParameters::DialogGetProjectionParameters 
572    (wxWindow* pParent, int iDefaultNDet, int iDefaultNView, int iDefaultNSamples, 
573     double dDefaultRotAngle, double dDefaultFocalLength, double dDefaultViewRatio,
574     double dDefaultScanRatio, int iDefaultGeometry, int iDefaultTrace)
575 : wxDialog (pParent, -1, "Set Projection Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
576 {
577   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
578   
579   m_dDefaultRotAngle = dDefaultRotAngle;
580   m_dDefaultFocalLength = dDefaultFocalLength;
581   m_dDefaultViewRatio = dDefaultViewRatio;
582   m_dDefaultScanRatio = dDefaultScanRatio;
583   m_iDefaultNSamples = iDefaultNSamples;
584   m_iDefaultNView = iDefaultNView;
585   m_iDefaultNDet = iDefaultNDet;
586   m_iDefaultTrace = iDefaultTrace;
587   m_iDefaultGeometry = iDefaultGeometry;
588   
589   pTopSizer->Add (new wxStaticText (this, -1, "Set Projection Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
590   
591   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
592     
593   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
594   m_pRadioBoxGeometry = new StringValueAndTitleRadioBox (this, _T("Geometry"), Scanner::getGeometryCount(), Scanner::getGeometryTitleArray(), Scanner::getGeometryNameArray());
595   m_pRadioBoxGeometry->SetSelection (iDefaultGeometry);
596   
597   pGridSizer->Add (m_pRadioBoxGeometry, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
598   
599   m_pRadioBoxTrace = new StringValueAndTitleRadioBox (this, _T("Trace Level"), Trace::getTraceCount(), Trace::getTraceTitleArray(), Trace::getTraceNameArray());
600   m_pRadioBoxTrace->SetSelection (iDefaultTrace);
601   pGridSizer->Add (m_pRadioBoxTrace, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
602
603           wxFlexGridSizer* pText1Sizer = new wxFlexGridSizer(2);
604   std::ostringstream os;
605   os << iDefaultNDet;
606   m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
607   pText1Sizer->Add (new wxStaticText (this, -1, "Detectors"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
608   pText1Sizer->Add (m_pTextCtrlNDet, 0, wxALIGN_CENTER_VERTICAL);
609   std::ostringstream osNView;
610   osNView << iDefaultNView;
611   m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
612   pText1Sizer->Add (new wxStaticText (this, -1, "Views"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
613   pText1Sizer->Add (m_pTextCtrlNView, 0, wxALIGN_CENTER_VERTICAL);
614   std::ostringstream osNSamples;
615   osNSamples << iDefaultNSamples;
616   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
617   pText1Sizer->Add (new wxStaticText (this, -1, "Samples per Detector"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
618   pText1Sizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
619
620   pGridSizer->Add (pText1Sizer);
621
622   wxFlexGridSizer* pText2Sizer = new wxFlexGridSizer(2);
623   std::ostringstream osViewRatio;
624   osViewRatio << dDefaultViewRatio;
625   m_pTextCtrlViewRatio = new wxTextCtrl (this, -1, osViewRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
626   pText2Sizer->Add (new wxStaticText (this, -1, "View Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
627   pText2Sizer->Add (m_pTextCtrlViewRatio, 0, wxALIGN_CENTER_VERTICAL);
628   std::ostringstream osScanRatio;
629   osScanRatio << dDefaultScanRatio;
630   m_pTextCtrlScanRatio = new wxTextCtrl (this, -1, osScanRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
631   pText2Sizer->Add (new wxStaticText (this, -1, "Scan Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
632   pText2Sizer->Add (m_pTextCtrlScanRatio, 0, wxALIGN_CENTER_VERTICAL);
633   std::ostringstream osFocalLength;
634   osFocalLength << dDefaultFocalLength;
635   m_pTextCtrlFocalLength = new wxTextCtrl (this, -1, osFocalLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
636   pText2Sizer->Add (new wxStaticText (this, -1, "Focal Length Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
637   pText2Sizer->Add (m_pTextCtrlFocalLength, 0, wxALIGN_CENTER_VERTICAL);
638   
639   if (theApp->getAdvancedOptions()) {
640     std::ostringstream osRotAngle;
641     osRotAngle << dDefaultRotAngle;
642     m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
643     pText2Sizer->Add (new wxStaticText (this, -1, "Rotation Angle (Fraction of circle)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
644     pText2Sizer->Add (m_pTextCtrlRotAngle, 0, wxALIGN_CENTER_VERTICAL);
645   }
646   pGridSizer->Add (pText2Sizer);
647
648   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
649   
650   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
651   
652   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
653   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
654   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
655   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
656   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
657   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PROJECTIONS);
658   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
659   
660   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
661   pButtonOk->SetDefault();
662   
663   SetAutoLayout (true);
664   SetSizer (pTopSizer);
665   pTopSizer->Fit (this);
666   pTopSizer->SetSizeHints (this);
667 }
668
669 DialogGetProjectionParameters::~DialogGetProjectionParameters ()
670 {
671 }
672
673
674 unsigned int
675 DialogGetProjectionParameters::getNDet ()
676 {
677   wxString strCtrl = m_pTextCtrlNDet->GetValue();
678   unsigned long lValue;
679   if (strCtrl.ToULong (&lValue))
680     return lValue;
681   else
682     return (m_iDefaultNDet);
683 }
684
685 unsigned int
686 DialogGetProjectionParameters::getNView ()
687 {
688   wxString strCtrl = m_pTextCtrlNView->GetValue();
689   unsigned long lValue;
690   if (strCtrl.ToULong (&lValue))
691     return lValue;
692   else
693     return (m_iDefaultNView);
694 }
695
696
697 unsigned int
698 DialogGetProjectionParameters::getNSamples ()
699 {
700   wxString strCtrl = m_pTextCtrlNSamples->GetValue();
701   unsigned long lValue;
702   if (strCtrl.ToULong (&lValue))
703     return lValue;
704   else
705     return (m_iDefaultNSamples);
706 }
707
708 double
709 DialogGetProjectionParameters::getRotAngle ()
710 {
711   if (theApp->getAdvancedOptions()) {
712     wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
713     double dValue;
714     if (strCtrl.ToDouble (&dValue))
715       return (dValue * TWOPI);
716     else
717       return (m_dDefaultRotAngle);
718   } else {
719     if (Scanner::convertGeometryNameToID (m_pRadioBoxGeometry->getSelectionStringValue()) == 
720           Scanner::GEOMETRY_PARALLEL)
721       return (PI);
722     else
723       return (TWOPI);
724   }
725 }
726
727 double
728 DialogGetProjectionParameters::getFocalLengthRatio ()
729 {
730   wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
731   double dValue;
732   if (strCtrl.ToDouble (&dValue))
733     return (dValue);
734   else
735     return (m_dDefaultFocalLength);
736 }
737
738 double
739 DialogGetProjectionParameters::getViewRatio ()
740 {
741   wxString strCtrl = m_pTextCtrlViewRatio->GetValue();
742   double dValue;
743   if (strCtrl.ToDouble (&dValue))
744     return (dValue);
745   else
746     return (m_dDefaultViewRatio);
747 }
748
749 double
750 DialogGetProjectionParameters::getScanRatio ()
751 {
752   wxString strCtrl = m_pTextCtrlScanRatio->GetValue();
753   double dValue;
754   if (strCtrl.ToDouble (&dValue))
755     return (dValue);
756   else
757     return (m_dDefaultScanRatio);
758 }
759
760 const char*
761 DialogGetProjectionParameters::getGeometry ()
762 {
763   return m_pRadioBoxGeometry->getSelectionStringValue();
764 }
765
766 int
767 DialogGetProjectionParameters::getTrace ()
768 {
769   return Trace::convertTraceNameToID(m_pRadioBoxTrace->getSelectionStringValue());
770 }
771
772
773
774 /////////////////////////////////////////////////////////////////////
775 // CLASS IDENTIFICATION
776 //
777 // DialogGetReconstructionParameters
778 /////////////////////////////////////////////////////////////////////
779
780
781 DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize, 
782                      int iDefaultYSize, int iDefaultFilterID, double dDefaultHammingParam,  
783                      int iDefaultFilterMethodID, int iDefaultFilterGenerationID, int iDefaultZeropad, 
784                      int iDefaultInterpID, int iDefaultInterpParam, int iDefaultBackprojectID, int iTrace)
785 : wxDialog (pParent, -1, "Set Reconstruction Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
786 {
787   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
788   
789   pTopSizer->Add (new wxStaticText (this, -1, "Set Reconstruction Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
790   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
791   
792   wxFlexGridSizer* pGridSizer = NULL;
793   if (theApp->getAdvancedOptions())
794     pGridSizer = new wxFlexGridSizer (4);
795   else
796     pGridSizer = new wxFlexGridSizer (3);
797
798   if (theApp->getAdvancedOptions())
799     m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
800   else
801     m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getReconstructFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
802   m_pRadioBoxFilter->SetSelection (iDefaultFilterID);
803   pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
804   
805   if (theApp->getAdvancedOptions()) {
806     m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray());
807     m_pRadioBoxFilterMethod->SetSelection (iDefaultFilterMethodID);
808     pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
809   } else {
810 #if HAVE_FFTW
811     static const char* aszFilterMethodTitle[] = {"Convolution", "FFT"};
812     static const char* aszFilterMethodName[] = {"convolution", "rfftw"};
813 #else
814     static const char* aszFilterMethodTitle[] = {"Convolution", "Fourier"};
815     static const char* aszFilterMethodName[] = {"convolution", "fourier-table"};
816 #endif
817       m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), 2, aszFilterMethodTitle, aszFilterMethodName);
818 #if HAVE_FFTW
819       m_pRadioBoxFilterMethod->SetSelection (1);
820 #else
821       m_pRadioBoxFilterMethod->SetSelection (0);
822 #endif
823       pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
824   }
825
826   if (theApp->getAdvancedOptions()) {
827     m_pRadioBoxFilterGeneration = new StringValueAndTitleRadioBox (this, _T("Filter Generation"), ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray());
828     m_pRadioBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID);
829     pGridSizer->Add (m_pRadioBoxFilterGeneration, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
830   
831     m_pRadioBoxBackproject = new StringValueAndTitleRadioBox (this, _T("Backprojection"), Backprojector::getBackprojectCount(), Backprojector::getBackprojectTitleArray(), Backprojector::getBackprojectNameArray());
832     m_pRadioBoxBackproject->SetSelection (iDefaultBackprojectID);
833     pGridSizer->Add (m_pRadioBoxBackproject, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
834   }
835
836   m_pRadioBoxInterp = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Backprojector::getInterpCount(), Backprojector::getInterpTitleArray(), Backprojector::getInterpNameArray());
837   m_pRadioBoxInterp->SetSelection (iDefaultInterpID);
838   pGridSizer->Add (m_pRadioBoxInterp, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
839   
840   static const char* aszTraceTitle[] = {"None", "Full"};
841   static const char* aszTraceName[] = {"none", "full"};
842   m_pRadioBoxTrace = new StringValueAndTitleRadioBox (this, _T("Trace Level"), 2, aszTraceTitle, aszTraceName);
843   iTrace = clamp(iTrace, 0, 1);
844   m_pRadioBoxTrace->SetSelection (iTrace);
845   pGridSizer->Add (m_pRadioBoxTrace);
846
847   wxFlexGridSizer* pTextGridSizer = new wxFlexGridSizer (2);
848   std::ostringstream os;
849   os << iDefaultXSize;
850   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
851   pTextGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
852   pTextGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
853   std::ostringstream osYSize;
854   osYSize << iDefaultYSize;
855   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
856   pTextGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
857   pTextGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
858
859   std::ostringstream osHammingParam;
860   osHammingParam << dDefaultHammingParam;
861   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osHammingParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
862   pTextGridSizer->Add (new wxStaticText (this, -1, "Hamming Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
863   pTextGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
864
865   if (theApp->getAdvancedOptions()) {
866     std::ostringstream osZeropad;
867     osZeropad << iDefaultZeropad;
868     m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
869     pTextGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
870     pTextGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
871   }
872   pGridSizer->Add (pTextGridSizer);
873
874 #if HAVE_FREQ_PREINTERP
875   std::ostringstream osInterpParam;
876   osInterpParam << iDefaultInterpParam;
877   m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
878   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
879   pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
880 #endif  
881   
882   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
883   
884   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
885   
886   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
887   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
888   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
889   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
890   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
891   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_RECONSTRUCTION);
892   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
893   
894   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
895   pButtonOk->SetDefault();
896   
897   SetAutoLayout (true);
898   SetSizer (pTopSizer);
899   pTopSizer->Layout();
900   pTopSizer->Fit (this);
901   pTopSizer->SetSizeHints (this);
902 }
903
904 DialogGetReconstructionParameters::~DialogGetReconstructionParameters ()
905 {
906 }
907
908
909 unsigned int
910 DialogGetReconstructionParameters::getXSize ()
911 {
912   wxString strCtrl = m_pTextCtrlXSize->GetValue();
913   unsigned long lValue;
914   if (strCtrl.ToULong (&lValue))
915     return lValue;
916   else
917     return (m_iDefaultXSize);
918 }
919
920 unsigned int
921 DialogGetReconstructionParameters::getYSize ()
922 {
923   wxString strCtrl = m_pTextCtrlYSize->GetValue();
924   unsigned long lValue;
925   if (strCtrl.ToULong (&lValue))
926     return lValue;
927   else
928     return (m_iDefaultYSize);
929 }
930
931 unsigned int
932 DialogGetReconstructionParameters::getZeropad ()
933 {
934   if (theApp->getAdvancedOptions()) {
935     wxString strCtrl = m_pTextCtrlZeropad->GetValue();
936     unsigned long lValue;
937     if (strCtrl.ToULong (&lValue))
938       return lValue;
939     else
940       return (m_iDefaultZeropad);
941   } else
942     return 1;
943 }
944
945
946 unsigned int
947 DialogGetReconstructionParameters::getInterpParam ()
948 {
949 #if HAVE_FREQ_PREINTERP
950   wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
951   unsigned long lValue;
952   if (strCtrl.ToULong (&lValue))
953     return lValue;
954   else
955     return (m_iDefaultInterpParam);
956 #else
957   return 1;
958 #endif
959 }
960
961 double
962 DialogGetReconstructionParameters::getFilterParam ()
963 {
964   wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
965   double dValue;
966   if (strCtrl.ToDouble (&dValue))
967     return (dValue);
968   else
969     return (m_dDefaultFilterParam);
970 }
971
972 const char*
973 DialogGetReconstructionParameters::getFilterName ()
974 {
975   return m_pRadioBoxFilter->getSelectionStringValue();
976 }
977
978 const char*
979 DialogGetReconstructionParameters::getFilterMethodName ()
980 {
981   return m_pRadioBoxFilterMethod->getSelectionStringValue();
982 }
983
984 const char*
985 DialogGetReconstructionParameters::getInterpName ()
986 {
987   return m_pRadioBoxInterp->getSelectionStringValue();
988 }
989
990 int
991 DialogGetReconstructionParameters::getTrace ()
992 {
993   int iTrace = 0;
994   if (strcmp("full", m_pRadioBoxTrace->getSelectionStringValue()) == 0)
995     iTrace = Trace::TRACE_PLOT;
996   return iTrace;
997 }
998
999 const char*
1000 DialogGetReconstructionParameters::getBackprojectName ()
1001 {
1002   if (theApp->getAdvancedOptions()) {
1003     return m_pRadioBoxBackproject->getSelectionStringValue();
1004   } else
1005     return "idiff";
1006 }
1007
1008 const char*
1009 DialogGetReconstructionParameters::getFilterGenerationName ()
1010 {
1011   if (theApp->getAdvancedOptions()) {
1012     return m_pRadioBoxFilterGeneration->getSelectionStringValue();
1013   } else {
1014     if (ProcessSignal::convertFilterMethodNameToID(m_pRadioBoxFilterMethod->getSelectionStringValue())
1015         == ProcessSignal::FILTER_METHOD_CONVOLUTION)
1016       return "direct";
1017     else
1018       return "inverse-fourier";
1019   }
1020 }
1021
1022
1023 /////////////////////////////////////////////////////////////////////
1024 // CLASS IDENTIFICATION
1025 //
1026 // DialogGetFilterParameters
1027 /////////////////////////////////////////////////////////////////////
1028
1029
1030
1031 DialogGetFilterParameters::DialogGetFilterParameters (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam,  double dDefaultBandwidth, int iDefaultDomainID, double dDefaultInputScale, double dDefaultOutputScale)
1032 : wxDialog (pParent, -1, "Set Filter Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1033 {
1034   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1035   
1036   pTopSizer->Add (new wxStaticText (this, -1, "Set Filter Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5); 
1037   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1038   
1039   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
1040
1041   m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
1042   m_pRadioBoxFilter->SetSelection (iDefaultFilterID);
1043   pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
1044   
1045   m_pRadioBoxDomain = new StringValueAndTitleRadioBox (this, _T("Domain"), SignalFilter::getDomainCount(), SignalFilter::getDomainTitleArray(), SignalFilter::getDomainNameArray());
1046   m_pRadioBoxDomain->SetSelection (iDefaultDomainID);
1047   pGridSizer->Add (m_pRadioBoxDomain, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
1048   
1049   std::ostringstream os;
1050   os << iDefaultXSize;
1051   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1052   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1053   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1054
1055   std::ostringstream osYSize;
1056   osYSize << iDefaultYSize;
1057   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1058   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1059   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1060
1061   std::ostringstream osFilterParam;
1062   osFilterParam << dDefaultFilterParam;
1063   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1064   pGridSizer->Add (new wxStaticText (this, -1, "Filter Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1065   pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1066
1067   std::ostringstream osBandwidth;
1068   osBandwidth << dDefaultBandwidth;
1069   m_pTextCtrlBandwidth = new wxTextCtrl (this, -1, osBandwidth.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1070   pGridSizer->Add (new wxStaticText (this, -1, "Bandwidth"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1071   pGridSizer->Add (m_pTextCtrlBandwidth, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1072
1073   std::ostringstream osInputScale;
1074   osInputScale << dDefaultInputScale;
1075   m_pTextCtrlInputScale = new wxTextCtrl (this, -1, osInputScale.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1076   pGridSizer->Add (new wxStaticText (this, -1, "Axis (input) Scale"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1077   pGridSizer->Add (m_pTextCtrlInputScale, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1078
1079   std::ostringstream osOutputScale;
1080   osOutputScale << dDefaultOutputScale;
1081   m_pTextCtrlOutputScale = new wxTextCtrl (this, -1, osOutputScale.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1082   pGridSizer->Add (new wxStaticText (this, -1, "Filter Output Scale"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1083   pGridSizer->Add (m_pTextCtrlOutputScale, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1084   
1085   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
1086   
1087   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1088   
1089   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1090   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1091   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1092   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1093   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1094   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_FILTER);
1095   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
1096   
1097   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1098   pButtonOk->SetDefault();
1099
1100   SetAutoLayout (true);
1101   SetSizer (pTopSizer);
1102   pTopSizer->Layout();
1103   pTopSizer->Fit (this);
1104   pTopSizer->SetSizeHints (this);
1105 }
1106
1107 DialogGetFilterParameters::~DialogGetFilterParameters ()
1108 {
1109 }
1110
1111
1112 unsigned int
1113 DialogGetFilterParameters::getXSize ()
1114 {
1115   wxString strCtrl = m_pTextCtrlXSize->GetValue();
1116   unsigned long lValue;
1117   if (strCtrl.ToULong (&lValue))
1118     return lValue;
1119   else
1120     return (m_iDefaultXSize);
1121 }
1122
1123 unsigned int
1124 DialogGetFilterParameters::getYSize ()
1125 {
1126   wxString strCtrl = m_pTextCtrlYSize->GetValue();
1127   unsigned long lValue;
1128   if (strCtrl.ToULong (&lValue))
1129     return lValue;
1130   else
1131     return (m_iDefaultYSize);
1132 }
1133
1134 double
1135 DialogGetFilterParameters::getBandwidth ()
1136 {
1137   wxString strCtrl = m_pTextCtrlBandwidth->GetValue();
1138   double dValue;
1139   if (strCtrl.ToDouble (&dValue))
1140     return dValue;
1141   else
1142     return (m_dDefaultBandwidth);
1143 }
1144
1145 double
1146 DialogGetFilterParameters::getFilterParam ()
1147 {
1148   wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
1149   double dValue;
1150   if (strCtrl.ToDouble (&dValue))
1151     return (dValue);
1152   else
1153     return (m_dDefaultFilterParam);
1154 }
1155
1156 double
1157 DialogGetFilterParameters::getInputScale ()
1158 {
1159   wxString strCtrl = m_pTextCtrlInputScale->GetValue();
1160   double dValue;
1161   if (strCtrl.ToDouble (&dValue))
1162     return dValue;
1163   else
1164     return (m_dDefaultInputScale);
1165 }
1166
1167 double
1168 DialogGetFilterParameters::getOutputScale ()
1169 {
1170   wxString strCtrl = m_pTextCtrlOutputScale->GetValue();
1171   double dValue;
1172   if (strCtrl.ToDouble (&dValue))
1173     return dValue;
1174   else
1175     return (m_dDefaultOutputScale);
1176 }
1177
1178 const char*
1179 DialogGetFilterParameters::getFilterName ()
1180 {
1181   return m_pRadioBoxFilter->getSelectionStringValue();
1182 }
1183
1184 const char*
1185 DialogGetFilterParameters::getDomainName ()
1186 {
1187   return m_pRadioBoxDomain->getSelectionStringValue();
1188 }
1189
1190
1191 ///////////////////////////////////////////////////////////////////////
1192 // CLASS IMPLEMENTATION
1193 //    DialogExportParameters
1194 ///////////////////////////////////////////////////////////////////////
1195
1196 DialogExportParameters::DialogExportParameters (wxWindow* pParent, int iDefaultFormatID)
1197 : wxDialog (pParent, -1, "Select ExportParameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1198 {
1199   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1200   
1201   pTopSizer->Add (new wxStaticText (this, -1, "Select Export Format"), 0, wxALIGN_CENTER | wxALL, 5);
1202   
1203   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
1204   
1205   m_pRadioBoxFormat = new StringValueAndTitleRadioBox (this, _T("Export Type"), ImageFile::getFormatCount(), ImageFile::getFormatTitleArray(), ImageFile::getFormatNameArray());
1206   m_pRadioBoxFormat->SetSelection (iDefaultFormatID);
1207   pTopSizer->Add (m_pRadioBoxFormat, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
1208   
1209   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1210   
1211   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1212   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1213   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1214   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1215   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1216   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_EXPORT);
1217   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
1218   
1219   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1220   pButtonOk->SetDefault();
1221
1222   SetAutoLayout (true);
1223   SetSizer (pTopSizer);
1224   pTopSizer->Fit (this);
1225   pTopSizer->SetSizeHints (this);
1226 }
1227
1228 const char*
1229 DialogExportParameters::getFormatName()
1230 {
1231   return m_pRadioBoxFormat->getSelectionStringValue();
1232 }
1233
1234
1235 /////////////////////////////////////////////////////////////////////
1236 // CLASS DiaglogGetXYSize Implementation
1237 /////////////////////////////////////////////////////////////////////
1238
1239 DialogGetXYSize::DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize, int iDefaultYSize)
1240 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1241 {
1242   m_iDefaultXSize = iDefaultXSize;
1243   m_iDefaultYSize = iDefaultYSize;
1244
1245   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1246   
1247   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
1248   
1249   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1250   
1251   std::ostringstream os;
1252   os << iDefaultXSize;
1253   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1254   std::ostringstream osYSize;
1255   osYSize << iDefaultYSize;
1256   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1257   
1258   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
1259   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1260   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
1261   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1262   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
1263   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
1264   
1265   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1266   
1267   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1268   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1269   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1270   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1271   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1272   
1273   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1274   pButtonOk->SetDefault();
1275
1276   SetAutoLayout (true);
1277   SetSizer (pTopSizer);
1278   pTopSizer->Fit (this);
1279   pTopSizer->SetSizeHints (this);
1280 }
1281
1282 DialogGetXYSize::~DialogGetXYSize ()
1283 {
1284 }
1285
1286 unsigned int
1287 DialogGetXYSize::getXSize ()
1288 {
1289   wxString strCtrl = m_pTextCtrlXSize->GetValue();
1290   long lValue;
1291   if (strCtrl.ToLong (&lValue))
1292     return lValue;
1293   else
1294     return (m_iDefaultXSize);
1295 }
1296
1297 unsigned int
1298 DialogGetXYSize::getYSize ()
1299 {
1300   wxString strCtrl = m_pTextCtrlYSize->GetValue();
1301   long lValue;
1302   if (strCtrl.ToLong (&lValue))
1303     return lValue;
1304   else
1305     return (m_iDefaultYSize);
1306 }
1307
1308
1309
1310 /////////////////////////////////////////////////////////////////////
1311 // CLASS IDENTIFICATION
1312 //
1313 // DialogGetConvertPolarParameters
1314 /////////////////////////////////////////////////////////////////////
1315
1316 DialogGetConvertPolarParameters::DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, 
1317        int iDefaultXSize, int iDefaultYSize, int iDefaultInterpolationID, int iDefaultZeropad)
1318 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1319 {
1320   m_iDefaultXSize = iDefaultXSize;
1321   m_iDefaultYSize = iDefaultYSize;
1322   m_iDefaultZeropad = iDefaultZeropad;
1323
1324   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1325   
1326   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5); 
1327   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1328   
1329   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (1);
1330   
1331   m_pRadioBoxInterpolation = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Projections::getInterpCount(), Projections::getInterpTitleArray(), Projections::getInterpNameArray());
1332   m_pRadioBoxInterpolation->SetSelection (iDefaultInterpolationID);
1333   pGridSizer->Add (m_pRadioBoxInterpolation, 0, wxALL | wxALIGN_CENTER);
1334   
1335   wxFlexGridSizer* pTextGridSizer = new wxFlexGridSizer (2);
1336   std::ostringstream os;
1337   os << iDefaultXSize;
1338   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);  
1339   pTextGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1340   pTextGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1341   std::ostringstream osYSize;
1342   osYSize << iDefaultYSize;
1343   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1344   pTextGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1345   pTextGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1346 #ifdef DEBUG
1347   if (iDefaultZeropad >= 0) {
1348     std::ostringstream osZeropad;
1349     osZeropad << iDefaultZeropad;
1350     m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1351     pTextGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1352     pTextGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1353   }
1354 #endif
1355
1356   pGridSizer->Add (pTextGridSizer, 0, wxALIGN_CENTER | wxALL);
1357
1358   pTopSizer->Add (pGridSizer, 1, wxALL | wxALIGN_CENTER, 3);
1359   
1360   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1361   
1362   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1363   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1364   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1365   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1366   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1367   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_POLAR);
1368   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
1369   
1370   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1371   pButtonOk->SetDefault();
1372   SetAutoLayout (true);
1373   SetSizer (pTopSizer);
1374   pTopSizer->Layout();
1375   pTopSizer->Fit (this);
1376   pTopSizer->SetSizeHints (this);
1377 }
1378
1379
1380 DialogGetConvertPolarParameters::~DialogGetConvertPolarParameters ()
1381 {
1382 }
1383
1384
1385 unsigned int
1386 DialogGetConvertPolarParameters::getXSize ()
1387 {
1388   wxString strCtrl = m_pTextCtrlXSize->GetValue();
1389   unsigned long lValue;
1390   if (strCtrl.ToULong (&lValue))
1391     return lValue;
1392   else
1393     return (m_iDefaultXSize);
1394 }
1395
1396 unsigned int
1397 DialogGetConvertPolarParameters::getYSize ()
1398 {
1399   wxString strCtrl = m_pTextCtrlYSize->GetValue();
1400   unsigned long lValue;
1401   if (strCtrl.ToULong (&lValue))
1402     return lValue;
1403   else
1404     return (m_iDefaultYSize);
1405 }
1406
1407 unsigned int
1408 DialogGetConvertPolarParameters::getZeropad ()
1409 {
1410 #ifdef DEBUG
1411   wxString strCtrl = m_pTextCtrlZeropad->GetValue();
1412   unsigned long lValue;
1413   if (strCtrl.ToULong (&lValue))
1414     return lValue;
1415   else
1416     return (m_iDefaultZeropad);
1417 #else
1418   return 0;
1419 #endif
1420 }
1421
1422 const char*
1423 DialogGetConvertPolarParameters::getInterpolationName ()
1424 {
1425   return m_pRadioBoxInterpolation->getSelectionStringValue();
1426 }
1427