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