Salome HOME
updated copyright message
[modules/shaper.git] / src / FiltersPlugin / FiltersPlugin_RelativeToSolid.cpp
index 512f66563ec37c1960a8e3886ba8d60c6d2e9a12..a4b8b840159db9f59547b6c528ae7120ea223a94 100644 (file)
@@ -1,4 +1,4 @@
-// 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
 
 bool FiltersPlugin_RelativeToSolid::isSupported(GeomAPI_Shape::ShapeType theType) const
 {
-  return true;
+  return theType >= GeomAPI_Shape::SHELL;
 }
 
-bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape,
+bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape, const ResultPtr&,
                                          const ModelAPI_FiltersArgs& theArgs) const
 {
   AttributePtr anAttr = theArgs.argument("Solid");
@@ -72,28 +72,9 @@ bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape,
   return isOK;
 }
 
-static std::string XMLRepresentation =
-"<filter id = \"RelativeToSolid\">"
-" <shape_selector id=\"RelativeToSolid__Solid\""
-"   label=\"Solid:\""
-"   tooltip=\"Select a solid.\""
-"   shape_types=\"solids\">"
-"   <validator id=\"GeomValidators_ShapeType\" parameters=\"solid\"/>"
-" </shape_selector>"
-" <switch id=\"RelativeToSolid__Location\" label=\"Algorithm:\">"
-"   <case id=\"in\" title=\"In\"/>"
-"   <case id=\"out\" title=\"Out\"/>"
-"   <case id=\"on\" title=\"On\"/>"
-"   <case id=\"not_on\" title=\"Not On\"/>"
-"   <case id=\"not_out\" title=\"In and On\"/>"
-"   <case id=\"not_in\" title=\"On and Out\"/>"
-" </switch>"
-"</filter>";
-
-
 std::string FiltersPlugin_RelativeToSolid::xmlRepresentation() const
 {
-  return XMLRepresentation;
+  return xmlFromFile("filter-RelativeToSolid.xml");
 }
 
 void FiltersPlugin_RelativeToSolid::initAttributes(ModelAPI_FiltersArgs& theArguments)