Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-13 08:43:48

0001 // Created on: 1995-07-17
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 _HLRBRep_BCurveTool_HeaderFile
0018 #define _HLRBRep_BCurveTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GeomAbs_Shape.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <gp_Pnt.hxx>
0028 #include <gp_Vec.hxx>
0029 #include <GeomAbs_CurveType.hxx>
0030 #include <gp_Lin.hxx>
0031 #include <gp_Circ.hxx>
0032 #include <gp_Elips.hxx>
0033 #include <gp_Hypr.hxx>
0034 #include <gp_Parab.hxx>
0035 #include <TColgp_Array1OfPnt.hxx>
0036 class BRepAdaptor_Curve;
0037 class gp_Pnt;
0038 class gp_Vec;
0039 class Geom_BezierCurve;
0040 class Geom_BSplineCurve;
0041 
0042 class HLRBRep_BCurveTool
0043 {
0044 public:
0045   DEFINE_STANDARD_ALLOC
0046 
0047   static Standard_Real FirstParameter(const BRepAdaptor_Curve& C);
0048 
0049   static Standard_Real LastParameter(const BRepAdaptor_Curve& C);
0050 
0051   static GeomAbs_Shape Continuity(const BRepAdaptor_Curve& C);
0052 
0053   //! Returns  the number  of  intervals for  continuity
0054   //! <S>. May be one if Continuity(myclass) >= <S>
0055   static Standard_Integer NbIntervals(const BRepAdaptor_Curve& C, const GeomAbs_Shape S);
0056 
0057   //! Stores in <T> the  parameters bounding the intervals
0058   //! of continuity <S>.
0059   //!
0060   //! The array must provide  enough room to  accommodate
0061   //! for the parameters. i.e. T.Length() > NbIntervals()
0062   static void Intervals(const BRepAdaptor_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
0063 
0064   static Standard_Boolean IsClosed(const BRepAdaptor_Curve& C);
0065 
0066   static Standard_Boolean IsPeriodic(const BRepAdaptor_Curve& C);
0067 
0068   static Standard_Real Period(const BRepAdaptor_Curve& C);
0069 
0070   //! Computes the point of parameter U on the curve.
0071   static gp_Pnt Value(const BRepAdaptor_Curve& C, const Standard_Real U);
0072 
0073   //! Computes the point of parameter U on the curve.
0074   static void D0(const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P);
0075 
0076   //! Computes the point of parameter U on the curve with its
0077   //! first derivative.
0078   //! Raised if the continuity of the current interval
0079   //! is not C1.
0080   static void D1(const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
0081 
0082   //! Returns the point P of parameter U, the first and second
0083   //! derivatives V1 and V2.
0084   //! Raised if the continuity of the current interval
0085   //! is not C2.
0086   static void D2(const BRepAdaptor_Curve& C,
0087                  const Standard_Real      U,
0088                  gp_Pnt&                  P,
0089                  gp_Vec&                  V1,
0090                  gp_Vec&                  V2);
0091 
0092   //! Returns the point P of parameter U, the first, the second
0093   //! and the third derivative.
0094   //! Raised if the continuity of the current interval
0095   //! is not C3.
0096   static void D3(const BRepAdaptor_Curve& C,
0097                  const Standard_Real      U,
0098                  gp_Pnt&                  P,
0099                  gp_Vec&                  V1,
0100                  gp_Vec&                  V2,
0101                  gp_Vec&                  V3);
0102 
0103   //! The returned vector gives the value of the derivative for the
0104   //! order of derivation N.
0105   //! Raised if the continuity of the current interval
0106   //! is not CN.
0107   //! Raised if N < 1.
0108   static gp_Vec DN(const BRepAdaptor_Curve& C, const Standard_Real U, const Standard_Integer N);
0109 
0110   //! Returns the parametric  resolution corresponding
0111   //! to the real space resolution <R3d>.
0112   static Standard_Real Resolution(const BRepAdaptor_Curve& C, const Standard_Real R3d);
0113 
0114   //! Returns  the  type of the   curve  in the  current
0115   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
0116   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0117   static GeomAbs_CurveType GetType(const BRepAdaptor_Curve& C);
0118 
0119   static gp_Lin Line(const BRepAdaptor_Curve& C);
0120 
0121   static gp_Circ Circle(const BRepAdaptor_Curve& C);
0122 
0123   static gp_Elips Ellipse(const BRepAdaptor_Curve& C);
0124 
0125   static gp_Hypr Hyperbola(const BRepAdaptor_Curve& C);
0126 
0127   static gp_Parab Parabola(const BRepAdaptor_Curve& C);
0128 
0129   Standard_EXPORT static Handle(Geom_BezierCurve) Bezier(const BRepAdaptor_Curve& C);
0130 
0131   Standard_EXPORT static Handle(Geom_BSplineCurve) BSpline(const BRepAdaptor_Curve& C);
0132 
0133   static Standard_Integer Degree(const BRepAdaptor_Curve& C);
0134 
0135   static Standard_Boolean IsRational(const BRepAdaptor_Curve& C);
0136 
0137   static Standard_Integer NbPoles(const BRepAdaptor_Curve& C);
0138 
0139   static Standard_Integer NbKnots(const BRepAdaptor_Curve& C);
0140 
0141   Standard_EXPORT static void Poles(const BRepAdaptor_Curve& C, TColgp_Array1OfPnt& T);
0142 
0143   Standard_EXPORT static void PolesAndWeights(const BRepAdaptor_Curve& C,
0144                                               TColgp_Array1OfPnt&      T,
0145                                               TColStd_Array1OfReal&    W);
0146 
0147   Standard_EXPORT static Standard_Integer NbSamples(const BRepAdaptor_Curve& C,
0148                                                     const Standard_Real      U0,
0149                                                     const Standard_Real      U1);
0150 
0151 protected:
0152 private:
0153 };
0154 
0155 #include <HLRBRep_BCurveTool.lxx>
0156 
0157 #endif // _HLRBRep_BCurveTool_HeaderFile