CMS 3D CMS Logo

FWDetailViewBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWDetailViewBase
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Fri Jan 9 13:35:56 EST 2009
11 //
12 
13 // system include files
14 #include "TBox.h"
15 #include "TEllipse.h"
16 #include "TEveViewer.h"
17 
18 // user include files
22 
23 FWDetailViewBase::FWDetailViewBase(const std::type_info &iInfo) : m_item(nullptr), m_helper(iInfo) {}
24 
26 
28  m_helper.itemChanged(iID.item());
29  build(iID, m_helper.offsetObject(iID.item()->modelData(iID.index())));
30 }
31 
33 
34 //______________________________________________________________________________
35 // UTILITIES for Canvas info
36 void FWDetailViewBase::drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t fillColor) {
37  // utility function to draw outline cricle
38 
39  Float_t ratio = 0.5;
40  // fill
41  TEllipse *b2 = new TEllipse(x, y, r, r * ratio);
42  b2->SetFillStyle(1001);
43  b2->SetFillColor(fillColor);
44  b2->Draw();
45 
46  // outline
47  TEllipse *b1 = new TEllipse(x, y, r, r * ratio);
48  b1->SetFillStyle(0);
49  b1->SetLineWidth(2);
50  b1->Draw();
51 }
52 
53 void FWDetailViewBase::drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType, bool bg) {
54  // utility function to draw outline box
55 
56  // background
57  if (bg) {
58  TBox *b1 = new TBox(pos[0], pos[1], pos[2], pos[3]);
59  b1->SetFillColor(fillCol);
60  b1->Draw();
61  }
62 
63  // fill (top layer)
64  TBox *b2 = new TBox(pos[0], pos[1], pos[2], pos[3]);
65  b2->SetFillStyle(fillType);
66  b2->SetFillColor(kBlack);
67  b2->Draw();
68 
69  //outline
70  TBox *b3 = new TBox(pos[0], pos[1], pos[2], pos[3]);
71  b3->SetFillStyle(0);
72  b3->SetLineWidth(2);
73  b3->Draw();
74 }
FWDetailViewBase::m_item
const FWEventItem * m_item
Definition: FWDetailViewBase.h:61
DDAxes::y
FWSimpleProxyHelper::itemChanged
void itemChanged(const FWEventItem *)
Definition: FWSimpleProxyHelper.cc:62
fireworks::Context
Definition: Context.h:41
FWModelId
Definition: FWModelId.h:28
pos
Definition: PixelAliasList.h:18
FWModelId.h
FWEventItem::modelData
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:466
FWDetailViewBase::drawCanvasBox
static void drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
Definition: FWDetailViewBase.cc:53
DDAxes::x
FWModelId::item
const FWEventItem * item() const
Definition: FWModelId.h:39
FWDetailViewBase::drawCanvasDot
static void drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t)
Definition: FWDetailViewBase.cc:36
b2
static constexpr float b2
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
FWDetailViewBase::~FWDetailViewBase
virtual ~FWDetailViewBase()
Definition: FWDetailViewBase.cc:25
FWDetailViewBase::FWDetailViewBase
FWDetailViewBase(const std::type_info &)
Definition: FWDetailViewBase.cc:23
b1
static constexpr float b1
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
FWEventItem::context
const fireworks::Context & context() const
Definition: FWEventItem.h:121
FWDetailViewBase::m_helper
FWSimpleProxyHelper m_helper
Definition: FWDetailViewBase.h:62
FWModelId::index
int index() const
Definition: FWModelId.h:41
particleFlowDisplacedVertex_cfi.ratio
ratio
Definition: particleFlowDisplacedVertex_cfi.py:93
FWDetailViewBase.h
FWSimpleProxyHelper::offsetObject
const void * offsetObject(const void *iObj) const
Definition: FWSimpleProxyHelper.h:36
FWEventItem.h
alignCSCRings.r
r
Definition: alignCSCRings.py:93
FWDetailViewBase::build
void build(const FWModelId &)
Definition: FWDetailViewBase.cc:27
testProducerWithPsetDescEmpty_cfi.b3
b3
Definition: testProducerWithPsetDescEmpty_cfi.py:36
genVertex_cff.x
x
Definition: genVertex_cff.py:12
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
FWDetailViewBase::context
const fireworks::Context & context() const
Definition: FWDetailViewBase.cc:32
RecoTauValidation_cfi.fillColor
fillColor
Definition: RecoTauValidation_cfi.py:295