From: vsv Date: Wed, 15 Mar 2017 13:08:38 +0000 (+0300) Subject: Fix for constraint selection problem X-Git-Tag: V_2.7.0~223 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b5d75a02129dfa236a8c5e1838980cae245b873;p=modules%2Fshaper.git Fix for constraint selection problem --- diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 729d13be5..8f77dbb15 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -51,9 +51,9 @@ class SketcherPrs_SymbolArray: public OpenGl_PrimitiveArray { public: SketcherPrs_SymbolArray(const OpenGl_GraphicDriver* theDriver, - const Handle(SketcherPrs_SymbolPrs)& theObj) + const Handle(SketcherPrs_SymbolPrs)& theObj, const Handle(AIS_InteractiveContext)& theCtx) :OpenGl_PrimitiveArray(theDriver, theObj->myPntArray->Type(), theObj->myPntArray->Indices(), - theObj->myPntArray->Attributes(), theObj->myPntArray->Bounds()), myObj(theObj) {} + theObj->myPntArray->Attributes(), theObj->myPntArray->Bounds()), myObj(theObj), myContext(theCtx) {} virtual void Render(const Handle(OpenGl_Workspace)& theWorkspace) const { @@ -78,10 +78,18 @@ public: } } OpenGl_PrimitiveArray::Render(theWorkspace); + + // Update selection position only if there is no selected object + // because it can corrupt selection of other objects + if ((myContext->NbCurrents() == 0) && (myContext->NbSelected() == 0)) { + myContext->MainSelector()->RebuildSensitivesTree(myObj); + myContext->MainSelector()->RebuildObjectsTree (false); + } } private: Handle(SketcherPrs_SymbolPrs) myObj; + Handle(AIS_InteractiveContext) myContext; }; @@ -259,7 +267,7 @@ void SketcherPrs_SymbolPrs::Compute( // Pint the group with custom procedure (see Render) SketcherPrs_SymbolArray* aElem = - new SketcherPrs_SymbolArray((OpenGl_GraphicDriver*)aDriver->This(), this); + new SketcherPrs_SymbolArray((OpenGl_GraphicDriver*)aDriver->This(), this, GetContext()); aGroup->AddElement(aElem); // Disable frustum culling for this object by marking it as mutable