f9726c02f07eed501a9d009fe690906d105ea7ba
[occt.git] / src / Geom / Geom_Transformation.cxx
1 // Created on: 1993-03-10
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 <Geom_Transformation.ixx>
18
19 typedef Handle(Geom_Transformation) Handle(Transformation);
20 typedef Geom_Transformation         Transformation;
21 typedef gp_Ax1      Ax1;
22 typedef gp_Ax2      Ax2;
23 typedef gp_Ax3      Ax3;
24 typedef gp_Pnt      Pnt;
25 typedef gp_TrsfForm TrsfForm;
26 typedef gp_Vec      Vec;
27
28
29
30
31 Geom_Transformation::Geom_Transformation () { }
32
33
34 Geom_Transformation::Geom_Transformation (const gp_Trsf& T) 
35 : gpTrsf (T) { }
36
37
38 Handle(Geom_Transformation) Geom_Transformation::Copy() const {
39
40   Handle(Transformation) T;
41   T = new Transformation (gpTrsf);
42   return T; 
43 }
44
45
46 void Geom_Transformation::SetMirror (const gp_Pnt& P) { gpTrsf.SetMirror (P); }
47
48 void Geom_Transformation::SetMirror (const gp_Ax1& A1) { gpTrsf.SetMirror (A1); }
49
50 void Geom_Transformation::SetMirror (const gp_Ax2& A2) { gpTrsf.SetMirror (A2);}
51
52 void Geom_Transformation::SetRotation (const gp_Ax1& A1, const Standard_Real Ang) {
53
54   gpTrsf.SetRotation (A1, Ang);
55 }
56
57 void Geom_Transformation::SetScale (const gp_Pnt& P, const Standard_Real S) {
58
59    gpTrsf.SetScale (P, S);
60 }
61
62
63 void Geom_Transformation::SetTransformation (const gp_Ax3& ToAxis) {
64
65   gpTrsf.SetTransformation (ToAxis);
66 }
67
68
69 void Geom_Transformation::SetTransformation (
70 const gp_Ax3& FromAxis1, const gp_Ax3& ToAxis2) {
71
72   gpTrsf.SetTransformation (FromAxis1, ToAxis2);
73 }
74
75
76 void Geom_Transformation::SetTranslation (const gp_Vec& V) {
77
78    gpTrsf.SetTranslation (V);
79 }
80
81
82 void Geom_Transformation::SetTranslation (const gp_Pnt& P1, const gp_Pnt& P2) {
83
84   gpTrsf.SetTranslation (P1, P2);
85 }
86
87
88 void Geom_Transformation::SetTrsf (const gp_Trsf& T) { gpTrsf = T; }
89
90 Standard_Boolean Geom_Transformation::IsNegative () const {return gpTrsf.IsNegative();}
91
92 TrsfForm Geom_Transformation::Form () const { return gpTrsf.Form(); }
93
94 Standard_Real Geom_Transformation::ScaleFactor () const { return gpTrsf.ScaleFactor(); }
95
96 const gp_Trsf& Geom_Transformation::Trsf () const { return gpTrsf; }
97
98 Standard_Real Geom_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const {
99
100    return gpTrsf.Value (Row, Col);
101 }
102
103
104 void Geom_Transformation::Invert () { gpTrsf.Invert(); }
105
106
107 Handle(Transformation) Geom_Transformation::Inverted () const {
108
109    return new Transformation (gpTrsf.Inverted());
110 }
111
112
113 Handle(Transformation) Geom_Transformation::Multiplied (
114 const Handle(Geom_Transformation)& Other) const {
115
116    return new Transformation (gpTrsf.Multiplied (Other->Trsf()));
117 }
118
119
120 void Geom_Transformation::Multiply (const Handle(Geom_Transformation)& Other) {
121
122    gpTrsf.Multiply (Other->Trsf());
123 }
124
125
126 void Geom_Transformation::Power (const Standard_Integer N) { gpTrsf.Power (N); }
127
128
129 Handle(Transformation) Geom_Transformation::Powered (const Standard_Integer N) const {
130
131   gp_Trsf T = gpTrsf;
132   T.Power (N);  
133   return new Transformation (T);
134 }
135
136
137 void Geom_Transformation::PreMultiply (const Handle(Geom_Transformation)& Other){
138
139    gpTrsf.PreMultiply (Other->Trsf());
140 }
141
142
143 void Geom_Transformation::Transforms (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
144
145   gpTrsf.Transforms (X, Y, Z);
146 }
147