CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: FWDetailViewBase.cc,v 1.23 2010/06/18 10:17:15 yana Exp $
12 //
13 
14 // system include files
15 #include "TBox.h"
16 #include "TEllipse.h"
17 #include "TEveViewer.h"
18 
19 // user include files
23 
24 FWDetailViewBase::FWDetailViewBase(const std::type_info& iInfo) :
25  m_item(0),
26  m_helper(iInfo)
27 {
28 }
29 
31 {
32 }
33 
34 
35 void
37 {
38  m_helper.itemChanged(iID.item());
39  build(iID, m_helper.offsetObject(iID.item()->modelData(iID.index())));
40 }
41 
42 const fireworks::Context&
44  return m_item->context();
45 }
46 
47 //______________________________________________________________________________
48 // UTILITIES for Canvas info
49 void
50 FWDetailViewBase::drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t fillColor)
51 {
52  // utility function to draw outline cricle
53 
54  Float_t ratio = 0.5;
55  // fill
56  TEllipse *b2 = new TEllipse(x, y, r, r*ratio);
57  b2->SetFillStyle(1001);
58  b2->SetFillColor(fillColor);
59  b2->Draw();
60 
61  // outline
62  TEllipse *b1 = new TEllipse(x, y, r, r*ratio);
63  b1->SetFillStyle(0);
64  b1->SetLineWidth(2);
65  b1->Draw();
66 }
67 
68 void
69 FWDetailViewBase::drawCanvasBox( Double_t *pos, Color_t fillCol, Int_t fillType, bool bg)
70 {
71  // utility function to draw outline box
72 
73  // background
74  if (bg)
75  {
76  TBox *b1 = new TBox(pos[0], pos[1], pos[2], pos[3]);
77  b1->SetFillColor(fillCol);
78  b1->Draw();
79  }
80 
81  // fill (top layer)
82  TBox *b2 = new TBox(pos[0], pos[1], pos[2], pos[3]);
83  b2->SetFillStyle(fillType);
84  b2->SetFillColor(kBlack);
85  b2->Draw();
86 
87  //outline
88  TBox *b3 = new TBox(pos[0], pos[1], pos[2], pos[3]);
89  b3->SetFillStyle(0);
90  b3->SetLineWidth(2);
91  b3->Draw();
92 }
93 
94 
FWSimpleProxyHelper m_helper
const void * offsetObject(const void *iObj) const
void build(const FWModelId &)
const fireworks::Context & context() const
int index() const
Definition: FWModelId.h:50
const fireworks::Context & context() const
Definition: FWEventItem.h:127
static void drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t)
virtual ~FWDetailViewBase()
FWDetailViewBase(const std::type_info &)
const FWEventItem * m_item
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:567
Definition: DDAxes.h:10
const FWEventItem * item() const
Definition: FWModelId.h:45
void itemChanged(const FWEventItem *)
static void drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)