CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
const FWInteractionListoperator= (const FWInteractionList &)
 

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::FWInteractionList ( const FWEventItem item)

Definition at line 38 of file FWInteractionList.cc.

39  : m_item(item)
40 {}
const FWEventItem * m_item
FWInteractionList::~FWInteractionList ( )
virtual

Definition at line 47 of file FWInteractionList.cc.

References i, and m_compounds.

48 {
49  for ( std::vector<TEveCompound*>::iterator i = m_compounds.begin(); i != m_compounds.end(); ++i)
50  {
51  // Interaction are created only in the standard use case, where user data is FWFromEveSelectorBase.
52  // This is defined with return value of virtual function FWPRoxyBuilderBase::willHandleInteraction().
53 
54  if ((*i)->GetUserData())
55  delete reinterpret_cast<FWFromEveSelectorBase*>((*i)->GetUserData());
56 
57  (*i)->RemoveElements();
58  (*i)->DecDenyDestroy();
59  }
60 }
int i
Definition: DBlmapReader.cc:9
std::vector< TEveCompound * > m_compounds
FWInteractionList::FWInteractionList ( const FWInteractionList )
private

Member Function Documentation

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 72 of file FWInteractionList.cc.

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

Referenced by FWProxyBuilderBase::build().

73 {
74 
75  // In the case a compound for the given index already exists, just add
76  // the TEveElement to it, otherwise create a new one.
77  if (idx < m_compounds.size())
78  {
79  m_compounds[idx]->AddElement(el);
80  return;
81  }
82 
83  // Prepare name for the tooltip on mouseover in GL viewer.Value of
84  // tooltip is TEveElement::fTitle
88 
89  TEveCompound* c = new TEveCompound(name.c_str(), name.c_str());
90  c->EnableListElements(m_item->defaultDisplayProperties().isVisible());
91  c->SetMainColor(m_item->defaultDisplayProperties().color());
92  c->SetMainTransparency(m_item->defaultDisplayProperties().transparency());
93 
94  // Set flags to propagat attributes.
95  c->CSCImplySelectAllChildren();
96  c->CSCApplyMainColorToAllChildren();
97  c->CSCApplyMainTransparencyToAllChildren();
98 
99  // TEveElement is auto-destroyed if is is not added to any parent. Alternative could
100  // be to use increase/decrease reference count.
101  c->IncDenyDestroy();
102  // FWModelIdFromEveSelector is needed for interaction from Eve to Fireworks.
103  // FWEveViewManager gets ROOT signals with selected objects (TEveCompound)
104  // then cals doSelect() on the compound's user data.
105  c->SetUserData(new FWModelIdFromEveSelector(FWModelId(m_item, idx)));
106  // Order does not matter. What is added to TEveCompound is not concern of interaction list.
107  // Interaction list operates ony with the compound.
108  m_compounds.push_back(c);
109  m_compounds.back()->AddElement(el);
110  // printf("%s[%d] FWInteractionList::added has childern %d\n",m_item->name().c_str(), idx, m_compounds[idx]->NumChildren());
111 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:575
bool haveInterestingValue() const
Definition: FWEventItem.cc:588
Color_t color() const
const FWEventItem * m_item
Char_t transparency() const
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:595
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< TEveCompound * > m_compounds
bool FWInteractionList::empty ( void  ) const
inline

Definition at line 42 of file FWInteractionList.h.

References m_compounds.

Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

42 { return m_compounds.empty(); }
std::vector< TEveCompound * > m_compounds
const FWEventItem* FWInteractionList::item ( ) const
inline
void FWInteractionList::itemChanged ( )

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

Definition at line 150 of file FWInteractionList.cc.

References FWDisplayProperties::color(), AlCaHLTBitMon_QueryRunRegistry::comp, FWEventItem::ModelInfo::displayProperties(), alignCSCRings::e, FWEventItem::haveInterestingValue(), i, info, FWDisplayProperties::isVisible(), m_compounds, m_item, FWEventItem::modelInfo(), FWEventItem::modelInterestingValueAsString(), FWEventItem::modelName(), mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, FWEventItem::size(), AlCaHLTBitMon_QueryRunRegistry::string, and FWDisplayProperties::transparency().

151 { for (size_t i = 0, e = m_item->size(); i < e; ++i)
152  {
153  // Assert for sizes is not necessary, becuse it is already in a
154  // proxy builder.
155  TEveElement* comp = m_compounds[i];
156 
160 
161  comp->SetElementTitle(name.c_str());
162 
164  const FWDisplayProperties &p = info.displayProperties();
165 
166  if (p.isVisible() != comp->GetRnrSelf())
167  comp->EnableListElements(p.isVisible(), p.isVisible());
168 
169  if (p.color() != comp->GetMainColor())
170  comp->SetMainColor(p.color());
171 
172  if (p.transparency() != comp->GetMainTransparency())
173  comp->SetMainTransparency(p.transparency());
174 
175  }
176 }
int i
Definition: DBlmapReader.cc:9
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:575
bool haveInterestingValue() const
Definition: FWEventItem.cc:588
Color_t color() const
const FWEventItem * m_item
Char_t transparency() const
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:595
size_t size() const
Definition: FWEventItem.cc:549
std::vector< TEveCompound * > m_compounds
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
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 118 of file FWInteractionList.cc.

References FWDisplayProperties::color(), AlCaHLTBitMon_QueryRunRegistry::comp, FWEventItem::ModelInfo::displayProperties(), info, FWEventItem::ModelInfo::isSelected(), FWDisplayProperties::isVisible(), m_compounds, m_item, FWEventItem::modelInfo(), AlCaHLTBitMon_ParallelJobs::p, FWEventItem::size(), and FWDisplayProperties::transparency().

119 {
120  assert (m_compounds.size() >= m_item->size());
121 
122  for (std::set<FWModelId>::const_iterator it = iIds.begin(); it != iIds.end(); ++it)
123  {
124  const FWEventItem::ModelInfo& info = m_item->modelInfo(it->index());
125  // std::cout <<" FWInteractionList::modelChanges color "<< info.displayProperties().color() << "(*it).index() " <<(*it).index() << " " << m_item->name() <<std::endl;
126  const FWDisplayProperties &p = info.displayProperties();
127  TEveElement* comp = m_compounds[it->index()];
128  comp->EnableListElements(p.isVisible(), p.isVisible());
129  comp->SetMainColor(p.color());
130  comp->SetMainTransparency(p.transparency());
131 
132  if (info.isSelected())
133  {
134  if (comp->GetSelectedLevel() != 1)
135  gEve->GetSelection()->AddElement(comp);
136  }
137  else
138  {
139  if (comp->GetSelectedLevel() == 1)
140  gEve->GetSelection()->RemoveElement(comp);
141  }
142  }
143 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
bool isSelected() const
Definition: FWEventItem.h:71
Color_t color() const
const FWEventItem * m_item
Char_t transparency() const
size_t size() const
Definition: FWEventItem.cc:549
std::vector< TEveCompound * > m_compounds
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
const FWInteractionList& FWInteractionList::operator= ( const FWInteractionList )
private

Member Data Documentation

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

Definition at line 60 of file FWInteractionList.h.

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

const FWEventItem* FWInteractionList::m_item
private

Definition at line 61 of file FWInteractionList.h.

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