/// \param thePreviousAttributeID an index of the previous active attribute\r
virtual bool processEnter(const std::string& thePreviousAttributeID) { return false; };\r
\r
+ /// Performs some GUI actions after an operation transaction is opened\r
+ /// Default realization is empty\r
+ virtual void beforeOperationStarted(ModuleBase_Operation* theOperation) {};\r
+\r
+ /// Performs some GUI actions before an operation transaction is stopped\r
+ /// Default realization is empty\r
+ virtual void beforeOperationStopped(ModuleBase_Operation* theOperation) {};\r
+\r
signals:\r
/// Signal which is emitted when operation is launched\r
void operationLaunched();\r
{
bool isModified = myCustomPrs->deactivate(false);
- if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
- mySketchMgr->stopSketch(theOperation);
- }
- else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
+ if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
mySketchMgr->stopNestedSketch(theOperation);
}
//VSV: Viewer is updated on feature update and redisplay
- //if (isModified) {
- // XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
- // XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
- // aDisplayer->updateViewer();
- //}
+ if (isModified) {
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
+ XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+ aDisplayer->updateViewer();
+ }
mySketchMgr->onShowConstraintsToggle(myHasConstraintShown);
}
if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
// Set final definitions if they are necessary
//propertyPanelDefined(aOperation);
-
/// Commit sketcher operations automatically
anOperation->commit();
}
aPointWgt->setSketch(mySketchMgr->activeSketch());
connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected()));
aWgt = aPointWgt;
- } else if (theType == "sketch-2dpoint_flyout_selector") {
+ }else if (theType == "sketch-2dpoint_flyout_selector") {
PartSet_WidgetPoint2DFlyout* aPointWgt = new PartSet_WidgetPoint2DFlyout(theParent, aWorkshop,
theWidgetApi, theParentId);
aPointWgt->setSketch(mySketchMgr->activeSketch());
return mySketchReentrantMgr->processEnter(thePreviousAttributeID);
}
+//******************************************************
+void PartSet_Module::beforeOperationStarted(ModuleBase_Operation* theOperation)
+{
+}
+
+//******************************************************
+void PartSet_Module::beforeOperationStopped(ModuleBase_Operation* theOperation)
+{
+ if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
+ mySketchMgr->stopSketch(theOperation);
+ }
+}
//******************************************************
void PartSet_Module::onBooleanOperationChange(int theOperation)
/// \param thePreviousAttributeID an index of the previous active attribute
virtual bool processEnter(const std::string& thePreviousAttributeID);
+ /// Performs some GUI actions after an operation transaction is opened
+ /// Default realization is empty
+ virtual void beforeOperationStarted(ModuleBase_Operation* theOperation);
+
+ /// Performs some GUI actions before an operation transaction is stopped
+ /// Default realization is empty
+ virtual void beforeOperationStopped(ModuleBase_Operation* theOperation);
+
public slots:
/// 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,
qDebug(QString("\tdocument->currentFeature(false) = %1").arg(
ModuleBase_Tools::objectInfo(ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str());
#endif
+ ModuleBase_IModule* aModule = myWorkshop->module();
+ if (aModule)
+ aModule->beforeOperationStarted(aFOperation);
}
}
qDebug(QString("\tdocument->currentFeature(false) = %1").arg(
ModuleBase_Tools::objectInfo(ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str());
#endif
+ ModuleBase_IModule* aModule = myWorkshop->module();
+ if (aModule)
+ aModule->beforeOperationStopped(aFOperation);
}
}