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