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