b311480e |
1 | // Created on: 1993-07-23 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <BRepBuilderAPI_MakeSolid.hxx> |
19 | #include <StdFail_NotDone.hxx> |
20 | #include <TopoDS.hxx> |
21 | #include <TopoDS_CompSolid.hxx> |
22 | #include <TopoDS_Shape.hxx> |
23 | #include <TopoDS_Shell.hxx> |
24 | #include <TopoDS_Solid.hxx> |
7fd59977 |
25 | |
26 | //======================================================================= |
27 | //function : BRepBuilderAPI_MakeSolid |
28 | //purpose : |
29 | //======================================================================= |
7fd59977 |
30 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid() |
31 | { |
32 | } |
33 | |
34 | //======================================================================= |
35 | //function : BRepBuilderAPI_MakeSolid |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S) |
40 | : myMakeSolid(S) |
41 | { |
42 | if ( myMakeSolid.IsDone()) { |
43 | Done(); |
44 | myShape = myMakeSolid.Shape(); |
45 | } |
46 | } |
47 | |
48 | |
49 | //======================================================================= |
50 | //function : BRepBuilderAPI_MakeSolid |
51 | //purpose : |
52 | //======================================================================= |
53 | |
54 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S) |
55 | : myMakeSolid(S) |
56 | { |
57 | if ( myMakeSolid.IsDone()) { |
58 | Done(); |
59 | myShape = myMakeSolid.Shape(); |
60 | } |
61 | } |
62 | |
63 | |
64 | //======================================================================= |
65 | //function : BRepBuilderAPI_MakeSolid |
66 | //purpose : |
67 | //======================================================================= |
68 | |
69 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, |
70 | const TopoDS_Shell& S2) |
71 | : myMakeSolid(S1,S2) |
72 | { |
73 | if ( myMakeSolid.IsDone()) { |
74 | Done(); |
75 | myShape = myMakeSolid.Shape(); |
76 | } |
77 | } |
78 | |
79 | |
80 | //======================================================================= |
81 | //function : BRepBuilderAPI_MakeSolid |
82 | //purpose : |
83 | //======================================================================= |
84 | |
85 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, |
86 | const TopoDS_Shell& S2, |
87 | const TopoDS_Shell& S3) |
88 | : myMakeSolid(S1,S2,S3) |
89 | { |
90 | if ( myMakeSolid.IsDone()) { |
91 | Done(); |
92 | myShape = myMakeSolid.Shape(); |
93 | } |
94 | } |
95 | |
96 | |
97 | //======================================================================= |
98 | //function : BRepBuilderAPI_MakeSolid |
99 | //purpose : |
100 | //======================================================================= |
101 | |
102 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So) |
103 | : myMakeSolid(So) |
104 | { |
105 | if ( myMakeSolid.IsDone()) { |
106 | Done(); |
107 | myShape = myMakeSolid.Shape(); |
108 | } |
109 | } |
110 | |
111 | |
112 | //======================================================================= |
113 | //function : BRepBuilderAPI_MakeSolid |
114 | //purpose : |
115 | //======================================================================= |
116 | |
117 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So, |
118 | const TopoDS_Shell& S) |
119 | : myMakeSolid(So,S) |
120 | { |
121 | if ( myMakeSolid.IsDone()) { |
122 | Done(); |
123 | myShape = myMakeSolid.Shape(); |
124 | } |
125 | } |
126 | |
127 | |
128 | //======================================================================= |
129 | //function : Add |
130 | //purpose : |
131 | //======================================================================= |
132 | |
133 | void BRepBuilderAPI_MakeSolid::Add(const TopoDS_Shell& S) |
134 | { |
135 | myMakeSolid.Add(S); |
136 | if ( myMakeSolid.IsDone()) { |
137 | Done(); |
138 | myShape = myMakeSolid.Shape(); |
139 | } |
140 | } |
141 | |
142 | //======================================================================= |
143 | //function : IsDone |
144 | //purpose : |
145 | //======================================================================= |
146 | |
147 | Standard_Boolean BRepBuilderAPI_MakeSolid::IsDone() const |
148 | { |
149 | return myMakeSolid.IsDone(); |
150 | } |
151 | |
152 | |
153 | //======================================================================= |
154 | //function : Solid |
155 | //purpose : |
156 | //======================================================================= |
157 | |
ecac41a9 |
158 | const TopoDS_Solid& BRepBuilderAPI_MakeSolid::Solid() |
7fd59977 |
159 | { |
160 | return myMakeSolid.Solid(); |
161 | } |
162 | |
163 | |
164 | |
165 | //======================================================================= |
166 | //function : operator |
167 | //purpose : |
168 | //======================================================================= |
169 | |
ecac41a9 |
170 | BRepBuilderAPI_MakeSolid::operator TopoDS_Solid() |
7fd59977 |
171 | { |
172 | return Solid(); |
173 | } |
174 | |
175 | //======================================================================= |
176 | //function : IsDeleted |
177 | //purpose : |
178 | //======================================================================= |
179 | |
180 | Standard_Boolean BRepBuilderAPI_MakeSolid::IsDeleted (const TopoDS_Shape& S) |
181 | |
182 | { |
183 | if(S.ShapeType() == TopAbs_FACE) { |
184 | BRepLib_ShapeModification aStatus = myMakeSolid.FaceStatus(TopoDS::Face(S)); |
185 | |
186 | if(aStatus == BRepLib_Deleted) return Standard_True; |
187 | |
188 | } |
189 | |
190 | return Standard_False; |
191 | } |
192 | |