]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_WidgetShapeSelector.h
Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[modules/shaper.git] / src / PartSet / PartSet_WidgetShapeSelector.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetShapeSelector.h
4 // Created:     27 Nov 2014
5 // Author:      Vitaly Smetannikov
6
7
8 #ifndef PartSet_WidgetShapeSelector_H
9 #define PartSet_WidgetShapeSelector_H
10
11 #include "PartSet.h"
12
13 #include <ModuleBase_WidgetShapeSelector.h>
14
15 #include <ModelAPI_CompositeFeature.h>
16
17 class PARTSET_EXPORT PartSet_WidgetShapeSelector: public ModuleBase_WidgetShapeSelector
18 {
19 Q_OBJECT
20  public:
21   PartSet_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
22     const Config_WidgetAPI* theData, const std::string& theParentId)
23     : ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) {}
24
25   virtual ~PartSet_WidgetShapeSelector() {}
26
27   /// Saves the internal parameters to the given feature
28   virtual bool storeValue() const;
29
30   void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
31   CompositeFeaturePtr sketch() const { return mySketch; }
32
33 protected:
34   /// Check the selected with validators if installed
35   virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
36
37 private:
38   CompositeFeaturePtr mySketch;
39 };
40
41
42 class PARTSET_EXPORT PartSet_WidgetConstraintShapeSelector: public ModuleBase_WidgetShapeSelector
43 {
44 Q_OBJECT
45  public:
46   PartSet_WidgetConstraintShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
47     const Config_WidgetAPI* theData, const std::string& theParentId)
48     : ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) {}
49
50   virtual ~PartSet_WidgetConstraintShapeSelector() {}
51
52   /// Saves the internal parameters to the given feature
53   virtual bool storeValue() const;
54
55   void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
56   CompositeFeaturePtr sketch() const { return mySketch; }
57
58 private:
59   CompositeFeaturePtr mySketch;
60 };
61
62 #endif