0023024: Update headers of OCCT files
[occt.git] / src / BRep / BRep_Builder.lxx
CommitLineData
b311480e 1// Created on: 1991-07-02
2// Created by: Remi LEQUETTE
3// Copyright (c) 1991-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
22#include <TopoDS_Face.hxx>
23#include <TopoDS_Vertex.hxx>
24#include <BRep_TFace.hxx>
25#include <BRep_TVertex.hxx>
26#include <BRep_Tool.hxx>
27
28
29//=======================================================================
30//function : MakeFace
31//purpose :
32//=======================================================================
33
34inline void BRep_Builder::MakeFace(TopoDS_Face& F) const
35{
36 Handle(BRep_TFace) TF = new BRep_TFace();
37 MakeShape(F,TF);
38}
39
40
41//=======================================================================
42//function : MakeEdge
43//purpose : make edge from curve
44//=======================================================================
45
46inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
47 const Handle(Geom_Curve)& C,
48 const Standard_Real Tol) const
49{
50 MakeEdge(E);
51 UpdateEdge(E,C,TopLoc_Location(),Tol);
52}
53
54
55//=======================================================================
56//function : MakeEdge
57//purpose : make edge from curve
58//=======================================================================
59
60inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
61 const Handle(Poly_Polygon3D)& P) const
62{
63 MakeEdge(E);
64 UpdateEdge(E,P);
65}
66
67//=======================================================================
68//function : MakeEdge
69//purpose : make edge from triangulation
70//=======================================================================
71
72inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
73 const Handle(Poly_PolygonOnTriangulation)& P,
74 const Handle(Poly_Triangulation)& T) const
75{
76 MakeEdge(E);
77 UpdateEdge(E,P,T,TopLoc_Location());
78}
79
80
81//=======================================================================
82//function : MakeEdge
83//purpose : make edge from triangulation
84//=======================================================================
85
86inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
87 const Handle(Poly_PolygonOnTriangulation)& P,
88 const Handle(Poly_Triangulation)& T,
89 const TopLoc_Location& L) const
90{
91 MakeEdge(E);
92 UpdateEdge(E,P,T,L);
93}
94
95
96//=======================================================================
97//function : MakeEdge
98//purpose : make edge from curve
99//=======================================================================
100
101inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
102 const Handle(Geom_Curve)& C,
103 const TopLoc_Location& L,
104 const Standard_Real Tol) const
105{
106 MakeEdge(E);
107 UpdateEdge(E,C,L,Tol);
108}
109
110
111//=======================================================================
112//function : UpdateEdge
113//purpose :
114//=======================================================================
115
116inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
117 const Handle(Geom_Curve)& C,
118 const Standard_Real Tol) const
119{
120 UpdateEdge(E,C,TopLoc_Location(),Tol);
121}
122
123
124//=======================================================================
125//function : UpdateEdge
126//purpose :
127//=======================================================================
128
129inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
130 const Handle(Geom2d_Curve)& C,
131 const TopoDS_Face& F,
132 const Standard_Real Tol) const
133{
134 TopLoc_Location l;
135 UpdateEdge(E,C,BRep_Tool::Surface(F,l),l,Tol);
136}
137
138
139//=======================================================================
140//function : UpdateEdge
141//purpose :
142//=======================================================================
143
144inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
145 const Handle(Geom2d_Curve)& C1,
146 const Handle(Geom2d_Curve)& C2,
147 const TopoDS_Face& F,
148 const Standard_Real Tol) const
149{
150 TopLoc_Location l;
151 UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol);
152}
153
154
155//=======================================================================
156//function : UpdateEdge
157//purpose :
158//=======================================================================
159
160inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
161 const Handle(Poly_Polygon3D)& P) const
162{
163 UpdateEdge(E,P,TopLoc_Location());
164}
165
166
167//=======================================================================
168//function : UpdateEdge
169//purpose :
170//=======================================================================
171
172inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
173 const Handle(Poly_PolygonOnTriangulation)& P,
174 const Handle(Poly_Triangulation)& T) const
175{
176 UpdateEdge(E,P,T,TopLoc_Location());
177}
178
179
180//=======================================================================
181//function : UpdateEdge
182//purpose :
183//=======================================================================
184
185inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
186 const Handle(Poly_PolygonOnTriangulation)& P1,
187 const Handle(Poly_PolygonOnTriangulation)& P2,
188 const Handle(Poly_Triangulation)& T) const
189{
190 UpdateEdge(E,P1,P2,T,TopLoc_Location());
191}
192
193
194//=======================================================================
195//function : Range
196//purpose :
197//=======================================================================
198
199inline void BRep_Builder::Range(const TopoDS_Edge& E,
200 const TopoDS_Face& F,
201 const Standard_Real First,
202 const Standard_Real Last) const
203{
204 TopLoc_Location l;
205 Range(E,BRep_Tool::Surface(F,l),l,First,Last);
206}
207
208
209//=======================================================================
210//function : MakeVertex
211//purpose : undefined vertex
212//=======================================================================
213
214inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V) const
215{
216 Handle(BRep_TVertex) TV = new BRep_TVertex();
217 MakeShape(V,TV);
218}
219
220
221//=======================================================================
222//function : MakeVertex
223//purpose : vertex from 3d point
224//=======================================================================
225
226inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V,
227 const gp_Pnt& P,
228 const Standard_Real Tol) const
229{
230 MakeVertex(V);
231 UpdateVertex(V,P,Tol);
232}
233
234
235//=======================================================================
236//function : UpdateVertex
237//purpose : update vertex with parameter on edge on face
238//=======================================================================
239
240inline void BRep_Builder::UpdateVertex(const TopoDS_Vertex& V,
241 const Standard_Real Par,
242 const TopoDS_Edge& E,
243 const TopoDS_Face& F,
244 const Standard_Real Tol) const
245{
246 TopLoc_Location l;
247 UpdateVertex(V,Par,E,BRep_Tool::Surface(F,l),l,Tol);
248}