From: eap Date: Wed, 7 Nov 2007 09:48:46 +0000 (+0000) Subject: PAL16202,16203 (Propagation 1D on edges group) X-Git-Tag: V3_2_9rc1~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=83aaa0ea088822b56de5f4651e6177f1618b4b19;p=modules%2Fsmesh.git PAL16202,16203 (Propagation 1D on edges group) - * * theNumber - Number of subshapes. Object is selected if it contains theNumber of - * theSubShapeType sub-shapes + * * theNumber - Number of subshapes. Object is selected if it contains + * theNumber of theSubShapeType sub-shapes, or at least + * one theSubShapeType, provided that theNumber==0 --- diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx index 61162a581..36a091c72 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx @@ -35,8 +35,9 @@ #include "SALOMEDSClient_SObject.hxx" #include "SALOMEDS_SObject.hxx" -#include #include +#include +#include /*! * Class : SMESH_NumberFilter @@ -135,12 +136,13 @@ bool SMESH_NumberFilter::isOk (const SUIT_DataOwner* theDataOwner) const if (mySubShapeType == TopAbs_SHAPE); return true; - TopExp_Explorer anExp2 (aShape, mySubShapeType); - TopTools_MapOfShape aMap; - for (; anExp2.More(); anExp2.Next()) - aMap.Add(anExp2.Current()); + TopTools_IndexedMapOfShape aMap; + TopExp::MapShapes(aShape, mySubShapeType, aMap); - return myNumber == aMap.Extent(); + if ( myNumber ) + return myNumber == aMap.Extent(); // given number + + return aMap.Extent(); // at least one? } //======================================================================= diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx index a1d96c310..c2d0b6741 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx @@ -41,8 +41,9 @@ class SUIT_DataOwner; * Filter geom objects by number of subshapes of the given type * Parameters of constructor: * * theSubShapeType - Type of subshape - * * theNumber - Number of subshapes. Object is selected if it contains theNumber of - * theSubShapeType sub-shapes + * * theNumber - Number of subshapes. Object is selected if it contains + * theNumber of theSubShapeType sub-shapes, or at least + * one theSubShapeType, provided that theNumber==0 * * theShapeType - This map specifies types of object to be selected * * theMainObject - Sub-shapes of this object is selected only * * theIsClosedOnly - Closed shapes is selected if this parameter is true