1 // Created on: 1993-06-22
2 // Created by: Martine LANGLOIS
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Geom_BezierSurface.hxx>
19 #include <Geom_BoundedSurface.hxx>
20 #include <Geom_BSplineSurface.hxx>
21 #include <Geom_RectangularTrimmedSurface.hxx>
22 #include <GeomConvert.hxx>
23 #include <GeomToStep_MakeBoundedSurface.hxx>
24 #include <GeomToStep_MakeBSplineSurfaceWithKnots.hxx>
25 #include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
26 #include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
27 #include <StdFail_NotDone.hxx>
28 #include <StepGeom_BoundedSurface.hxx>
29 #include <StepGeom_BSplineSurfaceWithKnots.hxx>
30 #include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
31 #include <StepGeom_RectangularTrimmedSurface.hxx>
33 //=============================================================================
34 // Creation d' une BoundedSurface de prostep a partir d' une BoundedSurface
36 //=============================================================================
37 GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
38 ( const Handle(Geom_BoundedSurface)& S)
41 if (S->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
42 Handle(Geom_BSplineSurface) BS= Handle(Geom_BSplineSurface)::DownCast(S);
44 if (S->IsUPeriodic() || S->IsVPeriodic()) {
45 Handle(Geom_BSplineSurface) newBS =
46 Handle(Geom_BSplineSurface)::DownCast(BS->Copy());
47 newBS->SetUNotPeriodic();
48 newBS->SetVNotPeriodic();
51 if ( BS->IsURational() || BS->IsVRational() ) {
52 GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
54 theBoundedSurface = MkRatBSplineS.Value();
57 GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
58 theBoundedSurface = MkBSplineS.Value();
61 else if (S->IsKind(STANDARD_TYPE(Geom_BezierSurface))) {
62 Handle(Geom_BezierSurface) Sur = Handle(Geom_BezierSurface)::DownCast(S);
63 Handle (Geom_BSplineSurface) BS =
64 GeomConvert::SurfaceToBSplineSurface(Sur);
65 if ( BS->IsURational() || BS->IsVRational() ) {
66 GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
68 theBoundedSurface = MkRatBSplineS.Value();
71 GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
72 theBoundedSurface = MkBSplineS.Value();
75 else if (S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
76 Handle(Geom_RectangularTrimmedSurface) Sur =
77 Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
78 GeomToStep_MakeRectangularTrimmedSurface MkRTSurf(Sur);
79 theBoundedSurface = MkRTSurf.Value();
82 done = Standard_False;
86 //=============================================================================
88 //=============================================================================
90 const Handle(StepGeom_BoundedSurface) &
91 GeomToStep_MakeBoundedSurface::Value() const
93 StdFail_NotDone_Raise_if(!done, "");
94 return theBoundedSurface;