//********************************************************************
void ModuleBase_WidgetSelector::deactivate()
{
+ ModuleBase_ModelWidget::deactivate();
disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
- activateSelection(false);
- activateFilters(false);
+ activateSelectionAndFilters(false);
+ ModuleBase_ModelWidget::deactivate();
}
PartSet_WidgetShapeSelector.h
PartSet_WidgetFileSelector.h
PartSet_Filters.h
- PartSet_LockApplyMgr.h
PartSet_FilterInfinite.h
PartSet_SketcherMgr.h
+ PartSet_SketcherReetntrantMgr.h
PartSet_MenuMgr.h
PartSet_WidgetSketchCreator.h
PartSet_IconFactory.h
PartSet_WidgetShapeSelector.cpp
PartSet_WidgetFileSelector.cpp
PartSet_Filters.cpp
- PartSet_LockApplyMgr.cpp
PartSet_FilterInfinite.cpp
PartSet_SketcherMgr.cpp
+ PartSet_SketcherReetntrantMgr.cpp
PartSet_MenuMgr.cpp
PartSet_WidgetSketchCreator.cpp
PartSet_IconFactory.cpp
mySketchMgr->commitNestedSketch(theOperation);
}
- ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
- if (!aFOperation || aFOperation->isEditOperation())
- return;
- // the selection is cleared after commit the create operation
- // in order to do not use the same selected objects in the restarted operation
- // for common behaviour, the selection is cleared even if the operation is not restarted
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
- XGUI_Workshop* aWorkshop = aConnector->workshop();
- aWorkshop->selector()->clearSelection();
-
/// Restart sketcher operations automatically
- FeaturePtr aFeature = aFOperation->feature();
- std::shared_ptr<SketchPlugin_Feature> aSPFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
- myRestartingMode == RM_EmptyFeatureUsed)) {
- myLastOperationId = aFOperation->id();
- myLastFeature = myRestartingMode == RM_LastFeatureUsed ? aFOperation->feature() : FeaturePtr();
- if (!sketchMgr()->sketchSolverError())
- launchOperation(myLastOperationId);
+ if (!mySketchReentrantMgr->operationCommitted(theOperation)) {
+ // the selection is cleared after commit the create operation
+ // in order to do not use the same selected objects in the restarted operation
+ // for common behaviour, the selection is cleared even if the operation is not restarted
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
+ XGUI_Workshop* aWorkshop = aConnector->workshop();
+ aWorkshop->selector()->clearSelection();
}
- breakOperationSequence();
-}
-
-void PartSet_Module::breakOperationSequence()
-{
- myLastOperationId = "";
- myLastFeature = FeaturePtr();
- myRestartingMode = RM_None;
}
- void PartSet_Module::onOperationAborted(ModuleBase_Operation* theOperation)
+ void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
{
- breakOperationSequence();
+ /// Restart sketcher operations automatically
+ mySketchReentrantMgr->operationAborted(theOperation);
}
- void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
+ void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation)
{
+ /// Restart sketcher operations automatically
+ mySketchReentrantMgr->operationStarted(theOperation);
+
if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
mySketchMgr->startSketch(theOperation);
}
/// Returns list of granted operation indices
virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const;
+ /// Validates the current operation and send the state change to sketch manager
+ /// \thePrevState the previous widget value state
+ virtual void widgetStateChanged(int thePreviousState);
+
public slots:
- /// SLOT, that is called by no more widget signal emitted by property panel
- /// Set a specific flag to restart the sketcher operation
- void onNoMoreWidgets();
-
/// Redefines the parent method in order to customize the next case:
/// If the sketch nested operation is active and the presentation is not visualized in the viewer,
/// the operation should be always aborted.
/// Register properties of this module
virtual void registerProperties();
+ /// 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
+ virtual void connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect);
+
private slots:
- /// Processing of vertex selected
- void onVertexSelected();
-
void onTreeViewDoubleClick(const QModelIndex&);
+ void onActiveDocPopup(const QPoint&);
+
private:
- /// Breaks sequense of automatically resterted operations
- void breakOperationSequence();
//! Delete features
virtual bool deleteObjects();
aModes << TopAbs_VERTEX;
aModes << TopAbs_EDGE;
myWorkshop->activateSubShapesSelection(aModes);
-
- myLockApplyMgr->activate();
}
+bool PartSet_WidgetPoint2D::canBeActivatedByMove()
+{
+ bool aCanBeActivated = false;
+ if (feature()->getKind() == SketchPlugin_Line::ID() &&
+ attributeID() == SketchPlugin_Line::START_ID())
+ aCanBeActivated = true;
+
+ return aCanBeActivated;
+}
+
void PartSet_WidgetPoint2D::deactivate()
{
+ ModuleBase_ModelWidget::deactivate();
ModuleBase_IViewer* aViewer = myWorkshop->viewer();
disconnect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
{
// Avoid activation of already actve widget. It could happen on focusIn event many times
if (theWidget == myActiveWidget) {
- return;
+ return false;
}
+ std::string aPreviosAttributeID;
if(myActiveWidget) {
+ aPreviosAttributeID = myActiveWidget->attributeID();
myActiveWidget->deactivate();
myActiveWidget->setHighlighted(false);
}