Salome HOME
Merge branch 'Dev_0.6' of newgeom:newgeom into Dev_0.6
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchLabel.h
index 5ad06d65d615ccac1f197b7cba1ded407f22b026..7c1d460be11dc0e221cd15eca254353d83b6d3b0 100644 (file)
@@ -8,10 +8,19 @@
 #include "PartSet.h"
 
 #include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_ViewerFilters.h>
+
+#include <GeomAPI_Pnt.h>
+#include <GeomAPI_Dir.h>
+#include <GeomAPI_AISObject.h>
+
+#include <StdSelect_FaceFilter.hxx>
+#include <TopoDS_Shape.hxx>
 
 class QLabel;
 class XGUI_OperationMgr;
-class PartSet_OperationSketch;
+class XGUI_Workshop;
+//class PartSet_OperationSketch;
 
 class PARTSET_EXPORT PartSet_WidgetSketchLabel : public ModuleBase_ModelWidget
 {
@@ -20,9 +29,7 @@ Q_OBJECT
   PartSet_WidgetSketchLabel(QWidget* theParent, const Config_WidgetAPI* theData,
                             const std::string& theParentId);
 
-  virtual ~PartSet_WidgetSketchLabel()
-  {
-  }
+  virtual ~PartSet_WidgetSketchLabel();
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
@@ -42,17 +49,46 @@ Q_OBJECT
 
   QWidget* getControl() const;
 
-  void setOperationsMgr(XGUI_OperationMgr* theMgr);
+  /// The methiod called when widget is activated
+  virtual void activate();
+
+  /// The methiod called when widget is deactivated
+  virtual void deactivate();
+
+  XGUI_Workshop* workshop() const { return myWorkshop; }
+
+  void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
+
+  std::shared_ptr<GeomAPI_Pln> plane() const;
 
  private slots:
   void onPlaneSelected();
 
  private:
-  void updateLabel(PartSet_OperationSketch* theSketchOpe);
+  AISObjectPtr createPreviewPlane(std::shared_ptr<GeomAPI_Pnt> theOrigin, 
+                                  std::shared_ptr<GeomAPI_Dir> theNorm, 
+                                  const int theRGB[3]);
+
+  std::shared_ptr<GeomAPI_Dir> setSketchPlane(const TopoDS_Shape& theShape);
+
+  void erasePreviewPlanes();
+  void showPreviewPlanes();
+
+  void setSketchingMode();
 
   QLabel* myLabel;
   QString myText;
   QString myTooltip;
+
+  XGUI_Workshop* myWorkshop;
+
+  AISObjectPtr myYZPlane;
+  AISObjectPtr myXZPlane;
+  AISObjectPtr myXYPlane;
+  bool myPreviewDisplayed;
+
+  Handle(StdSelect_FaceFilter) myPlaneFilter;
+  //Handle(ModuleBase_ShapeInPlaneFilter) mySketchFilter;
 };
 
 #endif