From: eap Date: Thu, 23 Oct 2014 08:21:14 +0000 (+0400) Subject: 52548: Set filter on standalone group of edges does't work X-Git-Tag: V7_5_0b1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3ba242025de908077c7407f8eb75e1fe328dfc0b;p=modules%2Fsmesh.git 52548: Set filter on standalone group of edges does't work 2) Allow passing a geom group as faces arg of ViscousLayers() 3) Prevent crash of Adaptive hyp when only degenerated EDGEs leave not meshed --- diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 0293f51a3..d0bb58cd2 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -3020,7 +3020,8 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria SMESH::Predicate_ptr aPrevPredicate = SMESH::Predicate::_nil(); int aPrevBinary = SMESH::FT_Undefined; - aBinaries.back() = SMESH::FT_Undefined; + if ( !aBinaries.empty() ) + aBinaries.back() = SMESH::FT_Undefined; for ( aPredIter = aPredicates.begin(), aBinaryIter = aBinaries.begin(); aPredIter != aPredicates.end() && aBinaryIter != aBinaries.end(); diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index 46f2270c1..8ce382e17 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -274,7 +274,14 @@ class Mesh_Algorithm: if not "ViscousLayers" in self.GetCompatibleHypothesis(): raise TypeError, "ViscousLayers are not supported by %s"%self.algo.GetName() if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ): - faces = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in faces ] + import GEOM + faceIDs = [] + for f in faces: + if self.mesh.geompyD.ShapeIdToType( f.GetType() ) == "GROUP": + faceIDs += f.GetSubShapeIndices() + else: + faceIDs += [self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f)] + faces = faceIDs hyp = self.Hypothesis("ViscousLayers", [thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore], toAdd=False) diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 62a2cf5a9..7bcfca77d 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -1179,6 +1179,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, eData.AddPoint( eData.myPoints.end(), eData.myC3d.LastParameter() ); } } + if ( myEdges.empty() ) return true; if ( _computeCanceled ) return false; // Take into account size of already existing segments