]> Creatis software - creaMaracasVisu.git/commitdiff
#3306 creaMaracasVisu Feature New Normal - Clean Code
authorEduardo DAVILA <davila@ei-ed-606.univ-lyon1.fr>
Mon, 16 Sep 2019 13:23:37 +0000 (15:23 +0200)
committerEduardo DAVILA <davila@ei-ed-606.univ-lyon1.fr>
Mon, 16 Sep 2019 13:23:37 +0000 (15:23 +0200)
bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx
bbtk/src/bbmaracasvisuViewerNV.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/kernel/marImageData.cpp

index 0fc2242b4f08dce552bb5ecdcb128a5af1cb911f..6681598bd21ee82392692900946dfc08a3b0ea7b 100644 (file)
@@ -42,46 +42,34 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ColorLayerImageView,bbtk::WxBlackBox);
 void ColorLayerImageView::Process()
 {
     ColorLayerImageViewPanel *clivp = (ColorLayerImageViewPanel*)bbGetOutputWidget();
-
         if (firsttime==true)
         {
 //             firsttime=false;
        clivp->SetActive( bbGetInputActive() );
         }
-
     clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() );
     clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 1 , bbGetInputWxVtkBaseView1() );
     clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 2 , bbGetInputWxVtkBaseView2() );
-
     std::vector<double> range = bbGetInputlstRangeForColorBar();
     clivp->GetColorLayerImageViewManager()->SetRangeForColorBar( range );
-
     std::vector<int> colorbarposition = bbGetInputColorBarPosition();
     clivp->GetColorLayerImageViewManager()->SetColorBarPosition( colorbarposition );
-
     std::vector<double> base_color = bbGetInputlstBaseColor();
     clivp->GetColorLayerImageViewManager()->SetBaseColors( base_color );
-
     std::vector<double> grey_level_boundaries = bbGetInputlstGreyLevelBoundaries();
     clivp->GetColorLayerImageViewManager()->SetGreyLevelBoundaries( grey_level_boundaries );
-
     std::vector<double> transparence_level_boundaries = bbGetInputlstTransparenceBoundaries();
     clivp->GetColorLayerImageViewManager()->SetBaseTransparence( transparence_level_boundaries );
-
     clivp->GetColorLayerImageViewManager()->SetPlainOrGradientColor( bbGetInputPlainOrGradientColor() );
     clivp->SetFittingMode( bbGetInputFittingMode() );
-
     clivp->SetImage( bbGetInputIn() );
-
     bbSetOutputNewImage( clivp->GetColorLayerImageViewManager()->GetImageChangeInformation(0) );
     bbSetOutputLookupTable( clivp->GetColorLayerImageViewManager()->GetLookupTable(0) );
-
         if (firsttime==true)
         {
                firsttime=false;
        clivp->ChangeOpacity();
         }
-
 }
 //=====
 // Don't edit this file. This file is generated from xml description..
index fd98d87ccc46eabadd54fd74bc173c32989c82ff..4a8cd289c570fc71555f0974e79ef580ad744bca 100644 (file)
@@ -57,13 +57,11 @@ void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
 {
        //printf("CPR: bbwxMaracas_N_ViewersWidget::OnRefreshView -> actualiza X, Y y Z\n");
        mbbViewerNV->_point.clear();
-
        mbbViewerNV->_point.push_back( (int)GetX() );
        mbbViewerNV->_point.push_back( (int)GetY() );
        mbbViewerNV->_point.push_back( (int)GetZ() );
        mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
        mbbViewerNV->bbSignalOutputModification(std::string("Point"));
-
        wxMaracas_N_ViewersWidget::OnRefreshView(event);
 }
 
@@ -104,8 +102,7 @@ void ViewerNV::Process()
                _point.push_back((int)_mwxwidget->GetY());
                _point.push_back((int)_mwxwidget->GetZ());
                bbSetOutputPoint(_point);
-       //    WxBlackBox::Process();
-//             mwxwidget->SetImage(img );
+
                wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView(1);
                wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView(2);
                wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView(3);
index 75fa8c30da965cbe8aa9dc45d366961d1460048e..a40409ec2e72d4943fcf182c1b9d07bf2ea97cc4 100644 (file)
                wxwindow4               = NULL;
                _currentwxw             = NULL;
                mvtkmprbasedata = NULL;
-
                wxSizer *sizer  = new wxBoxSizer(wxVERTICAL);
                this->SetSizer(sizer);
                this->SetAutoLayout(true);
-
-
-               if(imagedata!=NULL && nTypeView!=NULL ){
+               if(imagedata!=NULL && nTypeView!=NULL )
+               {
                        this->SetType(nTypeView);
                        this->UpdateLayout(imagedata);
                }
-
-
        }
        /**
        *       @pre A wxWindow* object must be provided as a parent for the viewer and the type of layout for the viewer
                //this->Layout();
                //this->Refresh();
 
-
 // I don't undestand how this works and not the opposite ...
                if (wxwindow4!=NULL) {wxwindow4->ConfigureVTK(); }
                if (wxwindow3!=NULL) {wxwindow3->ConfigureVTK(); }
         if (wxwindow2!=NULL) { wxwindow2->SetImage(image); }
         if (wxwindow3!=NULL) { wxwindow3->SetImage(image); }
         if (wxwindow4!=NULL) { wxwindow4->SetImage(image); }
-        
 //      ConfigureVTK();
  }
 
index b90dbaff4c38b4ee7cfa6a8a1cedb1a6db836a6e..a9e9e1da583d5186dde889eefc5918258bf86cd6 100644 (file)
@@ -410,56 +410,51 @@ void wxMaracas_ViewerWidget::Refresh(bool eraseBackground ,const wxRect* rect  )
 
 
 //-------------------------------------------------------------------------
-       void wxMaracas_ViewerWidget::SetImage( vtkImageData *image )
+void wxMaracas_ViewerWidget::SetImage( vtkImageData *image )
+{
+       if(mvtkmprbasedata !=NULL)
+       {
+               marImageData* mar = mvtkmprbasedata->GetMarImageData();
+               mar->removeImageData(0);
+               mar->AddImageData(image);
+       }       
+       if (mvtk2Dbaseview!=NULL)
        {
-               if(mvtkmprbasedata !=NULL)
-               {
-                       marImageData* mar = mvtkmprbasedata->GetMarImageData();
-                       mar->removeImageData(0);
-                       mar->AddImageData(image);
-               }
-               
-               if (mvtk2Dbaseview!=NULL)
-               {
                        mvtk2Dbaseview->SetImageToVtkViewer(image);
-               }
-               
-               if (mvtkmpr2Dview_X!=NULL)
-               {
-                       mvtkmpr2Dview_X->SetImageToVtkViewer(image);
-               }
-               if (mvtkmpr2Dview_Y!=NULL)
-               {
-                       mvtkmpr2Dview_Y->SetImageToVtkViewer(image);
-               }
-               if (mvtkmpr2Dview_Z!=NULL)
-               {
-                       mvtkmpr2Dview_Z->SetImageToVtkViewer(image);
-               }
-               
-               if (mvtkplane2Dview!=NULL)
-               {
-                       // ???  EED 10 oct 2012
-               }
-               if (mwxsphereview!=NULL)
-               {
-                       mwxsphereview->SetImage();
-               }
-               if (mwxvtkclipping3Dview!=NULL)
-               {
-                       mwxvtkclipping3Dview->GetVtkClipping3DDataViewer()->SetImage();
-               }
-               
-               if (mwxvtkmpr3Dview!=NULL)
-               {
-                       mwxvtkmpr3Dview->SetImage();
-               }
+       }       
+       if (mvtkmpr2Dview_X!=NULL)
+       {
+               mvtkmpr2Dview_X->SetImageToVtkViewer(image);
+       }
+       if (mvtkmpr2Dview_Y!=NULL)
+       {
+               mvtkmpr2Dview_Y->SetImageToVtkViewer(image);
+       }
+       if (mvtkmpr2Dview_Z!=NULL)
+       {
+               mvtkmpr2Dview_Z->SetImageToVtkViewer(image);
+       }       
+       if (mvtkplane2Dview!=NULL)
+       {
+               // ???  EED 10 oct 2012
+       }
+       if (mwxsphereview!=NULL)
+       {
+               mwxsphereview->SetImage();
+       }
+       if (mwxvtkclipping3Dview!=NULL)
+       {
+               mwxvtkclipping3Dview->GetVtkClipping3DDataViewer()->SetImage();
+       }               
+       if (mwxvtkmpr3Dview!=NULL)
+       {
+               mwxvtkmpr3Dview->SetImage();
+       }
                
 //EED 26/11/2009
 //             ConfigureVTK();
 //             RefreshView();
-
-       }
+}
 
        //-------------------------------------------------------------------------
 
index 237725698d51baef628b8c16cabfbef3e7cab672..c32af32beebcf1a55bbb18e809e228ad4918f6f7 100644 (file)
@@ -336,7 +336,6 @@ void wxVtkMPR3DView::SetImage()
        // -- Plane widget
        _probe->SetSourceData( imageData );
 #endif
-
        _vtkmpr3Ddataviewer->SetImage();
 }
 
index 3dfa8d47c5428c1b8c748984d14f587a971ddd80..db028be87769b4dd3c624c78e4d30d8e9c98a93d 100644 (file)
@@ -114,19 +114,21 @@ vtkImageData *marImageData::GetImageData()
 
 void marImageData::removeImageData(int index)
 {
-       if(index < _imagedataLST.size()){
+       if(index < _imagedataLST.size())
+       {
 
                /*vtkImageData* img = _imagedataLST[index];
                if(img->GetReferenceCount()>1){
                        img->SetReferenceCount(img->GetReferenceCount()-1);
                        //img->Delete();
                }*/
-               for(int i = index; i < _imagedataLST.size()-1; i++){                    
+               for(int i = index; i < _imagedataLST.size()-1; i++)
+               {                       
                        _imagedataLST[i] = _imagedataLST[i+1];
-               }
+               }// for
                _imagedataLST.pop_back();
                //delete img;
-       }       
+       } // if 
 }
 // ----------------------------------------------------------------------------------------------
 int marImageData::GetXOriginal(int value)