Salome HOME
#2309 Possibility to hide faces
[modules/shaper.git] / src / ModuleBase / ModuleBase_ResultPrs.cpp
index 6dd875f779274996ee88f9b2b3a478d38e76de77..8d2aeb755980b982d440247f7b46082e4e69b6e6 100755 (executable)
@@ -139,6 +139,26 @@ bool ModuleBase_ResultPrs::setSubShapeHidden(const NCollection_List<TopoDS_Shape
   return isModified;
 }
 
+//********************************************************************
+bool ModuleBase_ResultPrs::isSubShapeHidden(const TopoDS_Shape& theShape)
+{
+  if (theShape.IsNull() || theShape.ShapeType() != TopAbs_FACE) // only face shape can be hidden
+    return false;
+
+  if (myHiddenSubShapes.Contains(theShape))
+    return true;
+
+  // orientation of parameter shape(come from selection) may be wrong, check isEqual() to be sure
+  for (NCollection_List<TopoDS_Shape>::Iterator aShapeIt(myHiddenSubShapes); aShapeIt.More();
+    aShapeIt.Next())
+  {
+    if (theShape.IsEqual(aShapeIt.Value()))
+      return true;
+  }
+
+  return true;
+}
+
 //********************************************************************
 bool ModuleBase_ResultPrs::hasSubShapeVisible(
   const NCollection_List<TopoDS_Shape>& theShapesToSkip)