-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef PartSet_SketcherReentrantMgr_H
virtual ~PartSet_SketcherReentrantMgr();
public:
- /// Returns a first widget of the current opeation if the internal edit operation is active
- /// 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;
/// \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
/// \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,
/// Returns the workshop module
PartSet_Module* module() const;
+ void setInternalActiveWidget(ModuleBase_ModelWidget* theWidget);
+
+ void addConstraints(const FeaturePtr& theFeature);
+
private:
ModuleBase_IWorkshop* myWorkshop; /// the workshop
FeaturePtr myPreviousFeature; /// feature of the previous operation, which is restarted
FeaturePtr myInternalFeature;
QWidget* myInternalWidget;
- ModuleBase_ModelWidget* myInternalActiveWidget;
std::string myNoMoreWidgetsAttribute;
std::shared_ptr<Events_Message> myReentrantMessage; /// message obtained by operation restart
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