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