Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
// -*- C++ -*-
//
// Package:     Core
// Class  :     FWDetailViewBase
//
// Implementation:
//     <Notes on implementation>
//
// Original Author:  Chris Jones
//         Created:  Fri Jan  9 13:35:56 EST 2009
//

// system include files
#include "TBox.h"
#include "TEllipse.h"
#include "TEveViewer.h"

// user include files
#include "Fireworks/Core/interface/FWDetailViewBase.h"
#include "Fireworks/Core/interface/FWModelId.h"
#include "Fireworks/Core/interface/FWEventItem.h"

FWDetailViewBase::FWDetailViewBase(const std::type_info &iInfo) : m_item(nullptr), m_helper(iInfo) {}

FWDetailViewBase::~FWDetailViewBase() {}

void FWDetailViewBase::build(const FWModelId &iID) {
  m_helper.itemChanged(iID.item());
  build(iID, m_helper.offsetObject(iID.item()->modelData(iID.index())));
}

const fireworks::Context &FWDetailViewBase::context() const { return m_item->context(); }

//______________________________________________________________________________
// UTILITIES for Canvas info
void FWDetailViewBase::drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t fillColor) {
  // utility function to draw outline cricle

  Float_t ratio = 0.5;
  // fill
  TEllipse *b2 = new TEllipse(x, y, r, r * ratio);
  b2->SetFillStyle(1001);
  b2->SetFillColor(fillColor);
  b2->Draw();

  // outline
  TEllipse *b1 = new TEllipse(x, y, r, r * ratio);
  b1->SetFillStyle(0);
  b1->SetLineWidth(2);
  b1->Draw();
}

void FWDetailViewBase::drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType, bool bg) {
  // utility function to draw outline box

  // background
  if (bg) {
    TBox *b1 = new TBox(pos[0], pos[1], pos[2], pos[3]);
    b1->SetFillColor(fillCol);
    b1->Draw();
  }

  // fill  (top layer)
  TBox *b2 = new TBox(pos[0], pos[1], pos[2], pos[3]);
  b2->SetFillStyle(fillType);
  b2->SetFillColor(kBlack);
  b2->Draw();

  //outline
  TBox *b3 = new TBox(pos[0], pos[1], pos[2], pos[3]);
  b3->SetFillStyle(0);
  b3->SetLineWidth(2);
  b3->Draw();
}