b311480e |
1 | // Created on: 1995-08-31 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1995-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 | |
23 | #include <BRepFilletAPI_MakeFillet2d.ixx> |
24 | |
25 | //======================================================================= |
26 | //function : BRepFilletAPI_MakeFillet2d |
27 | //purpose : |
28 | //======================================================================= |
29 | |
30 | BRepFilletAPI_MakeFillet2d::BRepFilletAPI_MakeFillet2d() |
31 | { |
32 | } |
33 | |
34 | //======================================================================= |
35 | //function : BRepFilletAPI_MakeFillet2d |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | BRepFilletAPI_MakeFillet2d::BRepFilletAPI_MakeFillet2d(const TopoDS_Face& F) |
40 | { |
41 | myMakeChFi2d.Init(F); |
42 | } |
43 | |
44 | //======================================================================= |
45 | //function : Init |
46 | //purpose : |
47 | //======================================================================= |
48 | |
49 | void BRepFilletAPI_MakeFillet2d::Init(const TopoDS_Face& F) |
50 | { |
51 | myMakeChFi2d.Init(F); |
52 | } |
53 | |
54 | //======================================================================= |
55 | //function : Init |
56 | //purpose : |
57 | //======================================================================= |
58 | |
59 | void BRepFilletAPI_MakeFillet2d::Init(const TopoDS_Face& RefFace, const TopoDS_Face& ModFace) |
60 | { |
61 | myMakeChFi2d.Init(RefFace, ModFace); |
62 | } |
63 | |
64 | //======================================================================= |
65 | //function : AddFillet |
66 | //purpose : |
67 | //======================================================================= |
68 | |
69 | TopoDS_Edge BRepFilletAPI_MakeFillet2d::AddFillet(const TopoDS_Vertex& V, const Standard_Real Radius) |
70 | { |
71 | return myMakeChFi2d.AddFillet(V, Radius); |
72 | } |
73 | |
74 | //======================================================================= |
75 | //function : ModifyFillet |
76 | //purpose : |
77 | //======================================================================= |
78 | |
79 | TopoDS_Edge BRepFilletAPI_MakeFillet2d::ModifyFillet(const TopoDS_Edge& Fillet, const Standard_Real Radius) |
80 | { |
81 | return myMakeChFi2d.ModifyFillet(Fillet, Radius); |
82 | } |
83 | |
84 | //======================================================================= |
85 | //function : RemoveFillet |
86 | //purpose : |
87 | //======================================================================= |
88 | |
89 | TopoDS_Vertex BRepFilletAPI_MakeFillet2d::RemoveFillet(const TopoDS_Edge& Fillet) |
90 | { |
91 | return myMakeChFi2d.RemoveFillet(Fillet); |
92 | } |
93 | |
94 | //======================================================================= |
95 | //function : AddChamfer |
96 | //purpose : |
97 | //======================================================================= |
98 | |
99 | TopoDS_Edge BRepFilletAPI_MakeFillet2d::AddChamfer(const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2) |
100 | { |
101 | return myMakeChFi2d.AddChamfer(E1, E2, D1, D2); |
102 | } |
103 | |
104 | //======================================================================= |
105 | //function : AddChamfer |
106 | //purpose : |
107 | //======================================================================= |
108 | |
109 | TopoDS_Edge BRepFilletAPI_MakeFillet2d::AddChamfer(const TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real D, const Standard_Real Ang) |
110 | { |
111 | return myMakeChFi2d.AddChamfer(E, V, D, Ang); |
112 | } |
113 | |
114 | //======================================================================= |
115 | //function : ModifyChamfer |
116 | //purpose : |
117 | //======================================================================= |
118 | |
119 | TopoDS_Edge BRepFilletAPI_MakeFillet2d::ModifyChamfer(const TopoDS_Edge& Chamfer, const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2) |
120 | { |
121 | return myMakeChFi2d.ModifyChamfer(Chamfer, E1, E2, D1, D2); |
122 | } |
123 | |
124 | //======================================================================= |
125 | //function : ModifyChamfer |
126 | //purpose : |
127 | //======================================================================= |
128 | |
129 | TopoDS_Edge BRepFilletAPI_MakeFillet2d::ModifyChamfer(const TopoDS_Edge& Chamfer, const TopoDS_Edge& E, const Standard_Real D, const Standard_Real Ang) |
130 | { |
131 | return myMakeChFi2d.ModifyChamfer(Chamfer, E, D, Ang); |
132 | } |
133 | |
134 | //======================================================================= |
135 | //function : RemoveChamfer |
136 | //purpose : |
137 | //======================================================================= |
138 | |
139 | TopoDS_Vertex BRepFilletAPI_MakeFillet2d::RemoveChamfer(const TopoDS_Edge& Chamfer) |
140 | { |
141 | return myMakeChFi2d.RemoveChamfer(Chamfer); |
142 | } |
143 | |
144 | //======================================================================= |
145 | //function : BasisEdge |
146 | //purpose : |
147 | //======================================================================= |
148 | |
149 | const TopoDS_Edge& BRepFilletAPI_MakeFillet2d::BasisEdge(const TopoDS_Edge& E) const |
150 | { |
151 | return myMakeChFi2d.BasisEdge(E); |
152 | } |
153 | |
154 | |
155 | //======================================================================= |
156 | //function : Build |
157 | //purpose : |
158 | //======================================================================= |
159 | |
160 | void BRepFilletAPI_MakeFillet2d::Build() |
161 | { |
162 | // test if the operation is done |
163 | if (Status() == ChFi2d_IsDone) { |
164 | Done(); |
165 | myShape = myMakeChFi2d.Result(); |
166 | } |
167 | else |
168 | NotDone(); |
169 | } |
170 | |
171 | //======================================================================= |
172 | //function : Modified |
173 | //purpose : |
174 | //======================================================================= |
175 | |
176 | const TopTools_ListOfShape& BRepFilletAPI_MakeFillet2d::Modified(const TopoDS_Shape& E) |
177 | { |
178 | myGenerated.Clear(); |
179 | myGenerated.Append(DescendantEdge(TopoDS::Edge(E))); |
180 | return myGenerated; |
181 | } |
182 | |
183 | //======================================================================= |
184 | //function : NbCurves |
185 | //purpose : |
186 | //======================================================================= |
187 | |
188 | Standard_Integer BRepFilletAPI_MakeFillet2d::NbCurves() const |
189 | { |
190 | return NbFillet() + NbChamfer(); |
191 | } |
192 | |
193 | //======================================================================= |
194 | //function : NewEdges |
195 | //purpose : |
196 | //======================================================================= |
197 | |
198 | const TopTools_ListOfShape& BRepFilletAPI_MakeFillet2d::NewEdges(const Standard_Integer I) |
199 | { |
200 | myGenerated.Clear(); |
201 | if (I <= NbFillet()) |
202 | myGenerated.Append(FilletEdges()(I)); |
203 | else |
204 | myGenerated.Append(ChamferEdges()(I-NbFillet())); |
205 | |
206 | return myGenerated; |
207 | } |
208 | |
209 | |