0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead...
[occt.git] / src / HLRBRep / HLRBRep_Surface.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-04-14
2// Created by: Modelistation
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
17#ifndef _HLRBRep_Surface_HeaderFile
18#define _HLRBRep_Surface_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <BRepAdaptor_Surface.hxx>
25#include <GeomAbs_SurfaceType.hxx>
26#include <Standard_Address.hxx>
27#include <Standard_Boolean.hxx>
28#include <Standard_Real.hxx>
29#include <Standard_Integer.hxx>
30#include <TColgp_Array2OfPnt.hxx>
31#include <GeomAbs_Shape.hxx>
32#include <gp_Vec.hxx>
33#include <gp_Cylinder.hxx>
34#include <gp_Cone.hxx>
35#include <gp_Sphere.hxx>
36#include <gp_Torus.hxx>
37#include <gp_Ax1.hxx>
38class Standard_OutOfRange;
39class Standard_NoSuchObject;
40class Standard_DomainError;
41class BRepAdaptor_Surface;
42class TopoDS_Face;
43class gp_Pnt;
44class gp_Vec;
45class gp_Pln;
46
47
48
49class HLRBRep_Surface
50{
51public:
52
53 DEFINE_STANDARD_ALLOC
54
55
56 //! Creates an undefined surface with no face loaded.
57 Standard_EXPORT HLRBRep_Surface();
58
59 void Projector (const Standard_Address Proj);
60
61 //! Returns the 3D Surface.
62 BRepAdaptor_Surface& Surface();
63
64 //! Sets the 3D Surface to be projected.
65 Standard_EXPORT void Surface (const TopoDS_Face& F);
66
67 //! returns true if it is a side face
68 Standard_EXPORT Standard_Boolean IsSide (const Standard_Real tolf, const Standard_Real toler) const;
69
70 Standard_EXPORT Standard_Boolean IsAbove (const Standard_Boolean back, const Standard_Address A, const Standard_Real tolC) const;
71
72 Standard_Real FirstUParameter() const;
73
74 Standard_Real LastUParameter() const;
75
76 Standard_Real FirstVParameter() const;
77
78 Standard_Real LastVParameter() const;
79
80 GeomAbs_Shape UContinuity() const;
81
82 GeomAbs_Shape VContinuity() const;
83
84 //! If necessary, breaks the surface in U intervals of
85 //! continuity <S>. And returns the number of
86 //! intervals.
87 Standard_Integer NbUIntervals (const GeomAbs_Shape S);
88
89 //! If necessary, breaks the surface in V intervals of
90 //! continuity <S>. And returns the number of
91 //! intervals.
92 Standard_Integer NbVIntervals (const GeomAbs_Shape S);
93
94 GeomAbs_Shape UIntervalContinuity() const;
95
96 GeomAbs_Shape VIntervalContinuity() const;
97
98 Standard_Boolean IsUClosed() const;
99
100 Standard_Boolean IsVClosed() const;
101
102 Standard_Boolean IsUPeriodic() const;
103
104 Standard_Real UPeriod() const;
105
106 Standard_Boolean IsVPeriodic() const;
107
108 Standard_Real VPeriod() const;
109
110 //! Computes the point of parameters U,V on the surface.
111 Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
112
113 //! Computes the point of parameters U,V on the surface.
114 void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
115
116 //! Computes the point and the first derivatives on
117 //! the surface.
118 //! Raised if the continuity of the current
119 //! intervals is not C1.
120 void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
121
122 //! Computes the point, the first and second
123 //! derivatives on the surface.
124 //! Raised if the continuity of the current
125 //! intervals is not C2.
126 void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const;
127
128 //! Computes the point, the first, second and third
129 //! derivatives on the surface.
130 //! Raised if the continuity of the current
131 //! intervals is not C3.
132 void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const;
133
134 //! Computes the derivative of order Nu in the
135 //! direction U and Nv in the direction V at the point P(U,
136 //! V).
137 //! Raised if the current U interval is not not CNu
138 //! and the current V interval is not CNv.
139 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
140 gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const;
141
142 //! Returns the type of the surface : Plane, Cylinder,
143 //! Cone, Sphere, Torus, BezierSurface,
144 //! BSplineSurface, SurfaceOfRevolution,
145 //! SurfaceOfExtrusion, OtherSurface
146 GeomAbs_SurfaceType GetType() const;
147
148 Standard_EXPORT gp_Pln Plane() const;
149
150 gp_Cylinder Cylinder() const;
151
152 gp_Cone Cone() const;
153
154 gp_Sphere Sphere() const;
155
156 gp_Torus Torus() const;
157
158 Standard_Integer UDegree() const;
159
160 Standard_Integer NbUPoles() const;
161
162 Standard_Integer VDegree() const;
163
164 Standard_Integer NbVPoles() const;
165
166 Standard_Integer NbUKnots() const;
167
168 Standard_Integer NbVKnots() const;
169
170 gp_Ax1 Axis() const;
171
172
173
174
175protected:
176
177
178
179
180
181private:
182
183
184 //! returns true if it is a side face
185 Standard_EXPORT Standard_Boolean SideRowsOfPoles (const Standard_Real tol, const Standard_Integer nbuPoles, const Standard_Integer nbvPoles, TColgp_Array2OfPnt& Pnt) const;
186
187
188 BRepAdaptor_Surface mySurf;
189 GeomAbs_SurfaceType myType;
190 Standard_Address myProj;
191
192
193};
194
195
196#include <HLRBRep_Surface.lxx>
197
198
199
200
201
202#endif // _HLRBRep_Surface_HeaderFile