0024171: Eliminate CLang compiler warning -Wreorder
[occt.git] / src / BRepExtrema / BRepExtrema_ExtCC.cxx
CommitLineData
b311480e 1// Created on: 1993-12-15
2// Created by: Christophe MARION
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
92d1589b
A
22#include <BRepExtrema_ExtCC.hxx>
23
7fd59977 24#include <BRep_Tool.hxx>
7fd59977 25#include <Extrema_POnCurv.hxx>
26#include <BRepAdaptor_Curve.hxx>
27#include <BRepAdaptor_HCurve.hxx>
28
29
30//=======================================================================
31//function : BRepExtrema_ExtCC
32//purpose :
33//=======================================================================
34
92d1589b 35BRepExtrema_ExtCC::BRepExtrema_ExtCC(const TopoDS_Edge& E1, const TopoDS_Edge& E2)
7fd59977 36{
37 Initialize(E2);
38 Perform(E1);
39}
40
41//=======================================================================
42//function : Initialize
43//purpose :
44//=======================================================================
45
46void BRepExtrema_ExtCC::Initialize(const TopoDS_Edge& E2)
47{
48 Standard_Real V1,V2;
49 BRepAdaptor_Curve Curv(E2);
50 myHC = new BRepAdaptor_HCurve(Curv);
51 BRep_Tool::Range(E2,V1,V2);
92d1589b 52 myExtCC.SetCurve(2,myHC->Curve(),V1,V2);
7fd59977 53}
54
55//=======================================================================
56//function : Perform
57//purpose :
58//=======================================================================
59
60void BRepExtrema_ExtCC::Perform(const TopoDS_Edge& E1)
61{
62 Standard_Real U1, U2;
63 BRepAdaptor_Curve Curv(E1);
64 Handle(BRepAdaptor_HCurve) HC = new BRepAdaptor_HCurve(Curv);
65 BRep_Tool::Range(E1,U1,U2);
92d1589b
A
66 myExtCC.SetCurve (1, HC->Curve(), U1, U2);
67 myExtCC.Perform();
7fd59977 68}
69
70//=======================================================================
71//function : ParameterOnE1
72//purpose :
73//=======================================================================
74
92d1589b 75Standard_Real BRepExtrema_ExtCC::ParameterOnE1(const Standard_Integer N) const
7fd59977 76{
77 Extrema_POnCurv POnE1, POnE2;
92d1589b 78 myExtCC.Points(N, POnE1, POnE2);
7fd59977 79 return POnE1.Parameter();
80}
81
82//=======================================================================
83//function : PointOnE1
84//purpose :
85//=======================================================================
86
92d1589b 87gp_Pnt BRepExtrema_ExtCC::PointOnE1(const Standard_Integer N) const
7fd59977 88{
89 Extrema_POnCurv POnE1, POnE2;
92d1589b
A
90 myExtCC.Points(N, POnE1, POnE2);
91 return POnE1.Value();
7fd59977 92}
93
94//=======================================================================
95//function : ParameterOnE2
96//purpose :
97//=======================================================================
98
92d1589b 99Standard_Real BRepExtrema_ExtCC::ParameterOnE2(const Standard_Integer N) const
7fd59977 100{
101 Extrema_POnCurv POnE1, POnE2;
92d1589b 102 myExtCC.Points(N, POnE1, POnE2);
7fd59977 103 return POnE2.Parameter();
104}
105
106//=======================================================================
107//function : PointOnE2
108//purpose :
109//=======================================================================
110
92d1589b 111gp_Pnt BRepExtrema_ExtCC::PointOnE2(const Standard_Integer N) const
7fd59977 112{
113 Extrema_POnCurv POnE1, POnE2;
92d1589b
A
114 myExtCC.Points(N, POnE1, POnE2);
115 return POnE2.Value();
7fd59977 116}
117
118
119//=======================================================================
120//function : TrimmedSquareDistances
121//purpose :
122//=======================================================================
123
124void BRepExtrema_ExtCC::TrimmedSquareDistances
125 (Standard_Real& dist11,
126 Standard_Real& dist12,
127 Standard_Real& dist21,
128 Standard_Real& dist22,
129 gp_Pnt& pnt11,
130 gp_Pnt& pnt12,
131 gp_Pnt& pnt21,
132 gp_Pnt& pnt22) const
133{
92d1589b
A
134 myExtCC.TrimmedSquareDistances(dist11,dist12,dist21,dist22,
135 pnt11,pnt12,pnt21,pnt22);
7fd59977 136}