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