Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ArrowModel.cc 76285 2013-11-08 13:01:44Z gcosmo $
//
//
// John Allison 15th July 2012
@@ -36,13 +36,17 @@
#include "G4VGraphicsScene.hh"
#include "G4VisAttributes.hh"
#include "G4Tubs.hh"
#include "G4Polycone.hh"
#include "G4GenericPolycone.hh"
#include "G4Polyhedron.hh"
#include "G4Vector3D.hh"
#include "G4Point3D.hh"
#include "G4Transform3D.hh"
G4ArrowModel::~G4ArrowModel () {}
G4ArrowModel::~G4ArrowModel ()
{
delete fpHeadPolyhedron;
delete fpShaftPolyhedron;
}
G4ArrowModel::G4ArrowModel
(G4double x1, G4double y1, G4double z1,
@@ -84,7 +88,7 @@ G4ArrowModel::G4ArrowModel
r[i] *= 2.*shaftRadius;
z[i] = halfShaftLength + z[i] * 2.*shaftRadius;
}
G4Polycone head("head",0,twopi,numRZ,r,z);
G4GenericPolycone head("head",0,twopi,numRZ,r,z);
fpHeadPolyhedron = head.CreatePolyhedron();
// Transform to position
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4AttFilterUtils.cc 66870 2013-01-14 23:38:59Z adotti $
//
// Visualisation attribute filter utility functions.
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4AxesModel.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// John Allison 3rd April 2001
@@ -41,7 +41,18 @@
#include "G4ArrowModel.hh"
#include "G4TextModel.hh"
G4AxesModel::~G4AxesModel () {}
G4AxesModel::~G4AxesModel ()
{
delete fZAnnotationModel;
delete fZLabelModel;
delete fZAxisModel;
delete fYAnnotationModel;
delete fYLabelModel;
delete fYAxisModel;
delete fXAnnotationModel;
delete fXLabelModel;
delete fXAxisModel;
}
G4AxesModel::G4AxesModel
(G4double x0, G4double y0, G4double z0, G4double length,
@@ -96,6 +107,7 @@ G4AxesModel::G4AxesModel
va = new G4VisAttributes(xColour);
text->SetVisAttributes(va);
fXLabelModel = new G4TextModel(*text);
delete text;
text = new G4Text(annotation,G4Point3D(x0+0.8*length, y0, z0));
text->SetScreenSize(10.);
text->SetOffset(5.,5.);
@@ -103,6 +115,7 @@ G4AxesModel::G4AxesModel
va = new G4VisAttributes(xColour);
text->SetVisAttributes(va);
fXAnnotationModel = new G4TextModel(*text);
delete text;
}
G4Colour yColour(colour);
@@ -117,6 +130,7 @@ G4AxesModel::G4AxesModel
va = new G4VisAttributes(yColour);
text->SetVisAttributes(va);
fYLabelModel = new G4TextModel(*text);
delete text;
text = new G4Text(annotation,G4Point3D(x0, y0+0.8*length, z0));
text->SetScreenSize(10.);
text->SetOffset(5.,5.);
@@ -124,6 +138,7 @@ G4AxesModel::G4AxesModel
va = new G4VisAttributes(yColour);
text->SetVisAttributes(va);
fYAnnotationModel = new G4TextModel(*text);
delete text;
}
G4Colour zColour(colour);
@@ -138,6 +153,7 @@ G4AxesModel::G4AxesModel
va = new G4VisAttributes(zColour);
text->SetVisAttributes(va);
fZLabelModel = new G4TextModel(*text);
delete text;
text = new G4Text(annotation,G4Point3D(x0, y0, z0+0.8*length));
text->SetScreenSize(10.);
text->SetOffset(5.,5.);
@@ -145,6 +161,7 @@ G4AxesModel::G4AxesModel
va = new G4VisAttributes(zColour);
text->SetVisAttributes(va);
fZAnnotationModel = new G4TextModel(*text);
delete text;
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4BoundingSphereScene.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 7th June 1997
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4DigiFilterFactories.cc,v 1.1 2010-05-30 11:24:30 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// $Id: G4DigiFilterFactories.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Digi filter model factories creating filters
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4DigiModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -1,55 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id$
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
#include "G4FlavoredParallelWorldModel.hh"
#include "G4VFlavoredParallelWorld.hh"
#include "G4VisAttributes.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
G4FlavoredParallelWorldModel::G4FlavoredParallelWorldModel
(G4VFlavoredParallelWorld* FPW,
G4int soughtDepth,
const G4Transform3D& modelTransformation,
const G4ModelingParameters* mp)
: G4PhysicalVolumeModel (FPW -> GetThePhysicalVolumeWorld (),
soughtDepth,
modelTransformation,
mp),
theFlavoredParallelWorld (FPW)
{
fType = "G4FlavoredParallelWorldModel";
FPW -> GetThePhysicalVolumeWorld () ->
GetLogicalVolume () -> SetVisAttributes (G4VisAttributes::GetInvisible());
}
G4FlavoredParallelWorldModel::~G4FlavoredParallelWorldModel () {}
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4HitFilterFactories.cc,v 1.2 2010-05-30 11:24:03 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// $Id: G4HitFilterFactories.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Hits filter model factories creating filters
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4HitsModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4LogicalVolumeModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th July 1999.
@@ -0,0 +1,252 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4MagneticFieldModel.cc 74097 2013-09-22 16:03:59Z gcosmo $
//
//
// John Allison 17th August 2013
// Model that knows how to draw the magnetic field.
#include "G4MagneticFieldModel.hh"
#include "G4VGraphicsScene.hh"
#include "G4TransportationManager.hh"
#include "G4FieldManager.hh"
#include "G4Field.hh"
#include "G4Colour.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ArrowModel.hh"
#include "G4SystemOfUnits.hh"
#include <sstream>
#include <limits>
#include <vector>
G4MagneticFieldModel::~G4MagneticFieldModel ()
{
}
G4MagneticFieldModel::G4MagneticFieldModel (G4int nDataPointsPerMaxHalfScene)
: fNDataPointsPerMaxHalfScene(nDataPointsPerMaxHalfScene)
{
fType = "G4MagneticFieldModel";
fGlobalTag = fType;
std::ostringstream oss;
oss << fNDataPointsPerMaxHalfScene;
fGlobalDescription = fType + ':' + oss.str();
}
void G4MagneticFieldModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
{
// G4cout << "G4MagneticFieldModel::DescribeYourselfTo" << G4endl;
const G4VisExtent& extent = sceneHandler.GetExtent();
const G4double xMin = extent.GetXmin();
const G4double yMin = extent.GetYmin();
const G4double zMin = extent.GetZmin();
const G4double xMax = extent.GetXmax();
const G4double yMax = extent.GetYmax();
const G4double zMax = extent.GetZmax();
const G4double xHalfScene = 0.5 * (xMax - xMin);
const G4double yHalfScene = 0.5 * (yMax - yMin);
const G4double zHalfScene = 0.5 * (zMax - zMin);
// const G4double xSceneCentre = 0.5 * (xMax + xMin);
// const G4double ySceneCentre = 0.5 * (yMax + yMin);
// const G4double zSceneCentre = 0.5 * (zMax + zMin);
const G4double maxHalfScene =
std::max(xHalfScene,std::max(yHalfScene,zHalfScene));
if (maxHalfScene <= 0.) {
G4cout
<< "Extent non-positive."
<< G4endl;
return;
}
G4TransportationManager* tMgr =
G4TransportationManager::GetTransportationManager();
assert(tMgr);
G4Navigator* navigator = tMgr->GetNavigatorForTracking();
assert(navigator);
G4FieldManager* globalFieldMgr = tMgr->GetFieldManager();
const G4Field* globalField = 0;
if (globalFieldMgr) {
if (globalFieldMgr->DoesFieldExist()) {
globalField = globalFieldMgr->GetDetectorField();
if (!globalField) {
G4cout
<< "Null global field pointer."
<< G4endl;
}
} else {
G4cout
<< "No global field exists."
<< G4endl;
}
} else {
G4cout
<< "No global field manager."
<< G4endl;
}
// Constants
const G4double interval = maxHalfScene / fNDataPointsPerMaxHalfScene;
const G4int nDataPointsPerXHalfScene = G4int(xHalfScene / interval);
const G4int nDataPointsPerYHalfScene = G4int(yHalfScene / interval);
const G4int nDataPointsPerZHalfScene = G4int(zHalfScene / interval);
const G4int nXSamples = 2 * nDataPointsPerXHalfScene + 1;
const G4int nYSamples = 2 * nDataPointsPerYHalfScene + 1;
const G4int nZSamples = 2 * nDataPointsPerZHalfScene + 1;
const G4int nSamples = nXSamples * nYSamples * nZSamples;
const G4int nSamples3 = nSamples * 3;
const G4double arrowLengthMax = 0.8 * interval;
const G4int nResults = 6; // 3 B-field + 3 E-field.
// Working space for GetFieldValue.
double position_time[4] = {0,0,0,0};
double result[nResults];
// Working vectors for field values, etc.
std::vector<G4double> BField(nSamples3); // Initialises to zero.
std::vector<G4double> BFieldMagnitude(nSamples); // Initialises to zero.
std::vector<G4double> xyz(nSamples3); // Initialises to zero.
// Get field values and ascertain maximum field.
G4double BFieldMagnitudeMax = -std::numeric_limits<G4double>::max();
for (G4int i = 0; i < nXSamples; i++) {
G4double x = (i - nDataPointsPerXHalfScene) * interval;
position_time[0] = x;
for (G4int j = 0; j < nYSamples; j++) {
G4double y = (j - nDataPointsPerYHalfScene) * interval;
position_time[1] = y;
for (G4int k = 0; k < nZSamples; k++) {
G4double z = (k - nDataPointsPerZHalfScene) * interval;
position_time[2] = z;
// Calculate indices into working vectors
const G4int ijk = i * nYSamples * nZSamples + j * nZSamples + k;
const G4int ijk3 = ijk * 3;
// Find volume at this location.
G4ThreeVector pos(x,y,z);
const G4VPhysicalVolume* pPV =
navigator->LocateGlobalPointAndSetup(pos,0,false,true);
const G4Field* field = globalField;
if (pPV) {
// Get logical volume.
const G4LogicalVolume* pLV = pPV->GetLogicalVolume();
if (pLV) {
// Value for Region, if any, overrides
G4Region* pRegion = pLV->GetRegion();
if (pRegion) {
G4FieldManager* pRegionFieldMgr = pRegion->GetFieldManager();
if (pRegionFieldMgr) {
field = pRegionFieldMgr->GetDetectorField();
// G4cout << "Region with field" << G4endl;
}
}
// 'Local' value from logical volume, if any, overrides
G4FieldManager* pLVFieldMgr = pLV->GetFieldManager();
if (pLVFieldMgr) {
field = pLVFieldMgr->GetDetectorField();
// G4cout << "Logical volume with field" << G4endl;
}
}
}
// If field found, get values and store in working vectors.
if (field) {
// Get field values in result array.
field->GetFieldValue(position_time,result);
// G4cout
// << "BField/T:"
// << " " << result[0]/tesla
// << " " << result[1]/tesla
// << " " << result[2]/tesla
// << G4endl;
// Store B-field components.
for (G4int l = 0; l < 3; l++) {
BField[ijk3 + l] = result[l];
}
// Calculate magnitude and store.
G4double mag = sqrt
(result[0]*result[0]+result[1]*result[1]+result[2]*result[2]);
BFieldMagnitude[ijk] = mag;
// Store position.
xyz[ijk3] = x;
xyz[ijk3 + 1] = y;
xyz[ijk3 + 2] = z;
// Find maximum field magnitude.
if (mag > BFieldMagnitudeMax) {
BFieldMagnitudeMax = mag;
}
}
}
}
}
if (BFieldMagnitudeMax <= 0) {
G4cout
<< "No field in this scene."
<< G4endl;
return;
}
for (G4int i = 0; i < nSamples; i++) {
if (BFieldMagnitude[i] > 0) {
const G4int i3 = i * 3;
const G4double x = xyz[i3];
const G4double y = xyz[i3 + 1];
const G4double z = xyz[i3 + 2];
const G4double B = BFieldMagnitude[i];
// G4cout
// << "Position/mm, BField/T unpacked:"
// << ' ' << x/mm
// << ' ' << y/mm
// << ' ' << z/mm
// << " " << BField[i3]/tesla
// << " " << BField[i3 + 1]/tesla
// << " " << BField[i3 + 2]/tesla
// << G4endl;
const G4double f = B / BFieldMagnitudeMax;
const G4double arrowLength = arrowLengthMax * f;
G4double red = 0., green = 0., blue = 0., alpha = 1.;
if (f < 0.5) { // Linear colour scale: 0->0.5->1 is blue->green->red.
green = 2. * f;
blue = 2. * (0.5 - f);
} else {
red = 2. * (f - 0.5);
green = 2. * (1.0 - f);
}
const G4Colour arrowColour(red,green,blue,alpha);
G4ArrowModel BArrow
(x,y,z,
x + arrowLength * BField[i3] / B,
y + arrowLength * BField[i3 + 1] / B,
z + arrowLength * BField[i3 + 2] / B,
arrowLength/5,
arrowColour);
BArrow.DescribeYourselfTo(sceneHandler);
}
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ModelingParameters.cc 71534 2013-06-17 16:07:53Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -234,8 +234,8 @@ G4bool G4ModelingParameters::operator !=
(fExplodeFactor != mp.fExplodeFactor) ||
(fExplodeCentre != mp.fExplodeCentre) ||
(fNoOfSides != mp.fNoOfSides) ||
(fpSectionSolid != mp.fpSectionSolid) ||
(fpCutawaySolid != mp.fpCutawaySolid) ||
(fpSectionSolid != mp.fpSectionSolid) ||
(fpCutawaySolid != mp.fpCutawaySolid) ||
(fpEvent != mp.fpEvent)
)
return true;
@@ -243,90 +243,67 @@ G4bool G4ModelingParameters::operator !=
if (fDensityCulling &&
(fVisibleDensity != mp.fVisibleDensity)) return true;
if (VAMSNotEqual(fVisAttributesModifiers, mp.fVisAttributesModifiers))
if (fVisAttributesModifiers != mp.fVisAttributesModifiers)
return true;
return false;
}
G4bool G4ModelingParameters::PVNameCopyNoPathNotEqual
(const G4ModelingParameters::PVNameCopyNoPath& path1,
const G4ModelingParameters::PVNameCopyNoPath& path2)
G4bool G4ModelingParameters::PVNameCopyNo::operator!=
(const G4ModelingParameters::PVNameCopyNo& rhs) const
{
if (path1.size() != path2.size()) return true;
if (path1.empty()) return false;
PVNameCopyNoPathConstIterator i1, i2;
for (i1 = path1.begin(), i2 = path2.begin();
i1 != path1.end();
++i1, ++i2) {
if (i1->GetName() != i2->GetName()) return true;
if (i1->GetCopyNo() != i2->GetCopyNo()) return true;
}
if (fName != rhs.fName) return true;
if (fCopyNo != rhs.fCopyNo) return true;
return false;
}
G4bool G4ModelingParameters::VAMSNotEqual
(const std::vector<G4ModelingParameters::VisAttributesModifier>& vams1,
const std::vector<G4ModelingParameters::VisAttributesModifier>& vams2)
G4bool G4ModelingParameters::VisAttributesModifier::operator!=
(const G4ModelingParameters::VisAttributesModifier& rhs) const
{
if (vams1.size() != vams2.size()) return true;
if (vams1.empty()) return false;
std::vector<VisAttributesModifier>::const_iterator i1, i2;
for (i1 = vams1.begin(), i2 = vams2.begin();
i1 != vams1.end();
++i1, ++i2) {
const PVNameCopyNoPath& vam1Path = i1->GetPVNameCopyNoPath();
const PVNameCopyNoPath& vam2Path = i2->GetPVNameCopyNoPath();
if (PVNameCopyNoPathNotEqual(vam1Path,vam2Path)) return true;
if (i1->GetVisAttributesSignifier() != i2->GetVisAttributesSignifier())
return true;
const G4VisAttributes& vam1VisAtts = i1->GetVisAttributes();
const G4VisAttributes& vam2VisAtts = i2->GetVisAttributes();
const G4Colour& c1 = vam1VisAtts.GetColour();
const G4Colour& c2 = vam2VisAtts.GetColour();
switch (i1->GetVisAttributesSignifier()) {
case G4ModelingParameters::VASVisibility:
if (vam1VisAtts.IsVisible() != vam2VisAtts.IsVisible())
return true;
break;
case G4ModelingParameters::VASDaughtersInvisible:
if (vam1VisAtts.IsDaughtersInvisible() !=
vam2VisAtts.IsDaughtersInvisible())
return true;
break;
case G4ModelingParameters::VASColour:
if (c1 != c2)
return true;
break;
case G4ModelingParameters::VASLineStyle:
if (vam1VisAtts.GetLineStyle() != vam2VisAtts.GetLineStyle())
return true;
break;
case G4ModelingParameters::VASLineWidth:
if (vam1VisAtts.GetLineWidth() != vam2VisAtts.GetLineWidth())
return true;
break;
case G4ModelingParameters::VASForceWireframe:
if (vam1VisAtts.GetForcedDrawingStyle() !=
vam2VisAtts.GetForcedDrawingStyle())
return true;
break;
case G4ModelingParameters::VASForceSolid:
if (vam1VisAtts.GetForcedDrawingStyle() !=
vam2VisAtts.GetForcedDrawingStyle())
return true;
break;
case G4ModelingParameters::VASForceAuxEdgeVisible:
if (vam1VisAtts.IsForceAuxEdgeVisible() !=
vam2VisAtts.IsForceAuxEdgeVisible())
return true;
break;
case G4ModelingParameters::VASForceLineSegmentsPerCircle:
if (vam1VisAtts.GetForcedLineSegmentsPerCircle() !=
vam2VisAtts.GetForcedLineSegmentsPerCircle())
return true;
break;
}
if (fSignifier != rhs.fSignifier) return true;
if (fPVNameCopyNoPath != rhs.fPVNameCopyNoPath) return true;
switch (fSignifier) {
case G4ModelingParameters::VASVisibility:
if (fVisAtts.IsVisible() != rhs.fVisAtts.IsVisible())
return true;
break;
case G4ModelingParameters::VASDaughtersInvisible:
if (fVisAtts.IsDaughtersInvisible() !=
rhs.fVisAtts.IsDaughtersInvisible())
return true;
break;
case G4ModelingParameters::VASColour:
if (fVisAtts.GetColour() != rhs.fVisAtts.GetColour())
return true;
break;
case G4ModelingParameters::VASLineStyle:
if (fVisAtts.GetLineStyle() != rhs.fVisAtts.GetLineStyle())
return true;
break;
case G4ModelingParameters::VASLineWidth:
if (fVisAtts.GetLineWidth() != rhs.fVisAtts.GetLineWidth())
return true;
break;
case G4ModelingParameters::VASForceWireframe:
if (fVisAtts.GetForcedDrawingStyle() !=
rhs.fVisAtts.GetForcedDrawingStyle())
return true;
break;
case G4ModelingParameters::VASForceSolid:
if (fVisAtts.GetForcedDrawingStyle() !=
rhs.fVisAtts.GetForcedDrawingStyle())
return true;
break;
case G4ModelingParameters::VASForceAuxEdgeVisible:
if (fVisAtts.IsForceAuxEdgeVisible() !=
rhs.fVisAtts.IsForceAuxEdgeVisible())
return true;
break;
case G4ModelingParameters::VASForceLineSegmentsPerCircle:
if (fVisAtts.GetForcedLineSegmentsPerCircle() !=
rhs.fVisAtts.GetForcedLineSegmentsPerCircle())
return true;
break;
}
return false;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4NullModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 4th April 1998.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PSHitsModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Created: Mar. 31, 2009 Akinori Kimura
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PhysicalVolumeMassScene.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 10th August 1998.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PhysicalVolumeModel.cc 70646 2013-06-03 15:07:58Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -63,6 +63,7 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
G4bool useFullExtent):
G4VModel (modelTransformation, pMP),
fpTopPV (pVPV),
fTopPVCopyNo (0),
fRequestedDepth (requestedDepth),
fUseFullExtent (useFullExtent),
fCurrentDepth (0),
@@ -578,6 +579,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
if (copyForVAM) {
delete pModifiedVisAtts;
pVisAttribs = pUnmodifiedVisAtts;
copyForVAM = false;
}
// Vis atts for this volume no longer needed if created...
@@ -714,8 +716,9 @@ G4bool G4PhysicalVolumeModel::Validate (G4bool warn)
// The idea now is to seek a PV with the same name and copy no
// in the hope it's the same one!!
G4PhysicalVolumeModel searchModel (world);
G4int verbosity = 0; // Suppress messages from G4PhysicalVolumeSearchScene.
G4PhysicalVolumeSearchScene searchScene
(&searchModel, fTopPVName, fTopPVCopyNo);
(&searchModel, fTopPVName, fTopPVCopyNo, verbosity);
G4ModelingParameters mp; // Default modeling parameters for this search.
mp.SetDefaultVisAttributes(fpMP? fpMP->GetDefaultVisAttributes(): 0);
searchModel.SetModelingParameters (&mp);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PhysicalVolumeSearchScene.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// John Allison 10th August 1998.
@@ -39,7 +39,8 @@
G4PhysicalVolumeSearchScene::G4PhysicalVolumeSearchScene
(G4PhysicalVolumeModel* pPVModel,
const G4String& requiredPhysicalVolumeName,
G4int requiredCopyNo):
G4int requiredCopyNo,
G4int verbosity):
fpPVModel (pPVModel),
fRequiredPhysicalVolumeName (requiredPhysicalVolumeName),
fRequiredCopyNo (requiredCopyNo),
@@ -47,6 +48,7 @@ G4PhysicalVolumeSearchScene::G4PhysicalVolumeSearchScene
fFoundDepth (0),
fpFoundPV (0),
fpFoundLV (0),
fVerbosity (verbosity),
fMultipleOccurrence (false)
{}
@@ -82,7 +84,7 @@ void G4PhysicalVolumeSearchScene::FindVolume (const G4VSolid&) {
fFoundObjectTransformation = *fpCurrentObjectTransformation;
}
else {
if (!fMultipleOccurrence) {
if (!fMultipleOccurrence && fVerbosity > 0) {
fMultipleOccurrence = true;
G4cout << "G4PhysicalVolumeSearchScene::FindVolume:"
<< "\n Required volume \""
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ScaleModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 21st July 2001.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TextModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 3rd April 2001
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TrajectoriesModel.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -42,23 +42,14 @@
#include "G4UIcommand.hh"
G4TrajectoriesModel::G4TrajectoriesModel ():
fDrawingModeSet(false),
fDrawingMode(0),
fpCurrentTrajectory(0)
fpCurrentTrajectory(0),
fEventID(0)
{
fType = "G4TrajectoriesModel";
fGlobalTag = "G4TrajectoriesModel for all trajectories.";
fGlobalDescription = fGlobalTag;
}
G4TrajectoriesModel::G4TrajectoriesModel (G4int drawingMode):
fDrawingModeSet(true),
fDrawingMode(drawingMode),
fpCurrentTrajectory(0) {
fGlobalTag = "G4TrajectoriesModel for all trajectories.";
fGlobalDescription = fGlobalTag;
}
G4TrajectoriesModel::~G4TrajectoriesModel () {}
void G4TrajectoriesModelDebugG4AttValues(const G4VTrajectory*);
@@ -94,42 +85,6 @@ void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
pVVisManager->EndDraw();
}
G4bool G4TrajectoriesModel::IsDrawingModeSet() const
{
return fDrawingModeSet;
}
G4int G4TrajectoriesModel::GetDrawingMode() const
{
if (fDrawingModeSet) return fDrawingMode;
else {
G4Exception
("G4TrajectoriesModel::GetDrawingMode",
"modeling0010",
FatalException,
"Illegal attempt to obtain i_mode."
"\n i_mode is an old trajectories parameter that is DEPRECATED"
"\n and will be removed at the next major release."
);
return 0;
}
}
void G4TrajectoriesModel::SetDrawingMode(G4int drawingMode)
{
if (fDrawingModeSet) fDrawingMode = drawingMode;
else {
G4Exception
("G4TrajectoriesModel::SetDrawingMode",
"modeling0011",
FatalException,
"Illegal attempt to set i_mode."
"\n i_mode is an old trajectories parameter that is DEPRECATED"
"\n and will be removed at the next major release."
);
}
}
const std::map<G4String,G4AttDef>* G4TrajectoriesModel::GetAttDefs() const
{
G4bool isNew;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryChargeFilter.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Filter trajectories according to charge. Only registered
// charges will pass the filter.
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryDrawByAttribute.cc 68732 2013-04-05 09:44:10Z gcosmo $
//
// Jane Tinslay August 2006
//
@@ -58,14 +58,6 @@ G4TrajectoryDrawByAttribute::~G4TrajectoryDrawByAttribute()
delete filter;
}
void
G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
const G4int&,
const G4bool& visible) const
{
Draw(object, visible);
}
void
G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
const G4bool& visible) const
@@ -101,7 +93,7 @@ G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
ed <<"Unable to extract attribute definition named "<<fAttName;
G4Exception
("G4TrajectoryDrawByAttribute::Draw",
"modeling0117", JustWarning, ed, "Invalid attribute name");
"modeling0117", JustWarning, ed, ". Invalid attribute name");
G4cout << "Available attributes:\n"
<< object.GetAttDefs();
warnedUnableToExtract = true;
@@ -139,7 +131,7 @@ G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
ed <<"Unable to extract attribute value named "<<fAttName;
G4Exception
("G4TrajectoryDrawByAttribute::Draw",
"modeling0118", JustWarning, ed, "Invalid attribute name");
"modeling0118", JustWarning, ed, ". Invalid attribute name");
G4cout << "Available attributes:\n"
<< object.GetAttDefs();
warnedUnableToExtract = true;
@@ -224,7 +216,7 @@ G4TrajectoryDrawByAttribute::AddIntervalContext(const G4String& name, G4VisTrajC
ed <<"Interval "<< name <<" already exists";
G4Exception
("G4TrajectoryDrawByAttribute::AddIntervalContext",
"modeling0119", FatalErrorInArgument, ed, "Invalid interval");
"modeling0119", FatalErrorInArgument, ed, ". Invalid interval");
}
fContextMap[myPair] = context;
@@ -243,7 +235,7 @@ G4TrajectoryDrawByAttribute::AddValueContext(const G4String& name, G4VisTrajCont
ed <<"Single value "<< name <<" already exists";
G4Exception
("G4TrajectoryDrawByAttribute::AddSingleValueContext",
"modeling0120", FatalErrorInArgument, ed, "Invalid value");
"modeling0120", FatalErrorInArgument, ed, ". Invalid value");
}
fContextMap[myPair] = context;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryDrawByCharge.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
#include "G4TrajectoryDrawByCharge.hh"
@@ -54,14 +54,6 @@ G4TrajectoryDrawByCharge::G4TrajectoryDrawByCharge(const G4String& name,
G4TrajectoryDrawByCharge::~G4TrajectoryDrawByCharge() {}
void
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& object,
const G4int&,
const G4bool& visible) const
{
Draw(object, visible);
}
void
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4bool& visible) const
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryDrawByOriginVolume.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay March 2006
@@ -41,14 +41,6 @@ G4TrajectoryDrawByOriginVolume::G4TrajectoryDrawByOriginVolume(const G4String& n
G4TrajectoryDrawByOriginVolume::~G4TrajectoryDrawByOriginVolume() {}
void
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& object,
const G4int&,
const G4bool& visible) const
{
Draw(object, visible);
}
void
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4bool& visible) const
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryDrawByParticleID.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
@@ -47,14 +47,6 @@ G4TrajectoryDrawByParticleID::G4TrajectoryDrawByParticleID(const G4String& name,
G4TrajectoryDrawByParticleID::~G4TrajectoryDrawByParticleID() {}
void
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& object,
const G4int&,
const G4bool& visible) const
{
Draw(object, visible);
}
void
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4bool& visible) const
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryDrawerUtils.cc 66870 2013-01-14 23:38:59Z adotti $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -310,68 +310,6 @@ namespace G4TrajectoryDrawerUtils {
}
}
void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext& context, const G4int& i_mode)
{
static G4bool warnedAboutIMode = false;
G4ExceptionDescription ed;
ed << "WARNING: DEPRECATED use of i_mode (i_mode: " << i_mode
<< "). Feature will be removed at a future major release.";
if (!warnedAboutIMode) {
G4Exception
("G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, context, i_mode)",
"modeling0125", JustWarning, ed);
warnedAboutIMode = true;
}
// Extra copy while i_mode is still around
G4VisTrajContext myContext(context);
if (i_mode != 0) {
const G4double markerSize = std::abs(i_mode)/1000;
G4bool lineRequired (i_mode >= 0);
G4bool markersRequired (markerSize > 0.);
myContext.SetDrawLine(lineRequired);
myContext.SetDrawAuxPts(markersRequired);
myContext.SetDrawStepPts(markersRequired);
myContext.SetAuxPtsSize(markerSize);
myContext.SetStepPtsSize(markerSize);
}
// Return if don't need to do anything
if (!myContext.GetDrawLine() && !myContext.GetDrawAuxPts() && !myContext.GetDrawStepPts()) return;
// Get points and times (times are returned only if time-slicing
// is requested).
G4Polyline trajectoryLine;
G4Polymarker stepPoints;
G4Polymarker auxiliaryPoints;
std::vector<G4double> trajectoryLineTimes;
std::vector<G4double> stepPointTimes;
std::vector<G4double> auxiliaryPointTimes;
TimesValidity validity = GetPointsAndTimes
(traj, context,
trajectoryLine, auxiliaryPoints, stepPoints,
trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes);
if (validity == ValidTimes) {
SliceLine(context.GetTimeSliceInterval(),
trajectoryLine, trajectoryLineTimes);
DrawWithTime(context,
trajectoryLine, auxiliaryPoints, stepPoints,
trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes);
} else {
DrawWithoutTime(context, trajectoryLine, auxiliaryPoints, stepPoints);
}
}
void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext& context)
{
// Return if don't need to do anything
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4TrajectoryFilterFactories.cc,v 1.5 2006-09-12 18:53:03 tinslay Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// $Id: G4TrajectoryFilterFactories.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Trajectory filter model factories creating filters
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryGenericDrawer.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay May 2006
//
@@ -39,21 +39,6 @@ G4TrajectoryGenericDrawer::G4TrajectoryGenericDrawer(const G4String& name, G4Vis
G4TrajectoryGenericDrawer::~G4TrajectoryGenericDrawer() {}
void
G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
{
G4VisTrajContext myContext(GetContext());
myContext.SetVisible(visible);
if (GetVerbose()) {
G4cout<<"G4TrajectoryGenericDrawer named "<<Name();
G4cout<<", drawing trajectory with configuration: "<<G4endl;
myContext.Print(G4cout);
}
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
}
void
G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4bool& visible) const
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryModelFactories.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryOriginVolumeFilter.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Filter trajectories according to volume name. Only registered
// volumes will pass the filter.
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TrajectoryParticleFilter.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Filter trajectories according to particle type. Only registered
// particle types will pass the filter.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4VTrajectoryModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay May 2006
//