r641: no message
[ctsim.git] / src / dlgreconstruct.cpp
index d0be191674e6315011cdd02a9058bc22c91c39c5..093586bedc8552631c9b46a9b42c773b8a1f1c94 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: dlgreconstruct.cpp,v 1.15 2001/01/28 19:10:18 kevin Exp $
+**  $Id: dlgreconstruct.cpp,v 1.18 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 "dlgreconstruct.h"
 #endif
 
-// For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
 #include "wx/utils.h"
 #include "wx/frame.h"
 #include "wx/button.h"
@@ -74,8 +69,11 @@ END_EVENT_TABLE()
 IMPLEMENT_CLASS(ReconstructDialog, wxDialog)
 
 
-ReconstructDialog::ReconstructDialog (Reconstructor& rReconstruct, const Projections& rProj, ImageFile& rIF, const int iTrace, wxWindow *parent)
-: wxDialog(parent, -1, "Reconstruction", wxDefaultPosition), m_rReconstructor(rReconstruct), m_rProjections(rProj), m_rImageFile(rIF), m_pSGPDriver(NULL), m_pSGP(NULL), m_iTrace(iTrace), m_pDC(NULL), m_btnAbort(0), m_btnPause(0), m_btnStep(0)
+ReconstructDialog::ReconstructDialog (Reconstructor& rReconstruct, const Projections& rProj, 
+                                      ImageFile& rIF, const int iTrace, wxWindow *parent)
+: wxDialog(parent, -1, "Reconstruction", wxDefaultPosition), m_rReconstructor(rReconstruct), 
+           m_rProjections(rProj), m_rImageFile(rIF), m_pSGPDriver(NULL), m_pSGP(NULL), 
+  m_iTrace(iTrace), m_pDC(NULL), m_btnAbort(0), m_btnPause(0), m_btnStep(0)
 {
     m_state = Continue;
     m_iLastView = -1;
@@ -118,10 +116,10 @@ ReconstructDialog::ReconstructDialog (Reconstructor& rReconstruct, const Project
     wxSize sizeDlg (m_nxGraph, m_nyGraph);
     m_nxImage = m_rImageFile.nx();
     if (m_nxImage > MAX_IMAGE_X)
-               m_nxImage = MAX_IMAGE_X;
+                  m_nxImage = MAX_IMAGE_X;
     m_nyImage = m_rImageFile.ny();
     if (m_nyImage > MAX_IMAGE_Y)
-               m_nyImage = MAX_IMAGE_Y;
+                  m_nyImage = MAX_IMAGE_Y;
        
     sizeDlg.x += m_nxImage;
     sizeDlg.y = max (sizeDlg.y, m_nyImage);
@@ -166,15 +164,21 @@ ReconstructDialog::showView (int iViewNumber, bool bBackprojectView)
                m_pSGP->setViewport (0, 0, 1, 1);
                m_pSGP->setWindow (0, 0, 1, 1);
                m_pSGP->setTextColor (C_LTRED, -1);
-               double dCharHeight = m_pSGP->getCharHeight();
-               m_pSGP->setTextSize (dCharHeight * 2);
+               m_pSGP->setTextPointSize (20.);
                m_pSGP->moveAbs(0., m_pSGP->getCharHeight());
                m_pSGP->drawText (szProgress);
-               m_pSGP->setTextSize (dCharHeight);
-               
-               // m_pSGP->setViewport (0.0, 0.1, 0.66, 1.); // viewport equiv now done in subroutine
-               m_rReconstructor.reconstructView (iViewNumber, 1, m_pSGP, bBackprojectView);
+               m_pSGP->setTextPointSize (10.);
                
+    int iXDialog, iYDialog;
+    GetClientSize (&iXDialog, &iYDialog);
+    double dGraphWidth = (iXDialog - m_nxImage) / static_cast<double>(iXDialog);
+
+               m_rReconstructor.reconstructView (iViewNumber, 1, m_pSGP, bBackprojectView, dGraphWidth);
+    ::wxYield();
+::wxYield();
+::wxYield();
+::wxYield();
+
                ImageFileArrayConst v = m_rImageFile.getArray();
                int xBase = m_nxGraph;
                int yBase = 0;
@@ -208,6 +212,8 @@ ReconstructDialog::showView (int iViewNumber, bool bBackprojectView)
                m_pSGP->getDriver().idWX()->DrawBitmap(bitmap, xBase, yBase, false);
                delete imageData;
        }
+
+  ::wxYield();
 }
 
 bool