wxMaracas_N_ViewersWidget Class Reference

#include <wxMaracas_N_ViewersWidget.h>

Collaboration diagram for wxMaracas_N_ViewersWidget:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxMaracas_N_ViewersWidget (wxWindow *parent, vtkImageData *imagedata=NULL, std::vector< int > *nTypeView=NULL)
 ~wxMaracas_N_ViewersWidget ()
void Update ()
vtkRenderer * GetRenderer ()
void RefreshView ()
virtual void OnRefreshView (wxCommandEvent &event)
void OnDClickLeft (wxCommandEvent &event)
wxMaracas_ViewerWidgetGetWindow (int iWin)
wxVtkBaseViewGetwxVtkBaseView (int iWin)
virtual void Refresh (bool eraseBackground=true, const wxRect *rect=NULL)
void SetImage (vtkImageData *image)
void SetType (std::vector< int > *type)
void UpdateLayout (vtkImageData *imagedata)
double GetX ()
double GetY ()
double GetZ ()
void setColorTransferFunction (vtkColorTransferFunction *colortable)

Private Member Functions

 DECLARE_EVENT_TABLE ()

Private Attributes

wxMaracas_ViewerWidgetwxwindow1
wxMaracas_ViewerWidgetwxwindow2
wxMaracas_ViewerWidgetwxwindow3
wxMaracas_ViewerWidgetwxwindow4
wxWindow * _currentwxw
std::vector< int > * nTypeView
vtkMPRBaseDatamvtkmprbasedata


Detailed Description

Definition at line 47 of file wxMaracas_N_ViewersWidget.h.


Constructor & Destructor Documentation

wxMaracas_N_ViewersWidget::wxMaracas_N_ViewersWidget ( wxWindow *  parent,
vtkImageData *  imagedata = NULL,
std::vector< int > *  nTypeView = NULL 
)

Definition at line 45 of file wxMaracas_N_ViewersWidget.cxx.

00046                 : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
00047         {
00048                 wxwindow1               = NULL;
00049                 wxwindow2               = NULL;
00050                 wxwindow3               = NULL;
00051                 wxwindow4               = NULL;
00052                 _currentwxw             = NULL;
00053                 mvtkmprbasedata = NULL;
00054                 
00055                 wxSizer *sizer  = new wxBoxSizer(wxVERTICAL);
00056                 this->SetSizer(sizer);
00057                 this->SetAutoLayout(true);
00058                 
00059                 
00060                 if(imagedata!=NULL && nTypeView!=NULL ){
00061                         this->SetType(nTypeView);
00062                         this->UpdateLayout(imagedata);
00063                 }
00064 
00065                 
00066         }

wxMaracas_N_ViewersWidget::~wxMaracas_N_ViewersWidget (  ) 

Definition at line 69 of file wxMaracas_N_ViewersWidget.cxx.

References mvtkmprbasedata.

00070         {
00071                 if (mvtkmprbasedata!=NULL)
00072                 {
00073                         delete mvtkmprbasedata;
00074                 }
00075 
00076         }


Member Function Documentation

void wxMaracas_N_ViewersWidget::Update (  ) 

Definition at line 84 of file wxMaracas_N_ViewersWidget.cxx.

00085         {
00086                 //wxvtkrenderwindowinteractor->Render();
00087         //    wxvtkrenderwindowinteractor->Refresh();
00088         //    Refresh();
00089         }

vtkRenderer * wxMaracas_N_ViewersWidget::GetRenderer (  ) 

Definition at line 105 of file wxMaracas_N_ViewersWidget.cxx.

00106         {
00107                 return NULL; //renderer;
00108         }

void wxMaracas_N_ViewersWidget::RefreshView (  ) 

Definition at line 110 of file wxMaracas_N_ViewersWidget.cxx.

References wxMaracas_ViewerWidget::RefreshView(), wxwindow1, wxwindow2, wxwindow3, and wxwindow4.

Referenced by OnDClickLeft(), and OnRefreshView().

00111         {               
00112                 if (wxwindow1!=NULL) {wxwindow1->RefreshView(); }
00113                 if (wxwindow2!=NULL) {wxwindow2->RefreshView(); }
00114                 if (wxwindow3!=NULL) {wxwindow3->RefreshView(); }
00115                 if (wxwindow4!=NULL) {wxwindow4->RefreshView(); }
00116         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracas_N_ViewersWidget::OnRefreshView ( wxCommandEvent &  event  )  [virtual]

Definition at line 93 of file wxMaracas_N_ViewersWidget.cxx.

References RefreshView().

00094         {
00095                 RefreshView();
00096         }

Here is the call graph for this function:

void wxMaracas_N_ViewersWidget::OnDClickLeft ( wxCommandEvent &  event  ) 

Definition at line 98 of file wxMaracas_N_ViewersWidget.cxx.

References RefreshView().

00099         {
00100                 RefreshView();
00101         }

Here is the call graph for this function:

wxMaracas_ViewerWidget * wxMaracas_N_ViewersWidget::GetWindow ( int  iWin  ) 

Definition at line 119 of file wxMaracas_N_ViewersWidget.cxx.

References wxwindow1, wxwindow2, wxwindow3, and wxwindow4.

Referenced by wxMaracasSuperpositionPanel::createSuperpositionPanel(), and GetwxVtkBaseView().

00120         {
00121                 wxMaracas_ViewerWidget *tmpWin=NULL;
00122                 if  (iWin==1)
00123                 {
00124                         tmpWin=wxwindow1;
00125                 }
00126                 if  (iWin==2)
00127                 {
00128                         tmpWin=wxwindow2;
00129                 }
00130                 if  (iWin==3)
00131                 {
00132                         tmpWin=wxwindow3;
00133                 }
00134                 if  (iWin==4)
00135                 {
00136                         tmpWin=wxwindow4;
00137                 }
00138                 return tmpWin;
00139         }

Here is the caller graph for this function:

wxVtkBaseView * wxMaracas_N_ViewersWidget::GetwxVtkBaseView ( int  iWin  ) 

Definition at line 142 of file wxMaracas_N_ViewersWidget.cxx.

References GetWindow(), and wxMaracas_ViewerWidget::GetwxVtkBaseView().

Referenced by wxMaracasSuperpositionPanel::GetWxVtkBaseView(), and wxMaracasSuperpositionPanel::GetwxVtkMPR2DView().

00143         { 
00144                 wxVtkBaseView *wxvtkbaseview=NULL;
00145                 wxMaracas_ViewerWidget *tmpWin=GetWindow(iWin);
00146                 if (tmpWin!=NULL){  wxvtkbaseview = tmpWin->GetwxVtkBaseView();  }
00147                 return wxvtkbaseview;
00148         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracas_N_ViewersWidget::Refresh ( bool  eraseBackground = true,
const wxRect *  rect = NULL 
) [virtual]

Definition at line 151 of file wxMaracas_N_ViewersWidget.cxx.

Referenced by UpdateLayout().

00152         {
00153                 wxPanel::Refresh(false);
00154         }

Here is the caller graph for this function:

void wxMaracas_N_ViewersWidget::SetImage ( vtkImageData *  image  ) 

Definition at line 250 of file wxMaracas_N_ViewersWidget.cxx.

References wxMaracas_ViewerWidget::SetImage(), wxwindow1, wxwindow2, wxwindow3, and wxwindow4.

Referenced by wxMaracasSuperpositionPanel::ChangeImage().

00251  {
00252          if (wxwindow1!=NULL) { 
00253                  
00254                 wxwindow1->SetImage(image); 
00255         }
00256          if (wxwindow2!=NULL) { wxwindow2->SetImage(image); } 
00257          if (wxwindow3!=NULL) { wxwindow3->SetImage(image); }
00258          if (wxwindow4!=NULL) { wxwindow4->SetImage(image); }
00259 
00260 
00261  }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracas_N_ViewersWidget::SetType ( std::vector< int > *  type  ) 

Definition at line 243 of file wxMaracas_N_ViewersWidget.cxx.

References nTypeView.

00243                                                             {
00244          nTypeView = type;
00245  }

void wxMaracas_N_ViewersWidget::UpdateLayout ( vtkImageData *  imagedata  ) 

Definition at line 157 of file wxMaracas_N_ViewersWidget.cxx.

References _currentwxw, wxMaracas_ViewerWidget::ConfigureVTK(), mvtkmprbasedata, nTypeView, Refresh(), vtkBaseData::SetMarImageData(), wxwindow1, wxwindow2, wxwindow3, and wxwindow4.

00158         {
00159 
00160                 wxWindow                                *wxwindow       = NULL;
00161                 wxSizer *sizer                                          = this->GetSizer();     
00162                 
00163                 if (mvtkmprbasedata!=NULL)
00164                 {
00165                         delete mvtkmprbasedata;
00166                 }
00167                 
00168                 marImageData    *marimagedata   = new marImageData( imagedata );                        
00169                 mvtkmprbasedata                                 = new vtkMPRBaseData(); 
00170                 mvtkmprbasedata->SetMarImageData(marimagedata);
00171                 
00172                 if(_currentwxw != NULL){
00173                         _currentwxw->Show(false);
00174                         delete _currentwxw;
00175                         //sizer->Remove(currentwxwindow);                       
00176                         //delete currentwxwindow;
00177                 }
00178 
00179                 //std::cout<<"size "<<nTypeView->size()<<std::endl;
00180                 if (nTypeView->size()==1)
00181                 {
00182                         wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0],mvtkmprbasedata);
00183 
00184                         wxwindow1->ConfigureVTK();
00185                         wxwindow = wxwindow1;
00186                 }else   if (nTypeView->size()==2)       {
00187                         wxSplitterWindow        *spliter        = new wxSplitterWindow( this , -1);
00188                         spliter->SetMinimumPaneSize(1);
00189                         wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0],mvtkmprbasedata);
00190                         wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1],mvtkmprbasedata);
00191                         wxwindow1->ConfigureVTK();
00192                         wxwindow2->ConfigureVTK();
00193                         spliter -> SplitVertically( wxwindow1 , wxwindow2  );
00194                         wxwindow = spliter;
00195                 }else if (nTypeView->size()==3)
00196                 {
00197                         wxSplitterWindow        *spliter        = new wxSplitterWindow( this , -1);
00198                         wxSplitterWindow        *spliterA       = new wxSplitterWindow( spliter , -1);
00199                         spliter->SetMinimumPaneSize(1);
00200                         spliterA->SetMinimumPaneSize(1);
00201                         wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0],mvtkmprbasedata);
00202                         wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1],mvtkmprbasedata);
00203                         wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2],mvtkmprbasedata);
00204                         wxwindow1->ConfigureVTK();
00205                         wxwindow2->ConfigureVTK();
00206                         wxwindow3->ConfigureVTK();
00207                         spliter -> SplitVertically( wxwindow1 , spliterA   );
00208                         spliterA-> SplitHorizontally( wxwindow2 , wxwindow3  );
00209                         wxwindow = spliter;
00210                 }else if (nTypeView->size()>=4){
00211                         wxSplitterWindow        *spliter        = new wxSplitterWindow( this , -1);
00212                         wxSplitterWindow        *spliterA       = new wxSplitterWindow( spliter , -1);
00213                         wxSplitterWindow        *spliterB       = new wxSplitterWindow( spliter , -1);
00214                         spliter->SetMinimumPaneSize(1);
00215                         spliterA->SetMinimumPaneSize(1);
00216                         spliterB->SetMinimumPaneSize(1);
00217                         wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0],mvtkmprbasedata);
00218                         wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1],mvtkmprbasedata);
00219                         wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2],mvtkmprbasedata);
00220                         wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3],mvtkmprbasedata);
00221                         wxwindow1->ConfigureVTK();
00222                         wxwindow2->ConfigureVTK();
00223                         wxwindow3->ConfigureVTK();
00224                         wxwindow4->ConfigureVTK();
00225                         spliter -> SplitVertically( spliterA , spliterB   );
00226                         spliterA-> SplitHorizontally( wxwindow1 , wxwindow2  );
00227                         spliterB-> SplitHorizontally( wxwindow3 , wxwindow4  );
00228                         wxwindow = spliter;
00229                 }
00230                 
00231                 //panel->SetDimension()
00232                 sizer->Add( wxwindow , 1, wxEXPAND);
00233                 sizer->Layout();
00234                 _currentwxw = wxwindow;         
00235                 _currentwxw->Show(true);
00236                 
00237                 this->Layout();
00238                 this->Refresh();
00239  }

Here is the call graph for this function:

double wxMaracas_N_ViewersWidget::GetX (  ) 

Definition at line 264 of file wxMaracas_N_ViewersWidget.cxx.

References vtkMPRBaseData::GetX(), and mvtkmprbasedata.

00265 {
00266         return mvtkmprbasedata->GetX();
00267 //      return wxwindow1->GetX();
00268 }

Here is the call graph for this function:

double wxMaracas_N_ViewersWidget::GetY (  ) 

Definition at line 271 of file wxMaracas_N_ViewersWidget.cxx.

References vtkMPRBaseData::GetY(), and mvtkmprbasedata.

00272 {
00273         return mvtkmprbasedata->GetY();
00274 //      return wxwindow1->GetY();
00275 }

Here is the call graph for this function:

double wxMaracas_N_ViewersWidget::GetZ (  ) 

Definition at line 279 of file wxMaracas_N_ViewersWidget.cxx.

References vtkBaseData::GetZ(), and mvtkmprbasedata.

00280 {
00281         return mvtkmprbasedata->GetZ();
00282 //      return wxwindow1->GetZ();
00283 }

Here is the call graph for this function:

void wxMaracas_N_ViewersWidget::setColorTransferFunction ( vtkColorTransferFunction *  colortable  ) 

Definition at line 285 of file wxMaracas_N_ViewersWidget.cxx.

References wxMaracas_ViewerWidget::setColorTransferFunction(), wxwindow1, wxwindow2, wxwindow3, and wxwindow4.

00285                                                                                             {
00286     if (wxwindow1!=NULL) {
00287                 wxwindow1->setColorTransferFunction(colortable);
00288         }
00289         if (wxwindow2!=NULL) {
00290                 wxwindow2->setColorTransferFunction(colortable);
00291         }
00292         if (wxwindow3!=NULL) {
00293                 wxwindow3->setColorTransferFunction(colortable);
00294         }
00295         if (wxwindow4!=NULL) {
00296                 wxwindow4->setColorTransferFunction(colortable);
00297         }
00298 }

Here is the call graph for this function:

wxMaracas_N_ViewersWidget::DECLARE_EVENT_TABLE (  )  [private]


Member Data Documentation

wxMaracas_ViewerWidget* wxMaracas_N_ViewersWidget::wxwindow1 [private]

Definition at line 89 of file wxMaracas_N_ViewersWidget.h.

Referenced by GetWindow(), RefreshView(), setColorTransferFunction(), SetImage(), and UpdateLayout().

wxMaracas_ViewerWidget* wxMaracas_N_ViewersWidget::wxwindow2 [private]

Definition at line 90 of file wxMaracas_N_ViewersWidget.h.

Referenced by GetWindow(), RefreshView(), setColorTransferFunction(), SetImage(), and UpdateLayout().

wxMaracas_ViewerWidget* wxMaracas_N_ViewersWidget::wxwindow3 [private]

Definition at line 91 of file wxMaracas_N_ViewersWidget.h.

Referenced by GetWindow(), RefreshView(), setColorTransferFunction(), SetImage(), and UpdateLayout().

wxMaracas_ViewerWidget* wxMaracas_N_ViewersWidget::wxwindow4 [private]

Definition at line 92 of file wxMaracas_N_ViewersWidget.h.

Referenced by GetWindow(), RefreshView(), setColorTransferFunction(), SetImage(), and UpdateLayout().

wxWindow* wxMaracas_N_ViewersWidget::_currentwxw [private]

Definition at line 94 of file wxMaracas_N_ViewersWidget.h.

Referenced by UpdateLayout().

std::vector<int>* wxMaracas_N_ViewersWidget::nTypeView [private]

Definition at line 97 of file wxMaracas_N_ViewersWidget.h.

Referenced by SetType(), and UpdateLayout().

vtkMPRBaseData* wxMaracas_N_ViewersWidget::mvtkmprbasedata [private]

Definition at line 99 of file wxMaracas_N_ViewersWidget.h.

Referenced by GetX(), GetY(), GetZ(), UpdateLayout(), and ~wxMaracas_N_ViewersWidget().


The documentation for this class was generated from the following files:
Generated on Wed Jul 29 16:36:19 2009 for creaMaracasVisu_lib by  doxygen 1.5.3