Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -7,7 +7,6 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt 66373 2012-12-18 09:41:34Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -1,4 +1,3 @@
# $Id: GNUmakefile 99176 2016-09-07 09:46:36Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for modeling library. John Allison, 31/12/1997.
# --------------------------------------------------------------
+90 -1
View File
@@ -1,4 +1,3 @@
$Id: History 110743 2018-06-12 06:33:37Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +19,96 @@ committal in the CVS repository !
History file for visualization/modeling
---------------------------------------
14 November 2018 John Allison (modeling-V10-04-18)
- G4PhysicalVolumeModel.cc: Fix Coverity warning.
08 November 2018 John Allison (modeling-V10-04-17)
- G4LogicalVolumeModel.cc:
o Overlap checking now in text and drawing.
07 November 2018 John Allison (modeling-V10-04-16)
- G4PhysicalVolumeModel.cc:
o Add BasePVPath to G4Atts.
o Tidied.
- G4LogicalVolumeModel.cc:
o Overlap checking only in text output at present.
24 October 2018 John Allison (modeling-V10-04-15)
- G4TouchableUtils:
o Remove FindGlobalTransform, introduce FindTouchableProperties. The
global transform is in properties.fTouchableGlobalTransform.
- Add G4TouchablePropertiesScene.
- Delete G4TouchableDumpScene, G4TouchableGlobalTransformScene.
- sources.cmake: Modify for above additions and deletions.
- G4PhysicalVolumesSearchScene::Matcher:
o Improve logic and safety.
o Add G4Exception(...JustWarning...)
- G4PhysicalVolumeModel:
o Comment out resets at end of DescribeYourselfTo(). Shouldn't be
necessary - they should all be maintained. In fact, zeroing the LV
pointer is plain wrong and causes error in GetAttvalues
o Introduce a static function GetPVNameCopyNoPath to convert PVPath
to PVNameCopyNoPath:
o Add BasePVPath to G4Atts.
- G4ModelingParameters:
o Remove constructors that take PVPath as an argument. Caused circular
dependency with G4PhysicalVolumeModel.
- G4AxesModel: Correct exception number.
17 October 2018 John Allison (modeling-V10-04-14)
- G4PhysicalVolumesSearchScene: Attempt fix for Windows compiler error.
15 October 2018 John Allison (modeling-V10-04-13)
- G4PhysicalVolumesSearchScene: Add regex search.
o Match the string with the required match. The latter can be of the form
"/regexp/", where regexp is a regular expression (see C++ regex),
or a plain string, in which case there must be an exact match.
8 October 2018 John Allison
- G4MagneticFieldModel: Improve global description.
6 October 2018 John Allison (modeling-V10-04-12)
- G4TrajectoriesModel: Improve description.
11 September 2018 John Allison (modeling-V10-04-11)
- G4VisTrajContext.cc: Initialise fLineWidth(1.).
10 September 2018 John Allison (modeling-V10-04-10)
- Add G4PhysicalVolumesSearchScene.
o This returns all occurrences of a physical volume.
5 September 2018 John Allison
- G4PhysicalVolumeModel: More minor tidying.
4 September 2018 John Allison
- G4PhysicalVolumeModel: Minor tidying.
3 September 2018 John Allison (modeling-V10-04-09)
- G4PhysicalVolumeSearchScene:
o Remove fetch and store of unused logical volume pointer.
31 August 2018 John Allison (modeling-V10-04-08)
- Add setLineWidth for trajectory models.
29 August 2018 John Allison (modeling-V10-04-07)
- G4LogicalVolumeModel:
o Add overlap checking (printing only for now).
. Avoid multiple printing of overlaps. Print only first time for
a given instantiation of G4LogicalVolume.
- Add G4TouchableGlobalTransformScene:
o Return a pointer to the global transform of a touchable.
- Add G4TouchableUtils:
o Implement G4TouchableUtils::FindGlobalTransform. (Uses
G4TouchableGlobalTransformScene.) Typical use:
G4ModelingParameters::PVNameCopyNoPath path;
// Specify the complete path of the touchable by a succession of
// name,copyNo pairs or pointer,copyNo pairs.
path.push_back(G4ModelingParameters::PVNameCopyNo("World",0));
path.push_back(G4ModelingParameters::PVNameCopyNo("Envelope",0));
.. etc., until touchable completely specified
const G4Transform3D* pGlobalTransform =
G4TouchableUtils::FindGlobalTransform(path);
11 June 2018 John Allison (modeling-V10-04-06)
- G4PhysicalVolumeModel.cc: Fix Coverity warning.
o Unnecessary check on pointer.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ArrowModel.hh 100807 2016-11-02 15:00:41Z gcosmo $
//
//
// John Allison 15th July 2012
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AttFilterUtils.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Visualisation attribute filter utility functions.
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AttValueFilterT.hh 108059 2017-12-19 15:13:34Z gcosmo $
//
// Templated class for G4AttValue filters.
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AttributeFilterT.hh 66870 2013-01-14 23:38:59Z adotti $
//
// Generic attribute filter.
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4AxesModel.hh 83403 2014-08-21 15:07:30Z gcosmo $
//
//
// John Allison 3rd April 2001
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4BoundingSphereScene.hh 81056 2014-05-20 09:02:16Z gcosmo $
//
//
// John Allison 7th June 1997
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4CallbackModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4DigiFilterFactories.hh 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Digi filter model factories creating filters
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4DigiModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4GPSModel.hh 99642 2016-09-29 19:49:30Z allison $
//
//
// John Allison 26th April 2017.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4HitFilterFactories.hh 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Hit filter model factories creating filters
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4HitsModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4LogicalVolumeModel.hh 110480 2018-05-25 07:25:18Z gcosmo $
//
//
// John Allison 26th July 1999.
@@ -86,6 +85,7 @@ protected:
G4bool fVoxels; // Flag for drawing voxels.
G4bool fReadout; // Flag for drawing readout geometry.
G4bool fCheckOverlaps; // Flag for checking overlaps.
G4bool fOverlapsPrinted; // To avoid multiple printing.
};
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MagneticFieldModel.hh 101958 2016-12-12 08:04:35Z gcosmo $
//
//
// John Allison 17th August 2013
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModelApplyCommandsT.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Abstract model messenges. Derived classes should implement
// the "Apply" method
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModelColourMap.hh 95593 2016-02-16 10:48:50Z gcosmo $
//
// Generic variable->G4Colour map, where "variable" is the template
// parameter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModelCommandUtils.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay September 2006
//
@@ -46,7 +45,8 @@ namespace G4ModelCommandUtils {
messengers.push_back(new G4ModelCmdSetDrawLine<G4VisTrajContext>(context, placement));
messengers.push_back(new G4ModelCmdSetLineVisible<G4VisTrajContext>(context, placement));
messengers.push_back(new G4ModelCmdSetLineColour<G4VisTrajContext>(context, placement));
messengers.push_back(new G4ModelCmdSetLineWidth<G4VisTrajContext>(context, placement));
messengers.push_back(new G4ModelCmdSetDrawStepPts<G4VisTrajContext>(context, placement));
messengers.push_back(new G4ModelCmdSetStepPtsVisible<G4VisTrajContext>(context, placement));
messengers.push_back(new G4ModelCmdSetStepPtsColour<G4VisTrajContext>(context, placement));
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModelCommandsT.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Generic model messenges.
//
@@ -685,23 +684,42 @@ protected:
};
////////////////////////////////////////////////////////////////////////
// SetLineWidth command
template <typename M>
class G4ModelCmdSetLineWidth : public G4ModelCmdApplyDouble<M> {
public:
G4ModelCmdSetLineWidth(M* model, const G4String& placement,
const G4String& cmdName="""setLineWidth")
:G4ModelCmdApplyDouble<M>(model, placement, cmdName){}
protected:
void Apply(const G4double& width) {
G4VModelCommand<M>::Model()->SetLineWidth(width);
}
};
////////////////////////////////////////////////////////////////////////
// SetLineColour command
template <typename M>
class G4ModelCmdSetLineColour : public G4ModelCmdApplyColour<M> {
public:
G4ModelCmdSetLineColour(M* model, const G4String& placement,
const G4String& cmdName="""setLineColour")
:G4ModelCmdApplyColour<M>(model, placement, cmdName){}
const G4String& cmdName="""setLineColour")
:G4ModelCmdApplyColour<M>(model, placement, cmdName){}
protected:
void Apply(const G4Colour& colour) {
G4VModelCommand<M>::Model()->SetLineColour(colour);
}
};
////////////////////////////////////////////////////////////////////////
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModelCompoundCommandsT.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay September 2006
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ModelingParameters.hh 109510 2018-04-26 07:15:57Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -40,7 +39,6 @@
#include "G4VisExtent.hh"
#include "G4VisAttributes.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PhysicalVolumeModel.hh"
#include <vector>
#include <utility>
@@ -81,11 +79,6 @@ public: // With description
// Normal constructor
PVNameCopyNo(G4String name, G4int copyNo)
: fName(name), fCopyNo(copyNo) {}
// Constructor from G4PhysicalVolumeModel::G4PhysicalVolumeNodeID
PVNameCopyNo
(const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID& nodeID)
: fName(nodeID.GetPhysicalVolume()->GetName())
, fCopyNo(nodeID.GetCopyNo()) {}
const G4String& GetName() const {return fName;}
G4int GetCopyNo() const {return fCopyNo;}
G4bool operator!=(const PVNameCopyNo&) const;
@@ -102,11 +95,6 @@ public: // With description
// Normal constructor
PVPointerCopyNo(G4VPhysicalVolume* pPV, G4int copyNo)
: fpPV(pPV), fCopyNo(copyNo) {}
// Constructor from G4PhysicalVolumeModel::G4PhysicalVolumeNodeID
PVPointerCopyNo
(const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID& nodeID)
: fpPV(nodeID.GetPhysicalVolume())
, fCopyNo(nodeID.GetCopyNo()) {}
const G4String& GetName() const;
const G4VPhysicalVolume* GetPVPointer() const {return fpPV;}
G4int GetCopyNo() const {return fCopyNo;}
@@ -126,10 +114,6 @@ public: // With description
VisAttributesSignifier signifier,
const PVNameCopyNoPath& path):
fVisAtts(visAtts), fSignifier(signifier), fPVNameCopyNoPath(path) {}
VisAttributesModifier
(const G4VisAttributes& visAtts,
VisAttributesSignifier signifier,
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path);
const G4VisAttributes& GetVisAttributes() const
{return fVisAtts;}
VisAttributesSignifier GetVisAttributesSignifier() const
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ModelingParameters.icc 109510 2018-04-26 07:15:57Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4NullModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 4th April 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PSHitsModel.hh 99152 2016-09-07 08:04:30Z gcosmo $
//
//
// Created: Mar. 31, 2009 Akinori Kimura
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeMassScene.hh 99076 2016-09-01 12:40:47Z gcosmo $
//
//
// John Allison 12th September 2004
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeModel.hh 99668 2016-09-30 08:02:13Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -63,8 +62,9 @@
#define G4PHYSICALVOLUMEMODEL_HH
#include "G4VModel.hh"
#include "G4VTouchable.hh"
#include "G4ModelingParameters.hh"
#include "G4VTouchable.hh"
#include "G4Transform3D.hh"
#include "G4Plane3D.hh"
#include <iostream>
@@ -87,6 +87,7 @@ public: // With description
enum ClippingMode {subtraction, intersection};
// Nested class for identifying physical volume nodes.
class G4PhysicalVolumeNodeID {
public:
G4PhysicalVolumeNodeID
@@ -114,8 +115,8 @@ public: // With description
G4Transform3D fTransform;
G4bool fDrawn;
};
// Nested class for identifying physical volume nodes.
// Nested class for handling nested parameterisations.
class G4PhysicalVolumeModelTouchable: public G4VTouchable {
public:
G4PhysicalVolumeModelTouchable
@@ -129,14 +130,24 @@ public: // With description
private:
const std::vector<G4PhysicalVolumeNodeID>& fFullPVPath;
};
// Nested class for handling nested parameterisations.
// Nested struct for encapsulating touchable properties
struct TouchableProperties {
TouchableProperties(): fpTouchablePV(nullptr) {}
G4ModelingParameters::PVNameCopyNoPath fTouchablePath;
G4VPhysicalVolume* fpTouchablePV;
G4Transform3D fTouchableGlobalTransform;
std::vector<G4PhysicalVolumeNodeID> fTouchableBaseFullPVPath;
};
G4PhysicalVolumeModel
(G4VPhysicalVolume* = 0,
G4int requestedDepth = UNLIMITED,
const G4Transform3D& modelTransformation = G4Transform3D(),
const G4ModelingParameters* = 0,
G4bool useFullExtent = false);
G4bool useFullExtent = false,
const std::vector<G4PhysicalVolumeNodeID>& baseFullPVPath =
std::vector<G4PhysicalVolumeNodeID>());
virtual ~G4PhysicalVolumeModel ();
@@ -159,11 +170,14 @@ public: // With description
{return fpClippingSolid;}
G4int GetCurrentDepth() const {return fCurrentDepth;}
// Current depth of geom. hierarchy.
// Current depth in geom. hierarchy.
G4VPhysicalVolume* GetCurrentPV() const {return fpCurrentPV;}
// Current physical volume.
G4int GetCurrentPVCopyNo() const {return fCurrentPVCopyNo;}
// Current copy number.
G4LogicalVolume* GetCurrentLV() const {return fpCurrentLV;}
// Current logical volume.
@@ -173,6 +187,13 @@ public: // With description
G4Transform3D* GetCurrentTransform() const {return fpCurrentTransform;}
// Current transform.
const std::vector<G4PhysicalVolumeNodeID>& GetBaseFullPVPath() const
{return fBaseFullPVPath;}
// Base for this G4PhysicalVolumeModel. It can be empty, which would be the
// case for the world volume. But the user may create a G4PhysicalVolumeModel
// for a volume anywhere in the tree, in which case the user must provide
// the transform (in the constructor) and the base path (SetBaseFullPVPath).
const std::vector<G4PhysicalVolumeNodeID>& GetFullPVPath() const
{return fFullPVPath;}
// Vector of physical volume node identifiers for the current
@@ -185,7 +206,11 @@ public: // With description
// Path of the current drawn (non-culled) touchable in terms of
// drawn (non-culled) ancesters. It is a vector of physical volume
// node identifiers corresponding to the geometry hierarchy actually
// selected, i.e., not culled.
// selected, i.e., with "culled" volumes NOT included.
static G4ModelingParameters::PVNameCopyNoPath GetPVNameCopyNoPath
(const std::vector<G4PhysicalVolumeNodeID>&);
// Converts
const std::map<G4String,G4AttDef>* GetAttDefs() const;
// Attribute definitions for current solid.
@@ -199,13 +224,6 @@ public: // With description
// G4XXXStoredSceneHandler::PreAddSolid for how to access and
// G4VTrajectory::ShowTrajectory for an example of the use of
// G4Atts.
void SetBaseFullPVPath
(const std::vector<G4PhysicalVolumeNodeID>&
baseFullPVPath) {
fBaseFullPVPath = baseFullPVPath;
fFullPVPath = baseFullPVPath;
}
void SetRequestedDepth (G4int requestedDepth) {
fRequestedDepth = requestedDepth;
@@ -261,12 +279,13 @@ protected:
G4bool fUseFullExtent; // ...if requested.
G4int fCurrentDepth; // Current depth of geom. hierarchy.
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
G4int fCurrentPVCopyNo; // Current copy number.
G4LogicalVolume* fpCurrentLV; // Current logical volume.
G4Material* fpCurrentMaterial; // Current material.
G4Transform3D* fpCurrentTransform; // Current transform.
std::vector<G4PhysicalVolumeNodeID> fBaseFullPVPath;
std::vector<G4PhysicalVolumeNodeID> fFullPVPath;
std::vector<G4PhysicalVolumeNodeID> fDrawnPVPath;
std::vector<G4PhysicalVolumeNodeID> fBaseFullPVPath; // Base. May be empty.
std::vector<G4PhysicalVolumeNodeID> fFullPVPath; // Starts from base.
std::vector<G4PhysicalVolumeNodeID> fDrawnPVPath; // Omits culled volumes.
mutable G4bool fAbort; // Abort all further traversing.
mutable G4bool fCurtailDescent;// Can be set to curtail descent.
G4VSolid* fpClippingSolid;
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeSearchScene.hh 81056 2014-05-20 09:02:16Z gcosmo $
//
//
// John Allison 10th August 1998.
@@ -73,7 +72,6 @@ private:
fFoundFullPVPath; // Found full path.
G4int fFoundDepth; // Found depth.
G4VPhysicalVolume* fpFoundPV; // Found physical volume.
G4LogicalVolume* fpFoundLV; // Found logical volume.
G4Transform3D fFoundObjectTransformation; // Found transformation.
G4int fVerbosity;
G4bool fMultipleOccurrence;
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 5th September 2018, based on G4PhysicalVolumeSearchScene
// An artificial scene to find physical volumes. Instead of returning the
// first occurence (G4PhysicalVolumeSearchScene) this class (note the extra
// 's' in the name of this class) returns a vector of all occurences.
// It can match a physical volume name with the required match. The latter can
// be of the form "/regexp/", where regexp is a regular expression (see C++
// regex), or a plain string, in which case there must be an exact match.
#ifndef G4PHYSICALVOLUMESSEARCHSCENE_HH
#define G4PHYSICALVOLUMESSEARCHSCENE_HH
#include "G4PseudoScene.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PhysicalVolumeModel.hh"
class G4PhysicalVolumesSearchScene: public G4PseudoScene
{
public:
G4PhysicalVolumesSearchScene
(G4PhysicalVolumeModel* pSearchVolumeModel, // usually a world
const G4String& requiredPhysicalVolumeName,
G4int requiredCopyNo = -1); // -1 means any copy no
virtual ~G4PhysicalVolumesSearchScene () {}
struct Findings
{
Findings
(G4VPhysicalVolume* pSearchPV,
G4VPhysicalVolume* pFoundPV,
G4int foundPVCopyNo = 0,
G4int foundDepth = 0,
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
foundBasePVPath =
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>(),
G4Transform3D foundObjectTransformation = G4Transform3D())
: fpSearchPV(pSearchPV)
, fpFoundPV(pFoundPV)
, fFoundPVCopyNo(foundPVCopyNo)
, fFoundDepth(foundDepth)
, fFoundBasePVPath(foundBasePVPath)
, fFoundObjectTransformation(foundObjectTransformation) {}
G4VPhysicalVolume* fpSearchPV; // Searched physical volume.
G4VPhysicalVolume* fpFoundPV; // Found physical volume.
G4int fFoundPVCopyNo; // Found Copy number.
G4int fFoundDepth; // Found depth.
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
fFoundBasePVPath; // Base path (e.g., empty for world volume)
G4Transform3D fFoundObjectTransformation; // Found transformation.
};
const std::vector<Findings>& GetFindings() const
{return fFindings;}
private:
class Matcher {
public:
Matcher(const G4String& requiredMatch);
G4bool Match(const G4String&);
// Match the string with the required match. The latter can be of the form
// "/regexp/", where regexp is a regular expression (see C++ regex),
// or a plain string, in which case there must be an exact match.
private:
G4bool fRegexFlag; // True if fRequiredMatch is of the form "/.../".
G4String fRequiredMatch;
};
void ProcessVolume(const G4VSolid&);
const G4PhysicalVolumeModel* fpSearchVolumesModel;
Matcher fMatcher;
G4int fRequiredCopyNo;
std::vector<Findings> fFindings;
};
#endif
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PseudoScene.hh 66773 2013-01-12 14:48:08Z allison $
//
//
// John Allison 15th May 2014
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ScaleModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 21st July 2001.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4TextModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 3rd April 2001
@@ -24,43 +24,42 @@
// ********************************************************************
//
//
// $Id: G4TouchableDumpScene.hh 66773 2013-01-12 14:48:08Z allison $
//
//
// John Allison 10th August 1998.
// An artificial scene to find physical volumes.
//
// John Allison 22nd August 2018.
// An artificial scene to find the properties of a touchable.
#ifndef G4TOUCHABLEDUMPSCENE_HH
#define G4TOUCHABLEDUMPSCENE_HH
#ifndef G4TOUCHABLEPROPERTIESSCENE_HH
#define G4TOUCHABLEPROPERTIESSCENE_HH
#include "G4PseudoScene.hh"
#include "G4VisExtent.hh"
#include "G4ModelingParameters.hh"
#include "G4Transform3D.hh"
#include "G4PhysicalVolumeModel.hh"
#include <iostream>
class G4TouchableDumpScene: public G4PseudoScene {
class G4TouchablePropertiesScene: public G4PseudoScene {
public:
G4TouchableDumpScene
(std::ostream& os,
G4PhysicalVolumeModel* pPVModel,
G4TouchablePropertiesScene
(G4PhysicalVolumeModel* pSearchPVModel,
const G4ModelingParameters::PVNameCopyNoPath& requiredTouchable);
virtual ~G4TouchableDumpScene ();
virtual ~G4TouchablePropertiesScene ();
G4bool IsFound() {return fFound;}
const G4PhysicalVolumeModel::TouchableProperties&
GetFoundTouchableProperties() const
{return fFoundTouchableProperties;}
private:
void ProcessVolume(const G4VSolid&);
std::ostream& fos;
const G4PhysicalVolumeModel* fpPVModel;
const G4PhysicalVolumeModel* fpSearchPVModel;
G4ModelingParameters::PVNameCopyNoPath fRequiredTouchable;
G4bool fFound;
G4PhysicalVolumeModel::TouchableProperties fFoundTouchableProperties;
};
#endif
@@ -0,0 +1,41 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 22nd August 2018
// Touchable utilities
#include "G4ModelingParameters.hh"
#include "G4PhysicalVolumeModel.hh"
namespace G4TouchableUtils {
G4PhysicalVolumeModel::TouchableProperties FindTouchableProperties
(G4ModelingParameters::PVNameCopyNoPath path);
// If the search is not successful properties.fpTouchablePV will be null.
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4TrajectoriesModel.hh 78838 2014-01-28 08:46:17Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryChargeFilter.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Filter trajectories according to charge. Only registered
// charges will pass the filter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByAttribute.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay September 2006
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByCharge.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByEncounteredVolume.hh 66264 2012-12-14 10:17:44Z allison $
//
// Class Description:
// Trajectory model which colours a trajectory according to
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByOriginVolume.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Class Description:
// Trajectory model which colours a trajectory according to
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByParticleID.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawerUtils.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryEncounteredVolumeFilter.hh 66264 2012-12-14 10:17:44Z allison $
//
// Filter trajectories according to encountered volume name. Only registered
// volumes will pass the filter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4TrajectoryFilterFactories.hh 98766 2016-08-09 14:17:17Z gcosmo $
//
//
// Trajectory filter model factories creating filters
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryGenericDrawer.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryModelFactories.hh 98766 2016-08-09 14:17:17Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryOriginVolumeFilter.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Filter trajectories according to volume name. Only registered
// volumes will pass the filter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryParticleFilter.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Filter trajectories according to particle type. Only registered
// particle types will pass the filter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VAttValueFilter.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Abstract base class for G4AttValue filters
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VModel.icc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VModelCommand.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VModelFactory.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VTrajectoryModel.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VisTrajContext.hh 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay May 2006
//
@@ -54,6 +53,9 @@ public:
void SetLineColour(const G4Colour& colour);
G4Colour GetLineColour() const;
void SetLineWidth(const G4double& width);
G4double GetLineWidth() const;
void SetDrawLine(const G4bool& draw);
G4bool GetDrawLine() const;
@@ -113,6 +115,7 @@ private:
G4String fName;
// Line data
G4double fLineWidth;
G4Colour fLineColour;
G4bool fLineVisible;
G4bool fDrawLine;
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VisTrajContext.icc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay May 2006
//
@@ -40,6 +39,9 @@ inline void G4VisTrajContext::SetVisible(const G4bool& visible)
}
// Line
inline void G4VisTrajContext::SetLineWidth(const G4double& width) {fLineWidth = width;}
inline G4double G4VisTrajContext::GetLineWidth() const {return fLineWidth;}
inline void G4VisTrajContext::SetLineColour(const G4Colour& colour) {fLineColour = colour;}
inline G4Colour G4VisTrajContext::GetLineColour() const {return fLineColour;}
+6 -3
View File
@@ -11,7 +11,6 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 103926 2017-05-03 13:43:27Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -77,10 +76,12 @@ GEANT4_DEFINE_MODULE(NAME G4modeling
G4PhysicalVolumeMassScene.hh
G4PhysicalVolumeModel.hh
G4PhysicalVolumeSearchScene.hh
G4PhysicalVolumesSearchScene.hh
G4PseudoScene.hh
G4ScaleModel.hh
G4TextModel.hh
G4TouchableDumpScene.hh
G4TouchablePropertiesScene.hh
G4TouchableUtils.hh
G4TrajectoriesModel.hh
G4TrajectoryChargeFilter.hh
G4TrajectoryDrawByAttribute.hh
@@ -121,9 +122,11 @@ GEANT4_DEFINE_MODULE(NAME G4modeling
G4PhysicalVolumeMassScene.cc
G4PhysicalVolumeModel.cc
G4PhysicalVolumeSearchScene.cc
G4PhysicalVolumesSearchScene.cc
G4ScaleModel.cc
G4TextModel.cc
G4TouchableDumpScene.cc
G4TouchablePropertiesScene.cc
G4TouchableUtils.cc
G4TrajectoriesModel.cc
G4TrajectoryChargeFilter.cc
G4TrajectoryDrawByAttribute.cc
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ArrowModel.cc 100807 2016-11-02 15:00:41Z gcosmo $
//
//
// John Allison 15th July 2012
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AttFilterUtils.cc 66870 2013-01-14 23:38:59Z adotti $
//
// Visualisation attribute filter utility functions.
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4AxesModel.cc 83403 2014-08-21 15:07:30Z gcosmo $
//
//
// John Allison 3rd April 2001
@@ -86,7 +85,7 @@ G4AxesModel::G4AxesModel
<< "\" not found. Defaulting to white and opaque.";
G4Exception
("G4AxesModel::G4AxesModel",
"modeling0012", JustWarning, ed);
"modeling0011", JustWarning, ed);
}
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4BoundingSphereScene.cc 81056 2014-05-20 09:02:16Z gcosmo $
//
//
// John Allison 7th June 1997
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4DigiFilterFactories.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Digi filter model factories creating filters
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4DigiModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4GPSModel.cc 100959 2016-11-03 14:13:37Z allison $
//
//
// John Allison 26th April 2017.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4HitFilterFactories.cc 68043 2013-03-13 14:27:49Z gcosmo $
//
//
// Hits filter model factories creating filters
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4HitsModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4LogicalVolumeModel.cc 110480 2018-05-25 07:25:18Z gcosmo $
//
//
// John Allison 26th July 1999.
@@ -40,6 +39,10 @@
#include "G4DrawVoxels.hh"
#include "G4VSensitiveDetector.hh"
#include "G4VReadOutGeometry.hh"
#include "G4Circle.hh"
#include <vector>
#include <utility>
G4LogicalVolumeModel::G4LogicalVolumeModel
(G4LogicalVolume* pLV,
@@ -72,7 +75,8 @@ G4LogicalVolumeModel::G4LogicalVolumeModel
fBooleans (booleans),
fVoxels (voxels),
fReadout (readout),
fCheckOverlaps(checkOverlaps)
fCheckOverlaps(checkOverlaps),
fOverlapsPrinted(false)
{
fType = "G4LogicalVolumeModel";
fGlobalTag = fpLV -> GetName ();
@@ -81,6 +85,66 @@ G4LogicalVolumeModel::G4LogicalVolumeModel
G4LogicalVolumeModel::~G4LogicalVolumeModel () {}
namespace {
// Keep a vector of solid-transform pairs to avoid duplication.
typedef std::pair<G4VSolid*,G4Transform3D> solidTransformPair;
std::vector<solidTransformPair> solidTransformVector;
void drawSolidsAndPoint
(G4VGraphicsScene& sceneHandler,
const G4ThreeVector& point,
G4VSolid* sol1, const G4Transform3D& t1,
G4VSolid* sol2, const G4Transform3D& t2)
{
const G4Colour highlightSolidColour(1.0,0.8,0.8);
const G4double highlightSolidLineWidth(10./*pixels*/);
const G4Colour highlightPointColour(0.5,0.5,1.0);
const G4double highlightPointDiameter(20./*pixels*/);
// Draw first solid. Avoid duplication.
std::pair<G4VSolid*,G4Transform3D> pair1(sol1,t1);
auto iter1 = solidTransformVector.begin();
for ( ; iter1 != solidTransformVector.end(); ++iter1) {
if (iter1->first == pair1.first &&
iter1->second == pair1.second) break;
}
if (iter1 == solidTransformVector.end()) {
solidTransformVector.push_back(pair1);
G4VisAttributes highlightSolidVisAtts(highlightSolidColour);
highlightSolidVisAtts.SetLineWidth(highlightSolidLineWidth);
sceneHandler.PreAddSolid(t1,highlightSolidVisAtts);
sceneHandler.AddSolid(*sol1);
sceneHandler.PostAddSolid();
}
// Draw second solid. Avoid duplication.
std::pair<G4VSolid*,G4Transform3D> pair2(sol2,t2);
auto iter2 = solidTransformVector.begin();
for ( ; iter2 != solidTransformVector.end(); ++iter2) {
if (iter2->first == pair2.first &&
iter2->second == pair2.second) break;
}
if (iter2 == solidTransformVector.end()) {
solidTransformVector.push_back(pair2);
G4VisAttributes highlightSolidVisAtts(highlightSolidColour);
highlightSolidVisAtts.SetLineWidth(highlightSolidLineWidth);
sceneHandler.PreAddSolid(t2,highlightSolidVisAtts);
sceneHandler.AddSolid(*sol2);
sceneHandler.PostAddSolid();
}
// Draw points. Draw them all.
G4VisAttributes highlightPointVisAtts(highlightPointColour);
G4Circle overlapPoint;
overlapPoint.SetVisAttributes(highlightPointVisAtts);
overlapPoint.SetPosition(point);
overlapPoint.SetDiameter(G4VMarker::SizeType::screen,highlightPointDiameter);
overlapPoint.SetFillStyle(G4VMarker::FillStyle::filled);
sceneHandler.BeginPrimitives();
sceneHandler.AddPrimitive(overlapPoint);
sceneHandler.EndPrimitives();
}
}
void G4LogicalVolumeModel::DescribeYourselfTo
(G4VGraphicsScene& sceneHandler) {
@@ -129,11 +193,55 @@ void G4LogicalVolumeModel::DescribeYourselfTo
}
if (fCheckOverlaps) {
G4LogicalVolume* lv = fpTopPV->GetLogicalVolume();
G4int nSisters = lv->GetNoDaughters();
for (G4int iSister = 0; iSister < nSisters; ++iSister) {
G4PVPlacement* placement = dynamic_cast<G4PVPlacement*>(lv->GetDaughter(iSister));
if (placement) placement->CheckOverlaps();
G4LogicalVolume* motherLog = fpTopPV->GetLogicalVolume();
G4VSolid* motherSolid = motherLog->GetSolid();
G4int nDaughters = motherLog->GetNoDaughters();
// Models are called repeatedly by the scene handler so be careful...
// Print overlaps - but only the first time for a given instantiation of G4LogicalVolume
if (!fOverlapsPrinted) {
for (G4int iDaughter = 0; iDaughter < nDaughters; ++iDaughter) {
G4VPhysicalVolume* daughterPhys = motherLog->GetDaughter(iDaughter);
daughterPhys->CheckOverlaps();
}
fOverlapsPrinted = true;
}
// Draw overlaps. This algorithm is based on G4PVPlacement::CheckOverlaps.
solidTransformVector.clear();
for (G4int iDaughter = 0; iDaughter < nDaughters; ++iDaughter) {
G4VPhysicalVolume* daughterPhys = motherLog->GetDaughter(iDaughter);
// Replicas and paramaterisations not presently processed
if (!dynamic_cast<G4PVPlacement*>(daughterPhys)) continue;
G4AffineTransform tDaughter(daughterPhys->GetRotation(),daughterPhys->GetTranslation());
G4VSolid* daughterSolid = daughterPhys->GetLogicalVolume()->GetSolid();
const G4int nTrials = 1000;
for (G4int i = 0; i < nTrials; ++i) {
G4ThreeVector p = daughterSolid->GetPointOnSurface();
// Transform to mother's coordinate system
G4ThreeVector pMother = tDaughter.TransformPoint(p);
// Check overlaps with the mother volume
if (motherSolid->Inside(pMother)==kOutside) {
// Draw mother and daughter and point
drawSolidsAndPoint
(sceneHandler,pMother,motherSolid,G4Transform3D(),daughterSolid,tDaughter);
}
// Check other daughters
for (G4int iSister = 0; iSister < nDaughters; ++iSister) {
if (iSister == iDaughter) continue;
G4VPhysicalVolume* sisterPhys = motherLog->GetDaughter(iSister);
G4AffineTransform tSister(sisterPhys->GetRotation(),sisterPhys->GetTranslation());
// Transform to sister's coordinate system
G4ThreeVector pSister = tSister.InverseTransformPoint(pMother);
G4LogicalVolume* sisterLog = sisterPhys->GetLogicalVolume();
G4VSolid* sisterSolid = sisterLog->GetSolid();
if (sisterSolid->Inside(pSister)==kInside) {
// Draw daughter and sister and point
drawSolidsAndPoint
(sceneHandler,pMother,daughterSolid,tDaughter,sisterSolid,tSister);
}
}
}
}
}
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MagneticFieldModel.cc 101958 2016-12-12 08:04:35Z gcosmo $
//
//
// John Allison 17th August 2013
@@ -62,6 +61,11 @@ G4MagneticFieldModel::G4MagneticFieldModel
std::ostringstream oss;
oss << ':' << fNDataPointsPerMaxHalfScene
<< ':' << fArrow3DLineSegmentsPerCircle;
if (fRepresentation == Representation::fullArrow) {
oss << " full arrow";
} else if (fRepresentation == Representation::lightArrow) {
oss << " light arrow";
}
fGlobalDescription = fType + oss.str();
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ModelingParameters.cc 109510 2018-04-26 07:15:57Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -90,25 +89,25 @@ G4ModelingParameters::~G4ModelingParameters ()
delete fpCutawaySolid;
}
G4ModelingParameters::VisAttributesModifier::VisAttributesModifier
(const G4VisAttributes& visAtts,
G4ModelingParameters::VisAttributesSignifier signifier,
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path):
fVisAtts(visAtts), fSignifier(signifier)
{
typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
typedef std::vector<PVNodeID> PVPath;
typedef PVPath::const_iterator PVPathConstIterator;
PVPathConstIterator i;
for (i = path.begin();
i != path.end();
++i) {
fPVNameCopyNoPath.push_back
(PVNameCopyNo
(i->GetPhysicalVolume()->GetName(),
i->GetCopyNo()));
}
}
//G4ModelingParameters::VisAttributesModifier::VisAttributesModifier
//(const G4VisAttributes& visAtts,
// G4ModelingParameters::VisAttributesSignifier signifier,
// const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path):
//fVisAtts(visAtts), fSignifier(signifier)
//{
// typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
// typedef std::vector<PVNodeID> PVPath;
// typedef PVPath::const_iterator PVPathConstIterator;
// PVPathConstIterator i;
// for (i = path.begin();
// i != path.end();
// ++i) {
// fPVNameCopyNoPath.push_back
// (PVNameCopyNo
// (i->GetPhysicalVolume()->GetName(),
// i->GetCopyNo()));
// }
//}
void G4ModelingParameters::SetVisibleDensity (G4double visibleDensity) {
const G4double reasonableMaximum = 10.0 * g / cm3;
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4NullModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 4th April 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PSHitsModel.cc 99152 2016-09-07 08:04:30Z gcosmo $
//
//
// Created: Mar. 31, 2009 Akinori Kimura
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeMassScene.cc 108859 2018-03-12 07:44:53Z gcosmo $
//
//
// John Allison 10th August 1998.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeModel.cc 110743 2018-06-12 06:33:37Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -32,7 +31,6 @@
#include "G4PhysicalVolumeModel.hh"
#include "G4ModelingParameters.hh"
#include "G4VGraphicsScene.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VPVParameterisation.hh"
@@ -54,23 +52,27 @@
#include "G4Vector3D.hh"
#include <sstream>
#include <iomanip>
G4PhysicalVolumeModel::G4PhysicalVolumeModel
(G4VPhysicalVolume* pVPV
(G4VPhysicalVolume* pVPV
, G4int requestedDepth
, const G4Transform3D& modelTransformation
, const G4Transform3D& modelTransformation
, const G4ModelingParameters* pMP
, G4bool useFullExtent)
: G4VModel (modelTransformation, pMP)
, G4bool useFullExtent
, const std::vector<G4PhysicalVolumeNodeID>& baseFullPVPath)
: G4VModel (modelTransformation,pMP)
, fpTopPV (pVPV)
, fTopPVCopyNo (0)
, fRequestedDepth (requestedDepth)
, fUseFullExtent (useFullExtent)
, fCurrentDepth (0)
, fpCurrentPV (0)
, fpCurrentLV (0)
, fpCurrentMaterial (0)
, fpCurrentTransform (0)
, fpCurrentPV (fpTopPV)
, fCurrentPVCopyNo (fpTopPV? fpTopPV->GetCopyNo(): 0)
, fpCurrentLV (fpTopPV? fpTopPV->GetLogicalVolume(): 0)
, fpCurrentMaterial (fpCurrentLV? fpCurrentLV->GetMaterial(): 0)
, fpCurrentTransform (const_cast<G4Transform3D*>(&modelTransformation))
, fBaseFullPVPath (baseFullPVPath)
, fAbort (false)
, fCurtailDescent (false)
, fpClippingSolid (0)
@@ -96,17 +98,11 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
} else {
fTopPVName = fpTopPV -> GetName ();
fTopPVCopyNo = fpTopPV -> GetCopyNo ();
std::ostringstream o;
o << fpTopPV -> GetCopyNo ();
fGlobalTag = fpTopPV -> GetName () + "." + o.str();
std::ostringstream oss;
oss << fpTopPV->GetName() << ':' << fpTopPV->GetCopyNo()
<< " BasePath:" << fBaseFullPVPath;
fGlobalTag = oss.str();
fGlobalDescription = "G4PhysicalVolumeModel " + fGlobalTag;
fpCurrentPV = fpTopPV;
if (fpCurrentPV) fpCurrentLV = fpCurrentPV->GetLogicalVolume();
if (fpCurrentLV) fpCurrentMaterial = fpCurrentLV->GetMaterial();
fpCurrentTransform = const_cast<G4Transform3D*>(&modelTransformation);
CalculateExtent ();
}
}
@@ -116,6 +112,18 @@ G4PhysicalVolumeModel::~G4PhysicalVolumeModel ()
delete fpClippingSolid;
}
G4ModelingParameters::PVNameCopyNoPath G4PhysicalVolumeModel::GetPVNameCopyNoPath
(const std::vector<G4PhysicalVolumeNodeID>& path)
{
G4ModelingParameters::PVNameCopyNoPath PVNameCopyNoPath;
for (const auto& node: path) {
PVNameCopyNoPath.push_back
(G4ModelingParameters::PVNameCopyNo
(node.GetPhysicalVolume()->GetName(),node.GetCopyNo()));
}
return PVNameCopyNoPath;
}
void G4PhysicalVolumeModel::CalculateExtent ()
{
if (fUseFullExtent) {
@@ -166,9 +174,6 @@ void G4PhysicalVolumeModel::DescribeYourselfTo
("G4PhysicalVolumeModel::DescribeYourselfTo",
"modeling0003", FatalException, "No modeling parameters.");
// For safety...
fCurrentDepth = 0;
G4Transform3D startingTransformation = fTransform;
VisitGeometryAndGetVisReps
@@ -177,23 +182,16 @@ void G4PhysicalVolumeModel::DescribeYourselfTo
startingTransformation,
sceneHandler);
// Clear data...
// Reset or clear data...
fCurrentDepth = 0;
fpCurrentPV = 0;
fpCurrentLV = 0;
fpCurrentMaterial = 0;
if (fFullPVPath.size() != fBaseFullPVPath.size()) {
// They should be equal if pushing and popping is happening properly.
G4Exception
("G4PhysicalVolumeModel::DescribeYourselfTo",
"modeling0013",
FatalException,
"Path at start of modeling not equal to base path. Something badly"
"\nwrong. Please contact visualisation coordinator.");
}
fpCurrentPV = fpTopPV;
fCurrentPVCopyNo = fpTopPV->GetCopyNo();
fpCurrentLV = fpTopPV->GetLogicalVolume();
fpCurrentMaterial = fpCurrentLV? fpCurrentLV->GetMaterial(): 0;
fFullPVPath = fBaseFullPVPath;
fDrawnPVPath.clear();
fAbort = false;
fCurtailDescent = false;
fAbort = false;
fCurtailDescent = false;
}
G4String G4PhysicalVolumeModel::GetCurrentTag () const
@@ -255,6 +253,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
pP -> ComputeTransformation (n, pVPV);
pSol -> ComputeDimensions (pP, n, pVPV);
pVPV -> SetCopyNo (n);
fCurrentPVCopyNo = n;
// Create a touchable of current parent for ComputeMaterial.
// fFullPVPath has not been updated yet so at this point it
// corresponds to the parent.
@@ -338,6 +337,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
pVPV -> SetTranslation (translation);
pVPV -> SetRotation (pRotation);
pVPV -> SetCopyNo (n);
fCurrentPVCopyNo = n;
if (visualisable) {
DescribeAndDescend (pVPV, requestedDepth, pLV, pSol, pMaterial,
theAT, sceneHandler);
@@ -365,6 +365,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
{
// Maintain useful data members...
fpCurrentPV = pVPV;
fCurrentPVCopyNo = pVPV->GetCopyNo();
fpCurrentLV = pLV;
fpCurrentMaterial = pMaterial;
@@ -801,7 +802,9 @@ const std::map<G4String,G4AttDef>* G4PhysicalVolumeModel::GetAttDefs() const
= G4AttDefStore::GetInstance("G4PhysicalVolumeModel", isNew);
if (isNew) {
(*store)["PVPath"] =
G4AttDef("PVPath","Physical Volume Path","Physics","","G4String");
G4AttDef("PVPath","Physical Volume Path","Physics","","G4String");
(*store)["BasePVPath"] =
G4AttDef("BasePVPath","Base Physical Volume Path","Physics","","G4String");
(*store)["LVol"] =
G4AttDef("LVol","Logical Volume","Physics","","G4String");
(*store)["Solid"] =
@@ -830,8 +833,6 @@ const std::map<G4String,G4AttDef>* G4PhysicalVolumeModel::GetAttDefs() const
return store;
}
#include <iomanip>
static std::ostream& operator<< (std::ostream& o, const G4Transform3D t)
{
using namespace std;
@@ -874,12 +875,6 @@ static std::ostream& operator<< (std::ostream& o, const G4Transform3D t)
std::vector<G4AttValue>* G4PhysicalVolumeModel::CreateCurrentAttValues() const
{
std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
std::ostringstream oss;
for (size_t i = 0; i < fFullPVPath.size(); ++i) {
oss << fFullPVPath[i].GetPhysicalVolume()->GetName()
<< ':' << fFullPVPath[i].GetCopyNo();
if (i != fFullPVPath.size() - 1) oss << '/';
}
if (!fpCurrentLV) {
G4Exception
@@ -890,7 +885,10 @@ std::vector<G4AttValue>* G4PhysicalVolumeModel::CreateCurrentAttValues() const
return values;
}
std::ostringstream oss; oss << fFullPVPath;
values->push_back(G4AttValue("PVPath", oss.str(),""));
oss.str(""); oss << fBaseFullPVPath;
values->push_back(G4AttValue("BasePVPath", oss.str(),""));
values->push_back(G4AttValue("LVol", fpCurrentLV->GetName(),""));
G4VSolid* pSol = fpCurrentLV->GetSolid();
values->push_back(G4AttValue("Solid", pSol->GetName(),""));
@@ -954,8 +952,12 @@ std::ostream& operator<<
std::ostream& operator<<
(std::ostream& os, const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path)
{
for (const auto& nodeID: path) {
os << nodeID << ' ';
if (path.empty()) {
os << " NULL PATH";
} else {
for (const auto& nodeID: path) {
os << ' ' << nodeID;
}
}
return os;
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeSearchScene.cc 91686 2015-07-31 09:40:08Z gcosmo $
//
//
// John Allison 10th August 1998.
@@ -46,7 +45,6 @@ G4PhysicalVolumeSearchScene::G4PhysicalVolumeSearchScene
fRequiredCopyNo (requiredCopyNo),
fFoundDepth (0),
fpFoundPV (0),
fpFoundLV (0),
fVerbosity (verbosity),
fMultipleOccurrence (false)
{}
@@ -71,11 +69,7 @@ void G4PhysicalVolumeSearchScene::ProcessVolume (const G4VSolid&) {
typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
typedef std::vector<PVNodeID> PVPath;
const PVPath& fullPVPath = fpPVModel->GetFullPVPath();
G4int currentDepth = fpPVModel->GetCurrentDepth();
G4LogicalVolume* pCurrentLV = fpPVModel->GetCurrentLV();
//G4Material* pCurrentMaterial = fpPVModel->GetCurrentMaterial();
// Note: pCurrentMaterial may be zero (parallel world).
G4int currentDepth = fpPVModel->GetCurrentDepth();
if ((fRequiredCopyNo < 0 || // I.e., ignore negative request.
fRequiredCopyNo == pCurrentPV -> GetCopyNo ())) {
// Current policy - take first one found!!
@@ -83,7 +77,6 @@ void G4PhysicalVolumeSearchScene::ProcessVolume (const G4VSolid&) {
fFoundFullPVPath = fullPVPath;
fFoundDepth = currentDepth;
fpFoundPV = pCurrentPV;
fpFoundLV = pCurrentLV;
fFoundObjectTransformation = *fpCurrentObjectTransformation;
}
else {
@@ -0,0 +1,115 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 5th September 2018, based on G4PhysicalVolumeSearchScene
// An artificial scene to find physical volumes. Instead of returning the
// first occurence (G4PhysicalVolumeSearchScene) this class (note the extra
// 's' in the name of this class) returns a vector of all occurences.
#include "G4PhysicalVolumesSearchScene.hh"
#include <regex>
G4PhysicalVolumesSearchScene::G4PhysicalVolumesSearchScene
(G4PhysicalVolumeModel* pSearchVolumesModel, // usually a world
const G4String& requiredPhysicalVolumeName,
G4int requiredCopyNo)
: fpSearchVolumesModel (pSearchVolumesModel)
, fMatcher (requiredPhysicalVolumeName)
, fRequiredCopyNo (requiredCopyNo)
{}
void G4PhysicalVolumesSearchScene::ProcessVolume (const G4VSolid&)
{
G4VPhysicalVolume* pCurrentPV = fpSearchVolumesModel->GetCurrentPV();
const G4String& name = pCurrentPV->GetName();
G4int copyNo = fpSearchVolumesModel->GetCurrentPVCopyNo();
// Match the name with the required physical volume name. The latter can be of
// the form "/regexp/", where regexp is a regular expression (see C++ regex),
// or a plain name, in which case there must be an exact match.
if (fMatcher.Match(name)) {
if ((fRequiredCopyNo < 0 || // I.e., ignore negative request
fRequiredCopyNo == copyNo)) {
auto path = fpSearchVolumesModel->GetFullPVPath();
path.pop_back(); // Base node is one up from found node
fFindings.push_back
(Findings
(fpSearchVolumesModel->GetTopPhysicalVolume(),
pCurrentPV,
copyNo,
fpSearchVolumesModel->GetCurrentDepth(),
path,
*fpCurrentObjectTransformation));
}
}
}
G4PhysicalVolumesSearchScene::Matcher::Matcher(const G4String& requiredMatch)
: fRegexFlag(false)
{
if (requiredMatch.size()) {
size_t last = requiredMatch.size() - 1;
// If required name begins and ends with '/', treat as a regular expression.
// 0 causes a conversion ambiguity that upsets the Windows compiler, so use 0U.
if (requiredMatch[0U] == '/' && requiredMatch[last] == '/') {
if (last > 1) { // Non-null regexp
// regex match required
fRegexFlag = true;
// Extract the required regex
fRequiredMatch = requiredMatch.substr(1,last-1);
}
} else {
// Exact match required
fRequiredMatch = requiredMatch;
}
}
if (fRequiredMatch.isNull()) {
G4Exception
("G4PhysicalVolumesSearchScene::Matcher::Matcher",
"modeling0013", JustWarning, "Required match is null");
}
}
G4bool G4PhysicalVolumesSearchScene::Matcher::Match(const G4String& s)
// Match the string with the required match. The latter can be of the form
// "/regexp/", where regexp is a regular expression (see C++ regex),
// or a plain string, in which case there must be an exact match.
{
G4bool found = false;
if (fRequiredMatch.size()) {
if (fRegexFlag) { // Use extracted regex
std::regex requiredRegex(fRequiredMatch);
std::cmatch match;
std::regex_search(s.c_str(), match, requiredRegex);
if (match.size() > 0) found = true;
} else { // Require complete match
if (s == fRequiredMatch) found = true;
}
}
return found;
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ScaleModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 21st July 2001.
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4TextModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 3rd April 2001
@@ -24,54 +24,36 @@
// ********************************************************************
//
//
// $Id: G4TouchableDumpScene.cc 66773 2013-01-12 14:48:08Z allison $
//
//
// John Allison 15th May 2014.
// An artificial scene to dump touchable attributes.
//
// John Allison 22nd August 2018.
// An artificial scene to find the properties of a touchable.
#include "G4TouchableDumpScene.hh"
#include "G4TouchablePropertiesScene.hh"
#include "G4VSolid.hh"
#include "G4Vector3D.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PhysicalVolumeModel.hh"
//#include "G4PhysicalVolumeModel.hh"
#include "G4AttValue.hh"
#include "G4AttCheck.hh"
G4TouchableDumpScene::G4TouchableDumpScene
(std::ostream& os,
G4PhysicalVolumeModel* pPVModel,
G4TouchablePropertiesScene::G4TouchablePropertiesScene
(G4PhysicalVolumeModel* pSearchPVModel,
const G4ModelingParameters::PVNameCopyNoPath& requiredTouchable)
:fos(os)
,fpPVModel(pPVModel)
:fpSearchPVModel(pSearchPVModel)
,fRequiredTouchable(requiredTouchable)
,fFound(false)
{}
G4TouchableDumpScene::~G4TouchableDumpScene () {}
G4TouchablePropertiesScene::~G4TouchablePropertiesScene () {}
void G4TouchableDumpScene::ProcessVolume (const G4VSolid& solid) {
void G4TouchablePropertiesScene::ProcessVolume (const G4VSolid& /*solid*/) {
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>&
fullPVPath = fpPVModel->GetFullPVPath();
fullPVPath = fpSearchPVModel->GetFullPVPath();
if (fRequiredTouchable.size() == fullPVPath.size()) {
// OK - there's a size match. Check it out.
// G4cout << "Size match" << G4endl;
G4ModelingParameters::PVNameCopyNoPathConstIterator iNameCopyNo;
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>::const_iterator
iPVNodeId;
for (iNameCopyNo = fRequiredTouchable.begin(), iPVNodeId = fullPVPath.begin();
iNameCopyNo != fRequiredTouchable.end();
++iNameCopyNo, ++iPVNodeId) {
// G4cout
// << iNameCopyNo->GetName()
// << ',' << iNameCopyNo->GetCopyNo()
// << "; " << iPVNodeId->GetPhysicalVolume()->GetName()
// << ',' << iPVNodeId->GetPhysicalVolume()->GetCopyNo()
// << G4endl;
if (!(
iNameCopyNo->GetName() ==
iPVNodeId->GetPhysicalVolume()->GetName() &&
@@ -82,21 +64,13 @@ void G4TouchableDumpScene::ProcessVolume (const G4VSolid& solid) {
}
}
if (iNameCopyNo == fRequiredTouchable.end()) {
// G4cout << "Match found" << G4endl;
fFound = true;
const std::map<G4String,G4AttDef>* attDefs = fpPVModel->GetAttDefs();
std::vector<G4AttValue>* attValues = fpPVModel->CreateCurrentAttValues();
fos << G4AttCheck(attValues, attDefs);
delete attValues;
G4Polyhedron* polyhedron = solid.GetPolyhedron();
fos << "\nLocal polyhedron coordinates:\n" << *polyhedron;
G4Transform3D* transform = fpPVModel->GetCurrentTransform();
polyhedron->Transform(*transform);
fos << "\nGlobal polyhedron coordinates:\n" << *polyhedron;
fpPVModel->Abort(); // No need to look further.
fFoundTouchableProperties.fTouchablePath = fRequiredTouchable;
fFoundTouchableProperties.fpTouchablePV = fpSearchPVModel->GetCurrentPV();
fFoundTouchableProperties.fTouchableGlobalTransform = *fpSearchPVModel->GetCurrentTransform();
fFoundTouchableProperties.fTouchableBaseFullPVPath = fpSearchPVModel->GetFullPVPath();
// Base path is one down from found PV
fFoundTouchableProperties.fTouchableBaseFullPVPath.pop_back();
fpSearchPVModel->Abort(); // No need to look further.
}
}
}
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 22nd August 2018
// Touchable utilities
#include "G4TouchableUtils.hh"
#include "G4TouchablePropertiesScene.hh"
#include "G4TransportationManager.hh"
G4PhysicalVolumeModel::TouchableProperties G4TouchableUtils::FindTouchableProperties
(G4ModelingParameters::PVNameCopyNoPath path)
{
// If the search is not successful properties.fpTouchablePV will be null.
G4PhysicalVolumeModel::TouchableProperties properties;
G4TransportationManager* transportationManager =
G4TransportationManager::GetTransportationManager ();
size_t nWorlds = transportationManager->GetNoWorlds();
std::vector<G4VPhysicalVolume*>::iterator iterWorld =
transportationManager->GetWorldsIterator();
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
G4PhysicalVolumeModel pvModel (*iterWorld); // Unlimited depth.
G4ModelingParameters mp; // Default - no culling.
pvModel.SetModelingParameters (&mp);
G4TouchablePropertiesScene scene (&pvModel,path);
pvModel.DescribeYourselfTo (scene); // Initiate geometry tree traversal.
if (scene.GetFoundTouchableProperties().fpTouchablePV) {
properties = scene.GetFoundTouchableProperties();
break; // Found, so no need to scan more worlds.
}
}
return properties;
}
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4TrajectoriesModel.cc 98852 2016-08-15 07:03:35Z gcosmo $
//
//
// John Allison 26th August 1998.
@@ -53,7 +52,7 @@ G4TrajectoriesModel::G4TrajectoriesModel ()
,fEventID(-1)
{
fType = "G4TrajectoriesModel";
fGlobalTag = "G4TrajectoriesModel for all trajectories.";
fGlobalTag = "G4TrajectoriesModel for any type of trajectory";
fGlobalDescription = fGlobalTag;
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $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,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByAttribute.cc 78838 2014-01-28 08:46:17Z gcosmo $
//
// Jane Tinslay August 2006
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByCharge.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
#include "G4TrajectoryDrawByCharge.hh"
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByEncounteredVolume.cc 95107 2016-01-26 12:41:11Z allison $
//
// John Allison February 2016, based on
// G4TrajectoryDrawByVolume.hh Jane Tinslay March 2006
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByOriginVolume.cc 96316 2016-04-06 07:23:44Z gcosmo $
//
// Jane Tinslay March 2006
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawByParticleID.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryDrawerUtils.cc 107920 2017-12-13 08:06:00Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -218,6 +217,7 @@ namespace G4TrajectoryDrawerUtils {
if (myContext.GetDrawLine()) {
G4VisAttributes trajectoryLineAttribs(myContext.GetLineColour());
trajectoryLineAttribs.SetLineWidth(myContext.GetLineWidth());
trajectoryLineAttribs.SetVisibility(myContext.GetLineVisible());
trajectoryLine.SetVisAttributes(&trajectoryLineAttribs);
@@ -264,6 +264,7 @@ namespace G4TrajectoryDrawerUtils {
if (myContext.GetDrawLine()) {
G4VisAttributes trajectoryLineAttribs(myContext.GetLineColour());
trajectoryLineAttribs.SetLineWidth(myContext.GetLineWidth());
trajectoryLineAttribs.SetVisibility(myContext.GetLineVisible());
for (size_t i = 1; i < trajectoryLine.size(); ++i ) {
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryEncounteredVolumeFilter.cc 95107 2016-01-26 12:41:11Z allison $
//
// Filter trajectories according to encountered volume name. Only registered
// volumes will pass the filter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// $Id: G4TrajectoryFilterFactories.cc 98766 2016-08-09 14:17:17Z gcosmo $
//
//
// Trajectory filter model factories creating filters
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryGenericDrawer.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay May 2006
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryModelFactories.cc 98766 2016-08-09 14:17:17Z gcosmo $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TrajectoryOriginVolumeFilter.cc 95115 2016-01-26 16:33:29Z gcosmo $
//
// Filter trajectories according to volume name. Only registered
// volumes will pass the filter.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $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,6 @@
// ********************************************************************
//
//
// $Id: G4VModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// John Allison 31st December 1997.
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VTrajectoryModel.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// Jane Tinslay May 2006
//
@@ -28,6 +28,7 @@
// Default configuration
G4VisTrajContext::G4VisTrajContext(const G4String& name)
:fName(name)
,fLineWidth(1.)
,fLineColour(G4Colour::Grey())
,fLineVisible(true)
,fDrawLine(true)