Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
geant4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas-simulation-team
geant4
Commits
25ce267e
Commit
25ce267e
authored
7 years ago
by
Evgueni Tcherniaev
Browse files
Options
Downloads
Patches
Plain Diff
Use of temporary variables
parent
78702576
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/geometry/management/include/G4AffineTransform.icc
+20
-27
20 additions, 27 deletions
source/geometry/management/include/G4AffineTransform.icc
with
20 additions
and
27 deletions
source/geometry/management/include/G4AffineTransform.icc
+
20
−
27
View file @
25ce267e
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
// ********************************************************************
// ********************************************************************
//
//
//
//
// $Id: G4AffineTransform.icc 9830
9
2016-07-06 10:
30:1
5Z gcosmo $
// $Id: G4AffineTransform.icc 9830
7
2016-07-06 10:
28:3
5Z gcosmo $
//
//
//
//
// G4AffineTransformation Inline implementation
// G4AffineTransformation Inline implementation
...
@@ -50,9 +50,7 @@ inline G4AffineTransform::G4AffineTransform(const G4RotationMatrix& rot)
...
@@ -50,9 +50,7 @@ inline G4AffineTransform::G4AffineTransform(const G4RotationMatrix& rot)
ryx(rot.yx()),ryy(rot.yy()),ryz(rot.yz()),
ryx(rot.yx()),ryy(rot.yy()),ryz(rot.yz()),
rzx(rot.zx()),rzy(rot.zy()),rzz(rot.zz()),
rzx(rot.zx()),rzy(rot.zy()),rzz(rot.zz()),
tx(0),ty(0),tz(0)
tx(0),ty(0),tz(0)
{
{}
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
}
inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix& rot,
inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix& rot,
const G4ThreeVector& tlate )
const G4ThreeVector& tlate )
...
@@ -60,9 +58,7 @@ inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix& rot,
...
@@ -60,9 +58,7 @@ inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix& rot,
ryx(rot.yx()),ryy(rot.yy()),ryz(rot.yz()),
ryx(rot.yx()),ryy(rot.yy()),ryz(rot.yz()),
rzx(rot.zx()),rzy(rot.zy()),rzz(rot.zz()),
rzx(rot.zx()),rzy(rot.zy()),rzz(rot.zz()),
tx(tlate.x()),ty(tlate.y()),tz(tlate.z())
tx(tlate.x()),ty(tlate.y()),tz(tlate.z())
{
{}
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
}
inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix* rot,
inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix* rot,
const G4ThreeVector& tlate)
const G4ThreeVector& tlate)
...
@@ -73,7 +69,6 @@ inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix* rot,
...
@@ -73,7 +69,6 @@ inline G4AffineTransform::G4AffineTransform( const G4RotationMatrix* rot,
rxx=rot->xx();rxy=rot->xy();rxz=rot->xz();
rxx=rot->xx();rxy=rot->xy();rxz=rot->xz();
ryx=rot->yx();ryy=rot->yy();ryz=rot->yz();
ryx=rot->yx();ryy=rot->yy();ryz=rot->yz();
rzx=rot->zx();rzy=rot->zy();rzz=rot->zz();
rzx=rot->zx();rzy=rot->zy();rzz=rot->zz();
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
}
}
else
else
{
{
...
@@ -93,9 +88,7 @@ G4AffineTransform( const G4double prxx,const G4double prxy,const G4double prxz,
...
@@ -93,9 +88,7 @@ G4AffineTransform( const G4double prxx,const G4double prxy,const G4double prxz,
ryx(pryx),ryy(pryy),ryz(pryz),
ryx(pryx),ryy(pryy),ryz(pryz),
rzx(przx),rzy(przy),rzz(przz),
rzx(przx),rzy(przy),rzz(przz),
tx(ptx),ty(pty),tz(ptz)
tx(ptx),ty(pty),tz(ptz)
{
{}
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
}
inline G4AffineTransform
inline G4AffineTransform
G4AffineTransform::operator * (const G4AffineTransform& tf) const
G4AffineTransform::operator * (const G4AffineTransform& tf) const
...
@@ -144,7 +137,6 @@ G4AffineTransform::operator *= (const G4AffineTransform& tf)
...
@@ -144,7 +137,6 @@ G4AffineTransform::operator *= (const G4AffineTransform& tf)
ryx=nryx; ryy=nryy; ryz=nryz;
ryx=nryx; ryy=nryy; ryz=nryz;
rzx=nrzx; rzy=nrzy; rzz=nrzz;
rzx=nrzx; rzy=nrzy; rzz=nrzz;
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
return *this;
return *this;
}
}
...
@@ -168,7 +160,6 @@ G4AffineTransform::Product(const G4AffineTransform& tf1,
...
@@ -168,7 +160,6 @@ G4AffineTransform::Product(const G4AffineTransform& tf1,
ty=tf1.tx*tf2.rxy + tf1.ty*tf2.ryy + tf1.tz*tf2.rzy + tf2.ty;
ty=tf1.tx*tf2.rxy + tf1.ty*tf2.ryy + tf1.tz*tf2.rzy + tf2.ty;
tz=tf1.tx*tf2.rxz + tf1.ty*tf2.ryz + tf1.tz*tf2.rzz + tf2.tz;
tz=tf1.tx*tf2.rxz + tf1.ty*tf2.ryz + tf1.tz*tf2.rzz + tf2.tz;
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
return *this;
return *this;
}
}
...
@@ -196,32 +187,34 @@ G4AffineTransform::InverseProduct( const G4AffineTransform& tf1,
...
@@ -196,32 +187,34 @@ G4AffineTransform::InverseProduct( const G4AffineTransform& tf1,
ty=tf1.tx*tf2.ryx+tf1.ty*tf2.ryy+tf1.tz*tf2.ryz+itf2ty;
ty=tf1.tx*tf2.ryx+tf1.ty*tf2.ryy+tf1.tz*tf2.ryz+itf2ty;
tz=tf1.tx*tf2.rzx+tf1.ty*tf2.rzy+tf1.tz*tf2.rzz+itf2tz;
tz=tf1.tx*tf2.rzx+tf1.ty*tf2.rzy+tf1.tz*tf2.rzz+itf2tz;
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
return *this;
return *this;
}
}
inline
inline
G4ThreeVector G4AffineTransform::TransformPoint(const G4ThreeVector& vec) const
G4ThreeVector G4AffineTransform::TransformPoint(const G4ThreeVector& vec) const
{
{
return G4ThreeVector( vec.x()*rxx + vec.y()*ryx + vec.z()*rzx + tx,
G4double vecx = vec.x(), vecy = vec.y(), vecz = vec.z();
vec.x()*rxy + vec.y()*ryy + vec.z()*rzy + ty,
return G4ThreeVector( vecx*rxx + vecy*ryx + vecz*rzx + tx,
vec.x()*rxz + vec.y()*ryz + vec.z()*rzz + tz );
vecx*rxy + vecy*ryy + vecz*rzy + ty,
vecx*rxz + vecy*ryz + vecz*rzz + tz );
}
}
inline
inline
G4ThreeVector G4AffineTransform::TransformAxis(const G4ThreeVector& axis) const
G4ThreeVector G4AffineTransform::TransformAxis(const G4ThreeVector& axis) const
{
{
return G4ThreeVector( axis.x()*rxx + axis.y()*ryx + axis.z()*rzx,
G4double axisx = axis.x(), axisy = axis.y(), axisz = axis.z();
axis.x()*rxy + axis.y()*ryy + axis.z()*rzy,
return G4ThreeVector( axisx*rxx + axisy*ryx + axisz*rzx,
axis.x()*rxz + axis.y()*ryz + axis.z()*rzz );
axisx*rxy + axisy*ryy + axisz*rzy,
axisx*rxz + axisy*ryz + axisz*rzz );
}
}
inline
inline
void G4AffineTransform::ApplyPointTransform(G4ThreeVector& vec) const
void G4AffineTransform::ApplyPointTransform(G4ThreeVector& vec) const
{
{
G4double x = vec.x()*rxx + vec.y()*ryx + vec.z()*rzx + tx;
G4double vecx = vec.x(), vecy = vec.y(), vecz = vec.z();
G4double y = vec.x()*rxy + vec.y()*ryy + vec.z()*rzy + ty;
G4double x = vecx*rxx + vecy*ryx + vecz*rzx + tx;
G4double z = vec.x()*rxz + vec.y()*ryz + vec.z()*rzz + tz;
G4double y = vecx*rxy + vecy*ryy + vecz*rzy + ty;
G4double z = vecx*rxz + vecy*ryz + vecz*rzz + tz;
vec.setX(x);
vec.setX(x);
vec.setY(y);
vec.setY(y);
...
@@ -231,9 +224,10 @@ void G4AffineTransform::ApplyPointTransform(G4ThreeVector& vec) const
...
@@ -231,9 +224,10 @@ void G4AffineTransform::ApplyPointTransform(G4ThreeVector& vec) const
inline
inline
void G4AffineTransform::ApplyAxisTransform(G4ThreeVector& axis) const
void G4AffineTransform::ApplyAxisTransform(G4ThreeVector& axis) const
{
{
G4double x = axis.x()*rxx + axis.y()*ryx + axis.z()*rzx;
G4double axisx = axis.x(), axisy = axis.y(), axisz = axis.z();
G4double y = axis.x()*rxy + axis.y()*ryy + axis.z()*rzy;
G4double x = axisx*rxx + axisy*ryx + axisz*rzx;
G4double z = axis.x()*rxz + axis.y()*ryz + axis.z()*rzz;
G4double y = axisx*rxy + axisy*ryy + axisz*rzy;
G4double z = axisx*rxz + axisy*ryz + axisz*rzz;
axis.setX(x);
axis.setX(x);
axis.setY(y);
axis.setY(y);
...
@@ -396,7 +390,6 @@ void G4AffineTransform::SetNetRotation(const G4RotationMatrix& rot)
...
@@ -396,7 +390,6 @@ void G4AffineTransform::SetNetRotation(const G4RotationMatrix& rot)
rzx=rot.zx();
rzx=rot.zx();
rzy=rot.zy();
rzy=rot.zy();
rzz=rot.zz();
rzz=rot.zz();
if (rxx==1. && ryy==1. && rzz==1.) { rxy = rxz = ryx = ryz = rzx = rzy = 0; }
}
}
inline
inline
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment