]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #17347(Tuleap) Do not select a point from periodic B-spline
authorvsv <vsv@opencascade.com>
Wed, 11 Mar 2020 13:31:23 +0000 (16:31 +0300)
committervsv <vsv@opencascade.com>
Wed, 11 Mar 2020 13:31:49 +0000 (16:31 +0300)
src/PartSet/PartSet_Filters.cpp
src/PartSet/PartSet_Tools.cpp
src/XGUI/XGUI_Displayer.cpp

index a602a31c9372ca676d72f6cf4e53d4dc58e09360..c335ea9324fce8462dac1885107c1005cce0a357 100644 (file)
@@ -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;
   }
 
index 09f2e143726776d661a379a62fd906eacffb590c..0fd66fd4813b96434be19e44642b4e437e5f0054 100644 (file)
@@ -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,
index 155eb2082991273500660f3737bc0ba33c0f545d..7e690a0f1d1acf6a414c13d839b025026c5ce885 100644 (file)
@@ -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;
 }