Salome HOME
Issue #2079 : Select parent feature for default Constructions. Disable popup menu...
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintTangent.cpp
index 791de4cc2f3d470cbf1fd8ab32061bc49da1e028..1c42ac69af7fdceca28e1eeb1f3de71e094165e1 100644 (file)
@@ -279,7 +279,7 @@ static void adjustAngleBetweenCurves(const GCSCurvePtr& theCurve1,
                                      const GCSPointPtr& thePoint,
                                      double*            theAngle)
 {
-  double anAngle = GCS::System::calculateAngleViaPoint(*theCurve1, *theCurve2, *thePoint);
+  double anAngle = GCS::System().calculateAngleViaPoint(*theCurve1, *theCurve2, *thePoint);
   // bring angle to [-pi..pi]
   if (anAngle >  PI) anAngle -= 2.0 * PI;
   if (anAngle < -PI) anAngle += 2.0 * PI;
@@ -307,12 +307,13 @@ ConstraintWrapperPtr createArcLineTangency(EntityWrapperPtr theEntity1,
 
   std::shared_ptr<GCS::Circle> aCirc =
       std::dynamic_pointer_cast<GCS::Circle>(anEntCirc->entity());
+  std::shared_ptr<GCS::Arc> anArc = std::dynamic_pointer_cast<GCS::Arc>(aCirc);
+
   std::shared_ptr<GCS::Line> aLine =
       std::dynamic_pointer_cast<GCS::Line>(anEntLine->entity());
 
   GCSConstraintPtr aNewConstr;
-  if (theSharedPoint) {
-    std::shared_ptr<GCS::Arc> anArc = std::dynamic_pointer_cast<GCS::Arc>(aCirc);
+  if (theSharedPoint && anArc) { // do not process shared point between circle and line
     GCSPointPtr aPoint =
         std::dynamic_pointer_cast<PlaneGCSSolver_PointWrapper>(theSharedPoint)->point();