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 17/11/96. 00031 00032 // Class Description: 00033 // Text, i.e., a character string, is used to visualize various kinds of 00034 // description, particle name, energy, coordinate names etc. Text is 00035 // described by the class G4Text. The following constructors are supported: 00036 // 00037 // //----- Constructors of G4Text 00038 // G4Text (const G4String& text); 00039 // G4Text (const G4String& text, const G4Point3D& pos); 00040 // 00041 // where the argument text is the text (string) to be visualized, and pos 00042 // is the 3D position at which the text is visualized. Note that class 00043 // G4Text inherits G4VMarker. Size of text is recognized as "font size", 00044 // i.e., height of the text. All the access functions defined for class 00045 // G4VMarker are available. In addition, the following access functions 00046 // are available, too: 00047 // 00048 // //----- Set functions of G4Text 00049 // void G4Text::SetText ( const G4String& text ) ; 00050 // void G4Text::SetOffset ( double dx, double dy ) ; 00051 // 00052 // //----- Get functions of G4Text 00053 // G4String G4Text::GetText () const; 00054 // G4double G4Text::GetXOffset () const; 00055 // G4double G4Text::GetYOffset () const; 00056 // 00057 // Method SetText() defines text to be visualized, and GetText() returns 00058 // the defined text. Method SetOffset() defines x (horizontal) and 00059 // y (vertical) offsets in the screen coordinates. By default, both offsets 00060 // are zero, and the text starts from the 3D position given to the 00061 // constructor or to the method G4VMarker:SetPosition(). Offsets should be 00062 // given with the same units as the one adopted for the size, i.e., 00063 // world-size or screen-size units. 00064 // Class Description - End: 00065 00066 00067 #ifndef G4TEXT_HH 00068 #define G4TEXT_HH 00069 00070 #include "G4VMarker.hh" 00071 #include "globals.hh" 00072 00073 class G4Text: public G4VMarker { 00074 00075 public: // With description 00076 00077 enum Layout {left, centre, right}; 00078 G4Text (const G4String& text); 00079 G4Text (const G4String& text, const G4Point3D& position); 00080 G4Text (const G4VMarker&); 00081 G4Text (const G4Text&); 00082 virtual ~G4Text (); 00083 G4Text& operator= (const G4Text&); 00084 00085 G4String GetText () const; 00086 Layout GetLayout () const; 00087 00088 G4double GetXOffset () const ; 00089 G4double GetYOffset () const ; 00090 00091 void SetText (const G4String& text); 00092 void SetLayout (Layout); 00093 00094 void SetOffset (double dx, double dy) ; 00095 00096 private: 00097 G4String fText; 00098 Layout fLayout; 00099 G4double fXOffset, fYOffset; 00100 }; 00101 00102 #include "G4Text.icc" 00103 00104 std::ostream& operator<< (std::ostream& os, const G4Text&); 00105 std::ostream& operator<< (std::ostream& os, G4Text::Layout); 00106 00107 #endif