1 /*****************************************************************************
4 ** Name: threadraster.h
5 ** Purpose: Header file for threaded rasterizations
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: threadraster.h,v 1.1 2001/02/27 03:59:30 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 _THREADRASTER_H
29 #define _THREADRASTER_H
32 #include <wx/thread.h>
33 #include <wx/progdlg.h>
35 #include "backgroundsupr.h"
40 class PhantomFileDocument;
41 class RasterizerWorker;
44 class RasterizerSupervisorThread : public SupervisorThread {
46 PhantomFileView* m_pPhantomView;
50 const double m_dViewRatio;
51 const std::string m_strLabel;
54 RasterizerSupervisorThread(PhantomFileView* pProjView, int iNX, int iNY, int iNSample, double dViewRatio, const char* const pszLabel);
56 virtual wxThread::ExitCode Entry();
58 virtual void OnExit();
63 class RasterizerSupervisor : public BackgroundSupervisor {
66 std::vector<ImageFile*> m_vecpChildImageFiles;
67 PhantomFileDocument* m_pPhantomDoc;
68 PhantomFileView* m_pPhantomView;
73 const double m_dViewRatio;
74 const char* const m_pszLabel;
78 RasterizerSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNX, int iNY,
79 int iNSample, double dViewRatio, const char* const pszLabel);
81 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
83 virtual ~RasterizerSupervisor ();
87 ImageFile* getImageFile();
94 class RasterizerWorker : public BackgroundWorkerThread {
96 PhantomFileView* m_pPhantomView;
97 ImageFile* m_pImageFile;
105 RasterizerWorker (RasterizerSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
106 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
109 void SetParameters (PhantomFileView* pPhantomFile, ImageFile* pImageFile, int iNX, int iY,
110 int iNSample, double dViewRatio);
112 virtual wxThread::ExitCode Entry(); // thread execution starts here
114 virtual void OnExit();