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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _HLRBRep_Surface_HeaderFile
18 #define _HLRBRep_Surface_HeaderFile
20 #include <HLRBRep_Curve.hxx>
22 #include <Standard.hxx>
23 #include <Standard_DefineAlloc.hxx>
24 #include <Standard_Handle.hxx>
26 #include <BRepAdaptor_Surface.hxx>
27 #include <GeomAbs_SurfaceType.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Integer.hxx>
31 #include <TColgp_Array2OfPnt.hxx>
32 #include <GeomAbs_Shape.hxx>
34 #include <gp_Cylinder.hxx>
35 #include <gp_Cone.hxx>
36 #include <gp_Sphere.hxx>
37 #include <gp_Torus.hxx>
39 class Standard_OutOfRange;
40 class Standard_NoSuchObject;
41 class Standard_DomainError;
42 class BRepAdaptor_Surface;
57 //! Creates an undefined surface with no face loaded.
58 Standard_EXPORT HLRBRep_Surface();
60 void Projector (const HLRAlgo_Projector* Proj)
65 //! Returns the 3D Surface.
66 BRepAdaptor_Surface& Surface();
68 //! Sets the 3D Surface to be projected.
69 Standard_EXPORT void Surface (const TopoDS_Face& F);
71 //! returns true if it is a side face
72 Standard_EXPORT Standard_Boolean IsSide (const Standard_Real tolf, const Standard_Real toler) const;
74 Standard_EXPORT Standard_Boolean IsAbove (const Standard_Boolean back, const HLRBRep_Curve* A, const Standard_Real tolC) const;
76 Standard_Real FirstUParameter() const;
78 Standard_Real LastUParameter() const;
80 Standard_Real FirstVParameter() const;
82 Standard_Real LastVParameter() const;
84 GeomAbs_Shape UContinuity() const;
86 GeomAbs_Shape VContinuity() const;
88 //! If necessary, breaks the surface in U intervals of
89 //! continuity <S>. And returns the number of
91 Standard_Integer NbUIntervals (const GeomAbs_Shape S);
93 //! If necessary, breaks the surface in V intervals of
94 //! continuity <S>. And returns the number of
96 Standard_Integer NbVIntervals (const GeomAbs_Shape S);
98 GeomAbs_Shape UIntervalContinuity() const;
100 GeomAbs_Shape VIntervalContinuity() const;
102 Standard_Boolean IsUClosed() const;
104 Standard_Boolean IsVClosed() const;
106 Standard_Boolean IsUPeriodic() const;
108 Standard_Real UPeriod() const;
110 Standard_Boolean IsVPeriodic() const;
112 Standard_Real VPeriod() const;
114 //! Computes the point of parameters U,V on the surface.
115 Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
117 //! Computes the point of parameters U,V on the surface.
118 void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
120 //! Computes the point and the first derivatives on
122 //! Raised if the continuity of the current
123 //! intervals is not C1.
124 void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
126 //! Computes the point, the first and second
127 //! derivatives on the surface.
128 //! Raised if the continuity of the current
129 //! intervals is not C2.
130 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;
132 //! Computes the point, the first, second and third
133 //! derivatives on the surface.
134 //! Raised if the continuity of the current
135 //! intervals is not C3.
136 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;
138 //! Computes the derivative of order Nu in the
139 //! direction U and Nv in the direction V at the point P(U,
141 //! Raised if the current U interval is not not CNu
142 //! and the current V interval is not CNv.
143 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
144 gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const;
146 //! Returns the type of the surface : Plane, Cylinder,
147 //! Cone, Sphere, Torus, BezierSurface,
148 //! BSplineSurface, SurfaceOfRevolution,
149 //! SurfaceOfExtrusion, OtherSurface
150 GeomAbs_SurfaceType GetType() const;
152 Standard_EXPORT gp_Pln Plane() const;
154 gp_Cylinder Cylinder() const;
156 gp_Cone Cone() const;
158 gp_Sphere Sphere() const;
160 gp_Torus Torus() const;
162 Standard_Integer UDegree() const;
164 Standard_Integer NbUPoles() const;
166 Standard_Integer VDegree() const;
168 Standard_Integer NbVPoles() const;
170 Standard_Integer NbUKnots() const;
172 Standard_Integer NbVKnots() const;
188 //! returns true if it is a side face
189 Standard_EXPORT Standard_Boolean SideRowsOfPoles (const Standard_Real tol, const Standard_Integer nbuPoles, const Standard_Integer nbvPoles, TColgp_Array2OfPnt& Pnt) const;
192 BRepAdaptor_Surface mySurf;
193 GeomAbs_SurfaceType myType;
194 const HLRAlgo_Projector* myProj;
200 #include <HLRBRep_Surface.lxx>
206 #endif // _HLRBRep_Surface_HeaderFile