2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "wxMaracasSuperpositionPanel.h"
7 //----------------------------------------------------------------------------------------------------------------
9 //----------------------------------------------------------------------------------------------------------------
11 //------------------------------------------------------------------------------------------------------------
12 // Constructors & Destructors
13 //------------------------------------------------------------------------------------------------------------
15 wxMaracasSuperpositionPanel :: wxMaracasSuperpositionPanel ( std::vector<vtkImageData*> imgs, int type, 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)
22 createSuperpositionPanel();
24 outSizer = new wxFlexGridSizer(1, 1, gapH, gapV);
25 outSizer -> AddGrowableCol(0);
26 outSizer -> AddGrowableRow(0);
27 outSizer->Add( theViewPanel, 1, wxGROW);
29 this->SetSizer( outSizer );
30 this->SetAutoLayout( true );
35 wxMaracasSuperpositionPanel :: ~wxMaracasSuperpositionPanel()
40 //------------------------------------------------------------------------------------------------------------
41 // Creational and initialization methods
42 //------------------------------------------------------------------------------------------------------------
44 void wxMaracasSuperpositionPanel :: createSuperpositionPanel()
47 std::vector<int> * numViews = new std::vector<int> ();
48 numViews->push_back(0);
50 if (_type==1 || _type==3)
52 theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[0], numViews );
56 theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[1], numViews );
59 SetVisibleAxis(false);
61 theViewPanel->SetBackgroundColour(wxColour(0,0,0));
63 theViewPanel->SetSize(800, 900);
64 theViewPanel->GetWindow(1)->SetSize(800, 900);
67 //------------------------------------------------------------------------------------------------------------
69 wxVtkBaseView* wxMaracasSuperpositionPanel :: GetWxVtkBaseView()
71 return theViewPanel->GetwxVtkBaseView(1);
75 wxVtkMPR2DView * wxMaracasSuperpositionPanel::GetwxVtkMPR2DView()
77 return (wxVtkMPR2DView *) (theViewPanel->GetwxVtkBaseView(1));
80 vtkImageData * wxMaracasSuperpositionPanel::GetshowingVID()
85 int wxMaracasSuperpositionPanel::GetImageDataSizeZ()
88 GetshowingVID()->GetExtent(ext);
89 int sizeZ = ext[5]-ext[4]+1;
94 void wxMaracasSuperpositionPanel :: RefreshInterface()
96 GetWxVtkBaseView()->Refresh();
99 void wxMaracasSuperpositionPanel :: ChangeImage(vtkImageData* img)
101 theViewPanel->SetImage(img);
104 //------------------------------------------------------------------------------------------------------------
105 // Other functional methods
106 //------------------------------------------------------------------------------------------------------------
108 void wxMaracasSuperpositionPanel::SetVisibleAxis(bool ok)
110 GetwxVtkMPR2DView()->SetVisibleAxis(ok);
113 //------------------------------------------------------------------------------------------------------------
114 int wxMaracasSuperpositionPanel::GetX()
116 return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetX();
118 //------------------------------------------------------------------------------------------------------------
119 int wxMaracasSuperpositionPanel::GetY()
121 return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetY();
123 //------------------------------------------------------------------------------------------------------------
124 int wxMaracasSuperpositionPanel::GetZ()
126 return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetZ();
129 //------------------------------------------------------------------------------------------------------------
130 void wxMaracasSuperpositionPanel::Refresh()
132 GetwxVtkMPR2DView()->GetRenWin()->Render();