PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
: ModuleBase_IModule(theWshop),
- myVisualLayerId(0)
+ myVisualLayerId(0),
+ myIsOperationIsLaunched(false)
{
new PartSet_IconFactory();
return mySketchMgr->isMouseOverWindow();
}
+bool PartSet_Module::isSketchNeutralPointActivated() const
+{
+ bool isNeutralPoint = true;
+ if (sketchReentranceMgr()->isInternalEditStarted())
+ isNeutralPoint = false;
+ if (myIsOperationIsLaunched)
+ isNeutralPoint = false;
+
+ return isNeutralPoint;
+}
+
void PartSet_Module::closeDocument()
{
clearViewer();
void PartSet_Module::launchOperation(const QString& theCmdId,
const bool isUpdatePropertyPanel)
{
+ myIsOperationIsLaunched = true;
storeConstraintsState(theCmdId.toStdString());
updateConstraintsState(theCmdId.toStdString());
ModuleBase_IModule::launchOperation(theCmdId, isUpdatePropertyPanel);
+
+ myIsOperationIsLaunched = false;
}
void PartSet_Module::storeConstraintsState(const std::string& theFeatureKind)
PartSet_SketcherMgr* sketchMgr() const { return mySketchMgr; }
/// Returns sketch reentrant manager
- PartSet_SketcherReetntrantMgr* sketchReentranceMgr() { return mySketchReentrantMgr; }
+ PartSet_SketcherReetntrantMgr* sketchReentranceMgr() const { return mySketchReentrantMgr; }
/// Returns listener of overconstraint signal
/// \return the listener
PartSet_OverconstraintListener* overconstraintListener() { return myOverconstraintListener; }
+ /// Returns true if the current operation is not reentrant and the current state of the
+ /// application is not in launch operation mode
+ /// \return boolean value
+ bool isSketchNeutralPointActivated() const;
+
/// Performs functionality on closing document
virtual void closeDocument();
void setDefaultConstraintShown();
private:
+ bool myIsOperationIsLaunched; /// state of application between launch and stop operation
SelectMgr_ListOfFilter mySelectionFilters;
PartSet_SketcherMgr* mySketchMgr;
/// improvement to deselect automatically all eventual selected objects, when
// returning to the neutral point of the Sketcher
// if the operation is restarted, the previous selection is used to initialize started operation
- if (!myModule->sketchReentranceMgr()->isInternalEditStarted())
+ if (myModule->isSketchNeutralPointActivated())
workshop()->selector()->clearSelection();
}