42cf5bc1 |
1 | // Created on: 1993-04-21 |
2 | // Created by: Bruno DUMORTIER |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
6b84c3f7 |
17 | #ifndef _GeomAdaptor_SurfaceOfLinearExtrusion_HeaderFile |
18 | #define _GeomAdaptor_SurfaceOfLinearExtrusion_HeaderFile |
42cf5bc1 |
19 | |
6b84c3f7 |
20 | #include <GeomAdaptor_Surface.hxx> |
21 | |
42cf5bc1 |
22 | class gp_Pln; |
23 | class gp_Cylinder; |
24 | class gp_Cone; |
25 | class gp_Sphere; |
26 | class gp_Torus; |
27 | class Geom_BezierSurface; |
28 | class Geom_BSplineSurface; |
29 | class gp_Ax1; |
30 | |
c22b52d6 |
31 | DEFINE_STANDARD_HANDLE(GeomAdaptor_SurfaceOfLinearExtrusion, GeomAdaptor_Surface) |
42cf5bc1 |
32 | |
33 | //! Generalised cylinder. This surface is obtained by sweeping a curve in a given |
34 | //! direction. The parametrization range for the parameter U is defined |
35 | //! with referenced the curve. |
36 | //! The parametrization range for the parameter V is ]-infinite,+infinite[ |
37 | //! The position of the curve gives the origin for the |
38 | //! parameter V. |
39 | //! The continuity of the surface is CN in the V direction. |
6b84c3f7 |
40 | class GeomAdaptor_SurfaceOfLinearExtrusion : public GeomAdaptor_Surface |
42cf5bc1 |
41 | { |
c22b52d6 |
42 | DEFINE_STANDARD_RTTIEXT(GeomAdaptor_SurfaceOfLinearExtrusion, GeomAdaptor_Surface) |
42cf5bc1 |
43 | public: |
44 | |
6b84c3f7 |
45 | Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion(); |
42cf5bc1 |
46 | |
47 | //! The Curve is loaded. |
c22b52d6 |
48 | Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion(const Handle(Adaptor3d_Curve)& C); |
42cf5bc1 |
49 | |
50 | //! Thew Curve and the Direction are loaded. |
c22b52d6 |
51 | Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion(const Handle(Adaptor3d_Curve)& C, const gp_Dir& V); |
42cf5bc1 |
52 | |
872a7e3a |
53 | //! Shallow copy of adaptor |
54 | Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const Standard_OVERRIDE; |
55 | |
42cf5bc1 |
56 | //! Changes the Curve |
c22b52d6 |
57 | Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C); |
42cf5bc1 |
58 | |
59 | //! Changes the Direction |
60 | Standard_EXPORT void Load (const gp_Dir& V); |
61 | |
62 | Standard_EXPORT Standard_Real FirstUParameter() const Standard_OVERRIDE; |
63 | |
64 | Standard_EXPORT Standard_Real LastUParameter() const Standard_OVERRIDE; |
65 | |
66 | Standard_EXPORT Standard_Real FirstVParameter() const Standard_OVERRIDE; |
67 | |
68 | Standard_EXPORT Standard_Real LastVParameter() const Standard_OVERRIDE; |
69 | |
70 | Standard_EXPORT GeomAbs_Shape UContinuity() const Standard_OVERRIDE; |
71 | |
72 | //! Return CN. |
73 | Standard_EXPORT GeomAbs_Shape VContinuity() const Standard_OVERRIDE; |
74 | |
75 | //! Returns the number of U intervals for continuity |
76 | //! <S>. May be one if UContinuity(me) >= <S> |
77 | Standard_EXPORT Standard_Integer NbUIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE; |
78 | |
79 | //! Returns the number of V intervals for continuity |
80 | //! <S>. May be one if VContinuity(me) >= <S> |
81 | Standard_EXPORT Standard_Integer NbVIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE; |
82 | |
83 | //! Returns the intervals with the requested continuity |
84 | //! in the U direction. |
85 | Standard_EXPORT void UIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE; |
86 | |
87 | //! Returns the intervals with the requested continuity |
88 | //! in the V direction. |
89 | Standard_EXPORT void VIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE; |
90 | |
91 | //! Returns a surface trimmed in the U direction |
92 | //! equivalent of <me> between |
93 | //! parameters <First> and <Last>. <Tol> is used to |
94 | //! test for 3d points confusion. |
95 | //! If <First> >= <Last> |
c22b52d6 |
96 | Standard_EXPORT Handle(Adaptor3d_Surface) UTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE; |
42cf5bc1 |
97 | |
98 | //! Returns a surface trimmed in the V direction between |
99 | //! parameters <First> and <Last>. <Tol> is used to |
100 | //! test for 3d points confusion. |
101 | //! If <First> >= <Last> |
c22b52d6 |
102 | Standard_EXPORT Handle(Adaptor3d_Surface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE; |
42cf5bc1 |
103 | |
104 | Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE; |
105 | |
106 | Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE; |
107 | |
108 | Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE; |
109 | |
110 | Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE; |
111 | |
112 | Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE; |
113 | |
114 | Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE; |
6b84c3f7 |
115 | |
42cf5bc1 |
116 | //! Returns the parametric U resolution corresponding |
117 | //! to the real space resolution <R3d>. |
118 | Standard_EXPORT Standard_Real UResolution (const Standard_Real R3d) const Standard_OVERRIDE; |
119 | |
120 | //! Returns the parametric V resolution corresponding |
121 | //! to the real space resolution <R3d>. |
122 | Standard_EXPORT Standard_Real VResolution (const Standard_Real R3d) const Standard_OVERRIDE; |
123 | |
124 | //! Returns the type of the surface : Plane, Cylinder, |
125 | //! Cone, Sphere, Torus, BezierSurface, |
126 | //! BSplineSurface, SurfaceOfRevolution, |
127 | //! SurfaceOfExtrusion, OtherSurface |
128 | Standard_EXPORT GeomAbs_SurfaceType GetType() const Standard_OVERRIDE; |
129 | |
130 | Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE; |
131 | |
132 | Standard_EXPORT gp_Cylinder Cylinder() const Standard_OVERRIDE; |
133 | |
134 | Standard_EXPORT gp_Cone Cone() const Standard_OVERRIDE; |
135 | |
136 | Standard_EXPORT gp_Sphere Sphere() const Standard_OVERRIDE; |
137 | |
138 | Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE; |
139 | |
140 | Standard_EXPORT Standard_Integer UDegree() const Standard_OVERRIDE; |
141 | |
142 | Standard_EXPORT Standard_Integer NbUPoles() const Standard_OVERRIDE; |
6b84c3f7 |
143 | |
42cf5bc1 |
144 | Standard_EXPORT Standard_Boolean IsURational() const Standard_OVERRIDE; |
145 | |
146 | Standard_EXPORT Standard_Boolean IsVRational() const Standard_OVERRIDE; |
147 | |
148 | Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE; |
149 | |
150 | Standard_EXPORT Handle(Geom_BSplineSurface) BSpline() const Standard_OVERRIDE; |
151 | |
152 | Standard_EXPORT gp_Ax1 AxeOfRevolution() const Standard_OVERRIDE; |
153 | |
154 | Standard_EXPORT gp_Dir Direction() const Standard_OVERRIDE; |
155 | |
c22b52d6 |
156 | Standard_EXPORT Handle(Adaptor3d_Curve) BasisCurve() const Standard_OVERRIDE; |
42cf5bc1 |
157 | |
158 | private: |
c22b52d6 |
159 | Handle(Adaptor3d_Curve) myBasisCurve; ///< extruded curve |
6b84c3f7 |
160 | gp_Dir myDirection; ///< direction of extrusion |
161 | Standard_Boolean myHaveDir; ///< whether the direction of extrusion is initialized |
42cf5bc1 |
162 | }; |
163 | |
6b84c3f7 |
164 | #endif // _GeomAdaptor_SurfaceOfLinearExtrusion_HeaderFile |