X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetSketchLabel.h;h=58816ee4c7cfde676b82b90e230835db9caf7410;hb=07bc7fd1c59cbe7a2d916654edf77409670f215b;hp=30cdaace39917bcbd8e9d58be4c8b06352435198;hpb=72ccabc2a906e229fe487dfeae61d38f921927d0;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 30cdaace3..58816ee4c 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: PartSet_WidgetSketchLabel.h // Created: 07 July 2014 // Author: Vitaly SMETANNIKOV @@ -8,24 +10,40 @@ #include "PartSet.h" #include +#include + +#include +#include +#include + +#include +#include class QLabel; -class XGUI_OperationMgr; -class PartSet_OperationSketch; +class XGUI_OperationMgr; +class XGUI_Workshop; +//class PartSet_OperationSketch; class PARTSET_EXPORT PartSet_WidgetSketchLabel : public ModuleBase_ModelWidget { - Q_OBJECT -public: - PartSet_WidgetSketchLabel(QWidget* theParent, const Config_WidgetAPI* theData); +Q_OBJECT + public: + 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 - virtual bool storeValue(FeaturePtr theFeature) const { return true;} + virtual bool storeValue() const + { + return true; + } - virtual bool restoreValue(FeaturePtr theFeature) { return true;} + virtual bool restoreValue() + { + return true; + } /// Returns list of widget controls /// \return a control list @@ -33,17 +51,49 @@ public: 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 plane() const; -private slots: +signals: + void planeSelected(const std::shared_ptr& thePln); + + private slots: void onPlaneSelected(); -private: - void updateLabel(PartSet_OperationSketch* theSketchOpe); + private: + AISObjectPtr createPreviewPlane(std::shared_ptr theOrigin, + std::shared_ptr theNorm, + const int theRGB[3]); + + std::shared_ptr 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) myFaceFilter; + //Handle(ModuleBase_ShapeInPlaneFilter) mySketchFilter; }; -#endif \ No newline at end of file +#endif