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