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-2000 Kevin Rosenberg
12 ** $Id: dlgprojections.h,v 1.4 2000/12/16 03:29:02 kevin Exp $
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.
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.
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 ******************************************************************************/
28 #ifndef __DLGPROJECTIONS_H_
29 #define __DLGPROJECTIONS_H_
32 #pragma interface "dlgprojections.h"
36 #include "wx/dialog.h"
37 #include "wx/dcmemory.h"
48 class ProjectionsDialog : public wxDialog
50 DECLARE_DYNAMIC_CLASS(ProjectionsDialog)
53 ProjectionsDialog (Scanner& rScanner, Projections& rProj, const Phantom& rPhantom, const int iTrace, wxWindow *parent);
57 /* Perform projection on view number
58 return true if ABORT button has not been pressed
60 bool projectView(int iViewNumber);
62 /* Can be called to continue after the cancel button has been pressed, but
63 the program decided to continue the operation (e.g., user didn't
66 void Resume() { m_state = Continue; }
68 // implementation from now on
69 // callback for optional abort button
70 void OnCancel(wxCommandEvent& event);
71 // callback to disable "hard" window closing
72 void OnClose(wxCloseEvent& event);
73 void OnPaint(wxPaintEvent& event);
75 void OnPause(wxCommandEvent& event);
76 void OnStep(wxCommandEvent& event);
78 bool isPaused() const {return m_state == Paused;}
80 bool isCancelled() const {return m_state == Cancelled;}
83 // parent top level window (may be NULL)
84 wxWindow *m_parentTop;
86 int m_iClientX; // size of client window
90 Projections& m_rProjections;
91 const Phantom& m_rPhantom;
92 SGPDriver* m_pSGPDriver;
97 wxButton *m_btnAbort; // the abort button (or NULL if none)
101 wxMemoryDC m_memoryDC; // for restoring image on OnPaint
104 // continue processing or not (return value for Update())
107 Uncancellable = -1, // dialog can't be canceled
109 Cancelled, // can be cancelled and, in fact, was
110 Continue, // can be cancelled but wasn't
111 Finished // finished, waiting to be removed from screen
114 enum { ID_BTN_PAUSE = 19996, ID_BTN_STEP = 19997 };
116 void showView (int iViewNumber);
118 DECLARE_EVENT_TABLE()