42cf5bc1 |
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 _BRepLib_MakeEdge_HeaderFile |
18 | #define _BRepLib_MakeEdge_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRepLib_EdgeError.hxx> |
25 | #include <TopoDS_Vertex.hxx> |
26 | #include <BRepLib_MakeShape.hxx> |
27 | #include <Standard_Real.hxx> |
28 | class StdFail_NotDone; |
29 | class TopoDS_Vertex; |
30 | class gp_Pnt; |
31 | class gp_Lin; |
32 | class gp_Circ; |
33 | class gp_Elips; |
34 | class gp_Hypr; |
35 | class gp_Parab; |
36 | class Geom_Curve; |
37 | class Geom2d_Curve; |
38 | class Geom_Surface; |
39 | class TopoDS_Edge; |
40 | |
41 | |
42 | //! Provides methods to build edges. |
43 | //! |
44 | //! The methods have the following syntax, where |
45 | //! TheCurve is one of Lin, Circ, ... |
46 | //! |
47 | //! Create(C : TheCurve) |
48 | //! |
49 | //! Makes an edge on the whole curve. Add vertices |
50 | //! on finite curves. |
51 | //! |
52 | //! Create(C : TheCurve; p1,p2 : Real) |
53 | //! |
54 | //! Make an edge on the curve between parameters p1 |
55 | //! and p2. if p2 < p1 the edge will be REVERSED. If |
56 | //! p1 or p2 is infinite the curve will be open in |
57 | //! that direction. Vertices are created for finite |
58 | //! values of p1 and p2. |
59 | //! |
60 | //! Create(C : TheCurve; P1, P2 : Pnt from gp) |
61 | //! |
62 | //! Make an edge on the curve between the points P1 |
63 | //! and P2. The points are projected on the curve |
64 | //! and the previous method is used. An error is |
65 | //! raised if the points are not on the curve. |
66 | //! |
67 | //! Create(C : TheCurve; V1, V2 : Vertex from TopoDS) |
68 | //! |
69 | //! Make an edge on the curve between the vertices |
70 | //! V1 and V2. Same as the previous but no vertices |
71 | //! are created. If a vertex is Null the curve will |
72 | //! be open in this direction. |
73 | class BRepLib_MakeEdge : public BRepLib_MakeShape |
74 | { |
75 | public: |
76 | |
77 | DEFINE_STANDARD_ALLOC |
78 | |
79 | |
80 | Standard_EXPORT BRepLib_MakeEdge(); |
81 | |
82 | Standard_EXPORT BRepLib_MakeEdge(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
83 | |
84 | Standard_EXPORT BRepLib_MakeEdge(const gp_Pnt& P1, const gp_Pnt& P2); |
85 | |
86 | Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L); |
87 | |
88 | Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const Standard_Real p1, const Standard_Real p2); |
89 | |
90 | Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const gp_Pnt& P1, const gp_Pnt& P2); |
91 | |
92 | Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
93 | |
94 | Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L); |
95 | |
96 | Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const Standard_Real p1, const Standard_Real p2); |
97 | |
98 | Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const gp_Pnt& P1, const gp_Pnt& P2); |
99 | |
100 | Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
101 | |
102 | Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L); |
103 | |
104 | Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const Standard_Real p1, const Standard_Real p2); |
105 | |
106 | Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const gp_Pnt& P1, const gp_Pnt& P2); |
107 | |
108 | Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
109 | |
110 | Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L); |
111 | |
112 | Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const Standard_Real p1, const Standard_Real p2); |
113 | |
114 | Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const gp_Pnt& P1, const gp_Pnt& P2); |
115 | |
116 | Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
117 | |
118 | Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L); |
119 | |
120 | Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const Standard_Real p1, const Standard_Real p2); |
121 | |
122 | Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const gp_Pnt& P1, const gp_Pnt& P2); |
123 | |
124 | Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
125 | |
126 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L); |
127 | |
128 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const Standard_Real p1, const Standard_Real p2); |
129 | |
130 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2); |
131 | |
132 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
133 | |
134 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2); |
135 | |
136 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2); |
137 | |
138 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S); |
139 | |
140 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const Standard_Real p1, const Standard_Real p2); |
141 | |
142 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2); |
143 | |
144 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
145 | |
146 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2); |
147 | |
148 | Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2); |
149 | |
150 | Standard_EXPORT void Init (const Handle(Geom_Curve)& C); |
151 | |
152 | Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const Standard_Real p1, const Standard_Real p2); |
153 | |
154 | Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const gp_Pnt& P1, const gp_Pnt& P2); |
155 | |
156 | Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
157 | |
158 | Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2); |
159 | |
160 | Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2); |
161 | |
162 | Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S); |
163 | |
164 | Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const Standard_Real p1, const Standard_Real p2); |
165 | |
166 | Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2); |
167 | |
168 | Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2); |
169 | |
170 | Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2); |
171 | |
172 | Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2); |
173 | |
174 | //! Returns the error description when NotDone. |
175 | Standard_EXPORT BRepLib_EdgeError Error() const; |
176 | |
ecac41a9 |
177 | Standard_EXPORT const TopoDS_Edge& Edge(); |
178 | Standard_EXPORT operator TopoDS_Edge(); |
42cf5bc1 |
179 | |
180 | //! Returns the first vertex of the edge. May be Null. |
181 | Standard_EXPORT const TopoDS_Vertex& Vertex1() const; |
182 | |
183 | //! Returns the second vertex of the edge. May be Null. |
184 | Standard_EXPORT const TopoDS_Vertex& Vertex2() const; |
185 | |
186 | |
187 | |
188 | |
189 | protected: |
190 | |
191 | |
192 | |
193 | |
194 | |
195 | private: |
196 | |
197 | |
198 | |
199 | BRepLib_EdgeError myError; |
200 | TopoDS_Vertex myVertex1; |
201 | TopoDS_Vertex myVertex2; |
202 | |
203 | |
204 | }; |
205 | |
206 | |
207 | |
208 | |
209 | |
210 | |
211 | |
212 | #endif // _BRepLib_MakeEdge_HeaderFile |