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)
/// \returns true if the presentation is changed, or false (if for example it was hidden)
Standard_EXPORT bool setSubShapeHidden(const NCollection_List<TopoDS_Shape>& theShapes);
+ /// Returns true if parameter shape has been hidden
+ /// \param theShape sub-shape of the presentation shape
+ /// \return boolean value
+ Standard_EXPORT bool isSubShapeHidden(const TopoDS_Shape& theShape);
+
/// Returns true if there are no hidden sub shapes or original shape has at least one not hidden
/// \param theShapesToSkip container of shape to be hidden in the presentation (faces)
/// \return boolean value
#include <ModuleBase_WidgetMultiSelector.h>
+#include <GeomAPI_AISObject.h>
+
#include <ModuleBase_ActionIntParameter.h>
#include <ModuleBase_Definitions.h>
#include <ModuleBase_Events.h>
#include <ModuleBase_IViewer.h>
#include <ModuleBase_IWorkshop.h>
#include <ModuleBase_ListView.h>
+#include <ModuleBase_ResultPrs.h>
#include <ModuleBase_Tools.h>
#include <ModuleBase_ViewerPrs.h>
#include <ModuleBase_WidgetShapeSelector.h>
#include <Config_WidgetAPI.h>
+#include <AIS_InteractiveObject.hxx>
+
#include <QGridLayout>
#include <QLabel>
#include <QListWidget>
return true;
bool aFound = false;
- GeomShapePtr anEmptyShape(new GeomAPI_Shape());
if (theShape.get()) { // treat shape equal to context as null: 2219, keep order of shapes in list
const ResultPtr aContext = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
if (aContext.get() && aContext->shape()->isEqual(theShape))
theShape.reset();
}
+
+ GeomShapePtr anEmptyShape(new GeomAPI_Shape());
GeomShapePtr aShape = theShape.get() ? theShape : anEmptyShape;
if (theGeomSelection.find(theObject) != theGeomSelection.end()) {// found
const std::set<GeomShapePtr>& aShapes = theGeomSelection.at(theObject);
aFound = aCShape->isSame(aShape);
}
}
+
+ // issue #2903: (Possibility to hide faces) - check whether given shape is a hidden sub-shape
+ if (!aFound && theWorkshop->hasSHIFTPressed() && theObject->isDisplayed()) {
+ AISObjectPtr anAIS = theWorkshop->findPresentation(theObject);
+ if (anAIS.get() != NULL) {
+ Handle(AIS_InteractiveObject) anAISIO = anAIS->impl<Handle(AIS_InteractiveObject)>();
+
+ Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(anAISIO);
+ if (!aResultPrs.IsNull() && aResultPrs->isSubShapeHidden(theShape->impl<TopoDS_Shape>()))
+ return true;
+ }
+ }
+
return aFound;
}