Salome HOME
IPAL21346 After Quadrangle Algorithm failed, visualisation of mesh is bad. Regress...
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index 6d284548cff67e42b085b157a1a6342d5fcc18c1..b0211dc4a4150ef89e2e8f0c4aceed5a06ceae06 100644 (file)
@@ -23,7 +23,6 @@
 //  File   : SMESH_subMesh.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "SMESH_subMesh.hxx"
 
@@ -36,6 +35,7 @@
 #include "SMESH_subMeshEventListener.hxx"
 #include "SMESH_Comment.hxx"
 #include "SMDS_SetIterator.hxx"
+#include "SMDSAbs_ElementType.hxx"
 
 #include "utilities.h"
 #include "OpUtil.hxx"
@@ -947,6 +947,12 @@ SMESH_Hypothesis::Hypothesis_Status
       break;
     }
     case REMOVE_FATHER_ALGO: {
+      // IPAL21346. Edges not removed when Netgen 1d-2d is removed from a SOLID.
+      // CLEAN was not called at event REMOVE_ALGO because the algo is not applicable to SOLID.
+      algo = dynamic_cast<SMESH_Algo*> (anHyp);
+      if (!algo->NeedDescretBoundary())
+        needFullClean = true;
+
       algo = gen->GetAlgo((*_father), _subShape);
       if (algo == NULL)  // no more applying algo on father
       {
@@ -1578,6 +1584,48 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
   return ret;
 }
 
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap)
+{
+  _computeError.reset();
+
+  bool ret = true;
+
+  if (_subShape.ShapeType() == TopAbs_VERTEX) {
+    std::vector<int> aVec(SMDSEntity_Last);
+    for(int i= SMDSEntity_Node; i < SMDSEntity_Last; i++)
+      aVec[i] = 0;
+    aVec[SMDSEntity_Node] = 1;
+    aResMap.insert(std::make_pair(this,aVec));
+    return ret;
+  }
+
+  SMESH_Gen *gen = _father->GetGen();
+  SMESH_Algo *algo = 0;
+  SMESH_Hypothesis::Hypothesis_Status hyp_status;
+
+  algo = gen->GetAlgo((*_father), _subShape);
+  if(algo) {
+    ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
+    if (!ret) return false;
+
+    TopoDS_Shape shape = _subShape;
+
+    _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
+
+    ret = algo->Evaluate((*_father), shape, aResMap);
+  }
+
+  return ret;
+}
+
+
 //=======================================================================
 /*!
  * \brief Update compute_state by _computeError and send proper events to