Geant4  10.07
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4Voxelizer Class Reference

Classes

class  G4VoxelComparator
 

Public Member Functions

void Voxelize (std::vector< G4VSolid * > &solids, std::vector< G4Transform3D > &transforms)
 
void Voxelize (std::vector< G4VFacet * > &facets)
 
void DisplayVoxelLimits () const
 
void DisplayBoundaries ()
 
void DisplayListNodes () const
 
 G4Voxelizer ()
 
 ~G4Voxelizer ()
 
void GetCandidatesVoxel (std::vector< G4int > &voxels)
 
G4int GetCandidatesVoxelArray (const G4ThreeVector &point, std::vector< G4int > &list, G4SurfBits *crossed=nullptr) const
 
G4int GetCandidatesVoxelArray (const std::vector< G4int > &voxels, const G4SurfBits bitmasks[], std::vector< G4int > &list, G4SurfBits *crossed=nullptr) const
 
G4int GetCandidatesVoxelArray (const std::vector< G4int > &voxels, std::vector< G4int > &list, G4SurfBits *crossed=nullptr) const
 
const std::vector< G4VoxelBox > & GetBoxes () const
 
const std::vector< G4double > & GetBoundary (G4int index) const
 
G4bool UpdateCurrentVoxel (const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const
 
void GetVoxel (std::vector< G4int > &curVoxel, const G4ThreeVector &point) const
 
G4int GetBitsPerSlice () const
 
G4bool Contains (const G4ThreeVector &point) const
 
G4double DistanceToNext (const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const
 
G4double DistanceToFirst (const G4ThreeVector &point, const G4ThreeVector &direction) const
 
G4double DistanceToBoundingBox (const G4ThreeVector &point) const
 
G4int GetVoxelsIndex (G4int x, G4int y, G4int z) const
 
G4int GetVoxelsIndex (const std::vector< G4int > &voxels) const
 
G4bool GetPointVoxel (const G4ThreeVector &p, std::vector< G4int > &voxels) const
 
G4int GetPointIndex (const G4ThreeVector &p) const
 
const G4SurfBitsEmpty () const
 
G4bool IsEmpty (G4int index) const
 
void SetMaxVoxels (G4int max)
 
void SetMaxVoxels (const G4ThreeVector &reductionRatio)
 
G4int GetMaxVoxels (G4ThreeVector &ratioOfReduction)
 
G4int AllocatedMemory ()
 
long long GetCountOfVoxels () const
 
long long CountVoxels (std::vector< G4double > boundaries[]) const
 
const std::vector< G4int > & GetCandidates (std::vector< G4int > &curVoxel) const
 
G4int GetVoxelBoxesSize () const
 
const G4VoxelBoxGetVoxelBox (G4int i) const
 
const std::vector< G4int > & GetVoxelBoxCandidates (G4int i) const
 
G4int GetTotalCandidates () const
 

Static Public Member Functions

template<typename T >
static G4int BinarySearch (const std::vector< T > &vec, T value)
 
static G4double MinDistanceToBox (const G4ThreeVector &aPoint, const G4ThreeVector &f)
 
static void SetDefaultVoxelsCount (G4int count)
 
static G4int GetDefaultVoxelsCount ()
 

Private Member Functions

void BuildEmpty ()
 
G4String GetCandidatesAsString (const G4SurfBits &bits) const
 
void CreateSortedBoundary (std::vector< G4double > &boundaryRaw, G4int axis)
 
void BuildBoundaries ()
 
void BuildReduceVoxels (std::vector< G4double > fBoundaries[], G4ThreeVector reductionRatio)
 
void BuildReduceVoxels2 (std::vector< G4double > fBoundaries[], G4ThreeVector reductionRatio)
 
void BuildVoxelLimits (std::vector< G4VSolid * > &solids, std::vector< G4Transform3D > &transforms)
 
void BuildVoxelLimits (std::vector< G4VFacet * > &facets)
 
void DisplayBoundaries (std::vector< G4double > &fBoundaries)
 
void BuildBitmasks (std::vector< G4double > fBoundaries[], G4SurfBits bitmasks[], G4bool countsOnly=false)
 
void BuildBoundingBox ()
 
void BuildBoundingBox (G4ThreeVector &amin, G4ThreeVector &amax, G4double tolerance=0.0)
 
void SetReductionRatio (G4int maxVoxels, G4ThreeVector &reductionRatio)
 
void CreateMiniVoxels (std::vector< G4double > fBoundaries[], G4SurfBits bitmasks[])
 
G4ThreeVector GetGlobalPoint (const G4Transform3D &trans, const G4ThreeVector &lpoint) const
 
void TransformLimits (G4ThreeVector &min, G4ThreeVector &max, const G4Transform3D &transformation) const
 

Static Private Member Functions

static void FindComponentsFastest (unsigned int mask, std::vector< G4int > &list, G4int i)
 

Private Attributes

std::vector< G4VoxelBoxfVoxelBoxes
 
std::vector< std::vector< G4int > > fVoxelBoxesCandidates
 
std::map< G4int, std::vector
< G4int > > 
fCandidates
 
const std::vector< G4intfNoCandidates
 
long long fCountOfVoxels
 
G4int fNPerSlice
 
std::vector< G4VoxelBoxfBoxes
 
std::vector< G4doublefBoundaries [3]
 
std::vector< G4intfCandidatesCounts [3]
 
G4int fTotalCandidates
 
G4SurfBits fBitmasks [3]
 
G4ThreeVector fBoundingBoxCenter
 
G4Box fBoundingBox
 
G4ThreeVector fBoundingBoxSize
 
G4ThreeVector fReductionRatio
 
G4int fMaxVoxels
 
G4double fTolerance
 
G4SurfBits fEmpty
 

Static Private Attributes

static G4ThreadLocal G4int fDefaultVoxelsCount
 

Constructor & Destructor Documentation

Member Function Documentation

static G4int BinarySearch ( const std::vector< T > &  vec,
value 
)
static
void Voxelize ( std::vector< G4VSolid * > &  solids,
std::vector< G4Transform3D > &  transforms 
)
void Voxelize ( std::vector< G4VFacet * > &  facets)
void DisplayVoxelLimits ( ) const
void DisplayBoundaries ( )
void DisplayListNodes ( ) const
void GetCandidatesVoxel ( std::vector< G4int > &  voxels)
G4int GetCandidatesVoxelArray ( const G4ThreeVector point,
std::vector< G4int > &  list,
G4SurfBits crossed = nullptr 
) const
G4int GetCandidatesVoxelArray ( const std::vector< G4int > &  voxels,
const G4SurfBits  bitmasks[],
std::vector< G4int > &  list,
G4SurfBits crossed = nullptr 
) const
G4int GetCandidatesVoxelArray ( const std::vector< G4int > &  voxels,
std::vector< G4int > &  list,
G4SurfBits crossed = nullptr 
) const
const std::vector<G4VoxelBox>& GetBoxes ( ) const
const std::vector<G4double>& GetBoundary ( G4int  index) const
G4bool UpdateCurrentVoxel ( const G4ThreeVector point,
const G4ThreeVector direction,
std::vector< G4int > &  curVoxel 
) const
void GetVoxel ( std::vector< G4int > &  curVoxel,
const G4ThreeVector point 
) const
G4int GetBitsPerSlice ( ) const
G4bool Contains ( const G4ThreeVector point) const
G4double DistanceToNext ( const G4ThreeVector point,
const G4ThreeVector direction,
std::vector< G4int > &  curVoxel 
) const
G4double DistanceToFirst ( const G4ThreeVector point,
const G4ThreeVector direction 
) const
G4double DistanceToBoundingBox ( const G4ThreeVector point) const
G4int GetVoxelsIndex ( G4int  x,
G4int  y,
G4int  z 
) const
G4int GetVoxelsIndex ( const std::vector< G4int > &  voxels) const
G4bool GetPointVoxel ( const G4ThreeVector p,
std::vector< G4int > &  voxels 
) const
G4int GetPointIndex ( const G4ThreeVector p) const
const G4SurfBits& Empty ( ) const
G4bool IsEmpty ( G4int  index) const
void SetMaxVoxels ( G4int  max)
void SetMaxVoxels ( const G4ThreeVector reductionRatio)
G4int GetMaxVoxels ( G4ThreeVector ratioOfReduction)
G4int AllocatedMemory ( )
long long GetCountOfVoxels ( ) const
long long CountVoxels ( std::vector< G4double boundaries[]) const
const std::vector<G4int>& GetCandidates ( std::vector< G4int > &  curVoxel) const
G4int GetVoxelBoxesSize ( ) const
const G4VoxelBox& GetVoxelBox ( G4int  i) const
const std::vector<G4int>& GetVoxelBoxCandidates ( G4int  i) const
G4int GetTotalCandidates ( ) const
static G4double MinDistanceToBox ( const G4ThreeVector aPoint,
const G4ThreeVector f 
)
static
static void SetDefaultVoxelsCount ( G4int  count)
static
static G4int GetDefaultVoxelsCount ( )
static
void BuildEmpty ( )
private
G4String GetCandidatesAsString ( const G4SurfBits bits) const
private
void CreateSortedBoundary ( std::vector< G4double > &  boundaryRaw,
G4int  axis 
)
private
void BuildBoundaries ( )
private
void BuildReduceVoxels ( std::vector< G4double fBoundaries[],
G4ThreeVector  reductionRatio 
)
private
void BuildReduceVoxels2 ( std::vector< G4double fBoundaries[],
G4ThreeVector  reductionRatio 
)
private
void BuildVoxelLimits ( std::vector< G4VSolid * > &  solids,
std::vector< G4Transform3D > &  transforms 
)
private
void BuildVoxelLimits ( std::vector< G4VFacet * > &  facets)
private
void DisplayBoundaries ( std::vector< G4double > &  fBoundaries)
private
void BuildBitmasks ( std::vector< G4double fBoundaries[],
G4SurfBits  bitmasks[],
G4bool  countsOnly = false 
)
private
void BuildBoundingBox ( )
private
void BuildBoundingBox ( G4ThreeVector amin,
G4ThreeVector amax,
G4double  tolerance = 0.0 
)
private
void SetReductionRatio ( G4int  maxVoxels,
G4ThreeVector reductionRatio 
)
private
void CreateMiniVoxels ( std::vector< G4double fBoundaries[],
G4SurfBits  bitmasks[] 
)
private
static void FindComponentsFastest ( unsigned int  mask,
std::vector< G4int > &  list,
G4int  i 
)
staticprivate
G4ThreeVector GetGlobalPoint ( const G4Transform3D trans,
const G4ThreeVector lpoint 
) const
private
void TransformLimits ( G4ThreeVector min,
G4ThreeVector max,
const G4Transform3D transformation 
) const
private

Member Data Documentation

G4ThreadLocal G4int fDefaultVoxelsCount
staticprivate
std::vector<G4VoxelBox> fVoxelBoxes
private
std::vector<std::vector<G4int> > fVoxelBoxesCandidates
private
std::map<G4int, std::vector<G4int> > fCandidates
mutableprivate
const std::vector<G4int> fNoCandidates
private
long long fCountOfVoxels
private
G4int fNPerSlice
private
std::vector<G4VoxelBox> fBoxes
private
std::vector<G4double> fBoundaries[3]
private
std::vector<G4int> fCandidatesCounts[3]
private
G4int fTotalCandidates
private
G4SurfBits fBitmasks[3]
private
G4ThreeVector fBoundingBoxCenter
private
G4Box fBoundingBox
private
G4ThreeVector fBoundingBoxSize
private
G4ThreeVector fReductionRatio
private
G4int fMaxVoxels
private
G4double fTolerance
private
G4SurfBits fEmpty
private