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.
15 #ifndef _ShapePersistent_Geom_Surface_HeaderFile
16 #define _ShapePersistent_Geom_Surface_HeaderFile
18 #include <ShapePersistent_Geom.hxx>
19 #include <ShapePersistent_HArray2.hxx>
20 #include <StdLPersistent_HArray1.hxx>
21 #include <StdLPersistent_HArray2.hxx>
23 #include <Geom_Plane.hxx>
24 #include <Geom_ConicalSurface.hxx>
25 #include <Geom_CylindricalSurface.hxx>
26 #include <Geom_SphericalSurface.hxx>
27 #include <Geom_ToroidalSurface.hxx>
30 #include <gp_Cone.hxx>
31 #include <gp_Cylinder.hxx>
32 #include <gp_Sphere.hxx>
33 #include <gp_Torus.hxx>
39 class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
41 typedef Surface::PersistentBase pBase;
43 class pSweptData : protected StdObjMgt_ContentTypes
46 inline void Read (StdObjMgt_ReadData& theReadData)
47 { theReadData >> myBasisCurve >> myDirection; }
50 Reference <Curve> myBasisCurve;
51 StdObject_gp::Object <gp_Dir> myDirection;
54 struct pSwept : pBase, pSweptData {};
56 class pLinearExtrusion : public pSwept
59 virtual Handle(Geom_Surface) Import() const;
62 class pRevolution : public pSwept
65 inline void Read (StdObjMgt_ReadData& theReadData)
67 pSwept::Read (theReadData);
68 theReadData >> myLocation;
71 virtual Handle(Geom_Surface) Import() const;
74 StdObject_gp::Object<gp_Pnt> myLocation;
77 typedef pBase pBounded;
79 class pBezier : public pBounded
82 inline void Read (StdObjMgt_ReadData& theReadData)
83 { theReadData >> myURational >> myVRational >> myPoles >> myWeights; }
85 virtual Handle(Geom_Surface) Import() const;
88 Value <Standard_Boolean> myURational;
89 Value <Standard_Boolean> myVRational;
90 Reference <ShapePersistent_HArray2::Pnt> myPoles;
91 Reference <StdLPersistent_HArray2::Real> myWeights;
94 class pBSpline : public pBounded
97 inline void Read (StdObjMgt_ReadData& theReadData)
99 theReadData >> myURational >> myVRational;
100 theReadData >> myUPeriodic >> myVPeriodic;
101 theReadData >> myUSpineDegree >> myVSpineDegree;
102 theReadData >> myPoles;
103 theReadData >> myWeights;
104 theReadData >> myUKnots >> myVKnots;
105 theReadData >> myUMultiplicities >> myVMultiplicities;
108 virtual Handle(Geom_Surface) Import() const;
111 Value <Standard_Boolean> myURational;
112 Value <Standard_Boolean> myVRational;
113 Value <Standard_Boolean> myUPeriodic;
114 Value <Standard_Boolean> myVPeriodic;
115 Value <Standard_Integer> myUSpineDegree;
116 Value <Standard_Integer> myVSpineDegree;
117 Reference <ShapePersistent_HArray2::Pnt> myPoles;
118 Reference <StdLPersistent_HArray2::Real> myWeights;
119 Reference <StdLPersistent_HArray1::Real> myUKnots;
120 Reference <StdLPersistent_HArray1::Real> myVKnots;
121 Reference <StdLPersistent_HArray1::Integer> myUMultiplicities;
122 Reference <StdLPersistent_HArray1::Integer> myVMultiplicities;
125 class pRectangularTrimmed : public pBounded
128 inline void Read (StdObjMgt_ReadData& theReadData)
130 theReadData >> myBasisSurface;
131 theReadData >> myFirstU >> myLastU >> myFirstV >> myLastV;
134 virtual Handle(Geom_Surface) Import() const;
137 Reference<Surface> myBasisSurface;
138 Value<Standard_Real> myFirstU;
139 Value<Standard_Real> myLastU;
140 Value<Standard_Real> myFirstV;
141 Value<Standard_Real> myLastV;
144 class pOffset : public pBase
147 inline void Read (StdObjMgt_ReadData& theReadData)
148 { theReadData >> myBasisSurface >> myOffsetValue; }
150 virtual Handle(Geom_Surface) Import() const;
153 Reference<Surface> myBasisSurface;
154 Value<Standard_Real> myOffsetValue;
158 typedef subBase_gp<Surface, gp_Ax3> Elementary;
159 typedef instance<Elementary, Geom_Plane , gp_Ax3> Plane;
160 typedef instance<Elementary, Geom_ConicalSurface , gp_Cone> Conical;
161 typedef instance<Elementary, Geom_CylindricalSurface, gp_Cylinder> Cylindrical;
162 typedef instance<Elementary, Geom_SphericalSurface , gp_Sphere> Spherical;
163 typedef instance<Elementary, Geom_ToroidalSurface , gp_Torus> Toroidal;
165 typedef subBase<Surface, pSweptData> Swept;
166 typedef Delayed<Swept, pLinearExtrusion> LinearExtrusion;
167 typedef Delayed<Swept, pRevolution> Revolution;
169 typedef subBase_empty<Surface> Bounded;
170 typedef Delayed<Bounded, pBezier> Bezier;
171 typedef Delayed<Bounded, pBSpline> BSpline;
172 typedef Delayed<Bounded, pRectangularTrimmed> RectangularTrimmed;
174 typedef Delayed<Surface, pOffset> Offset;