From: vsv Date: Wed, 11 Mar 2020 13:31:23 +0000 (+0300) Subject: Issue #17347(Tuleap) Do not select a point from periodic B-spline X-Git-Tag: V9_5_0a2~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f3217132aa73757b2d95e612e51e7d46fb082fe;p=modules%2Fshaper.git Issue #17347(Tuleap) Do not select a point from periodic B-spline --- diff --git a/src/PartSet/PartSet_Filters.cpp b/src/PartSet/PartSet_Filters.cpp index a602a31c9..c335ea932 100644 --- a/src/PartSet/PartSet_Filters.cpp +++ b/src/PartSet/PartSet_Filters.cpp @@ -186,7 +186,9 @@ Standard_Boolean } FeaturePtr aFeature = aDocument->feature(aResult); - if(!aFeature.get() || aFeature->getKind() != "SketchCircle") { + if(!aFeature.get() || + ((aFeature->getKind() != "SketchCircle") && + (aFeature->getKind() != "SketchBSplinePeriodic"))) { return Standard_True; } diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 09f2e1437..0fd66fd48 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -122,6 +122,9 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theV gp_Pnt EyePoint(XEye, YEye, ZEye); gp_Pnt AtPoint(XAt, YAt, ZAt); + if (EyePoint.Distance(AtPoint) < Precision::Confusion()) + return gp_Pnt(); + gp_Vec EyeVector(EyePoint, AtPoint); gp_Dir EyeDir(EyeVector); @@ -131,9 +134,8 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theV gp_Pnt ConvertedPoint(X, Y, Z); gp_Pnt2d ConvertedPointOnPlane = ProjLib::Project(PlaneOfTheView, ConvertedPoint); - gp_Pnt ResultPoint = ElSLib::Value(ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(), + return ElSLib::Value(ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(), PlaneOfTheView); - return ResultPoint; } void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, FeaturePtr theSketch, diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 155eb2082..7e690a0f1 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -578,7 +578,8 @@ ObjectPtr XGUI_Displayer::getObject(const Handle(AIS_InteractiveObject)& theIO) if (!theIO.IsNull()) { anAISObj->setImpl(new Handle(AIS_InteractiveObject)(theIO)); } - anObject = myWorkshop->module()->findPresentedObject(anAISObj); + if (myWorkshop->module()) + anObject = myWorkshop->module()->findPresentedObject(anAISObj); } return anObject; }