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 onPlaneSelected();
68 AISObjectPtr createPreviewPlane(std::shared_ptr<GeomAPI_Pnt> theOrigin,
69 std::shared_ptr<GeomAPI_Dir> theNorm,
72 std::shared_ptr<GeomAPI_Dir> setSketchPlane(const TopoDS_Shape& theShape);
74 void erasePreviewPlanes();
75 void showPreviewPlanes();
77 void setSketchingMode();
83 XGUI_Workshop* myWorkshop;
85 AISObjectPtr myYZPlane;
86 AISObjectPtr myXZPlane;
87 AISObjectPtr myXYPlane;
88 bool myPreviewDisplayed;
90 Handle(StdSelect_FaceFilter) myPlaneFilter;
91 //Handle(ModuleBase_ShapeInPlaneFilter) mySketchFilter;