0032406: Configuration, CMake - DRAWEXE build fails on Linux with static libraries
[occt.git] / src / gp / gp_Lin.cxx
CommitLineData
b311480e 1// Copyright (c) 1995-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
7fd59977 15// JCV 30/08/90 Modif passage version C++ 2.0 sur Sun
16// JCV 1/10/90 Changement de nom du package vgeom -> gp
17// JCV 12/12/90 modifs suite a la premiere revue de projet
18
42cf5bc1 19#include <gp_Ax1.hxx>
20#include <gp_Ax2.hxx>
21#include <gp_Dir.hxx>
22#include <gp_Lin.hxx>
23#include <gp_Pnt.hxx>
24#include <gp_Trsf.hxx>
25#include <gp_Vec.hxx>
26#include <Standard_ConstructionError.hxx>
7fd59977 27
28Standard_Real gp_Lin::Distance (const gp_Lin& Other) const
29{
30 if (pos.IsParallel (Other.pos, gp::Resolution())) {
31 return Other.Distance(pos.Location());
32 }
33 else {
34 gp_Dir dir(pos.Direction().Crossed(Other.pos.Direction()));
35 Standard_Real D = gp_Vec (pos.Location(),Other.pos.Location())
36 .Dot(gp_Vec(dir));
37 if (D < 0) D = - D;
38 return D;
39 }
40}
41
42void gp_Lin::Mirror (const gp_Pnt& P)
43{ pos.Mirror(P); }
44
45gp_Lin gp_Lin::Mirrored (const gp_Pnt& P) const
46{
47 gp_Lin L = *this;
48 L.pos.Mirror (P);
49 return L;
50}
51
52void gp_Lin::Mirror (const gp_Ax1& A1)
53{ pos.Mirror(A1); }
54
55gp_Lin gp_Lin::Mirrored (const gp_Ax1& A1) const
56{
57 gp_Lin L = *this;
58 L.pos.Mirror (A1);
59 return L;
60}
61
62void gp_Lin::Mirror (const gp_Ax2& A2)
63{ pos.Mirror(A2); }
64
65gp_Lin gp_Lin::Mirrored (const gp_Ax2& A2) const
66{
67 gp_Lin L = *this;
68 L.pos.Mirror (A2);
69 return L;
70}
71