0024784: Move documentation in CDL files to proper location
[occt.git] / src / LProp / LProp_AnalyticCurInf.cxx
CommitLineData
b311480e 1// Created on: 1994-09-05
2// Created by: Yves FRICAUD
3// Copyright (c) 1994-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <LProp_AnalyticCurInf.ixx>
18#include <ElCLib.hxx>
19
20//=======================================================================
21//function : LProp_AnalyticCurInf
22//purpose :
23//=======================================================================
24
25LProp_AnalyticCurInf::LProp_AnalyticCurInf()
26{
27}
28
29
30//=======================================================================
31//function : Perform
32//purpose :
33//=======================================================================
34
35void LProp_AnalyticCurInf::Perform (const GeomAbs_CurveType CType,
36 const Standard_Real UFirst,
37 const Standard_Real ULast,
38 LProp_CurAndInf& Result)
39{
40 Standard_Boolean IsMin = Standard_True;
41 Standard_Boolean IsMax = Standard_False;
42
43 switch (CType) {
44
45 case GeomAbs_Ellipse:
46 {
47 Standard_Real U1,U2,U3,U4;
c6541a0c 48 Standard_Real UFPlus2PI = UFirst + 2*M_PI;
7fd59977 49
50 U1 = ElCLib::InPeriod(0.0 ,UFirst,UFPlus2PI);
c6541a0c
D
51 U2 = ElCLib::InPeriod(M_PI/2. ,UFirst,UFPlus2PI);
52 U3 = ElCLib::InPeriod(M_PI ,UFirst,UFPlus2PI);
53 U4 = ElCLib::InPeriod(3.*M_PI/2.,UFirst,UFPlus2PI);
7fd59977 54
55 if (UFirst <= U1 && U1 <= ULast) {Result.AddExtCur(U1, IsMin);}
56 if (UFirst <= U2 && U2 <= ULast) {Result.AddExtCur(U2, IsMax);}
57 if (UFirst <= U3 && U3 <= ULast) {Result.AddExtCur(U3, IsMin);}
58 if (UFirst <= U4 && U4 <= ULast) {Result.AddExtCur(U4, IsMax);}
59 }
60 break;
61
62 case GeomAbs_Hyperbola:
63 if (UFirst <= 0.0 && ULast >= 0.0) {
64 Result.AddExtCur(0.0 , Standard_True);
65 }
66 break;
67
68 case GeomAbs_Parabola:
69 if (UFirst <= 0.0 && ULast >= 0.0) {
70 Result.AddExtCur(0.0 , Standard_True);
71 }
72 break;
7fd59977 73 default:
74 break;
7fd59977 75 }
76}
77
78