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