//---------------------------------------------------------------------------------------------------------------- // Class definition include //---------------------------------------------------------------------------------------------------------------- #include "wxMaracasSuperpositionPanel.h" //---------------------------------------------------------------------------------------------------------------- // Other includes //---------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ wxMaracasSuperpositionPanel :: wxMaracasSuperpositionPanel ( std::vector imgs, int type, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd ) :wxPanel(parent, -1, pos, size, style) { _images = imgs; _type = type; int gapH = 20; int gapV = 10; createSuperpositionPanel(); outSizer = new wxFlexGridSizer(1, 1, gapH, gapV); outSizer -> AddGrowableCol(0); outSizer -> AddGrowableRow(0); outSizer->Add( theViewPanel, 1, wxGROW); this->SetSizer( outSizer ); this->SetAutoLayout( true ); this->Layout(); } wxMaracasSuperpositionPanel :: ~wxMaracasSuperpositionPanel() { } //------------------------------------------------------------------------------------------------------------ // Creational and initialization methods //------------------------------------------------------------------------------------------------------------ void wxMaracasSuperpositionPanel :: createSuperpositionPanel() { std::vector * numViews = new std::vector (); numViews->push_back(0); if (_type==1 || _type==3) { theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[0], numViews ); } else if (_type==2) { theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[1], numViews ); } SetVisibleAxis(false); theViewPanel->SetBackgroundColour(wxColour(0,0,0)); theViewPanel->SetSize(800, 900); theViewPanel->GetWindow(1)->SetSize(800, 900); } //------------------------------------------------------------------------------------------------------------ wxVtkBaseView* wxMaracasSuperpositionPanel :: GetWxVtkBaseView() { return theViewPanel->GetwxVtkBaseView(1); } wxVtkMPR2DView * wxMaracasSuperpositionPanel::GetwxVtkMPR2DView() { return (wxVtkMPR2DView *) (theViewPanel->GetwxVtkBaseView(1)); } vtkImageData * wxMaracasSuperpositionPanel::GetshowingVID() { return _images[0]; } int wxMaracasSuperpositionPanel::GetImageDataSizeZ() { int ext[6]; GetshowingVID()->GetExtent(ext); int sizeZ = ext[5]-ext[4]+1; return sizeZ; } void wxMaracasSuperpositionPanel :: RefreshInterface() { GetWxVtkBaseView()->Refresh(); } void wxMaracasSuperpositionPanel :: ChangeImage(vtkImageData* img) { theViewPanel->SetImage(img); } //------------------------------------------------------------------------------------------------------------ // Other functional methods //------------------------------------------------------------------------------------------------------------ void wxMaracasSuperpositionPanel::SetVisibleAxis(bool ok) { GetwxVtkMPR2DView()->SetVisibleAxis(ok); } //------------------------------------------------------------------------------------------------------------ int wxMaracasSuperpositionPanel::GetX() { return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetX(); } //------------------------------------------------------------------------------------------------------------ int wxMaracasSuperpositionPanel::GetY() { return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetY(); } //------------------------------------------------------------------------------------------------------------ int wxMaracasSuperpositionPanel::GetZ() { return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetZ(); } //------------------------------------------------------------------------------------------------------------ void wxMaracasSuperpositionPanel::Refresh() { GetwxVtkMPR2DView()->GetRenWin()->Render(); }