0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / Extrema / Extrema_ExtPElC2d.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-12-13
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 _Extrema_ExtPElC2d_HeaderFile
18#define _Extrema_ExtPElC2d_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26#include <Standard_Real.hxx>
27#include <Extrema_POnCurv2d.hxx>
28class StdFail_NotDone;
29class Standard_OutOfRange;
30class gp_Pnt2d;
31class gp_Lin2d;
32class gp_Circ2d;
33class gp_Elips2d;
34class gp_Hypr2d;
35class gp_Parab2d;
36class Extrema_POnCurv2d;
37
38
39//! It calculates all the distances between a point
40//! and an elementary curve.
41//! These distances can be minimum or maximum.
42class Extrema_ExtPElC2d
43{
44public:
45
46 DEFINE_STANDARD_ALLOC
47
48
49 Standard_EXPORT Extrema_ExtPElC2d();
50
51 //! Calculates the extremum distance between the
52 //! point P and the segment [Uinf,Usup] of the line L.
53 Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Lin2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
54
55 Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Lin2d& L, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
56
57 //! Calculates the 2 extremum distances between the
58 //! point P and the segment [Uinf,Usup] of the circle C.
59 //! Tol is used to determine
60 //! if P is on the axis of the circle or
61 //! if an extremum is on an endpoint of the segment.
62 //! If P is on the axis of the circle,
63 //! there are infinite solution then IsDone(me)=False.
64 //! The conditions on the Uinf and Usup are:
65 //! 0. <= Uinf <= 2.*PI and Usup > Uinf.
66 //! If Usup > Uinf + 2.*PI, then only the solutions in
67 //! the range [Uinf,Uinf+2.*PI[ are computed.
68 Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Circ2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
69
70 Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Circ2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
71
72 //! Calculates the 4 extremum distances between the
73 //! point P and the segment [Uinf,Usup] of the elipse C.
74 //! Tol is used to determine
75 //! if the point is on the axis of the elipse and
76 //! if the major radius is equal to the minor radius or
77 //! if an extremum is on an endpoint of the segment.
78 //! If P is on the axis of the elipse,
79 //! there are infinite solution then IsDone(me)=False.
80 //! The conditions on the Uinf and Usup are:
81 //! 0. <= Uinf <= 2.*PI and Usup > Uinf.
82 //! If Usup > Uinf + 2.*PI, then only the solutions in
83 //! the range [Uinf,Uinf+2.*PI[ are computed.
84 Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Elips2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
85
86 Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Elips2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
87
88 //! Calculates the extremum distances between the
89 //! point P and the segment [Uinf,Usup] of the hyperbola
90 //! C.
91 //! Tol is used to determine if two solutions u and v
92 //! are identical; the condition is:
93 //! dist(C(u),C(v)) < Tol.
94 Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Hypr2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
95
96 Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Hypr2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
97
98 //! Calculates the 4 extremum distances between the
99 //! point P and the segment [Uinf,Usup] of the parabola
100 //! C.
101 //! Tol is used to determine if two solutions u and v
102 //! are identical; the condition is:
103 //! dist(C(u),C(v)) < Tol.
104 Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Parab2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
105
106 Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Parab2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
107
108 //! True if the distances are found.
109 Standard_EXPORT Standard_Boolean IsDone() const;
110
111 //! Returns the number of extremum distances.
112 Standard_EXPORT Standard_Integer NbExt() const;
113
114 //! Returns the value of the Nth extremum square distance.
115 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
116
117 //! Returns True if the Nth extremum distance is a
118 //! minimum.
119 Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
120
121 //! Returns the point of the Nth extremum distance.
122 Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
123
124
125
126
127protected:
128
129
130
131
132
133private:
134
135
136
137 Standard_Boolean myDone;
138 Standard_Integer myNbExt;
139 Standard_Real mySqDist[4];
140 Standard_Boolean myIsMin[4];
141 Extrema_POnCurv2d myPoint[4];
142
143
144};
145
146
147
148
149
150
151
152#endif // _Extrema_ExtPElC2d_HeaderFile