42 #ifndef G4SurfaceVoxelizer_HH 43 #define G4SurfaceVoxelizer_HH 71 static inline G4int BinarySearch(
const std::vector<T> &vec, T value);
73 void Voxelize(std::vector<G4VFacet *> &facets);
75 void DisplayVoxelLimits();
76 void DisplayBoundaries();
77 void DisplayListNodes()
const;
82 void GetCandidatesVoxel(std::vector<G4int> &voxels);
87 std::vector<G4int> &list,
91 G4int GetCandidatesVoxelArray(
const std::vector<G4int> &voxels,
93 std::vector<G4int> &list,
95 G4int GetCandidatesVoxelArray(
const std::vector<G4int> &voxels,
96 std::vector<G4int> &list,
99 inline const std::vector<G4VoxelBox> &GetBoxes()
const;
103 inline const std::vector<G4double> &GetBoundary(
G4int index)
const;
107 std::vector<G4int> &curVoxel)
const;
109 inline void GetVoxel(std::vector<G4int> &curVoxel,
112 inline G4int GetBitsPerSlice ()
const;
118 const std::vector<G4int> &curVoxel)
const;
126 inline G4int GetVoxelsIndex(
const std::vector<G4int> &voxels)
const;
138 G4int AllocatedMemory();
140 inline long long GetCountOfVoxels()
const;
142 inline long long CountVoxels(std::vector<G4double> boundaries[])
const;
144 inline const std::vector<G4int> &
145 GetCandidates(std::vector<G4int> &curVoxel)
const;
147 inline G4int GetVoxelBoxesSize()
const;
151 inline const std::vector<G4int> &GetVoxelBoxCandidates(
G4int i)
const;
153 inline G4int GetTotalCandidates()
const;
158 static G4int SetDefaultVoxelsCount(
G4int count);
160 static G4int GetDefaultVoxelsCount();
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);
200 void DisplayBoundaries(std::vector<G4double> &fBoundaries);
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);
229 std::vector<G4double> fBoundaries[3];
232 std::vector<G4int> fCandidatesCounts[3];
253 #include "G4SurfaceVoxelizer.icc" G4bool operator()(const G4int &l, const G4int &r) const
G4ThreeVector fBoundingBoxSize
std::vector< G4VoxelInfo > & fVoxels
std::vector< G4VoxelBox > fVoxelBoxes
G4ThreeVector fBoundingBoxCenter
static G4ThreadLocal G4int fDefaultVoxelsCount
std::map< G4int, std::vector< G4int > > fCandidates
std::vector< std::vector< G4int > > fVoxelBoxesCandidates
std::vector< G4VoxelBox > fBoxes
G4ThreeVector fReductionRatio
G4VoxelComparator(std::vector< G4VoxelInfo > &voxels)
const std::vector< G4int > fNoCandidates