1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_WidgetSketchLabel.h
4 // Created: 07 July 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef PartSet_WidgetSketchLabel_H
8 #define PartSet_WidgetSketchLabel_H
12 #include <ModuleBase_ModelWidget.h>
13 #include <ModuleBase_ViewerFilters.h>
15 #include <GeomAPI_Pnt.h>
16 #include <GeomAPI_Dir.h>
17 #include <GeomAPI_AISObject.h>
19 #include <StdSelect_FaceFilter.hxx>
20 #include <TopoDS_Shape.hxx>
24 class XGUI_OperationMgr;
27 class PARTSET_EXPORT PartSet_WidgetSketchLabel : public ModuleBase_ModelWidget
31 PartSet_WidgetSketchLabel(QWidget* theParent, const Config_WidgetAPI* theData,
32 const std::string& theParentId);
34 virtual ~PartSet_WidgetSketchLabel();
36 /// Saves the internal parameters to the given feature
37 /// \param theFeature a model feature to be changed
38 virtual bool storeValue() const
43 virtual bool restoreValue()
48 /// Returns list of widget controls
49 /// \return a control list
50 virtual QList<QWidget*> getControls() const;
52 QWidget* getControl() const;
54 /// The methiod called when widget is activated
55 virtual void activate();
57 /// The methiod called when widget is deactivated
58 virtual void deactivate();
60 XGUI_Workshop* workshop() const { return myWorkshop; }
62 void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
64 std::shared_ptr<GeomAPI_Pln> plane() const;
67 void planeSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
70 void onPlaneSelected();
71 void setSketchingMode();
74 AISObjectPtr createPreviewPlane(std::shared_ptr<GeomAPI_Pnt> theOrigin,
75 std::shared_ptr<GeomAPI_Dir> theNorm,
78 std::shared_ptr<GeomAPI_Dir> setSketchPlane(const TopoDS_Shape& theShape);
80 void erasePreviewPlanes();
81 void showPreviewPlanes();
88 XGUI_Workshop* myWorkshop;
90 AISObjectPtr myYZPlane;
91 AISObjectPtr myXZPlane;
92 AISObjectPtr myXYPlane;
93 bool myPreviewDisplayed;
95 Handle(StdSelect_FaceFilter) myFaceFilter;
97 QTimer* mySelectionTimer;