Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-15 10:21:28

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 <NCollection_Array1.hxx>
0030 #include <Standard_Boolean.hxx>
0031 #include <Geom_Curve.hxx>
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 //! private class used to create a filler rolling on
0042 //! an edge.
0043 class BiTgte_CurveOnEdge : public Adaptor3d_Curve
0044 {
0045   DEFINE_STANDARD_RTTIEXT(BiTgte_CurveOnEdge, Adaptor3d_Curve)
0046 public:
0047   Standard_EXPORT BiTgte_CurveOnEdge();
0048 
0049   Standard_EXPORT BiTgte_CurveOnEdge(const TopoDS_Edge& EonF, const TopoDS_Edge& Edge);
0050 
0051   //! Shallow copy of adaptor
0052   Standard_EXPORT occ::handle<Adaptor3d_Curve> ShallowCopy() const override;
0053 
0054   Standard_EXPORT void Init(const TopoDS_Edge& EonF, const TopoDS_Edge& Edge);
0055 
0056   Standard_EXPORT double FirstParameter() const override;
0057 
0058   Standard_EXPORT double LastParameter() const override;
0059 
0060   Standard_EXPORT GeomAbs_Shape Continuity() const override;
0061 
0062   //! Returns the number of intervals for continuity
0063   //! <S>. May be one if Continuity(me) >= <S>
0064   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0065 
0066   //! Stores in <T> the parameters bounding the intervals
0067   //! of continuity <S>.
0068   //!
0069   //! The array must provide enough room to accommodate
0070   //! for the parameters. i.e. T.Length() > NbIntervals()
0071   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0072                                  const GeomAbs_Shape         S) const override;
0073 
0074   //! Returns a curve equivalent of <me> between
0075   //! parameters <First> and <Last>. <Tol> is used to
0076   //! test for 3d points confusion.
0077   //! If <First> >= <Last>
0078   Standard_EXPORT occ::handle<Adaptor3d_Curve> Trim(const double First,
0079                                                     const double Last,
0080                                                     const double Tol) const override;
0081 
0082   Standard_EXPORT bool IsClosed() const override;
0083 
0084   Standard_EXPORT bool IsPeriodic() const override;
0085 
0086   Standard_EXPORT double Period() const override;
0087 
0088   //! Computes the point of parameter theU on the curve.
0089   [[nodiscard]] Standard_EXPORT gp_Pnt EvalD0(const double theU) const final;
0090 
0091   //! Computes the point and first derivative at parameter theU.
0092   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD1 EvalD1(const double theU) const final;
0093 
0094   //! Computes the point and first two derivatives at parameter theU.
0095   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD2 EvalD2(const double theU) const final;
0096 
0097   //! Computes the point and first three derivatives at parameter theU.
0098   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD3 EvalD3(const double theU) const final;
0099 
0100   //! Returns the derivative of order theN at parameter theU.
0101   [[nodiscard]] Standard_EXPORT gp_Vec EvalDN(const double theU, const int theN) const final;
0102 
0103   //! Returns the parametric resolution corresponding
0104   //! to the real space resolution <R3d>.
0105   Standard_EXPORT double Resolution(const double R3d) const override;
0106 
0107   //! Returns the type of the curve in the current
0108   //! interval: Line, Circle, Ellipse, Hyperbola,
0109   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0110   Standard_EXPORT GeomAbs_CurveType GetType() const override;
0111 
0112   Standard_EXPORT gp_Lin Line() const override;
0113 
0114   Standard_EXPORT gp_Circ Circle() const override;
0115 
0116   Standard_EXPORT gp_Elips Ellipse() const override;
0117 
0118   Standard_EXPORT gp_Hypr Hyperbola() const override;
0119 
0120   Standard_EXPORT gp_Parab Parabola() const override;
0121 
0122   Standard_EXPORT int Degree() const override;
0123 
0124   Standard_EXPORT bool IsRational() const override;
0125 
0126   Standard_EXPORT int NbPoles() const override;
0127 
0128   Standard_EXPORT int NbKnots() const override;
0129 
0130   Standard_EXPORT occ::handle<Geom_BezierCurve> Bezier() const override;
0131 
0132   Standard_EXPORT occ::handle<Geom_BSplineCurve> BSpline() const override;
0133 
0134 private:
0135   TopoDS_Edge             myEdge;
0136   TopoDS_Edge             myEonF;
0137   occ::handle<Geom_Curve> myCurv;
0138   occ::handle<Geom_Curve> myConF;
0139   GeomAbs_CurveType       myType;
0140   gp_Circ                 myCirc;
0141 };
0142 
0143 #endif // _BiTgte_CurveOnEdge_HeaderFile