]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchShapePlugin/SketchShapePlugin_WidgetCreator.cpp
Salome HOME
Construction of vertices/edges/faces on the base of sketch: sketch attribute
[modules/shaper.git] / src / SketchShapePlugin / SketchShapePlugin_WidgetCreator.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include "SketchShapePlugin_WidgetCreator.h"
4 #include "SketchShapePlugin_PageGroupBox.h"
5
6 SketchShapePlugin_WidgetCreator::SketchShapePlugin_WidgetCreator()
7 : ModuleBase_IWidgetCreator()
8 {
9   myPages.insert("sketchshape_groupbox");
10 }
11
12 const std::set<std::string>& SketchShapePlugin_WidgetCreator::pageTypes()
13 {
14   return myPages;
15 }
16
17 const std::set<std::string>& SketchShapePlugin_WidgetCreator::widgetTypes()
18 {
19   return myTypes;
20 }
21
22 ModuleBase_PageBase* SketchShapePlugin_WidgetCreator::createPageByType(
23                                    const std::string& theType, QWidget* theParent)
24 {
25   ModuleBase_PageBase* aPage = 0;
26   if (myPages.find(theType) == myPages.end())
27     return aPage;
28
29   if (theType == "sketchshape_groupbox") {
30     aPage = new SketchShapePlugin_PageGroupBox(theParent);
31   }
32
33   return aPage;
34 }
35
36 ModuleBase_ModelWidget* SketchShapePlugin_WidgetCreator::createWidgetByType(
37                                    const std::string& theType, QWidget* theParent)
38 {
39   ModuleBase_ModelWidget* aWidget = 0;
40   if (myTypes.find(theType) == myTypes.end())
41     return aWidget;
42
43   //if (theType == "sketchshape_groupbox") {
44   //  aWidget = new SketchShapePlugin_PageGroupBox(theParent);
45   //}
46
47   return aWidget;
48 }