summaryrefslogtreecommitdiff
path: root/src/gp/gp_Ax1.cxx
blob: 30c76ae25424f6f4131f03d8ffb0f0051ed48762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// File gp_Ax1.cxx,  JCV 30/08/90
//
// JCV 1/10/90 Changement de nom du package vgeom -> gp
// JCV 12/12/90 modif introduction des classes XYZ et Mat dans le package
// LPA, JCV  07/92 passage sur C1.
// JCV 07/92 Introduction de la method Dump 

#define No_Standard_OutOfRange

#include <gp_Ax1.ixx>
#include <gp.hxx>

Standard_Boolean gp_Ax1::IsCoaxial
(const gp_Ax1& Other, 
 const Standard_Real AngularTolerance,
 const Standard_Real LinearTolerance) const
{
  gp_XYZ XYZ1 = loc.XYZ();
  XYZ1.Subtract (Other.loc.XYZ());
  XYZ1.Cross (Other.vdir.XYZ());
  Standard_Real D1 = XYZ1.Modulus();
  gp_XYZ XYZ2 = Other.loc.XYZ();
  XYZ2.Subtract (loc.XYZ());
  XYZ2.Cross (vdir.XYZ());
  Standard_Real D2 = XYZ2.Modulus();
  return (vdir.IsEqual (Other.vdir, AngularTolerance) &&
          D1 <= LinearTolerance && D2 <= LinearTolerance);
}

void gp_Ax1::Mirror (const gp_Pnt& P)
{
  loc.Mirror(P);
  vdir.Reverse();
}

gp_Ax1 gp_Ax1::Mirrored (const gp_Pnt& P) const
{
  gp_Ax1 A1 = *this;    
  A1.Mirror (P);
  return A1;
}

void gp_Ax1::Mirror (const gp_Ax1& A1)
{
  loc.Mirror(A1);
  vdir.Mirror(A1.vdir);
}

gp_Ax1 gp_Ax1::Mirrored (const gp_Ax1& A1) const
{
  gp_Ax1 A = *this;
  A.Mirror (A1);
  return A;
}

void gp_Ax1::Mirror (const gp_Ax2& A2)
{
  loc.Mirror  (A2);
  vdir.Mirror (A2);
}

gp_Ax1 gp_Ax1::Mirrored (const gp_Ax2& A2) const
{
  gp_Ax1 A1 = *this;
  A1.Mirror (A2);
  return A1;
}