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 ConfigureVTK ()
void SetType (std::vector< int > *type)
void UpdateLayout (vtkImageData *imagedata)
double GetX ()
double GetY ()
double GetZ ()
void setColorTransferFunction (vtkColorTransferFunction *colortable)
void setWindowLevel (double level)
void setColorLevel (double level)

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::ConfigureVTK (  ) 

Definition at line 259 of file wxMaracas_N_ViewersWidget.cxx.

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

00260  {
00261          if (wxwindow1!=NULL) { wxwindow1->ConfigureVTK(); }
00262          if (wxwindow2!=NULL) { wxwindow2->ConfigureVTK(); }
00263          if (wxwindow3!=NULL) { wxwindow3->ConfigureVTK(); }
00264          if (wxwindow4!=NULL) { wxwindow4->ConfigureVTK(); }
00265  }

Here is the call graph for this function:

wxMaracas_N_ViewersWidget::DECLARE_EVENT_TABLE (  )  [private]
vtkRenderer * wxMaracas_N_ViewersWidget::GetRenderer (  ) 

Definition at line 105 of file wxMaracas_N_ViewersWidget.cxx.

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

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:

double wxMaracas_N_ViewersWidget::GetX (  ) 

Definition at line 268 of file wxMaracas_N_ViewersWidget.cxx.

References vtkMPRBaseData::GetX(), and mvtkmprbasedata.

Referenced by wxMaracasDialog_NViewers::OnRefreshView().

00269 {
00270         return mvtkmprbasedata->GetX();
00271 //      return wxwindow1->GetX();
00272 }

Here is the call graph for this function:

Here is the caller graph for this function:

double wxMaracas_N_ViewersWidget::GetY (  ) 

Definition at line 275 of file wxMaracas_N_ViewersWidget.cxx.

References vtkMPRBaseData::GetY(), and mvtkmprbasedata.

Referenced by wxMaracasDialog_NViewers::OnRefreshView().

00276 {
00277         return mvtkmprbasedata->GetY();
00278 //      return wxwindow1->GetY();
00279 }

Here is the call graph for this function:

Here is the caller graph for this function:

double wxMaracas_N_ViewersWidget::GetZ (  ) 

Definition at line 283 of file wxMaracas_N_ViewersWidget.cxx.

References vtkBaseData::GetZ(), and mvtkmprbasedata.

Referenced by wxMaracasDialog_NViewers::OnRefreshView().

00284 {
00285         return mvtkmprbasedata->GetZ();
00286 //      return wxwindow1->GetZ();
00287 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracas_N_ViewersWidget::OnDClickLeft ( wxCommandEvent &  event  ) 

Definition at line 98 of file wxMaracas_N_ViewersWidget.cxx.

References RefreshView().

Referenced by wxMaracasDialog_NViewers::OnDClickLeft().

00099         {
00100                 RefreshView();
00101         }

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().

Referenced by wxMaracasDialog_NViewers::OnRefreshView().

00094         {
00095                 RefreshView();
00096         }

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::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::setColorLevel ( double  level  ) 

Definition at line 318 of file wxMaracas_N_ViewersWidget.cxx.

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

00318                                                          {
00319         if (wxwindow1!=NULL) {
00320                 wxwindow1->setColorLevel(level);
00321         }
00322         if (wxwindow2!=NULL) {
00323                 wxwindow2->setColorLevel(level);
00324         }
00325         if (wxwindow3!=NULL) {
00326                 wxwindow3->setColorLevel(level);
00327         }
00328         if (wxwindow4!=NULL) {
00329                 wxwindow4->setColorLevel(level);
00330         }
00331 }

Here is the call graph for this function:

void wxMaracas_N_ViewersWidget::setColorTransferFunction ( vtkColorTransferFunction *  colortable  ) 

Definition at line 289 of file wxMaracas_N_ViewersWidget.cxx.

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

00289                                                                                             {
00290     if (wxwindow1!=NULL) {
00291                 wxwindow1->setColorTransferFunction(colortable);
00292         }
00293         if (wxwindow2!=NULL) {
00294                 wxwindow2->setColorTransferFunction(colortable);
00295         }
00296         if (wxwindow3!=NULL) {
00297                 wxwindow3->setColorTransferFunction(colortable);
00298         }
00299         if (wxwindow4!=NULL) {
00300                 wxwindow4->setColorTransferFunction(colortable);
00301         }
00302 }

Here is the call 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) { wxwindow1->SetImage(image); }
00253          if (wxwindow2!=NULL) { wxwindow2->SetImage(image); } 
00254          if (wxwindow3!=NULL) { wxwindow3->SetImage(image); }
00255          if (wxwindow4!=NULL) { wxwindow4->SetImage(image); }
00256  }

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::setWindowLevel ( double  level  ) 

Definition at line 304 of file wxMaracas_N_ViewersWidget.cxx.

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

00304                                                           {
00305         if (wxwindow1!=NULL) {
00306                 wxwindow1->setWindowLevel(level);
00307         }
00308         if (wxwindow2!=NULL) {
00309                 wxwindow2->setWindowLevel(level);
00310         }
00311         if (wxwindow3!=NULL) {
00312                 wxwindow3->setWindowLevel(level);
00313         }
00314         if (wxwindow4!=NULL) {
00315                 wxwindow4->setWindowLevel(level);
00316         }
00317 }

Here is the call graph for this function:

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         }

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:


Member Data Documentation

Definition at line 98 of file wxMaracas_N_ViewersWidget.h.

Referenced by UpdateLayout().

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

Definition at line 101 of file wxMaracas_N_ViewersWidget.h.

Referenced by SetType(), and UpdateLayout().


The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1