]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Union of validator and filter functionalities.
authornds <natalia.donis@opencascade.com>
Wed, 25 Mar 2015 14:54:10 +0000 (17:54 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 25 Mar 2015 14:54:10 +0000 (17:54 +0300)
Checking for edge is degenerated is performed inside attribute selection. Filters are not used anymore, but validators could not check the degenerated shape state because the attribute selection returns a compound shape for a degenerative edge set.

src/Model/Model_AttributeSelectionList.cpp

index 000ba2b0d5565b4a9e11c06097c124e26a7f6529..24a9efca5308d5684d3030a0b55c6ac5d4fd8f54 100644 (file)
 #include <TDF_ChildIterator.hxx>
 #include <TopAbs_ShapeEnum.hxx>
 
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Edge.hxx>
+#include <BRep_Tool.hxx>
+
 using namespace std;
 
 void Model_AttributeSelectionList::append(
     const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape)
 {
+  // do not use the degenerated edge as a shape, a list is not incremented in this case
+  if (theSubShape.get() && !theSubShape->isNull() && theSubShape->isEdge()) {
+    const TopoDS_Shape& aSubShape = theSubShape->impl<TopoDS_Shape>();
+    if (aSubShape.ShapeType() == TopAbs_EDGE && BRep_Tool::Degenerated(TopoDS::Edge(aSubShape))) {
+      return;
+    }
+  }
+
   int aNewTag = mySize->Get() + 1;
   TDF_Label aNewLab = mySize->Label().FindChild(aNewTag);