1 // Created on: 1993-06-17
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 static TCollection_AsciiString PRODINS("dins ");
23 #include <TCollection_AsciiString.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <TopoDS_Solid.hxx>
27 #include <TopOpeBRepBuild_Builder.hxx>
28 #include <TopOpeBRepBuild_define.hxx>
29 #include <TopOpeBRepBuild_ShellFaceSet.hxx>
32 extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
35 //=======================================================================
36 //function : TopOpeBRepBuild_ShellFaceSet
38 //=======================================================================
40 TopOpeBRepBuild_ShellFaceSet::TopOpeBRepBuild_ShellFaceSet() :
41 TopOpeBRepBuild_ShapeSet(TopAbs_EDGE)
48 //=======================================================================
49 //function : TopOpeBRepBuild_ShellFaceSet
51 //=======================================================================
53 TopOpeBRepBuild_ShellFaceSet::TopOpeBRepBuild_ShellFaceSet
55 (const TopoDS_Shape& S,const Standard_Address A) : // DEB
57 (const TopoDS_Shape& S,const Standard_Address) : // DEB
59 TopOpeBRepBuild_ShapeSet(TopAbs_EDGE)
61 mySolid = TopoDS::Solid(S);
66 TopOpeBRepBuild_Builder* pB = ((TopOpeBRepBuild_Builder*)((void*)A));
67 myDEBNumber = pB->GdumpSHASETindex();
68 Standard_Integer iS; Standard_Boolean tSPS = pB->GtraceSPS(S,iS);
69 if(tSPS){cout<<"creation SFS "<<myDEBNumber<<" on ";}
70 if(tSPS){pB->GdumpSHA(S,NULL);cout<<endl;}
73 if (TopOpeBRepBuild_GettraceCHK() && !myCheckShape) {
74 DumpName(cout,"no checkshape in creation of ");cout<<endl;
79 //=======================================================================
82 //=======================================================================
83 void TopOpeBRepBuild_ShellFaceSet::AddShape(const TopoDS_Shape& S)
85 TopOpeBRepBuild_ShapeSet::AddShape(S);
88 //=======================================================================
89 //function : AddStartElement
91 //=======================================================================
92 void TopOpeBRepBuild_ShellFaceSet::AddStartElement(const TopoDS_Shape& S)
94 TopOpeBRepBuild_ShapeSet::ProcessAddStartElement(S);
97 //=======================================================================
98 //function : AddElement
100 //=======================================================================
101 void TopOpeBRepBuild_ShellFaceSet::AddElement(const TopoDS_Shape& S)
103 TopOpeBRepBuild_ShapeSet::AddElement(S);
106 //=======================================================================
109 //=======================================================================
111 const TopoDS_Solid& TopOpeBRepBuild_ShellFaceSet::Solid() const
116 //=======================================================================
119 //=======================================================================
121 void TopOpeBRepBuild_ShellFaceSet::DumpSS()
124 TopOpeBRepBuild_ShapeSet::DumpSS();
128 //=======================================================================
131 //=======================================================================
133 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopoDS_Shape& S,
134 const TCollection_AsciiString& sb,
135 const TCollection_AsciiString& sa) const
137 TCollection_AsciiString str=sb;
139 str=str+TopOpeBRepBuild_ShapeSet::SName(S);
141 DBRep::Set(str.ToCString(),S);
146 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopoDS_Shape&,
147 const TCollection_AsciiString& sb,
148 const TCollection_AsciiString&) const
150 TCollection_AsciiString str=sb;
155 //=======================================================================
156 //function : SNameori
158 //=======================================================================
160 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SNameori(const TopoDS_Shape& S,
161 const TCollection_AsciiString& sb,
162 const TCollection_AsciiString& sa) const
164 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SNameori(const TopoDS_Shape&,
165 const TCollection_AsciiString& sb,
166 const TCollection_AsciiString&) const
169 TCollection_AsciiString str=sb;
171 str=str+TopOpeBRepBuild_ShapeSet::SNameori(S);
172 if ( S.ShapeType() == TopAbs_FACE ) {
173 const TopoDS_Shape& F = TopoDS::Face(S);
174 DBRep::Set(str.ToCString(),S);
180 //=======================================================================
183 //=======================================================================
185 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopTools_ListOfShape& L,
186 const TCollection_AsciiString& sb,
187 const TCollection_AsciiString& sa) const
189 TCollection_AsciiString str;
191 for (TopTools_ListIteratorOfListOfShape it(L);it.More();it.Next()) str=str+sb+SName(it.Value())+sa+" ";
196 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SName(const TopTools_ListOfShape&,
197 const TCollection_AsciiString&,
198 const TCollection_AsciiString&) const
200 TCollection_AsciiString str;
205 //=======================================================================
206 //function : SNameori
208 //=======================================================================
209 TCollection_AsciiString TopOpeBRepBuild_ShellFaceSet::SNameori(const TopTools_ListOfShape& /*L*/,
210 const TCollection_AsciiString& /*sb*/,
211 const TCollection_AsciiString& /*sa*/) const
213 TCollection_AsciiString str;
215 for (TopTools_ListIteratorOfListOfShape it(L);it.More();it.Next()) str=str+sb+SNameori(it.Value())+sa+" ";