From: eap Date: Tue, 16 Sep 2008 14:37:45 +0000 (+0000) Subject: [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D... X-Git-Tag: V4_1_4a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6c591d8d6238d00a0686efec9107def467bd417a;p=modules%2Fsmesh.git [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D + static SMESH_HypoPredicate* IsMoreLocalThan(const TopoDS_Shape& theShape); --- diff --git a/src/SMESH/SMESH_HypoFilter.cxx b/src/SMESH/SMESH_HypoFilter.cxx index fe0bcd466..64720b1fa 100644 --- a/src/SMESH/SMESH_HypoFilter.cxx +++ b/src/SMESH/SMESH_HypoFilter.cxx @@ -118,6 +118,17 @@ bool SMESH_HypoFilter::IsAssignedToPredicate::IsOk(const SMESH_Hypothesis* aHyp, return ( !_mainShape.IsNull() && !aShape.IsNull() && _mainShape.IsSame( aShape )); } +//======================================================================= +//function : IsMoreLocalThanPredicate::IsOk +//purpose : +//======================================================================= + +bool SMESH_HypoFilter::IsMoreLocalThanPredicate::IsOk(const SMESH_Hypothesis* aHyp, + const TopoDS_Shape& aShape) const +{ + return ( aShape.ShapeType() > _shapeType ); +} + //======================================================================= //function : SMESH_HypoFilter //purpose : @@ -262,6 +273,16 @@ SMESH_HypoPredicate* SMESH_HypoFilter::IsApplicableTo(const TopoDS_Shape& theSha return new ApplicablePredicate( theShape ); } +//======================================================================= +//function : IsMoreLocalThan +//purpose : +//======================================================================= + +SMESH_HypoPredicate* SMESH_HypoFilter::IsMoreLocalThan(const TopoDS_Shape& theShape) +{ + return new IsMoreLocalThanPredicate( theShape ); +} + //======================================================================= //function : HasType //purpose : diff --git a/src/SMESH/SMESH_HypoFilter.hxx b/src/SMESH/SMESH_HypoFilter.hxx index 041166d41..d40bc1a75 100644 --- a/src/SMESH/SMESH_HypoFilter.hxx +++ b/src/SMESH/SMESH_HypoFilter.hxx @@ -74,6 +74,7 @@ class SMESH_EXPORT SMESH_HypoFilter: public SMESH_HypoPredicate static SMESH_HypoPredicate* IsAssignedTo(const TopoDS_Shape& theShape); static SMESH_HypoPredicate* Is(const SMESH_Hypothesis* theHypo); static SMESH_HypoPredicate* IsGlobal(const TopoDS_Shape& theMainShape); + static SMESH_HypoPredicate* IsMoreLocalThan(const TopoDS_Shape& theShape); static SMESH_HypoPredicate* HasName(const std::string & theName); static SMESH_HypoPredicate* HasDim(const int theDim); static SMESH_HypoPredicate* HasType(const int theHypType); @@ -167,6 +168,13 @@ class SMESH_EXPORT SMESH_HypoFilter: public SMESH_HypoPredicate const TopoDS_Shape& aShape) const; }; + struct IsMoreLocalThanPredicate : public SMESH_HypoPredicate { + TopAbs_ShapeEnum _shapeType; + IsMoreLocalThanPredicate( const TopoDS_Shape& shape ):_shapeType(shape.ShapeType()){} + bool IsOk(const SMESH_Hypothesis* aHyp, + const TopoDS_Shape& aShape) const; + }; + struct IsAuxiliaryPredicate : public SMESH_HypoPredicate { bool IsOk(const SMESH_Hypothesis* aHyp, const TopoDS_Shape& aShape) const;