From aa7fc4afd673282dc8c4f86fdabe93f4bf25aee9 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 25 Nov 2020 14:26:36 +0100 Subject: [PATCH] Bug Rendering --- bbtk/src/bbmaracasvisuImageActor.cxx | 1 + .../widgets/vtkClipping3DDataViewer.cxx | 17 ++++++------- .../widgets/vtkClipping3DDataViewer.h | 2 +- .../widgets/wxMaracasRenderTabbedPanel.cpp | 12 ++++----- .../widgets/wxVtkClipping3DViewCntrlPanel.cxx | 3 ++- .../wxWindows/widgets/wxVtkMPR3DView.cxx | 25 ++++++++++++++++++- .../wxWindows/widgets/wxVtkMPR3DView.h | 3 ++- .../widgets/wxVtkMPR3DViewCntrlPanel.cxx | 25 ++++++++++++++----- .../widgets/wxVtkMPR3DViewCntrlPanel.h | 6 +++-- 9 files changed, 65 insertions(+), 29 deletions(-) diff --git a/bbtk/src/bbmaracasvisuImageActor.cxx b/bbtk/src/bbmaracasvisuImageActor.cxx index c016625..7d6e5c8 100644 --- a/bbtk/src/bbmaracasvisuImageActor.cxx +++ b/bbtk/src/bbmaracasvisuImageActor.cxx @@ -131,6 +131,7 @@ vtkLookupTable *table = vtkLookupTable::New(); imageactor->GetMapper()->SetInputData( color->GetOutput() ); #endif imageactor->GetProperty()->SetInterpolationTypeToNearest(); + imageactor->SetForceOpaque(true); } if (transform!=NULL) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx index aa398d4..34da3bf 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx @@ -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 } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h index 4a75a62..a147202 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h @@ -46,7 +46,7 @@ #include "vtkColorTransferFunction.h" #include "vtkVolume.h" #include "vtkActor.h" -#include "vtkOutlineFilter.h" +//#include "vtkOutlineFilter.h" #include "vtkRenderWindowInteractor.h" diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp index 68db204..4cf5975 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp @@ -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'; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx index 2a587c9..3657b37 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index 32994c7..9e791ad 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -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) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h index 4eb27ee..b98227a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx index d8137db..9a62c86 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx @@ -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(); } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h index c38439e..58545d2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h @@ -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; -- 2.47.1