** 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.97 2001/02/03 18:42:21 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
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)
#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");
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");
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);
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);
+#if wxUSE_GLCANVAS
+ accelEntries[10].Set (wxACCEL_CTRL, static_cast<int>('3'), IFMENU_IMAGE_CONVERT3D);
+ wxAcceleratorTable accelTable (11, accelEntries);
+#else
wxAcceleratorTable accelTable (10, accelEntries);
+#endif
+
subframe->SetAcceleratorTable (accelTable);
return subframe;
ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
{
m_pFrame = CreateChildFrame(doc, this);
- (m_pFrame);
m_bMinSpecified = false;
m_bMaxSpecified = false;
SetFrame(NULL);
if (deleteWindow) {
- m_pFrame->Destroy();
+ delete m_pFrame;
m_pFrame = NULL;
if (GetDocument() && GetDocument()->getBadFileOpen())
::wxYield(); // wxWindows bug workaround
}
}
+#if wxUSE_GLCANVAS
+void
+ImageFileView::OnConvert3d (wxCommandEvent& event)
+{
+ ImageFile& rIF = GetDocument()->getImageFile();
+ Graph3dFileDocument* pGraph3d = theApp->newGraph3dDoc();
+ pGraph3d->setBadFileOpen();
+ pGraph3d->createFromImageFile (rIF);
+ pGraph3d->getView()->OnUpdate (this, NULL);
+ pGraph3d->UpdateAllViews();
+ pGraph3d->getView()->getFrame()->SetClientSize (400, 400);
+ pGraph3d->getView()->getFrame()->Show (true);
+ GetDocumentManager()->ActivateView (pGraph3d->getView(), true, false);
+ ::wxYield();
+ pGraph3d->getView()->getCanvas()->SetFocus();
+}
+#endif
+
void
ImageFileView::OnPlotRow (wxCommandEvent& event)
{
#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");
END_EVENT_TABLE()
ProjectionFileView::ProjectionFileView()
-: wxView(), m_pCanvas(NULL), m_pFrame(NULL), m_pFileMenu(0)
+: wxView(), m_pFrame(NULL), m_pCanvas(NULL), m_pFileMenu(0)
{
#ifdef DEBUG
m_iDefaultNX = 115;
#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");
#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");
#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");