Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:11

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
0015 #include <DDEve/Annotation.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <TEveViewer.h>
0018 #include <TGLViewer.h>
0019 
0020 // C/C++ include files
0021 
0022 // Forward declarations
0023 
0024 using namespace dd4hep;
0025 
0026 ClassImp(Annotation)
0027 
0028 /// Standard constructor with initialization
0029 Annotation::Annotation(TEveViewer* v, const std::string& text, float x, float y, Color_t c)  
0030 : TGLAnnotation(v->GetGLViewer(), text.c_str(), x, y)
0031 {
0032   SetTextSize(DefaultTextSize());
0033   SetUseColorSet(kFALSE);
0034   SetTextColor(c);
0035   InstanceCount::increment(this);
0036 }
0037 
0038 /// Default destructor
0039 Annotation::~Annotation() {
0040   InstanceCount::decrement(this);
0041 }
0042 
0043 /// Mouse has entered overlay area.
0044 Bool_t Annotation::MouseEnter(TGLOvlSelectRecord& )   {
0045   fActive = kFALSE;
0046   return kTRUE;
0047 }
0048 
0049 /// Default text size
0050 float Annotation::DefaultTextSize() {
0051   return 0.04; 
0052 }
0053 /// Default margin for placement in bottom left corner
0054 float Annotation::DefaultMargin()   { 
0055   return 0.01; 
0056 }