2// ********************************************************************
 
    3// * License and Disclaimer                                           *
 
    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.                             *
 
   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.         *
 
   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// ********************************************************************
 
   26// Class G4AssemblyTriplet - inline implementation
 
   28// ----------------------------------------------------------------------
 
   31G4AssemblyTriplet::G4AssemblyTriplet()
 
   33  G4ThreeVector v(0.,0.,0.);
 
   38G4AssemblyTriplet::G4AssemblyTriplet( G4LogicalVolume* pVolume,
 
   39                                      G4ThreeVector& translation,
 
   40                                      G4RotationMatrix* pRotation,
 
   42  : fVolume( pVolume ), fTranslation( translation ), fRotation( pRotation ),
 
   43    fIsReflection(isReflection)
 
   48G4AssemblyTriplet::G4AssemblyTriplet( G4AssemblyVolume* pAssembly,
 
   49                                      G4ThreeVector& translation,
 
   50                                      G4RotationMatrix* pRotation,
 
   52  : fTranslation( translation ), fRotation( pRotation ),
 
   53    fAssembly( pAssembly ), fIsReflection(isReflection) 
 
   58G4AssemblyTriplet::G4AssemblyTriplet( const G4AssemblyTriplet& scopy )
 
   60  fVolume       = scopy.GetVolume();
 
   61  fRotation     = scopy.GetRotation();
 
   62  fTranslation  = scopy.GetTranslation();
 
   63  fAssembly     = scopy.GetAssembly();
 
   64  fIsReflection = scopy.IsReflection();
 
   68G4AssemblyTriplet::~G4AssemblyTriplet()
 
   73G4LogicalVolume* G4AssemblyTriplet::GetVolume() const
 
   79void G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume )
 
   81  if ( fAssembly != nullptr ) 
 
   83    G4Exception("G4AssemblyTriplet::SetVolume()",
 
   84                "GeomVol1001", JustWarning,
 
   85                "There is an assembly already set, it will be ignored.");
 
   92G4AssemblyVolume* G4AssemblyTriplet::GetAssembly() const
 
   98void G4AssemblyTriplet::SetAssembly( G4AssemblyVolume* pAssembly )
 
  100  if ( fVolume != nullptr ) 
 
  102    G4Exception("G4AssemblyTriplet::SetAssembly()",
 
  103                "GeomVol1001", JustWarning,
 
  104                "There is a volume already set, it will be ignored.");
 
  106  fAssembly = pAssembly;
 
  111G4ThreeVector G4AssemblyTriplet::GetTranslation() const
 
  117void G4AssemblyTriplet::SetTranslation( G4ThreeVector& translation )
 
  119  fTranslation = translation;
 
  123G4RotationMatrix* G4AssemblyTriplet::GetRotation() const
 
  129void G4AssemblyTriplet::SetRotation( G4RotationMatrix* pRotation )
 
  131  fRotation = pRotation;
 
  135G4bool G4AssemblyTriplet::IsReflection() const
 
  137  return fIsReflection;
 
  142G4AssemblyTriplet::operator=( const G4AssemblyTriplet& scopy )
 
  146    fVolume       = scopy.GetVolume();
 
  147    fRotation     = scopy.GetRotation();
 
  148    fTranslation  = scopy.GetTranslation();
 
  149    fAssembly     = scopy.GetAssembly();
 
  150    fIsReflection = scopy.IsReflection();