Salome HOME
23570: EDF17299 - Problem with filters
authoreap <eap@opencascade.com>
Fri, 29 Jun 2018 13:38:39 +0000 (16:38 +0300)
committereap <eap@opencascade.com>
Fri, 29 Jun 2018 13:38:39 +0000 (16:38 +0300)
+ fix persistence of Group on Filter
+ minor fix of docs

doc/salome/examples/ex_MakePolyLine.py
doc/salome/examples/modifying_meshes_split_vol.py
doc/salome/examples/radial_prism_3d_algo.py
doc/salome/gui/SMESH/input/constructing_submeshes.rst
doc/salome/gui/SMESH/input/smeshpy_interface.rst
src/Controls/SMESH_Controls.cxx
src/SMESH_I/SMESH_PreMeshInfo.cxx
src/SMESH_SWIG/smesh_algorithm.py

index 0a9c67b1b8f742df37353b0960c1ef6463187815..20919129f692a43916aa2d8bc277d32a1fa603dd 100644 (file)
@@ -4,7 +4,7 @@ salome.salome_init()
 ### create geometry
 
 from salome.geom import geomBuilder
 ### 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' )
 
 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
 
 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)
 
 Mesh_1 = smesh.Mesh( Box_1 )
 Mesh_1.Segment().NumberOfSegments(15)
index 113aac36b5575e7ad4a31b6c60dfc92c22a95c12..38e8601b377e2bafbcb27daa02362321e142ab7a 100644 (file)
@@ -4,9 +4,9 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 from salome.smesh import smeshBuilder
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
 
 # mesh a hexahedral mesh
 box = geompy.MakeBoxDXDYDZ (1, 1, 1 )
 
 # mesh a hexahedral mesh
 box = geompy.MakeBoxDXDYDZ (1, 1, 1 )
index 39b260723bced46f89e4d9c4ec251764fdab07ce..6e8c7adba50a29e61894d1945626ae0f93e54e64 100644 (file)
@@ -3,10 +3,10 @@
 import salome
 salome.salome_init()
 from salome.geom import geomBuilder
 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
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create geometry: hollow sphere
 
 
 # Create geometry: hollow sphere
 
index 974b27916228a75278cb367a380b82bf83839c85..af3c417f4e8d4910ed423ef52b43ffce493925de 100644 (file)
@@ -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
 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 <create_groups_from_geometry_page>` 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
 
 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
index cee154d031b43970fc99e78faed08b8492bacbd0..0e209705a2372cd2c69bd735b36158a8ff8546ec 100644 (file)
@@ -11,7 +11,7 @@ Documentation of SALOME Mesh module Python API is available in two forms:
 
 - :doc:`Structured documentation <modules>`, where all methods and classes are grouped by their functionality.
 
 
 - :doc:`Structured documentation <modules>`, where all methods and classes are grouped by their functionality.
 
-- :ref:`Linear documentation <modindex>` grouped only by classes, declared in the :mod:`smeshBuilder` and :mod:`StdMeshersBuilder` Python packages.
+- :ref:`Linear documentation <modindex>` 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.
 
 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.
 
 
 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:
 generation and for retrieving information on mesh nodes and elements.
 
 .. _example_3d_mesh:
index 7fcc948da5ef4c6789c2fdd0fe844ea5264c50ab..2a1e274fd530f72d4f5c50243c87b622421cbff7 100644 (file)
@@ -4567,6 +4567,7 @@ ElementsOnShape::Classifier::~Classifier()
 
 bool ElementsOnShape::Classifier::isOutOfSolid (const gp_Pnt& p)
 {
 
 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 );
 }
   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)
 {
 
 bool ElementsOnShape::Classifier::isOutOfFace  (const gp_Pnt& p)
 {
+  if ( isOutOfBox( p )) return true;
   myProjFace.Perform( p );
   if ( myProjFace.IsDone() && myProjFace.LowerDistance() <= myTol )
   {
   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)
 {
 
 bool ElementsOnShape::Classifier::isOutOfEdge  (const gp_Pnt& p)
 {
+  if ( isOutOfBox( p )) return true;
   myProjEdge.Perform( p );
   return ! ( myProjEdge.NbPoints() > 0 && myProjEdge.LowerDistance() <= myTol );
 }
   myProjEdge.Perform( p );
   return ! ( myProjEdge.NbPoints() > 0 && myProjEdge.LowerDistance() <= myTol );
 }
index 886f4a6d1cfa34de335b7b94ead6c435fc20d77b..989de27e6cb69b2d448f6111801c6b570addde79 100644 (file)
@@ -61,7 +61,7 @@ using namespace std;
 
 namespace
 {
 
 namespace
 {
-  enum {  GroupOnFilter_OutOfDate = -1 };
+  enum {  GroupOnFilter_OutOfDate = -777 };
 
   // count not yet loaded meshes
   static int theMeshCounter = 0;
 
   // count not yet loaded meshes
   static int theMeshCounter = 0;
@@ -254,7 +254,7 @@ namespace
     std::vector<int> data;
 
     for ( size_t i = 0; i < meshInfo->length(); ++i )
     std::vector<int> 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 ] );
       {
         data.push_back( DriverMED::GetMedGeoType( SMDSAbs_EntityType( i ))); //medTypes[ i ] );
         data.push_back( meshInfo[ i ] );
index 45841d0003c3f19c7e956e2aeab0102e702d4abf..62edcb3fd37a4827a0dca1f5d037c0ed5880074d 100644 (file)
@@ -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.
         """
         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`
         """
         Returns: 
                 :class:`~SMESH.SMESH_Hypothesis`
         """