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.4 2001/03/05 20:29:23 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
34 #include <wx/thread.h>
35 #include <wx/progdlg.h>
37 #include "backgroundsupr.h"
42 class PhantomFileDocument;
43 class RasterizerWorker;
46 class RasterizerSupervisorThread : public SupervisorThread {
48 PhantomFileView* m_pPhantomView;
52 const double m_dViewRatio;
53 const std::string m_strLabel;
56 RasterizerSupervisorThread(PhantomFileView* pProjView, int iNX, int iNY, int iNSample, double dViewRatio, const char* const pszLabel);
58 virtual wxThread::ExitCode Entry();
59 virtual void OnExit();
64 class RasterizerSupervisor : public BackgroundSupervisor {
67 PhantomFileView* m_pPhantomView;
68 std::vector<ImageFile*> m_vecpChildImageFiles;
69 PhantomFileDocument* m_pPhantomDoc;
74 const double m_dViewRatio;
75 const char* const m_pszLabel;
79 RasterizerSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNX, int iNY,
80 int iNSample, double dViewRatio, const char* const pszLabel);
82 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
84 virtual ~RasterizerSupervisor ();
88 ImageFile* getImageFile();
95 class RasterizerWorker : public BackgroundWorkerThread {
97 PhantomFileView* m_pPhantomView;
98 ImageFile* m_pImageFile;
106 RasterizerWorker (RasterizerSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
107 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
110 void SetParameters (PhantomFileView* pPhantomFile, ImageFile* pImageFile, int iNX, int iY,
111 int iNSample, double dViewRatio);
113 virtual wxThread::ExitCode Entry(); // thread execution starts here
115 virtual void OnExit();
118 #endif // HAVE_WXTHREADS
119 #endif // _THREADRASTER_H_