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