Salome HOME
enable Tolerance for FT_EqualNodes
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index 120e2c8038c0ad379b2489e4f8bd271107eaec2e..11eb2b89eeaa3ad656520d0773550255d81528c2 100644 (file)
     }
   }
 
-  void AutoColor(){
+  void AutoColor()
+  {
     SALOME_ListIO selected;
     SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
     if( !app )
     if( aMainObject->_is_nil() )
       return;
 
+    SUIT_OverrideCursor wc;
+
     aMainObject->SetAutoColor( true ); // mesh groups are re-colored here
 
     QList<SALOMEDS::Color> aReservedColors;
       SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
       aReservedColors.append( aColor );
 #endif                    // SIMPLE_AUTOCOLOR
+      aGroupObject->SetColor( aColor );
 
       _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
       if (aGroupSObject) {
@@ -1982,7 +1986,7 @@ bool SMESHGUI::automaticUpdate(unsigned int requestedSize, bool* limitExceeded)
  */
 //=============================================================================
 bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
-                                int* entities, bool* limitExceeded )
+                                int* entities, bool* limitExceeded, int* hidden )
 {
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   if ( !resMgr )
@@ -1995,6 +1999,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
   long requestedSize = theMesh->NbElements();
 
   *entities = SMESH_Actor::eAllEntity;
+  *hidden   = 0;
 
   bool exceeded = updateLimit > 0 && requestedSize > updateLimit;
 
@@ -2009,40 +2014,50 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
     long total     = 0;
 
     if ( nbOdElems > 0 ) {
-      if ( total + nbOdElems > updateLimit )
+      if ( total + nbOdElems > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::e0DElements;
+       *hidden = *hidden | SMESH_Actor::e0DElements;
+      }
       else
         exceeded = false;
     }
     total += nbOdElems;
 
     if ( nbEdges > 0 ) {
-      if ( total + nbEdges > updateLimit )
+      if ( total + nbEdges > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eEdges;
+       *hidden = *hidden | SMESH_Actor::eEdges;
+      }
       else
         exceeded = false;
     }
     total += nbEdges;
 
     if ( nbFaces > 0 ) {
-      if ( total + nbFaces > updateLimit )
+      if ( total + nbFaces > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eFaces;
+       *hidden = *hidden | SMESH_Actor::eFaces;
+      }
       else
         exceeded = false;
     }
     total += nbFaces;
 
     if ( nbVolumes > 0 ) {
-      if ( total + nbVolumes > updateLimit )
+      if ( total + nbVolumes > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eVolumes;
+       *hidden = *hidden | SMESH_Actor::eVolumes;
+      }
       else
         exceeded = false;
     }
     total += nbVolumes;
 
     if ( nbBalls > 0 ) {
-      if ( total + nbBalls > updateLimit )
+      if ( total + nbBalls > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eBallElem;
+       *hidden = *hidden | SMESH_Actor::eBallElem;
+      }
       else
         exceeded = false;
     }
@@ -3526,8 +3541,20 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case 501:
   case 502:
+  case 503:
+  case 504:
+  case 505:
     {
-      int page = theCommandID == 501 ? SMESHGUI_MeasureDlg::MinDistance : SMESHGUI_MeasureDlg::BoundingBox;
+      int page = SMESHGUI_MeasureDlg::MinDistance;
+      if ( theCommandID == 502 )
+       page = SMESHGUI_MeasureDlg::BoundingBox;
+      else if ( theCommandID == 503 )
+       page = SMESHGUI_MeasureDlg::Length;
+      else if ( theCommandID == 504 )
+       page = SMESHGUI_MeasureDlg::Area;
+      else if ( theCommandID == 505 )
+       page = SMESHGUI_MeasureDlg::Volume;
+
       EmitSignalDeactivateDialog();
       SMESHGUI_MeasureDlg* dlg = new SMESHGUI_MeasureDlg( SMESHGUI::desktop(), page );
       dlg->show();
@@ -3829,6 +3856,9 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   createSMESHAction( 501, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" );
   createSMESHAction( 502, "MEASURE_BND_BOX",  "ICON_MEASURE_BND_BOX" );
+  createSMESHAction( 503, "MEASURE_LENGTH",   "ICON_MEASURE_LENGTH" );
+  createSMESHAction( 504, "MEASURE_AREA",     "ICON_MEASURE_AREA" );
+  createSMESHAction( 505, "MEASURE_VOLUME",   "ICON_MEASURE_VOLUME" );
 
   createSMESHAction( 300, "HIDE" );
   createSMESHAction( 301, "SHOW" );
@@ -3857,7 +3887,8 @@ void SMESHGUI::initialize( CAM_Application* app )
       addId    = createMenu( tr( "MEN_ADD" ),    modifyId, 402 ),
       removeId = createMenu( tr( "MEN_REMOVE" ), modifyId, 403 ),
       renumId  = createMenu( tr( "MEN_RENUM" ),  modifyId, 404 ),
-      transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 );
+      transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 ),
+      basicPropId = createMenu( tr( "MEN_BASIC_PROPERTIES" ), measureId, -1, 10 );
 
   //createMenu( 111, importId, -1 );
   createMenu( 112, importId, -1 );
@@ -4005,6 +4036,9 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   createMenu( 501, measureId, -1 );
   createMenu( 502, measureId, -1 );
+  createMenu( 503, basicPropId, -1 );
+  createMenu( 504, basicPropId, -1 );
+  createMenu( 505, basicPropId, -1 );
   createMenu( 214, viewId, -1 );
 
   // ----- create toolbars --------------