X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdlgreconstruct.cpp;fp=src%2Fdlgreconstruct.cpp;h=7ec1d326d03135e7d0a372bc1e3b680d6a3f3804;hp=4729ee9c3930aad1542da8bf967d841a04e7d77b;hb=92a0f68cb5d5062787b0cbb2664fafe2b2c9ae37;hpb=9324f74c9b1dcbb6aae655dbb24ca05284a144df diff --git a/src/dlgreconstruct.cpp b/src/dlgreconstruct.cpp index 4729ee9..7ec1d32 100644 --- a/src/dlgreconstruct.cpp +++ b/src/dlgreconstruct.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: dlgreconstruct.cpp,v 1.7 2000/12/16 03:39:06 kevin Exp $ +** $Id: dlgreconstruct.cpp,v 1.8 2000/12/17 22:30:34 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 @@ -130,23 +130,27 @@ ReconstructDialog::ReconstructDialog (Reconstructor& rReconstruct, const Project m_iClientY = sizeDlg.y; SetClientSize (sizeDlg); + Centre(wxCENTER_FRAME | wxBOTH); + + if ( m_parentTop ) + m_parentTop->Enable(FALSE); + + Show(TRUE); + Enable(TRUE); // enable this window + m_bitmap.Create (m_iClientX, m_iClientY); // save a copy of screen + int x, y; + this->GetClientSize(&x, &y); +#if OLD m_pDC = new wxMemoryDC; m_pDC->SelectObject (m_bitmap); // in memoryDC - m_pDC->SetFont (*wxSWISS_FONT); - int x, y; - this->GetClientSize(&x, &y); - m_pSGPDriver = new SGPDriver (dynamic_cast(m_pDC), x, y); + m_pSGPDriver = new SGPDriver (dynamic_cast(m_pDC), x, y); +#else + m_pDC = dynamic_cast (new wxClientDC (this)); + m_pSGPDriver = new SGPDriver (m_pDC, x, y); +#endif m_pSGP = new SGP (*m_pSGPDriver); - Centre(wxCENTER_FRAME | wxBOTH); - - if ( m_parentTop ) - m_parentTop->Enable(FALSE); - - Show(TRUE); - Enable(TRUE); // enable this window - wxYield(); // Update the display m_pSGPDriver->idWX()->SetFont(*wxSWISS_FONT); @@ -156,7 +160,7 @@ ReconstructDialog::ReconstructDialog (Reconstructor& rReconstruct, const Project } void -ReconstructDialog::showView (int iViewNumber) +ReconstructDialog::showView (int iViewNumber, bool bBackprojectView) { if ( iViewNumber < m_rProjections.nView() ) { m_iLastView = iViewNumber; @@ -174,7 +178,7 @@ ReconstructDialog::showView (int iViewNumber) m_pSGP->setTextSize (dCharHeight); m_pSGP->setViewport (0.0, 0.1, 0.66, 1.); - m_rReconstructor.reconstructView (iViewNumber, 1, m_pSGP); + m_rReconstructor.reconstructView (iViewNumber, 1, m_pSGP, bBackprojectView); ImageFileArrayConst v = m_rImageFile.getArray(); int xBase = m_nxGraph; @@ -221,7 +225,7 @@ ReconstructDialog::reconstructView (int iViewNumber) if (iViewNumber < m_rProjections.nView()) { ::wxYield(); // update the display - showView (iViewNumber); + showView (iViewNumber, true); ::wxYield(); // update the display if (m_iTrace >= Trace::TRACE_PLOT) { ::wxUsleep(250); @@ -267,7 +271,15 @@ ReconstructDialog::OnPause (wxCommandEvent& event) // shown as a modal dialog - so just let the default handler do the job event.Skip(); } else { - if (m_state == Continue) { + if (m_state == Continue) { +#ifndef OLD + m_memoryDC.SelectObject (m_bitmap); // in memoryDC + m_pSGP->setDC (&m_memoryDC); + m_memoryDC.SetFont (*wxSWISS_FONT); + showView (m_iLastView, false); + m_pSGP->setDC (m_pDC); + m_memoryDC.SelectObject(wxNullBitmap); +#endif m_state = Paused; m_btnPause->SetLabel (wxString("Resume")); } else if (m_state == Paused) { @@ -283,7 +295,15 @@ ReconstructDialog::OnStep (wxCommandEvent& event) if ( m_state == Finished ) { event.Skip(); } else { - if (m_state == Continue) { + if (m_state == Continue) { +#ifndef OLD + m_memoryDC.SelectObject (m_bitmap); // in memoryDC + m_pSGP->setDC (&m_memoryDC); + m_memoryDC.SetFont (*wxSWISS_FONT); + m_rReconstructor.reconstructView (m_iLastView, 1, m_pSGP, false); + m_pSGP->setDC (m_pDC); + m_memoryDC.SelectObject(wxNullBitmap); +#endif m_state = Paused; m_btnPause->SetLabel (wxString("Resume")); } else if (m_state == Paused) { @@ -305,8 +325,9 @@ void ReconstructDialog::OnClose(wxCloseEvent& event) void ReconstructDialog::OnPaint (wxPaintEvent& event) { - wxPaintDC paintDC (this); - paintDC.DrawBitmap(m_bitmap, 0, 0, false); + wxPaintDC paintDC (this); + if (m_state == Paused) + paintDC.DrawBitmap(m_bitmap, 0, 0, false); }