Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:37

0001 // -*- C++ -*-
0002 //
0003 // Package:     Core
0004 // Class  :     FWDetailViewBase
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Fri Jan  9 13:35:56 EST 2009
0011 //
0012 
0013 // system include files
0014 #include "TBox.h"
0015 #include "TEllipse.h"
0016 #include "TEveViewer.h"
0017 
0018 // user include files
0019 #include "Fireworks/Core/interface/FWDetailViewBase.h"
0020 #include "Fireworks/Core/interface/FWModelId.h"
0021 #include "Fireworks/Core/interface/FWEventItem.h"
0022 
0023 FWDetailViewBase::FWDetailViewBase(const std::type_info &iInfo) : m_item(nullptr), m_helper(iInfo) {}
0024 
0025 FWDetailViewBase::~FWDetailViewBase() {}
0026 
0027 void FWDetailViewBase::build(const FWModelId &iID) {
0028   m_helper.itemChanged(iID.item());
0029   build(iID, m_helper.offsetObject(iID.item()->modelData(iID.index())));
0030 }
0031 
0032 const fireworks::Context &FWDetailViewBase::context() const { return m_item->context(); }
0033 
0034 //______________________________________________________________________________
0035 // UTILITIES for Canvas info
0036 void FWDetailViewBase::drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t fillColor) {
0037   // utility function to draw outline cricle
0038 
0039   Float_t ratio = 0.5;
0040   // fill
0041   TEllipse *b2 = new TEllipse(x, y, r, r * ratio);
0042   b2->SetFillStyle(1001);
0043   b2->SetFillColor(fillColor);
0044   b2->Draw();
0045 
0046   // outline
0047   TEllipse *b1 = new TEllipse(x, y, r, r * ratio);
0048   b1->SetFillStyle(0);
0049   b1->SetLineWidth(2);
0050   b1->Draw();
0051 }
0052 
0053 void FWDetailViewBase::drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType, bool bg) {
0054   // utility function to draw outline box
0055 
0056   // background
0057   if (bg) {
0058     TBox *b1 = new TBox(pos[0], pos[1], pos[2], pos[3]);
0059     b1->SetFillColor(fillCol);
0060     b1->Draw();
0061   }
0062 
0063   // fill  (top layer)
0064   TBox *b2 = new TBox(pos[0], pos[1], pos[2], pos[3]);
0065   b2->SetFillStyle(fillType);
0066   b2->SetFillColor(kBlack);
0067   b2->Draw();
0068 
0069   //outline
0070   TBox *b3 = new TBox(pos[0], pos[1], pos[2], pos[3]);
0071   b3->SetFillStyle(0);
0072   b3->SetLineWidth(2);
0073   b3->Draw();
0074 }