40 fXmin(xmin), fXmax(xmax), fYmin(ymin), fYmax(ymax), fZmin(zmin), fZmax(zmax),
41 fRadiusCached(false), fCentreCached(false), fRadius(0.)
45 fRadiusCached(true), fCentreCached(true),
46 fRadius(radius), fCentre(centre)
49 G4double halfSide (radius / std::sqrt (3.));
50 fXmin = centre.
x () - halfSide;
51 fXmax = centre.
x () + halfSide;
52 fYmin = centre.
y () - halfSide;
53 fYmax = centre.
y () + halfSide;
54 fZmin = centre.
z () - halfSide;
55 fZmax = centre.
z () + halfSide;
67 fCentre =
G4Point3D (((fXmin + fXmax) / 2.),
68 ((fYmin + fYmax) / 2.),
69 ((fZmin + fZmax) / 2.));
77 fRadius = std::sqrt (((fXmax - fXmin) * (fXmax - fXmin)) +
78 ((fYmax - fYmin) * (fYmax - fYmin)) +
79 ((fZmax - fZmin) * (fZmax - fZmin))) / 2.;
86 os <<
"G4VisExtent (bounding box):";
87 os <<
"\n X limits: " << e.fXmin <<
' ' << e.fXmax;
88 os <<
"\n Y limits: " << e.fYmin <<
' ' << e.fYmax;
89 os <<
"\n Z limits: " << e.fZmin <<
' ' << e.fZmax;
94 return ((fXmin != e.fXmin) ||
116 auto apply_transform = [&rotation, &translation](
G4ThreeVector& v) {
117 v.transform(rotation);
121 apply_transform(nnn);
122 apply_transform(nnx);
123 apply_transform(nxn);
124 apply_transform(nxx);
125 apply_transform(xnn);
126 apply_transform(xnx);
127 apply_transform(xxn);
128 apply_transform(xxx);
136 for (
const auto& corner: {nnn,nnx,nxn,nxx,xnn,xnx,xxn,xxx}) {
137 if (fXmin > corner.getX()) fXmin = corner.getX();
138 if (fYmin > corner.getY()) fYmin = corner.getY();
139 if (fZmin > corner.getZ()) fZmin = corner.getZ();
140 if (fXmax < corner.getX()) fXmax = corner.getX();
141 if (fYmax < corner.getY()) fYmax = corner.getY();
142 if (fZmax < corner.getZ()) fZmax = corner.getZ();
HepGeom::Point3D< G4double > G4Point3D
CLHEP::Hep3Vector G4ThreeVector
std::ostream & operator<<(std::ostream &os, const G4VisExtent &e)
static const G4VisExtent & GetNullExtent()
G4bool operator!=(const G4VisExtent &e) const
G4double GetExtentRadius() const
G4VisExtent & Transform(const G4Transform3D &)
const G4Point3D & GetExtentCentre() const
G4VisExtent(G4double xmin=0., G4double xmax=0., G4double ymin=0., G4double ymax=0., G4double zmin=0., G4double zmax=0.)