1 // Created on: 1993-07-02
2 // Created by: Laurent BUCHARD
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_BSurfaceTool_HeaderFile
18 #define _HLRBRep_BSurfaceTool_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <GeomAbs_Shape.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <Standard_Boolean.hxx>
31 #include <GeomAbs_SurfaceType.hxx>
33 #include <gp_Cylinder.hxx>
34 #include <gp_Cone.hxx>
35 #include <gp_Torus.hxx>
36 #include <gp_Sphere.hxx>
39 class Standard_NoSuchObject;
40 class Standard_OutOfRange;
41 class BRepAdaptor_Surface;
42 class Adaptor3d_HSurface;
45 class Geom_BezierSurface;
46 class Geom_BSplineSurface;
47 class Adaptor3d_HCurve;
51 class HLRBRep_BSurfaceTool
58 static Standard_Real FirstUParameter (const BRepAdaptor_Surface& S);
60 static Standard_Real FirstVParameter (const BRepAdaptor_Surface& S);
62 static Standard_Real LastUParameter (const BRepAdaptor_Surface& S);
64 static Standard_Real LastVParameter (const BRepAdaptor_Surface& S);
66 static Standard_Integer NbUIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
68 static Standard_Integer NbVIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
70 static void UIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
72 static void VIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
74 //! If <First> >= <Last>
75 static Handle(Adaptor3d_HSurface) UTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
77 //! If <First> >= <Last>
78 static Handle(Adaptor3d_HSurface) VTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
80 static Standard_Boolean IsUClosed (const BRepAdaptor_Surface& S);
82 static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S);
84 static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S);
86 static Standard_Real UPeriod (const BRepAdaptor_Surface& S);
88 static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S);
90 static Standard_Real VPeriod (const BRepAdaptor_Surface& S);
92 static gp_Pnt Value (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
94 static void D0 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
96 static void D1 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
98 static void D2 (const BRepAdaptor_Surface& S, 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);
100 static void D3 (const BRepAdaptor_Surface& S, 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);
102 static gp_Vec DN (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
104 static GeomAbs_Shape UContinuity (const BRepAdaptor_Surface& S);
106 static GeomAbs_Shape VContinuity (const BRepAdaptor_Surface& S);
108 static Standard_Integer UDegree (const BRepAdaptor_Surface& S);
110 static Standard_Integer NbUPoles (const BRepAdaptor_Surface& S);
112 static Standard_Integer NbUKnots (const BRepAdaptor_Surface& S);
114 static Standard_Boolean IsURational (const BRepAdaptor_Surface& S);
116 static Standard_Integer VDegree (const BRepAdaptor_Surface& S);
118 static Standard_Integer NbVPoles (const BRepAdaptor_Surface& S);
120 static Standard_Integer NbVKnots (const BRepAdaptor_Surface& S);
122 static Standard_Boolean IsVRational (const BRepAdaptor_Surface& S);
124 static Standard_Real UResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
126 static Standard_Real VResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
128 static GeomAbs_SurfaceType GetType (const BRepAdaptor_Surface& S);
130 static gp_Pln Plane (const BRepAdaptor_Surface& S);
132 static gp_Cylinder Cylinder (const BRepAdaptor_Surface& S);
134 static gp_Cone Cone (const BRepAdaptor_Surface& S);
136 static gp_Torus Torus (const BRepAdaptor_Surface& S);
138 static gp_Sphere Sphere (const BRepAdaptor_Surface& S);
140 static Handle(Geom_BezierSurface) Bezier (const BRepAdaptor_Surface& S);
142 static Handle(Geom_BSplineSurface) BSpline (const BRepAdaptor_Surface& S);
144 static gp_Ax1 AxeOfRevolution (const BRepAdaptor_Surface& S);
146 static gp_Dir Direction (const BRepAdaptor_Surface& S);
148 static Handle(Adaptor3d_HCurve) BasisCurve (const BRepAdaptor_Surface& S);
150 static gp_Ax1 Axis (const BRepAdaptor_Surface& S);
152 Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S);
154 Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S);
156 Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S, const Standard_Real u1, const Standard_Real u2);
158 Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S, const Standard_Real v1, const Standard_Real v2);
178 #include <HLRBRep_BSurfaceTool.lxx>
184 #endif // _HLRBRep_BSurfaceTool_HeaderFile