Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-17 23:10:43

0001 #include "TCanvas.h"
0002 #include "TGFrame.h"
0003 #include "TEveWindow.h"
0004 #include "TRootEmbeddedCanvas.h"
0005 
0006 template <typename T>
0007 FWDetailViewCanvas<T>::FWDetailViewCanvas() : m_infoCanvas(nullptr), m_guiFrame(nullptr), m_viewCanvas(nullptr) {}
0008 
0009 template <typename T>
0010 FWDetailViewCanvas<T>::~FWDetailViewCanvas() {}
0011 
0012 template <typename T>
0013 void FWDetailViewCanvas<T>::init(TEveWindowSlot* slot) {
0014   TEveWindowPack* pack = slot->MakePack();
0015   pack->SetHorizontal();
0016   pack->SetShowTitleBar(kFALSE);
0017   pack->SetElementNameTitle("DetalView pack", "DetailViewPack");
0018 
0019   // canvas & widgets
0020   TEveWindowFrame* frame = pack->NewSlotWithWeight(1)->MakeFrame();
0021   frame->SetShowTitleBar(kFALSE);
0022   TGCompositeFrame* cf = frame->GetGUICompositeFrame();
0023 
0024   TGCompositeFrame* hf = new TGVerticalFrame(cf);
0025   hf->SetCleanup(kLocalCleanup);
0026   cf->AddFrame(hf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
0027   {
0028     m_guiFrame = new TGVerticalFrame(hf);
0029     hf->AddFrame(m_guiFrame, new TGLayoutHints(kLHintsExpandX));
0030     m_guiFrame->SetCleanup(kDeepCleanup);
0031 
0032     // legend
0033     TRootEmbeddedCanvas* ec = new TRootEmbeddedCanvas("Embeddedcanvas", hf, 100, 100, 0);
0034     hf->AddFrame(ec, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
0035     m_infoCanvas = ec->GetCanvas();
0036     m_infoCanvas->SetHighLightColor(-1);
0037   }
0038 
0039   cf->MapSubwindows();
0040   cf->Layout();
0041   cf->MapWindow();
0042 
0043   // view canvas
0044   TRootEmbeddedCanvas* ec = new TRootEmbeddedCanvas();
0045   TEveWindowFrame* wf = pack->NewSlotWithWeight(3)->MakeFrame(ec);
0046   wf->GetEveFrame()->SetShowTitleBar(kFALSE);
0047   m_viewCanvas = ec->GetCanvas();
0048 
0049   pack->GetEveFrame()->Layout();
0050 }