Salome HOME
Apply button to be disabled during value modification for any operation, not only...
[modules/shaper.git] / src / PartSet / PartSet_SketcherMgr.h
index 477fdcb3053bb17c8e75443b6c6ea744e059a13f..3ea2f1fbf1069379fb852afca7cd52ff0f099890 100644 (file)
@@ -137,7 +137,7 @@ public:
 
   /// Returns False only if the sketch creating feature can not be visualized.
   /// \return a boolean value
-  bool canCommitOperation() const;
+  //bool canCommitOperation() const;
 
   /// Returns whether the object can be erased at the bounds of the active operation.
   /// Sketch sub-entities can not be erased during the sketch operation
@@ -164,7 +164,7 @@ public:
 
   /// Saves the current selection in the viewer into an internal container
   /// It obtains the selected attributes. The highlighted objects can be processes as the selected ones
-  /// \param theHighlightedUse a boolean flag
+  /// \param theHighlightedOnly a boolean flag
   void storeSelection(const bool theHighlightedOnly = false);
 
   /// Restores previously saved selection state
@@ -174,6 +174,13 @@ public:
   /// \return boolean value
   bool sketchSolverError();
 
+  //! Returns the feature error if the current state of the feature in the sketch is not correct
+  //! If the feature is correct, it returns an empty value
+  //! Incorrect states: the feature is sketch, the solver error value
+  //! The feature value is reset, this is the flag of sketch mgr
+  //! \return string value
+  QString getFeatureError(const FeaturePtr& theFeature);
+
   /// Returns list of strings which contains id's of sketch operations
   static const QStringList& sketchOperationIdList();
 
@@ -184,10 +191,18 @@ public:
   /// \param theModes a list of modes
   static void sketchSelectionModes(QIntList& theModes);
 
+  /// Connects or disconnects to the value changed signal of the property panel widgets
+  /// \param theWidget a property contol widget
+  /// \param isToConnect a boolean value whether connect or disconnect
+  void connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect);
+
 public slots:
   /// Process sketch plane selected event
   void onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
 
+  /// Toggle show constraints
+  void onShowConstraintsToggle(bool);
+
 private slots:
   /// Process the enter mouse to the view port. If the current operation is a create of
   /// a nested sketch feature, it updates internal flags to display the feature on mouse move
@@ -212,8 +227,6 @@ private slots:
   void onBeforeContextMenu();
   void onAfterContextMenu();
 
-  void onShowConstraintsToggle(bool);
-
 private:
   /// Launches the operation from current highlighting
   void launchEditing();
@@ -258,10 +271,6 @@ private:
                                   const FeatureToSelectionMap& theSelection,
                                   SelectMgr_IndexedMapOfOwner& anOwnersToSelect);
 
-  /// Connects or disconnects to the value changed signal of the property panel widgets
-  /// \param isToConnect a boolean value whether connect or disconnect
-  void connectToPropertyPanel(const bool isToConnect);
-
   /// Returns true if the created feature is visible
   /// \param 
   bool isVisibleCreatedFeature() const;
@@ -270,6 +279,9 @@ private:
   /// \return an operation
   ModuleBase_Operation* getCurrentOperation() const;
 
+  /// Get the active widget in the property panel
+  ModuleBase_ModelWidget* getActiveWidget() const;
+
   /// Erase or display the feature of the current operation. If the mouse over the active view or
   /// a current value is changed by property panel, the feature is displayed otherwise it is hidden
   /// \param theOperation an operation which feature is to be displayed, it is nested create operation
@@ -277,19 +289,14 @@ private:
   void visualizeFeature(const FeaturePtr& theFeature, const bool isEditOperation,
                         const bool isToDisplay, const bool isFlushRedisplay = true);
 private:
-  /// Gives a debug information about internal flags myIsMouseOverWindow and myIsResetCurrentValue
-  /// \return a string value
-  QString mouseOverWindowFlagsInfo() const;
-
   XGUI_OperationMgr* operationMgr() const;
 
 private:
   PartSet_Module* myModule;
 
-  bool myPreviousSelectionEnabled; // the previous selection enabled state in the viewer
+  bool myPreviousDrawModeEnabled; // the previous selection enabled state in the viewer
   bool myIsDragging;
   bool myDragDone;
-  bool myIsResetCurrentValue; /// the state that value in the property panel is reset
   bool myIsMouseOverWindow; /// the state that the mouse over the view
   bool myIsMouseOverViewProcessed; /// the state whether the over view state is processed by mouseMove method
   bool myIsPopupMenuActive; /// the state of the popup menu is shown