Geant4 11.1.1
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&) = default;
103 G4VMarker (G4VMarker&& ) = default;
105
106 //////////////////////////////////////////////////////
107 // Destructor...
108 ~G4VMarker () override;
109
110 //////////////////////////////////////////////////////
111 // Assignment...
112 G4VMarker& operator = (const G4VMarker&) = default;
114
115 //////////////////////////////////////////////////////
116 // Logical...
117 G4bool operator != (const G4VMarker&) const;
119
120 /////////////////////////////////////////////////////
121 // Get functions...
123 SizeType GetSizeType () const;
131
132 /////////////////////////////////////////////////////
133 // Set functions...
134 void SetPosition (const G4Point3D&);
135 void SetSize (SizeType, G4double);
145
146private:
147 G4Point3D fPosition;
148 G4double fWorldSize; // Default 0. means use screen size.
149 G4double fScreenSize; // Default 0. means use global default.
150 FillStyle fFillStyle;
151};
152
153#include "G4VMarker.icc"
154
155#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
void SetDiameter(SizeType, G4double)
SizeType GetSizeType() const
Definition: G4VMarker.cc:79
void SetWorldRadius(G4double)
FillStyle GetFillStyle() const
~G4VMarker() override
G4double GetScreenSize() const
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:86
void SetWorldDiameter(G4double)
void SetScreenSize(G4double)
G4double GetScreenRadius() const
G4double GetWorldDiameter() const
G4VMarker(G4VMarker &&)=default
void SetFillStyle(FillStyle)
void SetWorldSize(G4double)
G4Point3D GetPosition() const
G4bool operator!=(const G4VMarker &) const
Definition: G4VMarker.cc:49
void SetPosition(const G4Point3D &)
void SetScreenRadius(G4double)
G4bool operator==(const G4VMarker &) const
G4VMarker(const G4VMarker &)=default
G4double GetWorldSize() const
friend std::ostream & operator<<(std::ostream &os, const G4VMarker &)
Definition: G4VMarker.cc:57
void SetScreenDiameter(G4double)
void SetRadius(SizeType, G4double)
G4double GetScreenDiameter() const
G4double GetWorldRadius() const
G4VMarker & operator=(const G4VMarker &)=default