1 // Created on: 1991-07-02
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1991-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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
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>
24 //=======================================================================
27 //=======================================================================
29 inline void BRep_Builder::MakeFace(TopoDS_Face& F) const
31 Handle(BRep_TFace) TF = new BRep_TFace();
36 //=======================================================================
38 //purpose : make edge from curve
39 //=======================================================================
41 inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
42 const Handle(Geom_Curve)& C,
43 const Standard_Real Tol) const
46 UpdateEdge(E,C,TopLoc_Location(),Tol);
50 //=======================================================================
52 //purpose : make edge from curve
53 //=======================================================================
55 inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
56 const Handle(Poly_Polygon3D)& P) const
62 //=======================================================================
64 //purpose : make edge from triangulation
65 //=======================================================================
67 inline void BRep_Builder::MakeEdge(TopoDS_Edge& E,
68 const Handle(Poly_PolygonOnTriangulation)& P,
69 const Handle(Poly_Triangulation)& T) const
72 UpdateEdge(E,P,T,TopLoc_Location());
76 //=======================================================================
78 //purpose : make edge from triangulation
79 //=======================================================================
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
91 //=======================================================================
93 //purpose : make edge from curve
94 //=======================================================================
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
102 UpdateEdge(E,C,L,Tol);
106 //=======================================================================
107 //function : UpdateEdge
109 //=======================================================================
111 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
112 const Handle(Geom_Curve)& C,
113 const Standard_Real Tol) const
115 UpdateEdge(E,C,TopLoc_Location(),Tol);
119 //=======================================================================
120 //function : UpdateEdge
122 //=======================================================================
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
130 UpdateEdge(E,C,BRep_Tool::Surface(F,l),l,Tol);
134 //=======================================================================
135 //function : UpdateEdge
137 //=======================================================================
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
146 UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol);
150 //=======================================================================
151 //function : UpdateEdge
153 //=======================================================================
155 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
156 const Handle(Poly_Polygon3D)& P) const
158 UpdateEdge(E,P,TopLoc_Location());
162 //=======================================================================
163 //function : UpdateEdge
165 //=======================================================================
167 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
168 const Handle(Poly_PolygonOnTriangulation)& P,
169 const Handle(Poly_Triangulation)& T) const
171 UpdateEdge(E,P,T,TopLoc_Location());
175 //=======================================================================
176 //function : UpdateEdge
178 //=======================================================================
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
185 UpdateEdge(E,P1,P2,T,TopLoc_Location());
189 //=======================================================================
192 //=======================================================================
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
200 Range(E,BRep_Tool::Surface(F,l),l,First,Last);
204 //=======================================================================
205 //function : MakeVertex
206 //purpose : undefined vertex
207 //=======================================================================
209 inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V) const
211 Handle(BRep_TVertex) TV = new BRep_TVertex();
216 //=======================================================================
217 //function : MakeVertex
218 //purpose : vertex from 3d point
219 //=======================================================================
221 inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V,
223 const Standard_Real Tol) const
226 UpdateVertex(V,P,Tol);
230 //=======================================================================
231 //function : UpdateVertex
232 //purpose : update vertex with parameter on edge on face
233 //=======================================================================
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
242 UpdateVertex(V,Par,E,BRep_Tool::Surface(F,l),l,Tol);