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