Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:14:45

0001 // Created on: 1993-03-11
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1993-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 _Adaptor3d_IsoCurve_HeaderFile
0018 #define _Adaptor3d_IsoCurve_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <Geom_Curve.hxx>
0022 #include <GeomAbs_IsoType.hxx>
0023 
0024 //! Defines an isoparametric curve on a surface. The
0025 //! type of isoparametric curve (U or V) is defined
0026 //! with the enumeration IsoType from GeomAbs if
0027 //! NoneIso is given an error is raised.
0028 class Adaptor3d_IsoCurve : public Adaptor3d_Curve
0029 {
0030   DEFINE_STANDARD_RTTIEXT(Adaptor3d_IsoCurve, Adaptor3d_Curve)
0031 public:
0032   //! The iso is set to NoneIso.
0033   Standard_EXPORT Adaptor3d_IsoCurve();
0034 
0035   //! The surface is loaded. The iso is set to NoneIso.
0036   Standard_EXPORT Adaptor3d_IsoCurve(const occ::handle<Adaptor3d_Surface>& S);
0037 
0038   //! Creates an IsoCurve curve. Iso defines the type
0039   //! (isoU or isoU) Param defines the value of the
0040   //! iso. The bounds of the iso are the bounds of
0041   //! the surface.
0042   Standard_EXPORT Adaptor3d_IsoCurve(const occ::handle<Adaptor3d_Surface>& S,
0043                                      const GeomAbs_IsoType                 Iso,
0044                                      const double                          Param);
0045 
0046   //! Create an IsoCurve curve. Iso defines the type
0047   //! (isoU or isov). Param defines the value of the
0048   //! iso. WFirst,WLast define the bounds of the iso.
0049   Standard_EXPORT Adaptor3d_IsoCurve(const occ::handle<Adaptor3d_Surface>& S,
0050                                      const GeomAbs_IsoType                 Iso,
0051                                      const double                          Param,
0052                                      const double                          WFirst,
0053                                      const double                          WLast);
0054 
0055   //! Shallow copy of adaptor
0056   Standard_EXPORT occ::handle<Adaptor3d_Curve> ShallowCopy() const override;
0057 
0058   //! Changes the surface. The iso is reset to NoneIso.
0059   Standard_EXPORT void Load(const occ::handle<Adaptor3d_Surface>& S);
0060 
0061   //! Changes the iso on the current surface.
0062   Standard_EXPORT void Load(const GeomAbs_IsoType Iso, const double Param);
0063 
0064   //! Changes the iso on the current surface.
0065   Standard_EXPORT void Load(const GeomAbs_IsoType Iso,
0066                             const double          Param,
0067                             const double          WFirst,
0068                             const double          WLast);
0069 
0070   const occ::handle<Adaptor3d_Surface>& Surface() const { return mySurface; }
0071 
0072   GeomAbs_IsoType Iso() const { return myIso; }
0073 
0074   double Parameter() const { return myParameter; }
0075 
0076   double FirstParameter() const override { return myFirst; }
0077 
0078   double LastParameter() const override { return myLast; }
0079 
0080   Standard_EXPORT GeomAbs_Shape Continuity() const override;
0081 
0082   //! Returns the number of intervals for continuity
0083   //! <S>. May be one if Continuity(me) >= <S>
0084   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0085 
0086   //! Stores in <T> the parameters bounding the intervals
0087   //! of continuity <S>.
0088   //!
0089   //! The array must provide enough room to accommodate
0090   //! for the parameters. i.e. T.Length() > NbIntervals()
0091   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0092                                  const GeomAbs_Shape         S) const override;
0093 
0094   //! Returns a curve equivalent of <me> between
0095   //! parameters <First> and <Last>. <Tol> is used to
0096   //! test for 3d points confusion.
0097   //! If <First> >= <Last>
0098   Standard_EXPORT occ::handle<Adaptor3d_Curve> Trim(const double First,
0099                                                     const double Last,
0100                                                     const double Tol) const override;
0101 
0102   Standard_EXPORT bool IsClosed() const override;
0103 
0104   Standard_EXPORT bool IsPeriodic() const override;
0105 
0106   Standard_EXPORT double Period() const override;
0107 
0108   //! Computes the point of parameter theU on the curve.
0109   [[nodiscard]] Standard_EXPORT gp_Pnt EvalD0(const double theU) const final;
0110 
0111   //! Computes the point of parameter theU on the curve with its first derivative.
0112   //! Raised if the continuity of the current interval is not C1.
0113   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD1 EvalD1(const double theU) const final;
0114 
0115   //! Returns the point and the first and second derivatives at parameter theU.
0116   //! Raised if the continuity of the current interval is not C2.
0117   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD2 EvalD2(const double theU) const final;
0118 
0119   //! Returns the point and the first, second and third derivatives at parameter theU.
0120   //! Raised if the continuity of the current interval is not C3.
0121   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD3 EvalD3(const double theU) const final;
0122 
0123   //! Returns the derivative of order theN at parameter theU.
0124   //! Raised if the continuity of the current interval is not CN.
0125   //! Raised if theN < 1.
0126   [[nodiscard]] Standard_EXPORT gp_Vec EvalDN(const double theU, const int theN) const final;
0127 
0128   //! Returns the parametric resolution corresponding
0129   //! to the real space resolution <R3d>.
0130   Standard_EXPORT double Resolution(const double R3d) const override;
0131 
0132   //! Returns the type of the curve in the current
0133   //! interval: Line, Circle, Ellipse, Hyperbola,
0134   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0135   Standard_EXPORT GeomAbs_CurveType GetType() const override;
0136 
0137   Standard_EXPORT gp_Lin Line() const override;
0138 
0139   Standard_EXPORT gp_Circ Circle() const override;
0140 
0141   Standard_EXPORT gp_Elips Ellipse() const override;
0142 
0143   Standard_EXPORT gp_Hypr Hyperbola() const override;
0144 
0145   Standard_EXPORT gp_Parab Parabola() const override;
0146 
0147   Standard_EXPORT int Degree() const override;
0148 
0149   Standard_EXPORT bool IsRational() const override;
0150 
0151   Standard_EXPORT int NbPoles() const override;
0152 
0153   Standard_EXPORT int NbKnots() const override;
0154 
0155   Standard_EXPORT occ::handle<Geom_BezierCurve> Bezier() const override;
0156 
0157   Standard_EXPORT occ::handle<Geom_BSplineCurve> BSpline() const override;
0158 
0159 private:
0160   occ::handle<Adaptor3d_Surface> mySurface;
0161   GeomAbs_IsoType                myIso;
0162   double                         myFirst;
0163   double                         myLast;
0164   double                         myParameter;
0165 };
0166 
0167 #endif // _Adaptor3d_IsoCurve_HeaderFile