Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:08

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