180{
183
184
186
187
189#ifdef G4BBOX_EXTENT
190 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
191#endif
192 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
193 {
194 return exist = (pMin < pMax) ? true : false;
195 }
196
197
198
199 static const G4int NTHETA = 8;
200 static const G4int NPHI = 16;
201 static const G4double sinHalfTheta = std::sin(halfpi/NTHETA);
202 static const G4double cosHalfTheta = std::cos(halfpi/NTHETA);
203 static const G4double sinHalfPhi = std::sin(pi/NPHI);
204 static const G4double cosHalfPhi = std::cos(pi/NPHI);
205 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
206 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
207 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
208 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
209
211 G4double rtheta = radius/cosHalfTheta;
213
214
218 for (
G4int k=0; k<NPHI; ++k)
219 {
220 xy[k].
set(cosCurPhi,sinCurPhi);
222 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
223 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
224 }
225
226
228 for (
G4int i=0; i<NTHETA; ++i) { circles[i].resize(NPHI); }
229
230 G4double sinCurTheta = sinHalfTheta;
231 G4double cosCurTheta = cosHalfTheta;
232 for (
G4int i=0; i<NTHETA; ++i)
233 {
236 for (
G4int k=0; k<NPHI; ++k)
237 {
238 circles[i][k].set(rho*xy[k].x(),rho*xy[k].y(),z);
239 }
241 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
242 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
243 }
244
245
246 std::vector<const G4ThreeVectorList *> polygons;
247 polygons.resize(NTHETA);
248 for (
G4int i=0; i<NTHETA; ++i) { polygons[i] = &circles[i]; }
249
251 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
252 return exist;
253}
std::vector< G4ThreeVector > G4ThreeVectorList
void set(double x, double y)
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const