0027067: Avoid use of virtual methods for implementation of destructors in legacy...
[occt.git] / src / TopTools / TopTools_ShapeSet.cxx
CommitLineData
b311480e 1// Created on: 1993-07-02
2// Created by: Remi LEQUETTE
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// Modified: 02 Nov 2000: BUC60769. JMB, PTV. In order to be able to read BRep
7fd59977 18// is run, we need the following modifications.
7fd59977 19// On Unix platforms:
20// ------------------
21// In method Read(Standard_IStream &IS), during the version
22// authentification we cut last '\r' in the line (which will
23// be present if file is in DOS coding)
24
42cf5bc1 25#include <Message_ProgressIndicator.hxx>
26#include <Message_ProgressSentry.hxx>
27#include <TCollection_AsciiString.hxx>
7fd59977 28#include <TopoDS_Iterator.hxx>
29#include <TopoDS_Shape.hxx>
42cf5bc1 30#include <TopTools_LocationSet.hxx>
31#include <TopTools_ShapeSet.hxx>
32
7fd59977 33#include <locale.h>
34#include <string.h>
7fd59977 35const char* Version = "CASCADE Topology V1, (c) Matra-Datavision";
36const char* Version2 = "CASCADE Topology V2, (c) Matra-Datavision";
37
38//=======================================================================
39//function : TopTools_ShapeSet
40//purpose :
41//=======================================================================
42
43TopTools_ShapeSet::TopTools_ShapeSet() : myFormatNb(1)
44{
45}
46
e6f550da 47TopTools_ShapeSet::~TopTools_ShapeSet()
7fd59977 48{}
49
50//=======================================================================
51//function : SetFormatNb
52//purpose :
53//=======================================================================
54void TopTools_ShapeSet::SetFormatNb(const Standard_Integer theFormatNb)
55{
56 myFormatNb = theFormatNb;
57}
58
59//=======================================================================
60//function : FormatNb
61//purpose :
62//=======================================================================
63Standard_Integer TopTools_ShapeSet::FormatNb() const
64{
65 return myFormatNb;
66}
67
68//=======================================================================
69//function : Clear
70//purpose :
71//=======================================================================
72
73void TopTools_ShapeSet::Clear()
74{
75 myShapes.Clear();
76 myLocations.Clear();
77}
78
79
80//=======================================================================
81//function : Add
82//purpose :
83//=======================================================================
84
85Standard_Integer TopTools_ShapeSet::Add(const TopoDS_Shape& S)
86{
87 if (S.IsNull()) return 0;
88 myLocations.Add(S.Location());
89 TopoDS_Shape S2 = S;
90 S2.Location(TopLoc_Location());
91 Standard_Integer index = myShapes.FindIndex(S2);
92 if (index == 0) {
93 AddGeometry(S2);
94
95 for (TopoDS_Iterator its(S2,Standard_False,Standard_False);
96 its.More(); its.Next())
97 Add(its.Value());
98 index = myShapes.Add(S2);
99 }
100 return index;
101}
102
103
104//=======================================================================
105//function : Shape
106//purpose :
107//=======================================================================
108
109const TopoDS_Shape& TopTools_ShapeSet::Shape(const Standard_Integer I)const
110{
111 return myShapes(I);
112}
113
114//=======================================================================
115//function : Index
116//purpose :
117//=======================================================================
118
119Standard_Integer TopTools_ShapeSet::Index(const TopoDS_Shape& S) const
120{
121 return myShapes.FindIndex(S);
122}
123
124//=======================================================================
125//function : Locations
126//purpose :
127//=======================================================================
128
129const TopTools_LocationSet& TopTools_ShapeSet::Locations()const
130{
131 return myLocations;
132}
133
134
135//=======================================================================
136//function : ChangeLocations
137//purpose :
138//=======================================================================
139
140TopTools_LocationSet& TopTools_ShapeSet::ChangeLocations()
141{
142 return myLocations;
143}
144
145//=======================================================================
146//function : PrintShapeEnum
147//purpose :
148//=======================================================================
149
150static void PrintShapeEnum(const TopAbs_ShapeEnum T,
151 Standard_OStream& S,
152 Standard_Boolean C)
153{
154 switch(T) {
155
156 case TopAbs_VERTEX :
157 if (C) S << "Ve"; else S << "VERTEX ";
158 break;
159
160 case TopAbs_EDGE :
161 if (C) S << "Ed"; else S << "EDGE ";
162 break;
163
164 case TopAbs_WIRE :
165 if (C) S << "Wi"; else S << "WIRE ";
166 break;
167
168 case TopAbs_FACE :
169 if (C) S << "Fa"; else S << "FACE ";
170 break;
171
172 case TopAbs_SHELL :
173 if (C) S << "Sh"; else S << "SHELL ";
174 break;
175
176 case TopAbs_SOLID :
177 if (C) S << "So"; else S << "SOLID ";
178 break;
179
180 case TopAbs_COMPSOLID :
181 if (C) S << "CS"; else S << "COMPSOLID";
182 break;
183
184 case TopAbs_COMPOUND :
185 if (C) S << "Co"; else S << "COMPOUND ";
186 break;
187
188 case TopAbs_SHAPE :
189 if (C) S << "Sp"; else S << "SHAPE";
190 break;
191 }
192}
193
194//=======================================================================
195//function : PrintOrientation
196//purpose :
197//=======================================================================
198
199static void PrintOrientation(const TopAbs_Orientation O,
200 Standard_OStream& S,
201 Standard_Boolean C)
202{
203 switch(O) {
204
205 case TopAbs_FORWARD :
206 if (C) S << "+"; else S << "FORWARD";
207 break;
208
209 case TopAbs_REVERSED :
210 if (C) S << "-"; else S << "REVERSED";
211 break;
212
213 case TopAbs_INTERNAL :
214 if (C) S << "i"; else S << "INTERNAL";
215 break;
216
217 case TopAbs_EXTERNAL :
218 if (C) S << "e"; else S << "EXTERNAL";
219 break;
220 }
221}
222
223//=======================================================================
224//function : DumpExtent
225//purpose : Dump number of shapes.
226//=======================================================================
227
228Standard_OStream& TopTools_ShapeSet::DumpExtent(Standard_OStream& OS)const
229{
230
231 Standard_Integer nbVERTEX = 0;
232 Standard_Integer nbEDGE = 0;
233 Standard_Integer nbWIRE = 0;
234 Standard_Integer nbFACE = 0;
235 Standard_Integer nbSHELL = 0;
236 Standard_Integer nbSOLID = 0;
237 Standard_Integer nbCOMPSOLID = 0;
238 Standard_Integer nbCOMPOUND = 0;
239 Standard_Integer nbSHAPE = myShapes.Extent();
240
241 for (Standard_Integer i = 1; i <= nbSHAPE; i++) {
242
243 switch(myShapes(i).ShapeType()) {
244
245 case TopAbs_VERTEX :
246 nbVERTEX++;
247 break;
248
249 case TopAbs_EDGE :
250 nbEDGE++;
251 break;
252
253 case TopAbs_WIRE :
254 nbWIRE++;
255 break;
256
257 case TopAbs_FACE :
258 nbFACE++;
259 break;
260
261 case TopAbs_SHELL :
262 nbSHELL++;
263 break;
264
265 case TopAbs_SOLID :
266 nbSOLID++;
267 break;
268
269 case TopAbs_COMPSOLID :
270 nbCOMPSOLID++;
271 break;
272
273 case TopAbs_COMPOUND :
274 nbCOMPOUND++;
275 break;
276
277 case TopAbs_SHAPE :
278 break;
279 }
280 }
281
282
283 OS << " VERTEX : " << nbVERTEX << "\n";
284 OS << " EDGE : " << nbEDGE << "\n";
285 OS << " WIRE : " << nbWIRE << "\n";
286 OS << " FACE : " << nbFACE << "\n";
287 OS << " SHELL : " << nbSHELL << "\n";
288 OS << " SOLID : " << nbSOLID << "\n";
289 OS << " COMPSOLID : " << nbCOMPSOLID << "\n";
290 OS << " COMPOUND : " << nbCOMPOUND << "\n";
291 OS << " SHAPE : " << nbSHAPE << "\n";
292
293 return OS;
294}
295
296//=======================================================================
297//function : DumpExtent
298//purpose : Dump number of shapes.
299//=======================================================================
300
301void TopTools_ShapeSet::DumpExtent(TCollection_AsciiString& S)const
302{
303
304 Standard_Integer nbVERTEX = 0;
305 Standard_Integer nbEDGE = 0;
306 Standard_Integer nbWIRE = 0;
307 Standard_Integer nbFACE = 0;
308 Standard_Integer nbSHELL = 0;
309 Standard_Integer nbSOLID = 0;
310 Standard_Integer nbCOMPSOLID = 0;
311 Standard_Integer nbCOMPOUND = 0;
312 Standard_Integer nbSHAPE = myShapes.Extent();
313
314 for (Standard_Integer i = 1; i <= nbSHAPE; i++) {
315
316 switch(myShapes(i).ShapeType()) {
317
318 case TopAbs_VERTEX :
319 nbVERTEX++;
320 break;
321
322 case TopAbs_EDGE :
323 nbEDGE++;
324 break;
325
326 case TopAbs_WIRE :
327 nbWIRE++;
328 break;
329
330 case TopAbs_FACE :
331 nbFACE++;
332 break;
333
334 case TopAbs_SHELL :
335 nbSHELL++;
336 break;
337
338 case TopAbs_SOLID :
339 nbSOLID++;
340 break;
341
342 case TopAbs_COMPSOLID :
343 nbCOMPSOLID++;
344 break;
345
346 case TopAbs_COMPOUND :
347 nbCOMPOUND++;
348 break;
349
350 case TopAbs_SHAPE :
351 break;
352 }
353 }
354
355 S = S + " VERTEX : " + TCollection_AsciiString(nbVERTEX) + "\n";
356 S = S + " EDGE : " + TCollection_AsciiString(nbEDGE) + "\n";
357 S = S + " WIRE : " + TCollection_AsciiString(nbWIRE) + "\n";
358 S = S + " FACE : " + TCollection_AsciiString(nbFACE) + "\n";
359 S = S + " SHELL : " + TCollection_AsciiString(nbSHELL) + "\n";
360 S = S + " SOLID : " + TCollection_AsciiString(nbSOLID) + "\n";
361 S = S + " COMPSOLID : " + TCollection_AsciiString(nbCOMPSOLID) + "\n";
362 S = S + " COMPOUND : " + TCollection_AsciiString(nbCOMPOUND) + "\n";
363 S = S + " SHAPE : " + TCollection_AsciiString(nbSHAPE) + "\n";
364}
365
366
367//=======================================================================
368//function : Dump
369//purpose :
370//=======================================================================
371
372void TopTools_ShapeSet::Dump(Standard_OStream& OS)const
373{
374 //-----------------------------------------
375 // dump the shapes
376 //-----------------------------------------
377
378 Standard_Integer i, nbShapes = myShapes.Extent();
379
380 OS << "\nDump of " << nbShapes << " TShapes";
381 OS << "\n\n-----------------\n\n";
382
383 OS << "Flags : Free, Modified, Checked, Orientable, Closed, Infinite, Convex";
384 OS << "\n\n";
385
386 for (i = nbShapes; i >= 1; i--) {
387
388 const TopoDS_Shape& S = myShapes(i);
389 OS << "TShape # " << nbShapes - i + 1 << " : ";
390
391 // Type and flags
392
393 PrintShapeEnum(S.ShapeType(),OS,Standard_False);
394 OS << " ";
395 OS << (S.Free() ? 1 : 0);
396 OS << (S.Modified() ? 1 : 0);
397 OS << (S.Checked() ? 1 : 0);
398 OS << (S.Orientable() ? 1 : 0);
399 OS << (S.Closed() ? 1 : 0);
400 OS << (S.Infinite() ? 1 : 0);
401 OS << (S.Convex() ? 1 : 0);
402 OS << " " << (void*) &(*S.TShape()) <<"\n";
403
404 // sub-shapes
405 OS << " ";
406 TopoDS_Iterator its(S,Standard_False,Standard_False);
407 while (its.More()) {
408 const TopoDS_Shape& sub = its.Value();
409 PrintOrientation(sub.Orientation(),OS,Standard_True);
410 OS<<nbShapes - myShapes.FindIndex(sub.Located(TopLoc_Location())) + 1;
411 if (!sub.Location().IsIdentity())
412 OS << "(L" << myLocations.Index(sub.Location()) << ")";
413 OS << " ";
414 its.Next();
415 }
416 OS << "\n";
417
418 // Geometry
419
420 DumpGeometry(S,OS);
421 }
422
423
424 //-----------------------------------------
425 // dump the geometry
426 //-----------------------------------------
427
428 DumpGeometry(OS);
429
430 //-----------------------------------------
431 // dump the locations
432 //-----------------------------------------
433
434 myLocations.Dump(OS);
435
586db386 436 OS << "\n";
7fd59977 437}
438
439
440//=======================================================================
441//function : Write
442//purpose :
443//=======================================================================
444
445void TopTools_ShapeSet::Write(Standard_OStream& OS)
446{
91322f44 447 // always use C locale for writing shapes
448 std::locale anOldLocale = OS.imbue (std::locale::classic());
7fd59977 449
91322f44 450 // use 15-digit precision
60be1f9b 451 std::streamsize prec = OS.precision(15);
7fd59977 452
453 // write the copyright
454 if (myFormatNb == 2)
586db386 455 OS << "\n" << Version2 << "\n";
7fd59977 456 else
586db386 457 OS << "\n" << Version << "\n";
7fd59977 458
459 //-----------------------------------------
460 // write the locations
461 //-----------------------------------------
462
7fd59977 463 if ( !myProgress.IsNull() )
464 myProgress->NewScope ( 10, "Locations" );
465 myLocations.SetProgress(myProgress);
466 myLocations.Write(OS);
467 if ( !myProgress.IsNull() ) {
468 myProgress->EndScope();
469 myProgress->Show();
470 }
471
7fd59977 472 if (!myProgress.IsNull() && myProgress->UserBreak()) {
586db386 473 OS << "Interrupted by the user\n";
91322f44 474 OS.imbue (anOldLocale);
7fd59977 475 return;
476 }
477
478 //-----------------------------------------
479 // write the geometry
480 //-----------------------------------------
481
482 if ( !myProgress.IsNull() )
483 myProgress->NewScope ( 75, "Geometry" );
484 WriteGeometry(OS);
485 if ( !myProgress.IsNull() ) {
486 myProgress->EndScope();
487 myProgress->Show();
488 }
489
490 //-----------------------------------------
491 // write the shapes
492 //-----------------------------------------
493
494 Standard_Integer i, nbShapes = myShapes.Extent();
495
496 OS << "\nTShapes " << nbShapes << "\n";
7fd59977 497
498 // subshapes are written first
499 //OCC19559
500 if ( !myProgress.IsNull() )
501 myProgress->NewScope ( 15, "Shapes" );
502 Message_ProgressSentry PS(myProgress, "Shapes", 0, nbShapes, 1);
7fd59977 503 for (i = 1; i <= nbShapes && PS.More(); i++, PS.Next()) {
7fd59977 504 const TopoDS_Shape& S = myShapes(i);
505
506 // Type
507 PrintShapeEnum(S.ShapeType(),OS,Standard_True);
508 OS << "\n";
509
510 // Geometry
511 WriteGeometry(S,OS);
512
513 // Flags
514 OS << "\n";
515 OS << (S.Free() ? 1 : 0);
516 OS << (S.Modified() ? 1 : 0);
517 OS << (S.Checked() ? 1 : 0);
518 OS << (S.Orientable() ? 1 : 0);
519 OS << (S.Closed() ? 1 : 0);
520 OS << (S.Infinite() ? 1 : 0);
521 OS << (S.Convex() ? 1 : 0);
522 OS << "\n";
523
524 // sub-shapes
525
526 Standard_Integer l = 0;
527 TopoDS_Iterator its(S,Standard_False,Standard_False);
528 while (its.More()) {
529 Write(its.Value(),OS);
530 l++;
531 if (l == 10) {
532 OS << "\n";
533 l = 0;
534 }
535 its.Next();
536 }
537 Write(TopoDS_Shape(),OS); // Null shape to end the list
538 OS << "\n";
539 }
540
586db386 541 OS << "\n";
7fd59977 542 OS.precision(prec);
91322f44 543 OS.imbue (anOldLocale);
544
7fd59977 545 PS.Relieve();
546 if (!myProgress.IsNull()) {
547 myProgress->EndScope();
548 myProgress->Show();
91322f44 549 if (myProgress->UserBreak())
586db386 550 OS << "Interrupted by the user\n";
7fd59977 551 }
7fd59977 552}
553
554//=======================================================================
555//function : ReadShapeEnum
556//purpose :
557//=======================================================================
558
559static TopAbs_ShapeEnum ReadShapeEnum(Standard_IStream& IS)
560{
561 char buffer[255];
562 IS >> buffer;
563
564 switch (buffer[0]) {
565
566 case 'V' :
567 return TopAbs_VERTEX;
568
569 case 'E' :
570 return TopAbs_EDGE;
571
572 case 'W' :
573 return TopAbs_WIRE;
574
575 case 'F' :
576 return TopAbs_FACE;
577
578 case 'S' :
579 if (buffer[1] == 'h')
580 return TopAbs_SHELL;
581 else
582 return TopAbs_SOLID;
583
584 case 'C' :
585 if (buffer[1] == 'S')
586 return TopAbs_COMPSOLID;
587 else
588 return TopAbs_COMPOUND;
589
590 }
591 return TopAbs_COMPOUND;
592}
593
594//=======================================================================
595//function : Read
596//purpose :
597//=======================================================================
598
599void TopTools_ShapeSet::Read(Standard_IStream& IS)
600{
91322f44 601 // always use C locale for reading shapes
602 std::locale anOldLocale = IS.imbue (std::locale::classic());
7fd59977 603
604 Clear();
605
606 // Check the version
607 char vers[101];
608 do {
609 IS.getline(vers,100,'\n');
610 // BUC60769 PTV 18.10.2000: remove possible '\r' at the end of the line
611 //Standard_Integer lv = strlen(vers);
612 //char *pm;
613 //if(pm = strchr(vers,'\r'))
614 // *pm ='\0';
615
5149c3f3 616 Standard_Size lv = strlen(vers);
617 if (lv > 0) {
618 for (lv--; lv > 0 && (vers[lv] == '\r' || vers[lv] == '\n') ;lv--)
619 vers[lv] = '\0';
620 }
7fd59977 621
622 } while ( ! IS.fail() && strcmp(vers,Version) && strcmp(vers,Version2) );
623 if (IS.fail()) {
624 cout << "File was not written with this version of the topology"<<endl;
91322f44 625 IS.imbue (anOldLocale);
7fd59977 626 return;
627 }
628 if (strcmp(vers,Version2) == 0) SetFormatNb(2);
629 else SetFormatNb(1);
630
631 //-----------------------------------------
632 // read the locations
633 //-----------------------------------------
634
635 //OCC19559
636 if (!myProgress.IsNull() && myProgress->UserBreak()) {
637 cout << "Interrupted by the user"<<endl;
638 // on remet le LC_NUMERIC a la precedente valeur
91322f44 639 IS.imbue (anOldLocale);
7fd59977 640 return;
641 }
642 if ( !myProgress.IsNull() )
643 myProgress->NewScope ( 10, "Locations" );
644 myLocations.SetProgress(myProgress);
645 myLocations.Read(IS);
646 if ( !myProgress.IsNull() ) {
647 myProgress->EndScope();
648 myProgress->Show();
649 }
650 //OCC19559
651 if (!myProgress.IsNull() && myProgress->UserBreak()) {
652 cout << "Interrupted by the user"<<endl;
653 // on remet le LC_NUMERIC a la precedente valeur
91322f44 654 IS.imbue (anOldLocale);
7fd59977 655 return;
656 }
657
658 //-----------------------------------------
659 // read the geometry
660 //-----------------------------------------
661 if ( !myProgress.IsNull() )
662 myProgress->NewScope ( 75, "Geometry" );
663 ReadGeometry(IS);
664 if ( !myProgress.IsNull() ) {
665 myProgress->EndScope();
666 myProgress->Show();
667 }
668
669 //-----------------------------------------
670 // read the shapes
671 //-----------------------------------------
672
673 char buffer[255];
674 IS >> buffer;
675 if (strcmp(buffer,"TShapes")) {
676 cout << "Not a TShape table"<<endl;
677 // on remet le LC_NUMERIC a la precedente valeur
91322f44 678 IS.imbue (anOldLocale);
7fd59977 679 return;
680 }
681
682 Standard_Integer i, nbShapes;
683 IS >> nbShapes;
684
685 //OCC19559
686 if ( !myProgress.IsNull() )
687 myProgress->NewScope ( 15, "Shapes" );
688 Message_ProgressSentry PS(myProgress, "Shapes", 0, nbShapes, 1);
689 for (i = 1; i <= nbShapes && PS.More(); i++, PS.Next() ) {
7fd59977 690 TopoDS_Shape S;
691
692 //Read type and create empty shape.
693
694 TopAbs_ShapeEnum T = ReadShapeEnum(IS);
695 ReadGeometry(T,IS,S);
696
697 // Set the flags
698 IS >> buffer;
699
700 // sub-shapes
701 TopoDS_Shape SS;
702 do {
703 Read(SS,IS,nbShapes);
704 if (!SS.IsNull())
705 AddShapes(S,SS);
706 } while(!SS.IsNull());
707
708 S.Free (buffer[0] == '1');
709 S.Modified (buffer[1] == '1');
710
711 if (myFormatNb == 2)
712 S.Checked (buffer[2] == '1');
713 else
714 S.Checked (Standard_False); // force check at reading..
715
716 S.Orientable(buffer[3] == '1');
717 S.Closed (buffer[4] == '1');
718 S.Infinite (buffer[5] == '1');
719 S.Convex (buffer[6] == '1');
720
721 // check
722
723 if (myFormatNb == 1)
724 Check(T,S);
725
726 myShapes.Add(S);
727 }
728 if (!myProgress.IsNull()) {
729 myProgress->EndScope();
730 myProgress->Show();
731 }
732
733 // on remet le LC_NUMERIC a la precedente valeur
91322f44 734 IS.imbue (anOldLocale);
7fd59977 735}
736
737//=======================================================================
738//function : Dump
739//purpose :
740//=======================================================================
741
742void TopTools_ShapeSet::Dump(const TopoDS_Shape& S,
743 Standard_OStream& OS)const
744{
745 if (S.IsNull()) OS << "Null shape\n";
746 OS << "Shape : " << myShapes.FindIndex(S.Located(TopLoc_Location()));
747 OS << ", ";
748 PrintOrientation(S.Orientation(),OS,Standard_False);
749 if (!S.Location().IsIdentity())
750 OS <<", location : " << myLocations.Index(S.Location());
751 OS << "\n";
752}
753
754
755//=======================================================================
756//function : Write
757//purpose :
758//=======================================================================
759
760void TopTools_ShapeSet::Write(const TopoDS_Shape& S,
761 Standard_OStream& OS)const
762{
763 if (S.IsNull()) OS << "*";
764 else {
765 PrintOrientation(S.Orientation(),OS,Standard_True);
766 OS << myShapes.Extent() - myShapes.FindIndex(S.Located(TopLoc_Location())) + 1;
767 OS << " " << myLocations.Index(S.Location()) << " ";
768 }
769}
770
771//=======================================================================
772//function : Read
773//purpose :
774//=======================================================================
775
776void TopTools_ShapeSet::Read(TopoDS_Shape& S,
777 Standard_IStream& IS)const
778{
779 Read(S,IS,myShapes.Extent());
780}
781
782//=======================================================================
783//function : Read
784//purpose :
785//=======================================================================
786
787void TopTools_ShapeSet::Read(TopoDS_Shape& S,
788 Standard_IStream& IS,
789 const Standard_Integer nbshapes)const
790{
791 if(nbshapes < 1)
792 {
793 S = TopoDS_Shape();
794 return;
795 }
796 char buffer[255];
797 IS >> buffer;
798 if (buffer[0] == '*')
799 S = TopoDS_Shape();
800 else {
801 S = myShapes(nbshapes - atoi(buffer+1) + 1);
802 switch (buffer[0]) {
803
804 case '+' :
805 S.Orientation(TopAbs_FORWARD);
806 break;
807
808 case '-' :
809 S.Orientation(TopAbs_REVERSED);
810 break;
811
812 case 'i' :
813 S.Orientation(TopAbs_INTERNAL);
814 break;
815
816 case 'e' :
817 S.Orientation(TopAbs_EXTERNAL);
818 break;
819 }
820
821 Standard_Integer l;
822 IS >> l;
823 S.Location(myLocations.Location(l));
824 }
825}
826
827//=======================================================================
828//function : AddGeometry
829//purpose :
830//=======================================================================
831
832void TopTools_ShapeSet::AddGeometry(const TopoDS_Shape&)
833{
834}
835
836//=======================================================================
837//function : DumpGeometry
838//purpose :
839//=======================================================================
840
841void TopTools_ShapeSet::DumpGeometry(Standard_OStream&) const
842{
843}
844
845
846//=======================================================================
847//function : WriteGeometry
848//purpose :
849//=======================================================================
850
851void TopTools_ShapeSet::WriteGeometry(Standard_OStream&)
852{
853}
854
855
856//=======================================================================
857//function : ReadGeometry
858//purpose :
859//=======================================================================
860
861void TopTools_ShapeSet::ReadGeometry(Standard_IStream&)
862{
863}
864
865
866//=======================================================================
867//function : DumpGeometry
868//purpose :
869//=======================================================================
870
871void TopTools_ShapeSet::DumpGeometry(const TopoDS_Shape&,
872 Standard_OStream&)const
873{
874}
875
876
877//=======================================================================
878//function : WriteGeometry
879//purpose :
880//=======================================================================
881
882void TopTools_ShapeSet::WriteGeometry(const TopoDS_Shape&,
883 Standard_OStream&)const
884{
885}
886
887
888//=======================================================================
889//function : ReadGeometry
890//purpose :
891//=======================================================================
892
893void TopTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum,
894 Standard_IStream& ,
895 TopoDS_Shape&)
896{
897}
898
899
900
901
902//=======================================================================
903//function : AddShapes
904//purpose :
905//=======================================================================
906
907void TopTools_ShapeSet::AddShapes(TopoDS_Shape&,
908 const TopoDS_Shape&)
909{
910}
911
912
913
914//=======================================================================
915//function : Check
916//purpose :
917//=======================================================================
918
919void TopTools_ShapeSet::Check(const TopAbs_ShapeEnum,
920 TopoDS_Shape&)
921{
922}
923
924//=======================================================================
925//function : NbShapes
926//purpose :
927//=======================================================================
928
929Standard_Integer TopTools_ShapeSet::NbShapes() const
930{
931 return myShapes.Extent();
932}
933
934//=======================================================================
935//function : GetProgress
936//purpose :
937//=======================================================================
938
939Handle(Message_ProgressIndicator) TopTools_ShapeSet::GetProgress() const
940{
941 return myProgress;
942}
943
944//=======================================================================
945//function : SetProgress
946//purpose :
947//=======================================================================
948
949void TopTools_ShapeSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)
950{
951 myProgress = PR;
952}
953
954