CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWInteractionList Class Reference

#include <Fireworks/Core/interface/FWInteractionList.h>

Public Member Functions

void added (TEveElement *, unsigned int)
 
bool empty () const
 
 FWInteractionList (const FWEventItem *item)
 
const FWEventItemitem () const
 
void itemChanged ()
 
void modelChanges (const std::set< FWModelId > &)
 
virtual ~FWInteractionList ()
 

Private Member Functions

 FWInteractionList (const FWInteractionList &)=delete
 
const FWInteractionListoperator= (const FWInteractionList &)=delete
 

Private Attributes

std::vector< TEveCompound * > m_compounds
 
const FWEventItemm_item
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 33 of file FWInteractionList.h.

Constructor & Destructor Documentation

◆ FWInteractionList() [1/2]

FWInteractionList::FWInteractionList ( const FWEventItem item)

Definition at line 35 of file FWInteractionList.cc.

35 : m_item(item) {}

◆ ~FWInteractionList()

FWInteractionList::~FWInteractionList ( )
virtual

Definition at line 42 of file FWInteractionList.cc.

42  {
43  for (std::vector<TEveCompound*>::iterator i = m_compounds.begin(); i != m_compounds.end(); ++i) {
44  // Interaction are created only in the standard use case, where user data is FWFromEveSelectorBase.
45  // This is defined with return value of virtual function FWPRoxyBuilderBase::willHandleInteraction().
46 
47  if ((*i)->GetUserData())
48  delete reinterpret_cast<FWFromEveSelectorBase*>((*i)->GetUserData());
49 
50  (*i)->RemoveElements();
51  (*i)->DecDenyDestroy();
52  }
53 }

References mps_fire::i, and m_compounds.

◆ FWInteractionList() [2/2]

FWInteractionList::FWInteractionList ( const FWInteractionList )
privatedelete

Member Function Documentation

◆ added()

void FWInteractionList::added ( TEveElement *  el,
unsigned int  idx 
)

This function is called from FWProxyBuilderBase::build() function (e.g. on next event). The PB build function creates TEveElement for each element of collection and calls this function to add the element to "master" element, which is a TEveCompound.

Definition at line 63 of file FWInteractionList.cc.

63  {
64  // In the case a compound for the given index already exists, just add
65  // the TEveElement to it, otherwise create a new one.
66  if (idx < m_compounds.size()) {
67  m_compounds[idx]->AddElement(el);
68  return;
69  }
70 
71  // Prepare name for the tooltip on mouseover in GL viewer.Value of
72  // tooltip is TEveElement::fTitle
76 
77  TEveCompound* c = new TEveCompound(name.c_str(), name.c_str());
78  c->EnableListElements(m_item->defaultDisplayProperties().isVisible());
79  c->SetMainColor(m_item->defaultDisplayProperties().color());
80  c->SetMainTransparency(m_item->defaultDisplayProperties().transparency());
81 
82  // Set flags to propagat attributes.
83  c->CSCImplySelectAllChildren();
84  c->CSCApplyMainColorToAllChildren();
85  c->CSCApplyMainTransparencyToAllChildren();
86 
87  // TEveElement is auto-destroyed if is is not added to any parent. Alternative could
88  // be to use increase/decrease reference count.
89  c->IncDenyDestroy();
90  // FWModelIdFromEveSelector is needed for interaction from Eve to Fireworks.
91  // FWEveViewManager gets ROOT signals with selected objects (TEveCompound)
92  // then cals doSelect() on the compound's user data.
93  c->SetUserData(new FWModelIdFromEveSelector(FWModelId(m_item, idx)));
94  // Order does not matter. What is added to TEveCompound is not concern of interaction list.
95  // Interaction list operates ony with the compound.
96  m_compounds.push_back(c);
97  m_compounds.back()->AddElement(el);
98  // printf("%s[%d] FWInteractionList::added has childern %d\n",m_item->name().c_str(), idx, m_compounds[idx]->NumChildren());
99 }

References c, FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), FWEventItem::haveInterestingValue(), heavyIonCSV_trainingSettings::idx, FWDisplayProperties::isVisible(), m_compounds, m_item, FWEventItem::modelInterestingValueAsString(), FWEventItem::modelName(), Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and FWDisplayProperties::transparency().

Referenced by FWSimpleProxyBuilderTemplate< TrajectorySeed >::build().

◆ empty()

bool FWInteractionList::empty ( void  ) const
inline

Definition at line 41 of file FWInteractionList.h.

41 { return m_compounds.empty(); }

References m_compounds.

◆ item()

const FWEventItem* FWInteractionList::item ( ) const
inline

Definition at line 40 of file FWInteractionList.h.

40 { return m_item; }

References m_item.

◆ itemChanged()

void FWInteractionList::itemChanged ( )

This method is called from FWEveViewManager::itemChanged(), which is a callback of signal FWEventItem::itemChanged_.

Definition at line 130 of file FWInteractionList.cc.

130  {
131  for (size_t i = 0, e = m_item->size(); i < e; ++i) {
132  // Assert for sizes is not necessary, becuse it is already in a
133  // proxy builder.
134  TEveElement* comp = m_compounds[i];
135 
139 
140  comp->SetElementTitle(name.c_str());
141 
143  const FWDisplayProperties& p = info.displayProperties();
144 
145  if (p.isVisible() != comp->GetRnrSelf())
146  comp->EnableListElements(p.isVisible(), p.isVisible());
147 
148  if (p.color() != comp->GetMainColor())
149  comp->SetMainColor(p.color());
150 
151  if (p.transparency() != comp->GetMainTransparency())
152  comp->SetMainTransparency(p.transparency());
153  }
154 }

References AlCaHLTBitMon_QueryRunRegistry::comp, MillePedeFileConverter_cfg::e, FWEventItem::haveInterestingValue(), mps_fire::i, info(), m_compounds, m_item, FWEventItem::modelInfo(), FWEventItem::modelInterestingValueAsString(), FWEventItem::modelName(), Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, FWEventItem::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ modelChanges()

void FWInteractionList::modelChanges ( const std::set< FWModelId > &  iIds)

This method is called from FWEveViewManager::modelChanges(), which has modelChanges callback same as all other view maangers.

Definition at line 104 of file FWInteractionList.cc.

104  {
105  assert(m_compounds.size() >= m_item->size());
106 
107  for (std::set<FWModelId>::const_iterator it = iIds.begin(); it != iIds.end(); ++it) {
108  const FWEventItem::ModelInfo& info = m_item->modelInfo(it->index());
109  // std::cout <<" FWInteractionList::modelChanges color "<< info.displayProperties().color() << "(*it).index() " <<(*it).index() << " " << m_item->name() <<std::endl;
110  const FWDisplayProperties& p = info.displayProperties();
111  TEveElement* comp = m_compounds[it->index()];
112  comp->EnableListElements(p.isVisible(), p.isVisible());
113  comp->SetMainColor(p.color());
114  comp->SetMainTransparency(p.transparency());
115 
116  if (info.isSelected()) {
117  if (comp->GetSelectedLevel() != 1)
118  gEve->GetSelection()->AddElement(comp);
119  } else {
120  if (comp->GetSelectedLevel() == 1)
121  gEve->GetSelection()->RemoveElement(comp);
122  }
123  }
124 }

References cms::cuda::assert(), AlCaHLTBitMon_QueryRunRegistry::comp, info(), m_compounds, m_item, FWEventItem::modelInfo(), AlCaHLTBitMon_ParallelJobs::p, and FWEventItem::size().

◆ operator=()

const FWInteractionList& FWInteractionList::operator= ( const FWInteractionList )
privatedelete

Member Data Documentation

◆ m_compounds

std::vector<TEveCompound*> FWInteractionList::m_compounds
private

Definition at line 59 of file FWInteractionList.h.

Referenced by added(), empty(), itemChanged(), modelChanges(), and ~FWInteractionList().

◆ m_item

const FWEventItem* FWInteractionList::m_item
private

Definition at line 60 of file FWInteractionList.h.

Referenced by added(), item(), itemChanged(), and modelChanges().

FWInteractionList::item
const FWEventItem * item() const
Definition: FWInteractionList.h:40
AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
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:428
FWModelId
Definition: FWModelId.h:28
FWEventItem::modelInterestingValueAsString
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:486
cms::cuda::assert
assert(be >=bs)
FWInteractionList::m_item
const FWEventItem * m_item
Definition: FWInteractionList.h:60
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
FWDisplayProperties::color
Color_t color() const
Definition: FWDisplayProperties.h:47
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
FWEventItem::defaultDisplayProperties
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
FWEventItem::ModelInfo
Definition: FWEventItem.h:58
FWModelIdFromEveSelector
Definition: FWModelIdFromEveSelector.h:29
FWDisplayProperties::transparency
Char_t transparency() const
Definition: FWDisplayProperties.h:49
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FWEventItem::modelName
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
FWInteractionList::m_compounds
std::vector< TEveCompound * > m_compounds
Definition: FWInteractionList.h:59
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWDisplayProperties
Definition: FWDisplayProperties.h:28
FWEventItem::haveInterestingValue
bool haveInterestingValue() const
Definition: FWEventItem.cc:482
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
FWEventItem::size
size_t size() const
Definition: FWEventItem.cc:457
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37