r569: no message
[ctsim.git] / src / docs.cpp
index f82fc6061da92d1f9df042bf48169841ae992236..93c5f1ea8d60954ccc54d007d644d842dd58e81b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: docs.cpp,v 1.21 2001/01/31 01:01:22 kevin Exp $
+**  $Id: docs.cpp,v 1.24 2001/02/21 20:13:03 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
@@ -61,7 +61,8 @@ bool ImageFileDocument::OnSaveDocument(const wxString& filename)
     *theApp->getLog() << "Unable to write image file " << filename << "\n";
     return false;
   }
-  *theApp->getLog() << "Wrote image file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Wrote image file " << filename << "\n";
   Modify(false);
   return true;
 }
@@ -76,7 +77,8 @@ bool ImageFileDocument::OnOpenDocument(const wxString& filename)
     m_bBadFileOpen = true;
     return false;
   }
-  *theApp->getLog() << "Read image file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Read image file " << filename << "\n";
   SetFilename(filename, true);  
   Modify(false);
   UpdateAllViews();
@@ -114,7 +116,8 @@ ImageFileDocument::Revert ()
     msg += "?";
     wxMessageDialog dialog (getView()->getFrame(), msg, "Are you sure?", wxYES_NO | wxNO_DEFAULT);
     if (dialog.ShowModal() == wxID_YES) {
-      *theApp->getLog() << "Reverting to saved " << GetFilename() << "\n";
+      if (theApp->getVerboseLogging())
+        *theApp->getLog() << "Reverting to saved " << GetFilename() << "\n";
       Modify (false);
       OnOpenDocument (GetFilename());
     }
@@ -136,7 +139,8 @@ ProjectionFileDocument::OnSaveDocument(const wxString& filename)
     *theApp->getLog() << "Unable to write projection file " << filename << "\n";
     return false;
   }
-  *theApp->getLog() << "Wrote projection file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Wrote projection file " << filename << "\n";
   Modify(false);
   return true;
 }
@@ -152,7 +156,8 @@ ProjectionFileDocument::OnOpenDocument(const wxString& filename)
     m_bBadFileOpen = true;
     return false;
   }
-  *theApp->getLog() << "Read projection file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Read projection file " << filename << "\n";
   SetFilename(filename, true);
   Modify(false);
   UpdateAllViews();
@@ -194,7 +199,8 @@ PhantomFileDocument::OnOpenDocument(const wxString& filename)
   wxString myFilename = filename;
   if (wxFile::Exists (myFilename)) {
     m_phantom.createFromFile (myFilename);
-    *theApp->getLog() << "Read phantom file " << filename << "\n";
+    if (theApp->getVerboseLogging())
+      *theApp->getLog() << "Read phantom file " << filename << "\n";
   } else {
     myFilename.Replace (".phm", "");
     m_phantom.createFromPhantom (myFilename);
@@ -222,7 +228,8 @@ PhantomFileDocument::OnSaveDocument(const wxString& filename)
     *theApp->getLog() << "Unable to write phantom file " << filename << "\n";
     return false;
   }
-  *theApp->getLog() << "Wrote phantom file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Wrote phantom file " << filename << "\n";
   Modify(false);
   return true;
 }
@@ -258,7 +265,8 @@ PlotFileDocument::OnSaveDocument(const wxString& filename)
     *theApp->getLog() << "Unable to write plot file " << filename << "\n";
     return false;
   }
-  *theApp->getLog() << "Wrote plot file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Wrote plot file " << filename << "\n";
   Modify(false);
   return true;
 }
@@ -274,7 +282,8 @@ PlotFileDocument::OnOpenDocument(const wxString& filename)
     m_bBadFileOpen = true;
     return false;
   }
-  *theApp->getLog() << "Read plot file " << filename << "\n";
+  if (theApp->getVerboseLogging())
+    *theApp->getLog() << "Read plot file " << filename << "\n";
   SetFilename (filename, true);
   m_namePlot = filename.c_str();
   Modify (false);
@@ -376,14 +385,14 @@ TextFileDocument::getTextCtrl()
 IMPLEMENT_DYNAMIC_CLASS(Graph3dFileDocument, wxDocument)
 
 Graph3dFileDocument::Graph3dFileDocument(void) 
-: m_bBadFileOpen(false), m_nVertices(0), m_pVertices(0), m_pNormals(0)
+: m_bBadFileOpen(false), m_nVertices(0), m_pVertices(0), m_pNormals(0),m_nx(0),m_ny(0),m_array(0)
 {
 }
 
 Graph3dFileDocument::~Graph3dFileDocument() 
 {
-    delete [] m_pVertices;
-    delete [] m_pNormals;
+//    delete [] m_pVertices;
+//    delete [] m_pNormals;
 }
 
 bool 
@@ -419,31 +428,15 @@ Graph3dFileDocument::getView() const
 bool
 Graph3dFileDocument::createFromImageFile (const ImageFile& rImageFile)
 {
-  delete [] m_pVertices;
-  delete [] m_pNormals;
+//  delete [] m_pVertices;
+//  delete [] m_pNormals;
+
 
   m_nx = rImageFile.nx();
   m_ny = rImageFile.ny();
   m_array = rImageFile.getArray();
-#if 0
-  const int nTriangles = nx * ny;
-  m_nVertices = nTriangles;
-  m_pVertices = new glTripleFloat [nTriangles];
-  m_pNormals = new glTripleFloat [nTriangles];
-
-  for (unsigned int ix = 0; ix < nx; ix++) {
-    for (unsigned int iy = 0; iy < ny; iy++) {
-      const int iTriangle = ix * iy;
-      m_pVertices[iTriangle][0] = ix;
-      m_pVertices[iTriangle][1] = iy;
-      m_pVertices[iTriangle][2] = v[ix][iy];
-      m_pNormals[iTriangle][0] = 0;
-      m_pNormals[iTriangle][1] = 0;
-      m_pNormals[iTriangle][2] = 0;
-    }
-  }
-#endif
+
   return true;
 }
 
-#endif // wxUSE_GLCANVAS
\ No newline at end of file
+#endif // wxUSE_GLCANVAS