b311480e |
1 | // Created on: 1991-07-02 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
973c2be1 |
8 | // This library is free software; you can redistribute it and / or modify it |
9 | // under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <TopoDS_Face.hxx> |
18 | #include <TopoDS_Vertex.hxx> |
19 | #include <BRep_TFace.hxx> |
20 | #include <BRep_TVertex.hxx> |
21 | #include <BRep_Tool.hxx> |
22 | |
23 | |
24 | //======================================================================= |
25 | //function : MakeFace |
26 | //purpose : |
27 | //======================================================================= |
28 | |
29 | inline void BRep_Builder::MakeFace(TopoDS_Face& F) const |
30 | { |
31 | Handle(BRep_TFace) TF = new BRep_TFace(); |
32 | MakeShape(F,TF); |
33 | } |
34 | |
35 | |
36 | //======================================================================= |
37 | //function : MakeEdge |
38 | //purpose : make edge from curve |
39 | //======================================================================= |
40 | |
41 | inline void BRep_Builder::MakeEdge(TopoDS_Edge& E, |
42 | const Handle(Geom_Curve)& C, |
43 | const Standard_Real Tol) const |
44 | { |
45 | MakeEdge(E); |
46 | UpdateEdge(E,C,TopLoc_Location(),Tol); |
47 | } |
48 | |
49 | |
50 | //======================================================================= |
51 | //function : MakeEdge |
52 | //purpose : make edge from curve |
53 | //======================================================================= |
54 | |
55 | inline void BRep_Builder::MakeEdge(TopoDS_Edge& E, |
56 | const Handle(Poly_Polygon3D)& P) const |
57 | { |
58 | MakeEdge(E); |
59 | UpdateEdge(E,P); |
60 | } |
61 | |
62 | //======================================================================= |
63 | //function : MakeEdge |
64 | //purpose : make edge from triangulation |
65 | //======================================================================= |
66 | |
67 | inline void BRep_Builder::MakeEdge(TopoDS_Edge& E, |
68 | const Handle(Poly_PolygonOnTriangulation)& P, |
69 | const Handle(Poly_Triangulation)& T) const |
70 | { |
71 | MakeEdge(E); |
72 | UpdateEdge(E,P,T,TopLoc_Location()); |
73 | } |
74 | |
75 | |
76 | //======================================================================= |
77 | //function : MakeEdge |
78 | //purpose : make edge from triangulation |
79 | //======================================================================= |
80 | |
81 | inline void BRep_Builder::MakeEdge(TopoDS_Edge& E, |
82 | const Handle(Poly_PolygonOnTriangulation)& P, |
83 | const Handle(Poly_Triangulation)& T, |
84 | const TopLoc_Location& L) const |
85 | { |
86 | MakeEdge(E); |
87 | UpdateEdge(E,P,T,L); |
88 | } |
89 | |
90 | |
91 | //======================================================================= |
92 | //function : MakeEdge |
93 | //purpose : make edge from curve |
94 | //======================================================================= |
95 | |
96 | inline void BRep_Builder::MakeEdge(TopoDS_Edge& E, |
97 | const Handle(Geom_Curve)& C, |
98 | const TopLoc_Location& L, |
99 | const Standard_Real Tol) const |
100 | { |
101 | MakeEdge(E); |
102 | UpdateEdge(E,C,L,Tol); |
103 | } |
104 | |
105 | |
106 | //======================================================================= |
107 | //function : UpdateEdge |
108 | //purpose : |
109 | //======================================================================= |
110 | |
111 | inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, |
112 | const Handle(Geom_Curve)& C, |
113 | const Standard_Real Tol) const |
114 | { |
115 | UpdateEdge(E,C,TopLoc_Location(),Tol); |
116 | } |
117 | |
118 | |
119 | //======================================================================= |
120 | //function : UpdateEdge |
121 | //purpose : |
122 | //======================================================================= |
123 | |
124 | inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, |
125 | const Handle(Geom2d_Curve)& C, |
126 | const TopoDS_Face& F, |
127 | const Standard_Real Tol) const |
128 | { |
129 | TopLoc_Location l; |
130 | UpdateEdge(E,C,BRep_Tool::Surface(F,l),l,Tol); |
131 | } |
132 | |
133 | |
134 | //======================================================================= |
135 | //function : UpdateEdge |
136 | //purpose : |
137 | //======================================================================= |
138 | |
139 | inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, |
140 | const Handle(Geom2d_Curve)& C1, |
141 | const Handle(Geom2d_Curve)& C2, |
142 | const TopoDS_Face& F, |
143 | const Standard_Real Tol) const |
144 | { |
145 | TopLoc_Location l; |
146 | UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol); |
147 | } |
148 | |
149 | |
150 | //======================================================================= |
151 | //function : UpdateEdge |
152 | //purpose : |
153 | //======================================================================= |
154 | |
155 | inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, |
156 | const Handle(Poly_Polygon3D)& P) const |
157 | { |
158 | UpdateEdge(E,P,TopLoc_Location()); |
159 | } |
160 | |
161 | |
162 | //======================================================================= |
163 | //function : UpdateEdge |
164 | //purpose : |
165 | //======================================================================= |
166 | |
167 | inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, |
168 | const Handle(Poly_PolygonOnTriangulation)& P, |
169 | const Handle(Poly_Triangulation)& T) const |
170 | { |
171 | UpdateEdge(E,P,T,TopLoc_Location()); |
172 | } |
173 | |
174 | |
175 | //======================================================================= |
176 | //function : UpdateEdge |
177 | //purpose : |
178 | //======================================================================= |
179 | |
180 | inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, |
181 | const Handle(Poly_PolygonOnTriangulation)& P1, |
182 | const Handle(Poly_PolygonOnTriangulation)& P2, |
183 | const Handle(Poly_Triangulation)& T) const |
184 | { |
185 | UpdateEdge(E,P1,P2,T,TopLoc_Location()); |
186 | } |
187 | |
188 | |
189 | //======================================================================= |
190 | //function : Range |
191 | //purpose : |
192 | //======================================================================= |
193 | |
194 | inline void BRep_Builder::Range(const TopoDS_Edge& E, |
195 | const TopoDS_Face& F, |
196 | const Standard_Real First, |
197 | const Standard_Real Last) const |
198 | { |
199 | TopLoc_Location l; |
200 | Range(E,BRep_Tool::Surface(F,l),l,First,Last); |
201 | } |
202 | |
203 | |
204 | //======================================================================= |
205 | //function : MakeVertex |
206 | //purpose : undefined vertex |
207 | //======================================================================= |
208 | |
209 | inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V) const |
210 | { |
211 | Handle(BRep_TVertex) TV = new BRep_TVertex(); |
212 | MakeShape(V,TV); |
213 | } |
214 | |
215 | |
216 | //======================================================================= |
217 | //function : MakeVertex |
218 | //purpose : vertex from 3d point |
219 | //======================================================================= |
220 | |
221 | inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V, |
222 | const gp_Pnt& P, |
223 | const Standard_Real Tol) const |
224 | { |
225 | MakeVertex(V); |
226 | UpdateVertex(V,P,Tol); |
227 | } |
228 | |
229 | |
230 | //======================================================================= |
231 | //function : UpdateVertex |
232 | //purpose : update vertex with parameter on edge on face |
233 | //======================================================================= |
234 | |
235 | inline void BRep_Builder::UpdateVertex(const TopoDS_Vertex& V, |
236 | const Standard_Real Par, |
237 | const TopoDS_Edge& E, |
238 | const TopoDS_Face& F, |
239 | const Standard_Real Tol) const |
240 | { |
241 | TopLoc_Location l; |
242 | UpdateVertex(V,Par,E,BRep_Tool::Surface(F,l),l,Tol); |
243 | } |