1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "FiltersPlugin_RelativeToSolid.h"
22 #include <ModelAPI_AttributeSelection.h>
23 #include <ModelAPI_AttributeString.h>
26 bool FiltersPlugin_RelativeToSolid::isSupported(GeomAPI_Shape::ShapeType theType) const
31 bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape,
32 const ModelAPI_FiltersArgs& theArgs) const
37 static std::string XMLRepresentation =
38 "<filter id = \"RelativeToSolid\">"
39 " <shape_selector id=\"RelativeToSolid__Solid\""
41 " tooltip=\"Select a solid.\""
42 " shape_types=\"solids\">"
43 " <validator id=\"GeomValidators_ShapeType\" parameters=\"solid\"/>"
45 " <switch id=\"RelativeToSolid__Location\" label=\"Algorithm:\">"
46 " <case id=\"in\" title=\"In\"/>"
47 " <case id=\"out\" title=\"Out\"/>"
48 " <case id=\"on\" title=\"On\"/>"
49 " <case id=\"noton\" title=\"Not On\"/>"
50 " <case id=\"inon\" title=\"In and On\"/>"
51 " <case id=\"outon\" title=\"On and Out\"/>"
56 std::string FiltersPlugin_RelativeToSolid::xmlRepresentation() const
58 return XMLRepresentation;
61 void FiltersPlugin_RelativeToSolid::initAttributes(ModelAPI_FiltersArgs& theArguments)
63 theArguments.initAttribute("Solid", ModelAPI_AttributeSelection::typeId());
64 theArguments.initAttribute("Location", ModelAPI_AttributeString::typeId());