1 // Created on: 1992-03-12
2 // Created by: Philippe DAUTRY
3 // Copyright (c) 1992-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 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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepPrim_Builder_HeaderFile
18 #define _BRepPrim_Builder_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRep_Builder.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Boolean.hxx>
41 //! implements the abstract Builder with the BRep Builder
42 class BRepPrim_Builder
49 //! Creates an empty, useless Builder. Necesseray for
51 Standard_EXPORT BRepPrim_Builder();
53 //! Creates from a Builder.
54 Standard_EXPORT BRepPrim_Builder(const BRep_Builder& B);
56 const BRep_Builder& Builder() const;
58 //! Make a empty Shell.
59 Standard_EXPORT void MakeShell (TopoDS_Shell& S) const;
61 //! Returns in <F> a Face built with the plane
62 //! equation <P>. Used by all primitives.
63 Standard_EXPORT void MakeFace (TopoDS_Face& F, const gp_Pln& P) const;
65 //! Returns in <W> an empty Wire.
66 Standard_EXPORT void MakeWire (TopoDS_Wire& W) const;
68 //! Returns in <E> a degenerated edge.
69 Standard_EXPORT void MakeDegeneratedEdge (TopoDS_Edge& E) const;
71 //! Returns in <E> an Edge built with the line
73 Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Lin& L) const;
75 //! Returns in <E> an Edge built with the circle
77 Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Circ& C) const;
79 //! Sets the line <L> to be the curve representing the
80 //! edge <E> in the parametric space of the surface of
82 Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L) const;
84 //! Sets the lines <L1,L2> to be the curves
85 //! representing the edge <E> in the parametric space
86 //! of the closed surface of <F>.
87 Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L1, const gp_Lin2d& L2) const;
89 //! Sets the circle <C> to be the curve representing
90 //! the edge <E> in the parametric space of the
92 Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Circ2d& C) const;
94 //! Returns in <V> a Vertex built with the point <P>.
95 Standard_EXPORT void MakeVertex (TopoDS_Vertex& V, const gp_Pnt& P) const;
97 //! Reverses the Face <F>.
98 Standard_EXPORT void ReverseFace (TopoDS_Face& F) const;
100 //! Adds the Vertex <V> in the Edge <E>. <P> is the
101 //! parameter of the vertex on the edge. If direct
102 //! is False the Vertex is reversed.
103 Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P, const Standard_Boolean direct) const;
105 //! Adds the Vertex <V> in the Edge <E>. <P1,P2>
106 //! are the parameters of the vertex on the closed
108 Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const;
110 //! <P1,P2> are the parameters of the vertex on the
111 //! edge. The edge is a closed curve.
112 Standard_EXPORT void SetParameters (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const;
114 //! Adds the Edge <E> in the Wire <W>, if direct is
115 //! False the Edge is reversed.
116 Standard_EXPORT void AddWireEdge (TopoDS_Wire& W, const TopoDS_Edge& E, const Standard_Boolean direct) const;
118 //! Adds the Wire <W> in the Face <F>.
119 Standard_EXPORT void AddFaceWire (TopoDS_Face& F, const TopoDS_Wire& W) const;
121 //! Adds the Face <F> in the Shell <Sh>.
122 Standard_EXPORT void AddShellFace (TopoDS_Shell& Sh, const TopoDS_Face& F) const;
124 //! This is called once an edge is completed. It gives
125 //! the opportunity to perform any post treatment.
126 Standard_EXPORT void CompleteEdge (TopoDS_Edge& E) const;
128 //! This is called once a wire is completed. It gives
129 //! the opportunity to perform any post treatment.
130 Standard_EXPORT void CompleteWire (TopoDS_Wire& W) const;
132 //! This is called once a face is completed. It gives
133 //! the opportunity to perform any post treatment.
134 Standard_EXPORT void CompleteFace (TopoDS_Face& F) const;
136 //! This is called once a shell is completed. It gives
137 //! the opportunity to perform any post treatment.
138 Standard_EXPORT void CompleteShell (TopoDS_Shell& S) const;
153 BRep_Builder myBuilder;
159 #include <BRepPrim_Builder.lxx>
165 #endif // _BRepPrim_Builder_HeaderFile