Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
source
geometry
management
include
G4AffineTransform.hh
이 파일의 문서화 페이지로 가기
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
//
27
// $Id: G4AffineTransform.hh 109778 2018-05-09 08:07:16Z gcosmo $
28
//
29
//
30
// class G4AffineTransform
31
//
32
// Class description:
33
//
34
// A class for geometric affine transformations [see, eg. Foley & Van Dam]
35
// Supports efficient arbitrary rotation & transformation of vectors and the
36
// computation of compound & inverse transformations. A `rotation flag' is
37
// maintained internally for greater computational efficiency for transforms
38
// that do not involve rotation.
39
//
40
// Interfaces to the CLHEP classes G4ThreeVector & G4RotationMatrix
41
//
42
// For member function descriptions, see comments by declarations. For
43
// additional clarification, also check the `const' declarations for
44
// functions & their parameters.
45
//
46
// Member data:
47
//
48
// G4double rxx,rxy,rxz;
49
// G4double ryx,ryy,ryz; A 3x3 rotation matrix - net rotation
50
// G4double rzx,rzy,rzz;
51
// G4double tx,ty,tz; Net translation
52
53
// History:
54
// Paul R C Kent 6 Aug 1996 - initial version
55
//
56
// 19.09.1996 E.Tcherniaev:
57
// - direct access to the protected members of the G4RotationMatrix class
58
// replaced by access via public access functions
59
// - conversion of the rotation matrix to angle & axis used to get
60
// a possibility to remove "friend" from the G4RotationMatrix class
61
// 06.05.2018 E.Tcherniaev:
62
// - optimized InverseProduct
63
// - added methods for inverse transformation: InverseTrasformPoint,
64
// InverseTransformAxis, InverseNetRotation, InverseNetTranslation
65
// --------------------------------------------------------------------
66
#ifndef G4AFFINETRANSFORM_HH
67
#define G4AFFINETRANSFORM_HH
68
69
#include "
G4Types.hh
"
70
#include "
G4ThreeVector.hh
"
71
#include "
G4RotationMatrix.hh
"
72
#include "
G4Transform3D.hh
"
73
74
class
G4AffineTransform
75
{
76
77
public
:
78
79
inline
G4AffineTransform
();
80
81
public
:
// with description
82
83
inline
G4AffineTransform
(
const
G4ThreeVector
& tlate);
84
// Translation only: under t'form translate point at origin by tlate
85
86
inline
G4AffineTransform
(
const
G4RotationMatrix
& rot);
87
// Rotation only: under t'form rotate by rot
88
89
inline
G4AffineTransform
(
const
G4RotationMatrix
& rot,
90
const
G4ThreeVector
& tlate);
91
// Under t'form: rotate by rot then translate by tlate
92
93
inline
G4AffineTransform
(
const
G4RotationMatrix
* rot,
94
const
G4ThreeVector
& tlate);
95
// Optionally rotate by *rot then translate by tlate - rot may be null
96
97
inline
G4AffineTransform
(
const
G4AffineTransform
& rhs);
98
// Copy constructor
99
100
inline
G4AffineTransform
&
operator=
(
const
G4AffineTransform
& rhs);
101
// Assignment operator
102
103
inline
~G4AffineTransform
();
104
// Destructor
105
106
inline
G4AffineTransform
operator *
(
const
G4AffineTransform
& tf)
const
;
107
// Compound Transforms:
108
// tf2=tf2*tf1 equivalent to tf2*=tf1
109
// Returns compound transformation of self*tf
110
111
inline
G4AffineTransform
&
operator *=
(
const
G4AffineTransform
& tf);
112
// (Modifying) Multiplies self by tf; Returns self reference
113
// ie. A=AB for a*=b
114
115
116
inline
G4AffineTransform
&
Product
(
const
G4AffineTransform
& tf1,
117
const
G4AffineTransform
& tf2);
118
// 'Products' for avoiding (potential) temporaries:
119
// c.Product(a,b) equivalent to c=a*b
120
// c.InverseProduct(a*b,b ) equivalent to c=a
121
// (Modifying) Sets self=tf1*tf2; Returns self reference
122
123
inline
G4AffineTransform
&
InverseProduct
(
const
G4AffineTransform
& tf1,
124
const
G4AffineTransform
& tf2);
125
// (Modifying) Sets self=tf1*(tf2^-1); Returns self reference
126
127
inline
G4ThreeVector
TransformPoint
(
const
G4ThreeVector
& vec)
const
;
128
// Transform the specified point: returns vec*rot+tlate
129
130
inline
G4ThreeVector
InverseTransformPoint
(
const
G4ThreeVector
& vec)
const
;
131
// Transform the specified point using inverse transformation
132
133
inline
G4ThreeVector
TransformAxis
(
const
G4ThreeVector
& axis)
const
;
134
// Transform the specified axis: returns vec*rot
135
136
inline
G4ThreeVector
InverseTransformAxis
(
const
G4ThreeVector
& axis)
const
;
137
// Transform the specified axis using inverse transfromation
138
139
inline
void
ApplyPointTransform
(
G4ThreeVector
& vec)
const
;
140
// Transform the specified point (in place): sets vec=vec*rot+tlate
141
142
inline
void
ApplyAxisTransform
(
G4ThreeVector
& axis)
const
;
143
// Transform the specified axis (in place): sets axis=axis*rot;
144
145
inline
G4AffineTransform
Inverse
()
const
;
146
// Return inverse of current transform
147
148
inline
G4AffineTransform
&
Invert
();
149
// (Modifying) Sets self=inverse of self; Returns self reference
150
151
inline
G4AffineTransform
&
operator +=
(
const
G4ThreeVector
& tlate);
152
inline
G4AffineTransform
&
operator -=
(
const
G4ThreeVector
& tlate);
153
// (Modifying) Adjust net translation by given vector;
154
// Returns self reference
155
156
inline
G4bool
operator ==
(
const
G4AffineTransform
& tf)
const
;
157
inline
G4bool
operator !=
(
const
G4AffineTransform
& tf)
const
;
158
159
inline
G4double
operator []
(
const
G4int
n
)
const
;
160
161
inline
G4bool
IsRotated
()
const
;
162
// True if transform includes rotation
163
164
inline
G4bool
IsTranslated
()
const
;
165
// True if transform includes translation
166
167
inline
G4RotationMatrix
NetRotation
()
const
;
168
169
inline
G4RotationMatrix
InverseNetRotation
()
const
;
170
171
inline
G4ThreeVector
NetTranslation
()
const
;
172
173
inline
G4ThreeVector
InverseNetTranslation
()
const
;
174
175
inline
void
SetNetRotation
(
const
G4RotationMatrix
& rot);
176
177
inline
void
SetNetTranslation
(
const
G4ThreeVector
& tlate);
178
179
inline
operator
G4Transform3D
()
const
;
180
// Conversion operator (cast) to G4Transform3D
181
182
private
:
183
184
inline
G4AffineTransform
(
185
const
G4double
prxx,
const
G4double
prxy,
const
G4double
prxz,
186
const
G4double
pryx,
const
G4double
pryy,
const
G4double
pryz,
187
const
G4double
przx,
const
G4double
przy,
const
G4double
przz,
188
const
G4double
ptx,
const
G4double
pty,
const
G4double
ptz);
189
190
G4double
rxx
,
rxy
,
rxz
;
191
G4double
ryx
,
ryy
,
ryz
;
192
G4double
rzx
,
rzy
,
rzz
;
193
G4double
tx
,
ty
,
tz
;
194
};
195
196
std::ostream&
operator <<
(std::ostream& os,
const
G4AffineTransform
& transf);
197
198
#include "G4AffineTransform.icc"
199
200
#endif
G4AffineTransform::TransformAxis
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
G4AffineTransform::operator*
G4AffineTransform operator*(const G4AffineTransform &tf) const
G4AffineTransform::SetNetTranslation
void SetNetTranslation(const G4ThreeVector &tlate)
G4AffineTransform::rzx
G4double rzx
Definition:
G4AffineTransform.hh:192
G4AffineTransform::Product
G4AffineTransform & Product(const G4AffineTransform &tf1, const G4AffineTransform &tf2)
G4AffineTransform::~G4AffineTransform
~G4AffineTransform()
HepGeom::BasicVector3D::operator<<
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
Definition:
BasicVector3D.cc:107
G4Transform3D
HepGeom::Transform3D G4Transform3D
Definition:
G4Transform3D.hh:35
G4AffineTransform::G4AffineTransform
G4AffineTransform()
G4AffineTransform::operator*=
G4AffineTransform & operator*=(const G4AffineTransform &tf)
G4AffineTransform::IsTranslated
G4bool IsTranslated() const
G4AffineTransform::InverseProduct
G4AffineTransform & InverseProduct(const G4AffineTransform &tf1, const G4AffineTransform &tf2)
G4AffineTransform::SetNetRotation
void SetNetRotation(const G4RotationMatrix &rot)
G4Types.hh
G4AffineTransform::tx
G4double tx
Definition:
G4AffineTransform.hh:193
CLHEP::HepRotation
Definition:
Rotation.h:47
G4AffineTransform::ty
G4double ty
Definition:
G4AffineTransform.hh:193
G4AffineTransform::InverseTransformPoint
G4ThreeVector InverseTransformPoint(const G4ThreeVector &vec) const
G4AffineTransform::rzz
G4double rzz
Definition:
G4AffineTransform.hh:192
G4AffineTransform::InverseNetRotation
G4RotationMatrix InverseNetRotation() const
G4double
double G4double
Definition:
G4Types.hh:76
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4AffineTransform::ApplyPointTransform
void ApplyPointTransform(G4ThreeVector &vec) const
G4AffineTransform::rxy
G4double rxy
Definition:
G4AffineTransform.hh:190
G4AffineTransform::InverseTransformAxis
G4ThreeVector InverseTransformAxis(const G4ThreeVector &axis) const
G4AffineTransform::Invert
G4AffineTransform & Invert()
G4AffineTransform::rxz
G4double rxz
Definition:
G4AffineTransform.hh:190
G4Transform3D.hh
G4ThreeVector.hh
G4AffineTransform
Definition:
G4AffineTransform.hh:74
G4AffineTransform::operator!=
G4bool operator!=(const G4AffineTransform &tf) const
G4AffineTransform::NetTranslation
G4ThreeVector NetTranslation() const
CLHEP::Hep3Vector
Definition:
ThreeVector.h:41
G4AffineTransform::IsRotated
G4bool IsRotated() const
G4int
int G4int
Definition:
G4Types.hh:78
G4AffineTransform::InverseNetTranslation
G4ThreeVector InverseNetTranslation() const
G4AffineTransform::rzy
G4double rzy
Definition:
G4AffineTransform.hh:192
G4AffineTransform::Inverse
G4AffineTransform Inverse() const
G4AffineTransform::operator+=
G4AffineTransform & operator+=(const G4ThreeVector &tlate)
G4AffineTransform::rxx
G4double rxx
Definition:
G4AffineTransform.hh:190
n
Char_t n[5]
Definition:
comparison_ascii.C:55
G4AffineTransform::ApplyAxisTransform
void ApplyAxisTransform(G4ThreeVector &axis) const
G4AffineTransform::operator=
G4AffineTransform & operator=(const G4AffineTransform &rhs)
G4AffineTransform::ryx
G4double ryx
Definition:
G4AffineTransform.hh:191
G4AffineTransform::TransformPoint
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4AffineTransform::tz
G4double tz
Definition:
G4AffineTransform.hh:193
G4AffineTransform::operator==
G4bool operator==(const G4AffineTransform &tf) const
G4AffineTransform::ryz
G4double ryz
Definition:
G4AffineTransform.hh:191
G4AffineTransform::operator[]
G4double operator[](const G4int n) const
G4AffineTransform::ryy
G4double ryy
Definition:
G4AffineTransform.hh:191
G4AffineTransform::NetRotation
G4RotationMatrix NetRotation() const
G4AffineTransform::operator-=
G4AffineTransform & operator-=(const G4ThreeVector &tlate)
G4RotationMatrix.hh
다음에 의해 생성됨 :
1.8.5