Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomValidators / GeomValidators_Plugin.cpp
1 // Copyright (C) 2014-2023  CEA, EDF
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 <GeomValidators_Plugin.h>
21
22 #include <GeomValidators_BodyShapes.h>
23 #include <GeomValidators_ConstructionComposite.h>
24 #include <GeomValidators_Different.h>
25 #include <GeomValidators_DifferentShapes.h>
26 #include <GeomValidators_Face.h>
27 #include <GeomValidators_Finite.h>
28 #include <GeomValidators_GlobalSelection.h>
29 #include <GeomValidators_ShapeType.h>
30 #include <GeomValidators_ZeroOffset.h>
31 #include <GeomValidators_FeatureKind.h>
32 #include <GeomValidators_MinObjectsSelected.h>
33 #include <GeomValidators_Intersected.h>
34 #include <GeomValidators_NotSelfIntersected.h>
35
36 #include <ModelAPI_Session.h>
37 #include <ModelAPI_Validator.h>
38
39 // the only created instance of this plugin
40 static GeomValidators_Plugin* MY_GEOMVALIDATORS_INSTANCE = new GeomValidators_Plugin();
41
42 GeomValidators_Plugin::GeomValidators_Plugin()
43 {
44   // register validators
45   SessionPtr aMgr = ModelAPI_Session::get();
46   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
47
48   aFactory->registerValidator("GeomValidators_BodyShapes", new GeomValidators_BodyShapes);
49   aFactory->registerValidator("GeomValidators_ConstructionComposite",
50                               new GeomValidators_ConstructionComposite);
51   aFactory->registerValidator("GeomValidators_Different", new GeomValidators_Different);
52   aFactory->registerValidator("GeomValidators_DifferentShapes",
53                               new GeomValidators_DifferentShapes);
54   aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
55   aFactory->registerValidator("GeomValidators_Finite", new GeomValidators_Finite);
56   aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
57   aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset);
58   aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind);
59   aFactory->registerValidator("GeomValidators_MinObjectsSelected",
60                               new GeomValidators_MinObjectsSelected);
61   aFactory->registerValidator("GeomValidators_Intersected", new GeomValidators_Intersected);
62   aFactory->registerValidator("GeomValidators_NotSelfIntersected",
63                               new GeomValidators_NotSelfIntersected);
64   aFactory->registerValidator("GeomValidators_GlobalSelection", new GeomValidators_GlobalSelection);
65
66   // Do not register this plugin because it doesn't create features
67   //ModelAPI_Session::get()->registerPlugin(this);
68 }
69
70 FeaturePtr GeomValidators_Plugin::createFeature(std::string theFeatureID)
71 {
72   // feature of such kind is not found
73   return FeaturePtr();
74 }