Salome HOME
53416: SALOME crashes when selecting a sub-menu of Control menu item
authoreap <eap@opencascade.com>
Tue, 21 Jun 2016 11:04:19 +0000 (14:04 +0300)
committereap <eap@opencascade.com>
Tue, 21 Jun 2016 11:04:19 +0000 (14:04 +0300)
doc/salome/gui/SMESH/input/about_meshes.doc
doc/salome/gui/SMESH/input/constructing_meshes.doc
doc/salome/gui/SMESH/input/index.doc
doc/salome/gui/SMESH/input/max_element_length_2d.doc
doc/salome/gui/SMESH/input/max_element_length_3d.doc
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx

index 003258f37884bc84659434e6861c836b47ebfa8c..2795d885ed4660de5c923c714ea42c44dd38271b 100644 (file)
@@ -35,7 +35,7 @@ Mesh module provides several ways to create the mesh:
   </li>
   <li>Bottom-up way, using \ref modifying_meshes_page "mesh modification"
     operations, especially \ref extrusion_page "extrusion" and \ref
-    revolution_page "revolution". To create an empty mesh not based on a
+    revolution_page "revolution". To create an empty mesh not based on
     geometry, use the same dialog as to \ref constructing_meshes_page
     "construct the mesh on geometry" but specify neither the geometry
     nor meshing algorithms.
@@ -44,9 +44,9 @@ Mesh module provides several ways to create the mesh:
     (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and
     SAUVE formats.
   </li>
-  <li>The 3D mesh can be generated from the 2D mesh not based on the geometry,
+  <li>The 3D mesh can be generated from the 2D mesh not based on geometry,
     which was either \ref importing_exporting_meshes_page "imported" or created in
-    other way. To setup the meshing parameters of a mesh not based on geometry,
+    other way. To setup the meshing parameters of a mesh not based on geometry,
     just invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on
     your 2D mesh.
   </li>
index 2ec8a49878fa121577843d32121c0b28324a3421..3a0490c210511bf87bde514e42e9e86dd3fe7bd2 100644 (file)
@@ -10,6 +10,9 @@ To create a mesh on geometry, it is necessary to create a mesh object by choosin
     taken into account by the chosen meshing algorithms.
 
 Then you can launch mesh generation by invoking \ref compute_anchor "Compute" command.
+The generated mesh will be automatically shown in the Viewer. You can
+switch off automatic visualization or limit mesh size until which it is
+automatically shown in \ref mesh_preferences_page (<em>Automatic update</em> entry).
 
 \note Sometimes \a hypotheses term is used to refer to both algorithms
 and hypotheses.
index 9bcdd79078048f82a7bb368efe6eaa2013662c13..e2762515b71e2c7837d08317b7811876659b40b5 100644 (file)
@@ -1,6 +1,6 @@
 /*!
 
-\mainpage Introduction to MESH
+\mainpage Introduction to Mesh module
 
 \image html a-viewgeneral.png
 
index 6ec4f71160ed1bdbb0f086e26ecbf362c1a20c05..e4e2ce9a88592da60351b32735537e21b4403983 100644 (file)
@@ -2,8 +2,9 @@
 
 \page max_element_length_2d_page Element Diameter 2D
 
-\n This quality control criterion consists in calculation of the length of
-edges and diagonals combining 2D mesh elements (triangles and quadrangles).
+\n This quality control criterion consists in calculation of the maximal length of
+edges and diagonals of 2D mesh elements (triangles and quadrangles). For polygons
+the value is always zero.
 
 <em>To apply the Element Diameter 2D quality criterion to your mesh:</em>
 <ol>
index 7aa70ad7bac61de67d2878b8e815222407cc916e..837f6aa6fd66a0afd05ead6862101eb43a729d5f 100644 (file)
@@ -2,9 +2,9 @@
 
 \page max_element_length_3d_page Element Diameter 3D
 
-\n This quality control criterion consists in calculation of the length of
-edges and diagonals combining 3D mesh elements
-(tetrahedrons, pyramids, pentahendrons, hexahedrons and polyhedrons).
+\n This quality control criterion consists in calculation of the maximal length of
+edges and diagonals of 3D mesh elements (tetrahedrons, pyramids, etc). For polyhedra
+the value is always zero. 
 
 <em>To apply the Element Diameter 3D quality criterion to your mesh:</em>
 <ol>
index ccf68d935d8cfee826001d29bb6105b7b84d96bf..a14b72eed2c353479538fccc2bf3a81b852e9896 100644 (file)
@@ -195,7 +195,7 @@ namespace
 
   void SetDisplayEntity(int theCommandID);
 
-  int ActionToControl( int theID, bool theReversed = false );
+  int  ActionToControl( int theID, bool theReversed = false );
 
   void Control( int theCommandID );
 
@@ -265,14 +265,16 @@ namespace
                                                   filter,
                                                   QObject::tr( "SMESH_IMPORT_MESH" ) );
     }
-    if ( filenames.count() > 0 ) {
+    if ( filenames.count() > 0 )
+    {
       SUIT_OverrideCursor wc;
       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 
       QStringList errors;
       QStringList anEntryList;
       bool isEmpty = false;
-      for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
+      for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it )
+      {
         QString filename = *it;
         SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
         try {
@@ -365,7 +367,8 @@ namespace
                          arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
         }
 
-        for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
+        for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ )
+        {
           _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
           if ( aMeshSO ) {
             _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
@@ -1634,11 +1637,11 @@ namespace
 
   void Control( int theCommandID )
   {
-    SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ) );
+    SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
     _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
+
     SALOME_ListIO selected;
-    if ( aSel )
+    if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
       aSel->selectedObjects( selected );
 
     if ( !selected.IsEmpty() ) {
@@ -1646,14 +1649,24 @@ namespace
       for ( ; It.More(); It.Next())
       {
         Handle(SALOME_InteractiveObject) anIO = It.Value();
-        if(!anIO.IsNull()){
+        if ( !anIO.IsNull() ) {
           _PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
           if ( SO ) {
             CORBA::Object_var         aObject = SMESH::SObjectToObject( SO );
             SMESH::SMESH_IDSource_var anIDSrc = SMESH::SMESH_IDSource::_narrow( aObject );
             if ( !anIDSrc->_is_nil() ) {
-              if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()) ) {
+              SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
+              if (( !anActor && selected.Extent() == 1 ) &&
+                  ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
+              {
                 anActor->SetControlMode( aControl );
+                SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
+                SMESH::UpdateView  ( SMESH::eDisplay, anIO->getEntry() );
+              }
+              if ( anActor )
+              {
+                if ( anActor->GetControlMode() != aControl )
+                  anActor->SetControlMode( aControl );
                 QString functorName = functorToString( anActor->GetFunctor() );
                 anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
                 SMESH::RepaintCurrentView();
@@ -4148,9 +4161,9 @@ void SMESHGUI::initialize( CAM_Application* app )
   createMenu( SMESHOp::OpPropertiesVolume, basicPropId, -1 );
   createMenu( SMESHOp::OpUpdate,           viewId,      -1 );
 
-  connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
-  connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
-  connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
+  connect( nodeMenu,   SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
+  connect( edgeMenu,   SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
+  connect( faceMenu,   SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
   connect( volumeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
 
   // ----- create toolbars --------------
@@ -6832,23 +6845,24 @@ void SMESHGUI::onHypothesisEdit( int result )
 */
 void SMESHGUI::onUpdateControlActions()
 {
-  LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
   SALOME_ListIO selected;
-  if ( aSel )
+  if ( LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr() )
     aSel->selectedObjects( selected );
 
   SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
   if ( selected.Extent() ) {
     if ( selected.First()->hasEntry() ) {
-      aControl = SMESH::FindActorByEntry( selected.First()->getEntry() )->GetControlMode();
-      SALOME_ListIteratorOfListIO it(selected);
-      for ( ; it.More(); it.Next() ) {
-        Handle(SALOME_InteractiveObject) anIO = it.Value();
-        if ( anIO->hasEntry() ) {
-          if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
-            if ( aControl != anActor->GetControlMode() ) {
-              aControl = SMESH_Actor::eNone;
-              break;
+      if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( selected.First()->getEntry() )) {
+        aControl = anActor->GetControlMode();
+        SALOME_ListIteratorOfListIO it(selected);
+        for ( it.Next(); it.More(); it.Next() ) {
+          Handle(SALOME_InteractiveObject) anIO = it.Value();
+          if ( anIO->hasEntry() ) {
+            if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
+              if ( aControl != anActor->GetControlMode() ) {
+                aControl = SMESH_Actor::eNone;
+                break;
+              }
             }
           }
         }
index c4de8a50729fdcbd0ab88554291c59dfe01e08fc..c7b72d386ff2607d853719458c63a4266dd0595d 100644 (file)
@@ -953,10 +953,8 @@ void SMESHGUI_BaseComputeOp::computeMesh()
         {
           SMESH::SMESH_GroupBase_var aGrp = aGroups[i];
           if ( CORBA::is_nil( aGrp ) ) continue;
-          SMESH::SMESH_Group_var         aStdGroup  = SMESH::SMESH_Group::_narrow( aGrp );
-          SMESH::SMESH_GroupOnGeom_var   aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
-          SMESH::SMESH_GroupOnFilter_var aFltGroup  = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
-          if ( !aStdGroup->_is_nil() ) continue; // don't update the standalone groups
+          SMESH::SMESH_Group_var  aStdGroup  = SMESH::SMESH_Group::_narrow( aGrp );
+          if ( !aStdGroup->_is_nil() ) continue; // don't update standalone groups
           _PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp );
           if ( !aGroupSO ) continue;
           SMESH::SMESH_IDSource_var aGroupObj =