From: vsr Date: Wed, 20 Oct 2010 20:02:29 +0000 (+0000) Subject: PAL20948 EDF 1468 SMESH: Histogram of the quality controls X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a415d418f68c798b598da60bea64b3cf9d6f6e50;hp=72832de1e2507ded3bc3a24736338a69ebd45488;p=modules%2Fsmesh.git PAL20948 EDF 1468 SMESH: Histogram of the quality controls --- diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 97bf66e85..4e2943ba6 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -721,51 +721,50 @@ SetControlMode(eControl theMode, bool anIsScalarVisible = theMode > eNone; if(anIsScalarVisible){ - SMESH::Controls::FunctorPtr aFunctor; switch(theMode){ case eLength: { SMESH::Controls::Length* aControl = new SMESH::Controls::Length(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my1DActor; break; } case eLength2D: { - aFunctor.reset(new SMESH::Controls::Length2D()); + myFunctor.reset(new SMESH::Controls::Length2D()); myControlActor = my2DActor; break; } case eFreeBorders: - aFunctor.reset(new SMESH::Controls::FreeBorders()); + myFunctor.reset(new SMESH::Controls::FreeBorders()); myControlActor = my1DActor; break; case eFreeEdges: - aFunctor.reset(new SMESH::Controls::FreeEdges()); + myFunctor.reset(new SMESH::Controls::FreeEdges()); myControlActor = my2DActor; break; case eFreeNodes: - aFunctor.reset(new SMESH::Controls::FreeNodes()); + myFunctor.reset(new SMESH::Controls::FreeNodes()); myControlActor = myNodeActor; break; case eFreeFaces: - aFunctor.reset(new SMESH::Controls::FreeFaces()); + myFunctor.reset(new SMESH::Controls::FreeFaces()); myControlActor = my2DActor; break; case eMultiConnection: - aFunctor.reset(new SMESH::Controls::MultiConnection()); + myFunctor.reset(new SMESH::Controls::MultiConnection()); myControlActor = my1DActor; break; case eMultiConnection2D: - aFunctor.reset(new SMESH::Controls::MultiConnection2D()); + myFunctor.reset(new SMESH::Controls::MultiConnection2D()); myControlActor = my2DActor; break; case eArea: { SMESH::Controls::Area* aControl = new SMESH::Controls::Area(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -773,7 +772,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::Taper* aControl = new SMESH::Controls::Taper(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -781,7 +780,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::AspectRatio* aControl = new SMESH::Controls::AspectRatio(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -789,7 +788,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my3DActor; break; } @@ -797,7 +796,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::Volume* aControl = new SMESH::Controls::Volume(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my3DActor; break; } @@ -805,7 +804,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::MaxElementLength2D* aControl = new SMESH::Controls::MaxElementLength2D(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -813,7 +812,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::MaxElementLength3D* aControl = new SMESH::Controls::MaxElementLength3D(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my3DActor; break; } @@ -821,7 +820,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -829,7 +828,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::Warping* aControl = new SMESH::Controls::Warping(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -837,7 +836,7 @@ SetControlMode(eControl theMode, { SMESH::Controls::Skew* aControl = new SMESH::Controls::Skew(); aControl->SetPrecision( myControlsPrecision ); - aFunctor.reset( aControl ); + myFunctor.reset( aControl ); myControlActor = my2DActor; break; } @@ -851,21 +850,21 @@ SetControlMode(eControl theMode, myControlMode = theMode; switch(myControlMode){ case eFreeNodes: - myNodeExtActor->SetExtControlMode(aFunctor); + myNodeExtActor->SetExtControlMode(myFunctor); break; case eFreeEdges: case eFreeBorders: - my1DExtActor->SetExtControlMode(aFunctor); + my1DExtActor->SetExtControlMode(myFunctor); break; case eFreeFaces: - my2DExtActor->SetExtControlMode(aFunctor); + my2DExtActor->SetExtControlMode(myFunctor); break; case eLength2D: case eMultiConnection2D: - my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable); + my1DExtActor->SetExtControlMode(myFunctor,myScalarBarActor,myLookupTable); break; default: - myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable); + myControlActor->SetControlMode(myFunctor,myScalarBarActor,myLookupTable); } } @@ -888,8 +887,11 @@ SetControlMode(eControl theMode, SetEntityMode(eVolumes); } - }else if(theCheckEntityMode){ - myEntityMode = eAllEntity; + } + else { + if(theCheckEntityMode) + myEntityMode = eAllEntity; + myFunctor.reset(); } SetRepresentation(GetRepresentation()); diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h index 9e53f5ac6..31d5b9f3e 100644 --- a/src/OBJECT/SMESH_Actor.h +++ b/src/OBJECT/SMESH_Actor.h @@ -119,6 +119,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor eMaxElementLength2D, eMaxElementLength3D}; virtual void SetControlMode(eControl theMode) = 0; virtual eControl GetControlMode() = 0; + virtual SMESH::Controls::FunctorPtr GetFunctor() = 0; virtual vtkScalarBarActor* GetScalarBarActor() = 0; diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index 0a740163b..44bc4f56a 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -185,6 +185,7 @@ class SMESH_ActorDef : public SMESH_Actor virtual void SetControlMode(eControl theMode); virtual eControl GetControlMode(){ return myControlMode;} + virtual SMESH::Controls::FunctorPtr GetFunctor() { return myFunctor; } virtual vtkScalarBarActor* GetScalarBarActor(){ return myScalarBarActor;} @@ -235,6 +236,7 @@ class SMESH_ActorDef : public SMESH_Actor SMESH_DeviceActor* myHighlitableActor; eControl myControlMode; + SMESH::Controls::FunctorPtr myFunctor; vtkProperty* my2DExtProp; SMESH_DeviceActor* my2DActor; SMESH_DeviceActor* my2DExtActor;