From: Kevin M. Rosenberg Date: Sun, 4 Mar 2001 03:14:47 +0000 (+0000) Subject: r600: *** empty log message *** X-Git-Tag: debian-4.5.3-3~417 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=8cce345df80fdbeea1c03a04a71d805951a87b74 r600: *** empty log message *** --- diff --git a/src/backgroundmgr.cpp b/src/backgroundmgr.cpp index 5e19879..ddbefb7 100644 --- a/src/backgroundmgr.cpp +++ b/src/backgroundmgr.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundmgr.cpp,v 1.8 2001/02/25 10:52:55 kevin Exp $ +** $Id: backgroundmgr.cpp,v 1.9 2001/03/04 03:14:47 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 @@ -128,9 +128,9 @@ BackgroundManager::OnAddTask (wxCommandEvent& event) wxPoint posGauge (m_sizeBorder.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); wxPoint posLabel (m_sizeBorder.x + m_sizeGauge.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); - wxPoint posButton (m_sizeBorder.x + m_sizeGauge.x + m_sizeLabel.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); wxGauge* pGauge = new wxGauge (m_pCanvas, -1, iNumUnits, posGauge, m_sizeGauge); wxStaticText* pLabel = new wxStaticText (m_pCanvas, -1, pszTaskName, posLabel, m_sizeLabel); + // wxPoint posButton (m_sizeBorder.x + m_sizeGauge.x + m_sizeLabel.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); // wxButton* pCancelButton = new wxButton (m_pCanvas, iFirstUnusedPos, _T("Cancel"), posButton, m_sizeButton, wxBU_LEFT); m_vecpBackgroundTasks.push_back (pTask); @@ -248,4 +248,4 @@ BackgroundManagerCanvas::OnPaint (wxPaintEvent& event) // dc.DrawLine (0, 0, 30, 30); // dc.DrawLine (30,0, 0, 30); } -#endif \ No newline at end of file +#endif diff --git a/src/backgroundsupr.cpp b/src/backgroundsupr.cpp index 09560c4..129b38f 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.10 2001/03/02 21:11:50 kevin Exp $ +** $Id: backgroundsupr.cpp,v 1.11 2001/03/04 03:14:47 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 @@ -71,7 +71,7 @@ BackgroundSupervisor::BackgroundSupervisor (SupervisorThread* pMyThread, wxFrame wxEvtHandler() { m_iNumThreads = theApp->getNumberCPU(); - ++m_iNumThreads; + // ++m_iNumThreads; m_vecpThreads.reserve (m_iNumThreads); for (int iThread = 0; iThread < m_iNumThreads; iThread++) diff --git a/src/backgroundsupr.h b/src/backgroundsupr.h index 3e170b7..dac77cc 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.6 2001/03/02 21:11:50 kevin Exp $ +** $Id: backgroundsupr.h,v 1.7 2001/03/04 03:14:47 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 @@ -93,7 +93,7 @@ public: int iTotalUnits); BackgroundSupervisor () - : m_iTotalUnits(0), wxEvtHandler() + : wxEvtHandler(), m_iTotalUnits(0) {} virtual ~BackgroundSupervisor(); @@ -129,14 +129,13 @@ public: class BackgroundWorkerThread : public wxThread { protected: BackgroundSupervisor* m_pSupervisor; + const int m_iThread; const int m_iStartUnit; const int m_iNumUnits; - const int m_iThread; public: BackgroundWorkerThread (BackgroundSupervisor* pSupervisor, int iThread, int iStartUnit, int iNumUnits) - : m_pSupervisor(pSupervisor), m_iThread(iThread), m_iStartUnit(iStartUnit), m_iNumUnits(iNumUnits), - wxThread (wxTHREAD_DETACHED) + : wxThread (wxTHREAD_DETACHED), m_pSupervisor(pSupervisor), m_iThread(iThread), m_iStartUnit(iStartUnit), m_iNumUnits(iNumUnits) {} }; diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 26a57b3..5bd5312 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.92 2001/03/02 21:11:50 kevin Exp $ +** $Id: ctsim.cpp,v 1.93 2001/03/04 03:14:47 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.92 2001/03/02 21:11:50 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.93 2001/03/04 03:14:47 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -84,7 +84,7 @@ IMPLEMENT_APP(CTSimApp) CTSimApp::CTSimApp() : m_bAdvancedOptions(false), m_bSetModifyNewDocs(true), m_bVerboseLogging(false), m_bShowStartupTips(true), m_iCurrentTip(0), m_bUseBackgroundTasks(false), -m_docManager(NULL), m_pFrame(NULL), m_pLog(0), m_pLogDoc(0), m_pConfig(0) +m_docManager(NULL), m_pFrame(NULL), m_pLog(0), m_pConfig(0), m_pLogDoc(0) { theApp = this; } @@ -336,6 +336,8 @@ EVT_MENU(MAINMENU_HELP_TIPS, MainFrame::OnHelpTips) EVT_MENU(MAINMENU_IMPORT, MainFrame::OnImport) EVT_MENU(IDH_QUICKSTART, MainFrame::OnHelpButton) EVT_MENU(MAINMENU_LOG_EVENT, MainFrame::OnLogEvent) +EVT_MENU(NEW_IMAGEFILE_EVENT, MainFrame::OnNewImageFile) +EVT_MENU(NEW_PROJECTIONFILE_EVENT, MainFrame::OnNewProjectionFile) EVT_BUTTON(IDH_DLG_RASTERIZE, MainFrame::OnHelpButton) EVT_BUTTON(IDH_DLG_PROJECTIONS, MainFrame::OnHelpButton) EVT_BUTTON(IDH_DLG_RECONSTRUCTION, MainFrame::OnHelpButton) @@ -589,6 +591,49 @@ CTSimApp::getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector(event.GetClientData()); + + ImageFileDocument* pImageDoc = theApp->newImageDoc(); + if (! pImageDoc) { + sys_error (ERR_SEVERE, "Unable to create image file"); + return; + } + pImageDoc->setImageFile (pImageFile); + pImageDoc->UpdateAllViews (NULL); + if (ImageFileView* imageView = pImageDoc->getView()) { + imageView->OnUpdate (imageView, NULL); + imageView->getFrame()->SetFocus(); + imageView->getFrame()->Show(true); + } + if (theApp->getAskDeleteNewDocs()) + pImageDoc->Modify (true); + +} + +void +MainFrame::OnNewProjectionFile (wxCommandEvent& event) +{ + Projections* pProjections = reinterpret_cast(event.GetClientData()); + ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc(); + if (! pProjDoc) { + sys_error (ERR_SEVERE, "Unable to create projection file"); + return; + } + pProjDoc->setProjections (pProjections); + pProjDoc->UpdateAllViews (NULL); + if (ProjectionFileView* projView = pProjDoc->getView()) { + projView->OnUpdate (projView, NULL); + projView->getFrame()->SetFocus(); + projView->getFrame()->Show(true); + } + + if (theApp->getAskDeleteNewDocs()) + pProjDoc->Modify (true); +} + void MainFrame::OnLogEvent (wxCommandEvent& event) { diff --git a/src/ctsim.h b/src/ctsim.h index abc16fd..ee871cb 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.54 2001/03/02 21:11:50 kevin Exp $ +** $Id: ctsim.h,v 1.55 2001/03/04 03:14:47 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 @@ -39,6 +39,7 @@ #define HAVE_WXTHREADS 1 #else #undef HAVE_WXTHREADS +#define HAVE_WXTHREADS 1 #endif #ifndef WX_PRECOMP @@ -149,6 +150,8 @@ public: void OnCreatePhantom (wxCommandEvent& event); void OnPreferences (wxCommandEvent& event); void OnLogEvent (wxCommandEvent& event); // used by thread children + void OnNewImageFile (wxCommandEvent& event); + void OnNewProjectionFile (wxCommandEvent& event); void OnHelpButton (wxCommandEvent& event); void OnImport (wxCommandEvent& event); @@ -207,6 +210,7 @@ private: MainFrame* m_pFrame; wxConfig* m_pConfig; wxTextCtrl* m_pLog; + TextFileDocument* m_pLogDoc; wxDocTemplate* m_pDocTemplImage; wxDocTemplate* m_pDocTemplProjection; wxDocTemplate* m_pDocTemplPhantom; @@ -215,8 +219,6 @@ private: #if wxUSE_GLCANVAS wxDocTemplate* m_pDocTemplGraph3d; #endif - - TextFileDocument* m_pLogDoc; void usage (const char* program); void openConfig(); @@ -369,6 +371,8 @@ enum { GRAPH3D_VIEW_SCALE_FULL, RECONSTRUCTION_THREAD_EVENT, + NEW_IMAGEFILE_EVENT, + NEW_PROJECTIONFILE_EVENT, }; #endif diff --git a/src/graph3dview.cpp b/src/graph3dview.cpp index 55fe7c1..4295f4c 100644 --- a/src/graph3dview.cpp +++ b/src/graph3dview.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: graph3dview.cpp,v 1.15 2001/02/22 11:05:38 kevin Exp $ +** $Id: graph3dview.cpp,v 1.16 2001/03/04 03:14:47 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 @@ -192,7 +192,6 @@ bool Graph3dFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) ) { m_pFrame = CreateChildFrame(doc, this); - (m_pFrame); int width, height; m_pFrame->GetClientSize (&width, &height); diff --git a/src/threadproj.cpp b/src/threadproj.cpp index daf21d4..1cc4bce 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.8 2001/03/02 21:32:34 kevin Exp $ +** $Id: threadproj.cpp,v 1.9 2001/03/04 03:14:47 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 @@ -154,30 +154,14 @@ ProjectorSupervisor::onDone() wxCriticalSectionLocker critsect (doneSection); Projections* pProjections = getProjections(); - - if (! wxThread::IsMain()) - wxMutexGuiEnter(); - ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc(); - if (! pProjDoc) { - sys_error (ERR_SEVERE, "Unable to create projection file"); - return; - } - pProjDoc->setProjections (pProjections); - pProjDoc->UpdateAllViews (NULL); - if (ProjectionFileView* projView = pProjDoc->getView()) { - projView->OnUpdate (projView, NULL); - projView->getFrame()->SetFocus(); - projView->getFrame()->Show(true); - } - *theApp->getLog() << m_pszLabel << "\n"; - if (! wxThread::IsMain()) - wxMutexGuiLeave(); - - if (theApp->getAskDeleteNewDocs()) - pProjDoc->Modify (true); pProjections->setRemark (m_pszLabel); pProjections->setCalcTime (getTimerEnd()); + // *theApp->getLog() << m_pszLabel << "\n"; + wxCommandEvent newProjEvent (wxEVT_COMMAND_MENU_SELECTED, NEW_PROJECTIONFILE_EVENT); + newImageEvent.SetClientData (pProjections); + wxPostEvent (theApp->getMainFrame(), newProjEvent); + setDone(); } diff --git a/src/threadraster.cpp b/src/threadraster.cpp index 6602cce..6edc17b 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.3 2001/03/02 21:32:34 kevin Exp $ +** $Id: threadraster.cpp,v 1.4 2001/03/04 03:14:47 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 @@ RasterizerSupervisorThread::RasterizerSupervisorThread (PhantomFileView* pProjView, int iNX, int iNY, int iNSample, double dViewRatio, const char* const pszLabel) -: m_pPhantomView(pProjView), m_iNX(iNX), m_iNY(iNY), m_iNSample(iNSample), m_dViewRatio(dViewRatio), m_strLabel(pszLabel), - SupervisorThread() +: SupervisorThread(), m_pPhantomView(pProjView), m_iNX(iNX), m_iNY(iNY), m_iNSample(iNSample), m_dViewRatio(dViewRatio), m_strLabel(pszLabel) { } @@ -141,28 +140,13 @@ RasterizerSupervisor::onDone() wxCriticalSectionLocker critsect (doneSection); ImageFile* pImageFile = getImageFile(); - - if (! wxThread::IsMain()) - wxMutexGuiEnter(); - ImageFileDocument* pImageDoc = theApp->newImageDoc(); - if (! pImageDoc) { - sys_error (ERR_SEVERE, "Unable to create image file"); - return; - } - pImageDoc->setImageFile (pImageFile); - pImageDoc->UpdateAllViews (NULL); - if (ImageFileView* imageView = pImageDoc->getView()) { - imageView->OnUpdate (imageView, NULL); - imageView->getFrame()->SetFocus(); - imageView->getFrame()->Show(true); - } - *theApp->getLog() << m_pszLabel << "\n"; - if (! wxThread::IsMain()) - wxMutexGuiLeave(); pImageFile->labelAdd (m_pszLabel, getTimerEnd()); - if (theApp->getAskDeleteNewDocs()) - pImageDoc->Modify (true); + // *theApp->getLog() << m_pszLabel << "\n"; + wxCommandEvent newImageEvent (wxEVT_COMMAND_MENU_SELECTED, NEW_IMAGEFILE_EVENT); + newImageEvent.SetClientData (pImageFile); + wxPostEvent (theApp->getMainFrame(), newImageEvent); + setDone(); } diff --git a/src/threadraster.h b/src/threadraster.h index 2644a45..222091c 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.2 2001/03/02 21:11:50 kevin Exp $ +** $Id: threadraster.h,v 1.3 2001/03/04 03:14:47 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 @@ -65,9 +65,9 @@ public: class RasterizerSupervisor : public BackgroundSupervisor { private: + PhantomFileView* m_pPhantomView; std::vector m_vecpChildImageFiles; PhantomFileDocument* m_pPhantomDoc; - PhantomFileView* m_pPhantomView; const int m_iNX; const int m_iNY; diff --git a/src/threadrecon.cpp b/src/threadrecon.cpp index 3c0b223..66eb047 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.16 2001/03/02 21:32:34 kevin Exp $ +** $Id: threadrecon.cpp,v 1.17 2001/03/04 03:14:47 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 @@ -148,29 +148,13 @@ ReconstructorSupervisor::onDone() wxCriticalSectionLocker critsect (doneSection); ImageFile* pImageFile = getImageFile(); - - if (! wxThread::IsMain()) - wxMutexGuiEnter(); - ImageFileDocument* pReconDoc = theApp->newImageDoc(); - if (! pReconDoc) { - sys_error (ERR_SEVERE, "Unable to create image file"); - return; - } - pReconDoc->setImageFile (pImageFile); - pReconDoc->UpdateAllViews (m_pProjView); - if (ImageFileView* rasterView = pReconDoc->getView()) { - rasterView->OnUpdate (rasterView, NULL); - rasterView->getFrame()->SetFocus(); - rasterView->getFrame()->Show(true); - } - *theApp->getLog() << m_pszLabel << "\n"; - if (! wxThread::IsMain()) - wxMutexGuiLeave(); - - if (theApp->getAskDeleteNewDocs()) - pReconDoc->Modify (true); pImageFile->labelAdd (m_pProjView->GetDocument()->getProjections().getLabel()); pImageFile->labelAdd (m_pszLabel, getTimerEnd()); + // *theApp->getLog() << m_pszLabel << "\n"; + + wxCommandEvent newImageEvent (wxEVT_COMMAND_MENU_SELECTED, NEW_IMAGEFILE_EVENT); + newImageEvent.SetClientData (pImageFile); + wxPostEvent (theApp->getMainFrame(), newImageEvent); setDone(); }