0032951: Coding - get rid of unused headers [GeomConvert to IGESBasic]
[occt.git] / src / HLRBRep / HLRBRep_LineTool.hxx
1 // Created on: 1993-08-18
2 // Created by: Christophe MARION
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _HLRBRep_LineTool_HeaderFile
18 #define _HLRBRep_LineTool_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <GeomAbs_Shape.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <GeomAbs_CurveType.hxx>
30 #include <gp_Lin.hxx>
31 #include <gp_Circ.hxx>
32 #include <gp_Elips.hxx>
33 #include <gp_Hypr.hxx>
34 #include <gp_Parab.hxx>
35 #include <TColgp_Array1OfPnt.hxx>
36 #include <TColStd_Array1OfInteger.hxx>
37 #include <TColStd_HArray1OfReal.hxx>
38 class Standard_OutOfRange;
39 class Standard_NoSuchObject;
40 class Standard_DomainError;
41 class gp_Pnt;
42 class gp_Vec;
43 class Geom_BezierCurve;
44 class Geom_BSplineCurve;
45
46
47 //! The  LineTool  class  provides  class  methods to
48 //! access the methodes of the Line.
49 class HLRBRep_LineTool 
50 {
51 public:
52
53   DEFINE_STANDARD_ALLOC
54
55   
56     static Standard_Real FirstParameter (const gp_Lin& C);
57   
58     static Standard_Real LastParameter (const gp_Lin& C);
59   
60     static GeomAbs_Shape Continuity (const gp_Lin& C);
61   
62   //! If necessary,   breaks the line  in  intervals of
63   //! continuity <S>.     And   returns  the  number  of
64   //! intervals.
65     static Standard_Integer NbIntervals (const gp_Lin& C, const GeomAbs_Shape S);
66   
67   //! Sets the current working interval.
68     static void Intervals (const gp_Lin& C, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
69   
70   //! Returns  the  first  parameter    of  the  current
71   //! interval.
72     static Standard_Real IntervalFirst (const gp_Lin& C);
73   
74   //! Returns  the  last  parameter    of  the  current
75   //! interval.
76     static Standard_Real IntervalLast (const gp_Lin& C);
77   
78     static GeomAbs_Shape IntervalContinuity (const gp_Lin& C);
79   
80     static Standard_Boolean IsClosed (const gp_Lin& C);
81   
82     static Standard_Boolean IsPeriodic (const gp_Lin& C);
83   
84     static Standard_Real Period (const gp_Lin& C);
85   
86   //! Computes the point of parameter U on the line.
87     static gp_Pnt Value (const gp_Lin& C, const Standard_Real U);
88   
89   //! Computes the point of parameter U on the line.
90     static void D0 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P);
91   
92   //! Computes the point of parameter U on the line with its
93   //! first derivative.
94   //! Raised if the continuity of the current interval
95   //! is not C1.
96     static void D1 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
97   
98
99   //! Returns the point P of parameter U, the first and second
100   //! derivatives V1 and V2.
101   //! Raised if the continuity of the current interval
102   //! is not C2.
103     static void D2 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
104   
105
106   //! Returns the point P of parameter U, the first, the second
107   //! and the third derivative.
108   //! Raised if the continuity of the current interval
109   //! is not C3.
110     static void D3 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
111   
112
113   //! The returned vector gives the value of the derivative for the
114   //! order of derivation N.
115   //! Raised if the continuity of the current interval
116   //! is not CN.
117   //! Raised if N < 1.
118     static gp_Vec DN (const gp_Lin& C, const Standard_Real U, const Standard_Integer N);
119   
120   //! Returns the parametric  resolution corresponding
121   //! to the real space resolution <R3d>.
122     static Standard_Real Resolution (const gp_Lin& C, const Standard_Real R3d);
123   
124   //! Returns  the  type of the   line  in the  current
125   //! interval :   Line,   Circle,   Ellipse, Hyperbola,
126   //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
127     static GeomAbs_CurveType GetType (const gp_Lin& C);
128   
129     static gp_Lin Line (const gp_Lin& C);
130   
131     static gp_Circ Circle (const gp_Lin& C);
132   
133     static gp_Elips Ellipse (const gp_Lin& C);
134   
135     static gp_Hypr Hyperbola (const gp_Lin& C);
136   
137     static gp_Parab Parabola (const gp_Lin& C);
138   
139     static Handle(Geom_BezierCurve) Bezier (const gp_Lin& C);
140   
141     static Handle(Geom_BSplineCurve) BSpline (const gp_Lin& C);
142   
143     static Standard_Integer Degree (const gp_Lin& C);
144   
145     static Standard_Integer NbPoles (const gp_Lin& C);
146   
147     static void Poles (const gp_Lin& C, TColgp_Array1OfPnt& TP);
148   
149     static Standard_Boolean IsRational (const gp_Lin& C);
150   
151     static void PolesAndWeights (const gp_Lin& C, TColgp_Array1OfPnt& TP, TColStd_Array1OfReal& TW);
152   
153     static Standard_Integer NbKnots (const gp_Lin& C);
154   
155     static void KnotsAndMultiplicities (const gp_Lin& C, TColStd_Array1OfReal& TK, TColStd_Array1OfInteger& TM);
156   
157     static Standard_Integer NbSamples (const gp_Lin& C, const Standard_Real U0, const Standard_Real U1);
158   
159     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);
160
161
162
163
164 protected:
165
166
167
168
169
170 private:
171
172
173
174
175
176 };
177
178
179 #include <HLRBRep_LineTool.lxx>
180
181
182
183
184
185 #endif // _HLRBRep_LineTool_HeaderFile