]> Creatis software - creaMaracasVisu.git/commitdiff
Bug Rendering
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 25 Nov 2020 13:26:36 +0000 (14:26 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 25 Nov 2020 13:26:36 +0000 (14:26 +0100)
bbtk/src/bbmaracasvisuImageActor.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h

index c016625aaa4adce9f58c5b179487733cf7e057f6..7d6e5c8dec3950419f68904a6bb60e0b25086dce 100644 (file)
@@ -131,6 +131,7 @@ vtkLookupTable *table = vtkLookupTable::New();
                                imageactor->GetMapper()->SetInputData( color->GetOutput() );
 #endif
                                imageactor->GetProperty()->SetInterpolationTypeToNearest();
+                               imageactor->SetForceOpaque(true);
                        }
 
                        if (transform!=NULL)
index aa398d488971528129d01e2c83955763b62c0f49..34da3bf50e95fe6fb3c2a5a8de680484f61240bd 100644 (file)
@@ -60,13 +60,14 @@ vtkClipping3DDataViewer::vtkClipping3DDataViewer()
 vtkClipping3DDataViewer::~vtkClipping3DDataViewer()
 {
        int i;
-       for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
+       for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+       {
                _mCubes[i]->Delete();
                _tissueStripper[i]->Delete();
                _tissueMapper[i]->Delete();
                _tissuePlanes[i]->Delete();
                _tissueClipper[i]->Delete();
-       }
+       } // for i
 
        // Volume
        _tfun->Delete();
@@ -527,20 +528,16 @@ void vtkClipping3DDataViewer::updateVolume()
     if(_interpolation)
     {
         _volumeProperty->SetInterpolationTypeToLinear();
-    }
-    else
-    {
+    } else {
         _volumeProperty->SetInterpolationTypeToNearest();
-    }
+    } // if _interpolation
 
     if(_shade)
     {
         _volumeProperty->ShadeOn();
-    }
-    else
-    {
+    } else {
         _volumeProperty->ShadeOff();
-    }
+    } // if _shade
 
 }
 
index 4a75a62a35fe8bd8988adc630db3776a690042d1..a14720278e37c9983f772408c5ad7a752f437696 100644 (file)
@@ -46,7 +46,7 @@
 #include "vtkColorTransferFunction.h"
 #include "vtkVolume.h"
 #include "vtkActor.h"
-#include "vtkOutlineFilter.h"
+//#include "vtkOutlineFilter.h"
 #include "vtkRenderWindowInteractor.h"
 
 
index 68db204e99233335b6324a97b1d43d853e487539..4cf5975c072369e3069f6a248f5b02da903b7e88 100644 (file)
@@ -385,7 +385,7 @@ void wxMaracasRenderTabbedPanel::addMPROptions()
 
        ((wxVtkMPR3DViewCntrlPanel*)controlPanelMPR3D)->SetVisibleZ(true);
        ((wxVtkMPR3DViewCntrlPanel*)controlPanelMPR3D)->SetVisibleXYZ(true);
-       mwxvtkmpr3Dview->showOutlineActor(true);
+       mwxvtkmpr3Dview->showOutlineBoxActor(true);
        mwxvtkmpr3Dview->Refresh();
                        
 }
@@ -493,7 +493,7 @@ void wxMaracasRenderTabbedPanel::addRemoveActorMPR(bool addremove)
                mwxvtkmpr3Dview->VisibleImageActor( 2, valueZ );
                mwxvtkmpr3Dview->VisiblePointWidget(valueXYZ);
                mwxvtkmpr3Dview->VisiblePlaneWidget(valuePlane);
-               mwxvtkmpr3Dview->showOutlineActor(true);
+               mwxvtkmpr3Dview->showOutlineBoxActor(true);
                mwxvtkmpr3Dview->Refresh();
        } else {
                wxtabs->GetPage(id)->Disable();
@@ -502,7 +502,7 @@ void wxMaracasRenderTabbedPanel::addRemoveActorMPR(bool addremove)
                mwxvtkmpr3Dview->VisibleImageActor(0, false );
                mwxvtkmpr3Dview->VisibleImageActor(1, false );
                mwxvtkmpr3Dview->VisibleImageActor(2, false );
-               mwxvtkmpr3Dview->showOutlineActor(false);
+               mwxvtkmpr3Dview->showOutlineBoxActor(false);
                mwxvtkmpr3Dview->Refresh();
                wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
@@ -729,11 +729,9 @@ void wxMaracasRenderTabbedPanel::onCheckBoxSBChange(wxCommandEvent& event)
                if(checkboxSB->GetValue())
                {
                        wxtabs->GetPage(id)->Enable();
-               }
-               else
-               {       
+               } else {        
                        wxtabs->GetPage(id)->Disable();
-               }
+               } // if checkboxSB
        }
        catch(char* str){
                std::cout << "Exception : " << str << '\n';
index 2a587c97f4ad6a713d9dee8102c75dc349817d62..3657b37809302427a3db06e000285a845056a804 100644 (file)
@@ -70,7 +70,8 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w
        double range[2];
        vtkImageData *vtkimagedata = wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
        vtkimagedata->GetScalarRange( range );
-       _isoValue->SetRange( (int)(range[1]*0.1) , (int)(range[1]) );
+//EED 2020-11-25       _isoValue->SetRange( (int)(range[1]*0.1) , (int)(range[1]) );
+       _isoValue->SetRange( (int)(range[0]) , (int)(range[1]) );
        _isoValue->SetValue( (int)(wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetIsovalue(0)) );
 
 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
index 32994c7743cd664add4ba747482f79d945312227..9e791adf7c5274a8e570fef4abc9580f9d289fb5 100644 (file)
@@ -699,7 +699,7 @@ void wxVtkMPR3DView::VisiblePlaneWidget( bool visible )
 }
 
 //CPR: Method added 30 Nov 2009
-void wxVtkMPR3DView::showOutlineActor(bool value)
+void wxVtkMPR3DView::showOutlineBoxActor(bool value)
 {
        vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
        if(value == true)
@@ -710,6 +710,29 @@ void wxVtkMPR3DView::showOutlineActor(bool value)
        } // value
 }
 
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::showOutlinePlaneActor(bool value)
+{
+       vtkProperty *prop1=NULL;
+       if(value == true)
+       {
+               prop1 = _planeWidgetX ->GetPlaneProperty();
+               prop1->SetOpacity(1);
+               prop1 = _planeWidgetY ->GetPlaneProperty();
+               prop1->SetOpacity(1);
+               prop1 = _planeWidgetZ ->GetPlaneProperty();
+               prop1->SetOpacity(1);           
+       } else {
+               prop1 = _planeWidgetX ->GetPlaneProperty();
+               prop1->SetOpacity(0);
+               prop1 = _planeWidgetY ->GetPlaneProperty();
+               prop1->SetOpacity(0);
+               prop1 = _planeWidgetZ ->GetPlaneProperty();
+               prop1->SetOpacity(0);
+       } // value
+}
+
+
 //-------------------------------------------------------------------
 void wxVtkMPR3DView::SetVtkMPR3DDataViewer(vtkMPR3DDataViewer *vtkmpr3Ddataviewer)
 {
index 4eb27ee95e0c8ce3dcdaf4ee46c236fbd9332a67..b98227a60538ad14e4756f2f9965c47cf67ef444 100644 (file)
@@ -59,7 +59,8 @@ public:
        vtkMPR3DDataViewer* GetVtkMPR3DDataViewer();
        wxVtk3DBaseView*        GetWxvtk3Dbaseview() throw (char*);
        void                            InitOrientationPointWidget(); 
-       void                            showOutlineActor(bool value);
+       void                            showOutlineBoxActor(bool value);
+       void                            showOutlinePlaneActor(bool value);
        // EED 25 Janvier 2007 testLoic
        void                            TestLoic1();
        void                            TestLoic2();
index d8137db26d18205d26d6ce4dd7ca7699a4febb6f..9a62c86f3918565c4fe1c5511485989960d88135 100644 (file)
@@ -86,12 +86,17 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV
        _ckBoxXYZ->SetValue(false);
 ////EED 05Nov2012      _ckBox_BW_Color_Plane->SetValue(true);
        _ckBoxPlane->SetValue(false);
-       _ckBoxOutline= new wxCheckBox(panel,-1,_T("Outline"));
-       _ckBoxOutline->SetValue(true);
        _ckBoxInterpolate= new wxCheckBox(panel,-1,_T("Interpolate"));
        _ckBoxInterpolate->SetValue(true);
 
 
+       _ckBoxOutlineBox= new wxCheckBox(panel,-1,_T("Outline Box"));
+       _ckBoxOutlineBox->SetValue(true);
+       _ckBoxOutlinePlane= new wxCheckBox(panel,-1,_T("Outline Plane"));
+       _ckBoxOutlinePlane->SetValue(true);
+       _ckBoxBackGroundBlack= new wxCheckBox(panel,-1,_T("Background Black"));;
+       _ckBoxBackGroundBlack->SetValue(false);
+       
        _ckBoxBackGroundBlack= new wxCheckBox(panel,-1,_T("Background Black"));;
        _ckBoxBackGroundBlack->SetValue(false);
 
@@ -128,7 +133,8 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV
        Connect(btnFreePlanesOrtho->GetId()             , wxEVT_COMMAND_BUTTON_CLICKED,   (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnFreePlanesOrtho  );
        Connect(_ckFreePlaneInteraction->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneInteraction );
        Connect(_cbStereo->GetId()                              , wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnSetStereo               );
-       Connect(_ckBoxOutline->GetId()                  , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnOutline                  );
+       Connect(_ckBoxOutlineBox->GetId()                       , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnOutlineBox                       );
+       Connect(_ckBoxOutlinePlane->GetId()                     , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnOutlinePlane                     );
        Connect(_ckBoxBackGroundBlack->GetId()  , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnBackGroundBlack  );
        Connect(_ckBoxInterpolate->GetId()              , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnInterpolate              );
        Connect(_ckBoxFixAxis2D->GetId()                , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnFixAxis2D                );
@@ -198,7 +204,8 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV
                sizerH5->Add( _cbStereo                                                                 , 1, wxALL|wxEXPAND                                             , 0);
                
                sizerH6 = new wxFlexGridSizer(1);
-               sizerH6->Add( _ckBoxOutline                                                             , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH6->Add( _ckBoxOutlineBox                                                  , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH6->Add( _ckBoxOutlinePlane                                                , 1, wxALL|wxEXPAND                                             , 0);
                sizerH6->Add( _ckBoxBackGroundBlack                                             , 1, wxALL|wxEXPAND                                             , 0);
 
                sizer->Add( sizerH4,  1, wxALL|wxGROW,  2);
@@ -741,11 +748,17 @@ void wxVtkMPR3DViewCntrlPanel::SetVisiblePlane(bool value)
 
 
 //-------------------------------------------------------------------
-void wxVtkMPR3DViewCntrlPanel::OnOutline(wxCommandEvent& event)
+void wxVtkMPR3DViewCntrlPanel::OnOutlineBox(wxCommandEvent& event)
 {
-       _wxvtkmpr3Dview->showOutlineActor( _ckBoxOutline->GetValue() );
+       _wxvtkmpr3Dview->showOutlineBoxActor( _ckBoxOutlineBox->GetValue() );
        _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->Refresh();
+}
 
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::OnOutlinePlane(wxCommandEvent& event)
+{
+       _wxvtkmpr3Dview->showOutlinePlaneActor( _ckBoxOutlinePlane->GetValue() );
+       _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->Refresh();
 }
 
 //-------------------------------------------------------------------
index c38439ea31dc6b434f962bd8643bc47e12580701..58545d2493a475b8b5a48efc950f46e39f2a9b24 100644 (file)
@@ -52,7 +52,8 @@ public:
        void            OnVisibleFreePlaneInteraction(wxCommandEvent& event);
        void            OnSetStereo(wxCommandEvent& event);
        void            OnFreePlanesOrtho(wxCommandEvent& event);
-       void            OnOutline(wxCommandEvent& event);
+       void            OnOutlineBox(wxCommandEvent& event);
+       void            OnOutlinePlane(wxCommandEvent& event);
        void            OnBackGroundBlack(wxCommandEvent& event);
        void            OnInterpolate(wxCommandEvent& event);
        void            OnFixAxis2D(wxCommandEvent& event);
@@ -111,7 +112,8 @@ private:
        
        wxComboBox              *_cbStereo;
 
-       wxCheckBox              *_ckBoxOutline;
+       wxCheckBox              *_ckBoxOutlineBox;
+       wxCheckBox              *_ckBoxOutlinePlane;
        wxCheckBox              *_ckBoxBackGroundBlack;
        wxCheckBox              *_ckBoxInterpolate;