Salome HOME
#1119 Confirmation box for deleting parts
[modules/shaper.git] / src / PartSet / PartSet_SketcherReetntrantMgr.h
index f8f9ae0f9c4852caa7f5a2ebc241761192922c80..93691362dff9b37649b07ab448e576101dd0f854 100755 (executable)
@@ -51,6 +51,15 @@ public:
   /// or return null. If the current widget of the operation is a viewer selector, it returns null.
   ModuleBase_ModelWidget* internalActiveWidget() const;
 
+  /// Return true if the current edit operation is an internal
+  bool isInternalEditActive() const;
+
+  /// if the internal flags allow it and the manager is active, it starts an internal edit operation
+  /// for the created operation.
+  /// \param thePreviousAttributeID an index of the previous active attribute
+  //bool restartOperation(const std::string& thePreviousAttributeID);
+  bool processEnter(const std::string& thePreviousAttributeID);
+
   /// Resets the internal flags
   /// \param theOperation a started operation
   void operationStarted(ModuleBase_Operation* theOperation);
@@ -100,10 +109,9 @@ private slots:
   /// the current feature is a line and there are not obligate widgets anymore
   void onVertexSelected();
 
-  /// SLOT, that is called by enter key released
-  /// Set a specific type of restarting the current operation to do not use the feature
-  /// for initialization of a new started operation.
-  void onEnterReleased();
+  /// Deactivates selection and filters of the first operation widget if it is an internal
+  /// 'edit' operation
+  void onBeforeStopped();
 
 private:
   /// Returns true if the current operation is a sketch or a nested sketch operation
@@ -112,14 +120,35 @@ private:
   /// Sets the focus to the last control of the property panel and activates selection
   /// of the first widget to can select first value of the next create operation
   /// \param thePreviousAttributeID an index of the previous attribute to set focus to this widget
-  void startInternalEdit(const std::string& thePreviousAttributeID);
+  /// \return true if it is started
+  bool startInternalEdit(const std::string& thePreviousAttributeID);
+
+  /// Disconnects this manager from operation signals, deactivate selection of the first control
+  /// in the viewer.
+  void beforeStopInternalEdit();
 
   /// Commits the current operation and launches a new with the commited operation feature index
   void restartOperation();
 
+  /// Creates an internal feature and controls to process it
+  void createInternalFeature();
+
+  /// A pair method for an internal creation to remove it and clear all created controls
+  void deleteInternalFeature();
+
   /// Breaks sequense of automatically resterted operations
   void resetFlags();
 
+  /// Copy some feature specific attributes from the source to a new feature
+  /// This is type for Circle and Arc features
+  /// \param theSourceFeature a source feature
+  /// \param theNewFeature a new feature
+  /// \return true is something is copied
+  static bool copyReetntrantAttributes(const FeaturePtr& theSourceFeature,
+                                       const FeaturePtr& theNewFeature);
+
+  static bool isTangentArc(ModuleBase_Operation* theOperation);
+
   /// Returns the workshop
   XGUI_Workshop* workshop() const;
 
@@ -132,6 +161,11 @@ private:
   RestartingMode myRestartingMode;  /// automatical restarting mode flag
   bool myIsFlagsBlocked; /// true when reset of flags should not be perfromed
   bool myIsInternalEditOperation; /// true when the 'internal' edit is started
+
+  FeaturePtr myInternalFeature;
+  QWidget* myInternalWidget;
+  ModuleBase_ModelWidget* myInternalActiveWidget;
+  std::string myNoMoreWidgetsAttribute;
 };
 
 #endif