Geant4  10.00.p01
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 // $Id: G4VMarker.cc 66376 2012-12-18 09:42:59Z gcosmo $
28 //
29 //
30 
31 #include "G4VMarker.hh"
32 
33 #include "G4VisAttributes.hh"
34 
36  fPosition (G4Point3D ()),
37  fWorldSize (0.),
38  fScreenSize (0.),
39  fFillStyle (noFill)
40 {
41  // fInfo: default initialisation.
42 }
43 
45  G4Visible (mk),
46  fPosition (mk.fPosition),
47  fWorldSize (mk.fWorldSize),
48  fScreenSize (mk.fScreenSize),
49  fFillStyle (mk.fFillStyle),
50  fInfo (mk.fInfo)
51 {}
52 
54  fPosition (pos),
55  fWorldSize (0.),
56  fScreenSize (0.),
57  fFillStyle (noFill),
58  fInfo (G4String())
59 {
60  // fInfo: default initialisation.
61 }
62 
64 
66  if (&mk == this) return *this;
68  fPosition = mk.fPosition;
72  fInfo = mk.fInfo;
73  return *this;
74 }
75 
77  if (
78  (G4Visible::operator != (mk)) ||
79  (fWorldSize != mk.fWorldSize) ||
80  (fScreenSize != mk.fScreenSize) ||
81  (fFillStyle != mk.fFillStyle) ||
82  !(fPosition == mk.fPosition) ||
83  (fInfo != mk.fInfo)
84  )
85  return true;
86  return false;
87 }
88 
89 std::ostream& operator << (std::ostream& os, const G4VMarker& marker) {
90  os << "G4VMarker: position: " << marker.fPosition
91  << ", world size: " << marker.fWorldSize
92  << ", screen size: " << marker.fScreenSize << '\n'
93  << " fill style: ";
94  switch (marker.fFillStyle) {
95  case G4VMarker::noFill:
96  os << "no fill";
97  break;
98  case G4VMarker::hashed:
99  os << "hashed";
100  break;
101  case G4VMarker::filled:
102  os << "filled";
103  break;
104  default:
105  os << "unrecognised"; break;
106  }
107  if (!marker.fInfo.empty()) os << "\n User information: " << marker.fInfo;
108  os << "\n " << (const G4Visible&) marker;
109  return os;
110 }
111 
113  SizeType type = none;
114  if (fWorldSize) type = world;
115  else if (fScreenSize) type = screen;
116  return type;
117 }
118 
119 void G4VMarker::SetSize (SizeType sizeType, G4double size) {
120  fWorldSize = fScreenSize = 0.;
121  if (sizeType == world) fWorldSize = size;
122  else if (sizeType == screen) fScreenSize = size;
123 }
G4double fScreenSize
Definition: G4VMarker.hh:151
G4double fWorldSize
Definition: G4VMarker.hh:150
G4Visible & operator=(const G4Visible &)
Definition: G4Visible.cc:58
G4Point3D fPosition
Definition: G4VMarker.hh:149
SizeType GetSizeType() const
Definition: G4VMarker.cc:112
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
G4VMarker & operator=(const G4VMarker &)
Definition: G4VMarker.cc:65
bool G4bool
Definition: G4Types.hh:79
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:119
G4String fInfo
Definition: G4VMarker.hh:155
std::ostream & operator<<(std::ostream &os, const G4VMarker &marker)
Definition: G4VMarker.cc:89
FillStyle fFillStyle
Definition: G4VMarker.hh:152
virtual ~G4VMarker()
Definition: G4VMarker.cc:63
G4bool operator!=(const G4VMarker &) const
Definition: G4VMarker.cc:76
double G4double
Definition: G4Types.hh:76
static const G4double pos