From 074862c21362ffeb5556c4f16c843aacda569121 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 29 Jun 2018 16:38:39 +0300 Subject: [PATCH] 23570: EDF17299 - Problem with filters + fix persistence of Group on Filter + minor fix of docs --- doc/salome/examples/ex_MakePolyLine.py | 4 ++-- doc/salome/examples/modifying_meshes_split_vol.py | 4 ++-- doc/salome/examples/radial_prism_3d_algo.py | 4 ++-- doc/salome/gui/SMESH/input/constructing_submeshes.rst | 4 +++- doc/salome/gui/SMESH/input/smeshpy_interface.rst | 4 ++-- src/Controls/SMESH_Controls.cxx | 3 +++ src/SMESH_I/SMESH_PreMeshInfo.cxx | 4 ++-- src/SMESH_SWIG/smesh_algorithm.py | 1 + 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/doc/salome/examples/ex_MakePolyLine.py b/doc/salome/examples/ex_MakePolyLine.py index 0a9c67b1b..20919129f 100644 --- a/doc/salome/examples/ex_MakePolyLine.py +++ b/doc/salome/examples/ex_MakePolyLine.py @@ -4,7 +4,7 @@ salome.salome_init() ### create geometry from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) geompy.addToStudy( Box_1, 'Box_1' ) @@ -13,7 +13,7 @@ geompy.addToStudy( Box_1, 'Box_1' ) import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() Mesh_1 = smesh.Mesh( Box_1 ) Mesh_1.Segment().NumberOfSegments(15) diff --git a/doc/salome/examples/modifying_meshes_split_vol.py b/doc/salome/examples/modifying_meshes_split_vol.py index 113aac36b..38e8601b3 100644 --- a/doc/salome/examples/modifying_meshes_split_vol.py +++ b/doc/salome/examples/modifying_meshes_split_vol.py @@ -4,9 +4,9 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # mesh a hexahedral mesh box = geompy.MakeBoxDXDYDZ (1, 1, 1 ) diff --git a/doc/salome/examples/radial_prism_3d_algo.py b/doc/salome/examples/radial_prism_3d_algo.py index 39b260723..6e8c7adba 100644 --- a/doc/salome/examples/radial_prism_3d_algo.py +++ b/doc/salome/examples/radial_prism_3d_algo.py @@ -3,10 +3,10 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Create geometry: hollow sphere diff --git a/doc/salome/gui/SMESH/input/constructing_submeshes.rst b/doc/salome/gui/SMESH/input/constructing_submeshes.rst index 974b27916..af3c417f4 100644 --- a/doc/salome/gui/SMESH/input/constructing_submeshes.rst +++ b/doc/salome/gui/SMESH/input/constructing_submeshes.rst @@ -15,7 +15,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 cee154d03..0e209705a 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.rst +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.rst @@ -11,7 +11,7 @@ Documentation of SALOME Mesh module Python API is available in two forms: - :doc:`Structured documentation `, where all methods and classes are grouped by their functionality. -- :ref:`Linear documentation ` grouped only by classes, declared in the :mod:`smeshBuilder` and :mod:`StdMeshersBuilder` Python packages. +- :ref:`Linear documentation ` grouped only by classes, declared in the :mod:`smeshBuilder` Python module. With SALOME 7.2, the Python interface for Mesh has been slightly modified to offer new functionality. You may have to modify your scripts generated with SALOME 6 or older versions. @@ -73,7 +73,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 7fcc948da..2a1e274fd 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -4567,6 +4567,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 ); } @@ -4578,6 +4579,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 ) { @@ -4594,6 +4596,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 886f4a6d1..989de27e6 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 }; // count not yet loaded meshes static int theMeshCounter = 0; @@ -254,7 +254,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 ] ); diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index 45841d000..62edcb3fd 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -74,6 +74,7 @@ class Mesh_Algorithm: """ Finds a hypothesis in the study by its type name and parameters. Finds only the hypotheses created in smeshBuilder engine. + Returns: :class:`~SMESH.SMESH_Hypothesis` """ -- 2.39.2