Visualization stuff.
61 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
62 if (!pVVisManager)
return;
64 const G4double markerSize = abs(i_mode)*0.001;
65 G4bool lineRequired (i_mode >= 0);
66 G4bool markersRequired (markerSize > 0.);
68 G4Polyline trajectoryLine;
69 G4Polymarker stepPoints;
70 G4Polymarker auxiliaryPoints;
72 for (G4int
i = 0;
i < GetPointEntries() ;
i++)
74 G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(
i);
75 const std::vector<G4ThreeVector>* auxiliaries
76 = aTrajectoryPoint->GetAuxiliaryPoints();
79 for (
size_t iAux = 0; iAux < auxiliaries->size(); ++iAux)
81 const G4ThreeVector
pos((*auxiliaries)[iAux]);
84 trajectoryLine.push_back(
pos);
88 auxiliaryPoints.push_back(
pos);
92 const G4ThreeVector
pos(aTrajectoryPoint->GetPosition());
95 trajectoryLine.push_back(
pos);
99 stepPoints.push_back(
pos);
106 getVisualizationHelper()->trackVisualizationScheme();
108 const G4double
charge = GetCharge();
112 const G4String pname=GetParticleName();
113 if (pname==
"e+" || pname==
"e-")
colour = G4Colour(1.,1.,0.);
114 else if (pname==
"mu+" || pname==
"mu-")
colour = G4Colour(0.,1.,0.);
115 else if (pname==
"gamma")
colour = G4Colour(0.,0.,1.);
116 else if (pname==
"neutron")
colour = G4Colour(0.,0.,0.);
119 else if (visScheme==2)
123 else colour = G4Colour(0.,1.,0.);
125 else if (visScheme==3)
127 const G4String pname=GetParticleName();
128 if (pname==
"e+" || pname==
"e-")
colour = G4Colour(1.,1.,0.);
129 else if (pname==
"mu+" || pname==
"mu-")
colour = G4Colour(0.,0.,1.);
130 else if (pname==
"gamma")
colour = G4Colour(60./256.,79./256.,113./256.);
131 else if (pname==
"neutron")
colour = G4Colour(1.,1.,1.);
132 else if (pname==
"pi-"|| pname==
"pi+")
133 colour = G4Colour(250/256.,128/256.,114/256.);
134 else colour = G4Colour(176/256.,48/256.,96/256.);
136 G4VisAttributes trajectoryLineAttribs(
colour);
137 if(visScheme==1 &&
charge==0)
139 G4VisAttributes::LineStyle
style=G4VisAttributes::dotted;
140 trajectoryLineAttribs.SetLineStyle(
style);
142 trajectoryLine.SetVisAttributes(&trajectoryLineAttribs);
143 pVVisManager->Draw(trajectoryLine);
147 auxiliaryPoints.SetMarkerType(G4Polymarker::squares);
148 auxiliaryPoints.SetScreenSize(markerSize);
150 G4VisAttributes auxiliaryPointsAttribs(G4Colour(0.,1.,1.));
151 auxiliaryPoints.SetVisAttributes(&auxiliaryPointsAttribs);
152 pVVisManager->Draw(auxiliaryPoints);
154 stepPoints.SetMarkerType(G4Polymarker::circles);
155 stepPoints.SetScreenSize(markerSize);
157 G4VisAttributes stepPointsAttribs(G4Colour(1.,1.,0.));
158 stepPoints.SetVisAttributes(&stepPointsAttribs);
159 pVVisManager->Draw(stepPoints);