X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fviews.h;h=40cc6fde0f03285f0da50b64420ef61fac7cd225;hp=f395c94df6cde30da3e1835648dcdae10743542b;hb=bd1d464294e037da19ccc80d8cc60475768eb2ca;hpb=91fb88e205c5bc7b771faf601db8489a9278c1ab diff --git a/src/views.h b/src/views.h index f395c94..40cc6fd 100644 --- a/src/views.h +++ b/src/views.h @@ -7,9 +7,9 @@ ** Date Started: July 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.h,v 1.31 2001/01/26 21:33:06 kevin Exp $ +** $Id: views.h,v 1.56 2001/09/24 09:40:42 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 @@ -35,6 +35,11 @@ #include "wx/wx.h" #include "docs.h" #include "imagefile.h" +#include "threadrecon.h" + +#if wxUSE_GLCANVAS +#include "graph3dview.h" +#endif class ImageFileCanvas; class ImageFileView : public wxView @@ -44,13 +49,20 @@ private: wxMemoryDC m_memoryDC; wxBitmap m_bitmap; + wxMenu* m_pMenuAnalyze; - ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); - wxMenu* m_pFileMenu; + ImageFileCanvas *CreateCanvas (wxFrame* parent); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - ImageFileCanvas *m_canvas; - wxFrame *m_frame; + ImageFileCanvas *m_pCanvas; + wxMenu* m_pFileMenu; + wxMenu* m_pFilterMenu; bool m_bMinSpecified; bool m_bMaxSpecified; double m_dMinPixel; @@ -61,16 +73,16 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: ImageFileView(); virtual ~ImageFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } wxMenu* getFileMenu() { return m_pFileMenu; } @@ -80,12 +92,16 @@ public: void OnUpdate(wxView *sender, wxObject *hint = NULL); bool OnClose (bool deleteWindow = true); - void OnScaleSize (wxCommandEvent& event); - void OnExport (wxCommandEvent& event); - + void OnEditCopy (wxCommandEvent& event); + void OnEditCut (wxCommandEvent& event); + void OnEditPaste (wxCommandEvent& event); + + void OnRevert (wxCommandEvent& event); + void OnExport (wxCommandEvent& event); void OnProperties (wxCommandEvent& event); - void OnCompare (wxCommandEvent& event); - + + void OnCompare (wxCommandEvent& event); + void OnScaleSize (wxCommandEvent& event); void OnInvertValues (wxCommandEvent& event); void OnSquare (wxCommandEvent& event); void OnSquareRoot (wxCommandEvent& event); @@ -99,7 +115,10 @@ public: void OnInverseFourier (wxCommandEvent& event); void OnShuffleNaturalToFourierOrder (wxCommandEvent& event); void OnShuffleFourierToNaturalOrder (wxCommandEvent& event); - +#if wxUSE_GLCANVAS + void OnConvert3d (wxCommandEvent& event); +#endif + #ifdef HAVE_FFT void OnFFT (wxCommandEvent& event); void OnIFFT (wxCommandEvent& event); @@ -111,6 +130,8 @@ public: void OnMagnitude (wxCommandEvent& event); void OnPhase (wxCommandEvent& event); + void OnReal (wxCommandEvent& event); + void OnImaginary (wxCommandEvent& event); void OnScaleAuto (wxCommandEvent& event); void OnScaleMinMax (wxCommandEvent& event); @@ -125,9 +146,14 @@ public: void OnCompareRow (wxCommandEvent& event); void OnCompareCol (wxCommandEvent& event); - wxFrame* getFrame() - { return m_frame; } - +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif + + wxMenu* getMenuAnalyze() { return m_pMenuAnalyze; } + ImageFileDocument* GetDocument() { return dynamic_cast(wxView::GetDocument()); } @@ -137,16 +163,17 @@ public: class ImageFileCanvas: public wxScrolledWindow { private: - + ImageFileView* m_pView; + int m_xCursor; int m_yCursor; - ImageFileView* m_pView; public: ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style); virtual ~ImageFileCanvas(); virtual void OnDraw(wxDC& dc); + void OnChar(wxKeyEvent& event); void OnMouseEvent(wxMouseEvent& event); void DrawRubberBandCursor (wxDC& dc, int x, int y); bool GetCurrentCursor (int& x, int& y); @@ -163,19 +190,24 @@ public: class ProjectionFileCanvas; class ProjectionFileView : public wxView { +private: DECLARE_DYNAMIC_CLASS(ProjectionFileView) - wxMemoryDC m_memoryDC; + wxMemoryDC m_memoryDC; wxBitmap m_bitmap; -private: - ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); + ProjectionFileCanvas *CreateCanvas (wxFrame* parent); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - ProjectionFileCanvas *m_canvas; - wxFrame *m_frame; + ProjectionFileCanvas *m_pCanvas; wxMenu* m_pFileMenu; - + int m_iDefaultNX; int m_iDefaultNY; int m_iDefaultFilter; @@ -195,16 +227,16 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: ProjectionFileView(); virtual ~ProjectionFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC* dc); @@ -212,12 +244,25 @@ public: bool OnClose (bool deleteWindow = true); void OnProperties (wxCommandEvent& event); void OnReconstructFBP (wxCommandEvent& event); + void OnReconstructFBPRebin (wxCommandEvent& event); void OnReconstructFourier (wxCommandEvent& event); + void OnConvertRectangular (wxCommandEvent& event); void OnConvertPolar (wxCommandEvent& event); void OnConvertFFTPolar (wxCommandEvent& event); - - wxFrame* getFrame () { return m_frame; } - + void OnPlotTThetaSampling (wxCommandEvent& event); + void OnPlotHistogram (wxCommandEvent& event); + void OnConvertParallel (wxCommandEvent& event); + void OnArtifactReduction (wxCommandEvent& event); + + void doReconstructFBP (const Projections& rProj, bool bRebinToParallel); + +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif + ProjectionFileCanvas* getCanvas() { return m_pCanvas; } + wxMenu* getFileMenu() { return m_pFileMenu; } ProjectionFileDocument* GetDocument() @@ -248,38 +293,47 @@ private: DECLARE_DYNAMIC_CLASS(PhantomFileView) DECLARE_EVENT_TABLE() - PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); + PhantomCanvas *CreateCanvas (wxFrame* parent); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - PhantomCanvas *m_canvas; - wxFrame *m_frame; + PhantomCanvas *m_pCanvas; wxMenu* m_pFileMenu; int m_iDefaultNDet; int m_iDefaultNView; + int m_iDefaultOffsetView; int m_iDefaultNSample; int m_iDefaultGeometry; int m_iDefaultTrace; double m_dDefaultRotation; double m_dDefaultFocalLength; - double m_dDefaultFieldOfView; + double m_dDefaultCenterDetectorLength; + double m_dDefaultViewRatio; + double m_dDefaultScanRatio; int m_iDefaultRasterNX; int m_iDefaultRasterNY; int m_iDefaultRasterNSamples; + double m_dDefaultRasterViewRatio; wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: PhantomFileView(); virtual ~PhantomFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnUpdate(wxView *sender, wxObject *hint = NULL); @@ -293,7 +347,11 @@ public: { return dynamic_cast(wxView::GetDocument()); } wxMenu* getFileMenu() { return m_pFileMenu; } - wxFrame* getFrame() { return m_frame; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif }; class PhantomCanvas: public wxScrolledWindow @@ -305,6 +363,7 @@ public: PhantomCanvas (PhantomFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style); virtual ~PhantomCanvas(); + virtual wxSize GetBestSize() const; void setView(PhantomFileView* pView) { m_pView = pView; } virtual void OnDraw(wxDC& dc); @@ -316,13 +375,17 @@ class PlotFileView : public wxView DECLARE_DYNAMIC_CLASS(PlotFileView) private: - PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - PlotFileCanvas *m_canvas; - wxFrame *m_frame; - wxMenu* m_pFileMenu; + PlotFileCanvas *m_pCanvas; EZPlot* m_pEZPlot; + wxMenu* m_pFileMenu; bool m_bMinSpecified; bool m_bMaxSpecified; @@ -330,18 +393,19 @@ private: double m_dMaxPixel; double m_dAutoScaleFactor; + PlotFileCanvas *CreateCanvas (wxFrame* parent); wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: PlotFileView(); virtual ~PlotFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC* dc); @@ -353,8 +417,11 @@ public: void OnScaleAuto (wxCommandEvent& event); void OnScaleFull (wxCommandEvent& event); - wxFrame* getFrame () - { return m_frame; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif wxMenu* getFileMenu() { return m_pFileMenu; } PlotFileDocument* GetDocument() @@ -385,7 +452,13 @@ class TextFileView: public wxView private: DECLARE_DYNAMIC_CLASS(TextFileView) - wxFrame *m_pFrame; +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif wxMenu* m_pFileMenu; TextFileCanvas *m_pCanvas; @@ -397,16 +470,21 @@ public: void canvasClosed() { m_pFrame = NULL; } - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); - bool OnCreate (wxDocument *doc, long flags); void OnDraw (wxDC *dc); void OnUpdate (wxView *sender, wxObject *hint = (wxObject *) NULL); bool OnClose (bool deleteWindow = TRUE); + TextFileDocument* GetDocument() + { return dynamic_cast(wxView::GetDocument()); } + TextFileCanvas* getTextCtrl() { return m_pCanvas; } - wxFrame* getFrame() { return m_pFrame; } wxMenu* getFileMenu() { return m_pFileMenu; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif }; class TextFileCanvas: public wxTextCtrl