1 // Created on: 1993-07-06
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepBuilderAPI_MakeEdge2d_HeaderFile
18 #define _BRepBuilderAPI_MakeEdge2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepLib_MakeEdge2d.hxx>
25 #include <BRepBuilderAPI_MakeShape.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <BRepBuilderAPI_EdgeError.hxx>
29 class StdFail_NotDone;
41 //! Provides methods to build edges.
43 //! The methods have the following syntax, where
44 //! TheCurve is one of Lin2d, Circ2d, ...
46 //! Create(C : TheCurve)
48 //! Makes an edge on the whole curve. Add vertices
51 //! Create(C : TheCurve; p1,p2 : Real)
53 //! Make an edge on the curve between parameters p1
54 //! and p2. if p2 < p1 the edge will be REVERSED. If
55 //! p1 or p2 is infinite the curve will be open in
56 //! that direction. Vertices are created for finite
57 //! values of p1 and p2.
59 //! Create(C : TheCurve; P1, P2 : Pnt2d from gp)
61 //! Make an edge on the curve between the points P1
62 //! and P2. The points are projected on the curve
63 //! and the previous method is used. An error is
64 //! raised if the points are not on the curve.
66 //! Create(C : TheCurve; V1, V2 : Vertex from TopoDS)
68 //! Make an edge on the curve between the vertices
69 //! V1 and V2. Same as the previous but no vertices
70 //! are created. If a vertex is Null the curve will
71 //! be open in this direction.
72 class BRepBuilderAPI_MakeEdge2d : public BRepBuilderAPI_MakeShape
79 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
81 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
83 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L);
85 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const Standard_Real p1, const Standard_Real p2);
87 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
89 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
91 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L);
93 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const Standard_Real p1, const Standard_Real p2);
95 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
97 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
99 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L);
101 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const Standard_Real p1, const Standard_Real p2);
103 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
105 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
107 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L);
109 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const Standard_Real p1, const Standard_Real p2);
111 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
113 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
115 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L);
117 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const Standard_Real p1, const Standard_Real p2);
119 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
121 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
123 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L);
125 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const Standard_Real p1, const Standard_Real p2);
127 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
129 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
131 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Real p1, const Standard_Real p2);
133 Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
135 Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C);
137 Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Standard_Real p1, const Standard_Real p2);
139 Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
141 Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
143 Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Real p1, const Standard_Real p2);
145 Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
147 Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
149 //! Returns the error description when NotDone.
150 Standard_EXPORT BRepBuilderAPI_EdgeError Error() const;
152 Standard_EXPORT const TopoDS_Edge& Edge() const;
153 Standard_EXPORT operator TopoDS_Edge() const;
155 //! Returns the first vertex of the edge. May be Null.
156 Standard_EXPORT const TopoDS_Vertex& Vertex1() const;
158 //! Returns the second vertex of the edge. May be Null.
159 Standard_EXPORT const TopoDS_Vertex& Vertex2() const;
174 BRepLib_MakeEdge2d myMakeEdge2d;
185 #endif // _BRepBuilderAPI_MakeEdge2d_HeaderFile