X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FPlaneGCSSolver%2FPlaneGCSSolver_EdgeWrapper.cpp;h=b6c408bb0bba10df6b30c72050ea16e246f00061;hb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;hp=f9683203880051e28acbc8a99d0e71ef8d4cf014;hpb=3c987a8d1b88765224e3ac1388afb91eae17e4d3;p=modules%2Fshaper.git diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp index f96832038..b6c408bb0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -20,45 +20,28 @@ #include #include -static bool isLine(const GCSCurvePtr& theEntity) +template +static bool isCurve(const GCSCurvePtr& theEntity) { - return std::dynamic_pointer_cast(theEntity).get(); -} - -static bool isCircle(const GCSCurvePtr& theEntity) -{ - return std::dynamic_pointer_cast(theEntity).get(); -} - -static bool isArc(const GCSCurvePtr& theEntity) -{ - return std::dynamic_pointer_cast(theEntity).get(); -} - -static bool isEllipse(const GCSCurvePtr& theEntity) -{ - return std::dynamic_pointer_cast(theEntity).get(); -} - -static bool isEllipticArc(const GCSCurvePtr& theEntity) -{ - return std::dynamic_pointer_cast(theEntity).get(); + return std::dynamic_pointer_cast(theEntity).get(); } PlaneGCSSolver_EdgeWrapper::PlaneGCSSolver_EdgeWrapper(const GCSCurvePtr theEntity) : myEntity(theEntity) { - if (isLine(myEntity)) + if (isCurve(myEntity)) myType = ENTITY_LINE; - else if (isArc(myEntity)) + else if (isCurve(myEntity)) myType = ENTITY_ARC; - else if (isCircle(myEntity)) + else if (isCurve(myEntity)) myType = ENTITY_CIRCLE; - else if (isEllipticArc(myEntity)) + else if (isCurve(myEntity)) myType = ENTITY_ELLIPTIC_ARC; - else if (isEllipse(myEntity)) + else if (isCurve(myEntity)) myType = ENTITY_ELLIPSE; + else if (isCurve(myEntity)) + myType = ENTITY_BSPLINE; } static double squareDistance(const GCS::Point& theP1, const GCS::Point& theP2)