b311480e |
1 | // Created on: 1993-03-24 |
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 | |
17 | #include <Geom2d_Transformation.ixx> |
18 | |
19 | |
20 | typedef Geom2d_Transformation Transformation; |
21 | typedef Handle(Geom2d_Transformation) Handle(Transformation); |
22 | |
23 | typedef gp_Ax2d Ax2d; |
24 | typedef gp_Pnt2d Pnt2d; |
25 | typedef gp_TrsfForm TrsfForm; |
26 | typedef gp_Vec2d Vec2d; |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 | |
35 | Handle(Geom2d_Transformation) Geom2d_Transformation::Copy() const { |
36 | |
37 | Handle(Transformation) T; |
38 | T = new Transformation (gpTrsf2d); |
39 | return T; |
40 | } |
41 | |
42 | |
43 | |
44 | |
45 | Geom2d_Transformation::Geom2d_Transformation () { } |
46 | |
47 | |
48 | Geom2d_Transformation::Geom2d_Transformation (const gp_Trsf2d& T) |
49 | : gpTrsf2d (T) { } |
50 | |
51 | |
52 | Handle(Transformation) Geom2d_Transformation::Inverted () const { |
53 | |
54 | return new Transformation (gpTrsf2d.Inverted()); |
55 | } |
56 | |
57 | |
58 | Handle(Transformation) Geom2d_Transformation::Multiplied ( |
59 | |
60 | const Handle(Transformation)& Other) const { |
61 | |
62 | return new Transformation (gpTrsf2d.Multiplied (Other->Trsf2d())); |
63 | } |
64 | |
65 | |
66 | Handle(Transformation) Geom2d_Transformation::Powered (const Standard_Integer N) const{ |
67 | |
68 | gp_Trsf2d Temp = gpTrsf2d; |
69 | Temp.Power (N); |
70 | return new Transformation (Temp); |
71 | } |
72 | |
73 | |
74 | |
75 | void Geom2d_Transformation::SetMirror (const gp_Pnt2d& P) { |
76 | |
77 | gpTrsf2d.SetMirror (P); |
78 | } |
79 | |
80 | |
81 | void Geom2d_Transformation::SetMirror (const gp_Ax2d& A) { |
82 | |
83 | gpTrsf2d.SetMirror (A); |
84 | } |
85 | |
86 | |
87 | void Geom2d_Transformation::SetRotation (const gp_Pnt2d& P, const Standard_Real Ang) { |
88 | |
89 | gpTrsf2d.SetRotation (P, Ang); |
90 | } |
91 | |
92 | |
93 | void Geom2d_Transformation::SetScale (const gp_Pnt2d& P, const Standard_Real S) { |
94 | |
95 | gpTrsf2d.SetScale (P, S); |
96 | } |
97 | |
98 | |
99 | void Geom2d_Transformation::SetTransformation (const gp_Ax2d& ToAxis) { |
100 | |
101 | gpTrsf2d.SetTransformation (ToAxis); |
102 | } |
103 | |
104 | |
105 | void Geom2d_Transformation::SetTransformation ( |
106 | const gp_Ax2d& FromAxis1, const gp_Ax2d& ToAxis2) { |
107 | |
108 | gpTrsf2d.SetTransformation (FromAxis1, ToAxis2); |
109 | } |
110 | |
111 | |
112 | void Geom2d_Transformation::SetTranslation (const gp_Vec2d& V) { |
113 | |
114 | gpTrsf2d.SetTranslation (V); |
115 | } |
116 | |
117 | |
118 | void Geom2d_Transformation::SetTranslation (const gp_Pnt2d& P1, const gp_Pnt2d& P2) { |
119 | |
120 | gpTrsf2d.SetTranslation (P1, P2); |
121 | } |
122 | |
123 | |
124 | void Geom2d_Transformation::SetTrsf2d (const gp_Trsf2d& T) { gpTrsf2d = T; } |
125 | |
126 | |
127 | Standard_Boolean Geom2d_Transformation::IsNegative () const { |
128 | |
129 | return gpTrsf2d.IsNegative(); |
130 | } |
131 | |
132 | |
133 | TrsfForm Geom2d_Transformation::Form () const { return gpTrsf2d.Form(); } |
134 | |
135 | |
136 | Standard_Real Geom2d_Transformation::ScaleFactor () const { |
137 | |
138 | return gpTrsf2d.ScaleFactor(); |
139 | } |
140 | |
141 | |
142 | gp_Trsf2d Geom2d_Transformation::Trsf2d () const { return gpTrsf2d; } |
143 | |
144 | |
145 | |
146 | Standard_Real Geom2d_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const{ |
147 | |
148 | return gpTrsf2d.Value (Row, Col); |
149 | } |
150 | |
151 | |
152 | void Geom2d_Transformation::Invert () { gpTrsf2d.Invert(); } |
153 | |
154 | |
155 | void Geom2d_Transformation::Transforms (Standard_Real& X, Standard_Real& Y) const { |
156 | |
157 | gpTrsf2d.Transforms (X, Y); |
158 | } |
159 | |
160 | |
161 | void Geom2d_Transformation::Multiply (const Handle(Geom2d_Transformation)& Other) { |
162 | |
163 | gpTrsf2d.Multiply (Other->Trsf2d()); |
164 | } |
165 | |
166 | |
167 | void Geom2d_Transformation::Power (const Standard_Integer N) { gpTrsf2d.Power (N); } |
168 | |
169 | |
170 | void Geom2d_Transformation::PreMultiply ( |
171 | const Handle(Transformation)& Other) { |
172 | |
173 | gpTrsf2d.PreMultiply (Other->Trsf2d()); |
174 | } |
175 | |
176 | |
177 | |
178 | |