Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:15:56

0001 // Created on: 1997-01-10
0002 // Created by: Bruno DUMORTIER
0003 // Copyright (c) 1997-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 _BiTgte_CurveOnEdge_HeaderFile
0018 #define _BiTgte_CurveOnEdge_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopoDS_Edge.hxx>
0025 #include <Adaptor3d_Curve.hxx>
0026 #include <Standard_Real.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <TColStd_Array1OfReal.hxx>
0030 #include <Standard_Boolean.hxx>
0031 class Geom_Curve;
0032 class gp_Pnt;
0033 class gp_Vec;
0034 class gp_Lin;
0035 class gp_Elips;
0036 class gp_Hypr;
0037 class gp_Parab;
0038 class Geom_BezierCurve;
0039 class Geom_BSplineCurve;
0040 
0041 DEFINE_STANDARD_HANDLE(BiTgte_CurveOnEdge, Adaptor3d_Curve)
0042 
0043 //! private class used  to create a filler rolling  on
0044 //! an edge.
0045 class BiTgte_CurveOnEdge : public Adaptor3d_Curve
0046 {
0047   DEFINE_STANDARD_RTTIEXT(BiTgte_CurveOnEdge, Adaptor3d_Curve)
0048 public:
0049   Standard_EXPORT BiTgte_CurveOnEdge();
0050 
0051   Standard_EXPORT BiTgte_CurveOnEdge(const TopoDS_Edge& EonF, const TopoDS_Edge& Edge);
0052 
0053   //! Shallow copy of adaptor
0054   Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
0055 
0056   Standard_EXPORT void Init(const TopoDS_Edge& EonF, const TopoDS_Edge& Edge);
0057 
0058   Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
0059 
0060   Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
0061 
0062   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0063 
0064   //! Returns  the number  of  intervals for  continuity
0065   //! <S>. May be one if Continuity(me) >= <S>
0066   Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const Standard_OVERRIDE;
0067 
0068   //! Stores in <T> the  parameters bounding the intervals
0069   //! of continuity <S>.
0070   //!
0071   //! The array must provide  enough room to  accommodate
0072   //! for the parameters. i.e. T.Length() > NbIntervals()
0073   Standard_EXPORT void Intervals(TColStd_Array1OfReal& T,
0074                                  const GeomAbs_Shape   S) const Standard_OVERRIDE;
0075 
0076   //! Returns    a  curve equivalent   of  <me>  between
0077   //! parameters <First>  and <Last>. <Tol>  is used  to
0078   //! test for 3d points confusion.
0079   //! If <First> >= <Last>
0080   Standard_EXPORT Handle(Adaptor3d_Curve) Trim(const Standard_Real First,
0081                                                const Standard_Real Last,
0082                                                const Standard_Real Tol) const Standard_OVERRIDE;
0083 
0084   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
0085 
0086   Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
0087 
0088   Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
0089 
0090   //! Computes the point of parameter U on the curve.
0091   Standard_EXPORT gp_Pnt Value(const Standard_Real U) const Standard_OVERRIDE;
0092 
0093   //! Computes the point of parameter U on the curve.
0094   Standard_EXPORT void D0(const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
0095 
0096   //! Computes the point of parameter U on the curve with its
0097   //! first derivative.
0098   //! Raised if the continuity of the current interval
0099   //! is not C1.
0100   Standard_EXPORT void D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const Standard_OVERRIDE;
0101 
0102   //! Returns the point P of parameter U, the first and second
0103   //! derivatives V1 and V2.
0104   //! Raised if the continuity of the current interval
0105   //! is not C2.
0106   Standard_EXPORT void D2(const Standard_Real U,
0107                           gp_Pnt&             P,
0108                           gp_Vec&             V1,
0109                           gp_Vec&             V2) const Standard_OVERRIDE;
0110 
0111   //! Returns the point P of parameter U, the first, the second
0112   //! and the third derivative.
0113   //! Raised if the continuity of the current interval
0114   //! is not C3.
0115   Standard_EXPORT void D3(const Standard_Real U,
0116                           gp_Pnt&             P,
0117                           gp_Vec&             V1,
0118                           gp_Vec&             V2,
0119                           gp_Vec&             V3) const Standard_OVERRIDE;
0120 
0121   //! The returned vector gives the value of the derivative for the
0122   //! order of derivation N.
0123   //! Raised if the continuity of the current interval
0124   //! is not CN.
0125   //! Raised if N < 1.
0126   Standard_EXPORT gp_Vec DN(const Standard_Real    U,
0127                             const Standard_Integer N) const Standard_OVERRIDE;
0128 
0129   //! Returns the parametric  resolution corresponding
0130   //! to the real space resolution <R3d>.
0131   Standard_EXPORT Standard_Real Resolution(const Standard_Real R3d) const Standard_OVERRIDE;
0132 
0133   //! Returns  the  type of the   curve  in the  current
0134   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
0135   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0136   Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
0137 
0138   Standard_EXPORT gp_Lin Line() const Standard_OVERRIDE;
0139 
0140   Standard_EXPORT gp_Circ Circle() const Standard_OVERRIDE;
0141 
0142   Standard_EXPORT gp_Elips Ellipse() const Standard_OVERRIDE;
0143 
0144   Standard_EXPORT gp_Hypr Hyperbola() const Standard_OVERRIDE;
0145 
0146   Standard_EXPORT gp_Parab Parabola() const Standard_OVERRIDE;
0147 
0148   Standard_EXPORT Standard_Integer Degree() const Standard_OVERRIDE;
0149 
0150   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0151 
0152   Standard_EXPORT Standard_Integer NbPoles() const Standard_OVERRIDE;
0153 
0154   Standard_EXPORT Standard_Integer NbKnots() const Standard_OVERRIDE;
0155 
0156   Standard_EXPORT Handle(Geom_BezierCurve) Bezier() const Standard_OVERRIDE;
0157 
0158   Standard_EXPORT Handle(Geom_BSplineCurve) BSpline() const Standard_OVERRIDE;
0159 
0160 private:
0161   TopoDS_Edge        myEdge;
0162   TopoDS_Edge        myEonF;
0163   Handle(Geom_Curve) myCurv;
0164   Handle(Geom_Curve) myConF;
0165   GeomAbs_CurveType  myType;
0166   gp_Circ            myCirc;
0167 };
0168 
0169 #endif // _BiTgte_CurveOnEdge_HeaderFile