]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Bug PAL7334 - DEVELOPMENT : Control Improvement
authorapo <apo@opencascade.com>
Tue, 28 Dec 2004 06:52:07 +0000 (06:52 +0000)
committerapo <apo@opencascade.com>
Tue, 28 Dec 2004 06:52:07 +0000 (06:52 +0000)
resources/SMESH_en.xml
src/OBJECT/SMESH_Actor.cxx

index 387e3ac8c1e813c37bd2ca0f3d7296f331e04d8e..f27e1f54056e4fe782155bd08586c97f151cd478 100644 (file)
 
 <!-- ************************** Control  (menubar)  ************************************ -->
 <menu-item label-id="Controls" item-id="60" pos-id="5">
-       <popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-       <popup-item item-id="6018" pos-id="" label-id="Length2D" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-       <popup-item item-id="6002" pos-id="" label-id="Free Edges" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+       <popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+        <separator pos-id=""/>
+       <popup-item item-id="6002" pos-id="" label-id="Free Edges" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+       <popup-item item-id="6018" pos-id="" label-id="Length2D" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
         <popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
         <popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-        <popup-item item-id="6017" pos-id="" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6015" pos-id="" label-id="Warping" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>  
+        <separator pos-id=""/>
+        <popup-item item-id="6017" pos-id="" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
 </menu-item>
         
 <!-- ************************** Entity  (menubar)  ************************************ -->
    <submenu label-id="Control" item-id="2000" pos-id="">
        <popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
         <separator pos-id=""/>
-        <popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+        <popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
         <separator pos-id=""/>
        <popup-item item-id="6002" pos-id="" label-id="Free Edges" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
    <submenu label-id="Control" item-id="2000" pos-id="">
        <popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
         <separator pos-id=""/>
-        <popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+        <popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
        <popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
         <separator pos-id=""/>
        <popup-item item-id="6002" pos-id="" label-id="Free Edges" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
index 9bd62817c4d684c5fd196928425cb029f0b8b4fe..8a3962e4a960218fdca3afebae2f0c720a53d239 100644 (file)
@@ -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){