1 // Created on: 1993-03-10
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <Geom_Transformation.ixx>
19 typedef Handle(Geom_Transformation) Handle(Transformation);
20 typedef Geom_Transformation Transformation;
25 typedef gp_TrsfForm TrsfForm;
31 Geom_Transformation::Geom_Transformation () { }
34 Geom_Transformation::Geom_Transformation (const gp_Trsf& T)
38 Handle(Geom_Transformation) Geom_Transformation::Copy() const {
40 Handle(Transformation) T;
41 T = new Transformation (gpTrsf);
46 void Geom_Transformation::SetMirror (const gp_Pnt& P) { gpTrsf.SetMirror (P); }
48 void Geom_Transformation::SetMirror (const gp_Ax1& A1) { gpTrsf.SetMirror (A1); }
50 void Geom_Transformation::SetMirror (const gp_Ax2& A2) { gpTrsf.SetMirror (A2);}
52 void Geom_Transformation::SetRotation (const gp_Ax1& A1, const Standard_Real Ang) {
54 gpTrsf.SetRotation (A1, Ang);
57 void Geom_Transformation::SetScale (const gp_Pnt& P, const Standard_Real S) {
59 gpTrsf.SetScale (P, S);
63 void Geom_Transformation::SetTransformation (const gp_Ax3& ToAxis) {
65 gpTrsf.SetTransformation (ToAxis);
69 void Geom_Transformation::SetTransformation (
70 const gp_Ax3& FromAxis1, const gp_Ax3& ToAxis2) {
72 gpTrsf.SetTransformation (FromAxis1, ToAxis2);
76 void Geom_Transformation::SetTranslation (const gp_Vec& V) {
78 gpTrsf.SetTranslation (V);
82 void Geom_Transformation::SetTranslation (const gp_Pnt& P1, const gp_Pnt& P2) {
84 gpTrsf.SetTranslation (P1, P2);
88 void Geom_Transformation::SetTrsf (const gp_Trsf& T) { gpTrsf = T; }
90 Standard_Boolean Geom_Transformation::IsNegative () const {return gpTrsf.IsNegative();}
92 TrsfForm Geom_Transformation::Form () const { return gpTrsf.Form(); }
94 Standard_Real Geom_Transformation::ScaleFactor () const { return gpTrsf.ScaleFactor(); }
96 const gp_Trsf& Geom_Transformation::Trsf () const { return gpTrsf; }
98 Standard_Real Geom_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const {
100 return gpTrsf.Value (Row, Col);
104 void Geom_Transformation::Invert () { gpTrsf.Invert(); }
107 Handle(Transformation) Geom_Transformation::Inverted () const {
109 return new Transformation (gpTrsf.Inverted());
113 Handle(Transformation) Geom_Transformation::Multiplied (
114 const Handle(Geom_Transformation)& Other) const {
116 return new Transformation (gpTrsf.Multiplied (Other->Trsf()));
120 void Geom_Transformation::Multiply (const Handle(Geom_Transformation)& Other) {
122 gpTrsf.Multiply (Other->Trsf());
126 void Geom_Transformation::Power (const Standard_Integer N) { gpTrsf.Power (N); }
129 Handle(Transformation) Geom_Transformation::Powered (const Standard_Integer N) const {
133 return new Transformation (T);
137 void Geom_Transformation::PreMultiply (const Handle(Geom_Transformation)& Other){
139 gpTrsf.PreMultiply (Other->Trsf());
143 void Geom_Transformation::Transforms (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
145 gpTrsf.Transforms (X, Y, Z);