]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Bug PAL7334
authorapo <apo@opencascade.com>
Mon, 27 Dec 2004 14:02:40 +0000 (14:02 +0000)
committerapo <apo@opencascade.com>
Mon, 27 Dec 2004 14:02:40 +0000 (14:02 +0000)
  DEVELOPMENT : Control Improvement

resources/SMESH_en.xml
src/OBJECT/SMESH_Actor.cxx
src/SMESHGUI/SMESHGUI.cxx

index 2913c8574eeb2e9ef6b54e509f037bc592a4312c..387e3ac8c1e813c37bd2ca0f3d7296f331e04d8e 100644 (file)
 <!-- ********************************* Settings  (menubar) ********************************* -->
 <menu-item label-id="Preferences" item-id="4" pos-id="">
    <submenu label-id="Mesh" item-id="100" pos-id="-1">
-    <submenu label-id="Display Mode" item-id="1000" pos-id="">
+   <submenu label-id="Display Mode" item-id="1000" pos-id="">
        <popup-item item-id="10001" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
        <popup-item item-id="10002" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
        <popup-item item-id="10004" pos-id="" label-id="Nodes" icon-id="mesh_points.png" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
     <separator pos-id=""/>
     <popup-item item-id="1006" pos-id="" label-id="Selection" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
     <separator pos-id=""/>
-    <popup-item item-id="1007" pos-id="" label-id="Quality controls" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+    <submenu label-id="Quality controls" item-id="1007" pos-id="">
+       <popup-item item-id="10070" pos-id="" label-id="Precision" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
+       <popup-item item-id="10071" pos-id="" label-id="Display Entity" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
+    </submenu>
+    <endsubmenu /> 
    </submenu>
    <endsubmenu />
    <separator pos-id="-1"/>
index 41b7668f222ff4f4d544b2108b5c9f6f2d459f48..9bd62817c4d684c5fd196928425cb029f0b8b4fe 100644 (file)
@@ -736,7 +736,20 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
        myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
       }
     }
+
+    if(QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true"){
+      if(myControlActor == my1DActor)
+       myEntityMode = eEdges;
+      else if(myControlActor == my2DActor)
+       myEntityMode = eFaces;
+      else if(myControlActor == my3DActor)
+       myEntityMode = eVolumes;
+    }
+
+  }else if(QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true"){
+    myEntityMode = eAllEntity;
   }
+
   SetRepresentation(GetRepresentation());
 
   myTimeStamp->Modified();
@@ -1011,18 +1024,18 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
     if(theIsUpdateRepersentation)
       SetRepresentation(GetRepresentation());
 
-    switch(myControlMode){
-    case eNone:
-      break;
-    case eFreeEdges:
-    case eFreeBorders:
-      my1DExtActor->VisibilityOn();
-      break;
-    case eLength2D:
-      my1DExtActor->VisibilityOn();
-    default:
-      if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
-       myScalarBarActor->VisibilityOn();
+    if(myControlMode != eNone){
+      switch(myControlMode){
+      case eFreeEdges:
+      case eFreeBorders:
+       my1DExtActor->VisibilityOn();
+       break;
+      case eLength2D:
+       my1DExtActor->VisibilityOn();
+      default:
+       if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
+         myScalarBarActor->VisibilityOn();
+      }
     }
 
     if(myRepresentation != ePoint)
@@ -1037,8 +1050,11 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
     if(myEntityMode & eVolumes)
       my3DActor->VisibilityOn();
     
-    if(myIsPointsLabeled) myPointLabels->VisibilityOn();
-    if(myIsCellsLabeled) myCellsLabels->VisibilityOn();
+    if(myIsPointsLabeled) 
+      myPointLabels->VisibilityOn();
+
+    if(myIsCellsLabeled) 
+      myCellsLabels->VisibilityOn();
   }
 
   Modified();
index f407960d426c31f0ba759796162ed5b3ab0e2530..453dda9b951df97f8787f4a586571ddf1b64c7f1 100644 (file)
@@ -1662,12 +1662,23 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent)
       break;
     }
 
-  case 1007:
+  case 10070:
     {
       ( new SMESHGUI_PrecisionDlg( parent ) )->exec();
       break;
     }
 
+  case 10071:
+    {
+      parent->menuBar()->setItemChecked(10071, !parent->menuBar()->isItemChecked(10071));
+      if (parent->menuBar()->isItemChecked(10071)) {
+       QAD_CONFIG->addSetting("SMESH:DispayEntity","true");
+      }
+      else {
+       QAD_CONFIG->addSetting("SMESH:DispayEntity","false");
+      }
+      break;
+    }
   case 1006: 
     {
       SMESHGUI_Preferences_SelectionDlg* aDlg = 
@@ -2254,6 +2265,12 @@ bool SMESHGUI::SetSettings(QAD_Desktop * parent)
     myAutomaticUpdate = false;
   }
 
+  QString anIsDisplayEntity = QAD_CONFIG->getSetting("SMESH:DispayEntity");
+  if(anIsDisplayEntity.compare("true") == 0)
+    parent->menuBar()->setItemChecked(10071,true);
+  else
+    parent->menuBar()->setItemChecked(10071,false);
+
   /* Selection */
   SMESH::UpdateSelectionProp();