]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
2390 creaMaracasVisu Feature New Normal manual contour information in units and pixels
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewBaseContour.cpp
index 4a3daf76285f937bec47a54b3999b5184599562f..1e765740c51f3cc035f42b6b24d34d0fb312e66b 100644 (file)
@@ -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");
        }
 }
 // ----------------------------------------------------------------------------