1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
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 Modif suite a la premiere revue de projet
18 // LPA, JCV 07/92 passage sur C1.
19 // JCV 07/92 Introduction de la method Dump
20 // LBO 08/93 Passage aux Ax3
25 gp_Pln::gp_Pln (const gp_Pnt& P,
28 Standard_Real A = V.X();
29 Standard_Real B = V.Y();
30 Standard_Real C = V.Z();
31 Standard_Real Aabs = A;
32 if (Aabs < 0) Aabs = - Aabs;
33 Standard_Real Babs = B;
34 if (Babs < 0) Babs = - Babs;
35 Standard_Real Cabs = C;
36 if (Cabs < 0) Cabs = - Cabs;
38 // pour determiner l'axe X :
39 // on dit que le produit scalaire Vx.V = 0.
40 // et on recherche le max(A,B,C) pour faire la division.
41 // l'une des coordonnees du vecteur est nulle.
43 if( Babs <= Aabs && Babs <= Cabs) {
44 if (Aabs > Cabs) pos = gp_Ax3 (P, V, gp_Dir (-C,0., A));
45 else pos = gp_Ax3 (P, V, gp_Dir ( C,0.,-A));
47 else if( Aabs <= Babs && Aabs <= Cabs) {
48 if (Babs > Cabs) pos = gp_Ax3 (P, V, gp_Dir (0.,-C, B));
49 else pos = gp_Ax3 (P, V, gp_Dir (0., C,-B));
52 if (Aabs > Babs) pos = gp_Ax3 (P, V, gp_Dir (-B, A,0.));
53 else pos = gp_Ax3 (P, V, gp_Dir ( B,-A,0.));
57 gp_Pln::gp_Pln (const Standard_Real A,
58 const Standard_Real B,
59 const Standard_Real C,
60 const Standard_Real D)
62 Standard_Real Aabs = A;
63 if (Aabs < 0) Aabs = - Aabs;
64 Standard_Real Babs = B;
65 if (Babs < 0) Babs = - Babs;
66 Standard_Real Cabs = C;
67 if (Cabs < 0) Cabs = - Cabs;
68 if (Babs <= Aabs && Babs <= Cabs) {
69 if (Aabs > Cabs) pos = gp_Ax3(gp_Pnt(-D/A, 0., 0.),
72 else pos = gp_Ax3(gp_Pnt( 0., 0.,-D/C),
76 else if (Aabs <= Babs && Aabs <= Cabs) {
77 if (Babs > Cabs) pos = gp_Ax3(gp_Pnt( 0.,-D/B, 0.),
80 else pos = gp_Ax3(gp_Pnt( 0., 0.,-D/C),
85 if (Aabs > Babs) pos = gp_Ax3(gp_Pnt(-D/A, 0., 0.),
88 else pos = gp_Ax3(gp_Pnt( 0.,-D/B, 0.),
94 void gp_Pln::Mirror (const gp_Pnt& P)
97 gp_Pln gp_Pln::Mirrored (const gp_Pnt& P) const
104 void gp_Pln::Mirror (const gp_Ax1& A1)
107 gp_Pln gp_Pln::Mirrored (const gp_Ax1& A1) const
114 void gp_Pln::Mirror (const gp_Ax2& A2)
117 gp_Pln gp_Pln::Mirrored (const gp_Ax2& A2) const