00001
00002
00003 #include "VisExamples/VisG4ExN02/src/VisG4ExampleHit.h"
00004 #include <G4UnitsTable.hh>
00005 #include <G4VVisManager.hh>
00006 #include <G4Circle.hh>
00007 #include <G4Colour.hh>
00008 #include <G4VisAttributes.hh>
00009 #include <iostream>
00010
00011
00012
00013
00014
00015
00016
00017 G4Allocator<VisG4ExampleHit> VisG4ExampleHitAllocator;
00018
00019
00020
00021
00022
00023
00024 VisG4ExampleHit::VisG4ExampleHit (void)
00025 : m_trackId (-1),
00026 m_chamber (-1),
00027 m_energy (0.),
00028 m_position (G4ThreeVector ())
00029 {}
00030
00031 void
00032 VisG4ExampleHit::Draw (void)
00033 {
00034 if (G4VVisManager *pVVisManager = G4VVisManager::GetConcreteInstance ())
00035 {
00036 G4Circle circle (m_position);
00037 circle.SetScreenSize (0.04);
00038 circle.SetFillStyle (G4Circle::filled);
00039 circle.SetVisAttributes (G4VisAttributes (G4Colour (1.,0.,0.)));
00040
00041 pVVisManager->Draw (circle);
00042 }
00043 }
00044
00045 void
00046 VisG4ExampleHit::Print (void)
00047 {
00048 std::cout << " track id: " << m_trackId
00049 << " chamber: " << m_chamber
00050 << " energy: " << m_energy
00051 << " position: " << m_position;
00052 }