Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:09

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // 
0029 // John Allison  17/11/96.
0030 
0031 // Class Description:
0032 // Text, i.e., a character string, is used to visualize various kinds of 
0033 // description, particle name, energy, coordinate names etc. Text is 
0034 // described by the class G4Text. The following constructors are supported: 
0035 // 
0036 //      //----- Constructors of G4Text
0037 //      G4Text (const G4String& text);
0038 //      G4Text (const G4String& text, const G4Point3D& pos);
0039 // 
0040 // where the argument text is the text (string) to be visualized, and pos 
0041 // is the 3D position at which the text is visualized.  Note that class 
0042 // G4Text inherits G4VMarker.  Size of text is recognized as "font size", 
0043 // i.e., height of the text. All the access functions defined for class 
0044 // G4VMarker are available. In addition, the following access functions 
0045 // are available, too: 
0046 // 
0047 //      //----- Set functions of G4Text
0048 //      void G4Text::SetText ( const G4String& text ) ;
0049 //      void G4Text::SetOffset ( double dx, double dy ) ;
0050 // 
0051 //      //----- Get functions of G4Text
0052 //      G4String G4Text::GetText () const;
0053 //      G4double G4Text::GetXOffset () const;
0054 //      G4double G4Text::GetYOffset () const;
0055 // 
0056 // Method SetText() defines text to be visualized, and GetText() returns 
0057 // the defined text. Method SetOffset() defines x (horizontal) and 
0058 // y (vertical) offsets in the screen coordinates. By default, both offsets 
0059 // are zero, and the text starts from the 3D position given to the 
0060 // constructor or to the method G4VMarker:SetPosition(). Offsets should be 
0061 // given with the same units as the one adopted for the size, i.e., 
0062 // world-size or screen-size units. 
0063 // Class Description - End:
0064 
0065 
0066 #ifndef G4TEXT_HH
0067 #define G4TEXT_HH
0068 
0069 #include "G4VMarker.hh"
0070 #include "globals.hh"
0071 
0072 class G4Text: public G4VMarker {
0073 
0074 public: // With description
0075 
0076   enum Layout {left, centre, right};
0077   G4Text (const G4String& text = "none");
0078   G4Text (const G4String& text, const G4Point3D& position);
0079   G4Text (const G4VMarker&);
0080   G4Text (const G4Text&) = default;
0081   G4Text (G4Text&&) = default;
0082   ~G4Text () override;
0083   G4Text& operator= (const G4Text&) = default;
0084   G4Text& operator= (G4Text&&) = default;
0085 
0086   G4String GetText   () const;
0087   Layout   GetLayout () const;
0088 
0089   G4double GetXOffset () const ;
0090   G4double GetYOffset () const ;
0091 
0092   void SetText   (const G4String& text);
0093   void SetLayout (Layout);
0094 
0095   void SetOffset (double dx, double dy) ;   
0096 
0097 private:
0098   G4String fText;
0099   Layout   fLayout;
0100   G4double fXOffset, fYOffset;
0101 };
0102 
0103 #include "G4Text.icc"
0104 
0105 std::ostream& operator<< (std::ostream& os, const G4Text&);
0106 std::ostream& operator<< (std::ostream& os, G4Text::Layout);
0107 
0108 #endif