From 23d1f04586e03800fa7cf056aa3c651233104a51 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 9 Jul 2018 18:15:13 +0300 Subject: [PATCH] 23570: EDF17299 - Problem with filters + fix persistence of Group on Filter + minor fix of docs --- doc/salome/gui/SMESH/input/constructing_submeshes.rst | 4 +++- doc/salome/gui/SMESH/input/smeshpy_interface.rst | 2 +- src/Controls/SMESH_Controls.cxx | 3 +++ src/SMESH_I/SMESH_PreMeshInfo.cxx | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/salome/gui/SMESH/input/constructing_submeshes.rst b/doc/salome/gui/SMESH/input/constructing_submeshes.rst index 3f414135d..0630c3ba0 100644 --- a/doc/salome/gui/SMESH/input/constructing_submeshes.rst +++ b/doc/salome/gui/SMESH/input/constructing_submeshes.rst @@ -12,7 +12,9 @@ different meshing parameters than those assigned to the main shape. Structurally, the sub-mesh is a mesh on a certain sub-shape, or a group of sub-shapes, possibly generated using different meshing algorithms and/or hypotheses than those used to generate the mesh on other -sub-shapes. +sub-shapes. Elements generated on a sub-shape can be retrieved without +explicit creation of a sub-mesh by creating a *Group on Geometry* using +:ref:`Create Groups from Geometry ` dialog. Creation of a sub-mesh allows to control individually meshing of a certain sub-shape, thus to get a locally coarser or finer mesh, to get diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.rst b/doc/salome/gui/SMESH/input/smeshpy_interface.rst index 7a71f5cb6..27d5accec 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.rst +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.rst @@ -75,7 +75,7 @@ by calling *dir()* Python built-in function. All methods of the Mesh Group can be found in :ref:`tui_create_standalone_group` sample script. -An example below demonstrates usage of the Python API for 3d mesh +An example below demonstrates usage of the Python API for 3D mesh generation and for retrieving information on mesh nodes and elements. .. _example_3d_mesh: diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 1ccd96f99..464ac1fd3 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -4561,6 +4561,7 @@ ElementsOnShape::Classifier::~Classifier() bool ElementsOnShape::Classifier::isOutOfSolid (const gp_Pnt& p) { + if ( isOutOfBox( p )) return true; mySolidClfr->Perform( p, myTol ); return ( mySolidClfr->State() != TopAbs_IN && mySolidClfr->State() != TopAbs_ON ); } @@ -4572,6 +4573,7 @@ bool ElementsOnShape::Classifier::isOutOfBox (const gp_Pnt& p) bool ElementsOnShape::Classifier::isOutOfFace (const gp_Pnt& p) { + if ( isOutOfBox( p )) return true; myProjFace.Perform( p ); if ( myProjFace.IsDone() && myProjFace.LowerDistance() <= myTol ) { @@ -4588,6 +4590,7 @@ bool ElementsOnShape::Classifier::isOutOfFace (const gp_Pnt& p) bool ElementsOnShape::Classifier::isOutOfEdge (const gp_Pnt& p) { + if ( isOutOfBox( p )) return true; myProjEdge.Perform( p ); return ! ( myProjEdge.NbPoints() > 0 && myProjEdge.LowerDistance() <= myTol ); } diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 38c13009c..52a831b6d 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -61,7 +61,7 @@ using namespace std; namespace { - enum { GroupOnFilter_OutOfDate = -1 }; + enum { GroupOnFilter_OutOfDate = -777 }; // a map to count not yet loaded meshes static std::map< int, int > theStudyIDToMeshCounter; @@ -259,7 +259,7 @@ namespace std::vector data; for ( size_t i = 0; i < meshInfo->length(); ++i ) - if ( meshInfo[i] > 0 ) + if ( meshInfo[i] > 0 || meshInfo[i] == GroupOnFilter_OutOfDate ) { data.push_back( DriverMED::GetMedGeoType( SMDSAbs_EntityType( i ))); //medTypes[ i ] ); data.push_back( meshInfo[ i ] ); -- 2.39.2