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 | |
17 | #include <BRepBuilderAPI_MakeSolid.ixx> |
18 | #include <TopoDS.hxx> |
19 | |
20 | |
21 | //======================================================================= |
22 | //function : BRepBuilderAPI_MakeSolid |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid() |
27 | { |
28 | } |
29 | |
30 | //======================================================================= |
31 | //function : BRepBuilderAPI_MakeSolid |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S) |
36 | : myMakeSolid(S) |
37 | { |
38 | if ( myMakeSolid.IsDone()) { |
39 | Done(); |
40 | myShape = myMakeSolid.Shape(); |
41 | } |
42 | } |
43 | |
44 | |
45 | //======================================================================= |
46 | //function : BRepBuilderAPI_MakeSolid |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S) |
51 | : myMakeSolid(S) |
52 | { |
53 | if ( myMakeSolid.IsDone()) { |
54 | Done(); |
55 | myShape = myMakeSolid.Shape(); |
56 | } |
57 | } |
58 | |
59 | |
60 | //======================================================================= |
61 | //function : BRepBuilderAPI_MakeSolid |
62 | //purpose : |
63 | //======================================================================= |
64 | |
65 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, |
66 | const TopoDS_Shell& S2) |
67 | : myMakeSolid(S1,S2) |
68 | { |
69 | if ( myMakeSolid.IsDone()) { |
70 | Done(); |
71 | myShape = myMakeSolid.Shape(); |
72 | } |
73 | } |
74 | |
75 | |
76 | //======================================================================= |
77 | //function : BRepBuilderAPI_MakeSolid |
78 | //purpose : |
79 | //======================================================================= |
80 | |
81 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, |
82 | const TopoDS_Shell& S2, |
83 | const TopoDS_Shell& S3) |
84 | : myMakeSolid(S1,S2,S3) |
85 | { |
86 | if ( myMakeSolid.IsDone()) { |
87 | Done(); |
88 | myShape = myMakeSolid.Shape(); |
89 | } |
90 | } |
91 | |
92 | |
93 | //======================================================================= |
94 | //function : BRepBuilderAPI_MakeSolid |
95 | //purpose : |
96 | //======================================================================= |
97 | |
98 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So) |
99 | : myMakeSolid(So) |
100 | { |
101 | if ( myMakeSolid.IsDone()) { |
102 | Done(); |
103 | myShape = myMakeSolid.Shape(); |
104 | } |
105 | } |
106 | |
107 | |
108 | //======================================================================= |
109 | //function : BRepBuilderAPI_MakeSolid |
110 | //purpose : |
111 | //======================================================================= |
112 | |
113 | BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So, |
114 | const TopoDS_Shell& S) |
115 | : myMakeSolid(So,S) |
116 | { |
117 | if ( myMakeSolid.IsDone()) { |
118 | Done(); |
119 | myShape = myMakeSolid.Shape(); |
120 | } |
121 | } |
122 | |
123 | |
124 | //======================================================================= |
125 | //function : Add |
126 | //purpose : |
127 | //======================================================================= |
128 | |
129 | void BRepBuilderAPI_MakeSolid::Add(const TopoDS_Shell& S) |
130 | { |
131 | myMakeSolid.Add(S); |
132 | if ( myMakeSolid.IsDone()) { |
133 | Done(); |
134 | myShape = myMakeSolid.Shape(); |
135 | } |
136 | } |
137 | |
138 | //======================================================================= |
139 | //function : IsDone |
140 | //purpose : |
141 | //======================================================================= |
142 | |
143 | Standard_Boolean BRepBuilderAPI_MakeSolid::IsDone() const |
144 | { |
145 | return myMakeSolid.IsDone(); |
146 | } |
147 | |
148 | |
149 | //======================================================================= |
150 | //function : Solid |
151 | //purpose : |
152 | //======================================================================= |
153 | |
154 | const TopoDS_Solid& BRepBuilderAPI_MakeSolid::Solid()const |
155 | { |
156 | return myMakeSolid.Solid(); |
157 | } |
158 | |
159 | |
160 | |
161 | //======================================================================= |
162 | //function : operator |
163 | //purpose : |
164 | //======================================================================= |
165 | |
166 | BRepBuilderAPI_MakeSolid::operator TopoDS_Solid() const |
167 | { |
168 | return Solid(); |
169 | } |
170 | |
171 | //======================================================================= |
172 | //function : IsDeleted |
173 | //purpose : |
174 | //======================================================================= |
175 | |
176 | Standard_Boolean BRepBuilderAPI_MakeSolid::IsDeleted (const TopoDS_Shape& S) |
177 | |
178 | { |
179 | if(S.ShapeType() == TopAbs_FACE) { |
180 | BRepLib_ShapeModification aStatus = myMakeSolid.FaceStatus(TopoDS::Face(S)); |
181 | |
182 | if(aStatus == BRepLib_Deleted) return Standard_True; |
183 | |
184 | } |
185 | |
186 | return Standard_False; |
187 | } |
188 | |