1 /*****************************************************************************
5 ** Purpose: Header file for thread reconstructions
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: February 2001
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2001 Kevin Rosenberg
12 ** $Id: threadproj.h,v 1.2 2001/02/25 15:27:28 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 ******************************************************************************/
32 #include <wx/thread.h>
33 #include <wx/progdlg.h>
35 #include "backgroundsupr.h"
40 class PhantomFileDocument;
41 class ProjectorWorker;
42 class ProjectionFileView;
44 class ProjectorSupervisorThread : public SupervisorThread {
46 PhantomFileView* m_pPhantomView;
49 const std::string m_strGeometry;
51 const double m_dRotation;
52 const double m_dFocalLength;
53 const double m_dViewRatio;
54 const double m_dScanRatio;
55 const std::string m_strLabel;
58 ProjectorSupervisorThread(PhantomFileView* pProjView, int iNDet, int iNView,
59 const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dViewRatio,
60 double dScanRatio, const char* const pszLabel);
62 virtual wxThread::ExitCode Entry();
64 virtual void OnExit();
69 class ProjectorSupervisor : public BackgroundSupervisor {
72 std::vector<Projections*> m_vecpChildProjections;
73 PhantomFileDocument* m_pPhantomDoc;
74 PhantomFileView* m_pPhantomView;
79 const char* const m_pszGeometry;
81 const double m_dRotation;
82 const double m_dFocalLength;
83 const double m_dViewRatio;
84 const double m_dScanRatio;
85 const char* const m_pszLabel;
89 ProjectorSupervisor (PhantomFileView* pProjView, int iNDet, int iNView,
90 const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dViewRatio,
91 double dScanRatio, const char* const pszLabel);
93 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
95 virtual ~ProjectorSupervisor ();
99 Projections* getProjections();
106 class ProjectorWorker : public BackgroundWorkerThread {
108 PhantomFileView* m_pPhantomView;
109 Projections* m_pProjections;
113 const char* m_pszGeometry;
116 double m_dFocalLength;
122 ProjectorWorker (ProjectorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
123 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
126 void SetParameters (PhantomFileView* pPhantomFile, Projections* pProjections, Scanner* pScanner,
127 int iNDet, int iView,
128 const char* const pszGeometry, int iNSample, double dRotation, double dFocalLength, double dViewRatio,
131 virtual wxThread::ExitCode Entry(); // thread execution starts here
133 virtual void OnExit();