Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:17:42

0001 // Created on: 1995-07-17
0002 // Created by: Laurent BUCHARD
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 _IntPatch_HCurve2dTool_HeaderFile
0018 #define _IntPatch_HCurve2dTool_HeaderFile
0019 
0020 #include <Adaptor2d_Curve2d.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024 
0025 #include <Standard_Real.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <Standard_Boolean.hxx>
0029 class gp_Pnt2d;
0030 class gp_Vec2d;
0031 class Geom2d_BezierCurve;
0032 class Geom2d_BSplineCurve;
0033 
0034 class IntPatch_HCurve2dTool
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   static double FirstParameter(const occ::handle<Adaptor2d_Curve2d>& C);
0040 
0041   static double LastParameter(const occ::handle<Adaptor2d_Curve2d>& C);
0042 
0043   static GeomAbs_Shape Continuity(const occ::handle<Adaptor2d_Curve2d>& C);
0044 
0045   //! Returns the number of intervals for continuity
0046   //! <S>. May be one if Continuity(myclass) >= <S>
0047   static int NbIntervals(const occ::handle<Adaptor2d_Curve2d>& C, const GeomAbs_Shape S);
0048 
0049   //! Stores in <T> the parameters bounding the intervals
0050   //! of continuity <S>.
0051   //!
0052   //! The array must provide enough room to accommodate
0053   //! for the parameters. i.e. T.Length() > NbIntervals()
0054   static void Intervals(const occ::handle<Adaptor2d_Curve2d>& C,
0055                         NCollection_Array1<double>&           T,
0056                         const GeomAbs_Shape                   S);
0057 
0058   static bool IsClosed(const occ::handle<Adaptor2d_Curve2d>& C);
0059 
0060   static bool IsPeriodic(const occ::handle<Adaptor2d_Curve2d>& C);
0061 
0062   static double Period(const occ::handle<Adaptor2d_Curve2d>& C);
0063 
0064   //! Computes the point of parameter U on the curve.
0065   static gp_Pnt2d Value(const occ::handle<Adaptor2d_Curve2d>& C, const double U);
0066 
0067   //! Computes the point of parameter U on the curve.
0068   static void D0(const occ::handle<Adaptor2d_Curve2d>& C, const double U, gp_Pnt2d& P);
0069 
0070   //! Computes the point of parameter U on the curve with its
0071   //! first derivative.
0072   //! Raised if the continuity of the current interval
0073   //! is not C1.
0074   static void D1(const occ::handle<Adaptor2d_Curve2d>& C, const double U, gp_Pnt2d& P, gp_Vec2d& V);
0075 
0076   //! Returns the point P of parameter U, the first and second
0077   //! derivatives V1 and V2.
0078   //! Raised if the continuity of the current interval
0079   //! is not C2.
0080   static void D2(const occ::handle<Adaptor2d_Curve2d>& C,
0081                  const double                          U,
0082                  gp_Pnt2d&                             P,
0083                  gp_Vec2d&                             V1,
0084                  gp_Vec2d&                             V2);
0085 
0086   //! Returns the point P of parameter U, the first, the second
0087   //! and the third derivative.
0088   //! Raised if the continuity of the current interval
0089   //! is not C3.
0090   static void D3(const occ::handle<Adaptor2d_Curve2d>& C,
0091                  const double                          U,
0092                  gp_Pnt2d&                             P,
0093                  gp_Vec2d&                             V1,
0094                  gp_Vec2d&                             V2,
0095                  gp_Vec2d&                             V3);
0096 
0097   //! The returned vector gives the value of the derivative for the
0098   //! order of derivation N.
0099   //! Raised if the continuity of the current interval
0100   //! is not CN.
0101   //! Raised if N < 1.
0102   static gp_Vec2d DN(const occ::handle<Adaptor2d_Curve2d>& C, const double U, const int N);
0103 
0104   //! Returns the parametric resolution corresponding
0105   //! to the real space resolution <R3d>.
0106   static double Resolution(const occ::handle<Adaptor2d_Curve2d>& C, const double R3d);
0107 
0108   //! Returns the type of the curve in the current
0109   //! interval: Line, Circle, Ellipse, Hyperbola,
0110   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0111   static GeomAbs_CurveType GetType(const occ::handle<Adaptor2d_Curve2d>& C);
0112 
0113   static gp_Lin2d Line(const occ::handle<Adaptor2d_Curve2d>& C);
0114 
0115   static gp_Circ2d Circle(const occ::handle<Adaptor2d_Curve2d>& C);
0116 
0117   static gp_Elips2d Ellipse(const occ::handle<Adaptor2d_Curve2d>& C);
0118 
0119   static gp_Hypr2d Hyperbola(const occ::handle<Adaptor2d_Curve2d>& C);
0120 
0121   static gp_Parab2d Parabola(const occ::handle<Adaptor2d_Curve2d>& C);
0122 
0123   static occ::handle<Geom2d_BezierCurve> Bezier(const occ::handle<Adaptor2d_Curve2d>& C);
0124 
0125   static occ::handle<Geom2d_BSplineCurve> BSpline(const occ::handle<Adaptor2d_Curve2d>& C);
0126 
0127   Standard_EXPORT static int NbSamples(const occ::handle<Adaptor2d_Curve2d>& C,
0128                                        const double                          U0,
0129                                        const double                          U1);
0130 };
0131 
0132 #include <IntPatch_HCurve2dTool.lxx>
0133 
0134 #endif // _IntPatch_HCurve2dTool_HeaderFile