00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // John Allison 21st July 2001. 00031 00032 #ifndef G4SCALE_HH 00033 #define G4SCALE_HH 00034 00035 #include "G4VMarker.hh" 00036 #include "globals.hh" 00037 00038 class G4Scale: public G4VMarker { 00039 00040 public: // With description 00041 00042 enum Direction {x, y, z}; 00043 00044 G4Scale (G4double length, const G4String& annotation = "", 00045 Direction direction = x, 00046 G4bool autoPlacing = true, 00047 G4double xmid = 0., G4double ymid = 0., G4double zmid = 0.); 00048 // This creates a representation of annotated line in the specified 00049 // direction with tick marks at the end. If autoPlacing is true it 00050 // is required to be centred at the front, right, bottom corner of 00051 // the world space, comfortably outside the existing bounding 00052 // box/sphere so that existing objects do not obscure it. Otherwise 00053 // it is required to be drawn with mid-point at (xmid, ymid, zmid). 00054 // 00055 // The auto placing algorithm might be: 00056 // x = xmin + (1 + comfort) * (xmax - xmin) 00057 // y = ymin - comfort * (ymax - ymin) 00058 // z = zmin + (1 + comfort) * (zmax - zmin) 00059 // if direction == x then (x - length,y,z) to (x,y,z) 00060 // if direction == y then (x,y,z) to (x,y + length,z) 00061 // if direction == z then (x,y,z - length) to (x,y,z) 00062 00063 // Uses compiler-generated copy constructor. 00064 00065 ~G4Scale (); 00066 00067 G4double GetLength() const; 00068 const G4String& GetAnnotation() const; 00069 Direction GetDirection() const; 00070 G4bool GetAutoPlacing() const; 00071 G4double GetXmid() const; 00072 G4double GetYmid() const; 00073 G4double GetZmid() const; 00074 00075 static const G4String& GetGuidanceString(); 00076 00077 private: 00078 00079 G4double fLength; 00080 G4String fAnnotation; 00081 Direction fDirection; 00082 G4bool fAutoPlacing; 00083 G4double fXmid, fYmid, fZmid; 00084 static const G4String GuidanceString; 00085 }; 00086 00087 #include "G4Scale.icc" 00088 00089 #endif