2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "wxMaracasSuperpositionPanel.h"
7 //----------------------------------------------------------------------------------------------------------------
9 //----------------------------------------------------------------------------------------------------------------
11 //------------------------------------------------------------------------------------------------------------
12 // Constructors & Destructors
13 //------------------------------------------------------------------------------------------------------------
15 wxMaracasSuperpositionPanel :: wxMaracasSuperpositionPanel ( std::vector<vtkImageData*> imgs, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
16 :wxPanel(parent, -1, pos, size, style)
21 createSuperpositionPanel();
23 outSizer = new wxFlexGridSizer(1, 1, gapH, gapV);
24 outSizer -> AddGrowableCol(0);
25 outSizer -> AddGrowableRow(0);
26 outSizer->Add( theViewPanel, 1, wxGROW);
28 this->SetSizer( outSizer );
29 this->SetAutoLayout( true );
34 wxMaracasSuperpositionPanel :: ~wxMaracasSuperpositionPanel()
39 //------------------------------------------------------------------------------------------------------------
40 // Creational and initialization methods
41 //------------------------------------------------------------------------------------------------------------
43 void wxMaracasSuperpositionPanel :: createSuperpositionPanel()
46 std::vector<int> * numViews = new std::vector<int> ();
47 numViews->push_back(0);
48 theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[0], numViews );
49 SetVisibleAxis(false);
51 theViewPanel->SetBackgroundColour(wxColour(0,0,0));
53 theViewPanel->SetSize(800, 900);
54 theViewPanel->GetWindow(1)->SetSize(800, 900);
57 //------------------------------------------------------------------------------------------------------------
59 wxVtkBaseView* wxMaracasSuperpositionPanel :: GetWxVtkBaseView()
61 return theViewPanel->GetwxVtkBaseView(1);
65 wxVtkMPR2DView * wxMaracasSuperpositionPanel::GetwxVtkMPR2DView()
67 return (wxVtkMPR2DView *) (theViewPanel->GetwxVtkBaseView(1));
70 vtkImageData * wxMaracasSuperpositionPanel::GetshowingVID()
75 int wxMaracasSuperpositionPanel::GetImageDataSizeZ()
78 GetshowingVID()->GetExtent(ext);
79 int sizeZ = ext[5]-ext[4]+1;
84 void wxMaracasSuperpositionPanel :: RefreshInterface()
86 GetWxVtkBaseView()->Refresh();
89 void wxMaracasSuperpositionPanel :: ChangeImage(vtkImageData* img)
91 theViewPanel->SetImage(img);
94 //------------------------------------------------------------------------------------------------------------
95 // Other functional methods
96 //------------------------------------------------------------------------------------------------------------
98 void wxMaracasSuperpositionPanel::SetVisibleAxis(bool ok)
100 GetwxVtkMPR2DView()->SetVisibleAxis(ok);
103 //------------------------------------------------------------------------------------------------------------
104 int wxMaracasSuperpositionPanel::GetX()
106 return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetX();
108 //------------------------------------------------------------------------------------------------------------
109 int wxMaracasSuperpositionPanel::GetY()
111 return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetY();
113 //------------------------------------------------------------------------------------------------------------
114 int wxMaracasSuperpositionPanel::GetZ()
116 return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetZ();
119 //------------------------------------------------------------------------------------------------------------
120 void wxMaracasSuperpositionPanel::Refresh()
122 GetwxVtkMPR2DView()->GetRenWin()->Render();