1 // File vgeom_Ax2.cxx , JCV 30/08/90
2 // JCV 1/10/90 Changement de nom du package vgeom -> gp
3 // JCV 12/12/90 Modif mineur suite a la premiere revue de projet
4 // LPA, JCV 07/92 passage sur C1.
5 // JCV 07/92 Introduction de la method Dump
7 #define No_Standard_OutOfRange
12 gp_Ax2::gp_Ax2 (const gp_Pnt& P, const gp_Dir& V) :
15 Standard_Real A = V.X();
16 Standard_Real B = V.Y();
17 Standard_Real C = V.Z();
18 Standard_Real Aabs = A;
19 if (Aabs < 0) Aabs = - Aabs;
20 Standard_Real Babs = B;
21 if (Babs < 0) Babs = - Babs;
22 Standard_Real Cabs = C;
23 if (Cabs < 0) Cabs = - Cabs;
26 // pour determiner l axe X :
27 // on dit que le produit scalaire Vx.V = 0.
28 // et on recherche le max(A,B,C) pour faire la division.
29 // l'une des coordonnees du vecteur est nulle.
31 if ( Babs <= Aabs && Babs <= Cabs) {
32 if (Aabs > Cabs) D.SetCoord(-C,0., A);
33 else D.SetCoord( C,0.,-A);
35 else if ( Aabs <= Babs && Aabs <= Cabs) {
36 if (Babs > Cabs) D.SetCoord(0.,-C, B);
37 else D.SetCoord(0., C,-B);
40 if (Aabs > Babs) D.SetCoord(-B, A,0.);
41 else D.SetCoord( B,-A,0.);
46 void gp_Ax2::Mirror (const gp_Pnt& P)
48 gp_Pnt Temp = axis.Location();
50 axis.SetLocation (Temp);
55 gp_Ax2 gp_Ax2::Mirrored(const gp_Pnt& P) const
62 void gp_Ax2::Mirror (const gp_Ax1& A1)
66 gp_Pnt Temp = axis.Location();
68 axis.SetLocation (Temp);
69 axis.SetDirection (vxdir.Crossed (vydir));
72 gp_Ax2 gp_Ax2::Mirrored(const gp_Ax1& A1) const
79 void gp_Ax2::Mirror (const gp_Ax2& A2)
83 gp_Pnt Temp = axis.Location();
85 axis.SetLocation (Temp);
86 axis.SetDirection (vxdir.Crossed (vydir));
89 gp_Ax2 gp_Ax2::Mirrored(const gp_Ax2& A2) const