X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fthreadraster.h;fp=src%2Fthreadraster.h;h=b161c03abb84dfe57279e279af6e8f932e424eb7;hp=0000000000000000000000000000000000000000;hb=432ba2c487a5320352f14bdd2cce008fccef6902;hpb=f1e69bf8888b1462007c93c8d6bf3ae1e0ecec20 diff --git a/src/threadraster.h b/src/threadraster.h new file mode 100644 index 0000000..b161c03 --- /dev/null +++ b/src/threadraster.h @@ -0,0 +1,119 @@ +/***************************************************************************** +** FILE IDENTIFICATION +** +** Name: threadraster.h +** Purpose: Header file for threaded rasterizations +** Programmer: Kevin Rosenberg +** Date Started: February 2001 +** +** This is part of the CTSim program +** Copyright (C) 1983-2001 Kevin Rosenberg +** +** $Id: threadraster.h,v 1.1 2001/02/27 03:59:30 kevin Exp $ +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ + +#ifndef _THREADRASTER_H +#define _THREADRASTER_H + +#include +#include +#include +#include "timer.h" +#include "backgroundsupr.h" + + +class Reconstructor; +class ImageFile; +class PhantomFileDocument; +class RasterizerWorker; +class ImageFileView; + +class RasterizerSupervisorThread : public SupervisorThread { +private: + PhantomFileView* m_pPhantomView; + const int m_iNX; + const int m_iNY; + const int m_iNSample; + const double m_dViewRatio; + const std::string m_strLabel; + +public: + RasterizerSupervisorThread(PhantomFileView* pProjView, int iNX, int iNY, int iNSample, double dViewRatio, const char* const pszLabel); + + virtual wxThread::ExitCode Entry(); + + virtual void OnExit(); +}; + + + +class RasterizerSupervisor : public BackgroundSupervisor { +private: + + std::vector m_vecpChildImageFiles; + PhantomFileDocument* m_pPhantomDoc; + PhantomFileView* m_pPhantomView; + + const int m_iNX; + const int m_iNY; + const int m_iNSample; + const double m_dViewRatio; + const char* const m_pszLabel; + + +public: + RasterizerSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNX, int iNY, + int iNSample, double dViewRatio, const char* const pszLabel); + + virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits); + + virtual ~RasterizerSupervisor (); + + void onDone(); + + ImageFile* getImageFile(); + +}; + + + + +class RasterizerWorker : public BackgroundWorkerThread { +private: + PhantomFileView* m_pPhantomView; + ImageFile* m_pImageFile; + int m_iNX; + int m_iNY; + int m_iNSample; + double m_dViewRatio; + + +public: + RasterizerWorker (RasterizerSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews) + : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews) + {} + + void SetParameters (PhantomFileView* pPhantomFile, ImageFile* pImageFile, int iNX, int iY, + int iNSample, double dViewRatio); + + virtual wxThread::ExitCode Entry(); // thread execution starts here + + virtual void OnExit(); +}; + + +#endif +