-// 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
#include <GeomAPI_XYZ.h>
-bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType theType) const
+bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType /*theType*/) const
{
return true;
}
if (!aList.get())
return false;
GeomShapePtr aPlanarShape = aList->value();
- if (!aPlanarShape)
- aPlanarShape = aList->context()->shape();
+ if (!aPlanarShape) {
+ ResultPtr aContext = aList->context();
+ if (!aContext)
+ return false;
+ aPlanarShape = aContext->shape();
+ }
GeomPlanePtr aPlane = aPlanarShape->face()->getPlane();
GeomPointPtr aPlaneLoc = aPlane->location();
return aVec->dot(aPlaneNorm->xyz()) > THE_TOLERANCE;
}
-static std::string XMLRepresentation =
-"<filter id = \"OnPlaneSide\">"
-" <shape_selector id=\"OnPlaneSide__OnPlaneSide\""
-" label=\"Plane:\""
-" tooltip=\"Select plane or planar face.\""
-" shape_types=\"faces\">"
-" <validator id=\"GeomValidators_ShapeType\" parameters=\"plane\"/>"
-" </shape_selector>"
-"</filter>";
-
-
std::string FiltersPlugin_OnPlaneSide::xmlRepresentation() const
{
- return XMLRepresentation;
+ return xmlFromFile("filter-OnPlaneSide.xml");
}
void FiltersPlugin_OnPlaneSide::initAttributes(ModelAPI_FiltersArgs& theArguments)