0024023: Revamp the OCCT Handle -- general
[occt.git] / src / Geom2d / Geom2d_Transformation.cxx
1 // Created on: 1993-03-24
2 // Created by: JCV
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <Geom2d_Transformation.ixx>
18
19
20 typedef Geom2d_Transformation         Transformation;
21 typedef gp_Ax2d     Ax2d;
22 typedef gp_Pnt2d    Pnt2d;
23 typedef gp_TrsfForm TrsfForm;
24 typedef gp_Vec2d    Vec2d;
25
26 Handle(Geom2d_Transformation) Geom2d_Transformation::Copy() const {
27
28   Handle(Geom2d_Transformation) T;
29   T = new Transformation (gpTrsf2d);
30   return T; 
31 }
32
33
34
35
36 Geom2d_Transformation::Geom2d_Transformation () { }
37
38
39 Geom2d_Transformation::Geom2d_Transformation (const gp_Trsf2d& T) 
40 :  gpTrsf2d (T) { }
41
42
43 Handle(Geom2d_Transformation) Geom2d_Transformation::Inverted () const {
44
45    return new Transformation (gpTrsf2d.Inverted());
46 }
47
48
49 Handle(Geom2d_Transformation) Geom2d_Transformation::Multiplied (
50
51 const Handle(Geom2d_Transformation)& Other) const {
52
53    return new Transformation (gpTrsf2d.Multiplied (Other->Trsf2d()));
54 }
55
56
57 Handle(Geom2d_Transformation) Geom2d_Transformation::Powered (const Standard_Integer N) const{
58
59   gp_Trsf2d Temp = gpTrsf2d;
60   Temp.Power (N);
61   return new Transformation (Temp);
62 }
63
64
65
66 void Geom2d_Transformation::SetMirror (const gp_Pnt2d& P) {
67
68   gpTrsf2d.SetMirror (P);
69 }
70
71
72 void Geom2d_Transformation::SetMirror (const gp_Ax2d& A) {
73
74   gpTrsf2d.SetMirror (A);
75 }
76
77
78 void Geom2d_Transformation::SetRotation (const gp_Pnt2d& P, const Standard_Real Ang) { 
79
80   gpTrsf2d.SetRotation (P, Ang); 
81 }
82
83
84 void Geom2d_Transformation::SetScale (const gp_Pnt2d& P, const Standard_Real S) { 
85
86   gpTrsf2d.SetScale (P, S);
87 }
88
89
90 void Geom2d_Transformation::SetTransformation (const gp_Ax2d& ToAxis) { 
91
92   gpTrsf2d.SetTransformation (ToAxis);
93 }
94
95
96 void Geom2d_Transformation::SetTransformation (
97 const gp_Ax2d& FromAxis1, const gp_Ax2d& ToAxis2) {
98
99   gpTrsf2d.SetTransformation (FromAxis1, ToAxis2);
100 }
101
102
103 void Geom2d_Transformation::SetTranslation (const gp_Vec2d& V) {
104
105   gpTrsf2d.SetTranslation (V);
106 }
107
108
109 void Geom2d_Transformation::SetTranslation (const gp_Pnt2d& P1, const gp_Pnt2d& P2) {
110
111   gpTrsf2d.SetTranslation (P1, P2); 
112 }
113
114
115 void Geom2d_Transformation::SetTrsf2d (const gp_Trsf2d& T) { gpTrsf2d = T; }
116
117
118 Standard_Boolean Geom2d_Transformation::IsNegative () const {
119
120   return gpTrsf2d.IsNegative();
121 }
122
123
124 TrsfForm Geom2d_Transformation::Form () const { return gpTrsf2d.Form(); }
125
126
127 Standard_Real Geom2d_Transformation::ScaleFactor () const {
128
129    return gpTrsf2d.ScaleFactor();
130 }
131
132
133 gp_Trsf2d Geom2d_Transformation::Trsf2d () const {  return gpTrsf2d; }
134
135
136
137 Standard_Real Geom2d_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const{
138
139   return gpTrsf2d.Value (Row, Col);
140 }
141
142
143 void Geom2d_Transformation::Invert () { gpTrsf2d.Invert(); }
144
145
146 void Geom2d_Transformation::Transforms (Standard_Real& X, Standard_Real& Y) const {  
147
148   gpTrsf2d.Transforms (X, Y); 
149 }
150
151
152 void Geom2d_Transformation::Multiply (const Handle(Geom2d_Transformation)& Other) {
153
154   gpTrsf2d.Multiply (Other->Trsf2d());
155 }
156
157
158 void Geom2d_Transformation::Power (const Standard_Integer N) { gpTrsf2d.Power (N); }
159
160
161 void Geom2d_Transformation::PreMultiply (
162 const Handle(Geom2d_Transformation)& Other) {
163
164   gpTrsf2d.PreMultiply (Other->Trsf2d());
165 }
166
167
168
169