1 // Copyright (C) 2017-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Circ2dBuilder.h
4 // Created: 3 April 2017
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAlgoAPI_Circ2dBuilder_H_
8 #define GeomAlgoAPI_Circ2dBuilder_H_
10 #include <GeomAlgoAPI.h>
20 /// \class GeomAlgoAPI_Circ2dBuilder
22 /// \brief Creates circle in 2D space satisfying combination of the following constraints:
23 /// * center of a circle
24 /// * passing through the point
25 /// * tangent to a curve
27 class GeomAlgoAPI_Circ2dBuilder
30 /// \brief Create a builder object.
31 /// Constraints should be applied separately.
32 /// \param thePlane [in] plane to project tangent curves
34 GeomAlgoAPI_Circ2dBuilder(const std::shared_ptr<GeomAPI_Ax3>& thePlane);
36 /// \brief Set fixed radius of the circle
38 void setRadius(const double theRadius);
40 /// \brief Set fixed center of the circle
42 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter);
44 /// \brief Constrain circle to be tangent to the given edge
46 void addTangentCurve(const std::shared_ptr<GeomAPI_Shape>& theEdge);
48 /// \brief Constrain circle to pass through the given point
50 void addPassingPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
52 /// \brief Optional constraint to find circle closest to the given point
54 void setClosestPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
56 /// \brief Build circle
58 std::shared_ptr<GeomAPI_Circ2d> circle();
60 /// \brief Create a circle passing through three points
62 static std::shared_ptr<GeomAPI_Circ2d>
63 circle(const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
64 const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint,
65 const std::shared_ptr<GeomAPI_Pnt2d>& theThirdPoint);
68 std::shared_ptr<GeomAPI_Ax3> myPlane;
69 std::shared_ptr<GeomAPI_Pnt2d> myCenter;
70 std::vector< std::shared_ptr<GeomAPI_Pnt2d> > myPassingPoints;
71 std::vector< std::shared_ptr<GeomAPI_Shape> > myTangentShapes;
72 std::shared_ptr<GeomAPI_Pnt2d> myClosestPoint;