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 01/10/90 Changement de nom du package vgeom -> gp |
17 | // JCV 07/12/90 Modifs introduction des classes XYZ, Mat dans le package gp |
18 | |
19 | #define No_Standard_OutOfRange |
20 | |
21 | #include <gp_Pnt.ixx> |
22 | |
23 | void gp_Pnt::Transform (const gp_Trsf& T) |
24 | { |
25 | if (T.Form() == gp_Identity) { } |
26 | else if (T.Form() == gp_Translation) { coord.Add (T.TranslationPart ()); } |
27 | else if (T.Form() == gp_Scale) { |
28 | coord.Multiply (T.ScaleFactor ()); |
29 | coord.Add (T.TranslationPart ()); |
30 | } |
31 | else if(T.Form() == gp_PntMirror) { |
32 | coord.Reverse (); |
33 | coord.Add (T.TranslationPart ()); |
34 | } |
35 | else { T.Transforms(coord); } |
36 | } |
37 | |
38 | void gp_Pnt::Mirror (const gp_Pnt& P) |
39 | { |
40 | coord.Reverse (); |
41 | gp_XYZ XYZ = P.coord; |
42 | XYZ.Multiply (2.0); |
43 | coord.Add (XYZ); |
44 | } |
45 | |
46 | gp_Pnt gp_Pnt::Mirrored (const gp_Pnt& P) const |
47 | { |
48 | gp_Pnt Pres = *this; |
49 | Pres.Mirror (P); |
50 | return Pres; |
51 | } |
52 | |
53 | void gp_Pnt::Mirror (const gp_Ax1& A1) |
54 | { |
55 | gp_Trsf T; |
56 | T.SetMirror (A1); |
57 | T.Transforms (coord); |
58 | } |
59 | |
60 | gp_Pnt gp_Pnt::Mirrored (const gp_Ax1& A1) const |
61 | { |
62 | gp_Pnt P = *this; |
63 | P.Mirror (A1); |
64 | return P; |
65 | } |
66 | |
67 | void gp_Pnt::Mirror (const gp_Ax2& A2) |
68 | { |
69 | gp_Trsf T; |
70 | T.SetMirror (A2); |
71 | T.Transforms (coord); |
72 | } |
73 | |
74 | gp_Pnt gp_Pnt::Mirrored (const gp_Ax2& A2) const |
75 | { |
76 | gp_Pnt P = *this; |
77 | P.Mirror (A2); |
78 | return P; |
79 | } |
80 | |