174 lines
4.2 KiB
Plaintext
174 lines
4.2 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * License and Disclaimer *
|
|
// * *
|
|
// * The Geant4 software is copyright of the Copyright Holders of *
|
|
// * the Geant4 Collaboration. It is provided under the terms and *
|
|
// * conditions of the Geant4 Software License, included in the file *
|
|
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
|
// * include a list of copyright holders. *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. Please see the license in the file LICENSE and URL above *
|
|
// * for the full disclaimer and the limitation of liability. *
|
|
// * *
|
|
// * This code implementation is the result of the scientific and *
|
|
// * technical work of the GEANT4 collaboration. *
|
|
// * By using, copying, modifying or distributing the software (or *
|
|
// * any work based on the software) you agree to acknowledge its *
|
|
// * use in resulting scientific publications, and indicate your *
|
|
// * acceptance of all terms of the Geant4 Software license. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id: G4VPhysicalVolume.icc 74466 2013-10-07 15:36:32Z gcosmo $
|
|
//
|
|
//
|
|
// class G4VPhysicalVolume Inline Implementation
|
|
//
|
|
// --------------------------------------------------------------------
|
|
|
|
// These macros change the references to fields that are now encapsulated
|
|
// in the class G4PVData.
|
|
//
|
|
#define G4MT_rot ((subInstanceManager.offset[instanceID]).frot)
|
|
#define G4MT_trans ((subInstanceManager.offset[instanceID]).ftrans)
|
|
|
|
#define G4MT_pvdata (subInstanceManager.offset[instanceID])
|
|
|
|
inline
|
|
G4bool G4VPhysicalVolume::operator == (const G4VPhysicalVolume& right) const
|
|
{
|
|
return (this==&right) ? true : false;
|
|
}
|
|
|
|
inline
|
|
G4int G4VPhysicalVolume::GetInstanceID() const
|
|
{
|
|
return instanceID;
|
|
}
|
|
|
|
|
|
inline
|
|
const G4ThreeVector& G4VPhysicalVolume::GetTranslation() const
|
|
{
|
|
return G4MT_trans;
|
|
}
|
|
|
|
inline
|
|
void G4VPhysicalVolume::SetTranslation(const G4ThreeVector &vec)
|
|
{
|
|
G4MT_trans=vec;
|
|
}
|
|
|
|
inline
|
|
const G4RotationMatrix* G4VPhysicalVolume::GetRotation() const
|
|
{
|
|
return G4MT_rot;
|
|
}
|
|
|
|
inline
|
|
G4RotationMatrix* G4VPhysicalVolume::GetRotation()
|
|
{
|
|
return G4MT_rot;
|
|
}
|
|
|
|
inline
|
|
void G4VPhysicalVolume::SetRotation(G4RotationMatrix *pRot)
|
|
{
|
|
G4MT_rot=pRot;
|
|
}
|
|
|
|
inline
|
|
G4LogicalVolume* G4VPhysicalVolume::GetLogicalVolume() const
|
|
{
|
|
return flogical;
|
|
}
|
|
|
|
inline
|
|
void G4VPhysicalVolume::SetLogicalVolume(G4LogicalVolume *pLogical)
|
|
{
|
|
flogical=pLogical;
|
|
}
|
|
|
|
inline
|
|
G4LogicalVolume* G4VPhysicalVolume::GetMotherLogical() const
|
|
{
|
|
return flmother;
|
|
}
|
|
|
|
inline
|
|
void G4VPhysicalVolume::SetMotherLogical(G4LogicalVolume *pMother)
|
|
{
|
|
flmother=pMother;
|
|
}
|
|
|
|
inline
|
|
const G4String& G4VPhysicalVolume::GetName() const
|
|
{
|
|
return fname;
|
|
}
|
|
|
|
inline
|
|
void G4VPhysicalVolume::SetName(const G4String& pName)
|
|
{
|
|
fname=pName;
|
|
}
|
|
|
|
inline
|
|
EVolume G4VPhysicalVolume::VolumeType() const
|
|
{
|
|
EVolume type;
|
|
EAxis axis;
|
|
G4int nReplicas;
|
|
G4double width,offset;
|
|
G4bool consuming;
|
|
if ( IsReplicated() )
|
|
{
|
|
GetReplicationData(axis,nReplicas,width,offset,consuming);
|
|
type = (consuming) ? kReplica : kParameterised;
|
|
}
|
|
else
|
|
{
|
|
type = kNormal;
|
|
}
|
|
return type;
|
|
}
|
|
|
|
inline
|
|
G4RotationMatrix G4VPhysicalVolume::GetObjectRotationValue() const
|
|
{
|
|
G4RotationMatrix aRotM; // Initialised to identity
|
|
|
|
// Insure against G4MT_rot being a null pointer
|
|
if(G4MT_rot)
|
|
{
|
|
aRotM= G4MT_rot->inverse();
|
|
}
|
|
return aRotM;
|
|
}
|
|
|
|
inline
|
|
G4ThreeVector G4VPhysicalVolume::GetObjectTranslation() const
|
|
{
|
|
return G4MT_trans;
|
|
}
|
|
|
|
inline
|
|
const G4RotationMatrix* G4VPhysicalVolume::GetFrameRotation() const
|
|
{
|
|
return G4MT_rot;
|
|
}
|
|
|
|
inline
|
|
G4ThreeVector G4VPhysicalVolume::GetFrameTranslation() const
|
|
{
|
|
return -G4MT_trans;
|
|
}
|
|
|
|
#undef G4MT_rot
|
|
#undef G4MT_trans
|