wxMaracasSuperpositionPanel.cxx

Go to the documentation of this file.
00001 
00002 //----------------------------------------------------------------------------------------------------------------
00003 // Class definition include
00004 //----------------------------------------------------------------------------------------------------------------
00005 #include "wxMaracasSuperpositionPanel.h"
00006 
00007 //----------------------------------------------------------------------------------------------------------------
00008 // Other includes
00009 //----------------------------------------------------------------------------------------------------------------
00010         
00011         //------------------------------------------------------------------------------------------------------------
00012         // Constructors & Destructors
00013         //------------------------------------------------------------------------------------------------------------
00014 
00015         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 )   
00016         :wxPanel(parent, -1, pos, size, style)          
00017         {                               
00018                 _images = imgs;
00019                 _type = type;
00020                 int gapH = 20;
00021                 int gapV = 10;
00022                 createSuperpositionPanel();
00023 
00024                 outSizer = new wxFlexGridSizer(1, 1, gapH, gapV);
00025                 outSizer -> AddGrowableCol(0);
00026                 outSizer -> AddGrowableRow(0);
00027                 outSizer->Add( theViewPanel, 1, wxGROW);
00028                                                                 
00029                 this->SetSizer( outSizer );
00030                 this->SetAutoLayout( true );
00031                 this->Layout();
00032         }
00033         
00034 
00035         wxMaracasSuperpositionPanel :: ~wxMaracasSuperpositionPanel()
00036         {
00037 
00038         }
00039 
00040         //------------------------------------------------------------------------------------------------------------
00041         // Creational and initialization methods
00042         //------------------------------------------------------------------------------------------------------------
00043         
00044         void wxMaracasSuperpositionPanel :: createSuperpositionPanel()
00045         {               
00046 
00047                 std::vector<int> * numViews = new std::vector<int> ();
00048                 numViews->push_back(0);
00049                 
00050                 if (_type==1 || _type==3)
00051                 {
00052                         theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[0], numViews );                     
00053                 }
00054                 else if (_type==2)
00055                 {
00056                         theViewPanel = new wxMaracas_N_ViewersWidget( this, _images[1], numViews );                                             
00057                 }
00058                 
00059                 SetVisibleAxis(false);
00060 
00061                 theViewPanel->SetBackgroundColour(wxColour(0,0,0));
00062 
00063                 theViewPanel->SetSize(800, 900);
00064                 theViewPanel->GetWindow(1)->SetSize(800, 900);  
00065         }
00066 
00067         //------------------------------------------------------------------------------------------------------------
00068 
00069         wxVtkBaseView* wxMaracasSuperpositionPanel :: GetWxVtkBaseView()
00070         {
00071                 return theViewPanel->GetwxVtkBaseView(1);
00072         }
00073 
00074 
00075         wxVtkMPR2DView * wxMaracasSuperpositionPanel::GetwxVtkMPR2DView() 
00076         {
00077                 return (wxVtkMPR2DView *) (theViewPanel->GetwxVtkBaseView(1));
00078         }
00079 
00080         vtkImageData * wxMaracasSuperpositionPanel::GetshowingVID() 
00081         {
00082                 return _images[0];
00083         }
00084 
00085         int wxMaracasSuperpositionPanel::GetImageDataSizeZ()
00086         {
00087                 int ext[6];
00088                 GetshowingVID()->GetExtent(ext);
00089                 int sizeZ = ext[5]-ext[4]+1;
00090 
00091                 return sizeZ;
00092         }
00093 
00094         void wxMaracasSuperpositionPanel :: RefreshInterface()
00095         {
00096                 GetWxVtkBaseView()->Refresh();
00097         }
00098 
00099         void wxMaracasSuperpositionPanel :: ChangeImage(vtkImageData* img)
00100         {
00101                 theViewPanel->SetImage(img);
00102         }
00103         
00104         //------------------------------------------------------------------------------------------------------------
00105         //  Other functional methods
00106         //------------------------------------------------------------------------------------------------------------
00107 
00108         void wxMaracasSuperpositionPanel::SetVisibleAxis(bool ok)
00109         {
00110                 GetwxVtkMPR2DView()->SetVisibleAxis(ok);
00111         }
00112 
00113         //------------------------------------------------------------------------------------------------------------
00114         int wxMaracasSuperpositionPanel::GetX()
00115         {
00116                 return  GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetX();
00117         }
00118         //------------------------------------------------------------------------------------------------------------
00119         int wxMaracasSuperpositionPanel::GetY()
00120         {
00121                 return  GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetY();
00122         }
00123         //------------------------------------------------------------------------------------------------------------
00124         int wxMaracasSuperpositionPanel::GetZ()
00125         {
00126                 return  GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetZ();
00127         }
00128 
00129         //------------------------------------------------------------------------------------------------------------
00130         void wxMaracasSuperpositionPanel::Refresh()
00131         {
00132                 GetwxVtkMPR2DView()->GetRenWin()->Render();
00133         }
00134         

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1