1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchShapePlugin_Plugin.cpp
4 // Created: 25 Nov 2015
5 // Author: Natalia ERMOLAEVA
7 #include <SketchShapePlugin_Plugin.h>
8 #include <SketchShapePlugin_Validators.h>
9 #include <SketchShapePlugin_Feature.h>
11 #include <SketchShapePlugin_PageGroupBox.h>
13 #include <Events_Loop.h>
15 #include <ModelAPI_Session.h>
16 #include <ModelAPI_Document.h>
17 #include <ModelAPI_Validator.h>
19 #include <ModuleBase_WidgetCreatorFactory.h>
20 #include <SketchShapePlugin_WidgetCreator.h>
21 /*#include <ModelAPI_Data.h>
23 #include <ModuleBase_ModelWidget.h>
28 // the only created instance of this plugin
29 static SketchShapePlugin_Plugin* MY_SKETCH_SHAPE_INSTANCE = new SketchShapePlugin_Plugin();
31 SketchShapePlugin_Plugin::SketchShapePlugin_Plugin()
33 SessionPtr aMgr = ModelAPI_Session::get();
34 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
35 aFactory->registerValidator("SketchShapePlugin_FeatureValidator",
36 new SketchShapePlugin_FeatureValidator);
38 WidgetCreatorFactoryPtr aWidgetCreatorFactory = ModuleBase_WidgetCreatorFactory::get();
39 aWidgetCreatorFactory->registerCreator(
40 std::shared_ptr<SketchShapePlugin_WidgetCreator>(new SketchShapePlugin_WidgetCreator()));
42 // register this plugin
43 ModelAPI_Session::get()->registerPlugin(this);
46 FeaturePtr SketchShapePlugin_Plugin::createFeature(std::string theFeatureID)
48 if (theFeatureID == SketchShapePlugin_Feature::ID()) {
49 return FeaturePtr(new SketchShapePlugin_Feature);
51 // feature of such kind is not found
55 /*ModuleBase_ModelWidget* SketchShapePlugin_Plugin::createWidgetByType(const std::string& theType,
58 ModuleBase_ModelWidget* aWidget = 0;
59 if (theType == "sketchshape_groupbox")
60 aWidget = new SketchShapePlugin_PageGroupBox(theParent);