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