source: trunk/examples/novice/N05/src/ExN05EnergySpot.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 3.1 KB
RevLine 
[807]1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: ExN05EnergySpot.cc,v 1.7 2006/06/29 17:53:13 gunter Exp $
28// GEANT4 tag $Name: $
29//
30#include "ExN05EnergySpot.hh"
31
32#include "G4VisAttributes.hh"
33#include "G4Colour.hh"
34#include "G4Polyline.hh"
35#include "G4VVisManager.hh"
36#include "G4Step.hh"
37
38
39ExN05EnergySpot::ExN05EnergySpot()
40{;}
41
42ExN05EnergySpot::ExN05EnergySpot(const G4ThreeVector& point, G4double E)
43{
44 Point = point;
45 Energy = E;
46}
47
48ExN05EnergySpot::~ExN05EnergySpot()
49{;}
50
51
52void ExN05EnergySpot::Draw(G4Colour *color)
53{
54 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
55 if (pVVisManager)
56 {
57 G4Polyline polyline;
58 G4Colour colour(1.,.5,.5);
59 if (color != 0) colour = *color;
60 polyline.SetVisAttributes(colour);
61 G4ThreeVector pp(Point);
62 // Draw a "home made" marker:
63 // Will be better by using a real Marker:
64 pp.setZ(pp.z()+1*cm);
65 polyline.push_back(pp);
66 pp.setZ(pp.z()-2*cm);
67 polyline.push_back(pp);
68 pp = Point;
69 polyline.push_back(pp);
70 pp.setX(pp.x()+1*cm);
71 polyline.push_back(pp);
72 pp.setX(pp.x()-2*cm);
73 polyline.push_back(pp);
74 pp = Point;
75 polyline.push_back(pp);
76 pp.setY(pp.y()+1*cm);
77 polyline.push_back(pp);
78 pp.setY(pp.y()-2*cm);
79 polyline.push_back(pp);
80 pVVisManager -> Draw(polyline);
81 }
82}
83
84void ExN05EnergySpot::Print()
85{
86 G4cout << " ExN05EnergySpot {E = " << Energy << "; Position = " << Point << " }"<< G4endl;
87}
88
89
90
91
92
Note: See TracBrowser for help on using the repository browser.