Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VMarker.hh
Go to the documentation of this file.
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//
28//
29// G4VMarker - base class for markers - circles, squares, etc.
30// John Allison 17/11/96.
31
32// Class Description:
33// G4VMarkers are 2-dimensional G4VVisPrims with the special
34// properties (a) of always facing the camera and (b) of having the
35// possibility of a size defined in screen units (pixels) or paper
36// units (points - there are 72 points per inch). The convention is
37// that if a world size is not specified, then the marker will be
38// drawn to the given screen size or paper size independent of the
39// viewing transformation in effect.
40//
41// "Size" means "overall size", e.g., diameter of circle, side of
42// square, height of text (but diameter and radius access functions
43// are defined to avoid ambiguity).
44//
45// So the user who constructs the marker decides whether it should be
46// drawn to a given size in world coordinates by setting the world
47// size. Alternatively, the user can set the screen size (internally,
48// the world size is set to zero) and the marker is drawn to its
49// screen size. Finally, the user may decide not to set any size; in
50// that case, it is drawn according to the sizes specified in the
51// default marker specified in G4ViewParameters.
52//
53// Also in G4ViewParameters is a "global marker scale" which is a
54// factor by which all marker sizes are multiplied before drawing.
55//
56// Thus the graphics system driver scene handler code might look like:
57//
58// void G4XXXGraphicsSceneHandler::AddPrimitive (const G4Circle& circle) {
59// G4bool hidden = !(fpView -> GetViewParameters().IsMarkerNotHidden());
60// const G4Colour& colour = GetColour (circle);
61// // Base class GetColour.
62// G4VMarker::FillStyle style = circle.GetFillStyle();
63// const G4Point3D& centre = circle.GetPosition();
64// MarkerSizeType sizeType;
65// G4double size = GetMarkerSize (circle, sizeType);
66// switch (sizeType) {
67// default:
68// case screen:
69// // Draw in screen coordinates.
70// // ...
71// break;
72// case world:
73// // Draw in world coordinates.
74// // ...
75// break;
76// }
77// }
78// Class Description - End:
79
80
81#ifndef G4VMARKER_HH
82#define G4VMARKER_HH
83
84#include "globals.hh"
85#include "G4Visible.hh"
86#include "G4Point3D.hh"
87#include "G4Colour.hh"
88#include "G4Color.hh"
89
90class G4VMarker: public G4Visible {
91
92 friend std::ostream& operator << (std::ostream& os, const G4VMarker&);
93
94public: // With description
95
98
99 //////////////////////////////////////////////////////
100 // Constructors...
101 G4VMarker ();
102 G4VMarker (const G4VMarker&);
104
105 //////////////////////////////////////////////////////
106 // Destructor...
107 virtual ~G4VMarker ();
108
109 //////////////////////////////////////////////////////
110 // Assignment...
112
113 //////////////////////////////////////////////////////
114 // Logical...
115 G4bool operator != (const G4VMarker&) const;
116
117 /////////////////////////////////////////////////////
118 // Get functions...
120 SizeType GetSizeType () const;
128
129 /////////////////////////////////////////////////////
130 // Set functions...
131 void SetPosition (const G4Point3D&);
132 void SetSize (SizeType, G4double);
142
143 // Access functions to the string for user customizable information
144 virtual const G4String& GetInfo() const;
145 virtual void SetInfo( const G4String& info );
146
147private:
148 G4Point3D fPosition;
149 G4double fWorldSize; // Default 0. means use screen size.
150 G4double fScreenSize; // Default 0. means use global default.
151 FillStyle fFillStyle;
152
153 // String for user customizable information
154 G4String fInfo ;
155
156};
157
158#include "G4VMarker.icc"
159
160#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
void SetDiameter(SizeType, G4double)
SizeType GetSizeType() const
Definition: G4VMarker.cc:111
void SetWorldRadius(G4double)
virtual void SetInfo(const G4String &info)
FillStyle GetFillStyle() const
G4double GetScreenSize() const
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:118
void SetWorldDiameter(G4double)
void SetScreenSize(G4double)
G4double GetScreenRadius() const
G4double GetWorldDiameter() const
void SetFillStyle(FillStyle)
G4VMarker & operator=(const G4VMarker &)
Definition: G4VMarker.cc:64
void SetWorldSize(G4double)
G4Point3D GetPosition() const
G4bool operator!=(const G4VMarker &) const
Definition: G4VMarker.cc:75
virtual ~G4VMarker()
Definition: G4VMarker.cc:62
void SetPosition(const G4Point3D &)
void SetScreenRadius(G4double)
G4double GetWorldSize() const
virtual const G4String & GetInfo() const
friend std::ostream & operator<<(std::ostream &os, const G4VMarker &)
Definition: G4VMarker.cc:88
void SetScreenDiameter(G4double)
void SetRadius(SizeType, G4double)
G4double GetScreenDiameter() const
G4double GetWorldRadius() const