1 // Copyright (c) 2015 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <ShapePersistent_Geom_Surface.hxx>
16 #include <Geom_SurfaceOfLinearExtrusion.hxx>
17 #include <Geom_SurfaceOfRevolution.hxx>
18 #include <Geom_BezierSurface.hxx>
19 #include <Geom_BSplineSurface.hxx>
20 #include <Geom_RectangularTrimmedSurface.hxx>
21 #include <Geom_OffsetSurface.hxx>
26 Handle(Geom_Surface) ShapePersistent_Geom_Surface::pLinearExtrusion::Import()
29 if (myBasisCurve.IsNull())
32 return new Geom_SurfaceOfLinearExtrusion
33 (myBasisCurve->Import(), myDirection);
36 Handle(Geom_Surface) ShapePersistent_Geom_Surface::pRevolution::Import() const
38 if (myBasisCurve.IsNull())
41 return new Geom_SurfaceOfRevolution
42 (myBasisCurve->Import(), gp_Ax1 (myLocation, myDirection));
45 Handle(Geom_Surface) ShapePersistent_Geom_Surface::pBezier::Import() const
50 if (myURational || myVRational)
52 if (myWeights.IsNull())
54 return new Geom_BezierSurface (*myPoles->Array(), *myWeights->Array());
57 return new Geom_BezierSurface (*myPoles->Array());
60 Handle(Geom_Surface) ShapePersistent_Geom_Surface::pBSpline::Import() const
62 if (myPoles.IsNull() || myUKnots.IsNull() || myVKnots.IsNull()
63 || myUMultiplicities.IsNull() || myVMultiplicities.IsNull())
66 if (myURational || myVRational)
68 if (myWeights.IsNull())
71 return new Geom_BSplineSurface (*myPoles->Array(),
75 *myUMultiplicities->Array(),
76 *myVMultiplicities->Array(),
83 return new Geom_BSplineSurface (*myPoles->Array(),
86 *myUMultiplicities->Array(),
87 *myVMultiplicities->Array(),
94 Handle(Geom_Surface) ShapePersistent_Geom_Surface::pRectangularTrimmed::Import()
97 if (myBasisSurface.IsNull())
100 return new Geom_RectangularTrimmedSurface
101 (myBasisSurface->Import(), myFirstU, myLastU, myFirstV, myLastV);
104 Handle(Geom_Surface) ShapePersistent_Geom_Surface::pOffset::Import() const
106 if (myBasisSurface.IsNull())
109 return new Geom_OffsetSurface (myBasisSurface->Import(), myOffsetValue);