G4VoxelLimits.icc

Go to the documentation of this file.
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 // G4VoxelLimits Inline implementation
00031 //
00032 // --------------------------------------------------------------------
00033 
00034 inline
00035 G4double G4VoxelLimits::GetMaxXExtent() const
00036 {
00037   return fxAxisMax;
00038 }
00039 
00040 inline
00041 G4double G4VoxelLimits::GetMaxYExtent() const
00042 {
00043   return fyAxisMax;
00044 }
00045 
00046 inline
00047 G4double G4VoxelLimits::GetMaxZExtent() const
00048 {
00049   return fzAxisMax;
00050 }
00051 
00052 inline
00053 G4double G4VoxelLimits::GetMinXExtent() const
00054 {
00055   return fxAxisMin;
00056 }
00057 
00058 inline
00059 G4double G4VoxelLimits::GetMinYExtent() const
00060 {
00061   return fyAxisMin;
00062 }
00063 
00064 inline
00065 G4double G4VoxelLimits::GetMinZExtent() const
00066 {
00067   return fzAxisMin;
00068 }
00069 
00070 inline
00071 G4double G4VoxelLimits::GetMaxExtent(const EAxis pAxis) const
00072 {
00073   if (pAxis==kXAxis)
00074   {
00075     return GetMaxXExtent();
00076   }
00077   else if (pAxis==kYAxis)
00078   {
00079     return GetMaxYExtent();
00080   }
00081   else 
00082   {
00083     assert(pAxis==kZAxis);
00084     return GetMaxZExtent();
00085   }
00086 }
00087 
00088 inline
00089 G4double G4VoxelLimits::GetMinExtent(const EAxis pAxis) const
00090 {
00091   if (pAxis==kXAxis)
00092   {
00093     return GetMinXExtent();
00094   }
00095   else if (pAxis==kYAxis)
00096   {
00097     return GetMinYExtent();
00098   }
00099   else 
00100   {
00101     assert(pAxis==kZAxis);
00102     return GetMinZExtent();
00103   }
00104 }
00105 
00106 inline
00107 G4bool G4VoxelLimits::IsXLimited() const
00108 {
00109   return (fxAxisMin==-kInfinity&&fxAxisMax==kInfinity) ? false : true;
00110 }
00111 
00112 inline
00113 G4bool G4VoxelLimits::IsYLimited() const
00114 {
00115   return (fyAxisMin==-kInfinity&&fyAxisMax==kInfinity) ? false : true;
00116 }
00117 
00118 inline
00119 G4bool G4VoxelLimits::IsZLimited() const
00120 {
00121   return (fzAxisMin==-kInfinity&&fzAxisMax==kInfinity) ? false : true;
00122 }
00123 
00124 inline
00125 G4bool G4VoxelLimits::IsLimited() const
00126 {
00127   return (IsXLimited()||IsYLimited()||IsZLimited());
00128 }
00129 
00130 inline
00131 G4bool G4VoxelLimits::IsLimited(const EAxis pAxis) const
00132 {
00133   if (pAxis==kXAxis)
00134   {
00135     return IsXLimited();
00136   }
00137   else if (pAxis==kYAxis)
00138   {
00139     return IsYLimited();
00140   }
00141   else 
00142   {
00143     assert(pAxis==kZAxis);
00144     return IsZLimited();
00145   }
00146 }
00147 
00148 inline
00149 G4bool G4VoxelLimits::Inside(const G4ThreeVector& pVec) const
00150 {
00151   return ((GetMinXExtent()<=pVec.x()) &&
00152           (GetMaxXExtent()>=pVec.x()) &&
00153           (GetMinYExtent()<=pVec.y()) &&
00154           (GetMaxYExtent()>=pVec.y()) &&
00155           (GetMinZExtent()<=pVec.z()) &&
00156           (GetMaxZExtent()>=pVec.z()) ) ? true : false;
00157 }

Generated on Mon May 27 17:50:18 2013 for Geant4 by  doxygen 1.4.7