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 // GEANT 4 inline definitions file 00031 // 00032 // G4BREPSolid.icc 00033 // 00034 // Implementation of inline methods of G4BREPSolid 00035 // -------------------------------------------------------------------- 00036 00037 inline G4double G4BREPSolid::IntersectionDistance() const 00038 { 00039 return intersectionDistance; 00040 } 00041 00042 inline void G4BREPSolid::IntersectionDistance(G4double d) const 00043 { 00044 ((G4BREPSolid*)this)->intersectionDistance=d; 00045 } 00046 00047 inline G4Surface* G4BREPSolid::GetSurface(G4int nr) const 00048 { 00049 return SurfaceVec[nr]; 00050 } 00051 00052 inline void G4BREPSolid::Active(G4int x) const 00053 { 00054 ((G4BREPSolid*)this)->active=x; 00055 } 00056 00057 inline G4int G4BREPSolid::Active() const 00058 { 00059 return active; 00060 } 00061 00062 inline G4double G4BREPSolid::GetShortestDistance() const 00063 { 00064 return ShortestDistance; 00065 } 00066 00067 inline G4int G4BREPSolid::GetId() const 00068 { 00069 return Id; 00070 } 00071 00072 inline void G4BREPSolid::SetId(G4int n) 00073 { 00074 Id = n; 00075 } 00076 00077 inline const G4String& G4BREPSolid::GetName() const 00078 { 00079 return solidname; 00080 } 00081 00082 inline void G4BREPSolid::SetName(const G4String& name) 00083 { 00084 solidname = name; 00085 } 00086 00087 inline G4int G4BREPSolid::GetNumberOfSolids() const 00088 { 00089 return NumberOfSolids; 00090 } 00091 00092 inline G4int G4BREPSolid::GetNumberOfFaces() const 00093 { 00094 return nb_of_surfaces; 00095 } 00096 00097 inline const G4Axis2Placement3D* G4BREPSolid::GetPlace() const 00098 { 00099 return place; 00100 } 00101 00102 inline const G4BoundingBox3D* G4BREPSolid::GetBBox() const 00103 { 00104 return bbox; 00105 } 00106 00107 inline G4int G4BREPSolid::StartInside() const 00108 { 00109 return startInside; 00110 } 00111 00112 inline void G4BREPSolid::StartInside(G4int si) const 00113 { 00114 ((G4BREPSolid*)this)->startInside=si; 00115 } 00116 00117 inline void G4BREPSolid::QuickSort( register G4Surface** SrfVec, 00118 register G4int left, 00119 register G4int right) const 00120 { 00121 register G4int i=left; 00122 register G4int j=right; 00123 register G4Surface* elem1; 00124 register G4Surface* elem2 = SrfVec[(left+right)/2]; 00125 register G4double tmpdistance; 00126 do 00127 { 00128 tmpdistance = elem2->GetDistance(); 00129 while ( SrfVec[i]->GetDistance() < tmpdistance && i < right ) i++; 00130 while (tmpdistance < SrfVec[j]->GetDistance() && j > left ) j--; 00131 if(i<=j) 00132 { 00133 elem1 = SrfVec[i]; 00134 SrfVec[i] = SrfVec[j]; 00135 SrfVec[j] = elem1; 00136 i++;j--; 00137 } 00138 } while (i<=j); 00139 00140 if( left < j ) QuickSort(SrfVec,left, j ); 00141 if( i < right ) QuickSort(SrfVec,i, right); 00142 } 00143 00144 inline G4int G4BREPSolid::GetCubVolStatistics() const 00145 { 00146 return fStatistics; 00147 } 00148 00149 inline G4double G4BREPSolid::GetCubVolEpsilon() const 00150 { 00151 return fCubVolEpsilon; 00152 } 00153 00154 inline void G4BREPSolid::SetCubVolStatistics(G4int st) 00155 { 00156 fCubicVolume=0.; 00157 fStatistics=st; 00158 } 00159 00160 inline void G4BREPSolid::SetCubVolEpsilon(G4double ep) 00161 { 00162 fCubicVolume=0.; 00163 fCubVolEpsilon=ep; 00164 } 00165 00166 inline G4int G4BREPSolid::GetAreaStatistics() const 00167 { 00168 return fStatistics; 00169 } 00170 00171 inline G4double G4BREPSolid::GetAreaAccuracy() const 00172 { 00173 return fAreaAccuracy; 00174 } 00175 00176 inline void G4BREPSolid::SetAreaStatistics(G4int st) 00177 { 00178 fSurfaceArea=0.; 00179 fStatistics=st; 00180 } 00181 00182 inline void G4BREPSolid::SetAreaAccuracy(G4double ep) 00183 { 00184 fSurfaceArea=0.; 00185 fAreaAccuracy=ep; 00186 } 00187 00188 inline G4double G4BREPSolid::GetCubicVolume() 00189 { 00190 if(fCubicVolume != 0.) {;} 00191 else { fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon); } 00192 return fCubicVolume; 00193 } 00194 00195 inline G4double G4BREPSolid::GetSurfaceArea() 00196 { 00197 if(fSurfaceArea != 0.) {;} 00198 else { fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy); } 00199 return fSurfaceArea; 00200 }