From: eap Date: Tue, 28 May 2013 16:41:00 +0000 (+0000) Subject: 0022108: EDF 2547 SMESH: Duplicate elements only X-Git-Tag: V7_3_0a1~394 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c25ddc7d49ed09f1b5719ce68292ee3694876462;p=modules%2Fsmesh.git 0022108: EDF 2547 SMESH: Duplicate elements only More filters + struct Filter + { + virtual bool operator()(const SMDS_MeshElement* e) const = 0; + ~Filter() {} + }; + struct NonNullFilter: public Filter --- diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index a8a3ad422..78238dcea 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -151,19 +151,28 @@ public: /*! * \brief Filters of elements, to be used with SMDS_SetIterator */ - struct TypeFilter + struct Filter + { + virtual bool operator()(const SMDS_MeshElement* e) const = 0; + ~Filter() {} + }; + struct NonNullFilter: public Filter + { + bool operator()(const SMDS_MeshElement* e) const { return e; } + }; + struct TypeFilter : public Filter { SMDSAbs_ElementType _type; TypeFilter( SMDSAbs_ElementType t = SMDSAbs_NbElementTypes ):_type(t) {} bool operator()(const SMDS_MeshElement* e) const { return e && e->GetType() == _type; } }; - struct EntityFilter + struct EntityFilter : public Filter { SMDSAbs_EntityType _type; EntityFilter( SMDSAbs_EntityType t = SMDSEntity_Last ):_type(t) {} bool operator()(const SMDS_MeshElement* e) const { return e && e->GetEntityType() == _type; } }; - struct GeomFilter + struct GeomFilter : public Filter { SMDSAbs_GeometryType _type; GeomFilter( SMDSAbs_GeometryType t = SMDSGeom_NONE ):_type(t) {}