Salome HOME
Correct processing of the fixed arc in PlaneGCS (issue #1280)
[modules/shaper.git] / src / SketchShapePlugin / SketchShapePlugin_WidgetCreator.cpp
index a5fa8cda417b75e219040daaf0343b7e311c4d72..ad994b49616fb4b55328fd041a3983d7a8588693 100755 (executable)
@@ -1,12 +1,19 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
 #include "SketchShapePlugin_WidgetCreator.h"
+
 #include "SketchShapePlugin_PageGroupBox.h"
 
+#include "SketchShapePlugin_WidgetMultiSelector.h"
+#include "SketchShapePlugin_WidgetCheckGroupBox.h"
+
 SketchShapePlugin_WidgetCreator::SketchShapePlugin_WidgetCreator()
 : ModuleBase_IWidgetCreator()
 {
   myPages.insert("sketchshape_groupbox");
+  myPages.insert("sketchshape_check_groupbox");
+
+  myWidgets.insert("sketchshape_multi_selector");
 }
 
 const std::set<std::string>& SketchShapePlugin_WidgetCreator::pageTypes()
@@ -16,11 +23,12 @@ const std::set<std::string>& SketchShapePlugin_WidgetCreator::pageTypes()
 
 const std::set<std::string>& SketchShapePlugin_WidgetCreator::widgetTypes()
 {
-  return myTypes;
+  return myWidgets;
 }
 
 ModuleBase_PageBase* SketchShapePlugin_WidgetCreator::createPageByType(
-                                   const std::string& theType, QWidget* theParent)
+                                   const std::string& theType, QWidget* theParent,
+                                   Config_WidgetAPI* theWidgetApi, std::string theParentId)
 {
   ModuleBase_PageBase* aPage = 0;
   if (myPages.find(theType) == myPages.end())
@@ -29,20 +37,26 @@ ModuleBase_PageBase* SketchShapePlugin_WidgetCreator::createPageByType(
   if (theType == "sketchshape_groupbox") {
     aPage = new SketchShapePlugin_PageGroupBox(theParent);
   }
+  else if (theType == "sketchshape_check_groupbox") {
+    aPage = new SketchShapePlugin_WidgetCheckGroupBox(theParent, theWidgetApi, theParentId);
+  }
 
   return aPage;
 }
 
 ModuleBase_ModelWidget* SketchShapePlugin_WidgetCreator::createWidgetByType(
-                                   const std::string& theType, QWidget* theParent)
+                                   const std::string& theType, QWidget* theParent,
+                                   Config_WidgetAPI* theWidgetApi, std::string theParentId,
+                                   ModuleBase_IWorkshop* theWorkshop)
 {
   ModuleBase_ModelWidget* aWidget = 0;
-  if (myTypes.find(theType) == myTypes.end())
+  if (myWidgets.find(theType) == myWidgets.end())
     return aWidget;
 
-  //if (theType == "sketchshape_groupbox") {
-  //  aWidget = new SketchShapePlugin_PageGroupBox(theParent);
-  //}
+  if (theType == "sketchshape_multi_selector") {
+    aWidget = new SketchShapePlugin_WidgetMultiSelector(theParent, theWorkshop, theWidgetApi,
+                                                        theParentId);
+  }
 
   return aWidget;
 }