r458: no message
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 28 Jan 2001 03:48:55 +0000 (03:48 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 28 Jan 2001 03:48:55 +0000 (03:48 +0000)
include/ct.h
msvc/ctsim/ctsim.plg
src/ctsim.cpp
src/views.cpp
src/views.h

index a36412f097b98936b7461c2b4e824b2238182b67..de8548ea280ee87d95c4f883713278e8fd7f94d8 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ct.h,v 1.53 2001/01/13 03:51:35 kevin Exp $
+**  $Id: ct.h,v 1.54 2001/01/28 03:48:55 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
   #include <config.h>
 #endif
 
+#ifdef _DEBUG
+#undef DEBUG
+#define DEBUG 1
+#endif
+
 #define HAVE_ANSI_CPP 1
 #ifdef HAVE_ANSI_CPP
 #include <complex>
index 9a07f723a531c9d83f8cdfdf46055cd026e115b5..8756f709ab4303983dd78131f14738c66af874af 100644 (file)
@@ -6,13 +6,13 @@
 --------------------Configuration: ctsim - Win32 Debug--------------------
 </h3>
 <h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140E.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E7.tmp" with contents
 [
 /nologo /G6 /MTd /W3 /Gm /GR /GX /Zi /Od /I "\wx2\include" /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"2.5.0\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
-"D:\ctsim\src\views.cpp"
+"C:\ctsim\src\views.cpp"
 ]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140E.tmp" 
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140F.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E7.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E8.tmp" with contents
 [
 comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lpng108\msvc\win32\libpng\lib_dbg\libpng.lib ..\..\..\lpng108\msvc\win32\zlib\lib_dbg\zlib.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib ../../../wx2/lib/wxd.lib xpmd.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" /libpath:"..\..\..\wx2\lib" 
 .\Debug\ctsim.obj
@@ -28,7 +28,7 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w
 \wx2\lib\wxd.lib
 \wx2\lib\xpmd.lib
 ]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140F.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E8.tmp"
 <h3>Output Window</h3>
 Compiling...
 views.cpp
index e96746c0206840e1fb3ee2c417011b227d9ba516..c2c952eb3706165800d7d329942a51f370bde966 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ctsim.cpp,v 1.51 2001/01/27 22:10:11 kevin Exp $
+**  $Id: ctsim.cpp,v 1.52 2001/01/28 03:48:55 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
@@ -70,7 +70,7 @@
 #endif
 #endif
 
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.51 2001/01/27 22:10:11 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.52 2001/01/28 03:48:55 kevin Exp $";
 
 struct option CTSimApp::ctsimOptions[] = 
 {
@@ -371,6 +371,7 @@ MainFrame::~MainFrame()
     if (theApp->getConfig())
       theApp->getDocManager()->FileHistorySave (*theApp->getConfig());
     delete theApp->getDocManager();
+
 }
 
 void
index ec75fccf4410be59f6537d10e5faacdfa8b5e885..315474d0371250f93e6bf083b0aea45061a274b0 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.81 2001/01/27 22:31:57 kevin Exp $
+**  $Id: views.cpp,v 1.82 2001/01/28 03:48:55 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
@@ -231,7 +231,8 @@ ImageFileView::ImageFileView()
 
 ImageFileView::~ImageFileView()
 {
-  theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->ActivateView(this, FALSE, TRUE);
 }
 
 void
@@ -818,8 +819,8 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   m_pFileMenu->AppendSeparator();
   m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit");
 #endif
-  theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
-  theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu);
   
   wxMenu *view_menu = new wxMenu;
   view_menu->Append(IFMENU_VIEW_SCALE_MINMAX, "Display Scale S&et...\tCtrl-E");
@@ -911,7 +912,7 @@ bool
 ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
 {
   m_pFrame = CreateChildFrame(doc, this);
-  SetFrame (m_pFrame);
+     (m_pFrame);
   
   m_bMinSpecified = false;
   m_bMaxSpecified = false;
@@ -999,22 +1000,23 @@ ImageFileView::OnClose (bool deleteWindow)
     return false;
   
   if (m_pCanvas) {
-    m_pCanvas->Clear();
-    m_pCanvas->Show(false);
+//    m_pCanvas->Show(false);
+//    m_pCanvas->Clear();
     m_pCanvas->setView(NULL);
     m_pCanvas = NULL;
   }
   wxString s(theApp->GetAppName());
   if (m_pFrame)
     m_pFrame->SetTitle(s);
-  SetFrame(NULL);
   
+  SetFrame(NULL);
   Activate(false);
-  
+
   if (deleteWindow) {
-    //m_pFrame->Show(false);
+    m_pFrame->Show(false);
+    //m_pFrame->Close(true);
     m_pFrame->Destroy();
-    //   delete m_pFrame;
+  //     delete m_pFrame;
     m_pFrame = NULL;
   }
   return true;
@@ -1736,8 +1738,13 @@ END_EVENT_TABLE()
 PhantomFileView::PhantomFileView() 
 : wxView(), m_pFrame(NULL), m_pCanvas(NULL), m_pFileMenu(0)
 {
+#if defined(DEBUG) || defined(_DEBUG)
+  m_iDefaultNDet = 165;
+  m_iDefaultNView = 180;
+#else
   m_iDefaultNDet = 367;
   m_iDefaultNView = 320;
+#endif
   m_iDefaultNSample = 1;
   m_dDefaultRotation = 1;
   m_dDefaultFocalLength = 2;
@@ -1745,14 +1752,21 @@ PhantomFileView::PhantomFileView()
   m_iDefaultGeometry = Scanner::GEOMETRY_PARALLEL;
   m_iDefaultTrace = Trace::TRACE_NONE;
   
+#ifdef DEBUG 
+  m_iDefaultRasterNX = 115;
+  m_iDefaultRasterNY = 115;
+  m_iDefaultRasterNSamples = 1;
+#else
   m_iDefaultRasterNX = 256;
   m_iDefaultRasterNY = 256;
   m_iDefaultRasterNSamples = 2;
+#endif
 }
 
 PhantomFileView::~PhantomFileView()
 {
-  theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->ActivateView(this, FALSE, TRUE);
 }
 
 void
@@ -1848,7 +1862,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event)
           pFrame->SetFocus();
           pFrame->Raise();
         }
-        theApp->getDocManager()->ActivateView (pView, true, false);
+        GetDocumentManager()->ActivateView (pView, true, false);
       }
       ::wxYield();
       if (theApp->getSetModifyNewDocs())
@@ -1959,8 +1973,8 @@ PhantomFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   m_pFileMenu->AppendSeparator();
   m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit");
 #endif
-  theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
-  theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu);
   
   wxMenu *process_menu = new wxMenu;
   process_menu->Append(PHMMENU_PROCESS_RASTERIZE, "&Rasterize...\tCtrl-R");
@@ -2033,22 +2047,23 @@ PhantomFileView::OnClose (bool deleteWindow)
     return false;
   
   if (m_pCanvas) {
-    m_pCanvas->Clear();
+    //m_pCanvas->Show(false);
+    //m_pCanvas->Clear();
     m_pCanvas->setView(NULL);
-    m_pCanvas->Show(false);
     m_pCanvas = NULL;
   }
   wxString s(wxTheApp->GetAppName());
   if (m_pFrame)
     m_pFrame->SetTitle(s);
-  SetFrame(NULL);
   
+  SetFrame(NULL);
   Activate(false);
   
   if (deleteWindow) {
-  //  m_pFrame->Show(false);
-    m_pFrame->Destroy();
-    //    delete m_pFrame;
+    m_pFrame->Show(false);
+     m_pFrame->Destroy();
+    //GetDocumentManager()->ActivateView(this, FALSE, TRUE);
+     //  delete m_pFrame;
     m_pFrame = NULL;
   }
   
@@ -2114,8 +2129,14 @@ END_EVENT_TABLE()
 ProjectionFileView::ProjectionFileView() 
 : wxView(), m_pCanvas(NULL), m_pFrame(NULL), m_pFileMenu(0)
 {
+#ifdef DEBUG
+  m_iDefaultNX = 115;
+  m_iDefaultNY = 115;
+#else
   m_iDefaultNX = 256;
   m_iDefaultNY = 256;
+#endif
+
   m_iDefaultFilter = SignalFilter::FILTER_ABS_BANDLIMIT;
   m_dDefaultFilterParam = 1.;
 #if HAVE_FFTW
@@ -2139,7 +2160,8 @@ ProjectionFileView::ProjectionFileView()
 
 ProjectionFileView::~ProjectionFileView()
 {
-  theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->ActivateView(this, FALSE, TRUE);;
 }
 
 void
@@ -2365,8 +2387,8 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   m_pFileMenu->AppendSeparator();
   m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit");
 #endif
-  theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
-  theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu);
   
   wxMenu *convert_menu = new wxMenu;
   convert_menu->Append (PJMENU_CONVERT_POLAR, "&Polar Image...\tCtrl-L");
@@ -2503,22 +2525,23 @@ ProjectionFileView::OnClose (bool deleteWindow)
     return false;
   
   if (m_pCanvas) {
-    m_pCanvas->Clear();
+    //m_pCanvas->Show(false);
+    //m_pCanvas->Clear();
     m_pCanvas->setView(NULL);
-    m_pCanvas->Show(false);
     m_pCanvas = NULL;
   }
   wxString s(wxTheApp->GetAppName());
   if (m_pFrame)
     m_pFrame->SetTitle(s);
-  //  SetFrame(NULL);
   
+  SetFrame(NULL);
   Activate(false);
   
   if (deleteWindow) {
-    //m_pFrame->Show(false);
+    m_pFrame->Show(false);
     m_pFrame->Destroy();
-    //   delete m_pFrame;
+    // delete m_pFrame;
+    //m_pFrame->Close(true);
     m_pFrame = NULL;
   }
   return true;
@@ -2567,7 +2590,7 @@ PlotFileView::~PlotFileView()
   if (m_pEZPlot)
     delete m_pEZPlot;
   
-  theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);  
+  GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu);  
 }
 
 void
@@ -2694,8 +2717,8 @@ PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   m_pFileMenu->AppendSeparator();
   m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit");
 #endif
-  theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
-  theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu);
   
   wxMenu *view_menu = new wxMenu;
   view_menu->Append(PLOTMENU_VIEW_SCALE_MINMAX, "Display Scale &Set...\tCtrl-E");
@@ -2833,21 +2856,24 @@ PlotFileView::OnClose (bool deleteWindow)
     return false;
   
   if (m_pCanvas) {
-    m_pCanvas->Clear();
+//    m_pCanvas->Show(false);
+//    m_pCanvas->Clear();
     m_pCanvas->setView (NULL);
-    m_pCanvas->Show(false);
     m_pCanvas = NULL;
   }
   wxString s(wxTheApp->GetAppName());
   if (m_pFrame)
     m_pFrame->SetTitle(s);
-  SetFrame(NULL);
   
   Activate(false);
   
+  m_pFrame->SetView(NULL);
+   SetFrame(NULL);
   if (deleteWindow) {
-    //m_pFrame->Show(false);
-    m_pFrame->Destroy();
+    m_pFrame->Show(false);
+     m_pFrame->Destroy();
+    //m_pFrame->Close(true);
+    //GetDocumentManager()->ActivateView(this, FALSE, TRUE);
     //   delete m_pFrame;
     m_pFrame = NULL;
   }
@@ -2862,7 +2888,8 @@ IMPLEMENT_DYNAMIC_CLASS(TextFileView, wxView)
 
 TextFileView::~TextFileView() 
 {
-  theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu);
+  GetDocumentManager()->ActivateView(this, FALSE, TRUE);;
 }
 
 bool TextFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@@ -2901,7 +2928,7 @@ void TextFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 TextFileView::OnClose (bool deleteWindow)
 {
-  if (m_pFrame && m_pFrame->GetTitle() == "Log")
// if (m_pFrame && m_pFrame->GetTitle() == "Log")
     return false;
   
   if (! GetDocument() || ! GetDocument()->Close())
@@ -2909,10 +2936,14 @@ TextFileView::OnClose (bool deleteWindow)
   
   m_pCanvas->Show(false);
   Activate(false);
-  
+
+  SetFrame(NULL);
+  m_pFrame->SetView(NULL);
   if (deleteWindow) {
-    //m_pFrame->Show(false);
-    m_pFrame->Destroy();
+    m_pFrame->Show(false);
+     m_pFrame->Destroy();
+    //m_pFrame->Close(true);
+    //GetDocumentManager()->ActivateView(this, FALSE, TRUE);
     //   delete m_pFrame;
     m_pFrame = NULL;
     
@@ -2951,8 +2982,8 @@ TextFileView::CreateChildFrame (wxDocument *doc, wxView *view)
   m_pFileMenu->AppendSeparator();
   m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit");
 #endif
-  theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
-  theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu);
+  GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu);
   
   wxMenu *help_menu = new wxMenu;
   help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents\tF1");
index eca72d488c56603fdacdc54f9037037096876972..0bec2e6bf2660832ba6d95413e6abad18e730ada 100644 (file)
@@ -7,9 +7,9 @@
 **   Date Started:  July 2000
 **
 **  This is part of the CTSim program
-**  Copyright (C) 1983-2000 Kevin Rosenberg
+**  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.h,v 1.35 2001/01/27 03:08:16 kevin Exp $
+**  $Id: views.h,v 1.36 2001/01/28 03:48:55 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
@@ -66,7 +66,7 @@ private:
 
   wxWindow* getFrameForChild() 
 #if CTSIM_MDI
-  { return theApp->getMainFrame()->GetClientWindow(); }
+  { return theApp->getMainFrame(); }
 #else
   { return m_pFrame; }
 #endif
@@ -207,7 +207,7 @@ private:
 
   wxWindow* getFrameForChild() 
 #if CTSIM_MDI
-  { return theApp->getMainFrame()->GetClientWindow(); }
+  { return theApp->getMainFrame(); }
 #else
   { return m_pFrame; }
 #endif
@@ -290,7 +290,7 @@ private:
 
   wxWindow* getFrameForChild() 
 #if CTSIM_MDI
-  { return theApp->getMainFrame()->GetClientWindow(); }
+  { return theApp->getMainFrame(); }
 #else
   { return m_pFrame; }
 #endif
@@ -361,7 +361,7 @@ private:
   PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
   wxWindow* getFrameForChild() 
 #if CTSIM_MDI
-  { return theApp->getMainFrame()->GetClientWindow(); }
+  { return theApp->getMainFrame(); }
 #else
   { return m_pFrame; }
 #endif