X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fviews.cpp;h=ba400e708a4cf336038b2d2bc07dcdbe3276b3fd;hb=22d00c00e9e45cdcb489c8cbbfc1b996f8ee981d;hp=28d663e7009e842f7b8291190cf13c3948c1c7ab;hpb=d3a6bf4aa2ccd32ed7671d1d97777dfc414df51d;p=ctsim.git diff --git a/src/views.cpp b/src/views.cpp index 28d663e..ba400e7 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.91 2001/01/30 05:05:41 kevin Exp $ +** $Id: views.cpp,v 1.94 2001/01/31 01:01:22 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,9 @@ 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) +#if wxUSE_GLCANVAS +EVT_MENU(IFMENU_IMAGE_CONVERT3D, ImageFileView::OnConvert3d) +#endif #ifdef HAVE_FFT EVT_MENU(IFMENU_FILTER_FFT, ImageFileView::OnFFT) EVT_MENU(IFMENU_FILTER_IFFT, ImageFileView::OnIFFT) @@ -799,7 +802,7 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) #endif theApp->setIconForFrame (subframe); - wxMenu *m_pFileMenu = new wxMenu; + m_pFileMenu = new wxMenu; m_pFileMenu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P"); m_pFileMenu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F"); @@ -861,6 +864,9 @@ 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..."); +#if wxUSE_GLCANVAS + image_menu->Append (IFMENU_IMAGE_CONVERT3D, "Convert &3-D\tCtrl-3"); +#endif m_pMenuAnalyze = new wxMenu; m_pMenuAnalyze->Append (IFMENU_PLOT_ROW, "Plot &Row"); @@ -898,7 +904,7 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) subframe->Centre(wxBOTH); - wxAcceleratorEntry accelEntries[10]; + wxAcceleratorEntry accelEntries[11]; accelEntries[0].Set (wxACCEL_CTRL, static_cast('O'), wxID_OPEN); accelEntries[1].Set (wxACCEL_CTRL, static_cast('S'), wxID_SAVE); accelEntries[2].Set (wxACCEL_CTRL, static_cast('W'), wxID_CLOSE); @@ -909,7 +915,13 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) accelEntries[7].Set (wxACCEL_CTRL, static_cast('A'), IFMENU_VIEW_SCALE_AUTO); accelEntries[8].Set (wxACCEL_CTRL, static_cast('U'), IFMENU_VIEW_SCALE_FULL); accelEntries[9].Set (wxACCEL_CTRL, static_cast('E'), IFMENU_VIEW_SCALE_MINMAX); +#if wxUSE_GLCANVAS + accelEntries[10].Set (wxACCEL_CTRL, static_cast('3'), IFMENU_IMAGE_CONVERT3D); + wxAcceleratorTable accelTable (11, accelEntries); +#else wxAcceleratorTable accelTable (10, accelEntries); +#endif + subframe->SetAcceleratorTable (accelTable); return subframe; @@ -1105,6 +1117,19 @@ ImageFileView::OnScaleSize (wxCommandEvent& event) } } +#if wxUSE_GLCANVAS +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); +} +#endif + void ImageFileView::OnPlotRow (wxCommandEvent& event) { @@ -1969,7 +1994,7 @@ PhantomFileView::CreateChildFrame(wxDocument *doc, wxView *view) #endif theApp->setIconForFrame (subframe); - wxMenu *m_pFileMenu = new wxMenu; + m_pFileMenu = new wxMenu; m_pFileMenu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P"); m_pFileMenu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F"); @@ -2376,7 +2401,7 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) #endif theApp->setIconForFrame (subframe); - wxMenu *m_pFileMenu = new wxMenu; + m_pFileMenu = new wxMenu; m_pFileMenu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P"); m_pFileMenu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F"); @@ -2706,7 +2731,7 @@ PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view) #endif theApp->setIconForFrame (subframe); - wxMenu *m_pFileMenu = new wxMenu; + m_pFileMenu = new wxMenu; m_pFileMenu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P"); m_pFileMenu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F"); @@ -2966,7 +2991,7 @@ TextFileView::CreateChildFrame (wxDocument *doc, wxView *view) #endif theApp->setIconForFrame (subframe); - wxMenu *m_pFileMenu = new wxMenu; + m_pFileMenu = new wxMenu; m_pFileMenu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P"); m_pFileMenu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F");