Warnings on vc14 were eliminated
[occt.git] / src / HLRBRep / HLRBRep_LineTool.hxx
CommitLineData
42cf5bc1 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 <gp_Pnt.hxx>
30#include <gp_Vec.hxx>
31#include <GeomAbs_CurveType.hxx>
32#include <gp_Lin.hxx>
33#include <gp_Circ.hxx>
34#include <gp_Elips.hxx>
35#include <gp_Hypr.hxx>
36#include <gp_Parab.hxx>
37#include <TColgp_Array1OfPnt.hxx>
38#include <TColStd_Array1OfInteger.hxx>
39#include <TColStd_HArray1OfReal.hxx>
40class Standard_OutOfRange;
41class Standard_NoSuchObject;
42class Standard_DomainError;
43class gp_Lin;
44class gp_Pnt;
45class gp_Vec;
46class Geom_BezierCurve;
47class Geom_BSplineCurve;
48
49
50//! The LineTool class provides class methods to
51//! access the methodes of the Line.
52class HLRBRep_LineTool
53{
54public:
55
56 DEFINE_STANDARD_ALLOC
57
58
59 static Standard_Real FirstParameter (const gp_Lin& C);
60
61 static Standard_Real LastParameter (const gp_Lin& C);
62
63 static GeomAbs_Shape Continuity (const gp_Lin& C);
64
65 //! If necessary, breaks the line in intervals of
66 //! continuity <S>. And returns the number of
67 //! intervals.
68 static Standard_Integer NbIntervals (const gp_Lin& C, const GeomAbs_Shape S);
69
70 //! Sets the current working interval.
71 static void Intervals (const gp_Lin& C, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
72
73 //! Returns the first parameter of the current
74 //! interval.
75 static Standard_Real IntervalFirst (const gp_Lin& C);
76
77 //! Returns the last parameter of the current
78 //! interval.
79 static Standard_Real IntervalLast (const gp_Lin& C);
80
81 static GeomAbs_Shape IntervalContinuity (const gp_Lin& C);
82
83 static Standard_Boolean IsClosed (const gp_Lin& C);
84
85 static Standard_Boolean IsPeriodic (const gp_Lin& C);
86
87 static Standard_Real Period (const gp_Lin& C);
88
89 //! Computes the point of parameter U on the line.
90 static gp_Pnt Value (const gp_Lin& C, const Standard_Real U);
91
92 //! Computes the point of parameter U on the line.
93 static void D0 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P);
94
95 //! Computes the point of parameter U on the line with its
96 //! first derivative.
97 //! Raised if the continuity of the current interval
98 //! is not C1.
99 static void D1 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
100
101
102 //! Returns the point P of parameter U, the first and second
103 //! derivatives V1 and V2.
104 //! Raised if the continuity of the current interval
105 //! is not C2.
106 static void D2 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
107
108
109 //! Returns the point P of parameter U, the first, the second
110 //! and the third derivative.
111 //! Raised if the continuity of the current interval
112 //! is not C3.
113 static void D3 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
114
115
116 //! The returned vector gives the value of the derivative for the
117 //! order of derivation N.
118 //! Raised if the continuity of the current interval
119 //! is not CN.
120 //! Raised if N < 1.
121 static gp_Vec DN (const gp_Lin& C, const Standard_Real U, const Standard_Integer N);
122
123 //! Returns the parametric resolution corresponding
124 //! to the real space resolution <R3d>.
125 static Standard_Real Resolution (const gp_Lin& C, const Standard_Real R3d);
126
127 //! Returns the type of the line in the current
128 //! interval : Line, Circle, Ellipse, Hyperbola,
129 //! Parabola, BezierCurve, BSplineCurve, OtherCurve.
130 static GeomAbs_CurveType GetType (const gp_Lin& C);
131
132 static gp_Lin Line (const gp_Lin& C);
133
134 static gp_Circ Circle (const gp_Lin& C);
135
136 static gp_Elips Ellipse (const gp_Lin& C);
137
138 static gp_Hypr Hyperbola (const gp_Lin& C);
139
140 static gp_Parab Parabola (const gp_Lin& C);
141
142 static Handle(Geom_BezierCurve) Bezier (const gp_Lin& C);
143
144 static Handle(Geom_BSplineCurve) BSpline (const gp_Lin& C);
145
146 static Standard_Integer Degree (const gp_Lin& C);
147
148 static Standard_Integer NbPoles (const gp_Lin& C);
149
150 static void Poles (const gp_Lin& C, TColgp_Array1OfPnt& TP);
151
152 static Standard_Boolean IsRational (const gp_Lin& C);
153
154 static void PolesAndWeights (const gp_Lin& C, TColgp_Array1OfPnt& TP, TColStd_Array1OfReal& TW);
155
156 static Standard_Integer NbKnots (const gp_Lin& C);
157
158 static void KnotsAndMultiplicities (const gp_Lin& C, TColStd_Array1OfReal& TK, TColStd_Array1OfInteger& TM);
159
160 static Standard_Integer NbSamples (const gp_Lin& C, const Standard_Real U0, const Standard_Real U1);
161
162 Standard_EXPORT 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);
163
164
165
166
167protected:
168
169
170
171
172
173private:
174
175
176
177
178
179};
180
181
182#include <HLRBRep_LineTool.lxx>
183
184
185
186
187
188#endif // _HLRBRep_LineTool_HeaderFile