b311480e |
1 | // Created on: 1993-03-10 |
2 | // Created by: JCV |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | #include <Geom_Transformation.ixx> |
18 | |
7fd59977 |
19 | typedef Geom_Transformation Transformation; |
20 | typedef gp_Ax1 Ax1; |
21 | typedef gp_Ax2 Ax2; |
22 | typedef gp_Ax3 Ax3; |
23 | typedef gp_Pnt Pnt; |
24 | typedef gp_TrsfForm TrsfForm; |
25 | typedef gp_Vec Vec; |
26 | |
7fd59977 |
27 | Geom_Transformation::Geom_Transformation () { } |
28 | |
29 | |
30 | Geom_Transformation::Geom_Transformation (const gp_Trsf& T) |
31 | : gpTrsf (T) { } |
32 | |
33 | |
34 | Handle(Geom_Transformation) Geom_Transformation::Copy() const { |
35 | |
c04c30b3 |
36 | Handle(Geom_Transformation) T; |
7fd59977 |
37 | T = new Transformation (gpTrsf); |
38 | return T; |
39 | } |
40 | |
41 | |
42 | void Geom_Transformation::SetMirror (const gp_Pnt& P) { gpTrsf.SetMirror (P); } |
43 | |
44 | void Geom_Transformation::SetMirror (const gp_Ax1& A1) { gpTrsf.SetMirror (A1); } |
45 | |
46 | void Geom_Transformation::SetMirror (const gp_Ax2& A2) { gpTrsf.SetMirror (A2);} |
47 | |
48 | void Geom_Transformation::SetRotation (const gp_Ax1& A1, const Standard_Real Ang) { |
49 | |
50 | gpTrsf.SetRotation (A1, Ang); |
51 | } |
52 | |
53 | void Geom_Transformation::SetScale (const gp_Pnt& P, const Standard_Real S) { |
54 | |
55 | gpTrsf.SetScale (P, S); |
56 | } |
57 | |
58 | |
59 | void Geom_Transformation::SetTransformation (const gp_Ax3& ToAxis) { |
60 | |
61 | gpTrsf.SetTransformation (ToAxis); |
62 | } |
63 | |
64 | |
65 | void Geom_Transformation::SetTransformation ( |
66 | const gp_Ax3& FromAxis1, const gp_Ax3& ToAxis2) { |
67 | |
68 | gpTrsf.SetTransformation (FromAxis1, ToAxis2); |
69 | } |
70 | |
71 | |
72 | void Geom_Transformation::SetTranslation (const gp_Vec& V) { |
73 | |
74 | gpTrsf.SetTranslation (V); |
75 | } |
76 | |
77 | |
78 | void Geom_Transformation::SetTranslation (const gp_Pnt& P1, const gp_Pnt& P2) { |
79 | |
80 | gpTrsf.SetTranslation (P1, P2); |
81 | } |
82 | |
83 | |
84 | void Geom_Transformation::SetTrsf (const gp_Trsf& T) { gpTrsf = T; } |
85 | |
86 | Standard_Boolean Geom_Transformation::IsNegative () const {return gpTrsf.IsNegative();} |
87 | |
88 | TrsfForm Geom_Transformation::Form () const { return gpTrsf.Form(); } |
89 | |
90 | Standard_Real Geom_Transformation::ScaleFactor () const { return gpTrsf.ScaleFactor(); } |
91 | |
92 | const gp_Trsf& Geom_Transformation::Trsf () const { return gpTrsf; } |
93 | |
94 | Standard_Real Geom_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const { |
95 | |
96 | return gpTrsf.Value (Row, Col); |
97 | } |
98 | |
99 | |
100 | void Geom_Transformation::Invert () { gpTrsf.Invert(); } |
101 | |
102 | |
c04c30b3 |
103 | Handle(Geom_Transformation) Geom_Transformation::Inverted () const { |
7fd59977 |
104 | |
105 | return new Transformation (gpTrsf.Inverted()); |
106 | } |
107 | |
108 | |
c04c30b3 |
109 | Handle(Geom_Transformation) Geom_Transformation::Multiplied ( |
7fd59977 |
110 | const Handle(Geom_Transformation)& Other) const { |
111 | |
112 | return new Transformation (gpTrsf.Multiplied (Other->Trsf())); |
113 | } |
114 | |
115 | |
116 | void Geom_Transformation::Multiply (const Handle(Geom_Transformation)& Other) { |
117 | |
118 | gpTrsf.Multiply (Other->Trsf()); |
119 | } |
120 | |
121 | |
122 | void Geom_Transformation::Power (const Standard_Integer N) { gpTrsf.Power (N); } |
123 | |
124 | |
c04c30b3 |
125 | Handle(Geom_Transformation) Geom_Transformation::Powered (const Standard_Integer N) const { |
7fd59977 |
126 | |
127 | gp_Trsf T = gpTrsf; |
128 | T.Power (N); |
129 | return new Transformation (T); |
130 | } |
131 | |
132 | |
133 | void Geom_Transformation::PreMultiply (const Handle(Geom_Transformation)& Other){ |
134 | |
135 | gpTrsf.PreMultiply (Other->Trsf()); |
136 | } |
137 | |
138 | |
139 | void Geom_Transformation::Transforms (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const { |
140 | |
141 | gpTrsf.Transforms (X, Y, Z); |
142 | } |
143 | |