Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History 101035 2016-11-04 08:48:17Z gcosmo $
|
||||
$Id: History 104164 2017-05-15 06:53:09Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,28 @@ committal in the CVS repository !
|
||||
History file for visualization/modeling
|
||||
---------------------------------------
|
||||
|
||||
14th May 2017 John Allison (modeling-V10-03-07)
|
||||
- G4GPSModel: Added user-selectable colour.
|
||||
|
||||
3rd May 2017 John Allison (modeling-V10-03-06)
|
||||
- Needs event-V10-03-01.
|
||||
- Completed G4GPSModel for visualisation of General Particle Source. Can
|
||||
be used with command /vis/scene/add/gps.
|
||||
|
||||
3rd May 2017 John Allison (modeling-V10-03-05)
|
||||
- Added prototype/skeleton G4GPSModel.
|
||||
- G4PhysicalVolumeModel::Validate:
|
||||
o Check world pointer (can be null if geometry has been cleared/destroyed).
|
||||
|
||||
19th April 2017 John Allison (modeling-V10-03-01)
|
||||
- Added G4ModelingParameters::PVPointerCopyNo.
|
||||
|
||||
9th December 2016 John Allison (modeling-V10-03-00)
|
||||
- Coworks with visman-V10-03-00.
|
||||
- G4MagneticFieldModel: Augmented to take lineSegmentsPerCircle.
|
||||
Default is 6 for rapid yet adequate drawing, but this my be changed
|
||||
with /vis/set/arrow3DLineSegmentsPerCircle.
|
||||
|
||||
3rd November 2016 John Allison (modeling-V10-02-17)
|
||||
- G4ModelingParameters and G4PhysicalVolumeModel:
|
||||
Changed default number of line segments per circle from 24 to 72.
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4GPSModel.hh 99642 2016-09-29 19:49:30Z allison $
|
||||
//
|
||||
//
|
||||
// John Allison 26th April 2017.
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// Model for a representation of the General Paricle Source.
|
||||
|
||||
#ifndef G4GPSMODEL_HH
|
||||
#define G4GPSMODEL_HH
|
||||
|
||||
#include "G4VModel.hh"
|
||||
|
||||
#include "G4String.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
class G4VGraphicsScene;
|
||||
|
||||
class G4GPSModel: public G4VModel {
|
||||
|
||||
public: // With description
|
||||
|
||||
G4GPSModel (const G4Colour& colour = G4Colour(1.,0.,0.,0.3));
|
||||
// Create with colour (default red and transparent).
|
||||
|
||||
virtual ~G4GPSModel ();
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene&);
|
||||
// The main task of a model is to describe itself to the graphics scene
|
||||
// handler (a object which inherits G4VSceneHandler, which inherits
|
||||
// G4VGraphicsScene).
|
||||
|
||||
G4String GetCurrentDescription () const;
|
||||
// A description which depends on the current state of the model.
|
||||
|
||||
G4String GetCurrentTag () const;
|
||||
// A tag which depends on the current state of the model.
|
||||
|
||||
protected:
|
||||
|
||||
G4Colour fColour;
|
||||
|
||||
private:
|
||||
// Private copy constructor and assigment operator - copying and
|
||||
// assignment not allowed. Keeps CodeWizard happy.
|
||||
G4GPSModel (const G4GPSModel&);
|
||||
G4GPSModel& operator = (const G4GPSModel&);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MagneticFieldModel.hh 93069 2015-10-02 09:54:27Z gcosmo $
|
||||
// $Id: G4MagneticFieldModel.hh 101958 2016-12-12 08:04:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 17th August 2013
|
||||
@@ -49,7 +49,8 @@ public: // With description
|
||||
|
||||
G4MagneticFieldModel
|
||||
(G4int nDataPointsPerHalfScene = 10,
|
||||
Representation representation = Representation::fullArrow);
|
||||
Representation representation = Representation::fullArrow,
|
||||
G4int arrow3DLineSegmentsPerCircle = 6);
|
||||
virtual ~G4MagneticFieldModel ();
|
||||
|
||||
virtual void DescribeYourselfTo (G4VGraphicsScene&);
|
||||
@@ -68,6 +69,7 @@ private:
|
||||
|
||||
Representation fRepresentation;
|
||||
|
||||
G4int fArrow3DLineSegmentsPerCircle;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.hh 99418 2016-09-21 09:18:42Z gcosmo $
|
||||
// $Id: G4ModelingParameters.hh 103627 2017-04-19 13:30:26Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "globals.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
|
||||
#include <vector>
|
||||
@@ -77,8 +78,14 @@ public: // With description
|
||||
|
||||
class PVNameCopyNo {
|
||||
public:
|
||||
PVNameCopyNo(G4String name, G4int copyNo):
|
||||
fName(name), fCopyNo(copyNo) {}
|
||||
// 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;
|
||||
@@ -87,10 +94,31 @@ public: // With description
|
||||
G4String fName;
|
||||
G4int fCopyNo;
|
||||
};
|
||||
|
||||
typedef std::vector<PVNameCopyNo> PVNameCopyNoPath;
|
||||
typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator;
|
||||
|
||||
class PVPointerCopyNo {
|
||||
public:
|
||||
// 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;}
|
||||
G4bool operator!=(const PVPointerCopyNo&) const;
|
||||
G4bool operator==(const PVPointerCopyNo& rhs) const {return !operator!=(rhs);}
|
||||
private:
|
||||
G4VPhysicalVolume* fpPV;
|
||||
G4int fCopyNo;
|
||||
};
|
||||
typedef std::vector<PVPointerCopyNo> PVPointerCopyNoPath;
|
||||
typedef PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator;
|
||||
|
||||
class VisAttributesModifier {
|
||||
public:
|
||||
VisAttributesModifier
|
||||
@@ -182,6 +210,9 @@ public: // With description
|
||||
friend std::ostream& operator <<
|
||||
(std::ostream& os, const PVNameCopyNoPath&);
|
||||
|
||||
friend std::ostream& operator <<
|
||||
(std::ostream& os, const PVPointerCopyNoPath&);
|
||||
|
||||
friend std::ostream& operator <<
|
||||
(std::ostream& os,
|
||||
const std::vector<VisAttributesModifier>&);
|
||||
@@ -212,6 +243,9 @@ std::ostream& operator <<
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath&);
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os,
|
||||
const std::vector<G4ModelingParameters::VisAttributesModifier>&);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake 99176 2016-09-07 09:46:36Z gcosmo $
|
||||
# $Id: sources.cmake 103926 2017-05-03 13:43:27Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -60,6 +60,7 @@ GEANT4_DEFINE_MODULE(NAME G4modeling
|
||||
G4CallbackModel.hh
|
||||
G4DigiFilterFactories.hh
|
||||
G4DigiModel.hh
|
||||
G4GPSModel.hh
|
||||
G4HitFilterFactories.hh
|
||||
G4HitsModel.hh
|
||||
G4LogicalVolumeModel.hh
|
||||
@@ -109,6 +110,7 @@ GEANT4_DEFINE_MODULE(NAME G4modeling
|
||||
G4BoundingSphereScene.cc
|
||||
G4DigiFilterFactories.cc
|
||||
G4DigiModel.cc
|
||||
G4GPSModel.cc
|
||||
G4HitFilterFactories.cc
|
||||
G4HitsModel.cc
|
||||
G4LogicalVolumeModel.cc
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4GPSModel.cc 100959 2016-11-03 14:13:37Z allison $
|
||||
//
|
||||
//
|
||||
// John Allison 26th April 2017.
|
||||
// Model for a representation of the General Paricle Source.
|
||||
|
||||
#include "G4GPSModel.hh"
|
||||
|
||||
#include "G4VGraphicsScene.hh"
|
||||
#include "G4GeneralParticleSourceData.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4GeometryTolerance.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4Circle.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4EllipticalTube.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4Ellipsoid.hh"
|
||||
#include "G4Para.hh"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
G4GPSModel::G4GPSModel (const G4Colour& colour)
|
||||
: fColour(colour)
|
||||
{
|
||||
fType = "G4GPSModel";
|
||||
std::ostringstream oss;
|
||||
oss << "G4GPSModel for General Particle Source " << fColour;
|
||||
fGlobalTag = oss.str();
|
||||
fGlobalDescription = fGlobalTag;
|
||||
}
|
||||
|
||||
G4GPSModel::~G4GPSModel () {}
|
||||
|
||||
G4String G4GPSModel::GetCurrentTag () const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
G4String G4GPSModel::GetCurrentDescription () const
|
||||
{
|
||||
return "G4GPSModel " + GetCurrentTag ();
|
||||
}
|
||||
|
||||
void G4GPSModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
// The main task of a model is to describe itself to the graphics scene
|
||||
// handler (a object which inherits G4VSceneHandler, which inherits
|
||||
// G4VGraphicsScene).
|
||||
{
|
||||
G4GeneralParticleSourceData* pGPSData = G4GeneralParticleSourceData::Instance();
|
||||
// Note: As far as I can see, if this is the first time Instance has been
|
||||
// called, it will, nevertheless, instantiate a default source, Type:"Point",
|
||||
// Shaep: "NULL", which will be drawn as a small circle at the origin of
|
||||
// coordinates whether you have set up GPS or not. Sorry, can't think of a
|
||||
// way to avoid that. Mostly, of course, you will only invoke this function,
|
||||
// if you have - or are about to - set up GPS, in which case all will be well.
|
||||
if (!pGPSData) return;
|
||||
|
||||
G4int nSources = pGPSData->GetSourceVectorSize();
|
||||
for (G4int iSource = 0; iSource < nSources; ++iSource) {
|
||||
|
||||
const G4SingleParticleSource* pCurrentSingleSource = pGPSData->GetCurrentSource(iSource);
|
||||
if (!pCurrentSingleSource) return;
|
||||
|
||||
const G4SPSPosDistribution* pSPSPosDistribution = pCurrentSingleSource->GetPosDist();
|
||||
if (!pSPSPosDistribution) return;
|
||||
|
||||
G4String Type = pSPSPosDistribution->GetPosDisType();
|
||||
G4String Shape = pSPSPosDistribution->GetPosDisShape();
|
||||
// Type can be: Point, Plane, Surface or Volume
|
||||
// Shape can be: Square, Circle, Ellipse, Rectangle,
|
||||
// Sphere, Ellipsoid, Cylinder, Parallelepiped
|
||||
// G4cout
|
||||
// << "G4GPSModel::DescribeYourselfTo"
|
||||
// << ": PosDisType: " << Type
|
||||
// << ", Shape: " << Shape
|
||||
// << G4endl;
|
||||
|
||||
const G4double& halfx = pSPSPosDistribution->GetHalfX();
|
||||
const G4double& halfy = pSPSPosDistribution->GetHalfY();
|
||||
const G4double& halfz = pSPSPosDistribution->GetHalfZ();
|
||||
const G4double& Radius = pSPSPosDistribution->GetRadius();
|
||||
const G4double& Radius0 = pSPSPosDistribution->GetRadius0();
|
||||
const G4double& ParAlpha = pSPSPosDistribution->GetParAlpha();
|
||||
const G4double& ParTheta = pSPSPosDistribution->GetParTheta();
|
||||
const G4double& ParPhi = pSPSPosDistribution->GetParPhi();
|
||||
|
||||
const G4ThreeVector& Rotx = pSPSPosDistribution->GetRotx();
|
||||
const G4ThreeVector& Roty = pSPSPosDistribution->GetRoty();
|
||||
const G4ThreeVector& Rotz = pSPSPosDistribution->GetRotz();
|
||||
|
||||
const G4ThreeVector& position = pSPSPosDistribution->GetCentreCoords();
|
||||
G4Transform3D transform(CLHEP::HepXHat,CLHEP::HepYHat,CLHEP::HepZHat,Rotx,Roty,Rotz);
|
||||
transform = G4Translate3D(position) * transform;
|
||||
|
||||
G4double surfaceTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
G4double smallHalfThickness = 10.*surfaceTolerance;
|
||||
|
||||
G4VisAttributes gpsAtts;
|
||||
gpsAtts.SetColour(fColour);
|
||||
gpsAtts.SetForceSolid();
|
||||
|
||||
if (Type == "Point") {
|
||||
|
||||
G4Circle circle;
|
||||
circle.SetPosition(position);
|
||||
circle.SetScreenDiameter(10.);
|
||||
circle.SetVisAttributes(gpsAtts);
|
||||
sceneHandler.BeginPrimitives(transform);
|
||||
sceneHandler.AddPrimitive(circle);
|
||||
sceneHandler.EndPrimitives();
|
||||
|
||||
} else if (Type == "Plane") {
|
||||
|
||||
// Code based on G4SPSPosDistribution::GeneratePointsInPlane.
|
||||
sceneHandler.PreAddSolid(transform,gpsAtts);
|
||||
if (Shape == "Circle") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Tubs("GPS_Circle",0.,Radius,smallHalfThickness,0.,twopi));
|
||||
} else if (Shape == "Annulus") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Tubs("GPS_Annulus",Radius0,Radius,smallHalfThickness,0.,twopi));
|
||||
} else if (Shape == "Ellipse") {
|
||||
sceneHandler.AddSolid
|
||||
(G4EllipticalTube("GPS_Ellipse",halfx,halfy,smallHalfThickness));
|
||||
} else if (Shape == "Square") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Box("GPS_Ellipse",halfx,halfx,smallHalfThickness));
|
||||
} else if (Shape == "Rectangle") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Box("GPS_Rectangle",halfx,halfy,smallHalfThickness));
|
||||
}
|
||||
sceneHandler.PostAddSolid();
|
||||
|
||||
} else if (Type == "Surface" || Type == "Volume") {
|
||||
|
||||
// Code based on G4SPSPosDistribution::GeneratePointsOnSurface.
|
||||
// and G4SPSPosDistribution::GeneratePointsInVolume.
|
||||
sceneHandler.PreAddSolid(transform,gpsAtts);
|
||||
if (Shape == "Sphere") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Orb("GPS_Sphere",Radius));
|
||||
} else if (Shape == "Ellipsoid") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Ellipsoid("GPS_Ellipsoid",halfx,halfy,halfz));
|
||||
} else if (Shape == "Cylinder") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Tubs("GPS_Cylinder",0.,Radius, halfz, 0., twopi));
|
||||
} else if (Shape == "Para") {
|
||||
sceneHandler.AddSolid
|
||||
(G4Para("GPS_Para",halfx,halfy,halfz,ParAlpha,ParTheta,ParPhi));
|
||||
}
|
||||
sceneHandler.PostAddSolid();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MagneticFieldModel.cc 94206 2015-11-09 08:11:59Z gcosmo $
|
||||
// $Id: G4MagneticFieldModel.cc 101958 2016-12-12 08:04:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 17th August 2013
|
||||
@@ -51,15 +51,18 @@ G4MagneticFieldModel::~G4MagneticFieldModel () {}
|
||||
|
||||
G4MagneticFieldModel::G4MagneticFieldModel
|
||||
(G4int nDataPointsPerMaxHalfScene,
|
||||
Representation representation)
|
||||
Representation representation,
|
||||
G4int arrow3DLineSegmentsPerCircle)
|
||||
: fNDataPointsPerMaxHalfScene(nDataPointsPerMaxHalfScene)
|
||||
, fRepresentation(representation)
|
||||
, fArrow3DLineSegmentsPerCircle(arrow3DLineSegmentsPerCircle)
|
||||
{
|
||||
fType = "G4MagneticFieldModel";
|
||||
fGlobalTag = fType;
|
||||
std::ostringstream oss;
|
||||
oss << fNDataPointsPerMaxHalfScene;
|
||||
fGlobalDescription = fType + ':' + oss.str();
|
||||
oss << ':' << fNDataPointsPerMaxHalfScene
|
||||
<< ':' << fArrow3DLineSegmentsPerCircle;
|
||||
fGlobalDescription = fType + oss.str();
|
||||
}
|
||||
|
||||
void G4MagneticFieldModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
@@ -109,14 +112,6 @@ void G4MagneticFieldModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
warned = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
static G4bool warned = false;
|
||||
if (!warned) {
|
||||
G4cout << intro
|
||||
<< "No global field exists."
|
||||
<< G4endl;
|
||||
warned = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
static G4bool warned = false;
|
||||
@@ -270,7 +265,9 @@ void G4MagneticFieldModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
const G4double y2 = y1 + arrowLength * By / B;
|
||||
const G4double z2 = z1 + arrowLength * Bz / B;
|
||||
if (fRepresentation == Representation::fullArrow) {
|
||||
G4ArrowModel BArrow(x1,y1,z1,x2,y2,z2,arrowLength/5,arrowColour);
|
||||
G4ArrowModel BArrow(x1,y1,z1,x2,y2,z2,arrowLength/5,arrowColour,
|
||||
"BField",
|
||||
fArrow3DLineSegmentsPerCircle);
|
||||
BArrow.DescribeYourselfTo(sceneHandler);
|
||||
} else if (fRepresentation == Representation::lightArrow) {
|
||||
G4Polyline BArrowLite;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.cc 101035 2016-11-04 08:48:17Z gcosmo $
|
||||
// $Id: G4ModelingParameters.cc 103627 2017-04-19 13:30:26Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -249,14 +249,6 @@ G4bool G4ModelingParameters::operator !=
|
||||
return false;
|
||||
}
|
||||
|
||||
G4bool G4ModelingParameters::PVNameCopyNo::operator!=
|
||||
(const G4ModelingParameters::PVNameCopyNo& rhs) const
|
||||
{
|
||||
if (fName != rhs.fName) return true;
|
||||
if (fCopyNo != rhs.fCopyNo) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4bool G4ModelingParameters::VisAttributesModifier::operator!=
|
||||
(const G4ModelingParameters::VisAttributesModifier& rhs) const
|
||||
{
|
||||
@@ -310,6 +302,14 @@ G4bool G4ModelingParameters::VisAttributesModifier::operator!=
|
||||
return false;
|
||||
}
|
||||
|
||||
G4bool G4ModelingParameters::PVNameCopyNo::operator!=
|
||||
(const G4ModelingParameters::PVNameCopyNo& rhs) const
|
||||
{
|
||||
if (fName != rhs.fName) return true;
|
||||
if (fCopyNo != rhs.fCopyNo) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath& path)
|
||||
{
|
||||
@@ -324,6 +324,33 @@ std::ostream& operator <<
|
||||
return os;
|
||||
}
|
||||
|
||||
const G4String& G4ModelingParameters::PVPointerCopyNo::GetName() const
|
||||
{
|
||||
return fpPV->GetName();
|
||||
}
|
||||
|
||||
G4bool G4ModelingParameters::PVPointerCopyNo::operator!=
|
||||
(const G4ModelingParameters::PVPointerCopyNo& rhs) const
|
||||
{
|
||||
if (fpPV != rhs.fpPV) return true;
|
||||
if (fCopyNo != rhs.fCopyNo) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath& path)
|
||||
{
|
||||
os << "Touchable path: physical-volume-pointer:copy-number pairs:\n ";
|
||||
G4ModelingParameters::PVPointerCopyNoPathConstIterator i;
|
||||
for (i = path.begin(); i != path.end(); ++i) {
|
||||
if (i != path.begin()) {
|
||||
os << ',';
|
||||
}
|
||||
os << '(' << (void*)(i->GetPVPointer()) << ')' << i->GetName() << ':' << i->GetCopyNo();
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os,
|
||||
const std::vector<G4ModelingParameters::VisAttributesModifier>& vams)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeModel.cc 101035 2016-11-04 08:48:17Z gcosmo $
|
||||
// $Id: G4PhysicalVolumeModel.cc 103926 2017-05-03 13:43:27Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -720,6 +720,7 @@ G4bool G4PhysicalVolumeModel::Validate (G4bool warn)
|
||||
transportationManager->GetWorldsIterator();
|
||||
for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
|
||||
G4VPhysicalVolume* world = (*iterWorld);
|
||||
if (!world) break; // This can happen if geometry has been cleared/destroyed.
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user