-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
std::list<GeomLinePtr>& theLines)
{
for (int i = 0; i < theSelected->size(); i++) {
- GeomShapePtr aCurShape = theSelected->value(i)->value();
+ AttributeSelectionPtr aSel = theSelected->value(i);
+ GeomShapePtr aCurShape = aSel->value();
+ if (!aCurShape)
+ aCurShape = aSel->context()->shape();
if (aCurShape && aCurShape->isEdge()) {
GeomLinePtr aLine = aCurShape->edge()->line();
if (aLine)
return theType == GeomAPI_Shape::EDGE || theType == GeomAPI_Shape::VERTEX;
}
-bool FiltersPlugin_OnLine::isOk(const GeomShapePtr& theShape,
+bool FiltersPlugin_OnLine::isOk(const GeomShapePtr& theShape, const ResultPtr&,
const ModelAPI_FiltersArgs& theArgs) const
{
AttributePtr aAttr = theArgs.argument("OnLine");
return false;
}
-static std::string XMLRepresentation =
-"<filter id = \"OnLine\">"
-" <multi_selector id=\"OnLine__OnLine\""
-" label=\"Lines:\""
-" tooltip=\"Select vertices or segments.\""
-" type_choice=\"edges\">"
-" <validator id=\"GeomValidators_ShapeType\" parameters=\"line\"/>"
-" </multi_selector>"
-"</filter>";
-
-
std::string FiltersPlugin_OnLine::xmlRepresentation() const
{
- return XMLRepresentation;
+ return xmlFromFile("filter-OnLine.xml");
}
void FiltersPlugin_OnLine::initAttributes(ModelAPI_FiltersArgs& theArguments)