42 #ifndef G4SurfaceVoxelizer_HH
43 #define G4SurfaceVoxelizer_HH
77 void Voxelize(std::vector<G4VFacet *> &facets);
91 std::vector<G4int> &list,
97 std::vector<G4int> &list,
100 std::vector<G4int> &list,
103 inline const std::vector<G4VoxelBox> &
GetBoxes()
const;
111 std::vector<G4int> &curVoxel)
const;
113 inline void GetVoxel(std::vector<G4int> &curVoxel,
122 const std::vector<G4int> &curVoxel)
const;
146 inline long long CountVoxels(std::vector<G4double> boundaries[])
const;
149 std::vector<G4int> *&candidates,
150 std::vector<G4int> &space)
const;
151 inline const std::vector<G4int> &
169 class G4VoxelComparator
173 std::vector<G4VoxelInfo> &fVoxels;
175 G4VoxelComparator(std::vector<G4VoxelInfo> &voxels) : fVoxels(voxels) {}
181 G4int right = rv.count + fVoxels[rv.next].count;
182 return (left == right) ? l < r : left <
right;
194 void CreateSortedBoundary(std::vector<G4double> &boundaryRaw,
G4int axis);
196 void BuildBoundaries();
198 void BuildReduceVoxels(std::vector<G4double> fBoundaries[],
200 void BuildReduceVoxels2(std::vector<G4double> fBoundaries[],
203 void BuildVoxelLimits(std::vector<G4VFacet *> &facets);
207 void BuildBitmasks(std::vector<G4double> fBoundaries[],
210 void BuildBoundingBox();
214 void CreateMiniVoxels(std::vector<G4double> fBoundaries[],
216 static void FindComponentsFastest(
unsigned int mask,
217 std::vector<G4int> &list,
G4int i);
221 std::vector<G4VoxelBox> fVoxelBoxes;
222 std::vector<std::vector<G4int> > fVoxelBoxesCandidates;
223 mutable std::map<G4int, std::vector<G4int> > fCandidates;
225 const std::vector<G4int> fNoCandidates;
227 long long fCountOfVoxels;
231 std::vector<G4VoxelBox> fBoxes;
234 std::vector<G4double> fBoundaries[3];
237 std::vector<G4int> fCandidatesCounts[3];
239 G4int fTotalCandidates;
258 #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)
friend class G4VoxelCandidatesIterator
G4int GetCandidates(std::vector< G4int > &curVoxel, std::vector< G4int > *&candidates, std::vector< G4int > &space) 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
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)
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
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 XML_Char int const XML_Char * value
const std::vector< G4double > & GetBoundary(G4int index) 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()