Back to home page

EIC code displayed by LXR

 
 

    


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