00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include "G4VTrajectory.hh"
00042 #include "G4VTrajectoryPoint.hh"
00043 #include "G4AttDefStore.hh"
00044 #include "G4AttDef.hh"
00045 #include "G4AttValue.hh"
00046 #include "G4AttCheck.hh"
00047 #include "G4VVisManager.hh"
00048 #include "G4VisAttributes.hh"
00049 #include "G4Polyline.hh"
00050 #include "G4Polymarker.hh"
00051 #include "G4Colour.hh"
00052
00053 G4VTrajectory::G4VTrajectory() {;}
00054 G4VTrajectory::~G4VTrajectory() {;}
00055
00056 G4bool G4VTrajectory::operator == (const G4VTrajectory& right) const
00057 {
00058 return (this==&right);
00059 }
00060
00061 void G4VTrajectory::ShowTrajectory(std::ostream& os) const
00062 {
00063
00064
00065
00066
00067 std::vector<G4AttValue>* attValues = CreateAttValues();
00068 const std::map<G4String,G4AttDef>* attDefs = GetAttDefs();
00069
00070
00071 if (G4AttCheck(attValues,attDefs).Check("G4VTrajectory::ShowTrajectory")) {
00072 return;
00073 }
00074
00075 os << "Trajectory:";
00076
00077 std::vector<G4AttValue>::iterator iAttVal;
00078 for (iAttVal = attValues->begin();
00079 iAttVal != attValues->end(); ++iAttVal) {
00080 std::map<G4String,G4AttDef>::const_iterator iAttDef =
00081 attDefs->find(iAttVal->GetName());
00082 os << "\n " << iAttDef->second.GetDesc()
00083 << " (" << iAttVal->GetName()
00084 << "): " << iAttVal->GetValue();
00085 }
00086
00087 delete attValues;
00088
00089
00090 for (G4int i = 0; i < GetPointEntries(); i++) {
00091
00092 G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(i);
00093 attValues = aTrajectoryPoint->CreateAttValues();
00094 attDefs = aTrajectoryPoint->GetAttDefs();
00095
00096
00097 if (G4AttCheck(attValues,attDefs).Check("G4VTrajectory::ShowTrajectory")) {
00098 return;
00099 }
00100
00101 for (iAttVal = attValues->begin();
00102 iAttVal != attValues->end(); ++iAttVal) {
00103 std::map<G4String,G4AttDef>::const_iterator iAttDef =
00104 attDefs->find(iAttVal->GetName());
00105 os << "\n " << iAttDef->second.GetDesc()
00106 << " (" << iAttVal->GetName()
00107 << "): " << iAttVal->GetValue();
00108 }
00109
00110 delete attValues;
00111 }
00112 }
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 void G4VTrajectory::DrawTrajectory(G4int i_mode) const
00126 {
00127 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
00128
00129 static G4bool warnedAboutIMode = false;
00130 if (!warnedAboutIMode && i_mode != 0) {
00131 G4Exception
00132 ("G4VTrajectory::DrawTrajectory()",
00133 "Tracking0100", JustWarning,
00134 "DEPRECATED! The use of i_mode argument in DrawTrajectory()"
00135 "\n is deprecated and will be removed at the next major release.");
00136 warnedAboutIMode = true;
00137 }
00138
00139 if (0 != pVVisManager) {
00140 pVVisManager->DispatchToModel(*this, i_mode);
00141 }
00142 }