Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4QuadrangularFacet.icc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Implementation of inline methods of G4QuadrangularFacet
0027 // --------------------------------------------------------------------
0028 
0029 inline G4int G4QuadrangularFacet::GetNumberOfVertices () const
0030 {
0031   return 4;
0032 }
0033 
0034 inline G4ThreeVector G4QuadrangularFacet::GetVertex (G4int i) const
0035 {
0036   return i == 3 ? fFacet2.GetVertex(2) : fFacet1.GetVertex(i);
0037 }
0038 
0039 
0040 inline G4double G4QuadrangularFacet::GetRadius () const
0041 {
0042   return fRadius;
0043 }
0044 
0045 inline G4ThreeVector G4QuadrangularFacet::GetCircumcentre () const
0046 {
0047   return fCircumcentre;
0048 }
0049 
0050 inline void G4QuadrangularFacet::SetVertex (G4int i, const G4ThreeVector &val)
0051 {
0052   switch (i)
0053   {
0054     case 0:
0055       fFacet1.SetVertex(0, val);
0056       fFacet2.SetVertex(0, val);
0057       break;
0058     case 1:
0059       fFacet1.SetVertex(1, val);
0060       break;
0061     case 2:
0062       fFacet1.SetVertex(2, val);
0063       fFacet2.SetVertex(1, val);
0064       break;
0065     case 3:
0066       fFacet2.SetVertex(2, val);
0067       break;
0068     }
0069 }
0070 
0071 inline void G4QuadrangularFacet::SetVertices(std::vector<G4ThreeVector>* v)
0072 {
0073   fFacet1.SetVertices(v);
0074   fFacet2.SetVertices(v);
0075 }
0076 
0077 inline G4bool G4QuadrangularFacet::IsDefined () const
0078 {
0079   return fFacet1.IsDefined();
0080 }
0081 
0082 inline G4int G4QuadrangularFacet::GetVertexIndex (G4int i) const
0083 {
0084   return i == 3 ? fFacet2.GetVertexIndex(2) : fFacet1.GetVertexIndex(i);
0085 }
0086 
0087 
0088 inline void G4QuadrangularFacet::SetVertexIndex (G4int i, G4int val)
0089 {
0090   switch (i)
0091   {
0092     case 0:
0093       fFacet1.SetVertexIndex(0, val);
0094       fFacet2.SetVertexIndex(0, val);
0095       break;
0096     case 1:
0097       fFacet1.SetVertexIndex(1, val);
0098       break;
0099     case 2:
0100       fFacet1.SetVertexIndex(2, val);
0101       fFacet2.SetVertexIndex(1, val);
0102       break;
0103     case 3:
0104       fFacet2.SetVertexIndex(2, val);
0105       break;
0106   }
0107 }
0108 
0109 inline G4int G4QuadrangularFacet::AllocatedMemory()
0110 {
0111   return sizeof(*this) + fFacet1.AllocatedMemory() + fFacet2.AllocatedMemory();
0112 }