1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include "SketchShapePlugin_WidgetCreator.h"
5 #include "SketchShapePlugin_PageGroupBox.h"
7 #include "SketchShapePlugin_WidgetMultiSelector.h"
8 #include "SketchShapePlugin_WidgetCheckGroupBox.h"
10 SketchShapePlugin_WidgetCreator::SketchShapePlugin_WidgetCreator()
11 : ModuleBase_IWidgetCreator()
13 myPages.insert("sketchshape_groupbox");
14 myPages.insert("sketchshape_check_groupbox");
16 myWidgets.insert("sketchshape_multi_selector");
19 const std::set<std::string>& SketchShapePlugin_WidgetCreator::pageTypes()
24 const std::set<std::string>& SketchShapePlugin_WidgetCreator::widgetTypes()
29 ModuleBase_PageBase* SketchShapePlugin_WidgetCreator::createPageByType(
30 const std::string& theType, QWidget* theParent,
31 Config_WidgetAPI* theWidgetApi, std::string theParentId)
33 ModuleBase_PageBase* aPage = 0;
34 if (myPages.find(theType) == myPages.end())
37 if (theType == "sketchshape_groupbox") {
38 aPage = new SketchShapePlugin_PageGroupBox(theParent);
40 else if (theType == "sketchshape_check_groupbox") {
41 aPage = new SketchShapePlugin_WidgetCheckGroupBox(theParent, theWidgetApi, theParentId);
47 ModuleBase_ModelWidget* SketchShapePlugin_WidgetCreator::createWidgetByType(
48 const std::string& theType, QWidget* theParent,
49 Config_WidgetAPI* theWidgetApi, std::string theParentId,
50 ModuleBase_IWorkshop* theWorkshop)
52 ModuleBase_ModelWidget* aWidget = 0;
53 if (myWidgets.find(theType) == myWidgets.end())
56 if (theType == "sketchshape_multi_selector") {
57 aWidget = new SketchShapePlugin_WidgetMultiSelector(theParent, theWorkshop, theWidgetApi,