From: Kevin M. Rosenberg Date: Fri, 2 Mar 2001 21:11:50 +0000 (+0000) Subject: r598: no message X-Git-Tag: debian-4.5.3-3~419 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=52f2fdc3424cd6b5b77ad1497243e1e06739ffe6 r598: no message --- diff --git a/INSTALL b/INSTALL index 265ecce..ca3c6a9 100644 --- a/INSTALL +++ b/INSTALL @@ -20,10 +20,8 @@ wxWindows (http://www.wxwindows.org) Used by CTSim (src/*) graphic front-end. Platform independent for GTK, Motif, and Windows32 API's. -g2 (http://g2.sourceforge.net) - Currently, used partially by SGP (Simple Graphics Package) for - graphical display by command-line tools (tools/*). This library - will likely be deprecated in favor of wxWindows. +ctn (http://www.erl.wustl.edu/DICOM/ctn.html) + Used by CTSim for DICOM file import and export lam (http://www.mpi.nd.edu/lam/) There is support is MPI clustering. I use this code at home for my diff --git a/doc/ctsim-install.tex b/doc/ctsim-install.tex index b0cd92f..f8b319a 100644 --- a/doc/ctsim-install.tex +++ b/doc/ctsim-install.tex @@ -66,4 +66,8 @@ However, they add functionality to \ctsim\ and there inclusion is recommended. Used for debugging memory allocation.\\ \urlref{Web site}{http://www.dmalloc.com} + \item \textbf{ctn}\\ + DICOM library used to support import/export of DICOM files + \urlref{Web site}{http://www.erl.wustl.edu/DICOM/ctn.html} + \end{itemize} diff --git a/doc/ctsim.prj b/doc/ctsim.prj index e2ee8a5..e7dbe76 100644 --- a/doc/ctsim.prj +++ b/doc/ctsim.prj @@ -5,8 +5,8 @@ 1 ctsim.tex 21 +4 3 -1 ctsim-algorithms.tex @@ -14,19 +14,19 @@ TeX 4091 0 65 52 0 43 44 44 960 631 ctsim-concepts.tex TeX -268447738 0 302 40 280 44 110 110 1187 697 +12282 0 302 40 280 44 110 110 1187 697 ctsim.tex TeX -134230010 2 50 12 50 22 22 22 1099 609 +134230010 0 50 12 33 1 22 22 1099 609 +ctsim-install.tex +TeX +268447738 0 70 62 71 1 110 110 1187 697 tex2rtf.ini DATA 273777330 0 0 1 26 8 22 22 938 609 ctsim-gui.tex TeX 268447738 0 145 21 144 1 176 176 1253 763 -ctsim-install.tex -TeX -268447738 1 0 1 4 1 110 110 1187 697 psbox.tex TeX 268439546 0 0 1 0 1 88 88 1004 675 diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 42b38df..ba3cdb4 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -3,63 +3,30 @@
 

Build Log

---------------------Configuration: libctsim - Win32 Debug-------------------- +--------------------Configuration: ctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB5.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9D.tmp" with contents [ -/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /I "\dicom\ctn\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c -"C:\ctsim\libctsim\ctndicom.cpp" -"C:\ctsim\libctsim\projections.cpp" +/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"D:\ctsim\src\backgroundmgr.cpp" +"D:\ctsim\src\backgroundsupr.cpp" +"D:\ctsim\src\graph3dview.cpp" +"D:\ctsim\src\threadproj.cpp" +"D:\ctsim\src\threadraster.cpp" +"D:\ctsim\src\threadrecon.cpp" ] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB5.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB6.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9D.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9E.tmp" with contents [ -/nologo /out:"Debug\libctsim.lib" -.\Debug\array2dfile.obj -.\Debug\backprojectors.obj -.\Debug\clip.obj -.\Debug\consoleio.obj -.\Debug\ctndicom.obj -.\Debug\dlgezplot.obj -.\Debug\ezplot.obj -.\Debug\ezset.obj -.\Debug\ezsupport.obj -.\Debug\filter.obj -.\Debug\fnetorderstream.obj -.\Debug\fourier.obj -.\Debug\getopt.obj -.\Debug\getopt1.obj -.\Debug\globalvars.obj -.\Debug\hashtable.obj -.\Debug\imagefile.obj -.\Debug\interpolator.obj -.\Debug\mathfuncs.obj -.\Debug\phantom.obj -.\Debug\plotfile.obj -.\Debug\pol.obj -.\Debug\procsignal.obj -.\Debug\projections.obj -.\Debug\reconstruct.obj -.\Debug\scanner.obj -.\Debug\sgp.obj -.\Debug\strfuncs.obj -.\Debug\syserror.obj -.\Debug\trace.obj -.\Debug\transformmatrix.obj -.\Debug\xform.obj +/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"D:\ctsim\src\ctsim.cpp" +"D:\ctsim\src\dialogs.cpp" +"D:\ctsim\src\docs.cpp" +"D:\ctsim\src\views.cpp" ] -Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB6.tmp" -

Output Window

-Compiling... -ctndicom.cpp -projections.cpp -Creating library... -

---------------------Configuration: ctsim - Win32 Debug-------------------- -

-

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB7.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9E.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9F.tmp" with contents [ winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib ctn_lib.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Debug" .\Debug\backgroundmgr.obj @@ -86,8 +53,20 @@ winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\.. \wx2.2.5\lib\zlibd.lib \wx2.2.5\lib\tiffd.lib ] -Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB7.tmp" +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9F.tmp"

Output Window

+Compiling... +backgroundsupr.cpp +threadproj.cpp +threadraster.cpp +threadrecon.cpp +backgroundmgr.cpp +graph3dview.cpp +Compiling... +ctsim.cpp +dialogs.cpp +docs.cpp +views.cpp Linking... diff --git a/src/backgroundsupr.cpp b/src/backgroundsupr.cpp index 3b2f362..09560c4 100644 --- a/src/backgroundsupr.cpp +++ b/src/backgroundsupr.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundsupr.cpp,v 1.9 2001/02/27 03:59:30 kevin Exp $ +** $Id: backgroundsupr.cpp,v 1.10 2001/03/02 21:11:50 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 @@ -38,10 +38,7 @@ #include "backgroundsupr.h" #include "backgroundmgr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif - +#ifdef HAVE_WXTHREADS //////////////////////////////////////////////////////////////////////////// // @@ -68,7 +65,7 @@ BackgroundSupervisor::cancelSupervisor (BackgroundSupervisor* pSupervisor) BackgroundSupervisor::BackgroundSupervisor (SupervisorThread* pMyThread, wxFrame* pParentFrame, wxDocument* pDocument, const char* const pszProcessTitle, int iTotalUnits) - : m_pMyThread(pMyThread), m_pParentFrame(pParentFrame), m_pDocument(pDocument), m_pDialogProgress(NULL), m_strProcessTitle(pszProcessTitle), + : m_pMyThread(pMyThread), m_pParentFrame(pParentFrame), m_pDocument(pDocument), m_strProcessTitle(pszProcessTitle), m_iTotalUnits(iTotalUnits), m_iNumThreads(0), m_bDone(false), m_bFail(false), m_bCancelled(false), m_pTimer(NULL), m_bBackgroundTaskAdded(false), m_bWorkersDeleted(false), wxEvtHandler() @@ -97,7 +94,6 @@ BackgroundSupervisor::~BackgroundSupervisor() } delete m_pTimer; - delete m_pDialogProgress; } void @@ -149,21 +145,16 @@ BackgroundSupervisor::start() m_pTimer = new Timer; - if (! theApp->getUseBackgroundTasks()) - m_pDialogProgress = new wxProgressDialog (_T("Filtered Backprojection"), _T("Reconstruction Progress"), - m_iTotalUnits, m_pParentFrame, wxPD_CAN_ABORT | wxPD_AUTO_HIDE); - else { - std::string strLabel (m_strProcessTitle); - strLabel += " "; - strLabel += m_pParentFrame->GetTitle(); - wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_ADD); - addTaskEvent.SetString (strLabel.c_str()); - addTaskEvent.SetInt (m_iTotalUnits); - addTaskEvent.SetClientData (this); - wxPostEvent (theApp->getBackgroundManager(), addTaskEvent); - wxPostEvent (m_pDocument, addTaskEvent); - m_bBackgroundTaskAdded = true; - } + std::string strLabel (m_strProcessTitle); + strLabel += " "; + strLabel += m_pParentFrame->GetTitle(); + wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_ADD); + addTaskEvent.SetString (strLabel.c_str()); + addTaskEvent.SetInt (m_iTotalUnits); + addTaskEvent.SetClientData (this); + wxPostEvent (theApp->getBackgroundManager(), addTaskEvent); + wxPostEvent (m_pDocument, addTaskEvent); + m_bBackgroundTaskAdded = true; m_iRunning = m_iNumThreads; m_iUnitsDone = 0; @@ -198,17 +189,10 @@ BackgroundSupervisor::OnWorkerUnitTick (wxCommandEvent& event) *theApp->getLog() << "Units done: " << static_cast(m_iUnitsDone) <<"\n"; #endif - if (m_pDialogProgress) { - if (! m_pDialogProgress->Update (m_iUnitsDone - 1)) { - wxCommandEvent dummy; - OnCancel (dummy); - } - } else { - wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_UNIT_TICK); - addTaskEvent.SetInt (m_iUnitsDone - 1); - addTaskEvent.SetClientData (this); - wxPostEvent (theApp->getBackgroundManager(), addTaskEvent); - } + wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_UNIT_TICK); + addTaskEvent.SetInt (m_iUnitsDone - 1); + addTaskEvent.SetClientData (this); + wxPostEvent (theApp->getBackgroundManager(), addTaskEvent); } void @@ -244,3 +228,4 @@ BackgroundSupervisor::OnWorkerFail (wxCommandEvent& event) OnCancel(dummy); } +#endif // HAVE_WXTHREADS diff --git a/src/backgroundsupr.h b/src/backgroundsupr.h index b77b997..3e170b7 100644 --- a/src/backgroundsupr.h +++ b/src/backgroundsupr.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundsupr.h,v 1.5 2001/02/26 17:36:56 kevin Exp $ +** $Id: backgroundsupr.h,v 1.6 2001/03/02 21:11:50 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 @@ -58,8 +58,7 @@ private: wxFrame* m_pParentFrame; wxDocument* m_pDocument; const std::string m_strProcessTitle; - wxProgressDialog* m_pDialogProgress; - + volatile bool m_bFail; std::string m_strFailMessage; int m_iNumThreads; diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 3449d48..26a57b3 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.91 2001/03/02 02:08:14 kevin Exp $ +** $Id: ctsim.cpp,v 1.92 2001/03/02 21:11:50 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 @@ -69,7 +69,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.91 2001/03/02 02:08:14 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.92 2001/03/02 21:11:50 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -453,12 +453,12 @@ MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const m_dDefaultFilterOutputScale = 1.; m_iDefaultImportFormat = ImageFile::IMPORT_FORMAT_PPM; - wxAcceleratorEntry accelEntries[16]; + wxAcceleratorEntry accelEntries[15]; accelEntries[0].Set (wxACCEL_CTRL, static_cast('O'), wxID_OPEN); - accelEntries[2].Set (wxACCEL_CTRL, static_cast('P'), MAINMENU_FILE_CREATE_PHANTOM); - accelEntries[3].Set (wxACCEL_CTRL, static_cast('F'), MAINMENU_FILE_CREATE_FILTER); - accelEntries[4].Set (wxACCEL_CTRL, static_cast('I'), MAINMENU_IMPORT); - accelEntries[5].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS); + accelEntries[1].Set (wxACCEL_CTRL, static_cast('P'), MAINMENU_FILE_CREATE_PHANTOM); + accelEntries[2].Set (wxACCEL_CTRL, static_cast('F'), MAINMENU_FILE_CREATE_FILTER); + accelEntries[3].Set (wxACCEL_CTRL, static_cast('I'), MAINMENU_IMPORT); + accelEntries[4].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS); #ifndef CTSIM_MDI for (i = 0; i < 10; i++) accelEntries[i+5].Set (wxACCEL_CTRL, static_cast('0'+i), MAINMENU_WINDOW_BASE+i); diff --git a/src/ctsim.h b/src/ctsim.h index e80bbb7..abc16fd 100644 --- a/src/ctsim.h +++ b/src/ctsim.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctsim.h,v 1.53 2001/03/01 20:02:18 kevin Exp $ +** $Id: ctsim.h,v 1.54 2001/03/02 21:11:50 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 @@ -35,6 +35,12 @@ #include #endif +#ifdef MSVC +#define HAVE_WXTHREADS 1 +#else +#undef HAVE_WXTHREADS +#endif + #ifndef WX_PRECOMP #include "wx/wx.h" #endif diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 42fe44d..8ecf945 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: dialogs.cpp,v 1.45 2001/03/01 20:02:18 kevin Exp $ +** $Id: dialogs.cpp,v 1.46 2001/03/02 21:11:50 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 @@ -244,7 +244,9 @@ DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTi m_pCBUseBackgroundTasks = new wxCheckBox (this, -1, "Put Tasks in Background", wxDefaultPosition, wxSize(250, 25), 0); m_pCBUseBackgroundTasks->SetValue (bUseBackgroundTasks); +#ifdef HAVE_WXTHREADS pTopSizer->Add (m_pCBUseBackgroundTasks, 0, wxALIGN_CENTER_VERTICAL); +#endif pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); diff --git a/src/threadproj.cpp b/src/threadproj.cpp index c4fa9ae..6421656 100644 --- a/src/threadproj.cpp +++ b/src/threadproj.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadproj.cpp,v 1.6 2001/03/01 07:30:49 kevin Exp $ +** $Id: threadproj.cpp,v 1.7 2001/03/02 21:11:50 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 @@ -31,6 +31,10 @@ #include "wx/wx.h" #endif +#if defined(HAVE_CONFIG_H) +#include "config.h" +#endif + #include "ct.h" #include "ctsim.h" #include "docs.h" @@ -39,9 +43,8 @@ #include "backgroundmgr.h" #include "backgroundsupr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif +#ifdef HAVE_WXTHREADS + @@ -150,16 +153,15 @@ ProjectorSupervisor::onDone() wxCriticalSection doneSection; wxCriticalSectionLocker critsect (doneSection); + Projections* pProjections = getProjections(); + + wxMutexGuiEnter(); ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc(); if (! pProjDoc) { sys_error (ERR_SEVERE, "Unable to create projection file"); return; - } - - Projections* pProjections = getProjections(); + } pProjDoc->setProjections (pProjections); - if (theApp->getAskDeleteNewDocs()) - pProjDoc->Modify (true); pProjDoc->UpdateAllViews (NULL); if (ProjectionFileView* projView = pProjDoc->getView()) { projView->OnUpdate (projView, NULL); @@ -167,6 +169,10 @@ ProjectorSupervisor::onDone() projView->getFrame()->Show(true); } *theApp->getLog() << m_pszLabel << "\n"; + wxMutexGuiLeave(); + + if (theApp->getAskDeleteNewDocs()) + pProjDoc->Modify (true); pProjections->setRemark (m_pszLabel); pProjections->setCalcTime (getTimerEnd()); @@ -274,3 +280,5 @@ void ProjectorWorker::OnExit () { } + +#endif // HAVE_WXTHREADS diff --git a/src/threadproj.h b/src/threadproj.h index 80ac09e..f76339e 100644 --- a/src/threadproj.h +++ b/src/threadproj.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadproj.h,v 1.4 2001/03/01 07:30:49 kevin Exp $ +** $Id: threadproj.h,v 1.5 2001/03/02 21:11:50 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 @@ -28,6 +28,8 @@ #ifndef _THREADPROJ_H #define _THREADPROJ_H +#ifdef HAVE_WXTHREADS + #include #include #include @@ -137,5 +139,6 @@ public: }; -#endif +#endif // HAVE_WXTHREADS +#endif // _THREADPROJ_H_ diff --git a/src/threadraster.cpp b/src/threadraster.cpp index 00f89dc..252d6c5 100644 --- a/src/threadraster.cpp +++ b/src/threadraster.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadraster.cpp,v 1.1 2001/02/27 03:59:30 kevin Exp $ +** $Id: threadraster.cpp,v 1.2 2001/03/02 21:11:50 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 @@ -25,6 +25,11 @@ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ + +#if defined(HAVE_CONFIG_H) +#include "config.h" +#endif + #include "wx/wxprec.h" #ifndef WX_PRECOMP @@ -35,15 +40,15 @@ #include "ctsim.h" #include "docs.h" #include "views.h" + + +#ifdef HAVE_WXTHREADS + + #include "threadraster.h" #include "backgroundmgr.h" #include "backgroundsupr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif - - ///////////////////////////////////////////////////////////////////// // @@ -135,16 +140,15 @@ RasterizerSupervisor::onDone() wxCriticalSection doneSection; wxCriticalSectionLocker critsect (doneSection); + ImageFile* pImageFile = getImageFile(); + + wxMutexGuiEnter(); ImageFileDocument* pImageDoc = theApp->newImageDoc(); if (! pImageDoc) { sys_error (ERR_SEVERE, "Unable to create image file"); return; - } - - ImageFile* pImageFile = getImageFile(); + } pImageDoc->setImageFile (pImageFile); - if (theApp->getAskDeleteNewDocs()) - pImageDoc->Modify (true); pImageDoc->UpdateAllViews (NULL); if (ImageFileView* imageView = pImageDoc->getView()) { imageView->OnUpdate (imageView, NULL); @@ -152,7 +156,10 @@ RasterizerSupervisor::onDone() imageView->getFrame()->Show(true); } *theApp->getLog() << m_pszLabel << "\n"; + wxMutexGuiLeave(); pImageFile->labelAdd (m_pszLabel, getTimerEnd()); + if (theApp->getAskDeleteNewDocs()) + pImageDoc->Modify (true); setDone(); } @@ -230,3 +237,5 @@ void RasterizerWorker::OnExit () { } + +#endif // HAVE_WXTHREADS diff --git a/src/threadraster.h b/src/threadraster.h index b161c03..2644a45 100644 --- a/src/threadraster.h +++ b/src/threadraster.h @@ -9,7 +9,7 @@ ** 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 $ +** $Id: threadraster.h,v 1.2 2001/03/02 21:11:50 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 @@ -28,6 +28,8 @@ #ifndef _THREADRASTER_H #define _THREADRASTER_H +#ifdef HAVE_WXTHREADS + #include #include #include @@ -114,6 +116,6 @@ public: virtual void OnExit(); }; - -#endif +#endif // HAVE_WXTHREADS +#endif // _THREADRASTER_H_ diff --git a/src/threadrecon.cpp b/src/threadrecon.cpp index 2cd9dd1..c075fb4 100644 --- a/src/threadrecon.cpp +++ b/src/threadrecon.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadrecon.cpp,v 1.14 2001/02/27 03:59:30 kevin Exp $ +** $Id: threadrecon.cpp,v 1.15 2001/03/02 21:11:50 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 @@ -25,6 +25,7 @@ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ + #include "wx/wxprec.h" #ifndef WX_PRECOMP @@ -39,9 +40,8 @@ #include "backgroundmgr.h" #include "backgroundsupr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif +#ifdef HAVE_WXTHREADS + @@ -147,16 +147,15 @@ ReconstructorSupervisor::onDone() wxCriticalSection doneSection; wxCriticalSectionLocker critsect (doneSection); + ImageFile* pImageFile = getImageFile(); + + wxMutexGuiEnter(); ImageFileDocument* pReconDoc = theApp->newImageDoc(); if (! pReconDoc) { sys_error (ERR_SEVERE, "Unable to create image file"); return; - } - - ImageFile* pImageFile = getImageFile(); + } pReconDoc->setImageFile (pImageFile); - if (theApp->getAskDeleteNewDocs()) - pReconDoc->Modify (true); pReconDoc->UpdateAllViews (m_pProjView); if (ImageFileView* rasterView = pReconDoc->getView()) { rasterView->OnUpdate (rasterView, NULL); @@ -164,6 +163,10 @@ ReconstructorSupervisor::onDone() rasterView->getFrame()->Show(true); } *theApp->getLog() << m_pszLabel << "\n"; + wxMutexGuiLeave(); + + if (theApp->getAskDeleteNewDocs()) + pReconDoc->Modify (true); pImageFile->labelAdd (m_pProjView->GetDocument()->getProjections().getLabel()); pImageFile->labelAdd (m_pszLabel, getTimerEnd()); @@ -274,3 +277,5 @@ void ReconstructorWorker::OnExit () { } + +#endif // HAVE_WXTHREADS diff --git a/src/threadrecon.h b/src/threadrecon.h index 97b36f4..f8d2940 100644 --- a/src/threadrecon.h +++ b/src/threadrecon.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadrecon.h,v 1.10 2001/02/25 19:24:01 kevin Exp $ +** $Id: threadrecon.h,v 1.11 2001/03/02 21:11:50 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 @@ -28,6 +28,9 @@ #ifndef _THREADRECON_H #define _THREADRECON_H +#ifdef HAVE_WXTHREADS + + #include #include #include @@ -135,6 +138,6 @@ public: virtual void OnExit(); }; - -#endif +#endif // HAVE_WXTHREADS +#endif // _THREADRECON_H_ diff --git a/src/views.cpp b/src/views.cpp index b784421..5a802c4 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.124 2001/03/02 20:20:09 kevin Exp $ +** $Id: views.cpp,v 1.125 2001/03/02 21:11:50 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 @@ -1948,6 +1948,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event) } } } else { +#if HAVE_WXTHREADS if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { ProjectorSupervisorThread* pProjector = new ProjectorSupervisorThread (this, m_iDefaultNDet, m_iDefaultNView, sGeometry.c_str(), m_iDefaultNSample, dRotationRadians, @@ -1960,7 +1961,9 @@ PhantomFileView::OnProjections (wxCommandEvent& event) pProjector->SetPriority(60); pProjector->Run(); return; - } else { + } else +#endif // HAVE_WXTHREADS + { pProj = new Projections; pProj->initFromScanner (theScanner); wxProgressDialog dlgProgress (wxString("Projection"), wxString("Projection Progress"), pProj->nView() + 1, getFrameForChild(), wxPD_CAN_ABORT ); @@ -2028,6 +2031,7 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) << m_iDefaultRasterNY << ", ViewRatio=" << m_dDefaultRasterViewRatio << ", nSamples=" << m_iDefaultRasterNSamples;; +#if HAVE_WXTHREADS if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { RasterizerSupervisorThread* pThread = new RasterizerSupervisorThread (this, m_iDefaultRasterNX, m_iDefaultRasterNY, m_iDefaultRasterNSamples, m_dDefaultRasterViewRatio, os.str().c_str()); @@ -2037,7 +2041,9 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) } pThread->SetPriority (60); pThread->Run(); - } else { + } else +#endif + { ImageFile* pImageFile = new ImageFile (m_iDefaultRasterNX, m_iDefaultRasterNY); wxProgressDialog dlgProgress (wxString("Rasterize"), wxString("Rasterization Progress"), pImageFile->nx() + 1, getFrameForChild(), wxPD_CAN_ABORT ); @@ -2465,6 +2471,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) delete pDlgReconstruct; delete pReconstructor; } else { +#if HAVE_WXTHREADS if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { ReconstructorSupervisorThread* pReconstructor = new ReconstructorSupervisorThread (this, m_iDefaultNX, m_iDefaultNY, optFilterName.c_str(), @@ -2478,7 +2485,9 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) pReconstructor->SetPriority (60); pReconstructor->Run(); return; - } else { + } else +#endif + { pImageFile = new ImageFile (m_iDefaultNX, m_iDefaultNY); Reconstructor* pReconstructor = new Reconstructor (rProj, *pImageFile, optFilterName.c_str(), m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(),