From c51eaff3b21f03402ef7561cf93fc9b7860db7ef Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 29 Dec 2004 05:58:56 +0000 Subject: [PATCH] Fix regression --- src/OBJECT/SMESH_Actor.cxx | 48 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 8a3962e4a..9bd62817c 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -629,14 +629,16 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){ my3DActor->GetMapper()->SetScalarVisibility(false); myScalarBarActor->SetVisibility(false); - if(theMode != eNone){ + bool anIsScalarVisible = theMode > eNone; + + if(anIsScalarVisible){ SMESH::Controls::FunctorPtr aFunctor; - SMESH::Controls::NumericalFunctor* aNumFunctor = NULL; switch(theMode){ case eLength: { - aNumFunctor = new SMESH::Controls::Length(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::Length* aControl = new SMESH::Controls::Length(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my1DActor; break; } @@ -660,50 +662,57 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){ break; case eArea: { - aNumFunctor = new SMESH::Controls::Area(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::Area* aControl = new SMESH::Controls::Area(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my2DActor; break; } case eTaper: { - aNumFunctor = new SMESH::Controls::Taper(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::Taper* aControl = new SMESH::Controls::Taper(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my2DActor; break; } case eAspectRatio: { - aNumFunctor = new SMESH::Controls::AspectRatio(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::AspectRatio* aControl = new SMESH::Controls::AspectRatio(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my2DActor; break; } case eAspectRatio3D: { - aNumFunctor = new SMESH::Controls::AspectRatio3D(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my3DActor; break; } case eMinimumAngle: { - aNumFunctor = new SMESH::Controls::MinimumAngle(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my2DActor; break; } case eWarping: { - aNumFunctor = new SMESH::Controls::Warping(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::Warping* aControl = new SMESH::Controls::Warping(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my2DActor; break; } case eSkew: { - aNumFunctor = new SMESH::Controls::Skew(); - aFunctor.reset( aNumFunctor ); + SMESH::Controls::Skew* aControl = new SMESH::Controls::Skew(); + aControl->SetPrecision( myControlsPrecision ); + aFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -711,9 +720,6 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){ return; } - if(aNumFunctor) - aNumFunctor->SetPrecision( myControlsPrecision ); - vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid(); vtkIdType aNbCells = aGrid->GetNumberOfCells(); if(aNbCells){ -- 2.39.2