]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchShapePlugin/SketchShapePlugin_Plugin.cpp
Salome HOME
Construction of vertices/edges/faces on the base of sketch: sketch attribute
[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
55 /*ModuleBase_ModelWidget* SketchShapePlugin_Plugin::createWidgetByType(const std::string& theType,
56                                                                      QWidget* theParent)
57 {
58   ModuleBase_ModelWidget* aWidget = 0;
59   if (theType == "sketchshape_groupbox")
60     aWidget = new SketchShapePlugin_PageGroupBox(theParent);
61   return aWidget;
62 }*/
63