1 // Created on: 1993-07-19
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
22 #include <Standard_Stream.hxx>
23 #include <GeomTools_SurfaceSet.ixx>
24 #include <GeomTools.hxx>
25 #include <GeomTools_UndefinedTypeHandler.hxx>
27 #include <GeomTools_CurveSet.hxx>
28 #include <Geom_Plane.hxx>
29 #include <Geom_CylindricalSurface.hxx>
30 #include <Geom_ConicalSurface.hxx>
31 #include <Geom_SphericalSurface.hxx>
32 #include <Geom_ToroidalSurface.hxx>
33 #include <Geom_SurfaceOfLinearExtrusion.hxx>
34 #include <Geom_SurfaceOfRevolution.hxx>
35 #include <Geom_BezierSurface.hxx>
36 #include <Geom_BSplineSurface.hxx>
37 #include <Geom_RectangularTrimmedSurface.hxx>
38 #include <Geom_OffsetSurface.hxx>
41 #include <gp_Cylinder.hxx>
42 #include <gp_Cone.hxx>
43 #include <gp_Sphere.hxx>
44 #include <gp_Torus.hxx>
46 #include <TColStd_Array1OfReal.hxx>
47 #include <TColStd_Array1OfInteger.hxx>
48 #include <TColgp_Array1OfPnt.hxx>
49 #include <TColStd_Array2OfReal.hxx>
50 #include <TColgp_Array2OfPnt.hxx>
51 #include <Standard_Failure.hxx>
52 #include <Standard_ErrorHandler.hxx>
53 #include <Message_ProgressSentry.hxx>
60 #define LINEAREXTRUSION 6
64 #define RECTANGULAR 10
67 //=======================================================================
68 //function : GeomTools_SurfaceSet
70 //=======================================================================
72 GeomTools_SurfaceSet::GeomTools_SurfaceSet()
77 //=======================================================================
80 //=======================================================================
82 void GeomTools_SurfaceSet::Clear()
88 //=======================================================================
91 //=======================================================================
93 Standard_Integer GeomTools_SurfaceSet::Add(const Handle(Geom_Surface)& S)
99 //=======================================================================
102 //=======================================================================
104 Handle(Geom_Surface) GeomTools_SurfaceSet::Surface
105 (const Standard_Integer I)const
107 if (I <= 0 || I > myMap.Extent())
108 return Handle(Geom_Surface)();
109 return Handle(Geom_Surface)::DownCast(myMap(I));
113 //=======================================================================
116 //=======================================================================
118 Standard_Integer GeomTools_SurfaceSet::Index
119 (const Handle(Geom_Surface)& S)const
121 return myMap.FindIndex(S);
124 //=======================================================================
127 //=======================================================================
129 static void Print(const gp_Pnt P,
130 Standard_OStream& OS,
131 const Standard_Boolean compact)
134 if (!compact) OS << ",";
137 if (!compact) OS << ",";
143 //=======================================================================
146 //=======================================================================
148 static void Print(const gp_Dir D,
149 Standard_OStream& OS,
150 const Standard_Boolean compact)
153 if (!compact) OS << ",";
156 if (!compact) OS << ",";
162 //=======================================================================
165 //=======================================================================
167 static void Print(const Handle(Geom_Plane)& S,
168 Standard_OStream& OS,
169 const Standard_Boolean compact)
177 if (!compact) OS << "\n Origin :";
178 Print(P.Location(),OS,compact);
179 if (!compact) OS << "\n Axis :";
180 Print(P.Axis().Direction(),OS,compact);
181 if (!compact) OS << "\n XAxis :";
182 Print(P.XAxis().Direction(),OS,compact);
183 if (!compact) OS << "\n YAxis :";
184 Print(P.YAxis().Direction(),OS,compact);
186 if (!compact) OS << "\n";
190 //=======================================================================
193 //=======================================================================
195 static void Print(const Handle(Geom_CylindricalSurface)& S,
196 Standard_OStream& OS,
197 const Standard_Boolean compact)
200 OS << CYLINDER << " ";
202 OS << "CylindricalSurface";
204 gp_Cylinder P = S->Cylinder();
205 if (!compact) OS << "\n Origin :";
206 Print(P.Location(),OS,compact);
207 if (!compact) OS << "\n Axis :";
208 Print(P.Axis().Direction(),OS,compact);
209 if (!compact) OS << "\n XAxis :";
210 Print(P.XAxis().Direction(),OS,compact);
211 if (!compact) OS << "\n YAxis :";
212 Print(P.YAxis().Direction(),OS,compact);
213 if (!compact) OS << "\n Radius :";
216 if (!compact) OS << "\n";
220 //=======================================================================
223 //=======================================================================
225 static void Print(const Handle(Geom_ConicalSurface)& S,
226 Standard_OStream& OS,
227 const Standard_Boolean compact)
232 OS << "ConicalSurface";
234 gp_Cone P = S->Cone();
235 if (!compact) OS << "\n Origin :";
236 Print(P.Location(),OS,compact);
237 if (!compact) OS << "\n Axis :";
238 Print(P.Axis().Direction(),OS,compact);
239 if (!compact) OS << "\n XAxis :";
240 Print(P.XAxis().Direction(),OS,compact);
241 if (!compact) OS << "\n YAxis :";
242 Print(P.YAxis().Direction(),OS,compact);
243 if (!compact) OS << "\n Radius :";
246 if (!compact) OS << "\n Angle :";
249 if (!compact) OS << "\n";
253 //=======================================================================
256 //=======================================================================
258 static void Print(const Handle(Geom_SphericalSurface)& S,
259 Standard_OStream& OS,
260 const Standard_Boolean compact)
265 OS << "SphericalSurface";
267 gp_Sphere P = S->Sphere();
268 if (!compact) OS << "\n Center :";
269 Print(P.Location(),OS,compact);
270 if (!compact) OS << "\n Axis :";
271 Print(P.Position().Axis().Direction(),OS,compact);
272 if (!compact) OS << "\n XAxis :";
273 Print(P.XAxis().Direction(),OS,compact);
274 if (!compact) OS << "\n YAxis :";
275 Print(P.YAxis().Direction(),OS,compact);
276 if (!compact) OS << "\n Radius :";
279 if (!compact) OS << "\n";
283 //=======================================================================
286 //=======================================================================
288 static void Print(const Handle(Geom_ToroidalSurface)& S,
289 Standard_OStream& OS,
290 const Standard_Boolean compact)
295 OS << "ToroidalSurface";
297 gp_Torus P = S->Torus();
298 if (!compact) OS << "\n Origin :";
299 Print(P.Location(),OS,compact);
300 if (!compact) OS << "\n Axis :";
301 Print(P.Axis().Direction(),OS,compact);
302 if (!compact) OS << "\n XAxis :";
303 Print(P.XAxis().Direction(),OS,compact);
304 if (!compact) OS << "\n YAxis :";
305 Print(P.YAxis().Direction(),OS,compact);
306 if (!compact) OS << "\n Radii :";
307 OS << P.MajorRadius() << " " << P.MinorRadius();
309 if (!compact) OS << "\n";
313 //=======================================================================
316 //=======================================================================
318 static void Print(const Handle(Geom_SurfaceOfLinearExtrusion)& S,
319 Standard_OStream& OS,
320 const Standard_Boolean compact)
323 OS << LINEAREXTRUSION << " ";
325 OS << "SurfaceOfLinearExtrusion";
327 if (!compact) OS << "\n Direction :";
328 Print(S->Direction(),OS,compact);
329 if (!compact) OS << "\n Basis curve : ";
331 GeomTools_CurveSet::PrintCurve(S->BasisCurve(),OS,compact);
335 //=======================================================================
338 //=======================================================================
340 static void Print(const Handle(Geom_SurfaceOfRevolution)& S,
341 Standard_OStream& OS,
342 const Standard_Boolean compact)
345 OS << REVOLUTION <<" ";
347 OS << "SurfaceOfRevolution";
349 if (!compact) OS << "\n Origin :";
350 Print(S->Location(),OS,compact);
351 if (!compact) OS << "\n Direction :";
352 Print(S->Direction(),OS,compact);
353 if (!compact) OS << "\n Basis curve : ";
355 GeomTools_CurveSet::PrintCurve(S->BasisCurve(),OS,compact);
359 //=======================================================================
362 //=======================================================================
364 static void Print(const Handle(Geom_BezierSurface)& S,
365 Standard_OStream& OS,
366 const Standard_Boolean compact)
371 OS << "BezierSurface";
374 Standard_Boolean urational = S->IsURational();
375 Standard_Boolean vrational = S->IsVRational();
377 OS << (urational ? 1 : 0) << " ";
383 OS << (vrational ? 1 : 0) << " ";
390 Standard_Boolean uclosed = S->IsUClosed();
391 Standard_Boolean vclosed = S->IsVClosed();
399 Standard_Integer i,j,udegree,vdegree;
400 udegree = S->UDegree();
401 vdegree = S->VDegree();
402 if (!compact) OS << "\n Degrees :";
403 OS << udegree << " " << vdegree << " ";
405 for (i = 1; i <= udegree+1; i++) {
406 for (j = 1; j <= vdegree+1; j++) {
407 if (!compact) OS << "\n "<<setw(2)<<i<<", "<<setw(2)<<j<<" : ";
408 Print(S->Pole(i,j),OS,compact);
409 if (urational || vrational)
410 OS << " " << S->Weight(i,j);
417 if (!compact) OS << "\n";
421 //=======================================================================
424 //=======================================================================
426 static void Print(const Handle(Geom_BSplineSurface)& S,
427 Standard_OStream& OS,
428 const Standard_Boolean compact)
431 OS << BSPLINE << " ";
433 OS << "BSplineSurface";
435 Standard_Boolean urational = S->IsURational();
436 Standard_Boolean vrational = S->IsVRational();
438 OS << (urational ? 1 : 0) << " ";
444 OS << (vrational ? 1 : 0) << " ";
450 Standard_Boolean uperiodic = S->IsUPeriodic();
451 Standard_Boolean vperiodic = S->IsVPeriodic();
453 OS << (uperiodic ? 1 : 0) << " ";
459 OS << (vperiodic ? 1 : 0) << " ";
466 Standard_Boolean uclosed = S->IsUClosed();
467 Standard_Boolean vclosed = S->IsVClosed();
476 Standard_Integer i,j,udegree,vdegree,nbupoles,nbvpoles,nbuknots,nbvknots;
477 udegree = S->UDegree();
478 vdegree = S->VDegree();
479 nbupoles = S->NbUPoles();
480 nbvpoles = S->NbVPoles();
481 nbuknots = S->NbUKnots();
482 nbvknots = S->NbVKnots();
483 if (!compact) OS << "\n Degrees :";
484 OS << udegree << " " << vdegree << " ";
485 if (!compact) OS << "\n NbPoles :";
486 OS << nbupoles << " " << nbvpoles << " ";
487 if (!compact) OS << "\n NbKnots :";
488 OS << nbuknots << " " << nbvknots << " ";
490 if (!compact) OS << "\n Poles :\n";
491 for (i = 1; i <= nbupoles; i++) {
492 for (j = 1; j <= nbvpoles; j++) {
493 if (!compact) OS << "\n "<<setw(2)<<i<<", "<<setw(2)<<j<<" : ";
494 Print(S->Pole(i,j),OS,compact);
495 if (urational || vrational)
496 OS << " " << S->Weight(i,j);
503 if (!compact) OS << "\n UKnots :\n";
504 for (i = 1; i <= nbuknots; i++) {
505 if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
506 OS << S->UKnot(i) << " " << S->UMultiplicity(i) <<"\n";
509 if (!compact) OS << "\n VKnots :\n";
510 for (i = 1; i <= nbvknots; i++) {
511 if (!compact) OS << "\n "<<setw(2)<<i<<" : ";
512 OS << S->VKnot(i) << " " << S->VMultiplicity(i) <<"\n";
515 if (!compact) OS << "\n";
519 //=======================================================================
522 //=======================================================================
524 static void Print(const Handle(Geom_RectangularTrimmedSurface)& S,
525 Standard_OStream& OS,
526 const Standard_Boolean compact)
529 OS << RECTANGULAR << " ";
531 OS << "RectangularTrimmedSurface";
533 Standard_Real U1,U2,V1,V2;
534 S->Bounds(U1,U2,V1,V2);
535 if (!compact) OS << "\nParameters : ";
536 OS << U1 << " " << U2 << " " << V1 << " " << V2 <<"\n";
537 if (!compact) OS << "BasisSurface :\n";
538 GeomTools_SurfaceSet::PrintSurface(S->BasisSurface(),OS,compact);
542 //=======================================================================
545 //=======================================================================
547 static void Print(const Handle(Geom_OffsetSurface)& S,
548 Standard_OStream& OS,
549 const Standard_Boolean compact)
554 OS << "OffsetSurface";
556 if (!compact) OS << "\nOffset : ";
557 OS << S->Offset() <<"\n";
558 if (!compact) OS << "BasisSurface :\n";
559 GeomTools_SurfaceSet::PrintSurface(S->BasisSurface(),OS,compact);
563 //=======================================================================
564 //function : PrintSurface
566 //=======================================================================
568 void GeomTools_SurfaceSet::PrintSurface(const Handle(Geom_Surface)& S,
569 Standard_OStream& OS,
570 const Standard_Boolean compact)
572 Handle(Standard_Type) TheType = S->DynamicType();
574 if ( TheType == STANDARD_TYPE(Geom_Plane)) {
575 Print(Handle(Geom_Plane)::DownCast(S),OS,compact);
577 else if ( TheType == STANDARD_TYPE(Geom_CylindricalSurface)) {
578 Print(Handle(Geom_CylindricalSurface)::DownCast(S),OS,compact);
580 else if ( TheType == STANDARD_TYPE(Geom_ConicalSurface)) {
581 Print(Handle(Geom_ConicalSurface)::DownCast(S),OS,compact);
583 else if ( TheType == STANDARD_TYPE(Geom_SphericalSurface)) {
584 Print(Handle(Geom_SphericalSurface)::DownCast(S),OS,compact);
586 else if ( TheType == STANDARD_TYPE(Geom_ToroidalSurface)) {
587 Print(Handle(Geom_ToroidalSurface)::DownCast(S),OS,compact);
589 else if ( TheType == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion)) {
590 Print(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(S),OS,compact);
592 else if ( TheType == STANDARD_TYPE(Geom_SurfaceOfRevolution)) {
593 Print(Handle(Geom_SurfaceOfRevolution)::DownCast(S),OS,compact);
595 else if ( TheType == STANDARD_TYPE(Geom_BezierSurface)) {
596 Print(Handle(Geom_BezierSurface)::DownCast(S),OS,compact);
598 else if ( TheType == STANDARD_TYPE(Geom_BSplineSurface)) {
599 Print(Handle(Geom_BSplineSurface)::DownCast(S),OS,compact);
601 else if ( TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
602 Print(Handle(Geom_RectangularTrimmedSurface)::DownCast(S),OS,compact);
604 else if ( TheType == STANDARD_TYPE(Geom_OffsetSurface)) {
605 Print(Handle(Geom_OffsetSurface)::DownCast(S),OS,compact);
608 GeomTools::GetUndefinedTypeHandler()->PrintSurface(S,OS,compact);
610 // OS << "***** Unknown Surface ********\n";
612 // cout << "***** Unknown Surface ********"<<endl;
616 //=======================================================================
619 //=======================================================================
621 void GeomTools_SurfaceSet::Dump(Standard_OStream& OS)const
623 Standard_Integer i, nbsurf = myMap.Extent();
624 OS << "\n -------\n";
625 OS << "Dump of "<< nbsurf << " surfaces ";
626 OS << "\n -------\n\n";
628 for (i = 1; i <= nbsurf; i++) {
629 OS << setw(4) << i << " : ";
630 PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_False);
635 //=======================================================================
638 //=======================================================================
640 void GeomTools_SurfaceSet::Write(Standard_OStream& OS)const
642 int prec = OS.precision(17);
644 Standard_Integer i, nbsurf = myMap.Extent();
645 OS << "Surfaces "<< nbsurf << "\n";
647 Handle(Message_ProgressIndicator) progress = GetProgress();
648 Message_ProgressSentry PS(progress, "Surfaces", 0, nbsurf, 1);
650 for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
651 if ( !progress.IsNull() )
654 PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_True);
661 //=======================================================================
664 //=======================================================================
666 static Standard_IStream& operator>>(Standard_IStream& IS, gp_Pnt& P)
668 Standard_Real X=0.,Y=0.,Z=0.;
674 //=======================================================================
677 //=======================================================================
679 static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D)
681 Standard_Real X=0.,Y=0.,Z=0.;
687 //=======================================================================
690 //=======================================================================
692 static Standard_IStream& operator>>(Standard_IStream& IS, gp_Ax3& A3)
695 gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
696 IS >> P >> A >> AX >> AY;
698 if (AY.DotCross(A,AX) < 0)
705 //=======================================================================
706 //function : operator>>
708 //=======================================================================
710 static Standard_IStream& operator>>(Standard_IStream& IS,
711 Handle(Geom_Plane)& S)
715 S = new Geom_Plane(A);
719 //=======================================================================
720 //function : operator>>
722 //=======================================================================
724 static Standard_IStream& operator>>(Standard_IStream& IS,
725 Handle(Geom_CylindricalSurface)& S)
730 S = new Geom_CylindricalSurface(A,R);
734 //=======================================================================
735 //function : operator>>
737 //=======================================================================
739 static Standard_IStream& operator>>(Standard_IStream& IS,
740 Handle(Geom_ConicalSurface)& S)
743 Standard_Real R=0.,Ang=0.;
745 S = new Geom_ConicalSurface(A,Ang,R);
749 //=======================================================================
750 //function : operator>>
752 //=======================================================================
754 static Standard_IStream& operator>>(Standard_IStream& IS,
755 Handle(Geom_SphericalSurface)& S)
760 S = new Geom_SphericalSurface(A,R);
764 //=======================================================================
765 //function : operator>>
767 //=======================================================================
769 static Standard_IStream& operator>>(Standard_IStream& IS,
770 Handle(Geom_ToroidalSurface)& S)
773 Standard_Real R1=0.,R2=0.;
775 S = new Geom_ToroidalSurface(A,R1,R2);
779 //=======================================================================
780 //function : operator>>
782 //=======================================================================
784 static Standard_IStream& operator>>(Standard_IStream& IS,
785 Handle(Geom_SurfaceOfLinearExtrusion)& S)
788 Handle(Geom_Curve) C;
790 GeomTools_CurveSet::ReadCurve(IS,C);
791 S = new Geom_SurfaceOfLinearExtrusion(C,D);
795 //=======================================================================
796 //function : operator>>
798 //=======================================================================
800 static Standard_IStream& operator>>(Standard_IStream& IS,
801 Handle(Geom_SurfaceOfRevolution)& S)
805 Handle(Geom_Curve) C;
807 GeomTools_CurveSet::ReadCurve(IS,C);
808 S = new Geom_SurfaceOfRevolution(C,gp_Ax1(P,D));
812 //=======================================================================
813 //function : operator>>
815 //=======================================================================
817 static Standard_IStream& operator>>(Standard_IStream& IS,
818 Handle(Geom_BezierSurface)& S)
820 Standard_Boolean urational=Standard_False, vrational=Standard_False;
821 IS >> urational >> vrational;
822 Standard_Integer udegree=0, vdegree=0;
823 IS >> udegree >> vdegree;
824 TColgp_Array2OfPnt poles(1,udegree+1,1,vdegree+1);
825 TColStd_Array2OfReal weights(1,udegree+1,1,vdegree+1);
827 Standard_Integer i,j;
828 for (i = 1; i <= udegree+1; i++) {
829 for (j = 1; j <= vdegree+1; j++) {
831 if (urational || vrational)
836 if (urational || vrational)
837 S = new Geom_BezierSurface(poles,weights);
839 S = new Geom_BezierSurface(poles);
843 //=======================================================================
844 //function : operator>>
846 //=======================================================================
848 static Standard_IStream& operator>>(Standard_IStream& IS,
849 Handle(Geom_BSplineSurface)& S)
851 Standard_Boolean urational=Standard_False, vrational=Standard_False,
852 uperiodic=Standard_False, vperiodic=Standard_False;
853 IS >> urational >> vrational;
854 IS >> uperiodic >> vperiodic;
855 Standard_Integer udegree=0, vdegree=0,nbupoles=0,nbvpoles=0,nbuknots=0,nbvknots=0;
856 IS >> udegree >> vdegree;
857 IS >> nbupoles >> nbvpoles;
858 IS >> nbuknots >> nbvknots;
860 TColgp_Array2OfPnt poles(1,nbupoles,1,nbvpoles);
861 TColStd_Array2OfReal weights(1,nbupoles,1,nbvpoles);
863 Standard_Integer i,j;
864 for (i = 1; i <= nbupoles; i++) {
865 for (j = 1; j <= nbvpoles; j++) {
867 if (urational || vrational)
872 TColStd_Array1OfReal uknots(1,nbuknots);
873 TColStd_Array1OfInteger umults(1,nbuknots);
874 for (i = 1; i <= nbuknots; i++) {
875 IS >> uknots(i) >> umults(i);
878 TColStd_Array1OfReal vknots(1,nbvknots);
879 TColStd_Array1OfInteger vmults(1,nbvknots);
880 for (i = 1; i <= nbvknots; i++) {
881 IS >> vknots(i) >> vmults(i);
884 if (urational || vrational)
885 S = new Geom_BSplineSurface(poles,weights,uknots,vknots,umults,vmults,
886 udegree,vdegree,uperiodic,vperiodic);
888 S = new Geom_BSplineSurface(poles,uknots,vknots,umults,vmults,
889 udegree,vdegree,uperiodic,vperiodic);
893 //=======================================================================
894 //function : operator>>
896 //=======================================================================
898 static Standard_IStream& operator>>(Standard_IStream& IS,
899 Handle(Geom_RectangularTrimmedSurface)& S)
901 Standard_Real U1=0.,U2=0.,V1=0.,V2=0.;
902 IS >> U1 >> U2 >> V1 >> V2;
903 Handle(Geom_Surface) BS;
904 GeomTools_SurfaceSet::ReadSurface(IS,BS);
905 S = new Geom_RectangularTrimmedSurface(BS,U1,U2,V1,V2);
909 //=======================================================================
910 //function : operator>>
912 //=======================================================================
914 static Standard_IStream& operator>>(Standard_IStream& IS,
915 Handle(Geom_OffsetSurface)& S)
919 Handle(Geom_Surface) BS;
920 GeomTools_SurfaceSet::ReadSurface(IS,BS);
921 S = new Geom_OffsetSurface(BS,O);
926 //=======================================================================
927 //function : ReadSurface
929 //=======================================================================
931 Standard_IStream& GeomTools_SurfaceSet::ReadSurface(Standard_IStream& IS,
932 Handle(Geom_Surface)& S)
934 Standard_Integer stype;
943 Handle(Geom_Plane) SS;
951 Handle(Geom_CylindricalSurface) SS;
959 Handle(Geom_ConicalSurface) SS;
967 Handle(Geom_SphericalSurface) SS;
975 Handle(Geom_ToroidalSurface) SS;
981 case LINEAREXTRUSION :
983 Handle(Geom_SurfaceOfLinearExtrusion) SS;
991 Handle(Geom_SurfaceOfRevolution) SS;
999 Handle(Geom_BezierSurface) SS;
1007 Handle(Geom_BSplineSurface) SS;
1015 Handle(Geom_RectangularTrimmedSurface) SS;
1023 Handle(Geom_OffsetSurface) SS;
1031 Handle(Geom_Surface) SS;
1032 GeomTools::GetUndefinedTypeHandler()->ReadSurface(stype,IS,SS);
1038 catch(Standard_Failure) {
1040 Handle(Standard_Failure) anExc = Standard_Failure::Caught();
1041 cout <<"EXCEPTION in GeomTools_SurfaceSet::ReadSurface(..)!!!" << endl;
1042 cout << anExc << endl;
1049 //=======================================================================
1052 //=======================================================================
1054 void GeomTools_SurfaceSet::Read(Standard_IStream& IS)
1058 if (strcmp(buffer,"Surfaces")) {
1059 cout << "Not a surface table"<<endl;
1063 Handle(Geom_Surface) S;
1064 Standard_Integer i, nbsurf;
1067 Handle(Message_ProgressIndicator) progress = GetProgress();
1068 Message_ProgressSentry PS(progress, "Surfaces", 0, nbsurf, 1);
1069 for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
1070 if ( !progress.IsNull() )
1073 GeomTools_SurfaceSet::ReadSurface(IS,S);
1078 //=======================================================================
1079 //function : GetProgress
1081 //=======================================================================
1083 Handle(Message_ProgressIndicator) GeomTools_SurfaceSet::GetProgress() const
1088 //=======================================================================
1089 //function : SetProgress
1091 //=======================================================================
1093 void GeomTools_SurfaceSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)