ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VMarker.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VMarker.cc
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;
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 
88 std::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) {
94  case G4VMarker::noFill:
95  os << "no fill";
96  break;
97  case G4VMarker::hashed:
98  os << "hashed";
99  break;
100  case G4VMarker::filled:
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 
118 void G4VMarker::SetSize (SizeType sizeType, G4double size) {
119  fWorldSize = fScreenSize = 0.;
120  if (sizeType == world) fWorldSize = size;
121  else if (sizeType == screen) fScreenSize = size;
122 }