G4NormalNavigation.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 // G4NormalNavigation Inline Implementation
00031 //
00032 // --------------------------------------------------------------------
00033 
00034 // ********************************************************************
00035 // LevelLocate
00036 // ********************************************************************
00037 //
00038 inline
00039 G4bool
00040 G4NormalNavigation::LevelLocate( G4NavigationHistory& history,
00041                            const G4VPhysicalVolume* blockedVol,
00042                            const G4int,
00043                            const G4ThreeVector& globalPoint,
00044                            const G4ThreeVector* globalDirection,
00045                            const G4bool  pLocatedOnEdge, 
00046                                  G4ThreeVector &localPoint )
00047 {
00048   G4VPhysicalVolume *targetPhysical, *samplePhysical;
00049   G4LogicalVolume *targetLogical;
00050   G4VSolid *sampleSolid;
00051   G4ThreeVector samplePoint;
00052   G4int targetNoDaughters;
00053   
00054   targetPhysical = history.GetTopVolume();
00055   targetLogical = targetPhysical->GetLogicalVolume();
00056   targetNoDaughters = targetLogical->GetNoDaughters();
00057   
00058   G4bool found = false;
00059 
00060   if (targetNoDaughters!=0)
00061   {
00062     //
00063     // Search daughters in volume
00064     //
00065     for ( register int sampleNo=targetNoDaughters-1; sampleNo>=0; sampleNo-- )
00066     {
00067       samplePhysical = targetLogical->GetDaughter(sampleNo);
00068       if ( samplePhysical!=blockedVol )
00069       {
00070         // Setup history
00071         //
00072         history.NewLevel(samplePhysical, kNormal, samplePhysical->GetCopyNo());
00073         sampleSolid = samplePhysical->GetLogicalVolume()->GetSolid();
00074         samplePoint = history.GetTopTransform().TransformPoint(globalPoint);
00075         if( G4AuxiliaryNavServices::
00076             CheckPointOnSurface(sampleSolid, samplePoint, globalDirection, 
00077                                 history.GetTopTransform(), pLocatedOnEdge) )
00078         {
00079           // Enter this daughter
00080           //
00081           localPoint = samplePoint;
00082           found = true;
00083           break;
00084         }
00085         else
00086         {
00087           history.BackLevel();
00088         }
00089       }
00090     }
00091   }
00092   return found;
00093 }
00094 
00095 // ********************************************************************
00096 // GetVerboseLevel
00097 // ********************************************************************
00098 //
00099 inline
00100 G4int G4NormalNavigation::GetVerboseLevel() const
00101 {
00102   return fLogger->GetVerboseLevel();
00103 }
00104 
00105 // ********************************************************************
00106 // SetVerboseLevel
00107 // ********************************************************************
00108 //
00109 inline
00110 void G4NormalNavigation::SetVerboseLevel(G4int level)
00111 {
00112   fLogger->SetVerboseLevel(level);
00113 }
00114 
00115 // ********************************************************************
00116 // CheckMode
00117 // ********************************************************************
00118 //
00119 inline
00120 void G4NormalNavigation::CheckMode(G4bool mode)
00121 {
00122   fCheck = mode;
00123 }

Generated on Mon May 27 17:49:06 2013 for Geant4 by  doxygen 1.4.7