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 nnn.
transform(rotation); nnn += translation;
117 nnx.
transform(rotation); nnx += translation;
118 nxn.
transform(rotation); nxn += translation;
119 nxx.
transform(rotation); nxx += translation;
120 xnn.
transform(rotation); xnn += translation;
121 xnx.
transform(rotation); xnx += translation;
122 xxn.
transform(rotation); xxn += translation;
123 xxx.
transform(rotation); xxx += translation;
131 for (
const auto& corner: {nnn,nnx,nxn,nxx,xnn,xnx,xxn,xxx}) {
132 if (fXmin > corner.getX()) fXmin = corner.getX();
133 if (fYmin > corner.getY()) fYmin = corner.getY();
134 if (fZmin > corner.getZ()) fZmin = corner.getZ();
135 if (fXmax < corner.getX()) fXmax = corner.getX();
136 if (fYmax < corner.getY()) fYmax = corner.getY();
137 if (fZmax < corner.getZ()) fZmax = corner.getZ();
HepGeom::Point3D< G4double > G4Point3D
std::ostream & operator<<(std::ostream &os, const G4VisExtent &e)
Hep3Vector & transform(const HepRotation &)
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.)