0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[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
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22#include <Geom_Transformation.ixx>
23
24typedef Handle(Geom_Transformation) Handle(Transformation);
25typedef Geom_Transformation Transformation;
26typedef gp_Ax1 Ax1;
27typedef gp_Ax2 Ax2;
28typedef gp_Ax3 Ax3;
29typedef gp_Pnt Pnt;
30typedef gp_TrsfForm TrsfForm;
31typedef gp_Vec Vec;
32
33
34
35
36Geom_Transformation::Geom_Transformation () { }
37
38
39Geom_Transformation::Geom_Transformation (const gp_Trsf& T)
40: gpTrsf (T) { }
41
42
43Handle(Geom_Transformation) Geom_Transformation::Copy() const {
44
45 Handle(Transformation) T;
46 T = new Transformation (gpTrsf);
47 return T;
48}
49
50
51void Geom_Transformation::SetMirror (const gp_Pnt& P) { gpTrsf.SetMirror (P); }
52
53void Geom_Transformation::SetMirror (const gp_Ax1& A1) { gpTrsf.SetMirror (A1); }
54
55void Geom_Transformation::SetMirror (const gp_Ax2& A2) { gpTrsf.SetMirror (A2);}
56
57void Geom_Transformation::SetRotation (const gp_Ax1& A1, const Standard_Real Ang) {
58
59 gpTrsf.SetRotation (A1, Ang);
60}
61
62void Geom_Transformation::SetScale (const gp_Pnt& P, const Standard_Real S) {
63
64 gpTrsf.SetScale (P, S);
65}
66
67
68void Geom_Transformation::SetTransformation (const gp_Ax3& ToAxis) {
69
70 gpTrsf.SetTransformation (ToAxis);
71}
72
73
74void Geom_Transformation::SetTransformation (
75const gp_Ax3& FromAxis1, const gp_Ax3& ToAxis2) {
76
77 gpTrsf.SetTransformation (FromAxis1, ToAxis2);
78}
79
80
81void Geom_Transformation::SetTranslation (const gp_Vec& V) {
82
83 gpTrsf.SetTranslation (V);
84}
85
86
87void Geom_Transformation::SetTranslation (const gp_Pnt& P1, const gp_Pnt& P2) {
88
89 gpTrsf.SetTranslation (P1, P2);
90}
91
92
93void Geom_Transformation::SetTrsf (const gp_Trsf& T) { gpTrsf = T; }
94
95Standard_Boolean Geom_Transformation::IsNegative () const {return gpTrsf.IsNegative();}
96
97TrsfForm Geom_Transformation::Form () const { return gpTrsf.Form(); }
98
99Standard_Real Geom_Transformation::ScaleFactor () const { return gpTrsf.ScaleFactor(); }
100
101const gp_Trsf& Geom_Transformation::Trsf () const { return gpTrsf; }
102
103Standard_Real Geom_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const {
104
105 return gpTrsf.Value (Row, Col);
106}
107
108
109void Geom_Transformation::Invert () { gpTrsf.Invert(); }
110
111
112Handle(Transformation) Geom_Transformation::Inverted () const {
113
114 return new Transformation (gpTrsf.Inverted());
115}
116
117
118Handle(Transformation) Geom_Transformation::Multiplied (
119const Handle(Geom_Transformation)& Other) const {
120
121 return new Transformation (gpTrsf.Multiplied (Other->Trsf()));
122}
123
124
125void Geom_Transformation::Multiply (const Handle(Geom_Transformation)& Other) {
126
127 gpTrsf.Multiply (Other->Trsf());
128}
129
130
131void Geom_Transformation::Power (const Standard_Integer N) { gpTrsf.Power (N); }
132
133
134Handle(Transformation) Geom_Transformation::Powered (const Standard_Integer N) const {
135
136 gp_Trsf T = gpTrsf;
137 T.Power (N);
138 return new Transformation (T);
139}
140
141
142void Geom_Transformation::PreMultiply (const Handle(Geom_Transformation)& Other){
143
144 gpTrsf.PreMultiply (Other->Trsf());
145}
146
147
148void Geom_Transformation::Transforms (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
149
150 gpTrsf.Transforms (X, Y, Z);
151}
152