X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFiltersPlugin%2FFiltersPlugin_OnGeometry.cpp;h=d234e4f8ec2114c07732fe99d00d3fb5ee47f1bb;hb=04e2497fc973f0afc95d0a4a6f95e37fb27f45e8;hp=e62dba49c31cf3f72e5fa7e4515ed94a4d324b0a;hpb=ed92e0bb25bbe82b732828655a66be5d7ec80b1b;p=modules%2Fshaper.git diff --git a/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp b/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp index e62dba49c..d234e4f8e 100644 --- a/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp +++ b/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp @@ -1,4 +1,4 @@ -// 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 @@ -26,8 +26,8 @@ bool FiltersPlugin_OnGeometry::isSupported(GeomAPI_Shape::ShapeType theType) con return theType == GeomAPI_Shape::EDGE || theType == GeomAPI_Shape::FACE; } -bool FiltersPlugin_OnGeometry::isOk(const GeomShapePtr& theShape, - const ModelAPI_FiltersArgs& theArgs) const +bool FiltersPlugin_OnGeometry::isOk(const GeomShapePtr& theShape, const ResultPtr&, + const ModelAPI_FiltersArgs& theArgs) const { AttributePtr aAttr = theArgs.argument("OnGeometry"); AttributeSelectionListPtr aList = @@ -35,28 +35,19 @@ bool FiltersPlugin_OnGeometry::isOk(const GeomShapePtr& theShape, if (!aList.get()) return false; for (int i = 0; i < aList->size(); i++) { - AttributeSelectionPtr aAttr = aList->value(i); - GeomShapePtr aGeom = aAttr->value(); - if (aGeom->isSameGeometry(theShape)) + AttributeSelectionPtr aCurAttr = aList->value(i); + GeomShapePtr aGeom = aCurAttr->value(); + if (!aGeom) + aGeom = aCurAttr->context()->shape(); + if (aGeom && aGeom->isSameGeometry(theShape)) return true; } return false; } -static std::string XMLRepresentation = -"" -" " -" " -" " -""; - - std::string FiltersPlugin_OnGeometry::xmlRepresentation() const { - return XMLRepresentation; + return xmlFromFile("filter-OnGeometry.xml"); } void FiltersPlugin_OnGeometry::initAttributes(ModelAPI_FiltersArgs& theArguments)