Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-08-18
0002 // Created by: Christophe MARION
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 _HLRBRep_LineTool_HeaderFile
0018 #define _HLRBRep_LineTool_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_Lin.hxx>
0031 #include <gp_Circ.hxx>
0032 #include <gp_Elips.hxx>
0033 #include <gp_Hypr.hxx>
0034 #include <gp_Parab.hxx>
0035 #include <TColgp_Array1OfPnt.hxx>
0036 #include <TColStd_Array1OfInteger.hxx>
0037 #include <TColStd_HArray1OfReal.hxx>
0038 class Standard_OutOfRange;
0039 class Standard_NoSuchObject;
0040 class Standard_DomainError;
0041 class gp_Pnt;
0042 class gp_Vec;
0043 class Geom_BezierCurve;
0044 class Geom_BSplineCurve;
0045 
0046 
0047 //! The  LineTool  class  provides  class  methods to
0048 //! access the methodes of the Line.
0049 class HLRBRep_LineTool 
0050 {
0051 public:
0052 
0053   DEFINE_STANDARD_ALLOC
0054 
0055   
0056     static Standard_Real FirstParameter (const gp_Lin& C);
0057   
0058     static Standard_Real LastParameter (const gp_Lin& C);
0059   
0060     static GeomAbs_Shape Continuity (const gp_Lin& C);
0061   
0062   //! If necessary,   breaks the line  in  intervals of
0063   //! continuity <S>.     And   returns  the  number  of
0064   //! intervals.
0065     static Standard_Integer NbIntervals (const gp_Lin& C, const GeomAbs_Shape S);
0066   
0067   //! Sets the current working interval.
0068     static void Intervals (const gp_Lin& C, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
0069   
0070   //! Returns  the  first  parameter    of  the  current
0071   //! interval.
0072     static Standard_Real IntervalFirst (const gp_Lin& C);
0073   
0074   //! Returns  the  last  parameter    of  the  current
0075   //! interval.
0076     static Standard_Real IntervalLast (const gp_Lin& C);
0077   
0078     static GeomAbs_Shape IntervalContinuity (const gp_Lin& C);
0079   
0080     static Standard_Boolean IsClosed (const gp_Lin& C);
0081   
0082     static Standard_Boolean IsPeriodic (const gp_Lin& C);
0083   
0084     static Standard_Real Period (const gp_Lin& C);
0085   
0086   //! Computes the point of parameter U on the line.
0087     static gp_Pnt Value (const gp_Lin& C, const Standard_Real U);
0088   
0089   //! Computes the point of parameter U on the line.
0090     static void D0 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P);
0091   
0092   //! Computes the point of parameter U on the line with its
0093   //! first derivative.
0094   //! Raised if the continuity of the current interval
0095   //! is not C1.
0096     static void D1 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
0097   
0098 
0099   //! Returns the point P of parameter U, the first and second
0100   //! derivatives V1 and V2.
0101   //! Raised if the continuity of the current interval
0102   //! is not C2.
0103     static void D2 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0104   
0105 
0106   //! Returns the point P of parameter U, the first, the second
0107   //! and the third derivative.
0108   //! Raised if the continuity of the current interval
0109   //! is not C3.
0110     static void D3 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0111   
0112 
0113   //! The returned vector gives the value of the derivative for the
0114   //! order of derivation N.
0115   //! Raised if the continuity of the current interval
0116   //! is not CN.
0117   //! Raised if N < 1.
0118     static gp_Vec DN (const gp_Lin& C, const Standard_Real U, const Standard_Integer N);
0119   
0120   //! Returns the parametric  resolution corresponding
0121   //! to the real space resolution <R3d>.
0122     static Standard_Real Resolution (const gp_Lin& C, const Standard_Real R3d);
0123   
0124   //! Returns  the  type of the   line  in the  current
0125   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
0126   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
0127     static GeomAbs_CurveType GetType (const gp_Lin& C);
0128   
0129     static gp_Lin Line (const gp_Lin& C);
0130   
0131     static gp_Circ Circle (const gp_Lin& C);
0132   
0133     static gp_Elips Ellipse (const gp_Lin& C);
0134   
0135     static gp_Hypr Hyperbola (const gp_Lin& C);
0136   
0137     static gp_Parab Parabola (const gp_Lin& C);
0138   
0139     static Handle(Geom_BezierCurve) Bezier (const gp_Lin& C);
0140   
0141     static Handle(Geom_BSplineCurve) BSpline (const gp_Lin& C);
0142   
0143     static Standard_Integer Degree (const gp_Lin& C);
0144   
0145     static Standard_Integer NbPoles (const gp_Lin& C);
0146   
0147     static void Poles (const gp_Lin& C, TColgp_Array1OfPnt& TP);
0148   
0149     static Standard_Boolean IsRational (const gp_Lin& C);
0150   
0151     static void PolesAndWeights (const gp_Lin& C, TColgp_Array1OfPnt& TP, TColStd_Array1OfReal& TW);
0152   
0153     static Standard_Integer NbKnots (const gp_Lin& C);
0154   
0155     static void KnotsAndMultiplicities (const gp_Lin& C, TColStd_Array1OfReal& TK, TColStd_Array1OfInteger& TM);
0156   
0157     static Standard_Integer NbSamples (const gp_Lin& C, const Standard_Real U0, const Standard_Real U1);
0158   
0159     static void SamplePars (const gp_Lin& C, const Standard_Real U0, const Standard_Real U1, const Standard_Real Defl, const Standard_Integer NbMin, Handle(TColStd_HArray1OfReal)& Pars);
0160 
0161 
0162 
0163 
0164 protected:
0165 
0166 
0167 
0168 
0169 
0170 private:
0171 
0172 
0173 
0174 
0175 
0176 };
0177 
0178 
0179 #include <HLRBRep_LineTool.lxx>
0180 
0181 
0182 
0183 
0184 
0185 #endif // _HLRBRep_LineTool_HeaderFile