Geant4 10.7.0
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
38:fpModel(pModel)
39{}
40
42
43
44void G4BoundingExtentScene::ProcessVolume(const G4VSolid& solid)
45{
46 G4VisExtent newExtent = solid.GetExtent ();
49 }
50 AccrueBoundingExtent (newExtent);
51
52 // Curtail descent - can assume daughters are contained within mother...
53 G4PhysicalVolumeModel* pPVM = dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
54 if (pPVM) pPVM->CurtailDescent();
55}
56
58{
61}
62
64{
65
66 if (fExtent == G4VisExtent::GetNullExtent()) { // First time.
67
68 fExtent = newExtent;
69
70 } else {
71
72 if (newExtent.GetXmin() < fExtent.GetXmin()) fExtent.SetXmin(newExtent.GetXmin());
73 if (newExtent.GetYmin() < fExtent.GetYmin()) fExtent.SetYmin(newExtent.GetYmin());
74 if (newExtent.GetZmin() < fExtent.GetZmin()) fExtent.SetZmin(newExtent.GetZmin());
75 if (newExtent.GetXmax() > fExtent.GetXmax()) fExtent.SetXmax(newExtent.GetXmax());
76 if (newExtent.GetYmax() > fExtent.GetYmax()) fExtent.SetYmax(newExtent.GetYmax());
77 if (newExtent.GetZmax() > fExtent.GetZmax()) fExtent.SetZmax(newExtent.GetZmax());
78
79 }
80}
void AccrueBoundingExtent(const G4VisExtent &)
G4BoundingExtentScene(G4VModel *pModel=0)
const G4Transform3D * fpCurrentObjectTransformation
virtual G4VisExtent GetExtent() const
Definition: G4VSolid.cc:670
static const G4VisExtent & GetNullExtent()
Definition: G4VisExtent.cc:60
void SetYmin(G4double ymin)
Definition: G4VisExtent.hh:114
G4double GetYmin() const
Definition: G4VisExtent.hh:101
G4double GetXmax() const
Definition: G4VisExtent.hh:100
void SetYmax(G4double ymax)
Definition: G4VisExtent.hh:116
void SetXmax(G4double xmax)
Definition: G4VisExtent.hh:112
G4VisExtent & Transform(const G4Transform3D &)
Definition: G4VisExtent.cc:102
void SetXmin(G4double xmin)
Definition: G4VisExtent.hh:110
void SetZmax(G4double zmax)
Definition: G4VisExtent.hh:120
G4double GetYmax() const
Definition: G4VisExtent.hh:102
G4double GetZmax() const
Definition: G4VisExtent.hh:104
G4double GetZmin() const
Definition: G4VisExtent.hh:103
G4double GetXmin() const
Definition: G4VisExtent.hh:99
void SetZmin(G4double zmin)
Definition: G4VisExtent.hh:118