** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: docs.cpp,v 1.24 2001/02/21 20:13:03 kevin Exp $
+** $Id: docs.cpp,v 1.25 2001/02/22 11:05:38 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
// #pragma implementation
#endif
-// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/txtstrm.h"
#include "wx/file.h"
+#include "wx/thread.h"
#if !wxUSE_DOC_VIEW_ARCHITECTURE
#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#include "ctsim.h"
#include "docs.h"
#include "views.h"
+#include "threadrecon.h"
+
// ImageFileDocument
return true;
}
+ProjectionFileDocument::~ProjectionFileDocument()
+{
+ for (int i = 0; i < m_vecpActiveReconstructors.size(); i++) {
+ ThreadedReconstructor* pThreadedReconstructor = m_vecpActiveReconstructors[i];
+ if (pThreadedReconstructor) {
+ pThreadedReconstructor->cancel();
+ }
+ }
+
+ delete m_pProjectionFile;
+}
+
+void
+ProjectionFileDocument::addReconstructor (ThreadedReconstructor* pRecon)
+{
+ wxCriticalSectionLocker locker (m_criticalSection);
+ m_vecpActiveReconstructors.push_back (pRecon);
+}
+
+void
+ProjectionFileDocument::removeReconstructor (ThreadedReconstructor* pRecon)
+{
+ wxCriticalSectionLocker locker (m_criticalSection);
+ for (int i = 0; i < m_vecpActiveReconstructors.size(); i++) {
+ if (m_vecpActiveReconstructors[i] == pRecon)
+ m_vecpActiveReconstructors[i] = NULL;
+ }
+}
+
bool
ProjectionFileDocument::OnOpenDocument(const wxString& filename)
{