Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -19,6 +19,43 @@ committal in the CVS repository !
|
||||
History file for visualization/modeling
|
||||
---------------------------------------
|
||||
|
||||
19 November 2019 Gabriele Cosmo (modeling-V10-05-11)
|
||||
- Fixed more cases of implicit type conversions.
|
||||
|
||||
15 November 2019 Gabriele Cosmo (modeling-V10-05-10)
|
||||
- Fixed cases of implicit type conversions from size_t to G4int.
|
||||
|
||||
19 September 2019 Makoto Asai (modeling-V10-05-09)
|
||||
- G4PSHitsModel.cc
|
||||
o Namespace scope is added to MeshScoreMap
|
||||
o Co-working with detutils-V10-05-01
|
||||
|
||||
29 August 2019 John Allison (modeling-V10-05-08)
|
||||
- Part of vis-V10-05-24.
|
||||
- Add G4TessellatedSolid to list of solids that may be specially treated
|
||||
|
||||
16 July 2019 John Allison (modeling-V10-05-07)
|
||||
- Part of vis-V10-05-22.
|
||||
- G4CallbackModel.hh:
|
||||
o Include modelling parameters in passed arguments.
|
||||
|
||||
05 July 2019 John Allison (modeling-V10-05-06)
|
||||
- Part of vis-V10-05-21.
|
||||
- Rationalise trajectory line drawing.
|
||||
o There is a flag - DrawLine - which controls whether a trajectory
|
||||
should be drawn at all:
|
||||
/vis/modeling/trajectories/drawByCharge-0/default/setDrawLine
|
||||
but there is also a lineVisible command, which should do the same.:
|
||||
/vis/modeling/trajectories/drawByCharge-0/default/setLineVisible
|
||||
This is fixed in this tag.
|
||||
o I think there was some confusion between "visible" as used by filtering
|
||||
and "visible" as used in drawing. For example in
|
||||
G4TrajectoryDrawByCharge::Draw
|
||||
(const G4VTrajectory& traj, const G4bool& /*visible*/)
|
||||
the argument visible is the former sense but it is (was) interpreted as
|
||||
visible in the latter sense. As you see, I have suppressed its use in
|
||||
this and similar functions.
|
||||
|
||||
13 June 2019 John Allison (modeling-V10-05-04)
|
||||
- Part of vis-V10-05-20.
|
||||
- G4ModelingParameters:
|
||||
|
||||
@@ -59,7 +59,7 @@ template <class F> class G4CallbackModel: public G4VModel {
|
||||
fFunction(function) {}
|
||||
~G4CallbackModel() {}
|
||||
void DescribeYourselfTo(G4VGraphicsScene& sceneHandler) {
|
||||
(*fFunction)(sceneHandler, fTransform);
|
||||
(*fFunction)(sceneHandler, fTransform, fpMP);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -126,7 +126,7 @@ public: // With description
|
||||
G4VPhysicalVolume* GetVolume(G4int depth) const;
|
||||
G4VSolid* GetSolid(G4int depth) const;
|
||||
G4int GetReplicaNumber(G4int depth) const;
|
||||
G4int GetHistoryDepth() const {return fFullPVPath.size();}
|
||||
G4int GetHistoryDepth() const {return G4int(fFullPVPath.size());}
|
||||
private:
|
||||
const std::vector<G4PhysicalVolumeNodeID>& fFullPVPath;
|
||||
};
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "G4Ellipsoid.hh"
|
||||
#include "G4Polycone.hh"
|
||||
#include "G4Polyhedra.hh"
|
||||
#include "G4TessellatedSolid.hh"
|
||||
|
||||
class G4PseudoScene: public G4VGraphicsScene {
|
||||
|
||||
@@ -57,32 +58,35 @@ public:
|
||||
{fpCurrentObjectTransformation = &objectTransformation;}
|
||||
void PostAddSolid () {}
|
||||
// From geometry/solids/CSG
|
||||
void AddSolid (const G4Box& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Cons& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Orb& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Para& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Box& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Cons& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Orb& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Para& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Sphere& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Torus& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Trap& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Trd& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Tubs& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Torus& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Trap& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Trd& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Tubs& solid) {ProcessVolume (solid);}
|
||||
// From geometry/solids/specific
|
||||
void AddSolid (const G4Ellipsoid& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Polycone& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Polyhedra& solid) {ProcessVolume (solid);}
|
||||
// For solids not above.
|
||||
void AddSolid (const G4Ellipsoid& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Polycone& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4Polyhedra& solid) {ProcessVolume (solid);}
|
||||
void AddSolid (const G4TessellatedSolid& solid) {ProcessVolume (solid);}
|
||||
// For solids not above
|
||||
void AddSolid (const G4VSolid& solid) {ProcessVolume (solid);}
|
||||
// Compounds
|
||||
void AddCompound (const G4VTrajectory&) {}
|
||||
void AddCompound (const G4VHit&) {}
|
||||
void AddCompound (const G4VDigi&) {}
|
||||
void AddCompound (const G4THitsMap<G4double>&) {}
|
||||
void AddCompound (const G4VHit&) {}
|
||||
void AddCompound (const G4VDigi&) {}
|
||||
void AddCompound (const G4THitsMap<G4double>&) {}
|
||||
void AddCompound (const G4THitsMap<G4StatDouble>&) {}
|
||||
void BeginPrimitives (const G4Transform3D&) {}
|
||||
void EndPrimitives () {}
|
||||
// Primitives
|
||||
void BeginPrimitives (const G4Transform3D&) {}
|
||||
void EndPrimitives () {}
|
||||
void BeginPrimitives2D (const G4Transform3D&) {}
|
||||
void EndPrimitives2D () {}
|
||||
void EndPrimitives2D () {}
|
||||
void AddPrimitive (const G4Polyline&) {}
|
||||
void AddPrimitive (const G4Scale&) {}
|
||||
void AddPrimitive (const G4Scale&) {}
|
||||
void AddPrimitive (const G4Text&) {}
|
||||
void AddPrimitive (const G4Circle&) {}
|
||||
void AddPrimitive (const G4Square&) {}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "G4VGraphicsScene.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
|
||||
G4PSHitsModel::~G4PSHitsModel () {}
|
||||
|
||||
@@ -49,6 +50,8 @@ G4PSHitsModel::G4PSHitsModel (const G4String& requestedMapName):
|
||||
|
||||
void G4PSHitsModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
{
|
||||
using MeshScoreMap = G4VScoringMesh::MeshScoreMap;
|
||||
using RunScore = G4VScoringMesh::RunScore;
|
||||
G4ScoringManager* scoringManager =
|
||||
G4ScoringManager::GetScoringManagerIfExist();
|
||||
if (scoringManager) {
|
||||
|
||||
@@ -94,7 +94,7 @@ void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
// speed) assumes all trajectories are drawn with the same
|
||||
// transformation. If not, a fatal exception with be raised in
|
||||
// G4VisManager::DrawT.
|
||||
for (G4int iT = 0; iT < TC->entries(); iT++) {
|
||||
for (std::size_t iT = 0; iT < TC->entries(); ++iT) {
|
||||
fpCurrentTrajectory = (*TC) [iT];
|
||||
// Debug trajectory:
|
||||
// fpCurrentTrajectory->ShowTrajectory(); G4cout << G4endl;
|
||||
@@ -154,7 +154,7 @@ void G4TrajectoriesModelDebugG4AttValues(const G4VTrajectory* pTraj)
|
||||
}
|
||||
}
|
||||
// Trajectory point attributes
|
||||
for (G4int i = 0; i < pTraj->GetPointEntries(); i++) {
|
||||
for (G4int i = 0; i < pTraj->GetPointEntries(); ++i) {
|
||||
G4VTrajectoryPoint* aPoint = pTraj->GetPoint(i);
|
||||
std::vector<G4AttValue>* attValues = aPoint->CreateAttValues();
|
||||
if (attValues) {
|
||||
|
||||
@@ -59,7 +59,7 @@ G4TrajectoryDrawByAttribute::~G4TrajectoryDrawByAttribute()
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
|
||||
const G4bool& visible) const
|
||||
const G4bool& /*visible*/) const
|
||||
{
|
||||
// Return if attribute name has not been set. Just print one warning
|
||||
if (fAttName.isNull()) {
|
||||
@@ -161,8 +161,6 @@ G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
|
||||
|
||||
assert (gotContext);
|
||||
}
|
||||
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout<<"G4TrajectoryDrawByAttribute drawer named "<<Name();
|
||||
|
||||
@@ -54,7 +54,7 @@ G4TrajectoryDrawByCharge::G4TrajectoryDrawByCharge(const G4String& name,
|
||||
G4TrajectoryDrawByCharge::~G4TrajectoryDrawByCharge() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4bool& /*visible*/) const
|
||||
{
|
||||
G4Colour colour;
|
||||
|
||||
@@ -65,10 +65,9 @@ G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4bool& visible)
|
||||
else fMap.GetColour(Neutral, colour);
|
||||
|
||||
G4VisTrajContext myContext(GetContext());
|
||||
|
||||
|
||||
myContext.SetLineColour(colour);
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout<<"G4TrajectoryDrawByCharge drawer named "<<Name();
|
||||
G4cout<<", drawing trajectory with charge, "<<charge<<G4endl;
|
||||
|
||||
@@ -44,7 +44,7 @@ G4TrajectoryDrawByEncounteredVolume::G4TrajectoryDrawByEncounteredVolume
|
||||
G4TrajectoryDrawByEncounteredVolume::~G4TrajectoryDrawByEncounteredVolume() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByEncounteredVolume::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
G4TrajectoryDrawByEncounteredVolume::Draw(const G4VTrajectory& traj, const G4bool& /*visible*/) const
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -74,7 +74,6 @@ G4TrajectoryDrawByEncounteredVolume::Draw(const G4VTrajectory& traj, const G4boo
|
||||
G4VisTrajContext myContext(GetContext());
|
||||
|
||||
myContext.SetLineColour(colour);
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout
|
||||
|
||||
@@ -41,7 +41,7 @@ G4TrajectoryDrawByOriginVolume::G4TrajectoryDrawByOriginVolume(const G4String& n
|
||||
G4TrajectoryDrawByOriginVolume::~G4TrajectoryDrawByOriginVolume() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4bool& /*visible*/) const
|
||||
{
|
||||
G4VTrajectoryPoint* aTrajectoryPoint = traj.GetPoint(0);
|
||||
assert (0 != aTrajectoryPoint);
|
||||
@@ -68,7 +68,6 @@ G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4bool& vi
|
||||
G4VisTrajContext myContext(GetContext());
|
||||
|
||||
myContext.SetLineColour(colour);
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout<<"G4TrajectoryDrawByOriginVolume drawer named "<<Name();
|
||||
|
||||
@@ -47,7 +47,7 @@ G4TrajectoryDrawByParticleID::G4TrajectoryDrawByParticleID(const G4String& name,
|
||||
G4TrajectoryDrawByParticleID::~G4TrajectoryDrawByParticleID() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4bool& /*visible*/) const
|
||||
{
|
||||
G4Colour colour(fDefault);
|
||||
G4String particle = traj.GetParticleName();
|
||||
@@ -57,7 +57,6 @@ G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4bool& visi
|
||||
G4VisTrajContext myContext(GetContext());
|
||||
|
||||
myContext.SetLineColour(colour);
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout<<"G4TrajectoryDrawByParticleID drawer named "<<Name();
|
||||
|
||||
@@ -215,34 +215,33 @@ namespace G4TrajectoryDrawerUtils {
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (0 == pVVisManager) return;
|
||||
|
||||
if (myContext.GetDrawLine()) {
|
||||
if (myContext.GetDrawLine() && myContext.GetLineVisible()) {
|
||||
G4VisAttributes trajectoryLineAttribs(myContext.GetLineColour());
|
||||
trajectoryLineAttribs.SetLineWidth(myContext.GetLineWidth());
|
||||
trajectoryLineAttribs.SetVisibility(myContext.GetLineVisible());
|
||||
trajectoryLine.SetVisAttributes(&trajectoryLineAttribs);
|
||||
|
||||
pVVisManager->Draw(trajectoryLine);
|
||||
}
|
||||
|
||||
if (myContext.GetDrawAuxPts() && (auxiliaryPoints.size() > 0)) {
|
||||
if (myContext.GetDrawAuxPts() && myContext.GetAuxPtsVisible()
|
||||
&& (auxiliaryPoints.size() > 0)) {
|
||||
auxiliaryPoints.SetMarkerType(myContext.GetAuxPtsType());
|
||||
auxiliaryPoints.SetSize(myContext.GetAuxPtsSizeType(), myContext.GetAuxPtsSize());
|
||||
auxiliaryPoints.SetFillStyle(myContext.GetAuxPtsFillStyle());
|
||||
|
||||
G4VisAttributes auxiliaryPointsAttribs(myContext.GetAuxPtsColour());
|
||||
auxiliaryPointsAttribs.SetVisibility(myContext.GetAuxPtsVisible());
|
||||
auxiliaryPoints.SetVisAttributes(&auxiliaryPointsAttribs);
|
||||
|
||||
pVVisManager->Draw(auxiliaryPoints);
|
||||
}
|
||||
|
||||
if (myContext.GetDrawStepPts() && (stepPoints.size() > 0)) {
|
||||
if (myContext.GetDrawStepPts() && myContext.GetStepPtsVisible()
|
||||
&& (stepPoints.size() > 0)) {
|
||||
stepPoints.SetMarkerType(myContext.GetStepPtsType());
|
||||
stepPoints.SetSize(myContext.GetStepPtsSizeType(), myContext.GetStepPtsSize());
|
||||
stepPoints.SetFillStyle(myContext.GetStepPtsFillStyle());
|
||||
|
||||
G4VisAttributes stepPointsAttribs(myContext.GetStepPtsColour());
|
||||
stepPointsAttribs.SetVisibility(myContext.GetStepPtsVisible());
|
||||
stepPoints.SetVisAttributes(&stepPointsAttribs);
|
||||
|
||||
pVVisManager->Draw(stepPoints);
|
||||
@@ -262,10 +261,9 @@ namespace G4TrajectoryDrawerUtils {
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (0 == pVVisManager) return;
|
||||
|
||||
if (myContext.GetDrawLine()) {
|
||||
if (myContext.GetDrawLine() && myContext.GetLineVisible()) {
|
||||
G4VisAttributes trajectoryLineAttribs(myContext.GetLineColour());
|
||||
trajectoryLineAttribs.SetLineWidth(myContext.GetLineWidth());
|
||||
trajectoryLineAttribs.SetVisibility(myContext.GetLineVisible());
|
||||
|
||||
for (size_t i = 1; i < trajectoryLine.size(); ++i ) {
|
||||
G4Polyline slice;
|
||||
@@ -278,9 +276,9 @@ namespace G4TrajectoryDrawerUtils {
|
||||
}
|
||||
}
|
||||
|
||||
if (myContext.GetDrawAuxPts() && (auxiliaryPoints.size() > 0)) {
|
||||
if (myContext.GetDrawAuxPts() && myContext.GetAuxPtsVisible()
|
||||
&& (auxiliaryPoints.size() > 0)) {
|
||||
G4VisAttributes auxiliaryPointsAttribs(myContext.GetAuxPtsColour());
|
||||
auxiliaryPointsAttribs.SetVisibility(myContext.GetAuxPtsVisible());
|
||||
|
||||
for (size_t i = 0; i < auxiliaryPoints.size(); ++i ) {
|
||||
G4Polymarker point;
|
||||
@@ -295,9 +293,9 @@ namespace G4TrajectoryDrawerUtils {
|
||||
}
|
||||
}
|
||||
|
||||
if (myContext.GetDrawStepPts() && (stepPoints.size() > 0)) {
|
||||
if (myContext.GetDrawStepPts() && myContext.GetStepPtsVisible()
|
||||
&& (stepPoints.size() > 0)) {
|
||||
G4VisAttributes stepPointsAttribs(myContext.GetStepPtsColour());
|
||||
stepPointsAttribs.SetVisibility(myContext.GetStepPtsVisible());
|
||||
|
||||
for (size_t i = 0; i < stepPoints.size(); ++i ) {
|
||||
G4Polymarker point;
|
||||
|
||||
Reference in New Issue
Block a user