Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Adaptor2d_Curve2d.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1993-04-02
0002 // Created by: Bruno DUMORTIER
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 _Adaptor2d_Curve2d_HeaderFile
0018 #define _Adaptor2d_Curve2d_HeaderFile
0019 
0020 #include <GeomAbs_CurveType.hxx>
0021 #include <GeomAbs_Shape.hxx>
0022 #include <gp_Lin2d.hxx>
0023 #include <gp_Circ2d.hxx>
0024 #include <gp_Elips2d.hxx>
0025 #include <gp_Hypr2d.hxx>
0026 #include <gp_Parab2d.hxx>
0027 #include <Standard.hxx>
0028 #include <Standard_DefineAlloc.hxx>
0029 #include <Standard_Handle.hxx>
0030 #include <TColStd_Array1OfReal.hxx>
0031 
0032 class gp_Pnt2d;
0033 class gp_Vec2d;
0034 class Geom2d_BezierCurve;
0035 class Geom2d_BSplineCurve;
0036 
0037 DEFINE_STANDARD_HANDLE(Adaptor2d_Curve2d, Standard_Transient)
0038 
0039 //! Root class for 2D curves on which geometric
0040 //! algorithms work.
0041 //! An adapted curve is an interface between the
0042 //! services provided by a curve, and those required of
0043 //! the curve by algorithms, which use it.
0044 //! A derived concrete class is provided:
0045 //! Geom2dAdaptor_Curve for a curve from the Geom2d package.
0046 //!
0047 //! Polynomial coefficients of BSpline curves used for their evaluation are
0048 //! cached for better performance. Therefore these evaluations are not
0049 //! thread-safe and parallel evaluations need to be prevented.
0050 class Adaptor2d_Curve2d : public Standard_Transient
0051 {
0052   DEFINE_STANDARD_RTTIEXT(Adaptor2d_Curve2d, Standard_Transient)
0053 public:
0054 
0055   //! Shallow copy of adaptor
0056   Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const;
0057   
0058   Standard_EXPORT virtual Standard_Real FirstParameter() const;
0059   
0060   Standard_EXPORT virtual Standard_Real LastParameter() const;
0061   
0062   Standard_EXPORT virtual GeomAbs_Shape Continuity() const;
0063   
0064   //! If necessary,  breaks the  curve in  intervals  of
0065   //! continuity  <S>.    And  returns   the number   of
0066   //! intervals.
0067   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
0068   
0069   //! Stores in <T> the  parameters bounding the intervals
0070   //! of continuity <S>.
0071   //!
0072   //! The array must provide  enough room to  accommodate
0073   //! for the parameters. i.e. T.Length() > NbIntervals()
0074   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
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 virtual Handle(Adaptor2d_Curve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
0081   
0082   Standard_EXPORT virtual Standard_Boolean IsClosed() const;
0083   
0084   Standard_EXPORT virtual Standard_Boolean IsPeriodic() const;
0085   
0086   Standard_EXPORT virtual Standard_Real Period() const;
0087   
0088   //! Computes the point of parameter U on the curve.
0089   Standard_EXPORT virtual gp_Pnt2d Value (const Standard_Real U) const;
0090   
0091   //! Computes the point of parameter U on the curve.
0092   Standard_EXPORT virtual void D0 (const Standard_Real U, gp_Pnt2d& P) const;
0093   
0094   //! Computes the point of parameter U on the curve with its
0095   //! first derivative.
0096   //! Raised if the continuity of the current interval
0097   //! is not C1.
0098   Standard_EXPORT virtual void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const;
0099   
0100 
0101   //! Returns the point P of parameter U, the first and second
0102   //! derivatives V1 and V2.
0103   //! Raised if the continuity of the current interval
0104   //! is not C2.
0105   Standard_EXPORT virtual void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
0106   
0107 
0108   //! Returns the point P of parameter U, the first, the second
0109   //! and the third derivative.
0110   //! Raised if the continuity of the current interval
0111   //! is not C3.
0112   Standard_EXPORT virtual void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
0113   
0114 
0115   //! The returned vector gives the value of the derivative for the
0116   //! order of derivation N.
0117   //! Raised if the continuity of the current interval
0118   //! is not CN.
0119   //! Raised if N < 1.
0120   Standard_EXPORT virtual gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const;
0121   
0122   //! Returns the parametric  resolution corresponding
0123   //! to the real space resolution <R3d>.
0124   Standard_EXPORT virtual Standard_Real Resolution (const Standard_Real R3d) const;
0125   
0126   //! Returns  the  type of the   curve  in the  current
0127   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
0128   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0129   Standard_EXPORT virtual GeomAbs_CurveType GetType() const;
0130   
0131   Standard_EXPORT virtual gp_Lin2d Line() const;
0132   
0133   Standard_EXPORT virtual gp_Circ2d Circle() const;
0134   
0135   Standard_EXPORT virtual gp_Elips2d Ellipse() const;
0136   
0137   Standard_EXPORT virtual gp_Hypr2d Hyperbola() const;
0138   
0139   Standard_EXPORT virtual gp_Parab2d Parabola() const;
0140   
0141   Standard_EXPORT virtual Standard_Integer Degree() const;
0142   
0143   Standard_EXPORT virtual Standard_Boolean IsRational() const;
0144   
0145   Standard_EXPORT virtual Standard_Integer NbPoles() const;
0146   
0147   Standard_EXPORT virtual Standard_Integer NbKnots() const;
0148   
0149   Standard_EXPORT virtual Standard_Integer NbSamples() const;
0150   
0151   Standard_EXPORT virtual Handle(Geom2d_BezierCurve) Bezier() const;
0152   
0153   Standard_EXPORT virtual Handle(Geom2d_BSplineCurve) BSpline() const;
0154   Standard_EXPORT virtual ~Adaptor2d_Curve2d();
0155 
0156 };
0157 
0158 #endif // _Adaptor2d_Curve2d_HeaderFile