Event_Loop::loop()->send(aMessage);
}
-/**
- * Slot that is called by the operation requiring of preview display or erase
- * \param isDisplay the display or erase state
-*/
-void PartSet_Module::visualizePreview(bool isDisplay)
-{
- ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
- if (!anOperation)
- return;
-
- PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
- if (!aPreviewOp)
- return;
-
- if (isDisplay)
- myWorkshop->displayer()->Display(anOperation->feature(), aPreviewOp->preview());
- else
- myWorkshop->displayer()->Erase(anOperation->feature(), aPreviewOp->preview());
-}
-
void PartSet_Module::onOperationStarted()
{
ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
visualizePreview(false);
}
}
+
+void PartSet_Module::visualizePreview(bool isDisplay)
+{
+ ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
+ if (!anOperation)
+ return;
+
+ PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
+ if (!aPreviewOp)
+ return;
+
+ if (isDisplay)
+ myWorkshop->displayer()->Display(anOperation->feature(), aPreviewOp->preview());
+ else
+ myWorkshop->displayer()->Erase(anOperation->feature(), aPreviewOp->preview());
+}
public slots:
void onFeatureTriggered();
+ /// SLOT, that is called after the operation is started. Perform some specific for module
+ /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
void onOperationStarted();
+ /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
+ /// from the viewer selection and show the sketch preview.
void onOperationStopped(ModuleBase_Operation* theOperation);
private:
+ /// Displays or erase the current operation preview, if it has it.
+ /// \param isDisplay the state whether the presentation should be displayed or erased
void visualizePreview(bool isDisplay);
private: