42 #ifndef G4SurfaceVoxelizer_HH
43 #define G4SurfaceVoxelizer_HH
73 void Voxelize(std::vector<G4VFacet *> &facets);
87 std::vector<G4int> &list,
93 std::vector<G4int> &list,
96 std::vector<G4int> &list,
99 inline const std::vector<G4VoxelBox> &
GetBoxes()
const;
107 std::vector<G4int> &curVoxel)
const;
109 inline void GetVoxel(std::vector<G4int> &curVoxel,
118 const std::vector<G4int> &curVoxel)
const;
142 inline long long CountVoxels(std::vector<G4double> boundaries[])
const;
144 inline const std::vector<G4int> &
164 class G4VoxelComparator
168 std::vector<G4VoxelInfo> &fVoxels;
170 G4VoxelComparator(std::vector<G4VoxelInfo> &voxels) : fVoxels(voxels) {}
176 G4int right = rv.count + fVoxels[rv.next].count;
177 return (left == right) ? l < r : left < right;
189 void CreateSortedBoundary(std::vector<G4double> &boundaryRaw,
G4int axis);
191 void BuildBoundaries();
193 void BuildReduceVoxels(std::vector<G4double> fBoundaries[],
195 void BuildReduceVoxels2(std::vector<G4double> fBoundaries[],
198 void BuildVoxelLimits(std::vector<G4VFacet *> &facets);
202 void BuildBitmasks(std::vector<G4double> fBoundaries[],
205 void BuildBoundingBox();
209 void CreateMiniVoxels(std::vector<G4double> fBoundaries[],
211 static void FindComponentsFastest(
unsigned int mask,
212 std::vector<G4int> &list,
G4int i);
216 std::vector<G4VoxelBox> fVoxelBoxes;
217 std::vector<std::vector<G4int> > fVoxelBoxesCandidates;
218 mutable std::map<G4int, std::vector<G4int> > fCandidates;
220 const std::vector<G4int> fNoCandidates;
222 long long fCountOfVoxels;
226 std::vector<G4VoxelBox> fBoxes;
229 std::vector<G4double> fBoundaries[3];
232 std::vector<G4int> fCandidatesCounts[3];
234 G4int fTotalCandidates;
253 #include "G4SurfaceVoxelizer.icc"
G4bool Contains(const G4ThreeVector &point) const
void DisplayListNodes() const
G4int GetCandidatesVoxelArray(const G4ThreeVector &point, std::vector< G4int > &list, G4SurfBits *crossed=0) const
void Voxelize(std::vector< G4VFacet * > &facets)
G4double DistanceToFirst(const G4ThreeVector &point, const G4ThreeVector &direction) const
G4double DistanceToBoundingBox(const G4ThreeVector &point) const
G4int GetVoxelsIndex(G4int x, G4int y, G4int z) const
void DisplayVoxelLimits()
static G4double MinDistanceToBox(const G4ThreeVector &aPoint, const G4ThreeVector &f)
G4bool UpdateCurrentVoxel(const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const
G4int GetBitsPerSlice() const
G4int GetPointIndex(const G4ThreeVector &p) const
G4bool IsEmpty(G4int index) const
static G4int BinarySearch(const std::vector< T > &vec, T value)
const XML_Char int const XML_Char * value
void GetVoxel(std::vector< G4int > &curVoxel, const G4ThreeVector &point) const
G4double DistanceToNext(const G4ThreeVector &point, const G4ThreeVector &direction, const std::vector< G4int > &curVoxel) const
void SetMaxVoxels(G4int max)
const std::vector< G4VoxelBox > & GetBoxes() const
const std::vector< G4int > & GetCandidates(std::vector< G4int > &curVoxel) const
static G4int SetDefaultVoxelsCount(G4int count)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void GetCandidatesVoxel(std::vector< G4int > &voxels)
long long GetCountOfVoxels() const
const std::vector< G4double > & GetBoundary(G4int index) const
G4int GetTotalCandidates() const
const G4SurfBits & Empty() const
G4int GetMaxVoxels(G4ThreeVector &ratioOfReduction)
const std::vector< G4int > & GetVoxelBoxCandidates(G4int i) const
G4int GetVoxelBoxesSize() const
long long CountVoxels(std::vector< G4double > boundaries[]) const
const G4VoxelBox & GetVoxelBox(G4int i) const
static G4int GetDefaultVoxelsCount()