X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FmanualContour%2FmanualViewBaseContour.cpp;h=1e765740c51f3cc035f42b6b24d34d0fb312e66b;hb=4dcdcabb81ce9f9e9b7ccdb86a64995d7b18ea23;hp=4a3daf76285f937bec47a54b3999b5184599562f;hpb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index 4a3daf7..1e76574 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -214,6 +214,7 @@ void manualViewBaseContour::AddTextActor() if(_show_text) { _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor ); + _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor2 ); } } // ---------------------------------------------------------------------------- @@ -222,6 +223,7 @@ void manualViewBaseContour::RemoveTextActor() if(_show_text) { _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor ); + _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor2 ); } } // ---------------------------------------------------------------------------- @@ -310,6 +312,7 @@ void manualViewBaseContour::ConstructVTKObjects() InitTextActor(); } +// ---------------------------------------------------------------------------- void manualViewBaseContour::InitTextActor() { // Text @@ -326,6 +329,23 @@ void manualViewBaseContour::InitTextActor() tprop->SetFontSize(14); tprop->SetFontFamilyToArial(); tprop->SetColor(0, 0, 1); + + + // Text 2 + _textActor2 = vtkTextActor::New(); +// _textActor->SetDisplayPosition(200, 200); + _textActor2->SetInput("00"); + // Set coordinates to match the old vtkScaledTextActor default value +// _textActor2->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport(); +// _textActor2->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 ); + _textActor2->GetPositionCoordinate()->SetCoordinateSystemToWorld (); +// _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 ); + + vtkTextProperty *tprop2 = _textActor2->GetTextProperty(); + tprop2->SetFontSize(14); + tprop2->SetFontFamilyToArial(); + tprop2->SetColor(0, 0, 1); + } // ---------------------------------------------------------------------------- @@ -660,7 +680,10 @@ void manualViewBaseContour::Refresh() // virtual void manualViewBaseContour::RefreshText() // virtual { if( _textActor!=NULL) + { _textActor -> SetInput("00"); + _textActor2 -> SetInput("00"); + } } // ---------------------------------------------------------------------------- void manualViewBaseContour::SetColorNormalContour(double r, double g, double b) @@ -913,6 +936,8 @@ void manualViewBaseContour::SetVisible(bool ok) _contourVtkActor->GetProperty()->SetOpacity( opacity ); _textActor->GetProperty()->SetOpacity( opacity ); _textActor->SetInput("00"); + _textActor2->GetProperty()->SetOpacity( opacity ); + _textActor2->SetInput("00"); } // ---------------------------------------------------------------------------- @@ -922,6 +947,7 @@ void manualViewBaseContour::SetShowText(bool ok) if (_show_text==false && _textActor!=NULL) { _textActor->SetInput("00"); + _textActor2->SetInput("00"); } } // ----------------------------------------------------------------------------