PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
: ModuleBase_IModule(theWshop),
- myIsDragging(false), myRestartingMode(LastFeatureUse), myDragDone(false)
+ myIsDragging(false), myRestartingMode(RM_LastFeatureUse), myDragDone(false)
{
//myWorkshop = dynamic_cast<XGUI_Workshop*>(theWshop);
ModuleBase_IViewer* aViewer = aViewer = theWshop->viewer();
XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
connect(anOpMgr, SIGNAL(keyEnterReleased()), this, SLOT(onEnterReleased()));
+
+ connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
+ this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
}
PartSet_Module::~PartSet_Module()
FeaturePtr aFeature = theOperation->feature();
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSPFeature && (myRestartingMode != None)) {
+ if (aSPFeature && (myRestartingMode != RM_None)) {
myLastOperationId = theOperation->id();
- myLastFeature = myRestartingMode == LastFeatureUse ? theOperation->feature() : FeaturePtr();
+ myLastFeature = myRestartingMode == RM_LastFeatureUse ? theOperation->feature() : FeaturePtr();
launchOperation(myLastOperationId);
} else {
breakOperationSequence();
{
myLastOperationId = "";
myLastFeature = FeaturePtr();
- myRestartingMode = None;
+ myRestartingMode = RM_None;
}
void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
{
- myRestartingMode = LastFeatureUse;
+ myRestartingMode = RM_LastFeatureUse;
if (theOperation->id().toStdString() == SketchPlugin_Sketch::ID()) {
// Display all sketcher sub-Objects
myCurrentSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theOperation->feature());
}
}
+void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
+{
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
+ XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
+ anOpMgr->onKeyReleased(theEvent);
+}
+
void PartSet_Module::onEnterReleased()
{
- myRestartingMode = LastFeatureEmpty;
+ myRestartingMode = RM_LastFeatureEmpty;
}
QStringList PartSet_Module::sketchOperationIdList() const
/// Enumeration to specify the restart operation properties.
enum RestartingMode {
- None, /// the operation should not be restarted
- LastFeatureUse, /// the operation is restarted and use the previous feature for own initialization
- LastFeatureEmpty /// the operation is restarted and does not use the previous feature
+ RM_None, /// the operation should not be restarted
+ RM_LastFeatureUse, /// the operation is restarted and use the previous feature for own initialization
+ RM_LastFeatureEmpty /// the operation is restarted and does not use the previous feature
};
public:
/// \param theEvent the mouse event
virtual void onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
+ /// SLOT, that is called by key release in the viewer.
+ /// The mouse moved point is sent to the current operation to be processed.
+ /// \param theEvent the key event
+ void onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent);
+
/// SLOT, that is called by enter key released
/// Set a specific type of restarting the current operation
void onEnterReleased();