Salome HOME
Merge remote-tracking branch 'remotes/origin/HigherLevelObjectsHistory'
[modules/shaper.git] / src / GeomValidators / GeomValidators_Plugin.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 <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_ShapeType.h>
29 #include <GeomValidators_ZeroOffset.h>
30 #include <GeomValidators_FeatureKind.h>
31 #include <GeomValidators_MinObjectsSelected.h>
32 #include <GeomValidators_Intersected.h>
33 #include <GeomValidators_NotSelfIntersected.h>
34
35 #include <ModelAPI_Session.h>
36 #include <ModelAPI_Validator.h>
37
38 // the only created instance of this plugin
39 static GeomValidators_Plugin* MY_GEOMVALIDATORS_INSTANCE = new GeomValidators_Plugin();
40
41 GeomValidators_Plugin::GeomValidators_Plugin()
42 {
43   // register validators
44   SessionPtr aMgr = ModelAPI_Session::get();
45   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
46
47   aFactory->registerValidator("GeomValidators_BodyShapes", new GeomValidators_BodyShapes);
48   aFactory->registerValidator("GeomValidators_ConstructionComposite",
49                               new GeomValidators_ConstructionComposite);
50   aFactory->registerValidator("GeomValidators_Different", new GeomValidators_Different);
51   aFactory->registerValidator("GeomValidators_DifferentShapes",
52                               new GeomValidators_DifferentShapes);
53   aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
54   aFactory->registerValidator("GeomValidators_Finite", new GeomValidators_Finite);
55   aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
56   aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset);
57   aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind);
58   aFactory->registerValidator("GeomValidators_MinObjectsSelected",
59                               new GeomValidators_MinObjectsSelected);
60   aFactory->registerValidator("GeomValidators_Intersected", new GeomValidators_Intersected);
61   aFactory->registerValidator("GeomValidators_NotSelfIntersected",
62                               new GeomValidators_NotSelfIntersected);
63
64   // register this plugin
65   ModelAPI_Session::get()->registerPlugin(this);
66 }
67
68 FeaturePtr GeomValidators_Plugin::createFeature(std::string theFeatureID)
69 {
70   // feature of such kind is not found
71   return FeaturePtr();
72 }