Salome HOME
[bos #29467] [EDF] (2022-T1) Logging of SALOME usage: specific log in SALOME
[modules/shaper.git] / src / PartSet / PartSet_SketcherReentrantMgr.h
index fc2f6723cc9440e9edfa4e1b5cc1943b86d9ebbb..220120e56844b2a5416d60d84b1ff0543eeb1ac8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -131,6 +131,17 @@ public:
   /// \param theMessage a message of reentrant operation
   void setReentrantPreSelection(const std::shared_ptr<Events_Message>& theMessage);
 
+  bool isAutoConstraints() const { return myIsAutoConstraints; }
+
+
+  bool isLastAutoConstraint(const ObjectPtr& theObj) const;
+
+public slots:
+  /// The slot is called when user checks "Automatic constraints" button
+  /// \param isOn a state of the check box
+  void onAutoConstraints(bool isOn);
+
+
 private slots:
   /// SLOT, that is called by a widget activating in the property panel
   /// If the 'internal' edit operation is started, it activates the first widget selection
@@ -188,7 +199,7 @@ private:
   /// \param theSourceFeature a source feature
   /// \param theNewFeature a new feature
   /// \param theSketch an active sketch
-  /// \param isTemporary is used to do not create additional features(e.g. coicidence for line)
+  /// \param isTemporary is used to do not create additional features(e.g. coincidence for line)
   /// \return true is something is copied
   static bool copyReetntrantAttributes(const FeaturePtr& theSourceFeature,
                                       const FeaturePtr& theNewFeature,
@@ -211,6 +222,8 @@ private:
 
   void setInternalActiveWidget(ModuleBase_ModelWidget* theWidget);
 
+  void addConstraints(const FeaturePtr& theFeature);
+
 private:
   ModuleBase_IWorkshop* myWorkshop; /// the workshop
 
@@ -227,6 +240,10 @@ private:
   ObjectPtr mySelectedObject; /// cashed selected object
   std::shared_ptr<ModelAPI_Attribute> mySelectedAttribute; /// cashed selected attribute
   std::shared_ptr<GeomAPI_Pnt2d> myClickedSketchPoint; /// cashed clicked point
+
+  bool myIsAutoConstraints;
+  void* myLastAutoConstraint; //< Stores address of last automatic constraint.
+                              //< Cannot be used as a pointer!!!
 };
 
 #endif