-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <list>
#include <string>
#include <TopoDS_Shape.hxx>
+#include <TopTools_MapOfShape.hxx>
class SMESH_HypoFilter;
class SMESH_Hypothesis;
+class SMESH_Mesh;
class SMESH_EXPORT SMESH_HypoPredicate {
public:
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* IsMoreLocalThan(const TopoDS_Shape& theShape,
+ const SMESH_Mesh& theMesh);
static SMESH_HypoPredicate* HasName(const std::string & theName);
static SMESH_HypoPredicate* HasDim(const int theDim);
static SMESH_HypoPredicate* HasType(const int theHypType);
};
struct IsMoreLocalThanPredicate : public SMESH_HypoPredicate {
- TopoDS_Shape _shape;
- IsMoreLocalThanPredicate( const TopoDS_Shape& shape ):_shape(shape){}
+ TopoDS_Shape _shape;
+ const SMESH_Mesh& _mesh;
+ TopTools_MapOfShape _preferableShapes;
+ IsMoreLocalThanPredicate( const TopoDS_Shape& shape,
+ const SMESH_Mesh& mesh )
+ :_shape(shape),_mesh(mesh) { findPreferable(); }
bool IsOk(const SMESH_Hypothesis* aHyp,
const TopoDS_Shape& aShape) const;
+ void findPreferable();
};
struct IsAuxiliaryPredicate : public SMESH_HypoPredicate {