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.hh,v 1.7 2006/06/29 19:05:56 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // John Allison 21st July 2001. |
---|
32 | |
---|
33 | #ifndef G4SCALE_HH |
---|
34 | #define G4SCALE_HH |
---|
35 | |
---|
36 | #include "G4VMarker.hh" |
---|
37 | #include "globals.hh" |
---|
38 | |
---|
39 | class G4Scale: public G4VMarker { |
---|
40 | |
---|
41 | public: // With description |
---|
42 | |
---|
43 | enum Direction {x, y, z}; |
---|
44 | |
---|
45 | G4Scale (G4double length, const G4String& annotation = "", |
---|
46 | Direction direction = x, |
---|
47 | G4bool autoPlacing = true, |
---|
48 | G4double xmid = 0., G4double ymid = 0., G4double zmid = 0.); |
---|
49 | // This creates a representation of annotated line in the specified |
---|
50 | // direction with tick marks at the end. If autoPlacing is true it |
---|
51 | // is required to be centred at the front, right, bottom corner of |
---|
52 | // the world space, comfortably outside the existing bounding |
---|
53 | // box/sphere so that existing objects do not obscure it. Otherwise |
---|
54 | // it is required to be drawn with mid-point at (xmid, ymid, zmid). |
---|
55 | // |
---|
56 | // The auto placing algorithm might be: |
---|
57 | // x = xmin + (1 + comfort) * (xmax - xmin) |
---|
58 | // y = ymin - comfort * (ymax - ymin) |
---|
59 | // z = zmin + (1 + comfort) * (zmax - zmin) |
---|
60 | // if direction == x then (x - length,y,z) to (x,y,z) |
---|
61 | // if direction == y then (x,y,z) to (x,y + length,z) |
---|
62 | // if direction == z then (x,y,z - length) to (x,y,z) |
---|
63 | |
---|
64 | // Uses compiler-generated copy constructor. |
---|
65 | |
---|
66 | ~G4Scale (); |
---|
67 | |
---|
68 | G4double GetLength() const; |
---|
69 | const G4String& GetAnnotation() const; |
---|
70 | Direction GetDirection() const; |
---|
71 | G4bool GetAutoPlacing() const; |
---|
72 | G4double GetXmid() const; |
---|
73 | G4double GetYmid() const; |
---|
74 | G4double GetZmid() const; |
---|
75 | |
---|
76 | static const G4String& GetGuidanceString(); |
---|
77 | |
---|
78 | private: |
---|
79 | |
---|
80 | G4double fLength; |
---|
81 | G4String fAnnotation; |
---|
82 | Direction fDirection; |
---|
83 | G4bool fAutoPlacing; |
---|
84 | G4double fXmid, fYmid, fZmid; |
---|
85 | static const G4String GuidanceString; |
---|
86 | }; |
---|
87 | |
---|
88 | #include "G4Scale.icc" |
---|
89 | |
---|
90 | #endif |
---|