1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_WidgetShapeSelector.h
4 // Created: 27 Nov 2014
5 // Author: Vitaly Smetannikov
8 #ifndef PartSet_WidgetShapeSelector_H
9 #define PartSet_WidgetShapeSelector_H
13 #include <ModuleBase_WidgetShapeSelector.h>
15 #include <ModelAPI_CompositeFeature.h>
20 * Customosation of ModuleBase_WidgetShapeSelector in order to provide
21 * working with sketch specific objects.
23 class PARTSET_EXPORT PartSet_WidgetShapeSelector: public ModuleBase_WidgetShapeSelector
28 /// \param theParent the parent object
29 /// \param theWorkshop instance of workshop interface
30 /// \param theData the widget configuation. The attribute of the model widget is obtained from
31 /// \param theParentId is Id of a parent of the current attribute
32 PartSet_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
33 const Config_WidgetAPI* theData, const std::string& theParentId)
34 : ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) {}
36 virtual ~PartSet_WidgetShapeSelector() {}
38 virtual bool storeValue() const;
41 /// \param theSketch a sketcher object
42 void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
44 /// Retrurns installed sketcher
45 CompositeFeaturePtr sketch() const { return mySketch; }
48 /// Check the selected with validators if installed
49 virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
52 /// Pointer to a sketch
53 CompositeFeaturePtr mySketch;
58 * Customosation of ModuleBase_WidgetShapeSelector in order to provide
59 * working with constraints.
61 class PARTSET_EXPORT PartSet_WidgetConstraintShapeSelector: public ModuleBase_WidgetShapeSelector
66 /// \param theParent the parent object
67 /// \param theWorkshop instance of workshop interface
68 /// \param theData the widget configuation. The attribute of the model widget is obtained from
69 /// \param theParentId is Id of a parent of the current attribute
70 PartSet_WidgetConstraintShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
71 const Config_WidgetAPI* theData, const std::string& theParentId)
72 : ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) {}
74 virtual ~PartSet_WidgetConstraintShapeSelector() {}
76 /// Saves the internal parameters to the given feature
77 virtual bool storeValue() const;
80 /// \param theSketch a sketcher object
81 void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
83 /// Retrurns installed sketcher
84 CompositeFeaturePtr sketch() const { return mySketch; }
87 /// Pointer to a sketch
88 CompositeFeaturePtr mySketch;