]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
Feature #1606 Add a new entry to ColorLayerImageView to select the fitting mode betwe...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewBaseContour.cpp
index f448458d1dcccfce36e0d4e3faecb4bde3916ef7..d06b6db735d39b365f4694d0ae0ee340391d6a3f 100644 (file)
@@ -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()
@@ -267,20 +273,16 @@ void manualViewBaseContour::ConstructVTKObjects()
     _bboxMapper                        =       vtkPolyDataMapper::New();
     _bboxMapper->ScalarVisibilityOff( );
 
-
        _bboxMapper->SetInput(_pd);
        _bboxMapper->ImmediateModeRenderingOn();
        _contourVtkActor->SetMapper(_bboxMapper);
        _contourVtkActor->GetProperty()->BackfaceCullingOff();
 
-
        UpdateColorActor();
 
        _pd->ComputeBounds();
 
        InitTextActor();
-       
-       
 }
 
 void manualViewBaseContour::InitTextActor()
@@ -529,9 +531,8 @@ bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
                        {
                                result=true;
                                SetPosibleSelected(result);
-                       } 
+                       }
                }
-
        }
        return result;
 }
@@ -893,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");
        }