From: apo Date: Tue, 28 Dec 2004 06:52:07 +0000 (+0000) Subject: Bug PAL7334 - DEVELOPMENT : Control Improvement X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=57d4d5c4567310b6a999c186c9474231e7fe7960;p=modules%2Fsmesh.git Bug PAL7334 - DEVELOPMENT : Control Improvement --- diff --git a/resources/SMESH_en.xml b/resources/SMESH_en.xml index 387e3ac8c..f27e1f540 100644 --- a/resources/SMESH_en.xml +++ b/resources/SMESH_en.xml @@ -73,18 +73,20 @@ - - - + + + + - + + @@ -251,8 +253,8 @@ - + @@ -361,8 +363,8 @@ - + diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 9bd62817c..8a3962e4a 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -629,16 +629,14 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){ my3DActor->GetMapper()->SetScalarVisibility(false); myScalarBarActor->SetVisibility(false); - bool anIsScalarVisible = theMode > eNone; - - if(anIsScalarVisible){ + if(theMode != eNone){ SMESH::Controls::FunctorPtr aFunctor; + SMESH::Controls::NumericalFunctor* aNumFunctor = NULL; switch(theMode){ case eLength: { - SMESH::Controls::Length* aControl = new SMESH::Controls::Length(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::Length(); + aFunctor.reset( aNumFunctor ); myControlActor = my1DActor; break; } @@ -662,57 +660,50 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){ break; case eArea: { - SMESH::Controls::Area* aControl = new SMESH::Controls::Area(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::Area(); + aFunctor.reset( aNumFunctor ); myControlActor = my2DActor; break; } case eTaper: { - SMESH::Controls::Taper* aControl = new SMESH::Controls::Taper(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::Taper(); + aFunctor.reset( aNumFunctor ); myControlActor = my2DActor; break; } case eAspectRatio: { - SMESH::Controls::AspectRatio* aControl = new SMESH::Controls::AspectRatio(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::AspectRatio(); + aFunctor.reset( aNumFunctor ); myControlActor = my2DActor; break; } case eAspectRatio3D: { - SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::AspectRatio3D(); + aFunctor.reset( aNumFunctor ); myControlActor = my3DActor; break; } case eMinimumAngle: { - SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::MinimumAngle(); + aFunctor.reset( aNumFunctor ); myControlActor = my2DActor; break; } case eWarping: { - SMESH::Controls::Warping* aControl = new SMESH::Controls::Warping(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::Warping(); + aFunctor.reset( aNumFunctor ); myControlActor = my2DActor; break; } case eSkew: { - SMESH::Controls::Skew* aControl = new SMESH::Controls::Skew(); - aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + aNumFunctor = new SMESH::Controls::Skew(); + aFunctor.reset( aNumFunctor ); myControlActor = my2DActor; break; } @@ -720,6 +711,9 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){ return; } + if(aNumFunctor) + aNumFunctor->SetPrecision( myControlsPrecision ); + vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid(); vtkIdType aNbCells = aGrid->GetNumberOfCells(); if(aNbCells){