Back to home page

EIC code displayed by LXR

 
 

    


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

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