42cf5bc1 |
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 |
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 _BRepPrim_Builder_HeaderFile |
18 | #define _BRepPrim_Builder_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRep_Builder.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
42cf5bc1 |
27 | class TopoDS_Shell; |
28 | class TopoDS_Face; |
29 | class gp_Pln; |
30 | class TopoDS_Wire; |
31 | class TopoDS_Edge; |
32 | class gp_Lin; |
33 | class gp_Circ; |
34 | class gp_Lin2d; |
35 | class gp_Circ2d; |
36 | class TopoDS_Vertex; |
37 | class gp_Pnt; |
38 | |
39 | |
40 | //! implements the abstract Builder with the BRep Builder |
41 | class BRepPrim_Builder |
42 | { |
43 | public: |
44 | |
45 | DEFINE_STANDARD_ALLOC |
46 | |
47 | |
48 | //! Creates an empty, useless Builder. Necesseray for |
49 | //! compilation. |
50 | Standard_EXPORT BRepPrim_Builder(); |
51 | |
52 | //! Creates from a Builder. |
53 | Standard_EXPORT BRepPrim_Builder(const BRep_Builder& B); |
54 | |
55 | const BRep_Builder& Builder() const; |
56 | |
57 | //! Make a empty Shell. |
58 | Standard_EXPORT void MakeShell (TopoDS_Shell& S) const; |
59 | |
60 | //! Returns in <F> a Face built with the plane |
61 | //! equation <P>. Used by all primitives. |
62 | Standard_EXPORT void MakeFace (TopoDS_Face& F, const gp_Pln& P) const; |
63 | |
64 | //! Returns in <W> an empty Wire. |
65 | Standard_EXPORT void MakeWire (TopoDS_Wire& W) const; |
66 | |
67 | //! Returns in <E> a degenerated edge. |
68 | Standard_EXPORT void MakeDegeneratedEdge (TopoDS_Edge& E) const; |
69 | |
70 | //! Returns in <E> an Edge built with the line |
71 | //! equation <L>. |
72 | Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Lin& L) const; |
73 | |
74 | //! Returns in <E> an Edge built with the circle |
75 | //! equation <C>. |
76 | Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Circ& C) const; |
77 | |
78 | //! Sets the line <L> to be the curve representing the |
79 | //! edge <E> in the parametric space of the surface of |
80 | //! <F>. |
81 | Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L) const; |
82 | |
83 | //! Sets the lines <L1,L2> to be the curves |
84 | //! representing the edge <E> in the parametric space |
85 | //! of the closed surface of <F>. |
86 | Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L1, const gp_Lin2d& L2) const; |
87 | |
88 | //! Sets the circle <C> to be the curve representing |
89 | //! the edge <E> in the parametric space of the |
90 | //! surface of <F>. |
91 | Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Circ2d& C) const; |
92 | |
93 | //! Returns in <V> a Vertex built with the point <P>. |
94 | Standard_EXPORT void MakeVertex (TopoDS_Vertex& V, const gp_Pnt& P) const; |
95 | |
96 | //! Reverses the Face <F>. |
97 | Standard_EXPORT void ReverseFace (TopoDS_Face& F) const; |
98 | |
99 | //! Adds the Vertex <V> in the Edge <E>. <P> is the |
100 | //! parameter of the vertex on the edge. If direct |
101 | //! is False the Vertex is reversed. |
102 | Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P, const Standard_Boolean direct) const; |
103 | |
104 | //! Adds the Vertex <V> in the Edge <E>. <P1,P2> |
105 | //! are the parameters of the vertex on the closed |
106 | //! edge. |
107 | Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const; |
108 | |
109 | //! <P1,P2> are the parameters of the vertex on the |
110 | //! edge. The edge is a closed curve. |
111 | Standard_EXPORT void SetParameters (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const; |
112 | |
113 | //! Adds the Edge <E> in the Wire <W>, if direct is |
114 | //! False the Edge is reversed. |
115 | Standard_EXPORT void AddWireEdge (TopoDS_Wire& W, const TopoDS_Edge& E, const Standard_Boolean direct) const; |
116 | |
117 | //! Adds the Wire <W> in the Face <F>. |
118 | Standard_EXPORT void AddFaceWire (TopoDS_Face& F, const TopoDS_Wire& W) const; |
119 | |
120 | //! Adds the Face <F> in the Shell <Sh>. |
121 | Standard_EXPORT void AddShellFace (TopoDS_Shell& Sh, const TopoDS_Face& F) const; |
122 | |
123 | //! This is called once an edge is completed. It gives |
124 | //! the opportunity to perform any post treatment. |
125 | Standard_EXPORT void CompleteEdge (TopoDS_Edge& E) const; |
126 | |
127 | //! This is called once a wire is completed. It gives |
128 | //! the opportunity to perform any post treatment. |
129 | Standard_EXPORT void CompleteWire (TopoDS_Wire& W) const; |
130 | |
131 | //! This is called once a face is completed. It gives |
132 | //! the opportunity to perform any post treatment. |
133 | Standard_EXPORT void CompleteFace (TopoDS_Face& F) const; |
134 | |
135 | //! This is called once a shell is completed. It gives |
136 | //! the opportunity to perform any post treatment. |
137 | Standard_EXPORT void CompleteShell (TopoDS_Shell& S) const; |
138 | |
139 | |
140 | |
141 | |
142 | protected: |
143 | |
144 | |
145 | |
146 | |
147 | |
148 | private: |
149 | |
150 | |
151 | |
152 | BRep_Builder myBuilder; |
153 | |
154 | |
155 | }; |
156 | |
157 | |
158 | #include <BRepPrim_Builder.lxx> |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | #endif // _BRepPrim_Builder_HeaderFile |