1 /*****************************************************************************
4 ** Name: dlgprojections.h
5 ** Purpose: Headers for Projection Collection 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 __DLGPROJECTIONS_H_
27 #define __DLGPROJECTIONS_H_
30 #include "wx/dialog.h"
31 #include "wx/dcmemory.h"
41 class ProjectionsDialog : public wxDialog
43 DECLARE_DYNAMIC_CLASS(ProjectionsDialog)
46 ProjectionsDialog (Scanner& rScanner, Projections& rProj, const Phantom& rPhantom, const int iTrace, wxWindow *parent);
50 /* Perform projection on view number
51 return true if ABORT button has not been pressed
53 bool projectView(int iViewNumber);
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
83 Projections& m_rProjections;
84 const Phantom& m_rPhantom;
85 SGPDriver* m_pSGPDriver;
90 wxButton *m_btnAbort; // the abort button (or NULL if none)
94 wxMemoryDC m_memoryDC; // for restoring image on OnPaint
97 // continue processing or not (return value for Update())
100 Uncancellable = -1, // dialog can't be canceled
102 Cancelled, // can be cancelled and, in fact, was
103 Continue, // can be cancelled but wasn't
104 Finished // finished, waiting to be removed from screen
107 enum { ID_BTN_PAUSE = 19996, ID_BTN_STEP = 19997 };
109 void showView (int iViewNumber);
111 DECLARE_EVENT_TABLE()