Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveTableProxyBuilder.cxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2020
3
4/*************************************************************************
5 * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TClass.h"
18#include <ROOT/REveManager.hxx>
19
20using namespace ROOT::Experimental;
21
23{
24 fTable = new REveDataTable("ProxyTable");
25}
26
28{
29 fTable->Destroy();
30 fTable = nullptr;
31}
32
33// reuse table product
35{
36}
37
38void REveTableProxyBuilder::Build(const REveDataCollection* collection, REveElement* product, const REveViewContext* context)
39{
40 REveTableViewInfo* info = context->GetTableViewInfo();
41 if (info->GetDisplayedCollection() != Collection()->GetElementId())
42 {
43 return;
44 }
45
46 if (product->NumChildren() == 0) {
47 product->AddElement(fTable);
48 }
49
50 // printf("-----REveTableProxyBuilder::Build() body for %s (%p, %p)\n",collection->GetCName(), collection, Collection() );
51
52 if (info->GetConfigChanged() || fTable->NumChildren() == 0) {
54 REveTableHandle::Entries_t& tableEntries = context->GetTableViewInfo()->RefTableEntries(collection->GetItemClass()->GetName());
55 for (const REveTableEntry& spec : tableEntries) {
56 auto c = new REveDataColumn(spec.fName.c_str());
58 using namespace std::string_literals;
59 std::string exp = spec.fExpression;
60 c->SetExpressionAndType(exp.c_str(), spec.fType);
61 c->SetPrecision(spec.fPrecision);
62 }
63 }
65}
66
67
68
70{
72 fTable->SetCollection(collection);
73}
74
76{
77 // printf("REveTableProxyBuilder::ModelChanges\n");
79}
80
82 Build();
83}
#define c(i)
Definition RSha256.hxx:101
double exp(double)
void SetCollection(const REveDataCollection *col)
virtual void Destroy()
Destroy this element.
virtual void AddElement(REveElement *el)
Add el to the list of children.
virtual void DestroyElements()
Destroy all children of this element.
std::vector< REveTableEntry > Entries_t
void SetCollection(REveDataCollection *) override
virtual void ModelChanges(const REveDataCollection::Ids_t &, REveDataProxyBuilderBase::Product *p) override
REveTableHandle::Entries_t & RefTableEntries(std::string cname)
Find column definitions for given class name.
REveTableViewInfo * GetTableViewInfo() const
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47