DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Annotation.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include <DDEve/Annotation.h>
16 #include <DD4hep/InstanceCount.h>
17 #include <TEveViewer.h>
18 #include <TGLViewer.h>
19 
20 // C/C++ include files
21 
22 // Forward declarations
23 
24 using namespace dd4hep;
25 
27 
28 Annotation::Annotation(TEveViewer* v, const std::string& text, float x, float y, Color_t c)
30 : TGLAnnotation(v->GetGLViewer(), text.c_str(), x, y)
31 {
32  SetTextSize(DefaultTextSize());
33  SetUseColorSet(kFALSE);
34  SetTextColor(c);
35  InstanceCount::increment(this);
36 }
37 
39 Annotation::~Annotation() {
41 }
42 
44 Bool_t Annotation::MouseEnter(TGLOvlSelectRecord& ) {
45  fActive = kFALSE;
46  return kTRUE;
47 }
48 
51  return 0.04;
52 }
55  return 0.01;
56 }
dd4hep::Annotation::MouseEnter
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered overlay area.
Definition: Annotation.cpp:44
dd4hep::Annotation::Annotation
Annotation(TEveViewer *v, const std::string &text, float x, float y, Color_t c)
Standard constructor with initialization.
dd4hep::Annotation::DefaultTextSize
static float DefaultTextSize()
Default text size.
Definition: Annotation.cpp:50
v
View * v
Definition: MultiView.cpp:28
dd4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition: InstanceCount.h:102
dd4hep::Annotation::DefaultMargin
static float DefaultMargin()
Default margin for placement in bottom left corner.
Definition: Annotation.cpp:54
TGLAnnotation
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:29
dd4hep::Annotation
Class to add annotations to eve viewers.
Definition: Annotation.h:34
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
InstanceCount.h
ClassImp
ClassImp(Annotation) Annotation
Standard constructor with initialization.
Definition: Annotation.cpp:26
Annotation.h