Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:18:13

0001 // Created on: 1995-07-20
0002 // Created by: Modelistation
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepApprox_SurfaceTool_HeaderFile
0018 #define _BRepApprox_SurfaceTool_HeaderFile
0019 
0020 #include <BRepAdaptor_Surface.hxx>
0021 #include <GeomAbs_Shape.hxx>
0022 #include <NCollection_Array1.hxx>
0023 #include <gp_Pnt.hxx>
0024 #include <gp_Vec.hxx>
0025 #include <GeomAbs_SurfaceType.hxx>
0026 #include <gp_Pln.hxx>
0027 #include <gp_Cylinder.hxx>
0028 #include <gp_Cone.hxx>
0029 #include <gp_Torus.hxx>
0030 #include <gp_Sphere.hxx>
0031 #include <gp_Ax1.hxx>
0032 #include <gp_Dir.hxx>
0033 
0034 class Geom_BezierSurface;
0035 class Geom_BSplineSurface;
0036 
0037 class BRepApprox_SurfaceTool
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   static double FirstUParameter(const BRepAdaptor_Surface& S);
0043 
0044   static double FirstVParameter(const BRepAdaptor_Surface& S);
0045 
0046   static double LastUParameter(const BRepAdaptor_Surface& S);
0047 
0048   static double LastVParameter(const BRepAdaptor_Surface& S);
0049 
0050   static int NbUIntervals(const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
0051 
0052   static int NbVIntervals(const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
0053 
0054   static void UIntervals(const BRepAdaptor_Surface&  S,
0055                          NCollection_Array1<double>& T,
0056                          const GeomAbs_Shape         Sh);
0057 
0058   static void VIntervals(const BRepAdaptor_Surface&  S,
0059                          NCollection_Array1<double>& T,
0060                          const GeomAbs_Shape         Sh);
0061 
0062   //! If <First> >= <Last>
0063   static occ::handle<Adaptor3d_Surface> UTrim(const BRepAdaptor_Surface& S,
0064                                               const double               First,
0065                                               const double               Last,
0066                                               const double               Tol);
0067 
0068   //! If <First> >= <Last>
0069   static occ::handle<Adaptor3d_Surface> VTrim(const BRepAdaptor_Surface& S,
0070                                               const double               First,
0071                                               const double               Last,
0072                                               const double               Tol);
0073 
0074   static bool IsUClosed(const BRepAdaptor_Surface& S);
0075 
0076   static bool IsVClosed(const BRepAdaptor_Surface& S);
0077 
0078   static bool IsUPeriodic(const BRepAdaptor_Surface& S);
0079 
0080   static double UPeriod(const BRepAdaptor_Surface& S);
0081 
0082   static bool IsVPeriodic(const BRepAdaptor_Surface& S);
0083 
0084   static double VPeriod(const BRepAdaptor_Surface& S);
0085 
0086   static gp_Pnt Value(const BRepAdaptor_Surface& S, const double u, const double v);
0087 
0088   static void D0(const BRepAdaptor_Surface& S, const double u, const double v, gp_Pnt& P);
0089 
0090   static void D1(const BRepAdaptor_Surface& S,
0091                  const double               u,
0092                  const double               v,
0093                  gp_Pnt&                    P,
0094                  gp_Vec&                    D1u,
0095                  gp_Vec&                    D1v);
0096 
0097   static void D2(const BRepAdaptor_Surface& S,
0098                  const double               u,
0099                  const double               v,
0100                  gp_Pnt&                    P,
0101                  gp_Vec&                    D1U,
0102                  gp_Vec&                    D1V,
0103                  gp_Vec&                    D2U,
0104                  gp_Vec&                    D2V,
0105                  gp_Vec&                    D2UV);
0106 
0107   static void D3(const BRepAdaptor_Surface& S,
0108                  const double               u,
0109                  const double               v,
0110                  gp_Pnt&                    P,
0111                  gp_Vec&                    D1U,
0112                  gp_Vec&                    D1V,
0113                  gp_Vec&                    D2U,
0114                  gp_Vec&                    D2V,
0115                  gp_Vec&                    D2UV,
0116                  gp_Vec&                    D3U,
0117                  gp_Vec&                    D3V,
0118                  gp_Vec&                    D3UUV,
0119                  gp_Vec&                    D3UVV);
0120 
0121   static gp_Vec DN(const BRepAdaptor_Surface& S,
0122                    const double               u,
0123                    const double               v,
0124                    const int                  Nu,
0125                    const int                  Nv);
0126 
0127   static double UResolution(const BRepAdaptor_Surface& S, const double R3d);
0128 
0129   static double VResolution(const BRepAdaptor_Surface& S, const double R3d);
0130 
0131   static GeomAbs_SurfaceType GetType(const BRepAdaptor_Surface& S);
0132 
0133   static gp_Pln Plane(const BRepAdaptor_Surface& S);
0134 
0135   static gp_Cylinder Cylinder(const BRepAdaptor_Surface& S);
0136 
0137   static gp_Cone Cone(const BRepAdaptor_Surface& S);
0138 
0139   static gp_Torus Torus(const BRepAdaptor_Surface& S);
0140 
0141   static gp_Sphere Sphere(const BRepAdaptor_Surface& S);
0142 
0143   static occ::handle<Geom_BezierSurface> Bezier(const BRepAdaptor_Surface& S);
0144 
0145   static occ::handle<Geom_BSplineSurface> BSpline(const BRepAdaptor_Surface& S);
0146 
0147   static gp_Ax1 AxeOfRevolution(const BRepAdaptor_Surface& S);
0148 
0149   static gp_Dir Direction(const BRepAdaptor_Surface& S);
0150 
0151   static occ::handle<Adaptor3d_Curve> BasisCurve(const BRepAdaptor_Surface& S);
0152 
0153   Standard_EXPORT static int NbSamplesU(const BRepAdaptor_Surface& S);
0154 
0155   Standard_EXPORT static int NbSamplesV(const BRepAdaptor_Surface& S);
0156 
0157   Standard_EXPORT static int NbSamplesU(const BRepAdaptor_Surface& S,
0158                                         const double               u1,
0159                                         const double               u2);
0160 
0161   Standard_EXPORT static int NbSamplesV(const BRepAdaptor_Surface& S,
0162                                         const double               v1,
0163                                         const double               v2);
0164 };
0165 
0166 #include <BRepApprox_SurfaceTool.lxx>
0167 
0168 #endif // _BRepApprox_SurfaceTool_HeaderFile