SHAPER 9.16.0
GeomAlgoAPI_Circ2dBuilder.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef GeomAlgoAPI_Circ2dBuilder_H_
21#define GeomAlgoAPI_Circ2dBuilder_H_
22
23#include <GeomAlgoAPI.h>
24
25#include <memory>
26#include <vector>
27
28class GeomAPI_Ax3;
29class GeomAPI_Circ2d;
30class GeomAPI_Pnt2d;
31class GeomAPI_Shape;
32
41{
42public:
46 GEOMALGOAPI_EXPORT
47 GeomAlgoAPI_Circ2dBuilder(const std::shared_ptr<GeomAPI_Ax3>& thePlane);
48
50 GEOMALGOAPI_EXPORT
51 void setRadius(const double theRadius);
52
54 GEOMALGOAPI_EXPORT
55 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter);
56
58 GEOMALGOAPI_EXPORT
59 void addTangentCurve(const std::shared_ptr<GeomAPI_Shape>& theEdge);
60
62 GEOMALGOAPI_EXPORT
63 void setTransversalLine(const std::shared_ptr<GeomAPI_Shape>& theEdge);
64
66 GEOMALGOAPI_EXPORT
67 void addPassingPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
68
70 GEOMALGOAPI_EXPORT
71 void setClosestPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
72
74 GEOMALGOAPI_EXPORT
75 std::shared_ptr<GeomAPI_Circ2d> circle();
76
78 GEOMALGOAPI_EXPORT
79 static std::shared_ptr<GeomAPI_Circ2d>
80 circle(const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
81 const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint,
82 const std::shared_ptr<GeomAPI_Pnt2d>& theThirdPoint);
83
84private:
85 std::shared_ptr<GeomAPI_Ax3> myPlane;
86 std::shared_ptr<GeomAPI_Pnt2d> myCenter;
87 std::vector< std::shared_ptr<GeomAPI_Pnt2d> > myPassingPoints;
88 std::vector< std::shared_ptr<GeomAPI_Shape> > myTangentShapes;
89 std::shared_ptr<GeomAPI_Shape> myTransversalLine;
90 std::shared_ptr<GeomAPI_Pnt2d> myClosestPoint;
91 double myRadius;
92};
93
94#endif
The class represents a coordinate plane which is 2d plane with X and Y directions and origin.
Definition: GeomAPI_Ax3.h:33
Circle in 2D.
Definition: GeomAPI_Circ2d.h:37
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Interface to the topological shape object.
Definition: GeomAPI_Shape.h:43
Creates circle in 2D space satisfying combination of the following constraints:
Definition: GeomAlgoAPI_Circ2dBuilder.h:41
GEOMALGOAPI_EXPORT void setRadius(const double theRadius)
Set fixed radius of the circle.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:520
GEOMALGOAPI_EXPORT GeomAlgoAPI_Circ2dBuilder(const std::shared_ptr< GeomAPI_Ax3 > &thePlane)
Create a builder object.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:514
GEOMALGOAPI_EXPORT void setTransversalLine(const std::shared_ptr< GeomAPI_Shape > &theEdge)
Constrain circle to be orthogonal to the given edge.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:536
GEOMALGOAPI_EXPORT void setCenter(const std::shared_ptr< GeomAPI_Pnt2d > &theCenter)
Set fixed center of the circle.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:525
GEOMALGOAPI_EXPORT void setClosestPoint(const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
Optional constraint to find circle closest to the given point.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:547
GEOMALGOAPI_EXPORT void addPassingPoint(const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
Constrain circle to pass through the given point.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:542
GEOMALGOAPI_EXPORT std::shared_ptr< GeomAPI_Circ2d > circle()
Build circle.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:566
GEOMALGOAPI_EXPORT void addTangentCurve(const std::shared_ptr< GeomAPI_Shape > &theEdge)
Constrain circle to be tangent to the given edge.
Definition: GeomAlgoAPI_Circ2dBuilder.cpp:530