202 lines
5.1 KiB
Plaintext
202 lines
5.1 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * License and Disclaimer *
|
|
// * *
|
|
// * The Geant4 software is copyright of the Copyright Holders of *
|
|
// * the Geant4 Collaboration. It is provided under the terms and *
|
|
// * conditions of the Geant4 Software License, included in the file *
|
|
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
|
// * include a list of copyright holders. *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. Please see the license in the file LICENSE and URL above *
|
|
// * for the full disclaimer and the limitation of liability. *
|
|
// * *
|
|
// * This code implementation is the result of the scientific and *
|
|
// * technical work of the GEANT4 collaboration. *
|
|
// * By using, copying, modifying or distributing the software (or *
|
|
// * any work based on the software) you agree to acknowledge its *
|
|
// * use in resulting scientific publications, and indicate your *
|
|
// * acceptance of all terms of the Geant4 Software license. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id: G4BREPSolid.icc,v 1.9 2006/10/20 14:23:19 gcosmo Exp $
|
|
// GEANT4 tag $Name: geant4-09-01 $
|
|
//
|
|
// --------------------------------------------------------------------
|
|
// GEANT 4 inline definitions file
|
|
//
|
|
// G4BREPSolid.icc
|
|
//
|
|
// Implementation of inline methods of G4BREPSolid
|
|
// --------------------------------------------------------------------
|
|
|
|
inline G4double G4BREPSolid::IntersectionDistance() const
|
|
{
|
|
return intersectionDistance;
|
|
}
|
|
|
|
inline void G4BREPSolid::IntersectionDistance(G4double d) const
|
|
{
|
|
((G4BREPSolid*)this)->intersectionDistance=d;
|
|
}
|
|
|
|
inline G4Surface* G4BREPSolid::GetSurface(G4int nr) const
|
|
{
|
|
return SurfaceVec[nr];
|
|
}
|
|
|
|
inline void G4BREPSolid::Active(G4int x) const
|
|
{
|
|
((G4BREPSolid*)this)->active=x;
|
|
}
|
|
|
|
inline G4int G4BREPSolid::Active() const
|
|
{
|
|
return active;
|
|
}
|
|
|
|
inline G4double G4BREPSolid::GetShortestDistance() const
|
|
{
|
|
return ShortestDistance;
|
|
}
|
|
|
|
inline G4int G4BREPSolid::GetId() const
|
|
{
|
|
return Id;
|
|
}
|
|
|
|
inline void G4BREPSolid::SetId(G4int n)
|
|
{
|
|
Id = n;
|
|
}
|
|
|
|
inline const G4String& G4BREPSolid::GetName() const
|
|
{
|
|
return solidname;
|
|
}
|
|
|
|
inline void G4BREPSolid::SetName(const G4String& name)
|
|
{
|
|
solidname = name;
|
|
}
|
|
|
|
inline G4int G4BREPSolid::GetNumberOfSolids() const
|
|
{
|
|
return NumberOfSolids;
|
|
}
|
|
|
|
inline G4int G4BREPSolid::GetNumberOfFaces() const
|
|
{
|
|
return nb_of_surfaces;
|
|
}
|
|
|
|
inline const G4Axis2Placement3D* G4BREPSolid::GetPlace() const
|
|
{
|
|
return place;
|
|
}
|
|
|
|
inline const G4BoundingBox3D* G4BREPSolid::GetBBox() const
|
|
{
|
|
return bbox;
|
|
}
|
|
|
|
inline G4int G4BREPSolid::StartInside() const
|
|
{
|
|
return startInside;
|
|
}
|
|
|
|
inline void G4BREPSolid::StartInside(G4int si) const
|
|
{
|
|
((G4BREPSolid*)this)->startInside=si;
|
|
}
|
|
|
|
inline void G4BREPSolid::QuickSort( register G4Surface** SrfVec,
|
|
register G4int left,
|
|
register G4int right) const
|
|
{
|
|
register G4int i=left;
|
|
register G4int j=right;
|
|
register G4Surface* elem1;
|
|
register G4Surface* elem2 = SrfVec[(left+right)/2];
|
|
register G4double tmpdistance;
|
|
do
|
|
{
|
|
tmpdistance = elem2->GetDistance();
|
|
while ( SrfVec[i]->GetDistance() < tmpdistance && i < right ) i++;
|
|
while (tmpdistance < SrfVec[j]->GetDistance() && j > left ) j--;
|
|
if(i<=j)
|
|
{
|
|
elem1 = SrfVec[i];
|
|
SrfVec[i] = SrfVec[j];
|
|
SrfVec[j] = elem1;
|
|
i++;j--;
|
|
}
|
|
} while (i<=j);
|
|
|
|
if( left < j ) QuickSort(SrfVec,left, j );
|
|
if( i < right ) QuickSort(SrfVec,i, right);
|
|
}
|
|
|
|
inline G4int G4BREPSolid::GetCubVolStatistics() const
|
|
{
|
|
return fStatistics;
|
|
}
|
|
|
|
inline G4double G4BREPSolid::GetCubVolEpsilon() const
|
|
{
|
|
return fCubVolEpsilon;
|
|
}
|
|
|
|
inline void G4BREPSolid::SetCubVolStatistics(G4int st)
|
|
{
|
|
fCubicVolume=0.;
|
|
fStatistics=st;
|
|
}
|
|
|
|
inline void G4BREPSolid::SetCubVolEpsilon(G4double ep)
|
|
{
|
|
fCubicVolume=0.;
|
|
fCubVolEpsilon=ep;
|
|
}
|
|
|
|
inline G4int G4BREPSolid::GetAreaStatistics() const
|
|
{
|
|
return fStatistics;
|
|
}
|
|
|
|
inline G4double G4BREPSolid::GetAreaAccuracy() const
|
|
{
|
|
return fAreaAccuracy;
|
|
}
|
|
|
|
inline void G4BREPSolid::SetAreaStatistics(G4int st)
|
|
{
|
|
fSurfaceArea=0.;
|
|
fStatistics=st;
|
|
}
|
|
|
|
inline void G4BREPSolid::SetAreaAccuracy(G4double ep)
|
|
{
|
|
fSurfaceArea=0.;
|
|
fAreaAccuracy=ep;
|
|
}
|
|
|
|
inline G4double G4BREPSolid::GetCubicVolume()
|
|
{
|
|
if(fCubicVolume != 0.) {;}
|
|
else { fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon); }
|
|
return fCubicVolume;
|
|
}
|
|
|
|
inline G4double G4BREPSolid::GetSurfaceArea()
|
|
{
|
|
if(fSurfaceArea != 0.) {;}
|
|
else { fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy); }
|
|
return fSurfaceArea;
|
|
}
|