Salome HOME
SketchShapePlugin: checked group box/multi editor controls, which highlight the paren...
[modules/shaper.git] / src / SketchShapePlugin / SketchShapePlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchShapePlugin_Plugin.cpp
4 // Created:     25 Nov 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #include <SketchShapePlugin_Plugin.h>
8 #include <SketchShapePlugin_Validators.h>
9 #include <SketchShapePlugin_Feature.h>
10 /*
11 #include <SketchShapePlugin_PageGroupBox.h>
12
13 #include <Events_Loop.h>
14 */
15 #include <ModelAPI_Session.h>
16 #include <ModelAPI_Document.h>
17 #include <ModelAPI_Validator.h>
18
19 #include <ModuleBase_WidgetCreatorFactory.h>
20 #include <SketchShapePlugin_WidgetCreator.h>
21 /*#include <ModelAPI_Data.h>
22
23 #include <ModuleBase_ModelWidget.h>
24 #include <qwidget.h>
25
26 #include <memory>*/
27
28 // the only created instance of this plugin
29 static SketchShapePlugin_Plugin* MY_SKETCH_SHAPE_INSTANCE = new SketchShapePlugin_Plugin();
30
31 SketchShapePlugin_Plugin::SketchShapePlugin_Plugin()
32 {
33   SessionPtr aMgr = ModelAPI_Session::get();
34   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
35   aFactory->registerValidator("SketchShapePlugin_FeatureValidator",
36                               new SketchShapePlugin_FeatureValidator);
37
38   WidgetCreatorFactoryPtr aWidgetCreatorFactory = ModuleBase_WidgetCreatorFactory::get();
39   aWidgetCreatorFactory->registerCreator(
40           std::shared_ptr<SketchShapePlugin_WidgetCreator>(new SketchShapePlugin_WidgetCreator()));
41
42   // register this plugin
43   ModelAPI_Session::get()->registerPlugin(this);
44 }
45
46 FeaturePtr SketchShapePlugin_Plugin::createFeature(std::string theFeatureID)
47 {
48   if (theFeatureID == SketchShapePlugin_Feature::ID()) {
49     return FeaturePtr(new SketchShapePlugin_Feature);
50   }
51   // feature of such kind is not found
52   return FeaturePtr();
53 }
54