Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BoundingExtentScene.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//
28//
29// John Allison 15th February 2019
30// An artificial scene to reuse G4VScene code to calculate a bounding extent.
31
33
34#include "G4VSolid.hh"
36
40
42
43void G4BoundingExtentScene::ProcessVolume(const G4VSolid& solid)
44{
45 G4VisExtent newExtent = solid.GetExtent ();
48 }
49 AccrueBoundingExtent (newExtent);
50
51 // Curtail descent - can assume daughters are contained within mother...
52 G4PhysicalVolumeModel* pPVM = dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
53 if (pPVM) pPVM->CurtailDescent();
54}
55
61
63{
64
65 if (fExtent == G4VisExtent::GetNullExtent()) { // First time.
66
67 fExtent = newExtent;
68
69 } else {
70
71 if (newExtent.GetXmin() < fExtent.GetXmin()) fExtent.SetXmin(newExtent.GetXmin());
72 if (newExtent.GetYmin() < fExtent.GetYmin()) fExtent.SetYmin(newExtent.GetYmin());
73 if (newExtent.GetZmin() < fExtent.GetZmin()) fExtent.SetZmin(newExtent.GetZmin());
74 if (newExtent.GetXmax() > fExtent.GetXmax()) fExtent.SetXmax(newExtent.GetXmax());
75 if (newExtent.GetYmax() > fExtent.GetYmax()) fExtent.SetYmax(newExtent.GetYmax());
76 if (newExtent.GetZmax() > fExtent.GetZmax()) fExtent.SetZmax(newExtent.GetZmax());
77
78 }
79}
void AccrueBoundingExtent(const G4VisExtent &)
G4BoundingExtentScene(G4VModel *pModel=0)
const G4Transform3D * fpCurrentObjectTransformation
virtual G4VisExtent GetExtent() const
Definition G4VSolid.cc:682
static const G4VisExtent & GetNullExtent()
void SetYmin(G4double ymin)
G4double GetYmin() const
G4double GetXmax() const
void SetYmax(G4double ymax)
void SetXmax(G4double xmax)
G4VisExtent & Transform(const G4Transform3D &)
void SetXmin(G4double xmin)
void SetZmax(G4double zmax)
G4double GetYmax() const
G4double GetZmax() const
G4double GetZmin() const
G4double GetXmin() const
void SetZmin(G4double zmin)