Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VMarker.cc
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
30#include "G4VMarker.hh"
31
32#include "G4VisAttributes.hh"
33
35 fPosition (G4Point3D ()),
36 fWorldSize (0.),
37 fScreenSize (0.),
38 fFillStyle (noFill)
39{
40 // fInfo: default initialisation.
41}
42
44 G4Visible (mk),
45 fPosition (mk.fPosition),
46 fWorldSize (mk.fWorldSize),
47 fScreenSize (mk.fScreenSize),
48 fFillStyle (mk.fFillStyle),
49 fInfo (mk.fInfo)
50{}
51
53 fPosition (pos),
54 fWorldSize (0.),
55 fScreenSize (0.),
56 fFillStyle (noFill),
57 fInfo (G4String())
58{
59 // fInfo: default initialisation.
60}
61
63
65 if (&mk == this) return *this;
67 fPosition = mk.fPosition;
68 fWorldSize = mk.fWorldSize;
69 fScreenSize = mk.fScreenSize;
70 fFillStyle = mk.fFillStyle;
71 fInfo = mk.fInfo;
72 return *this;
73}
74
76 if (
77 (G4Visible::operator != (mk)) ||
78 (fWorldSize != mk.fWorldSize) ||
79 (fScreenSize != mk.fScreenSize) ||
80 (fFillStyle != mk.fFillStyle) ||
81 !(fPosition == mk.fPosition) ||
82 (fInfo != mk.fInfo)
83 )
84 return true;
85 return false;
86}
87
88std::ostream& operator << (std::ostream& os, const G4VMarker& marker) {
89 os << "G4VMarker: position: " << marker.fPosition
90 << ", world size: " << marker.fWorldSize
91 << ", screen size: " << marker.fScreenSize << '\n'
92 << " fill style: ";
93 switch (marker.fFillStyle) {
95 os << "no fill";
96 break;
98 os << "hashed";
99 break;
101 os << "filled";
102 break;
103 default:
104 os << "unrecognised"; break;
105 }
106 if (!marker.fInfo.empty()) os << "\n User information: " << marker.fInfo;
107 os << "\n " << (const G4Visible&) marker;
108 return os;
109}
110
112 SizeType type = none;
113 if (fWorldSize) type = world;
114 else if (fScreenSize) type = screen;
115 return type;
116}
117
118void G4VMarker::SetSize (SizeType sizeType, G4double size) {
119 fWorldSize = fScreenSize = 0.;
120 if (sizeType == world) fWorldSize = size;
121 else if (sizeType == screen) fScreenSize = size;
122}
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
std::ostream & operator<<(std::ostream &os, const G4VMarker &marker)
Definition: G4VMarker.cc:88
SizeType GetSizeType() const
Definition: G4VMarker.cc:111
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:118
G4VMarker & operator=(const G4VMarker &)
Definition: G4VMarker.cc:64
G4bool operator!=(const G4VMarker &) const
Definition: G4VMarker.cc:75
virtual ~G4VMarker()
Definition: G4VMarker.cc:62
G4Visible & operator=(const G4Visible &)
Definition: G4Visible.cc:57