00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 inline
00038 G4bool G4Axis2Placement3D::operator==(const G4Axis2Placement3D& other) const
00039 {
00040 return ((location == other.location) && (axis == other.axis) &&
00041 (refDirection == other.refDirection) &&
00042 (pX == other.pX) && (pY == other.pY) && (pZ == other.pZ) &&
00043 (toPlacementCoordinates == other.toPlacementCoordinates) &&
00044 (fromPlacementCoordinates == other.fromPlacementCoordinates))
00045 ? true : false;
00046 }
00047
00048 inline
00049 void G4Axis2Placement3D::Init( const G4Vector3D& refDirection0 ,
00050 const G4Vector3D& axis0 ,
00051 const G4Point3D& location0 )
00052 {
00053 refDirection = refDirection0;
00054 axis = axis0;
00055 location = location0;
00056
00057
00058
00059 pZ = axis.unit();
00060 pX = (refDirection-(refDirection*pZ)*pZ).unit();
00061 pY = pZ.cross(pX);
00062
00063
00064 fromPlacementCoordinates =
00065 G4Translate3D(location0) *
00066 G4Transform3D(CLHEP::HepXHat, CLHEP::HepYHat, CLHEP::HepZHat,
00067 pX, pY, pZ);
00068
00069 toPlacementCoordinates= fromPlacementCoordinates.inverse();
00070 }
00071
00072
00073 inline
00074 G4Axis2Placement3D::G4Axis2Placement3D(const G4Vector3D& refDirection0,
00075 const G4Vector3D& axis0 ,
00076 const G4Point3D& location0 )
00077 {
00078 Init( refDirection0, axis0, location0);
00079 }
00080
00081
00082 inline
00083 G4Point3D G4Axis2Placement3D::GetLocation() const
00084 {
00085 return location;
00086 }
00087
00088 inline
00089 G4Vector3D G4Axis2Placement3D::GetAxis() const
00090 {
00091 return axis;
00092 }
00093
00094 inline
00095 G4Vector3D G4Axis2Placement3D::GetRefDirection() const
00096 {
00097 return refDirection;
00098 }
00099
00101
00102 inline
00103 const G4Transform3D& G4Axis2Placement3D::GetToPlacementCoordinates() const
00104 {
00105 return toPlacementCoordinates;
00106 }
00107
00108 inline
00109 const G4Transform3D& G4Axis2Placement3D::GetFromPlacementCoordinates() const
00110 {
00111 return fromPlacementCoordinates;
00112 }
00113
00114 inline
00115 G4Vector3D G4Axis2Placement3D::GetPX() const
00116 {
00117 return pX;
00118 }
00119
00120 inline
00121 G4Vector3D G4Axis2Placement3D::GetPY() const
00122 {
00123 return pY;
00124 }
00125
00126 inline
00127 G4Vector3D G4Axis2Placement3D::GetPZ() const
00128 {
00129 return pZ;
00130 }