From e639c953cb37d60d72a7f13b475dfab39746b6e2 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 22 May 2014 14:50:48 +0400 Subject: [PATCH] refs #30 - Sketch base GUI: create, draw lines The edit operation correction. It is necessary to move any object without preliminary selection. Drag a highlighted object and move it somewhere. --- src/PartSet/PartSet_Module.cpp | 24 ++++-- src/PartSet/PartSet_OperationEditLine.cpp | 81 ++++++++++++++++----- src/PartSet/PartSet_OperationEditLine.h | 27 +++++-- src/PartSet/PartSet_OperationSketch.cpp | 21 ++---- src/PartSet/PartSet_OperationSketch.h | 12 +-- src/PartSet/PartSet_OperationSketchBase.cpp | 6 +- src/PartSet/PartSet_OperationSketchBase.h | 21 ++++-- src/PartSet/PartSet_OperationSketchLine.cpp | 16 +++- src/PartSet/PartSet_OperationSketchLine.h | 13 ++-- src/XGUI/XGUI_Displayer.cpp | 58 +++++++++++---- src/XGUI/XGUI_Displayer.h | 14 +++- src/XGUI/XGUI_Viewer.cpp | 2 +- 12 files changed, 206 insertions(+), 89 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index b54dc192a..606c57899 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -128,8 +128,11 @@ void PartSet_Module::onMousePressed(QMouseEvent* theEvent) myWorkshop->operationMgr()->currentOperation()); if (aPreviewOp) { - std::list aPresentations = myWorkshop->displayer()->GetViewerPrs(); - aPreviewOp->mousePressed(theEvent, myWorkshop->viewer()->activeView(), aPresentations); + XGUI_Displayer* aDisplayer = myWorkshop->displayer(); + std::list aSelected = aDisplayer->GetSelected(); + std::list aHighlighted = aDisplayer->GetHighlighted(); + + aPreviewOp->mousePressed(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted); } } @@ -139,8 +142,11 @@ void PartSet_Module::onMouseReleased(QMouseEvent* theEvent) myWorkshop->operationMgr()->currentOperation()); if (aPreviewOp) { - std::list aPresentations = myWorkshop->displayer()->GetViewerPrs(); - aPreviewOp->mouseReleased(theEvent, myWorkshop->viewer()->activeView(), aPresentations); + XGUI_Displayer* aDisplayer = myWorkshop->displayer(); + std::list aSelected = aDisplayer->GetSelected(); + std::list aHighlighted = aDisplayer->GetHighlighted(); + + aPreviewOp->mouseReleased(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted); } } @@ -173,8 +179,10 @@ void PartSet_Module::onLaunchOperation(std::string theName, boost::shared_ptr(anOperation); if (aPreviewOp) { - std::list aPresentations = myWorkshop->displayer()->GetViewerPrs(); - aPreviewOp->init(theFeature, aPresentations); + XGUI_Displayer* aDisplayer = myWorkshop->displayer(); + std::list aSelected = aDisplayer->GetSelected(); + std::list aHighlighted = aDisplayer->GetHighlighted(); + aPreviewOp->init(theFeature, aSelected, aHighlighted); } myWorkshop->actionsMgr()->setActionChecked(anOperation->getDescription()->operationId(), true); sendOperation(anOperation); @@ -197,6 +205,10 @@ void PartSet_Module::onStopSelection(const std::list& theFeature } } aDisplayer->StopSelection(theFeatures, isStop, false); + + XGUI_ViewerProxy* aViewer = myWorkshop->viewer(); + aViewer->enableSelection(!isStop); + aDisplayer->UpdateViewer(); } diff --git a/src/PartSet/PartSet_OperationEditLine.cpp b/src/PartSet/PartSet_OperationEditLine.cpp index 7b37976e8..561ae86e3 100644 --- a/src/PartSet/PartSet_OperationEditLine.cpp +++ b/src/PartSet/PartSet_OperationEditLine.cpp @@ -53,10 +53,28 @@ std::list PartSet_OperationEditLine::getSelectionModes(boost::shared_ptr theFeature, - const std::list& thePresentations) + const std::list& theSelected, + const std::list& theHighlighted) { setFeature(theFeature); - myFeatures = thePresentations; + + if (!theHighlighted.empty()) { + // if there is highlighted object, we check whether it is in the list of selected objects + // in that case this object is a handle of the moved lines. If there no such object in the selection, + // the hightlighted object should moved and the selection is skipped. The skipped selection will be + // deselected in the viewer by blockSelection signal in the startOperation method. + bool isSelected = false; + std::list::const_iterator anIt = theSelected.begin(), aLast = theSelected.end(); + for (; anIt != aLast && !isSelected; anIt++) { + isSelected = (*anIt).feature() == feature(); + } + if (!isSelected) + myFeatures = theHighlighted; + else + myFeatures = theSelected; + } + else + myFeatures = theSelected; } boost::shared_ptr PartSet_OperationEditLine::sketch() const @@ -64,12 +82,27 @@ boost::shared_ptr PartSet_OperationEditLine::sketch() const return mySketch; } -void PartSet_OperationEditLine::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView) +void PartSet_OperationEditLine::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView, + const std::list& /*theSelected*/, + const std::list& theHighlighted) { - if (!(theEvent->buttons() & Qt::LeftButton)) - return; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); - myCurPoint.setPoint(aPoint); + if (myFeatures.size() == 1) + { + boost::shared_ptr aFeature; + if (!theHighlighted.empty()) + aFeature = theHighlighted.front().feature(); + + if (aFeature && aFeature == feature()) { // continue the feature edit + blockSelection(true); + } + else { + commit(); + emit featureConstructed(feature(), FM_Deactivation); + if (aFeature) { + emit launchOperation(PartSet_OperationEditLine::Type(), aFeature); + } + } + } } void PartSet_OperationEditLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) @@ -107,16 +140,12 @@ void PartSet_OperationEditLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_Vie } void PartSet_OperationEditLine::mouseReleased(QMouseEvent* theEvent, Handle(V3d_View) theView, - const std::list& theSelected) + const std::list& /*theSelected*/, + const std::list& /*theHighlighted*/) { std::list aFeatures = myFeatures; if (myFeatures.size() == 1) { - if (theSelected.empty()) - return; - - boost::shared_ptr aFeature = theSelected.front().feature(); - commit(); - emit launchOperation(PartSet_OperationEditLine::Type(), aFeature); + blockSelection(false); } else { commit(); @@ -133,22 +162,34 @@ void PartSet_OperationEditLine::startOperation() { // do nothing in order to do not create a new feature emit multiSelectionEnabled(false); - emit setSelection(std::list()); - emit stopSelection(myFeatures, true); + + blockSelection(true); + myCurPoint.clear(); } void PartSet_OperationEditLine::stopOperation() { emit multiSelectionEnabled(true); - bool isSelectFeatures = myFeatures.size() > 1; - emit stopSelection(myFeatures, false); - if (isSelectFeatures) - emit setSelection(myFeatures); + + blockSelection(false, myFeatures.size() > 1); myFeatures.clear(); } +void PartSet_OperationEditLine::blockSelection(bool isBlocked, const bool isRestoreSelection) +{ + if (isBlocked) { + emit setSelection(std::list()); + emit stopSelection(myFeatures, true); + } + else { + emit stopSelection(myFeatures, false); + if (isRestoreSelection) + emit setSelection(myFeatures); + } +} + boost::shared_ptr PartSet_OperationEditLine::createFeature() { // do nothing in order to do not create a new feature diff --git a/src/PartSet/PartSet_OperationEditLine.h b/src/PartSet/PartSet_OperationEditLine.h index 14fd56959..8f0b62361 100644 --- a/src/PartSet/PartSet_OperationEditLine.h +++ b/src/PartSet/PartSet_OperationEditLine.h @@ -72,28 +72,36 @@ public: /// Initializes some fields accorging to the feature /// \param theFeature the feature - /// \param thePresentations the list of additional presentations + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void init(boost::shared_ptr theFeature, - const std::list& thePresentations); + const std::list& theSelected, + const std::list& theHighlighted); /// Returns the operation sketch feature /// \returns the sketch instance virtual boost::shared_ptr sketch() const; /// Processes the mouse pressed in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event - virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView); + /// \param theView a viewer to have the viewer the eye position + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations + virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, + const std::list& theSelected, + const std::list& theHighlighted); /// Gives the current mouse point in the viewer - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView); /// Gives the current selected objects to be processed by the operation /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); protected: /// \brief Virtual method called when operation is started /// Virtual method called when operation started (see start() method for more description) @@ -110,6 +118,13 @@ protected: virtual boost::shared_ptr createFeature(); protected: + /// Emits a signal about the selection blocking. Emits a signal to change the selection. + /// If the block is true, the signal clear selection, otherwise if restore selection flag allows, + /// the internal operation features are to be selected + /// \param isBlocked the state whether the operation is blocked or unblocked + /// \param isRestoreSelection the state whether the selected objects should be reselected + void blockSelection(bool isBlocked, const bool isRestoreSelection = true); + /// \brief Save the point to the line. /// \param theFeature the source feature /// \param theDeltaX the delta for X coordinate is moved diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index d527cd0f3..e818e5ec1 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -57,19 +57,11 @@ boost::shared_ptr PartSet_OperationSketch::sketch() const } void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected) + const std::list& /*theSelected*/, + const std::list& theHighlighted) { - myFeatures = theSelected; -} - -void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected) -{ - if (theSelected.empty()) - return; - if (!myIsEditMode) { - XGUI_ViewerPrs aPrs = theSelected.front(); + XGUI_ViewerPrs aPrs = theHighlighted.front(); const TopoDS_Shape& aShape = aPrs.shape(); if (!aShape.IsNull()) { setSketchPlane(aShape); @@ -77,13 +69,14 @@ void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_Vi } } else { - if (theSelected.size() == 1) { - boost::shared_ptr aFeature = theSelected.front().feature(); + if (theHighlighted.size() == 1) { + boost::shared_ptr aFeature = theHighlighted.front().feature(); if (aFeature) emit launchOperation(PartSet_OperationEditLine::Type(), aFeature); } + else + myFeatures = theHighlighted; } - myFeatures.clear(); } void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) diff --git a/src/PartSet/PartSet_OperationSketch.h b/src/PartSet/PartSet_OperationSketch.h index fbb0eb376..010b28d86 100644 --- a/src/PartSet/PartSet_OperationSketch.h +++ b/src/PartSet/PartSet_OperationSketch.h @@ -39,17 +39,13 @@ public: virtual boost::shared_ptr sketch() const; /// Processes the mouse pressed in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); - /// Processes the mouse release in the point - /// \param thePoint a point clicked in the viewer - /// \param theEvent the mouse event - /// \param theSelected the list of selected presentations - virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); /// Gives the current mouse point in the viewer /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event diff --git a/src/PartSet/PartSet_OperationSketchBase.cpp b/src/PartSet/PartSet_OperationSketchBase.cpp index 18fdea1fd..0527d9c68 100644 --- a/src/PartSet/PartSet_OperationSketchBase.cpp +++ b/src/PartSet/PartSet_OperationSketchBase.cpp @@ -61,11 +61,13 @@ boost::shared_ptr PartSet_OperationSketchBase::createFeature() void PartSet_OperationSketchBase::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected) + const std::list& theSelected, + const std::list& theHighlighted) { } void PartSet_OperationSketchBase::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected) + const std::list& theSelected, + const std::list& theHighlighted) { } void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) diff --git a/src/PartSet/PartSet_OperationSketchBase.h b/src/PartSet/PartSet_OperationSketchBase.h index 0045a8e87..53916ee6f 100644 --- a/src/PartSet/PartSet_OperationSketchBase.h +++ b/src/PartSet/PartSet_OperationSketchBase.h @@ -55,32 +55,37 @@ public: virtual std::list getSelectionModes(boost::shared_ptr theFeature) const = 0; /// Initializes some fields accorging to the feature - /// \param theFeature the feature - /// \param thePresentations the list of additional presentations + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void init(boost::shared_ptr theFeature, - const std::list& thePresentations) {} + const std::list& theSelected, + const std::list& theHighlighted) {} /// Returns the operation sketch feature /// \returns the sketch instance virtual boost::shared_ptr sketch() const = 0; /// Processes the mouse pressed in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); /// Processes the mouse release in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); /// Processes the mouse move in the point - /// \param thePoint a 3D point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView); /// Processes the key pressed in the view diff --git a/src/PartSet/PartSet_OperationSketchLine.cpp b/src/PartSet/PartSet_OperationSketchLine.cpp index 6b64cd275..4ccf1c16c 100644 --- a/src/PartSet/PartSet_OperationSketchLine.cpp +++ b/src/PartSet/PartSet_OperationSketchLine.cpp @@ -67,7 +67,8 @@ std::list PartSet_OperationSketchLine::getSelectionModes(boost::shared_ptr< } void PartSet_OperationSketchLine::init(boost::shared_ptr theFeature, - const std::list& /*thePresentations*/) + const std::list& /*theSelected*/, + const std::list& /*theHighlighted*/) { if (!theFeature || theFeature->getKind() != "SketchLine") return; @@ -82,7 +83,8 @@ boost::shared_ptr PartSet_OperationSketchLine::sketch() const } void PartSet_OperationSketchLine::mouseReleased(QMouseEvent* theEvent, Handle(V3d_View) theView, - const std::list& theSelected) + const std::list& theSelected, + const std::list& /*theHighlighted*/) { double aX, anY; @@ -198,8 +200,16 @@ void PartSet_OperationSketchLine::keyReleased(const int theKey) emit launchOperation(PartSet_OperationSketchLine::Type(), boost::shared_ptr()); } break; + case Qt::Key_Escape: { + if (myPointSelectionMode == SM_DonePoint) + { + commit(); + emit featureConstructed(feature(), FM_Deactivation); + } + else + abort(); + } default: - PartSet_OperationSketchBase::keyReleased(theKey); break; } } diff --git a/src/PartSet/PartSet_OperationSketchLine.h b/src/PartSet/PartSet_OperationSketchLine.h index 09c33f6f4..0d556d2c0 100644 --- a/src/PartSet/PartSet_OperationSketchLine.h +++ b/src/PartSet/PartSet_OperationSketchLine.h @@ -46,21 +46,24 @@ public: virtual std::list getSelectionModes(boost::shared_ptr theFeature) const; /// Initializes some fields accorging to the feature - /// \param theFeature the feature - /// \param thePresentations the list of additional presentations + /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void init(boost::shared_ptr theFeature, - const std::list& thePresentations); + const std::list& theSelected, + const std::list& theHighlighted); /// Returns the operation sketch feature /// \returns the sketch instance virtual boost::shared_ptr sketch() const; /// Gives the current selected objects to be processed by the operation - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); /// Gives the current mouse point in the viewer /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 7f6bb00d7..4073b30b4 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -52,7 +53,7 @@ void XGUI_Displayer::Display(boost::shared_ptr theFeature, }*/ -std::list XGUI_Displayer::GetViewerPrs() +std::list XGUI_Displayer::GetSelected() { std::set > aPrsFeatures; std::list aPresentations; @@ -62,15 +63,26 @@ std::list XGUI_Displayer::GetViewerPrs() Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive(); TopoDS_Shape aShape = aContext->SelectedShape(); - boost::shared_ptr aFeature; - FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(), - aFLast = myFeature2AISObjectMap.end(); - for (; aFIt != aFLast && !aFeature; aFIt++) { - Handle(AIS_InteractiveObject) anAIS = (*aFIt).second; - if (anAIS != anIO) - continue; - aFeature = (*aFIt).first; - } + boost::shared_ptr aFeature = GetFeature(anIO); + if (aPrsFeatures.find(aFeature) != aPrsFeatures.end()) + continue; + aPresentations.push_back(XGUI_ViewerPrs(aFeature, aShape)); + aPrsFeatures.insert(aFeature); + } + return aPresentations; +} + +std::list XGUI_Displayer::GetHighlighted() +{ + std::set > aPrsFeatures; + std::list aPresentations; + + Handle(AIS_InteractiveContext) aContext = AISContext(); + for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) { + Handle(AIS_InteractiveObject) anIO = aContext->DetectedInteractive(); + TopoDS_Shape aShape = aContext->DetectedShape(); + + boost::shared_ptr aFeature = GetFeature(anIO); if (aPrsFeatures.find(aFeature) != aPrsFeatures.end()) continue; aPresentations.push_back(XGUI_ViewerPrs(aFeature, aShape)); @@ -203,7 +215,12 @@ void XGUI_Displayer::SetSelected(const std::list& theFeatures, c boost::shared_ptr aFeature; Handle(AIS_Shape) anAIS; - aContext->ClearSelected(); + // we need to unhighligth objects manually in the current local context + // in couple with the selection clear (TODO) + Handle(AIS_LocalContext) aLocalContext = aContext->LocalContext(); + if (!aLocalContext.IsNull()) + aLocalContext->UnhilightLastDetected(myWorkshop->viewer()->activeView()); + aContext->ClearSelected(false); for (; anIt != aLast; anIt++) { aFeature = (*anIt).feature(); @@ -213,6 +230,7 @@ void XGUI_Displayer::SetSelected(const std::list& theFeatures, c continue; aContext->AddOrRemoveSelected(anAIS, false); } + if (isUpdateViewer) aContext->UpdateCurrentViewer(); } @@ -267,10 +285,24 @@ void XGUI_Displayer::EraseDeletedFeatures(const bool isUpdateViewer) void XGUI_Displayer::CloseLocalContexts(const bool isUpdateViewer) { - closeAllContexts(true); + CloseAllContexts(true); +} + +boost::shared_ptr XGUI_Displayer::GetFeature(Handle(AIS_InteractiveObject) theIO) +{ + boost::shared_ptr aFeature; + FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(), + aFLast = myFeature2AISObjectMap.end(); + for (; aFIt != aFLast && !aFeature; aFIt++) { + Handle(AIS_InteractiveObject) anAIS = (*aFIt).second; + if (anAIS != theIO) + continue; + aFeature = (*aFIt).first; + } + return aFeature; } -void XGUI_Displayer::closeAllContexts(const bool isUpdateViewer) +void XGUI_Displayer::CloseAllContexts(const bool isUpdateViewer) { Handle(AIS_InteractiveContext) ic = AISContext(); if (!ic.IsNull()) { diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index 5973cd67e..080fef76a 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -58,9 +58,13 @@ public: //void Display(boost::shared_ptr theFeature, const TopoDS_Shape& theShape, // const bool isUpdateViewer = true); - /// Returns a list of viewer presentations + /// Returns a list of viewer selected presentations /// \return list of presentations - std::list GetViewerPrs(); + std::list GetSelected(); + + /// Returns a list of viewer highlited presentations + /// \return list of presentations + std::list GetHighlighted(); /// Display the shape and activate selection of sub-shapes /// \param theFeature a feature instance @@ -111,9 +115,13 @@ public: void UpdateViewer(); protected: + /// Searches the feature by interactive object + /// \param theIO an interactive object + /// \return feature the feature or NULL if it not visualized + boost::shared_ptr GetFeature(Handle(AIS_InteractiveObject) theIO); /// Deactivate local selection /// \param isUpdateViewer the state wether the viewer should be updated immediatelly - void closeAllContexts(const bool isUpdateViewer); + void CloseAllContexts(const bool isUpdateViewer); /// Returns currently installed AIS_InteractiveContext Handle(AIS_InteractiveContext) AISContext() const; diff --git a/src/XGUI/XGUI_Viewer.cpp b/src/XGUI/XGUI_Viewer.cpp index 734a1a469..3d5af347a 100644 --- a/src/XGUI/XGUI_Viewer.cpp +++ b/src/XGUI/XGUI_Viewer.cpp @@ -506,9 +506,9 @@ void XGUI_Viewer::onMousePressed(XGUI_ViewWindow* theWindow, QMouseEvent* theEve */ void XGUI_Viewer::onMouseMove(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent) { + myCurPnt.setX(theEvent->x()); myCurPnt.setY(theEvent->y()); if (!mySelectionEnabled) return; - myCurPnt.setX(theEvent->x()); myCurPnt.setY(theEvent->y()); Handle(V3d_View) aView3d = theWindow->viewPort()->getView(); if ( !aView3d.IsNull() ) { myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d); -- 2.39.2