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