From: nds Date: Tue, 14 Jul 2015 12:50:26 +0000 (+0300) Subject: Multi-rotation/translation deselect listo of objects. There is still a crash by desel... X-Git-Tag: V_1.3.0~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0284999c9db26f1fdc4db2b11876d0dd6ae2c508;p=modules%2Fshaper.git Multi-rotation/translation deselect listo of objects. There is still a crash by deselection when edit them. The crash correction. Scenario: create sketch, a line, create a rotation on the line. Edit rotation, activate selector control, click in the viewer to deselect current value. Result is crash. --- diff --git a/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp b/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp index 0785b8415..acd74cb15 100644 --- a/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp +++ b/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp @@ -10,6 +10,8 @@ #include #include "SketcherPrs_SymbolPrs.h" +#define DEBUG_SENSITIVE_TO_BE_CORRECTED + IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity); IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity); @@ -54,11 +56,27 @@ Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected() gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const { +#ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED + const Handle(SelectMgr_EntityOwner)& anOwner = + Handle(SelectMgr_EntityOwner)::DownCast(OwnerId()); + const Handle(SketcherPrs_SymbolPrs)& aSymbPrs = + Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable()); + if (aSymbPrs->pointsArray()->VertexNumber() < myId) + return gp_Pnt(); +#endif return Point(); } Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox() { +#ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED + const Handle(SelectMgr_EntityOwner)& anOwner = + Handle(SelectMgr_EntityOwner)::DownCast(OwnerId()); + const Handle(SketcherPrs_SymbolPrs)& aSymbPrs = + Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable()); + if (aSymbPrs->pointsArray()->VertexNumber() < myId) + return Select3D_BndBox3d(); +#endif gp_Pnt aPnt = Point(); return Select3D_BndBox3d (SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()), SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z())); diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 30535729a..893b33fbf 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -343,7 +343,6 @@ void SketcherPrs_SymbolPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& } if (!updatePoints(20)) { - mySPoints.Clear(); return; } diff --git a/src/SketcherPrs/SketcherPrs_Transformation.cpp b/src/SketcherPrs/SketcherPrs_Transformation.cpp index 280d14e34..43a57aa9f 100644 --- a/src/SketcherPrs/SketcherPrs_Transformation.cpp +++ b/src/SketcherPrs/SketcherPrs_Transformation.cpp @@ -43,7 +43,13 @@ bool SketcherPrs_Transformation::updatePoints(double theStep) const int aNbB = anAttrB->size(); if (aNbB == 0) + { +#ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED + //if (!myPntArray.IsNull()) + // mySPoints.Clear(); +#endif return false; + } SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get(); myPntArray = new Graphic3d_ArrayOfPoints(aNbB);