0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_MakeEdge2d.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepBuilderAPI_MakeEdge2d_HeaderFile
18 #define _BRepBuilderAPI_MakeEdge2d_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
30 class TopoDS_Vertex;
31 class gp_Pnt2d;
32 class gp_Lin2d;
33 class gp_Circ2d;
34 class gp_Elips2d;
35 class gp_Hypr2d;
36 class gp_Parab2d;
37 class Geom2d_Curve;
38 class TopoDS_Edge;
39
40
41 //! Provides methods to build edges.
42 //!
43 //! The   methods have  the  following   syntax, where
44 //! TheCurve is one of Lin2d, Circ2d, ...
45 //!
46 //! Create(C : TheCurve)
47 //!
48 //! Makes an edge on  the whole curve.  Add vertices
49 //! on finite curves.
50 //!
51 //! Create(C : TheCurve; p1,p2 : Real)
52 //!
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.
58 //!
59 //! Create(C : TheCurve; P1, P2 : Pnt2d from gp)
60 //!
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.
65 //!
66 //! Create(C : TheCurve; V1, V2 : Vertex from TopoDS)
67 //!
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
73 {
74 public:
75
76   DEFINE_STANDARD_ALLOC
77
78   
79   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
80   
81   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
82   
83   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L);
84   
85   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const Standard_Real p1, const Standard_Real p2);
86   
87   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
88   
89   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
90   
91   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L);
92   
93   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const Standard_Real p1, const Standard_Real p2);
94   
95   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
96   
97   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
98   
99   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L);
100   
101   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const Standard_Real p1, const Standard_Real p2);
102   
103   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
104   
105   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
106   
107   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L);
108   
109   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const Standard_Real p1, const Standard_Real p2);
110   
111   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
112   
113   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
114   
115   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L);
116   
117   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const Standard_Real p1, const Standard_Real p2);
118   
119   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
120   
121   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
122   
123   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L);
124   
125   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const Standard_Real p1, const Standard_Real p2);
126   
127   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
128   
129   Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
130   
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);
132   
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);
134   
135   Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C);
136   
137   Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Standard_Real p1, const Standard_Real p2);
138   
139   Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
140   
141   Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
142   
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);
144   
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);
146   
147   Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
148   
149   //! Returns the error description when NotDone.
150   Standard_EXPORT BRepBuilderAPI_EdgeError Error() const;
151   
152   Standard_EXPORT const TopoDS_Edge& Edge();
153   Standard_EXPORT operator TopoDS_Edge();
154   
155   //! Returns the first vertex of the edge. May be Null.
156   Standard_EXPORT const TopoDS_Vertex& Vertex1() const;
157   
158   //! Returns the second vertex of the edge. May be Null.
159   Standard_EXPORT const TopoDS_Vertex& Vertex2() const;
160
161
162
163
164 protected:
165
166
167
168
169
170 private:
171
172
173
174   BRepLib_MakeEdge2d myMakeEdge2d;
175
176
177 };
178
179
180
181
182
183
184
185 #endif // _BRepBuilderAPI_MakeEdge2d_HeaderFile