0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
[occt.git] / src / TopOpeBRepBuild / TopOpeBRepBuild_ShapeSet.cxx
CommitLineData
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
42cf5bc1 17
7fd59977 18#include <BRepCheck_Analyzer.hxx>
42cf5bc1 19#include <Standard_ProgramError.hxx>
20#include <TCollection_AsciiString.hxx>
7fd59977 21#include <TopAbs.hxx>
42cf5bc1 22#include <TopoDS_Shape.hxx>
23#include <TopOpeBRepBuild_define.hxx>
24#include <TopOpeBRepBuild_ShapeSet.hxx>
7fd59977 25
26#ifdef DRAW
27#include <DBRep.hxx>
28#include <DBRep_DrawableShape.hxx>
7fd59977 29#include <TopoDS_Iterator.hxx>
30#include <TopTools_IndexedMapOfShape.hxx>
31static TCollection_AsciiString PRODINS("dins ");
7868210d 32
33static void ShapeEnumToString(const TopAbs_ShapeEnum T, TCollection_AsciiString& N)
34{
35 if (T == TopAbs_SHAPE) N = "s";
36 else if (T == TopAbs_COMPOUND) N = "co";
37 else if (T == TopAbs_COMPSOLID) N = "cs";
38 else if (T == TopAbs_SOLID) N = "so";
39 else if (T == TopAbs_SHELL) N = "sh";
40 else if (T == TopAbs_FACE) N = "f";
41 else if (T == TopAbs_WIRE) N = "w";
42 else if (T == TopAbs_EDGE) N = "e";
43 else if (T == TopAbs_VERTEX) N = "v";
44}
7fd59977 45#endif
46
0797d9d3 47#ifdef OCCT_DEBUG
1d0a9d4d 48extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
49extern Standard_Boolean TopOpeBRepBuild_GettraceCHKOK();
50extern Standard_Boolean TopOpeBRepBuild_GettraceCHKNOK();
7fd59977 51Standard_EXPORT void debaddss(){}
52Standard_IMPORT TopOpeBRepBuild_Builder* LOCAL_PBUILDER_DEB;
53#endif
54
55//=======================================================================
56//function : TopOpeBRepBuild_ShapeSet
57//purpose :
58//=======================================================================
59TopOpeBRepBuild_ShapeSet::TopOpeBRepBuild_ShapeSet(const TopAbs_ShapeEnum SubShapeType,const Standard_Boolean checkshape) :
60 mySubShapeType(SubShapeType), myCheckShape(checkshape)
61{
62 if (SubShapeType == TopAbs_EDGE) myShapeType = TopAbs_FACE;
63 else if (SubShapeType == TopAbs_VERTEX) myShapeType = TopAbs_EDGE;
9775fa61 64 else throw Standard_ProgramError("ShapeSet : bad ShapeType");
7fd59977 65 myDEBNumber = 0;
66
67 myCheckShape = Standard_False; // temporary NYI
68}
69
e6f550da 70TopOpeBRepBuild_ShapeSet::~TopOpeBRepBuild_ShapeSet()
7fd59977 71{}
72
73//=======================================================================
74//function : AddShape
75//purpose :
76//=======================================================================
77void TopOpeBRepBuild_ShapeSet::AddShape(const TopoDS_Shape& S)
78{
79 Standard_Boolean chk = CheckShape(S);
0797d9d3 80#ifdef OCCT_DEBUG
04232180 81 DumpCheck(std::cout," AddShape",S,chk);
7fd59977 82#endif
83
84 if (!chk) return;
85 ProcessAddShape(S);
86}
87
88//=======================================================================
89//function : AddStartElement
90//purpose :
91//=======================================================================
92void TopOpeBRepBuild_ShapeSet::AddStartElement(const TopoDS_Shape& S)
93{
94 Standard_Boolean chk = CheckShape(S);
0797d9d3 95#ifdef OCCT_DEBUG
04232180 96 DumpCheck(std::cout," AddStartElement",S,chk);
7fd59977 97#endif
98
99 if (!chk) return;
100 ProcessAddStartElement(S);
101}
102
103//=======================================================================
104//function : AddElement
105//purpose :
106//=======================================================================
107void TopOpeBRepBuild_ShapeSet::AddElement(const TopoDS_Shape& S)
108{
109 Standard_Boolean chk = CheckShape(S);
0797d9d3 110#ifdef OCCT_DEBUG
04232180 111 DumpCheck(std::cout," AddElement",S,chk);
7fd59977 112#endif
113
114 if (!chk) return;
115 ProcessAddElement(S);
116}
117
118//=======================================================================
119//function : ProcessAddShape
120//purpose :
121//=======================================================================
122void TopOpeBRepBuild_ShapeSet::ProcessAddShape(const TopoDS_Shape& S)
123{
124 if ( !myOMSH.Contains(S) ) {
125 myOMSH.Add(S);
126 myShapes.Append(S);
127 }
128}
129
130//=======================================================================
131//function : ProcessStartElement
132//purpose :
133//=======================================================================
134void TopOpeBRepBuild_ShapeSet::ProcessAddStartElement(const TopoDS_Shape& S)
135{
136 if ( !myOMSS.Contains(S) ) {
137 myOMSS.Add(S);
138 myStartShapes.Append(S);
139 ProcessAddElement(S);
140 }
141}
142
143//=======================================================================
144//function : ProcessAddElement
145//purpose :
146//=======================================================================
147void TopOpeBRepBuild_ShapeSet::ProcessAddElement(const TopoDS_Shape& S)
148{
149 if ( !myOMES.Contains(S) ) {
150 myOMES.Add(S);
151 TopTools_ListOfShape Lemp;
152 TopOpeBRepTool_ShapeExplorer Ex(S,mySubShapeType);
153 for (; Ex.More(); Ex.Next()) {
154 const TopoDS_Shape& subshape = Ex.Current();
155 Standard_Boolean b = ( ! mySubShapeMap.Contains(subshape) );
156 if ( b ) mySubShapeMap.Add(subshape,Lemp);
157 mySubShapeMap.ChangeFromKey(subshape).Append(S);
158 }
159 }
160}
161
162//=======================================================================
163//function : StartElements
164//purpose :
165//=======================================================================
166const TopTools_ListOfShape& TopOpeBRepBuild_ShapeSet::StartElements()const
167{
168 return myStartShapes;
169}
170
171//=======================================================================
172//function : InitShapes
173//purpose :
174//=======================================================================
175void TopOpeBRepBuild_ShapeSet::InitShapes()
176{
177 myShapesIter.Initialize(myShapes);
178}
179
180//=======================================================================
181//function : MoreShapes
182//purpose :
183//=======================================================================
184Standard_Boolean TopOpeBRepBuild_ShapeSet::MoreShapes()const
185{
186 Standard_Boolean b = myShapesIter.More();
187 return b;
188}
189
190//=======================================================================
191//function : NextShape
192//purpose :
193//=======================================================================
194void TopOpeBRepBuild_ShapeSet::NextShape()
195{
196 myShapesIter.Next();
197}
198
199//=======================================================================
200//function : Shape
201//purpose :
202//=======================================================================
203const TopoDS_Shape& TopOpeBRepBuild_ShapeSet::Shape()const
204{
205 const TopoDS_Shape& S = myShapesIter.Value();
206 return S;
207}
208
209//=======================================================================
210//function : InitStartElements
211//purpose :
212//=======================================================================
213void TopOpeBRepBuild_ShapeSet::InitStartElements()
214{
215 myStartShapesIter.Initialize(myStartShapes);
216}
217
218//=======================================================================
219//function : MoreStartElements
220//purpose :
221//=======================================================================
222Standard_Boolean TopOpeBRepBuild_ShapeSet::MoreStartElements()const
223{
224 Standard_Boolean b = myStartShapesIter.More();
225 return b;
226}
227
228//=======================================================================
229//function : NextStartElement
230//purpose :
231//=======================================================================
232void TopOpeBRepBuild_ShapeSet::NextStartElement()
233{
234 myStartShapesIter.Next();
235}
236
237//=======================================================================
238//function : StartElement
239//purpose :
240//=======================================================================
241const TopoDS_Shape& TopOpeBRepBuild_ShapeSet::StartElement()const
242{
243 const TopoDS_Shape& S = myStartShapesIter.Value();
244 return S;
245}
246
247//=======================================================================
248//function : InitNeighbours
249//purpose :
250//=======================================================================
251void TopOpeBRepBuild_ShapeSet::InitNeighbours(const TopoDS_Shape& S)
252{
253 mySubShapeExplorer.Init(S,mySubShapeType);
254 myCurrentShape = S;
255 FindNeighbours();
256}
257
258//=======================================================================
259//function : MoreNeighbours
260//purpose :
261//=======================================================================
262Standard_Boolean TopOpeBRepBuild_ShapeSet::MoreNeighbours()
263{
264 Standard_Boolean b = myIncidentShapesIter.More();
265 return b;
266}
267
268//=======================================================================
269//function : NextNeighbour
270//purpose :
271//=======================================================================
272void TopOpeBRepBuild_ShapeSet::NextNeighbour()
273{
274 myIncidentShapesIter.Next();
275 Standard_Boolean noisimore = ! myIncidentShapesIter.More();
276 if ( noisimore ) {
277 Standard_Boolean ssemore = mySubShapeExplorer.More();
278 if ( ssemore ) {
279 mySubShapeExplorer.Next();
280 FindNeighbours();
281 }
282 }
283}
284
285//=======================================================================
286//function : Neighbour
287//purpose :
288//=======================================================================
289const TopoDS_Shape& TopOpeBRepBuild_ShapeSet::Neighbour()const
290{
291 const TopoDS_Shape& S = myIncidentShapesIter.Value();
292 return S;
293}
294
295//=======================================================================
296//function : ChangeStartShapes
297//purpose :
298//=======================================================================
299TopTools_ListOfShape& TopOpeBRepBuild_ShapeSet::ChangeStartShapes()
300{
301 return myStartShapes;
302}
303
7fd59977 304//=======================================================================
305//function : FindNeighbours
306//purpose :
307//=======================================================================
308void TopOpeBRepBuild_ShapeSet::FindNeighbours()
309{
310 while (mySubShapeExplorer.More()) {
311
312 // l = list of edges neighbour of edge myCurrentShape trough
313 // the vertex mySubShapeExplorer.Current(), which is a vertex of the
314 // edge myCurrentShape.
315 const TopoDS_Shape& V = mySubShapeExplorer.Current();
316 const TopTools_ListOfShape & l = MakeNeighboursList(myCurrentShape,V);
317
318 // myIncidentShapesIter iterates on the neighbour edges of the edge
319 // given as InitNeighbours() argument (this edge has been stored
320 // in the field myCurrentShape).
321
322 myIncidentShapesIter.Initialize(l);
323 if (myIncidentShapesIter.More()) break;
324 else mySubShapeExplorer.Next();
325 }
326}
327
328//=======================================================================
329//function : MakeNeighboursList
330//purpose : // (Earg = Edge, Varg = Vertex) to find connected to Earg by Varg
331//=======================================================================
35e08fe8 332const TopTools_ListOfShape & TopOpeBRepBuild_ShapeSet::MakeNeighboursList(const TopoDS_Shape& /*Earg*/, const TopoDS_Shape& Varg)
7fd59977 333{
334 const TopTools_ListOfShape& l = mySubShapeMap.FindFromKey(Varg);
335 return l;
336}
337
338//=======================================================================
339//function : MaxNumberSubShape
340//purpose :
341//=======================================================================
342Standard_Integer TopOpeBRepBuild_ShapeSet::MaxNumberSubShape(const TopoDS_Shape& Shape)
343{
344 Standard_Integer i, m = 0;
345 TopOpeBRepTool_ShapeExplorer SE(Shape, mySubShapeType);
346 TopTools_ListIteratorOfListOfShape LI;
347 while(SE.More()) {
348 const TopoDS_Shape& SubShape = SE.Current();
349 if(!mySubShapeMap.Contains(SubShape)) {
350 SE.Next();
351 continue;
352 }
353 const TopTools_ListOfShape& l = mySubShapeMap.FindFromKey(SubShape);
354 LI.Initialize(l);
355 for(i = 0;LI.More();LI.Next(), i++) {}
356 m = Max(m, i);
357 SE.Next();
358 }
359 return m;
360}
361
362//=======================================================================
363//function : CheckShape
364//purpose :
365//=======================================================================
366void TopOpeBRepBuild_ShapeSet::CheckShape(const Standard_Boolean checkshape)
367{
368 myCheckShape = checkshape;
369
0797d9d3 370#ifdef OCCT_DEBUG
7fd59977 371 if (TopOpeBRepBuild_GettraceCHK() && !myCheckShape) {
04232180 372 DumpName(std::cout,"no checkshape set on ");std::cout<<std::endl;
7fd59977 373 }
374#endif
375}
376
377//=======================================================================
378//function : CheckShape
379//purpose :
380//=======================================================================
381Standard_Boolean TopOpeBRepBuild_ShapeSet::CheckShape() const
382{
383 return myCheckShape;
384}
385
386//=======================================================================
387//function : CheckShape
388//purpose :
389//=======================================================================
390Standard_Boolean TopOpeBRepBuild_ShapeSet::CheckShape(const TopoDS_Shape& S,const Standard_Boolean checkgeom)
391{
392 if (!myCheckShape) return Standard_True;
393
394 BRepCheck_Analyzer ana(S,checkgeom);
395 Standard_Boolean val = ana.IsValid();
396 if ( val ) {
397 return Standard_True;
398 }
399 else {
400 return Standard_False;
401 }
402}
403
404//=======================================================================
405//function : DumpName
406//purpose :
407//=======================================================================
408void TopOpeBRepBuild_ShapeSet::DumpName(Standard_OStream& OS,const TCollection_AsciiString& str) const
409{
410 OS<<str<<"("<<myDEBName<<","<<myDEBNumber<<")";
411}
412
413//=======================================================================
414//function : DumpCheck
415//purpose :
416//=======================================================================
498ce76b 417
0797d9d3 418#ifdef OCCT_DEBUG
498ce76b 419void TopOpeBRepBuild_ShapeSet::DumpCheck(Standard_OStream& OS,
420 const TCollection_AsciiString& str,
421 const TopoDS_Shape& S,
422 const Standard_Boolean chk
423#else
424void TopOpeBRepBuild_ShapeSet::DumpCheck(Standard_OStream&,
425 const TCollection_AsciiString&,
426 const TopoDS_Shape&,
427 const Standard_Boolean
428#endif
429 ) const
7fd59977 430{
431 if (!myCheckShape) return;
432
0797d9d3 433#ifdef OCCT_DEBUG
7fd59977 434 TopAbs_ShapeEnum t = S.ShapeType();
435 if (!chk) {
436 if (TopOpeBRepBuild_GettraceCHK() ||
437 TopOpeBRepBuild_GettraceCHKNOK() ) {
438 DumpName(OS,"*********************** ");
04232180 439 OS<<str<<" ";TopAbs::Print(t,OS);OS<<" : incorrect"<<std::endl;
7fd59977 440 }
441 }
442 else {
443 if (TopOpeBRepBuild_GettraceCHK() ||
444 TopOpeBRepBuild_GettraceCHKOK() ) {
445 DumpName(OS,"");
04232180 446 OS<<str<<" ";TopAbs::Print(t,OS);OS<<" : correct"<<std::endl;
7fd59977 447 }
448 }
449 if (!chk) debaddss();
450#endif
451}
452
453//=======================================================================
454//function : DumpSS
455//purpose :
456//=======================================================================
457void TopOpeBRepBuild_ShapeSet::DumpSS()
458{
459#ifdef DRAW
04232180 460 DumpName(std::cout,"\nDumpSS start ");
7fd59977 461 TopTools_ListIteratorOfListOfShape it;
462 Standard_Integer i,j,ne;
463 TCollection_AsciiString s1(" ");
464 InitShapes();
04232180 465 std::cout<<std::endl<<"#Shapes : ";if (!MoreShapes()) std::cout<<0;std::cout<<std::endl;
7fd59977 466 for (i=1;MoreShapes();NextShape(),i++) {
467 TCollection_AsciiString ns = SNameori(Shape());
04232180 468 std::cout<<PRODINS<<ns<<"; # "<<i<<" draw"<<std::endl;
7fd59977 469 DBRep::Set(ns.ToCString(),Shape());
470 }
471
472 InitStartElements();
04232180 473 std::cout<<"#StartElements : ";if (!MoreStartElements()) std::cout<<0;std::cout<<std::endl;
7fd59977 474 for (i=1;MoreStartElements();NextStartElement(),i++) {
04232180 475 std::cout<<PRODINS<<SNameori(StartElement())<<"; # "<<i<<" draw"<<std::endl;
7fd59977 476 }
477
478 InitStartElements();
04232180 479 std::cout<<"#Neighbours of StartElements : ";if (!MoreStartElements()) std::cout<<0;std::cout<<std::endl;
7fd59977 480 for (i=1;MoreStartElements();NextStartElement(),i++) {
481 const TopoDS_Shape& e = StartElement();
482 TCollection_AsciiString enam = SNameori(e);
483 InitNeighbours(e);
484 if (MoreNeighbours()) {
485 TCollection_AsciiString sne("clear; ");sne=sne+PRODINS+enam;
486 for (ne=1; MoreNeighbours(); NextNeighbour(),ne++) {
487 const TopoDS_Shape& N = Neighbour();
488 sne=sne+" "+SNameori(N);
489 }
490 sne=sne+"; wclick; #draw";
04232180 491 std::cout<<sne<<std::endl;
7fd59977 492 }
493 }
494
495 Standard_Integer ism,nsm=mySubShapeMap.Extent();
04232180 496 std::cout<<"#Incident shapes : ";if (!nsm) std::cout<<0;std::cout<<std::endl;
7fd59977 497 for (i=1,ism=1;ism<=nsm;ism++,i++) {
498 const TopoDS_Shape& v = mySubShapeMap.FindKey(ism);
499 const TopTools_ListOfShape& lsv = mySubShapeMap.FindFromIndex(ism);
500 TopTools_ListIteratorOfListOfShape itle(lsv);
501 if (itle.More()) {
502 TCollection_AsciiString vnam = SName(v);
503 TCollection_AsciiString sle("clear; ");sle=sle+PRODINS+vnam;
504 for (j=1;itle.More();itle.Next(),j++) {
505 const TopoDS_Shape& e = itle.Value();
506 sle=sle+" "+SNameori(e);
507 }
508 sle=sle+"; wclick; #draw";
04232180 509 std::cout<<sle<<std::endl;
7fd59977 510 }
511 }
04232180 512 DumpName(std::cout,"DumpSS end ");
7fd59977 513#endif
514}
515
516//=======================================================================
517//function : DumpBB
518//purpose :
519//=======================================================================
520void TopOpeBRepBuild_ShapeSet::DumpBB()
521{
522#ifdef DRAW
04232180 523 DumpName(std::cout,"\nDumpBB ");
7fd59977 524 TopTools_ListIteratorOfListOfShape it;
525 Standard_Integer i,j,ne = 0, nb = 1, curr, currloc;
526 TCollection_AsciiString s1(" "),stt,enam,nnam,vnam;
527 InitShapes();
528
04232180 529 std::cout<<std::endl<<"#Shapes : (block old) ";if (!MoreShapes()) std::cout<<0;std::cout<<std::endl;
7fd59977 530 for (i=1;MoreShapes();NextShape(),i++, nb++) {
04232180 531 std::cout<<"Block number"<<nb<<" (old)."<<std::endl;
7fd59977 532 const TopoDS_Shape& e = Shape();
533 TopoDS_Iterator ShapIter(e);
534 for(ne = 1;ShapIter.More();ShapIter.Next(), ne++) {
535 const TopoDS_Shape& subsha = ShapIter.Value();
7868210d 536 ShapeEnumToString(subsha.ShapeType(),stt);
7fd59977 537 enam = stt+ne+"ShaB"+nb;
538 DBRep::Set(enam.ToCString(),subsha);
04232180 539 std::cout<<"clear; "<<PRODINS<<enam<<"; #draw"<<std::endl;
7fd59977 540 }
541 }
542
543 InitStartElements();
544 TopTools_IndexedMapOfShape mos;
04232180 545 std::cout<<"#Elements : (block new) : ";if (!MoreStartElements()) std::cout<<0;std::cout<<std::endl;
7fd59977 546 mos.Clear();
547 for (;MoreStartElements();NextStartElement()) {
548 const TopoDS_Shape& e = StartElement();
549 curr = mos.Extent();
550 if(mos.Add(e) > curr) {
04232180 551 std::cout<<"#Block number"<<nb<<" (new)."<<std::endl;
7fd59977 552 nb++;ne++;
553 enam = "";
554 enam = enam+"ste"+ne+"newB"+nb;
555 DBRep::Set(enam.ToCString(),e);
7868210d 556
7fd59977 557 while(curr < mos.Extent()) {
558 curr = mos.Extent();
559 currloc = curr;
560 InitNeighbours(mos.FindKey(curr));
561 for (; MoreNeighbours(); NextNeighbour()) {
562 const TopoDS_Shape& N = Neighbour();
563 if(mos.Add(N) > currloc) {
564 currloc++;ne++;
565 // to know if ste or ele is displayed; start
566 const TopTools_ListOfShape& LSE = StartElements();
567 it.Initialize(LSE);
568 while(it.More())
569 if(it.Value() == N)
570 break;
571 else
572 it.Next();
573 enam = "";
574 if(it.More()) {
575 enam = enam+"ste"+ne+"newB"+nb;
7fd59977 576 DBRep::Set(enam.ToCString(),N);
7fd59977 577 } else {
578 enam = enam+"ele"+ne+"newB"+nb;
579 DBRep::Set(enam.ToCString(),N);
04232180 580 std::cout<<PRODINS<<enam<<"; #draw"<<std::endl;
7fd59977 581 }
582 }
583 }
584 }
585 }
586 }
587#endif
588}
589
590//=======================================================================
591//function : DEBName
592//purpose :
593//=======================================================================
594void TopOpeBRepBuild_ShapeSet::DEBName(const TCollection_AsciiString& N)
595{
596 myDEBName = N;
597}
598
599//=======================================================================
600//function : DEBName
601//purpose :
602//=======================================================================
603const TCollection_AsciiString& TopOpeBRepBuild_ShapeSet::DEBName() const
604{
605 return myDEBName;
606}
607
608//=======================================================================
609//function : DEBNumber
610//purpose :
611//=======================================================================
612void TopOpeBRepBuild_ShapeSet::DEBNumber(const Standard_Integer I)
613{
614 myDEBNumber = I;
615}
616
617//=======================================================================
618//function : DEBNumber
619//purpose :
620//=======================================================================
621Standard_Integer TopOpeBRepBuild_ShapeSet::DEBNumber() const
622{
623 return myDEBNumber;
624}
625
626//=======================================================================
627//function : SName
628//purpose :
629//=======================================================================
35e08fe8 630#ifdef DRAW
631TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SName(const TopoDS_Shape& /*S*/,
632 const TCollection_AsciiString& sb,
633 const TCollection_AsciiString& sa) const
7fd59977 634{
635 TCollection_AsciiString str;
35e08fe8 636
7fd59977 637 str=sb;
638 TCollection_AsciiString WESi=myDEBName.SubString(1,1)+myDEBNumber;
639 str=str+WESi;
640 TopAbs_ShapeEnum t = S.ShapeType();
7868210d 641 TCollection_AsciiString sts;ShapeEnumToString(t,sts);
7fd59977 642 sts.UpperCase();str=str+sts.SubString(1,1);
643 Standard_Integer isub = mySubShapeMap.FindIndex(S);
644 Standard_Integer ista = myOMSS.FindIndex(S);
645 Standard_Integer iele = myOMES.FindIndex(S);
646 Standard_Integer isha = myOMSH.FindIndex(S);
647 if (isub) str=str+"sub"+isub;
648 if (ista) str=str+"sta"+ista;
649 else if (iele) str=str+"ele"+iele;
650 if (isha) str=str+"sha"+isha;
651 str=str+sa;
35e08fe8 652
7fd59977 653 return str;
654}
35e08fe8 655#else
656TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SName(const TopoDS_Shape&,
657 const TCollection_AsciiString&,
658 const TCollection_AsciiString&) const
659{
660 TCollection_AsciiString str;
661 return str;
662}
663#endif
7fd59977 664
665//=======================================================================
666//function : SNameori
667//purpose :
668//=======================================================================
35e08fe8 669#ifdef DRAW
670TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SNameori(const TopoDS_Shape& S,
671 const TCollection_AsciiString& sb,
672 const TCollection_AsciiString& sa) const
7fd59977 673{
674 TCollection_AsciiString str;
7fd59977 675 str=sb+SName(S);
d2e60688 676 TCollection_AsciiString sto = TopAbs::ShapeOrientationToString (S.Orientation());
7fd59977 677 str=str+sto.SubString(1,1);
678 str=str+sa;
7fd59977 679 return str;
680}
35e08fe8 681#else
682TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SNameori(const TopoDS_Shape&,
683 const TCollection_AsciiString&,
684 const TCollection_AsciiString&) const
685{
686 TCollection_AsciiString str;
687 return str;
688}
689#endif
7fd59977 690
691//=======================================================================
692//function : SName
693//purpose :
694//=======================================================================
35e08fe8 695#ifdef DRAW
696TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SName(const TopTools_ListOfShape& L,
697 const TCollection_AsciiString& sb,
698 const TCollection_AsciiString& /*sa*/) const
7fd59977 699{
700 TCollection_AsciiString str;
7fd59977 701 for (TopTools_ListIteratorOfListOfShape it(L);it.More();it.Next()) str=str+sb+SName(it.Value())+sa+" ";
7fd59977 702 return str;
703}
35e08fe8 704#else
705TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SName(const TopTools_ListOfShape&,
706 const TCollection_AsciiString&,
707 const TCollection_AsciiString&) const
708{
709 TCollection_AsciiString str;
710 return str;
711}
712#endif
7fd59977 713
714//=======================================================================
715//function : SNameori
716//purpose :
717//=======================================================================
35e08fe8 718TCollection_AsciiString TopOpeBRepBuild_ShapeSet::SNameori(const TopTools_ListOfShape& /*L*/,
719 const TCollection_AsciiString& /*sb*/,
720 const TCollection_AsciiString& /*sa*/) const
7fd59977 721{
722 TCollection_AsciiString str;
723#ifdef DRAW
724 for (TopTools_ListIteratorOfListOfShape it(L);it.More();it.Next()) str=str+sb+SNameori(it.Value())+sa+" ";
725#endif
726 return str;
727}