-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
bool FiltersPlugin_ExternalFaces::isOk(const GeomShapePtr& theShape,
const ResultPtr& theResult,
- const ModelAPI_FiltersArgs& theArgs) const
+ const ModelAPI_FiltersArgs& /*theArgs*/) const
{
if (!theShape->isFace())
return false;
+ // verify INTERNAL flag
+ TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
+ if (aShape.Orientation() == TopAbs_INTERNAL)
+ return false;
+
+ // check number of solids containing the face
ResultBodyPtr anOwner = ModelAPI_Tools::bodyOwner(theResult, true);
if (!anOwner) {
anOwner = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
TopTools_IndexedDataMapOfShapeListOfShape aMapFS;
TopExp::MapShapesAndUniqueAncestors(anOwnerShape->impl<TopoDS_Shape>(),
TopAbs_FACE, TopAbs_SOLID, aMapFS);
- const TopTools_ListOfShape& aSolids = aMapFS.FindFromKey(theShape->impl<TopoDS_Shape>());
+ const TopTools_ListOfShape& aSolids = aMapFS.FindFromKey(aShape);
return aSolids.Extent() <= 1;
}