]> Creatis software - creaMaracasVisu.git/commitdiff
Opacity Text in 2D viewers
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 11 Dec 2020 12:50:22 +0000 (13:50 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 11 Dec 2020 12:50:22 +0000 (13:50 +0100)
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx

index 02e73d290df9be4ce72a1436eec563bf0a6b6ff3..66632639fbd6d771a826ce2cb2630053c9ac91b2 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "vtkInfoTextImage.h"
 
+#include "vtkProperty2D.h"
 #include "vtkTextProperty.h"
 #include <vtkImageMapToWindowLevelColors.h>
 //-------------------------------------------------------------------
@@ -60,6 +61,29 @@ void vtkInfoTextImage::Configure()
        } // if vtkText_WindowLevel
 }
 
+void vtkInfoTextImage::SetOpacity(double opacity)
+{
+       if (_vtkText_WindowLevel!=NULL) 
+       {
+               _vtkText_WindowLevel->GetProperty()->SetOpacity( opacity );
+       }
+       if (_vtkText_ColorLevel!=NULL) 
+       {
+               _vtkText_ColorLevel->GetProperty()->SetOpacity( opacity );
+       }
+       if (_vtkText_position!=NULL) 
+       {
+               _vtkText_position->GetProperty()->SetOpacity( opacity );
+       }
+       if (_vtkText_pixelIntensity!=NULL) 
+       {
+               _vtkText_pixelIntensity->GetProperty()->SetOpacity( opacity );
+       }
+       if (_vtkText_plane!=NULL) 
+       {
+               _vtkText_plane->GetProperty()->SetOpacity( opacity );
+       }
+}
 
 //-------------------------------------------------------------------
 
index e0a761db2bd7a9a10a76684ca45a49d67830a087..7997714c590a727de2af88785083aa1a76c34cda 100644 (file)
@@ -41,6 +41,7 @@ public:
        void PutColorLevel();
        void PutWindowLevel();
        void PutPlane();
+       void SetOpacity(double opacity);
 
 
 protected:
index 5337c807149d005d81571e3b5aa476a66779726a..70310e66bb83994f9ca5324fdf5f98786ae911f3 100644 (file)
@@ -426,3 +426,13 @@ int wxVtk2DBaseView::GetDirection() // virtual
     return 2;
 }
 
+//-------------------------------------------------------------------
+void wxVtk2DBaseView::SetOpacityText(double opacity)
+{
+       if (_vtkIinfoTextImage!=NULL)
+       {
+               _vtkIinfoTextImage->SetOpacity( opacity );
+       }
+}
+
+
index 93e3eee5d5b4b3e6e79ea1eedf7ece2307d46da4..784f2e682eb24f60dab743f4422a95f09c047d71 100644 (file)
@@ -69,6 +69,7 @@ public:
 
        //EED 05juin2019
        void UpdateCameraParallelScale();
+       void SetOpacityText(double opacity);
 
 private:
        vtkInfoTextImage                                *_vtkIinfoTextImage;
index 517ca87925bd997bb706ddf1109daea013f4478c..bd0582eb3e0afeee6ef0654c4cc11481c2dfa406 100644 (file)
@@ -389,6 +389,10 @@ void wxVtkMPR2DView::Refresh()
                        } // if GetFixAxis2D
                        _lineAActor->GetProperty()->SetOpacity( opacityAxis );
                        _lineBActor->GetProperty()->SetOpacity( opacityAxis );
+                       
+                       SetOpacityText( opacityAxis );
+
+                       
                        _backX                  = xx;
                        _backY                  = yy;
                        _backZ                  = zz;