CMS 3D CMS Logo

FWSimpleProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWGlimpseSimpleProxyBuilder
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones, Alja Mrak-Tadel
10 // Created: Tue March 28 09:46:41 EST 2010
11 //
12 
13 // system include files
14 #include <memory>
15 
16 // user include files
17 #include "TEveCompound.h"
20 
21 //
22 // constants, enums and typedefs
23 //
24 
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
32 FWSimpleProxyBuilder::FWSimpleProxyBuilder(const std::type_info& iType) : m_helper(iType) {}
33 
34 // FWSimpleProxyBuilder::FWSimpleProxyBuilder(const FWSimpleProxyBuilder& rhs)
35 // {
36 // // do actual copying here;
37 // }
38 
40 
41 //
42 // assignment operators
43 //
44 // const FWSimpleProxyBuilder& FWSimpleProxyBuilder::operator=(const FWSimpleProxyBuilder& rhs)
45 // {
46 // //An exception safe implementation is
47 // FWSimpleProxyBuilder temp(rhs);
48 // swap(rhs);
49 //
50 // return *this;
51 // }
52 
53 //
54 // member functions
55 //
56 
58  for (Product_it i = m_products.begin(); i != m_products.end(); ++i) {
59  if ((*i)->m_elements) {
60  TEveElement* elms = (*i)->m_elements;
61  for (TEveElement::List_i it = elms->BeginChildren(); it != elms->EndChildren(); ++it)
62  (*it)->DestroyElements();
63  }
64  }
65 
66  cleanLocal();
67 }
68 
70  if (iItem) {
71  m_helper.itemChanged(iItem);
72  }
73 }
74 
75 void FWSimpleProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext* vc) {
76  size_t size = iItem->size();
77  TEveElement::List_i pIdx = product->BeginChildren();
78  for (int index = 0; index < static_cast<int>(size); ++index) {
79  TEveElement* itemHolder = nullptr;
80  if (index < product->NumChildren()) {
81  itemHolder = *pIdx;
82  itemHolder->SetRnrSelfChildren(true, true);
83  ++pIdx;
84  } else {
85  itemHolder = createCompound();
86  product->AddElement(itemHolder);
87  }
88  if (iItem->modelInfo(index).displayProperties().isVisible()) {
89  const void* modelData = iItem->modelData(index);
90  build(m_helper.offsetObject(modelData), index, *itemHolder, vc);
91  }
92  }
93 }
94 
96  TEveElementList* product,
97  FWViewType::EType viewType,
98  const FWViewContext* vc) {
99  size_t size = iItem->size();
100  TEveElement::List_i pIdx = product->BeginChildren();
101  for (int index = 0; index < static_cast<int>(size); ++index) {
102  TEveElement* itemHolder = nullptr;
103  if (index < product->NumChildren()) {
104  itemHolder = *pIdx;
105  itemHolder->SetRnrSelfChildren(true, true);
106  ++pIdx;
107  } else {
108  itemHolder = createCompound();
109  product->AddElement(itemHolder);
110  }
111  if (iItem->modelInfo(index).displayProperties().isVisible()) {
112  const void* modelData = iItem->modelData(index);
113  buildViewType(m_helper.offsetObject(modelData), index, *itemHolder, viewType, vc);
114  }
115  }
116 }
117 
119  TEveElement* iCompound,
120  FWViewType::EType viewType,
121  const FWViewContext* vc) {
122  const FWEventItem::ModelInfo& info = iId.item()->modelInfo(iId.index());
123  bool returnValue = false;
124  if (info.displayProperties().isVisible() && iCompound->NumChildren() == 0) {
125  const void* modelData = iId.item()->modelData(iId.index());
126  if (haveSingleProduct())
127  build(m_helper.offsetObject(modelData), iId.index(), *iCompound, vc);
128  else
129  buildViewType(m_helper.offsetObject(modelData), iId.index(), *iCompound, viewType, vc);
130  returnValue = true;
131  }
132  return returnValue;
133 }
134 
135 //
136 // const member functions
137 //
138 
139 //
140 // static member functions
141 //
FWSimpleProxyBuilder::buildViewType
void buildViewType(const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
Definition: FWSimpleProxyBuilder.cc:95
FWSimpleProxyHelper::itemChanged
void itemChanged(const FWEventItem *)
Definition: FWSimpleProxyHelper.cc:62
FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
FWDisplayProperties::isVisible
bool isVisible() const
Definition: FWDisplayProperties.h:51
mps_fire.i
i
Definition: mps_fire.py:355
FWViewType::EType
EType
Definition: FWViewType.h:31
FWModelId
Definition: FWModelId.h:28
FWSimpleProxyBuilder::itemChangedImp
virtual void itemChangedImp(const FWEventItem *)
Definition: FWSimpleProxyBuilder.cc:69
FWEventItem::modelData
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:466
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
FWSimpleProxyBuilder::~FWSimpleProxyBuilder
~FWSimpleProxyBuilder() override
Definition: FWSimpleProxyBuilder.cc:39
FWModelId::item
const FWEventItem * item() const
Definition: FWModelId.h:39
FWProxyBuilderBase::createCompound
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
Definition: FWProxyBuilderBase.cc:374
FWEventItem::ModelInfo
Definition: FWEventItem.h:58
FWSimpleProxyBuilder::m_helper
FWSimpleProxyHelper m_helper
Definition: FWSimpleProxyBuilder.h:59
FWModelId::index
int index() const
Definition: FWModelId.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWSimpleProxyBuilder::typeOfBuilder
static std::string typeOfBuilder()
Used by the plugin system to determine how the proxy uses the data from FWEventItem.
Definition: FWSimpleProxyBuilder.cc:142
FWSimpleProxyBuilder.h
FWSimpleProxyHelper::offsetObject
const void * offsetObject(const void *iObj) const
Definition: FWSimpleProxyHelper.h:36
FWSimpleProxyBuilder::clean
void clean() override
Definition: FWSimpleProxyBuilder.cc:57
FWProxyBuilderBase::Product_it
std::vector< Product * >::iterator Product_it
Definition: FWProxyBuilderBase.h:133
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWSimpleProxyBuilder::visibilityModelChanges
bool visibilityModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *) override
Definition: FWSimpleProxyBuilder.cc:118
FWEventItem.h
FWEventItem::ModelInfo::displayProperties
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
FWViewContext
Definition: FWViewContext.h:32
FWSimpleProxyBuilder::FWSimpleProxyBuilder
FWSimpleProxyBuilder(const std::type_info &iType)
Definition: FWSimpleProxyBuilder.cc:32
FWProxyBuilderBase::cleanLocal
virtual void cleanLocal()
Definition: FWProxyBuilderBase.cc:324
FWEventItem
Definition: FWEventItem.h:56
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
FWProxyBuilderBase::haveSingleProduct
virtual bool haveSingleProduct() const
Definition: FWProxyBuilderBase.h:88
FWProxyBuilderBase::m_products
std::vector< Product * > m_products
Definition: FWProxyBuilderBase.h:135
FWEventItem::size
size_t size() const
Definition: FWEventItem.cc:457
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443