r188: *** empty log message ***
[ctsim.git] / src / dlgreconstruct.cpp
index e8e01e2872da6651b285191a5c8fb9d121506725..277b6ea8bd41c11e17579e80a773916f1581d6f4 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: dlgreconstruct.cpp,v 1.1 2000/09/02 05:13:57 kevin Exp $
+**  $Id: dlgreconstruct.cpp,v 1.2 2000/09/02 16:40:36 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
@@ -145,7 +145,6 @@ void
 ReconstructDialog::showView (int iViewNumber)
 {
   if ( iViewNumber < m_rProjections.nView() ) {
-    wxYield();        // update the display
     m_iLastView = iViewNumber;
     m_pSGP->eraseWindow();
     if (m_iTrace >= Trace::TRACE_PLOT)
@@ -162,23 +161,20 @@ ReconstructDialog::showView (int iViewNumber)
     if (m_iTrace >= Trace::TRACE_PLOT)
       m_pSGP->setViewport (0, .1, 0.66, 1);
     m_rReconstructor.reconstructView (iViewNumber, 1, m_pSGP);
-
-    ::wxYield();
-    m_pDC->SelectObject (wxNullBitmap);
-    Refresh();
-    m_pDC->SelectObject (m_bitmap);
-    ::wxYield();
   }
 }
 
 bool
 ReconstructDialog::reconstructView (int iViewNumber)
 {
+  ::wxYield();        // update the display
   showView (iViewNumber);
-  wxYield();        // update the display
-  if (m_iTrace >= Trace::TRACE_PLOT)
-    sleep(1);
-  else {
+  ::wxYield();        // update the display
+  if (iViewNumber < m_rProjections.nView()) {
+    if (m_iTrace >= Trace::TRACE_PLOT) {
+      sleep(1);
+    }
+  } else {
     m_state = Finished;    // so that we return TRUE below and 
   }                        // that [Cancel] handler knew what to do
   
@@ -186,6 +182,7 @@ ReconstructDialog::reconstructView (int iViewNumber)
   MacUpdateImmediately();
 #endif
 
+  ::wxYield();        // update the display
   return m_state != Cancelled;
 }