Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Scale.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: G4Scale.cc 83392 2014-08-21 14:36:35Z gcosmo $
28 //
29 //
30 // John Allison 21st July 2001
31 
32 #include "G4Scale.hh"
33 
34 G4Scale::G4Scale (G4double length, const G4String& annotation,
35  G4Scale::Direction direction,
36  G4bool autoPlacing,
37  G4double xmid, G4double ymid, G4double zmid,
38  G4double annotationSize):
39  fLength(length),
40  fAnnotation(annotation),
41  fAnnotationSize(annotationSize),
42  fDirection(direction),
43  fAutoPlacing(autoPlacing),
44  fXmid(xmid), fYmid(ymid), fZmid(zmid) {}
45 
47 
48 const G4String G4Scale::GuidanceString
49 (
50  "An annotated line in the specified direction with tick marks at the"
51  "\nend. If autoPlacing is true it is required to be centred at the"
52  "\nfront, right, bottom corner of the world space, comfortably outside"
53  "\nthe existing bounding box/sphere so that existing objects do not"
54  "\nobscure it. Otherwise it is required to be drawn with mid-point at"
55  "\n(xmid, ymid, zmid)."
56  "\n"
57  "\nThe auto placing algorithm might be:"
58  "\n x = xmin + (1 + comfort) * (xmax - xmin);"
59  "\n y = ymin - comfort * (ymax - ymin);"
60  "\n z = zmin + (1 + comfort) * (zmax - zmin);"
61  "\n if direction == x then (x - length,y,z) to (x,y,z);"
62  "\n if direction == y then (x,y,z) to (x,y + length,z);"
63  "\n if direction == z then (x,y,z - length) to (x,y,z);"
64 );
65 
67 {
68  return GuidanceString;
69 }
Direction
Definition: G4Scale.hh:42
bool G4bool
Definition: G4Types.hh:79
static const G4String & GetGuidanceString()
Definition: G4Scale.cc:66
G4Scale(G4double length, const G4String &annotation="", Direction direction=x, G4bool autoPlacing=true, G4double xmid=0., G4double ymid=0., G4double zmid=0., G4double annotationSize=12.)
Definition: G4Scale.cc:34
double G4double
Definition: G4Types.hh:76
~G4Scale()
Definition: G4Scale.cc:46