r473: no message
[ctsim.git] / src / views.cpp
index 0a3896c012513435375f37d1f0eec593adcb9d32..a8cb6e401156268a3b544818f249ddac715ab006 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.92 2001/01/30 07:32:13 kevin Exp $
+**  $Id: views.cpp,v 1.93 2001/01/30 10:58:13 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
@@ -226,6 +226,7 @@ EVT_MENU(IFMENU_IMAGE_SUBTRACT, ImageFileView::OnSubtract)
 EVT_MENU(IFMENU_IMAGE_MULTIPLY, ImageFileView::OnMultiply)
 EVT_MENU(IFMENU_IMAGE_DIVIDE, ImageFileView::OnDivide)
 EVT_MENU(IFMENU_IMAGE_SCALESIZE, ImageFileView::OnScaleSize)
+EVT_MENU(IFMENU_IMAGE_CONVERT3D, ImageFileView::OnConvert3d)
 #ifdef HAVE_FFT
 EVT_MENU(IFMENU_FILTER_FFT, ImageFileView::OnFFT)
 EVT_MENU(IFMENU_FILTER_IFFT, ImageFileView::OnIFFT)
@@ -861,6 +862,7 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   image_menu->Append (IFMENU_IMAGE_DIVIDE, "&Divide...");
   image_menu->AppendSeparator();
   image_menu->Append (IFMENU_IMAGE_SCALESIZE, "S&cale Size...");
+  image_menu->Append (IFMENU_IMAGE_CONVERT3D, "Convert &3-D\tCtrl-3");
   
   m_pMenuAnalyze = new wxMenu;
   m_pMenuAnalyze->Append (IFMENU_PLOT_ROW, "Plot &Row");
@@ -898,7 +900,7 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   
   subframe->Centre(wxBOTH);
   
-  wxAcceleratorEntry accelEntries[10];
+  wxAcceleratorEntry accelEntries[11];
   accelEntries[0].Set (wxACCEL_CTRL, static_cast<int>('O'), wxID_OPEN);
   accelEntries[1].Set (wxACCEL_CTRL, static_cast<int>('S'), wxID_SAVE);
   accelEntries[2].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_CLOSE);
@@ -909,7 +911,8 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   accelEntries[7].Set (wxACCEL_CTRL, static_cast<int>('A'), IFMENU_VIEW_SCALE_AUTO);
   accelEntries[8].Set (wxACCEL_CTRL, static_cast<int>('U'), IFMENU_VIEW_SCALE_FULL);
   accelEntries[9].Set (wxACCEL_CTRL, static_cast<int>('E'), IFMENU_VIEW_SCALE_MINMAX);
-  wxAcceleratorTable accelTable (10, accelEntries);
+  accelEntries[0].Set (wxACCEL_CTRL, static_cast<int>('3'), IFMENU_IMAGE_CONVERT3D);
+  wxAcceleratorTable accelTable (11, accelEntries);
   subframe->SetAcceleratorTable (accelTable);
   
   return subframe;
@@ -1105,6 +1108,17 @@ ImageFileView::OnScaleSize (wxCommandEvent& event)
   }
 }
 
+void
+ImageFileView::OnConvert3d (wxCommandEvent& event)
+{
+  ImageFile& rIF = GetDocument()->getImageFile();
+  Graph3dFileDocument* pGraph3d = theApp->newGraph3dDoc();
+  pGraph3d->setBadFileOpen();
+  pGraph3d->createFromImageFile (rIF);
+  pGraph3d->getView()->getFrame()->SetClientSize (200, 200);
+  pGraph3d->getView()->getFrame()->Show (true);
+}
+  
 void
 ImageFileView::OnPlotRow (wxCommandEvent& event)
 {