Salome HOME
#16843 EDF 19340 - wrong quadratic mesh
[modules/smesh.git] / src / SMESH / SMESH_Algo.cxx
index 6585e104ca810c4663796043a9eb731582615d66..12371ea6488133d8b66f26169916684ad54a74c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  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
@@ -1268,3 +1268,33 @@ bool SMESH_2D_Algo::FixInternalNodes(const SMESH_ProxyMesh& mesh,
   }
   return true;
 }
+
+//=======================================================================
+//function : IsApplicableToShape
+//purpose  : Return true if the algorithm can mesh a given shape
+//=======================================================================
+
+bool SMESH_1D_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+{
+  return ( !shape.IsNull() && TopExp_Explorer( shape, TopAbs_EDGE ).More() );
+}
+
+//=======================================================================
+//function : IsApplicableToShape
+//purpose  : Return true if the algorithm can mesh a given shape
+//=======================================================================
+
+bool SMESH_2D_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+{
+  return ( !shape.IsNull() && TopExp_Explorer( shape, TopAbs_FACE ).More() );
+}
+
+//=======================================================================
+//function : IsApplicableToShape
+//purpose  : Return true if the algorithm can mesh a given shape
+//=======================================================================
+
+bool SMESH_3D_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+{
+  return ( !shape.IsNull() && TopExp_Explorer( shape, TopAbs_SOLID ).More() );
+}