]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
bool SMESH_HypoFilter::IsMoreLocalThanPredicate::IsOk(const SMESH_Hypothesis* aHyp,
authoreap <eap@opencascade.com>
Thu, 2 Sep 2010 06:26:23 +0000 (06:26 +0000)
committereap <eap@opencascade.com>
Thu, 2 Sep 2010 06:26:23 +0000 (06:26 +0000)
                                                       const TopoDS_Shape&     aShape) const
 {
+  // issue 0020963
+  // if aShape is COMPOUND (i.e. most probably a GEOM group) then
+  // it is more local if it contains shapes of less dimension than _shapeType
+  ...

src/SMESH/SMESH_HypoFilter.cxx

index 1f6685d15184a21bce84479e16b2cd81e86c1644..dd99ac11a474597ad75afa3855eb4bc98b28c7d5 100644 (file)
@@ -30,6 +30,8 @@
 #include "SMESH_Hypothesis.hxx"
 #include "SMESH_subMesh.hxx"
 
+#include <TopExp_Explorer.hxx>
+
 using namespace std;
 
 
@@ -126,6 +128,13 @@ bool SMESH_HypoFilter::IsAssignedToPredicate::IsOk(const SMESH_Hypothesis* aHyp,
 bool SMESH_HypoFilter::IsMoreLocalThanPredicate::IsOk(const SMESH_Hypothesis* aHyp,
                                                       const TopoDS_Shape&     aShape) const
 {
+  // issue 0020963
+  // if aShape is COMPOUND (i.e. most probably a GEOM group) then
+  // it is more local if it contains shapes of less dimension than _shapeType
+  if ( aShape.ShapeType() == TopAbs_COMPOUND )
+    for ( int moreLocalType = _shapeType+1; moreLocalType < int(TopAbs_SHAPE); ++moreLocalType )
+      if ( TopExp_Explorer( aShape, TopAbs_ShapeEnum(moreLocalType)).More())
+        return true;
   return ( aShape.ShapeType() > _shapeType );
 }