X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fdialogs.cpp;h=6d20898dab59ca513f8d6c9ccc3b478dbd5483c4;hb=11ea72090da18aa290e2c3ab217f1d27736bca50;hp=d2fae8cedbe34f441b402dbea27c197691643964;hpb=17f20398d8bb0e4b97b5884b999bbe8d58c5254f;p=ctsim.git diff --git a/src/dialogs.cpp b/src/dialogs.cpp index d2fae8c..6d20898 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: dialogs.cpp,v 1.33 2001/02/16 00:28:41 kevin Exp $ +** $Id: dialogs.cpp,v 1.37 2001/02/20 17:44:14 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -620,7 +620,7 @@ DialogGetProjectionParameters::DialogGetProjectionParameters std::ostringstream osRotAngle; osRotAngle << dDefaultRotAngle; m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - pText2Sizer->Add (new wxStaticText (this, -1, "Rotation Angle (PI units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pText2Sizer->Add (new wxStaticText (this, -1, "Rotation Angle (Fraction of circle)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); pText2Sizer->Add (m_pTextCtrlRotAngle, 0, wxALIGN_CENTER_VERTICAL); } pGridSizer->Add (pText2Sizer); @@ -692,7 +692,7 @@ DialogGetProjectionParameters::getRotAngle () wxString strCtrl = m_pTextCtrlRotAngle->GetValue(); double dValue; if (strCtrl.ToDouble (&dValue)) - return (dValue * PI); + return (dValue * TWOPI); else return (m_dDefaultRotAngle); } else { @@ -700,7 +700,7 @@ DialogGetProjectionParameters::getRotAngle () Scanner::GEOMETRY_PARALLEL) return (PI); else - return (2 * PI); + return (TWOPI); } } @@ -782,10 +782,27 @@ DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxWindow* m_pRadioBoxFilter->SetSelection (iDefaultFilterID); pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND); - m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray()); - m_pRadioBoxFilterMethod->SetSelection (iDefaultFilterMethodID); - pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND); - + if (theApp->getAdvancedOptions()) { + m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray()); + m_pRadioBoxFilterMethod->SetSelection (iDefaultFilterMethodID); + pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND); + } else { +#if HAVE_FFTW + static const char* aszFilterMethodTitle[] = {"Convolution", "FFT"}; + static const char* aszFilterMethodName[] = {"convolution", "rfftw"}; +#else + static const char* aszFilterMethodTitle[] = {"Convolution", "Fourier"}; + static const char* aszFilterMethodName[] = {"convolution", "fourier-table"}; +#endif + m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), 2, aszFilterMethodTitle, aszFilterMethodName); +#if HAVE_FFTW + m_pRadioBoxFilterMethod->SetSelection (1); +#else + m_pRadioBoxFilterMethod->SetSelection (0); +#endif + pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND); + } + if (theApp->getAdvancedOptions()) { m_pRadioBoxFilterGeneration = new StringValueAndTitleRadioBox (this, _T("Filter Generation"), ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray()); m_pRadioBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID); @@ -1286,36 +1303,39 @@ DialogGetConvertPolarParameters::DialogGetConvertPolarParameters (wxWindow* pPar wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL); - pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5); - + pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5); pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); + wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (1); + + m_pRadioBoxInterpolation = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Projections::getInterpCount(), Projections::getInterpTitleArray(), Projections::getInterpNameArray()); + m_pRadioBoxInterpolation->SetSelection (iDefaultInterpolationID); + pGridSizer->Add (m_pRadioBoxInterpolation, 0, wxALL | wxALIGN_CENTER); + + wxFlexGridSizer* pTextGridSizer = new wxFlexGridSizer (2); std::ostringstream os; os << iDefaultXSize; - m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); + m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); + pTextGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pTextGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); std::ostringstream osYSize; osYSize << iDefaultYSize; m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - - wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2); - - m_pRadioBoxInterpolation = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Projections::getInterpCount(), Projections::getInterpTitleArray(), Projections::getInterpNameArray()); - m_pRadioBoxInterpolation->SetSelection (iDefaultInterpolationID); - pGridSizer->Add (m_pRadioBoxInterpolation, 0, wxALL | wxALIGN_LEFT | wxEXPAND); - - pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); - pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + pTextGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pTextGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); +#ifdef DEBUG if (iDefaultZeropad >= 0) { std::ostringstream osZeropad; osZeropad << iDefaultZeropad; m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - pGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - pGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + pTextGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pTextGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); } - - pTopSizer->Add (pGridSizer, 1, wxALL, 3); +#endif + + pGridSizer->Add (pTextGridSizer, 0, wxALIGN_CENTER | wxALL); + + pTopSizer->Add (pGridSizer, 1, wxALL | wxALIGN_CENTER, 3); pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); @@ -1367,12 +1387,16 @@ DialogGetConvertPolarParameters::getYSize () unsigned int DialogGetConvertPolarParameters::getZeropad () { +#ifdef DEBUG wxString strCtrl = m_pTextCtrlZeropad->GetValue(); unsigned long lValue; if (strCtrl.ToULong (&lValue)) return lValue; else return (m_iDefaultZeropad); +#else + return 0; +#endif } const char*