0022627: Change OCCT memory management defaults
[occt.git] / src / gp / gp_Lin.cxx
CommitLineData
7fd59977 1// File gp_Lin.cxx, JCV O3/06/90
2// JCV 30/08/90 Modif passage version C++ 2.0 sur Sun
3// JCV 1/10/90 Changement de nom du package vgeom -> gp
4// JCV 12/12/90 modifs suite a la premiere revue de projet
5
6#include <gp_Lin.ixx>
7
8Standard_Real gp_Lin::Distance (const gp_Lin& Other) const
9{
10 if (pos.IsParallel (Other.pos, gp::Resolution())) {
11 return Other.Distance(pos.Location());
12 }
13 else {
14 gp_Dir dir(pos.Direction().Crossed(Other.pos.Direction()));
15 Standard_Real D = gp_Vec (pos.Location(),Other.pos.Location())
16 .Dot(gp_Vec(dir));
17 if (D < 0) D = - D;
18 return D;
19 }
20}
21
22void gp_Lin::Mirror (const gp_Pnt& P)
23{ pos.Mirror(P); }
24
25gp_Lin gp_Lin::Mirrored (const gp_Pnt& P) const
26{
27 gp_Lin L = *this;
28 L.pos.Mirror (P);
29 return L;
30}
31
32void gp_Lin::Mirror (const gp_Ax1& A1)
33{ pos.Mirror(A1); }
34
35gp_Lin gp_Lin::Mirrored (const gp_Ax1& A1) const
36{
37 gp_Lin L = *this;
38 L.pos.Mirror (A1);
39 return L;
40}
41
42void gp_Lin::Mirror (const gp_Ax2& A2)
43{ pos.Mirror(A2); }
44
45gp_Lin gp_Lin::Mirrored (const gp_Ax2& A2) const
46{
47 gp_Lin L = *this;
48 L.pos.Mirror (A2);
49 return L;
50}
51