X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fviews.cpp;h=b33086e89b495f93d41d069c28a592a65ab8cdd6;hb=0e305a6bd11df323b21c77f16159ef365b6846ff;hp=f78f9e3470dd319b5086ea5e819d2fa43c6d0147;hpb=bd1d464294e037da19ccc80d8cc60475768eb2ca;p=ctsim.git diff --git a/src/views.cpp b/src/views.cpp index f78f9e3..b33086e 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -1,7 +1,7 @@ /***************************************************************************** ** FILE IDENTIFICATION ** -** Name: view.cpp +** Name: views.cpp ** Purpose: View & Canvas routines for CTSim program ** Programmer: Kevin Rosenberg ** Date Started: July 2000 @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.146 2001/09/24 09:40:42 kevin Exp $ +** $Id: views.cpp,v 1.149 2002/04/30 18:13:40 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 @@ -1027,17 +1027,17 @@ ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) ) m_bMaxSpecified = false; m_dAutoScaleFactor = 1.; - int width, height; - m_pFrame->GetClientSize (&width, &height); + // int width, height; + // m_pFrame->GetClientSize (&width, &height); m_pFrame->SetTitle("ImageFileView"); m_pCanvas = CreateCanvas (m_pFrame); - int x, y; // X requires a forced resize - m_pFrame->GetSize(&x, &y); - m_pFrame->SetSize(-1, -1, x, y); + // int x, y; // X requires a forced resize + // m_pFrame->GetSize(&x, &y); + // m_pFrame->SetSize(-1, -1, x, y); m_pFrame->SetFocus(); m_pFrame->Show(true); - Activate(true); + // Activate(true); return true; } @@ -1106,7 +1106,7 @@ ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) int xSize = nx; int ySize = ny; ySize = clamp (ySize, 0, 800); - m_pFrame->SetClientSize (xSize, ySize); + // m_pFrame->SetClientSize (xSize, ySize); // KMR m_pCanvas->SetScrollbars(20, 20, nx/20, ny/20); m_pCanvas->SetBackgroundColour(*wxWHITE); } @@ -1975,7 +1975,11 @@ PhantomCanvas::GetBestSize() const int xSize, ySize; theApp->getMainFrame()->GetClientSize (&xSize, &ySize); xSize = maxValue (xSize, ySize); +#ifdef CTSIM_MDI ySize = xSize = (xSize / 4); +#else + ySize = xSize; +#endif return wxSize (xSize, ySize); } @@ -2221,14 +2225,15 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) #endif { ImageFile* pImageFile = new ImageFile (m_iDefaultRasterNX, m_iDefaultRasterNY); + wxProgressDialog dlgProgress (wxString("Rasterize"), wxString("Rasterization Progress"), - pImageFile->nx() + 1, getFrameForChild(), wxPD_CAN_ABORT ); + pImageFile->nx() + 1, getFrameForChild(), wxPD_CAN_ABORT ); Timer timer; for (unsigned int i = 0; i < pImageFile->nx(); i++) { rPhantom.convertToImagefile (*pImageFile, m_dDefaultRasterViewRatio, m_iDefaultRasterNSamples, Trace::TRACE_NONE, i, 1, true); if (! dlgProgress.Update (i+1)) { - delete pImageFile; - return; + delete pImageFile; + return; } } @@ -2240,16 +2245,17 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) pRasterDoc->setImageFile (pImageFile); if (theApp->getAskDeleteNewDocs()) pRasterDoc->Modify (true); - pRasterDoc->UpdateAllViews (this); - pRasterDoc->getView()->getFrame()->Show(true); *theApp->getLog() << os.str().c_str() << "\n"; pImageFile->labelAdd (os.str().c_str(), timer.timerEnd()); - ImageFileView* rasterView = pRasterDoc->getView(); - if (rasterView) { + + if (ImageFileView* rasterView = pRasterDoc->getView()) { + rasterView->getFrame()->Show(true); rasterView->getFrame()->SetFocus(); rasterView->OnUpdate (rasterView, NULL); } - pRasterDoc->Activate(); + // Causes loss of frame in wxGTK + // pRasterDoc->UpdateAllViews (this); + // pRasterDoc->Activate(); } } @@ -2453,7 +2459,7 @@ EVT_MENU(PJMENU_CONVERT_FFT_POLAR, ProjectionFileView::OnConvertFFTPolar) EVT_MENU(PJMENU_CONVERT_PARALLEL, ProjectionFileView::OnConvertParallel) EVT_MENU(PJMENU_PLOT_TTHETA_SAMPLING, ProjectionFileView::OnPlotTThetaSampling) EVT_MENU(PJMENU_PLOT_HISTOGRAM, ProjectionFileView::OnPlotHistogram) -EVT_MENU(PJMENU_ARTIFACT_REDUCTION, ProjectionFileView::OnArtifactReduction) + // EVT_MENU(PJMENU_ARTIFACT_REDUCTION, ProjectionFileView::OnArtifactReduction) END_EVENT_TABLE() @@ -2947,16 +2953,19 @@ ProjectionFileView::doReconstructFBP (const Projections& rProj, bool bRebinToPar pReconDoc->setImageFile (pImageFile); if (theApp->getAskDeleteNewDocs()) pReconDoc->Modify (true); - pReconDoc->UpdateAllViews (this); - pReconDoc->Activate(); - if (ImageFileView* rasterView = pReconDoc->getView()) { - rasterView->OnUpdate (rasterView, NULL); - rasterView->getFrame()->SetFocus(); - rasterView->getFrame()->Show(true); - } *theApp->getLog() << os.str().c_str() << "\n"; pImageFile->labelAdd (rProj.getLabel()); pImageFile->labelAdd (os.str().c_str(), timerRecon.timerEnd()); + + // if (ImageFileView* rasterView = pReconDoc->getView()) { + // rasterView->getFrame()->Show(true); + // rasterView->getFrame()->SetFocus(); + // rasterView->OnUpdate (rasterView, NULL); + // } + // causes loss of frame in wxGTK + pReconDoc->GetFirstView()->GetFrame()->Show(true); + pReconDoc->UpdateAllViews (); + // pReconDoc->Activate(); } @@ -3029,8 +3038,8 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) convert_menu->AppendSeparator(); convert_menu->Append (PJMENU_CONVERT_PARALLEL, "&Interpolate to Parallel"); - wxMenu* filter_menu = new wxMenu; - filter_menu->Append (PJMENU_ARTIFACT_REDUCTION, "&Artifact Reduction"); + // wxMenu* filter_menu = new wxMenu; + // filter_menu->Append (PJMENU_ARTIFACT_REDUCTION, "&Artifact Reduction"); wxMenu* analyze_menu = new wxMenu; analyze_menu->Append (PJMENU_PLOT_HISTOGRAM, "&Plot Histogram"); @@ -3051,7 +3060,7 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) menu_bar->Append (m_pFileMenu, "&File"); menu_bar->Append (convert_menu, "&Convert"); - menu_bar->Append (filter_menu, "Fi<er"); + // menu_bar->Append (filter_menu, "Fi<er"); menu_bar->Append (analyze_menu, "&Analyze"); menu_bar->Append (reconstruct_menu, "&Reconstruct"); menu_bar->Append (help_menu, "&Help");