r635: no message
[ctsim.git] / src / dialogs.cpp
index 57dc3f73a42d8ec1db7407e83cfbcef7b3ef1dac..4125f10f076fa2080008565e32513f14c36e1a7f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: dialogs.cpp,v 1.51 2001/03/11 17:55:29 kevin Exp $
+**  $Id: dialogs.cpp,v 1.52 2001/03/13 04:44:25 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
@@ -47,6 +47,7 @@
 #include "docs.h"
 #include "views.h"
 #include "imagefile.h"
+#include "projections.h"
 
 #if defined(MSVC) || HAVE_SSTREAM
 #include <sstream>
@@ -142,6 +143,64 @@ DialogGetPhantom::getPhantom()
 }
 
 
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+//    DialogGetThetaRange
+///////////////////////////////////////////////////////////////////////
+
+DialogGetThetaRange::DialogGetThetaRange (wxWindow* pParent, int iDefaultThetaRange)
+: wxDialog (pParent, -1, _T("Select Phantom"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+  wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+  
+  pTopSizer->Add (new wxStaticText (this, -1, "Select Theta Range"), 0, wxCENTER | wxALL, 5);
+  
+  pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+  
+  wxString asTitle[] = {"Unconstrained", "Normalized to 2pi", "Fold to pi"};
+  
+  m_pRadioBoxThetaRange = new wxRadioBox (this, -1, _T("Theta Range"), wxDefaultPosition, wxDefaultSize, 3, asTitle, 1, wxRA_SPECIFY_COLS);
+  if (iDefaultThetaRange == ParallelRaysums::THETA_RANGE_UNCONSTRAINED)
+    m_pRadioBoxThetaRange->SetSelection (0);
+  else if (iDefaultThetaRange == ParallelRaysums::THETA_RANGE_NORMALIZE_TO_TWOPI)
+    m_pRadioBoxThetaRange->SetSelection (1);
+  else if (iDefaultThetaRange == ParallelRaysums::THETA_RANGE_FOLD_TO_PI)
+    m_pRadioBoxThetaRange->SetSelection (2);
+
+  pTopSizer->Add (m_pRadioBoxThetaRange, 0, wxALL | wxALIGN_CENTER);
+  
+  pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+  
+  wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
+  wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
+  pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+  wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+  pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+  CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_THETA_RANGE);
+  pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
+
+  pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
+  pButtonOk->SetDefault();
+  
+  SetAutoLayout (true);
+  SetSizer (pTopSizer);
+  pTopSizer->Fit (this);
+  pTopSizer->SetSizeHints (this);
+}
+
+int
+DialogGetThetaRange::getThetaRange()
+{
+  int iSelection = m_pRadioBoxThetaRange->GetSelection();
+  if (iSelection == 0)
+    return ParallelRaysums::THETA_RANGE_UNCONSTRAINED;
+  else if (iSelection == 1)
+    return ParallelRaysums::THETA_RANGE_NORMALIZE_TO_TWOPI;
+  else
+    return ParallelRaysums::THETA_RANGE_FOLD_TO_PI;
+}
+
+
 ///////////////////////////////////////////////////////////////////////
 // CLASS IMPLEMENTATION
 //    DialogGetComparisonImage