1 // File: PartSet_WidgetSketchLabel.h
2 // Created: 07 July 2014
3 // Author: Vitaly SMETANNIKOV
5 #ifndef PartSet_WidgetSketchLabel_H
6 #define PartSet_WidgetSketchLabel_H
10 #include <ModuleBase_ModelWidget.h>
11 #include <ModuleBase_ViewerFilters.h>
13 #include <GeomAPI_Pnt.h>
14 #include <GeomAPI_Dir.h>
15 #include <GeomAPI_AISObject.h>
17 #include <StdSelect_FaceFilter.hxx>
18 #include <TopoDS_Shape.hxx>
21 class XGUI_OperationMgr;
23 //class PartSet_OperationSketch;
25 class PARTSET_EXPORT PartSet_WidgetSketchLabel : public ModuleBase_ModelWidget
29 PartSet_WidgetSketchLabel(QWidget* theParent, const Config_WidgetAPI* theData,
30 const std::string& theParentId);
32 virtual ~PartSet_WidgetSketchLabel();
34 /// Saves the internal parameters to the given feature
35 /// \param theFeature a model feature to be changed
36 virtual bool storeValue() const
41 virtual bool restoreValue()
46 /// Returns list of widget controls
47 /// \return a control list
48 virtual QList<QWidget*> getControls() const;
50 QWidget* getControl() const;
52 /// The methiod called when widget is activated
53 virtual void activate();
55 /// The methiod called when widget is deactivated
56 virtual void deactivate();
58 XGUI_Workshop* workshop() const { return myWorkshop; }
60 void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
62 std::shared_ptr<GeomAPI_Pln> plane() const;
65 void planeSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
68 void onPlaneSelected();
71 AISObjectPtr createPreviewPlane(std::shared_ptr<GeomAPI_Pnt> theOrigin,
72 std::shared_ptr<GeomAPI_Dir> theNorm,
75 std::shared_ptr<GeomAPI_Dir> setSketchPlane(const TopoDS_Shape& theShape);
77 void erasePreviewPlanes();
78 void showPreviewPlanes();
80 void setSketchingMode();
86 XGUI_Workshop* myWorkshop;
88 AISObjectPtr myYZPlane;
89 AISObjectPtr myXZPlane;
90 AISObjectPtr myXYPlane;
91 bool myPreviewDisplayed;
93 Handle(StdSelect_FaceFilter) myPlaneFilter;
94 //Handle(ModuleBase_ShapeInPlaneFilter) mySketchFilter;