b311480e |
1 | // Created on: 1993-06-17 |
2 | // Created by: Jean Yves LEBEY |
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 | #ifdef DRAW |
23 | #include <DBRep.hxx> |
24 | #include <TestTopOpeDraw_TTOT.hxx> |
25 | static TCollection_AsciiString PRODINS("dins "); |
26 | #endif |
27 | |
28 | #include <TopOpeBRepBuild_ShellFaceSet.ixx> |
29 | #include <TopOpeBRepBuild_Builder.hxx> |
30 | #include <TopOpeBRepBuild_define.hxx> |
31 | #include <TopoDS.hxx> |
32 | |
33 | #ifdef DEB |
1d0a9d4d |
34 | extern Standard_Boolean TopOpeBRepBuild_GettraceCHK(); |
7fd59977 |
35 | #endif |
36 | |
37 | //======================================================================= |
38 | //function : TopOpeBRepBuild_ShellFaceSet |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | TopOpeBRepBuild_ShellFaceSet::TopOpeBRepBuild_ShellFaceSet() : |
43 | TopOpeBRepBuild_ShapeSet(TopAbs_EDGE) |
44 | { |
45 | #ifdef DEB |
46 | myDEBName = "SFS"; |
47 | #endif |
48 | } |
49 | |
50 | //======================================================================= |
51 | //function : TopOpeBRepBuild_ShellFaceSet |
52 | //purpose : |
53 | //======================================================================= |
54 | |
55 | TopOpeBRepBuild_ShellFaceSet::TopOpeBRepBuild_ShellFaceSet |
498ce76b |
56 | #ifdef DEB |
7fd59977 |
57 | (const TopoDS_Shape& S,const Standard_Address A) : // DEB |
498ce76b |
58 | #else |
59 | (const TopoDS_Shape& S,const Standard_Address) : // DEB |
60 | #endif |
7fd59977 |
61 | TopOpeBRepBuild_ShapeSet(TopAbs_EDGE) |
62 | { |
63 | mySolid = TopoDS::Solid(S); |
64 | |
65 | #ifdef DEB |
66 | myDEBName = "SFS"; |
67 | if (A != NULL) { |
68 | TopOpeBRepBuild_Builder* pB = ((TopOpeBRepBuild_Builder*)((void*)A)); |
69 | myDEBNumber = pB->GdumpSHASETindex(); |
70 | Standard_Integer iS; Standard_Boolean tSPS = pB->GtraceSPS(S,iS); |
71 | if(tSPS){cout<<"creation SFS "<<myDEBNumber<<" on ";} |
72 | if(tSPS){pB->GdumpSHA(S,NULL);cout<<endl;} |
73 | } |
74 | |
75 | if (TopOpeBRepBuild_GettraceCHK() && !myCheckShape) { |
76 | DumpName(cout,"no checkshape in creation of ");cout<<endl; |
77 | } |
78 | #endif |
79 | } |
80 | |
81 | //======================================================================= |
82 | //function : AddShape |
83 | //purpose : |
84 | //======================================================================= |
85 | void TopOpeBRepBuild_ShellFaceSet::AddShape(const TopoDS_Shape& S) |
86 | { |
87 | TopOpeBRepBuild_ShapeSet::AddShape(S); |
88 | } |
89 | |
90 | //======================================================================= |
91 | //function : AddStartElement |
92 | //purpose : |
93 | //======================================================================= |
94 | void TopOpeBRepBuild_ShellFaceSet::AddStartElement(const TopoDS_Shape& S) |
95 | { |
96 | TopOpeBRepBuild_ShapeSet::ProcessAddStartElement(S); |
97 | } |
98 | |
99 | //======================================================================= |
100 | //function : AddElement |
101 | //purpose : |
102 | //======================================================================= |
103 | void TopOpeBRepBuild_ShellFaceSet::AddElement(const TopoDS_Shape& S) |
104 | { |
105 | TopOpeBRepBuild_ShapeSet::AddElement(S); |
106 | } |
107 | |
108 | //======================================================================= |
109 | //function : Solid |
110 | //purpose : |
111 | //======================================================================= |
112 | |
113 | const TopoDS_Solid& TopOpeBRepBuild_ShellFaceSet::Solid() const |
114 | { |
115 | return mySolid; |
116 | } |
117 | |
118 | //======================================================================= |
119 | //function : DumpSS |
120 | //purpose : |
121 | //======================================================================= |
122 | |
123 | void TopOpeBRepBuild_ShellFaceSet::DumpSS() |
124 | { |
125 | #ifdef DEB |
126 | TopOpeBRepBuild_ShapeSet::DumpSS(); |
127 | #endif |
128 | } |
129 | |
130 | //======================================================================= |
131 | //function : SName |
132 | //purpose : |
133 | //======================================================================= |
35e08fe8 |
134 | #ifdef DRAW |
135 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopoDS_Shape& S, |
136 | const TCollection_AsciiString& sb, |
137 | const TCollection_AsciiString& sa) const |
7fd59977 |
138 | { |
139 | TCollection_AsciiString str=sb; |
35e08fe8 |
140 | |
7fd59977 |
141 | str=str+TopOpeBRepBuild_ShapeSet::SName(S); |
142 | str=str+sa; |
143 | DBRep::Set(str.ToCString(),S); |
35e08fe8 |
144 | |
7fd59977 |
145 | return str; |
146 | } |
35e08fe8 |
147 | #else |
148 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopoDS_Shape&, |
149 | const TCollection_AsciiString& sb, |
150 | const TCollection_AsciiString&) const |
151 | { |
152 | TCollection_AsciiString str=sb; |
153 | return str; |
154 | } |
155 | #endif |
7fd59977 |
156 | |
157 | //======================================================================= |
158 | //function : SNameori |
159 | //purpose : |
160 | //======================================================================= |
35e08fe8 |
161 | #ifdef DRAW |
162 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SNameori(const TopoDS_Shape& S, |
163 | const TCollection_AsciiString& sb, |
164 | const TCollection_AsciiString& sa) const |
165 | #else |
166 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SNameori(const TopoDS_Shape&, |
167 | const TCollection_AsciiString& sb, |
168 | const TCollection_AsciiString&) const |
169 | #endif |
7fd59977 |
170 | { |
171 | TCollection_AsciiString str=sb; |
172 | #ifdef DRAW |
173 | str=str+TopOpeBRepBuild_ShapeSet::SNameori(S); |
174 | if ( S.ShapeType() == TopAbs_FACE ) { |
175 | const TopoDS_Shape& F = TopoDS::Face(S); |
176 | DBRep::Set(str.ToCString(),S); |
177 | } |
178 | #endif |
179 | return str; |
180 | } |
181 | |
182 | //======================================================================= |
183 | //function : SName |
184 | //purpose : |
185 | //======================================================================= |
35e08fe8 |
186 | #ifdef DRAW |
187 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopTools_ListOfShape& L, |
188 | const TCollection_AsciiString& sb, |
189 | const TCollection_AsciiString& sa) const |
7fd59977 |
190 | { |
191 | TCollection_AsciiString str; |
35e08fe8 |
192 | |
7fd59977 |
193 | for (TopTools_ListIteratorOfListOfShape it(L);it.More();it.Next()) str=str+sb+SName(it.Value())+sa+" "; |
35e08fe8 |
194 | |
7fd59977 |
195 | return str; |
196 | } |
35e08fe8 |
197 | #else |
198 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopTools_ListOfShape&, |
199 | const TCollection_AsciiString&, |
200 | const TCollection_AsciiString&) const |
201 | { |
202 | TCollection_AsciiString str; |
203 | return str; |
204 | } |
205 | #endif |
7fd59977 |
206 | |
207 | //======================================================================= |
208 | //function : SNameori |
209 | //purpose : |
210 | //======================================================================= |
35e08fe8 |
211 | TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SNameori(const TopTools_ListOfShape& /*L*/, |
212 | const TCollection_AsciiString& /*sb*/, |
213 | const TCollection_AsciiString& /*sa*/) const |
7fd59977 |
214 | { |
215 | TCollection_AsciiString str; |
216 | #ifdef DRAW |
217 | for (TopTools_ListIteratorOfListOfShape it(L);it.More();it.Next()) str=str+sb+SNameori(it.Value())+sa+" "; |
218 | #endif |
219 | return str; |
220 | } |