Fix few more c-string to unicode strings
[ctsim.git] / src / views.cpp
index b238a81f9f1e27f7c42eedb33786d1b8903d6a16..f7898314fca127d73cc121433749e1c2a8867a87 100644 (file)
@@ -1413,7 +1413,7 @@ ImageFileView::OnPlotRow (wxCommandEvent& event)
     } else {
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Row " << yCursor;
+      os << "Row " << yCursor << ": ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1443,7 +1443,7 @@ ImageFileView::OnPlotRow (wxCommandEvent& event)
       }
       for (unsigned int iL = 0; iL < rIF.nLabels(); iL++)
         rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str());
-      os << " Plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
     }
@@ -1477,8 +1477,8 @@ ImageFileView::OnPlotCol (wxCommandEvent& event)
   int ny = rIF.ny();
 
   if (v != NULL && xCursor < nx) {
-    double* pX = new double [ny];
-    double* pYReal = new double [ny];
+    double* const pX = new double [ny];
+    double* const pYReal = new double [ny];
     double* pYImag = NULL;
     double* pYMag = NULL;
     if (rIF.isComplex()) {
@@ -1499,7 +1499,7 @@ ImageFileView::OnPlotCol (wxCommandEvent& event)
     } else {
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Column " << xCursor;
+      os << "Column " << xCursor << ": ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1529,7 +1529,7 @@ ImageFileView::OnPlotCol (wxCommandEvent& event)
       }
       for (unsigned int iL = 0; iL < rIF.nLabels(); iL++)
         rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str());
-      os << " Plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
     }
@@ -1599,7 +1599,7 @@ ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
     } else {
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Row " << yCursor;
+      os << "Row " << yCursor << ": ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1624,7 +1624,7 @@ ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
       rPlotFile.addColumn (3, pYMag);
       for (unsigned int iL = 0; iL < rIF.nLabels(); iL++)
         rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str());
-      os << " FFT Plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " FFT Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
     }
@@ -1699,7 +1699,7 @@ ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
     } else {
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Column " << xCursor;
+      os << "Column " << xCursor << ": ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1724,7 +1724,7 @@ ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
       rPlotFile.addColumn (3, pYMag);
       for (unsigned int iL = 0; iL < rIF.nLabels(); iL++)
         rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str());
-      os << " FFT Plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " FFT Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
     }
@@ -1786,7 +1786,7 @@ ImageFileView::OnCompareCol (wxCommandEvent& event)
       } else {
         PlotFile& rPlotFile = pPlotDoc->getPlotFile();
         std::ostringstream os;
-        os << "Column " << xCursor << " Comparison";
+        os << "Column " << xCursor << ": Comparison";
         std::string title("title ");
         title += os.str();
         rPlotFile.addEzsetCommand (title.c_str());
@@ -1808,7 +1808,7 @@ ImageFileView::OnCompareCol (wxCommandEvent& event)
         unsigned int iL;
         for (iL = 0; iL < rIF.nLabels(); iL++) {
           std::ostringstream os;
-          os << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().mb_str(wxConvUTF8);
+          os << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
           os << ": " << rIF.labelGet(iL).getLabelString();
           rPlotFile.addDescription (os.str().c_str());
         }
@@ -1819,8 +1819,8 @@ ImageFileView::OnCompareCol (wxCommandEvent& event)
           os << rCompareIF.labelGet(iL).getLabelString();
           rPlotFile.addDescription (os.str().c_str());
         }
-        os << " Between " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str() << " and "
-           << dynamic_cast<wxFrame*>(pCompareDoc->GetFirstView()->GetFrame())->GetTitle().c_str();
+        os << " between " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().mb_str(wxConvUTF8) << " and "
+           << dynamic_cast<wxFrame*>(pCompareDoc->GetFirstView()->GetFrame())->GetTitle().mb_str(wxConvUTF8);
         *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
         rPlotFile.addDescription (os.str().c_str());
       }
@@ -1880,7 +1880,7 @@ ImageFileView::OnCompareRow (wxCommandEvent& event)
       } else {
         PlotFile& rPlotFile = pPlotDoc->getPlotFile();
         std::ostringstream os;
-        os << "Row " << yCursor << " Comparison";
+        os << "Row " << yCursor << ": Comparison";
         std::string title("title ");
         title += os.str();
         rPlotFile.addEzsetCommand (title.c_str());
@@ -1912,8 +1912,8 @@ ImageFileView::OnCompareRow (wxCommandEvent& event)
              << rCompareIF.labelGet(iL).getLabelString();
           rPlotFile.addDescription (os.str().c_str());
         }
-        os << " Between " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().mb_str(wxConvUTF8) << " and "
-           << dynamic_cast<wxFrame*>(pCompareDoc->GetFirstView()->GetFrame())->GetTitle().c_str();
+        os << " between " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().mb_str(wxConvUTF8) << " and "
+           << dynamic_cast<wxFrame*>(pCompareDoc->GetFirstView()->GetFrame())->GetTitle().mb_str(wxConvUTF8);
         *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
         rPlotFile.addDescription (os.str().c_str());
       }
@@ -1965,7 +1965,7 @@ ImageFileView::OnPlotHistogram (wxCommandEvent& event)
 
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Histogram";
+      os << "Histogram ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1982,7 +1982,7 @@ ImageFileView::OnPlotHistogram (wxCommandEvent& event)
         os << ": " << rIF.labelGet(iL).getLabelString();
         rPlotFile.addDescription (os.str().c_str());
       }
-      os << "  plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
       delete pX;
@@ -2143,18 +2143,18 @@ PhantomFileView::OnProjections (wxCommandEvent& event)
   }
 
   std::ostringstream os;
-  os << "Projections for " << rPhantom.name()
-        << ": nDet=" << m_iDefaultNDet
-    << ", nView=" << m_iDefaultNView
-        << ", gantry offset=" << m_iDefaultOffsetView
-        << ", nSamples=" << m_iDefaultNSample
-    << ", RotAngle=" << m_dDefaultRotation
-        << ", FocalLengthRatio=" << m_dDefaultFocalLength
-    << ", CenterDetectorLengthRatio=" << m_dDefaultCenterDetectorLength
-    << ", ViewRatio=" << m_dDefaultViewRatio
-        << ", ScanRatio=" << m_dDefaultScanRatio
-    << ", Geometry=" << sGeometry.c_str()
-        << ", FanBeamAngle=" << convertRadiansToDegrees (theScanner.fanBeamAngle());
+  os << "Projections for " << rPhantom.name().c_str()
+     << ": nDet=" << m_iDefaultNDet
+     << ", nView=" << m_iDefaultNView
+     << ", gantry offset=" << m_iDefaultOffsetView
+     << ", nSamples=" << m_iDefaultNSample
+     << ", RotAngle=" << m_dDefaultRotation
+     << ", FocalLengthRatio=" << m_dDefaultFocalLength
+     << ", CenterDetectorLengthRatio=" << m_dDefaultCenterDetectorLength
+     << ", ViewRatio=" << m_dDefaultViewRatio
+     << ", ScanRatio=" << m_dDefaultScanRatio
+     << ", Geometry=" << sGeometry.mb_str(wxConvUTF8)
+     << ", FanBeamAngle=" << convertRadiansToDegrees (theScanner.fanBeamAngle());
 
   Timer timer;
   Projections* pProj = NULL;