** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: docs.cpp,v 1.26 2001/02/23 18:56:56 kevin Exp $
+** $Id: docs.cpp,v 1.27 2001/02/23 21:58:31 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
{
for (BackgroundContainer::iterator i = m_vecpBackgroundSupervisors.begin();
i != m_vecpBackgroundSupervisors.end(); i++) {
- (*i)->cancel();
+ BackgroundSupervisor::cancelSupervisor(*i);
}
- m_vecpBackgroundSupervisors.clear();
+ while (m_vecpBackgroundSupervisors.size() > 0)
+ ::wxYield();
+
delete m_pProjectionFile;
}
void
ProjectionFileDocument::OnAddBackground (wxCommandEvent& event)
{
-}
+ BackgroundSupervisor* pSupervisor = reinterpret_cast<BackgroundSupervisor*>(event.GetClientData());
+ wxASSERT (pSupervisor != NULL);
-void
-ProjectionFileDocument::OnRemoveBackground (wxCommandEvent& event)
-{
-}
-
-void
-ProjectionFileDocument::addReconstructor (BackgroundSupervisor* pRecon)
-{
wxCriticalSectionLocker locker (m_criticalSection);
- m_vecpBackgroundSupervisors.push_back (pRecon);
+ if (pSupervisor)
+ m_vecpBackgroundSupervisors.push_back (pSupervisor);
}
void
-ProjectionFileDocument::removeReconstructor (BackgroundSupervisor* pRecon)
+ProjectionFileDocument::OnRemoveBackground (wxCommandEvent& event)
{
+ BackgroundSupervisor* pSupervisor = reinterpret_cast<BackgroundSupervisor*>(event.GetClientData());
+ wxASSERT (pSupervisor != NULL);
+
wxCriticalSectionLocker locker (m_criticalSection);
bool bFound = false;
for (BackgroundContainer::iterator i = m_vecpBackgroundSupervisors.begin();
i != m_vecpBackgroundSupervisors.end();
i++)
- if (*i == pRecon) {
+ if (*i == pSupervisor) {
m_vecpBackgroundSupervisors.erase(i);
bFound = true;
break;