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 #include "G4TrajectoryGenericDrawer.hh"
00031 #include "G4TrajectoryDrawerUtils.hh"
00032 #include "G4VisTrajContext.hh"
00033 #include "G4VTrajectory.hh"
00034 #include <sstream>
00035
00036 G4TrajectoryGenericDrawer::G4TrajectoryGenericDrawer(const G4String& name, G4VisTrajContext* context)
00037 :G4VTrajectoryModel(name, context)
00038 {}
00039
00040 G4TrajectoryGenericDrawer::~G4TrajectoryGenericDrawer() {}
00041
00042 void
00043 G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
00044 {
00045 G4VisTrajContext myContext(GetContext());
00046 myContext.SetVisible(visible);
00047
00048 if (GetVerbose()) {
00049 G4cout<<"G4TrajectoryGenericDrawer named "<<Name();
00050 G4cout<<", drawing trajectory with configuration: "<<G4endl;
00051 myContext.Print(G4cout);
00052 }
00053
00054 G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
00055 }
00056
00057 void
00058 G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4bool& visible) const
00059 {
00060 G4VisTrajContext myContext(GetContext());
00061 myContext.SetVisible(visible);
00062
00063 if (GetVerbose()) {
00064 G4cout<<"G4TrajectoryGenericDrawer named "<<Name();
00065 G4cout<<", drawing trajectory with configuration: "<<G4endl;
00066 myContext.Print(G4cout);
00067 }
00068
00069 G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
00070 }
00071
00072 void
00073 G4TrajectoryGenericDrawer::Print(std::ostream& ostr) const
00074 {
00075 ostr<<"G4TrajectoryGenericDrawer model "<< Name()<< ", default configuration :"<<G4endl;
00076 GetContext().Print(G4cout);
00077 }