440d2ff2ceaf744759017ca387757b46060dd43c
[ctsim.git] / src / dlgprojections.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          dlgprojections.h
5 **   Purpose:       Headers for Projection Collection Animation Dialog
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  August 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: dlgprojections.h,v 1.1 2000/08/27 20:32:55 kevin Exp $
13 **
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.
17 **
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.
22 **
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 ******************************************************************************/
27
28 #ifndef __DLGPROJECTIONS_H_
29 #define __DLGPROJECTIONS_H_
30
31 #ifdef __GNUG__
32 #pragma interface "dlgprojections.h"
33 #endif
34
35 #include "wx/setup.h"
36 #include "wx/dialog.h"
37
38 class wxButton;
39 class wxStaticText;
40 class Projections;
41 class Phantom;
42 class SGP;
43 class Scanner;
44 class SGP;
45 class SGPDriver;
46
47 class ProjectionsDialog : public wxDialog
48 {
49   DECLARE_DYNAMIC_CLASS(ProjectionsDialog)
50
51 public:
52   ProjectionsDialog (Scanner& rScanner, Projections& rProj, const Phantom& rPhantom, const int iTrace, wxWindow *parent);
53
54    ~ProjectionsDialog();
55
56    /* Perform projection on view number
57        return true if ABORT button has not been pressed
58    */
59    bool projectView(int iViewNumber);
60
61    /* Can be called to continue after the cancel button has been pressed, but
62        the program decided to continue the operation (e.g., user didn't
63        confirm it)
64    */
65    void Resume() { m_state = Continue; }
66
67    // implementation from now on
68        // callback for optional abort button
69    void OnCancel(wxCommandEvent& event);
70        // callback to disable "hard" window closing
71    void OnClose(wxCloseEvent& event);
72
73 private:
74    // parent top level window (may be NULL)
75    wxWindow *m_parentTop;
76
77    // continue processing or not (return value for Update())
78    enum
79    {
80       Uncancelable = -1,   // dialog can't be canceled
81       Canceled,            // can be cancelled and, in fact, was
82       Continue,            // can be cancelled but wasn't
83       Finished             // finished, waiting to be removed from screen
84    } m_state;
85
86    // the abort button (or NULL if none)
87    wxButton *m_btnAbort;
88
89    Scanner& m_rScanner;
90    Projections& m_rProjections;
91    const Phantom& m_rPhantom;
92    SGPDriver* m_pSGPDriver;
93    SGP* m_pSGP;
94    const int m_iTrace;
95    wxDC* m_pDC;
96
97    DECLARE_EVENT_TABLE()
98 };
99 #endif
100