Salome HOME
Issue #2608: Invalid shape when select compound as a tool object for cut
[modules/shaper.git] / src / GeomValidators / GeomValidators_Plugin.cpp
1 // Copyright (C) 2014-2017  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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #include <GeomValidators_Plugin.h>
22
23 #include <GeomValidators_BodyShapes.h>
24 #include <GeomValidators_ConstructionComposite.h>
25 #include <GeomValidators_Different.h>
26 #include <GeomValidators_DifferentShapes.h>
27 #include <GeomValidators_Face.h>
28 #include <GeomValidators_Finite.h>
29 #include <GeomValidators_PartitionArguments.h>
30 #include <GeomValidators_ShapeType.h>
31 #include <GeomValidators_ZeroOffset.h>
32 #include <GeomValidators_FeatureKind.h>
33 #include <GeomValidators_MinObjectsSelected.h>
34 #include <GeomValidators_Intersected.h>
35 #include <GeomValidators_NotSelfIntersected.h>
36
37 #include <ModelAPI_Session.h>
38 #include <ModelAPI_Validator.h>
39
40 // the only created instance of this plugin
41 static GeomValidators_Plugin* MY_GEOMVALIDATORS_INSTANCE = new GeomValidators_Plugin();
42
43 GeomValidators_Plugin::GeomValidators_Plugin()
44 {
45   // register validators
46   SessionPtr aMgr = ModelAPI_Session::get();
47   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
48
49   aFactory->registerValidator("GeomValidators_BodyShapes", new GeomValidators_BodyShapes);
50   aFactory->registerValidator("GeomValidators_ConstructionComposite",
51                               new GeomValidators_ConstructionComposite);
52   aFactory->registerValidator("GeomValidators_Different", new GeomValidators_Different);
53   aFactory->registerValidator("GeomValidators_DifferentShapes",
54                               new GeomValidators_DifferentShapes);
55   aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
56   aFactory->registerValidator("GeomValidators_Finite", new GeomValidators_Finite);
57   aFactory->registerValidator("GeomValidators_PartitionArguments",
58                               new GeomValidators_PartitionArguments);
59   aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
60   aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset);
61   aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind);
62   aFactory->registerValidator("GeomValidators_MinObjectsSelected",
63                               new GeomValidators_MinObjectsSelected);
64   aFactory->registerValidator("GeomValidators_Intersected", new GeomValidators_Intersected);
65   aFactory->registerValidator("GeomValidators_NotSelfIntersected",
66                               new GeomValidators_NotSelfIntersected);
67
68   // register this plugin
69   ModelAPI_Session::get()->registerPlugin(this);
70 }
71
72 FeaturePtr GeomValidators_Plugin::createFeature(std::string theFeatureID)
73 {
74   // feature of such kind is not found
75   return FeaturePtr();
76 }