b311480e |
1 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
7fd59977 |
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 1/10/90 Changement de nom du package vgeom -> gp |
16 | // JCV 12/12/90 modif introduction des classes XYZ et Mat dans le package |
17 | // LPA, JCV 07/92 passage sur C1. |
18 | // JCV 07/92 Introduction de la method Dump |
19 | |
20 | #define No_Standard_OutOfRange |
21 | |
22 | #include <gp_Ax1.ixx> |
23 | #include <gp.hxx> |
24 | |
25 | Standard_Boolean gp_Ax1::IsCoaxial |
26 | (const gp_Ax1& Other, |
27 | const Standard_Real AngularTolerance, |
28 | const Standard_Real LinearTolerance) const |
29 | { |
30 | gp_XYZ XYZ1 = loc.XYZ(); |
31 | XYZ1.Subtract (Other.loc.XYZ()); |
32 | XYZ1.Cross (Other.vdir.XYZ()); |
33 | Standard_Real D1 = XYZ1.Modulus(); |
34 | gp_XYZ XYZ2 = Other.loc.XYZ(); |
35 | XYZ2.Subtract (loc.XYZ()); |
36 | XYZ2.Cross (vdir.XYZ()); |
37 | Standard_Real D2 = XYZ2.Modulus(); |
38 | return (vdir.IsEqual (Other.vdir, AngularTolerance) && |
39 | D1 <= LinearTolerance && D2 <= LinearTolerance); |
40 | } |
41 | |
42 | void gp_Ax1::Mirror (const gp_Pnt& P) |
43 | { |
44 | loc.Mirror(P); |
45 | vdir.Reverse(); |
46 | } |
47 | |
48 | gp_Ax1 gp_Ax1::Mirrored (const gp_Pnt& P) const |
49 | { |
50 | gp_Ax1 A1 = *this; |
51 | A1.Mirror (P); |
52 | return A1; |
53 | } |
54 | |
55 | void gp_Ax1::Mirror (const gp_Ax1& A1) |
56 | { |
57 | loc.Mirror(A1); |
58 | vdir.Mirror(A1.vdir); |
59 | } |
60 | |
61 | gp_Ax1 gp_Ax1::Mirrored (const gp_Ax1& A1) const |
62 | { |
63 | gp_Ax1 A = *this; |
64 | A.Mirror (A1); |
65 | return A; |
66 | } |
67 | |
68 | void gp_Ax1::Mirror (const gp_Ax2& A2) |
69 | { |
70 | loc.Mirror (A2); |
71 | vdir.Mirror (A2); |
72 | } |
73 | |
74 | gp_Ax1 gp_Ax1::Mirrored (const gp_Ax2& A2) const |
75 | { |
76 | gp_Ax1 A1 = *this; |
77 | A1.Mirror (A2); |
78 | return A1; |
79 | } |
80 | |