1 /*****************************************************************************
4 ** Name: dlgreconstruct.h
5 ** Purpose: Headers for Reconstruction Animation Dialog
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: August 2000
9 ** This is part of the CTSim program
10 ** Copyright (c) 1983-2009 Kevin Rosenberg
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License (version 2) as
14 ** published by the Free Software Foundation.
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ** GNU General Public License for more details.
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ******************************************************************************/
26 #ifndef __DLGRECONSTRUCT_H_
27 #define __DLGRECONSTRUCT_H_
30 #include "wx/dialog.h"
31 #include "wx/dcmemory.h"
41 class ReconstructDialog : public wxDialog
43 DECLARE_DYNAMIC_CLASS(ReconstructDialog)
46 ReconstructDialog (Reconstructor& rReconstruct, const Projections& rProj, ImageFile& rIF, const int iTrace, wxWindow *parent);
50 /* Perform projection on view number
51 return true if ABORT button has not been pressed
53 bool reconstructView (int iViewNumber, bool bBackproject = true);
55 /* Can be called to continue after the cancel button has been pressed, but
56 the program decided to continue the operation (e.g., user didn't
59 void Resume() { m_state = Continue; }
61 // implementation from now on
62 // callback for optional abort button
63 void OnCancel(wxCommandEvent& event);
64 // callback to disable "hard" window closing
65 void OnClose(wxCloseEvent& event);
66 void OnPaint(wxPaintEvent& event);
68 void OnPause(wxCommandEvent& event);
69 void OnStep(wxCommandEvent& event);
71 bool isPaused() const {return m_state == Paused;}
73 bool isCancelled() const {return m_state == Cancelled;}
76 // parent top level window (may be NULL)
77 wxWindow *m_parentTop;
79 int m_iClientX; // size of client window
82 Reconstructor& m_rReconstructor;
83 const Projections& m_rProjections;
84 ImageFile& m_rImageFile;
85 SGPDriver* m_pSGPDriver;
90 wxButton *m_btnAbort; // the abort button (or NULL if none)
94 wxMemoryDC m_memoryDC; // for restoring image on OnPaint
102 // continue processing or not (return value for Update())
105 Uncancellable = -1, // dialog can't be canceled
107 Cancelled, // can be cancelled and, in fact, was
108 Continue, // can be cancelled but wasn't
109 Finished // finished, waiting to be removed from screen
112 const static int ID_BTN_PAUSE;
113 const static int ID_BTN_STEP;
114 const static int MAX_IMAGE_X;
115 const static int MAX_IMAGE_Y;
117 void showView (int iViewNumber, bool bBackprojectView = true);
119 DECLARE_EVENT_TABLE()