00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // Class G4AssemblyTriplet 00031 // 00032 // Class description: 00033 // 00034 // A class to help place logical or assembly volumes inside a generic 00035 // containers (like STL vector ) together with information about its rotation, 00036 // placement and eventually reflection. 00037 // How to interpret the rotation and translation depends on the class which 00038 // uses a container of these triplets. The first class using G4AssemblyTriplet 00039 // is G4AssemblyVolume class. 00040 // The pointer to the logical or assembly volume is copied so this class 00041 // does not take its ownership and does not delete the object behind. 00042 00043 // Author: Radovan Chytracek 00044 // Version: 1.0 00045 // Date: November 2000 00046 // 00047 // History: 00048 // March 2006, I.Hrivnacova - Extended to support assembly of assemblies 00049 // of volumes and reflections 00050 // ---------------------------------------------------------------------- 00051 #ifndef G4_ASSEMBLYTRIPLET_H 00052 #define G4_ASSEMBLYTRIPLET_H 00053 00054 #include "G4ThreeVector.hh" 00055 #include "G4RotationMatrix.hh" 00056 00057 class G4LogicalVolume; 00058 class G4AssemblyVolume; 00059 00060 class G4AssemblyTriplet 00061 { 00062 public: // with description 00063 00064 G4AssemblyTriplet(); 00065 // Default constructor 00066 00067 G4AssemblyTriplet( G4LogicalVolume* pVolume, 00068 G4ThreeVector& translation, 00069 G4RotationMatrix* pRotation, 00070 G4bool isReflection = false); 00071 // An explicit constructor for a logical volume 00072 00073 G4AssemblyTriplet( G4AssemblyVolume* pAssembly, 00074 G4ThreeVector& translation, 00075 G4RotationMatrix* pRotation, 00076 G4bool isReflection = false); 00077 // An explicit constructor for an assembly volume 00078 00079 G4AssemblyTriplet( const G4AssemblyTriplet& second ); 00080 // Copy constructor 00081 00082 ~G4AssemblyTriplet(); 00083 // Destructor 00084 00085 G4AssemblyTriplet& operator=( const G4AssemblyTriplet& second ); 00086 // Assignment operator 00087 00088 inline G4LogicalVolume* GetVolume() const; 00089 // Retrieve the logical volume reference 00090 00091 inline void SetVolume( G4LogicalVolume* pVolume ); 00092 // Update the logical volume reference 00093 00094 inline G4AssemblyVolume* GetAssembly() const; 00095 // Retrieve the assembly volume reference 00096 00097 inline void SetAssembly( G4AssemblyVolume* pAssembly ); 00098 // Update the assembly volume reference 00099 00100 inline G4ThreeVector GetTranslation() const; 00101 // Retrieve the logical volume translation 00102 00103 inline void SetTranslation( G4ThreeVector& pVolume ); 00104 // Update the logical volume translation 00105 00106 inline G4RotationMatrix* GetRotation() const; 00107 // Retrieve the logical volume rotation 00108 00109 inline void SetRotation( G4RotationMatrix* pVolume ); 00110 // Update the logical volume rotation 00111 00112 inline G4bool IsReflection() const; 00113 // Return true if the logical or assembly volume has reflection 00114 00115 private: 00116 00117 G4LogicalVolume* fVolume; 00118 // A logical volume 00119 00120 G4ThreeVector fTranslation; 00121 // A logical volume translation 00122 00123 G4RotationMatrix* fRotation; 00124 // A logical volume rotation 00125 00126 private: 00127 00128 // Member data for handling assemblies of assemblies and reflections 00129 00130 G4AssemblyVolume* fAssembly; 00131 // An assembly volume 00132 00133 G4bool fIsReflection; 00134 // True if the logical or assembly volume has reflection 00135 }; 00136 00137 #include "G4AssemblyTriplet.icc" 00138 00139 #endif // G4_ASSEMBLYTRIPLET_H