X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetSketchLabel.h;h=2bc8d85d682d04865b9e815d9adbdced64400b2f;hb=857b1f72d9703c46c6c8c9bb239821d314344c86;hp=0dc7c07f63f547d1dff933fd3f504213724d240e;hpb=179d6f9656ac229aa724f98742bf3e0f07f23e0f;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 0dc7c07f6..2bc8d85d6 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -42,7 +42,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from /// \param theParentId is Id of a parent of the current attribute - PartSet_WidgetSketchLabel(QWidget* theParent, const Config_WidgetAPI* theData, + PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, + const Config_WidgetAPI* theData, const std::string& theParentId, bool toShowConstraints); virtual ~PartSet_WidgetSketchLabel(); @@ -52,13 +53,8 @@ Q_OBJECT /// The method is called by the current operation to process the operation preselection. /// It is redefined to do nothing if the plane of the sketch has been already set. /// \param theValues the wrapped selection values - /// \param thePosition an index in the list of values, the values should be get from the index - virtual bool setSelection(const QList& theValues, int& thePosition); - - virtual bool restoreValue() - { - return true; - } + virtual bool setSelection(QList& theValues, + const bool theToValidate); /// Returns list of widget controls /// \return a control list @@ -67,13 +63,6 @@ Q_OBJECT /// The methiod called when widget is deactivated virtual void deactivate(); - /// Returns pointer to workshop - XGUI_Workshop* workshop() const { return myWorkshop; } - - /// Set pointer to workshop - /// \param theWork a pointer to workshop - void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; } - /// Returns sketcher plane std::shared_ptr plane() const; @@ -113,9 +102,18 @@ protected: return true; } + virtual bool restoreValueCustom() + { + return true; + } + /// The methiod called when widget is activated virtual void activateCustom(); + /// Erase preview planes, disconnect widget, change the view projection + /// \param thePrs a selected presentation + void updateByPlaneSelected(const ModuleBase_ViewerPrs& thePrs); + protected: /// Activate or deactivate selection void activateSelection(bool toActivate); @@ -133,6 +131,9 @@ protected: std::shared_ptr theNorm, const int theRGB[3]); + //! Returns workshop + XGUI_Workshop* workshop() const; + /// Set sketch plane by shape /// \param theShape a planar face std::shared_ptr setSketchPlane(const TopoDS_Shape& theShape); @@ -148,8 +149,6 @@ protected: QString myText; QString myTooltip; - XGUI_Workshop* myWorkshop; - AISObjectPtr myYZPlane; AISObjectPtr myXZPlane; AISObjectPtr myXYPlane;