]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuViewerMPR.cxx
v1.0.3 Feature 1408
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuViewerMPR.cxx
index 246ae620dc8ccfba782b19c47bdaf44aac9aa238..05191c7e91d9c389f4460cfb4deabc95b40b23a0 100644 (file)
@@ -40,10 +40,8 @@ END_EVENT_TABLE( );
                panel   -> Layout();            
   }
 
-  void wxWidgetMPR::setMarImage(marImageData* marimagedata){
-         wxwidget->setMarImage(marimagedata, 1);
-
-
+  void wxWidgetMPR::setImageData(vtkImageData* img){
+         wxwidget->setImageData(img, 1);
   }
   void wxWidgetMPR::ConfigureVTK(){
                wxwidget->ConfigureVTK();
@@ -88,9 +86,10 @@ END_EVENT_TABLE( );
   //---------------
   void wxWidgetMPR::OnRefreshView(wxCommandEvent &event)
   {
-
+  printf("EED wxWidgetMPR::OnRefreshView 01\n");
          if((wxwidget!=NULL) && (mbbViewerMPR!=NULL))
          {
+                 printf("EED wxWidgetMPR::OnRefreshView 02\n");
            point.clear();
                point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetX());
                point.push_back((int)wxwidget->GetVtkMPRBaseData()->GetY());
@@ -122,19 +121,21 @@ BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ViewerMPR)
 BBTK_BLACK_BOX_IMPLEMENTATION(ViewerMPR,bbtk::WxBlackBox);
 void ViewerMPR::Process()
 {
-printf("EED ViewerMPR::Process 01\n"); 
        if (wxwidget!=NULL){
                wxBusyCursor wait;         
-               if(marimagedata==NULL){
-                       wxwidget->setMarImage(new marImageData(bbGetInputIn() ));
+               vtkImageData* img = bbGetInputIn();
+               if(img!=NULL && img != _img){
+                       _img = img;
+                       wxwidget->setImageData(_img);
                        wxwidget->ConfigureVTK();
                        
+//                     wxwidget->wxPanel::Refresh();
+                       wxwidget->Refresh();
+//                     wxwidget->Show();
+
+               }       
                        
-printf("EED ViewerMPR::Process 02\n"); 
-                       wxwidget->wxPanel::Refresh();
-                       wxwidget->Show();
-//                     wxwidget->Refresh();
-               }
+               
                bbSetOutputPoint( wxwidget->GetPoint() );
                bbSetOutputRenderer( wxwidget->GetRenderer() );  
        } // wxwidget
@@ -142,7 +143,6 @@ printf("EED ViewerMPR::Process 02\n");
 
 void ViewerMPR::CreateWidget(wxWindow* parent)
 {
-printf("EED ViewerMPR::CreateWidget \n");      
        bbtkDebugMessageInc("Core",9,"ViewerMPR::CreateWidget() " <<std::endl);
        //JCP 10 - 03 - 09 marImageData *marimagedata = new marImageData(bbGetInputIn() );
        bbtkDebugDecTab("Core",9);
@@ -150,24 +150,26 @@ printf("EED ViewerMPR::CreateWidget \n");
        bbSetOutputWidget( wxwidget );
 }
 
-void ViewerMPR::bbUserConstructor()
-{
-               marimagedata =  NULL;
+void ViewerMPR::bbUserSetDefaultValues()
+{              
+               _img = NULL;
                wxwidget = NULL;
                bbSetInputIn(NULL);
 }
-void ViewerMPR::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
-{
-
-       marimagedata =  NULL;
-               wxwidget = NULL;
-               bbSetInputIn(NULL);
 
-}
-void ViewerMPR::bbUserDestructor()
-{
-
-}
+       
+       //-----------------------------------------------------------------     
+       void ViewerMPR::bbUserInitializeProcessing()
+       {
+       }
+       
+       //-----------------------------------------------------------------     
+       void ViewerMPR::bbUserFinalizeProcessing()
+       {
+       }
+       
+       //-----------------------------------------------------------------     
+       
 }
 // EO namespace bbcreaMaracasVisu