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-2009 Kevin Rosenberg
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License (version 2) as
14 ** published by the Free Software Foundation.
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ** GNU General Public License for more details.
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ******************************************************************************/
26 #ifndef _THREADRASTER_H
27 #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 wxString m_strLabel;
54 RasterizerSupervisorThread(PhantomFileView* pProjView, int iNX, int iNY, int iNSample, double dViewRatio, wxChar const* strLabel);
56 virtual wxThread::ExitCode Entry();
57 virtual void OnExit();
62 class RasterizerSupervisor : public BackgroundSupervisor {
65 PhantomFileView* m_pPhantomView;
66 std::vector<ImageFile*> m_vecpChildImageFiles;
67 PhantomFileDocument* m_pPhantomDoc;
72 const double m_dViewRatio;
73 const wxString m_strLabel;
77 RasterizerSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNX, int iNY,
78 int iNSample, double dViewRatio, wxChar const* pszLabel);
80 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
82 virtual ~RasterizerSupervisor ();
86 ImageFile* getImageFile();
93 class RasterizerWorker : public BackgroundWorkerThread {
95 PhantomFileView* m_pPhantomView;
96 ImageFile* m_pImageFile;
104 RasterizerWorker (RasterizerSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
105 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
108 void SetParameters (PhantomFileView* pPhantomFile, ImageFile* pImageFile, int iNX, int iY,
109 int iNSample, double dViewRatio);
111 virtual wxThread::ExitCode Entry(); // thread execution starts here
113 virtual void OnExit();
116 #endif // HAVE_WXTHREADS
117 #endif // _THREADRASTER_H_