]> SALOME platform Git repositories - modules/shaper.git/blob - src/FiltersPlugin/FiltersPlugin_RelativeToSolid.cpp
Salome HOME
86743520ce5722bd72a6e41593f20394a2709af9
[modules/shaper.git] / src / FiltersPlugin / FiltersPlugin_RelativeToSolid.cpp
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "FiltersPlugin_RelativeToSolid.h"
21
22 #include <ModelAPI_AttributeSelection.h>
23 #include <ModelAPI_AttributeString.h>
24
25
26 bool FiltersPlugin_RelativeToSolid::isSupported(GeomAPI_Shape::ShapeType theType) const
27 {
28   return true;
29 }
30
31 bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape,
32                                          const ModelAPI_FiltersArgs& theArgs) const
33 {
34   return false;
35 }
36
37 static std::string XMLRepresentation =
38 "<filter id = \"RelativeToSolid\">"
39 " <shape_selector id=\"RelativeToSolid__Solid\""
40 "   label=\"Solid:\""
41 "   tooltip=\"Select a solid.\""
42 "   shape_types=\"solids\">"
43 "   <validator id=\"GeomValidators_ShapeType\" parameters=\"solid\"/>"
44 " </shape_selector>"
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\"/>"
52 " </switch>"
53 "</filter>";
54
55
56 std::string FiltersPlugin_RelativeToSolid::xmlRepresentation() const
57 {
58   return XMLRepresentation;
59 }
60
61 void FiltersPlugin_RelativeToSolid::initAttributes(ModelAPI_FiltersArgs& theArguments)
62 {
63   theArguments.initAttribute("Solid", ModelAPI_AttributeSelection::typeId());
64   theArguments.initAttribute("Location", ModelAPI_AttributeString::typeId());
65 }