summaryrefslogtreecommitdiff
path: root/src/Geom/Geom_Transformation.cxx
blob: a0a38f2f66174904409c1a4f2e4d1bd042edcf16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// File:	Geom_Transformation.cxx
// Created:	Wed Mar 10 10:59:58 1993
// Author:	JCV
//		<fid@phylox>
// Copyright:	Matra Datavision 1993

//File Geom_Transformation.cxx, JCV 14/01/91
#include <Geom_Transformation.ixx>

typedef Handle(Geom_Transformation) Handle(Transformation);
typedef Geom_Transformation         Transformation;
typedef gp_Ax1      Ax1;
typedef gp_Ax2      Ax2;
typedef gp_Ax3      Ax3;
typedef gp_Pnt      Pnt;
typedef gp_TrsfForm TrsfForm;
typedef gp_Vec      Vec;




Geom_Transformation::Geom_Transformation () { }


Geom_Transformation::Geom_Transformation (const gp_Trsf& T) 
: gpTrsf (T) { }


Handle(Geom_Transformation) Geom_Transformation::Copy() const {

  Handle(Transformation) T;
  T = new Transformation (gpTrsf);
  return T; 
}


void Geom_Transformation::SetMirror (const gp_Pnt& P) { gpTrsf.SetMirror (P); }

void Geom_Transformation::SetMirror (const gp_Ax1& A1) { gpTrsf.SetMirror (A1); }

void Geom_Transformation::SetMirror (const gp_Ax2& A2) { gpTrsf.SetMirror (A2);}

void Geom_Transformation::SetRotation (const gp_Ax1& A1, const Standard_Real Ang) {

  gpTrsf.SetRotation (A1, Ang);
}

void Geom_Transformation::SetScale (const gp_Pnt& P, const Standard_Real S) {

   gpTrsf.SetScale (P, S);
}


void Geom_Transformation::SetTransformation (const gp_Ax3& ToAxis) {

  gpTrsf.SetTransformation (ToAxis);
}


void Geom_Transformation::SetTransformation (
const gp_Ax3& FromAxis1, const gp_Ax3& ToAxis2) {

  gpTrsf.SetTransformation (FromAxis1, ToAxis2);
}


void Geom_Transformation::SetTranslation (const gp_Vec& V) {

   gpTrsf.SetTranslation (V);
}


void Geom_Transformation::SetTranslation (const gp_Pnt& P1, const gp_Pnt& P2) {

  gpTrsf.SetTranslation (P1, P2);
}


void Geom_Transformation::SetTrsf (const gp_Trsf& T) { gpTrsf = T; }

Standard_Boolean Geom_Transformation::IsNegative () const {return gpTrsf.IsNegative();}

TrsfForm Geom_Transformation::Form () const { return gpTrsf.Form(); }

Standard_Real Geom_Transformation::ScaleFactor () const { return gpTrsf.ScaleFactor(); }

const gp_Trsf& Geom_Transformation::Trsf () const { return gpTrsf; }

Standard_Real Geom_Transformation::Value (const Standard_Integer Row, const Standard_Integer Col) const {

   return gpTrsf.Value (Row, Col);
}


void Geom_Transformation::Invert () { gpTrsf.Invert(); }


Handle(Transformation) Geom_Transformation::Inverted () const {

   return new Transformation (gpTrsf.Inverted());
}


Handle(Transformation) Geom_Transformation::Multiplied (
const Handle(Geom_Transformation)& Other) const {

   return new Transformation (gpTrsf.Multiplied (Other->Trsf()));
}


void Geom_Transformation::Multiply (const Handle(Geom_Transformation)& Other) {

   gpTrsf.Multiply (Other->Trsf());
}


void Geom_Transformation::Power (const Standard_Integer N) { gpTrsf.Power (N); }


Handle(Transformation) Geom_Transformation::Powered (const Standard_Integer N) const {

  gp_Trsf T = gpTrsf;
  T.Power (N);  
  return new Transformation (T);
}


void Geom_Transformation::PreMultiply (const Handle(Geom_Transformation)& Other){

   gpTrsf.PreMultiply (Other->Trsf());
}


void Geom_Transformation::Transforms (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {

  gpTrsf.Transforms (X, Y, Z);
}