r600: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 4 Mar 2001 03:14:47 +0000 (03:14 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 4 Mar 2001 03:14:47 +0000 (03:14 +0000)
src/backgroundmgr.cpp
src/backgroundsupr.cpp
src/backgroundsupr.h
src/ctsim.cpp
src/ctsim.h
src/graph3dview.cpp
src/threadproj.cpp
src/threadraster.cpp
src/threadraster.h
src/threadrecon.cpp

index 5e1987990bac1cd8ae120806e34e80c573367a26..ddbefb75f9108ad6d1b015e92d71b30d75be164f 100644 (file)
@@ -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
index 09560c4068ef6d8f2d1ecfe52fb7858055e8e46e..129b38fa642482f11ed518daf37e06ef45f7caf2 100644 (file)
@@ -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++)
index 3e170b740d4e99f034a9019334da01c4617dcc4f..dac77cc60106204195a22f3262e328062c2fd12a 100644 (file)
@@ -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)
   {}
 };
 
index 26a57b33984ada0195523c3cdc9bc73696a54fb5..5bd53127267ae3bd857d87017cc6c28c38e4cf40 100644 (file)
@@ -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<Imag
 }
 
 
+void
+MainFrame::OnNewImageFile (wxCommandEvent& event)
+{
+  ImageFile* pImageFile = reinterpret_cast<ImageFile*>(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<Projections*>(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)
 {
index abc16fd173e41c7473195dab2232809421e8b599..ee871cbf3e4d794a7f090174d0e73cd1d2d4c558 100644 (file)
@@ -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
index 55fe7c1d9ece9bf2d8230685d624170ccadddabb..4295f4c9a3da128a61901d449082c83f4207a343 100644 (file)
@@ -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);
index daf21d46c0fc944dcec75306b117d9e3a86bcb5c..1cc4bce8e9f74d6c66553a07cce61ad88373b0d5 100644 (file)
@@ -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();
 }
 
index 6602ccedc1f3a000ff01a7cc86032042757310a8..6edc17b5e09554f933748e35a94e4a4c5b4064c5 100644 (file)
@@ -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();
 }
 
index 2644a45840cdb9fe72e6ebb254ea295755040764..222091c6b5f14a8fd184902646ef695646949bb9 100644 (file)
@@ -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<ImageFile*> m_vecpChildImageFiles;
   PhantomFileDocument* m_pPhantomDoc;
-  PhantomFileView* m_pPhantomView;
   
   const int m_iNX;
   const int m_iNY;
index 3c0b223924917e67b351284e8228ca99d69ba4d7..66eb0474914b258f1d331a6f2d2dbdd2a436d46f 100644 (file)
@@ -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();
 }