From: Ricardo Corredor Date: Thu, 6 May 2010 08:46:00 +0000 (+0000) Subject: The method SetShowText was not working because in this methos uses the textActor... X-Git-Tag: CREATOOLS.2-0-3~19 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f200c6250f9267d1996d1dd6c1209d7586bb63ab;p=creaMaracasVisu.git The method SetShowText was not working because in this methos uses the textActor, and when the property was set, the actor was NULL. It was added just some validations to make it work ... --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index 9c8005e..d06b6db 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -84,8 +84,8 @@ void manualViewBaseContour :: AddCompleteContourActor( bool ifControlPoints ) /*vtkRenderer * theRenderer = */ _wxvtkbaseview->GetRenderer(); // JPRx ?? //Adding the spline AddSplineActor(); - AddTextActor(); + //Adding each control point if( ifControlPoints ) AddControlPoints(); @@ -186,12 +186,18 @@ void manualViewBaseContour::AddControlPoints() // ---------------------------------------------------------------------------- void manualViewBaseContour::AddTextActor() { - _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor ); + if(_show_text) + { + _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor ); + } } // ---------------------------------------------------------------------------- void manualViewBaseContour::RemoveTextActor() { - _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor ); + if(_show_text) + { + _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor ); + } } // ---------------------------------------------------------------------------- void manualViewBaseContour::DeleteVtkObjects() @@ -888,7 +894,7 @@ void manualViewBaseContour::SetVisible(bool ok) void manualViewBaseContour::SetShowText(bool ok) { _show_text = ok; - if (_show_text==false) + if (_show_text==false && _textActor!=NULL) { _textActor->SetInput("00"); }