CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
FWProxyBuilderBase Class Reference

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

Inheritance diagram for FWProxyBuilderBase:
FWCaloDataProxyBuilderBase FWCSCStripDigiProxyBuilder FWCSCWireDigiProxyBuilder FWDigitSetProxyBuilder FWDTDigiProxyBuilder FWPFCandidateWithHitsProxyBuilder FWProxyBuilderTemplate< T > FWProxyBuilderTemplate< EcalRecHit > FWRPCDigiProxyBuilder FWSimpleProxyBuilder FWSimTrackProxyBuilder FWSiPixelClusterDetProxyBuilder FWSiPixelClusterProxyBuilder FWSiPixelDigiProxyBuilder FWSiStripClusterProxyBuilder FWSiStripDigiProxyBuilder FWTauProxyBuilderBase FWTrackProxyBuilderFF

Classes

struct  Product
 

Public Member Functions

void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
virtual void setItem (const FWEventItem *iItem)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Static Public Member Functions

static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 

Protected Types

typedef std::vector< Product * >
::iterator 
Product_it
 

Protected Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 

Protected Attributes

std::vector< Product * > m_products
 

Private Member Functions

void cleanProduct (Product *p)
 
void setProjectionLayer (float)
 

Private Attributes

bool m_haveWindow
 
FWInteractionListm_interactionList
 
const FWEventItemm_item
 
float m_layer
 
bool m_modelsChanged
 
bool m_mustBuild
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 47 of file FWProxyBuilderBase.h.

Member Typedef Documentation

typedef std::vector<Product*>::iterator FWProxyBuilderBase::Product_it
protected

Definition at line 138 of file FWProxyBuilderBase.h.

Constructor & Destructor Documentation

FWProxyBuilderBase::FWProxyBuilderBase ( )

Definition at line 75 of file FWProxyBuilderBase.cc.

75  :
77  m_item(0),
78  m_modelsChanged(false),
79  m_haveWindow(false),
80  m_mustBuild(true),
81  m_layer(0)
82 {
83 }
const FWEventItem * m_item
FWInteractionList * m_interactionList
FWProxyBuilderBase::~FWProxyBuilderBase ( )
virtual

Definition at line 85 of file FWProxyBuilderBase.cc.

References m_products.

86 {
87  m_products.clear();
88 }
std::vector< Product * > m_products
FWProxyBuilderBase::FWProxyBuilderBase ( const FWProxyBuilderBase )
protected

Member Function Documentation

void FWProxyBuilderBase::build ( )

Definition at line 132 of file FWProxyBuilderBase.cc.

References FWInteractionList::added(), buildViewType(), clean(), cmsRelvalreport::exit, fwLog, haveSingleProduct(), i, item(), fwlog::kError, layer(), m_interactionList, m_item, m_mustBuild, m_products, FWEventItem::name(), and FWEventItem::size().

Referenced by FWSimpleProxyBuilder::build(), FWSimpleProxyBuilderTemplate< l1extra::L1JetParticle >::build(), FWCaloTowerProxyBuilderBase::build(), FWHFTowerProxyBuilderBase::build(), itemChanged(), setHaveWindow(), and FWSimpleProxyBuilder::visibilityModelChanges().

133 {
134  if (m_item)
135  {
136  try
137  {
138  size_t itemSize = m_item->size(); //cashed
139 
140  clean();
141  for (Product_it i = m_products.begin(); i != m_products.end(); ++i)
142  {
143  // printf("build() %s \n", m_item->name().c_str());
144  TEveElementList* elms = (*i)->m_elements;
145  size_t oldSize = elms->NumChildren();
146 
147  if (haveSingleProduct())
148  {
149  build(m_item, elms, (*i)->m_viewContext);
150  }
151  else
152  {
153  buildViewType(m_item, elms, (*i)->m_viewType, (*i)->m_viewContext);
154  }
155 
156  // Project all children of current product.
157  // If product is not registered into any projection-manager,
158  // this does nothing.
159  TEveProjectable* pable = dynamic_cast<TEveProjectable*>(elms);
160  if (pable->HasProjecteds())
161  {
162  for (TEveProjectable::ProjList_i i = pable->BeginProjecteds(); i != pable->EndProjecteds(); ++i)
163  {
164  TEveProjectionManager *pmgr = (*i)->GetManager();
165  Float_t oldDepth = pmgr->GetCurrentDepth();
166  pmgr->SetCurrentDepth(item()->layer());
167  size_t cnt = 0;
168 
169  TEveElement* projectedAsElement = (*i)->GetProjectedAsElement();
170  TEveElement::List_i parentIt = projectedAsElement->BeginChildren();
171  for (TEveElement::List_i prodIt = elms->BeginChildren(); prodIt != elms->EndChildren(); ++prodIt, ++cnt)
172  {
173  if (cnt < oldSize)
174  {
175  // reused projected holder
176  pmgr->SubImportChildren(*prodIt, *parentIt);
177  ++parentIt;
178  }
179  else if (cnt < itemSize)
180  {
181  // new product holder
182  pmgr->SubImportElements(*prodIt, projectedAsElement);
183  }
184  else
185  {
186  break;
187  }
188  }
189  pmgr->SetCurrentDepth(oldDepth);
190  }
191  }
192 
193 
194  if (m_interactionList && itemSize > oldSize)
195  {
196  TEveElement::List_i elIt = elms->BeginChildren();
197  for (size_t cnt = 0; cnt < itemSize; ++cnt, ++elIt)
198  {
199  if (cnt >= oldSize )
200  m_interactionList->added(*elIt, cnt);
201  }
202  }
203  }
204  }
205  catch (const std::runtime_error& iException)
206  {
207  fwLog(fwlog::kError) << "Caught exception in build function for item " << m_item->name() << ":\n"
208  << iException.what() << std::endl;
209  exit(1);
210  }
211  }
212  m_mustBuild = false;
213 }
virtual void buildViewType(const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
const std::string & name() const
Definition: FWEventItem.cc:500
const FWEventItem * m_item
void added(TEveElement *, unsigned int)
const FWEventItem * item() const
virtual bool haveSingleProduct() const
size_t size() const
Definition: FWEventItem.cc:548
#define fwLog(_level_)
Definition: fwLog.h:51
FWInteractionList * m_interactionList
void FWProxyBuilderBase::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
protectedvirtual
void FWProxyBuilderBase::buildViewType ( const FWEventItem iItem,
TEveElementList *  ,
FWViewType::EType  ,
const FWViewContext  
)
protectedvirtual

Reimplemented in FWDTDigiProxyBuilder, FWSimpleProxyBuilder, FWCaloTauProxyBuilder, and FWPFTauProxyBuilder.

Definition at line 410 of file FWProxyBuilderBase.cc.

Referenced by build().

411 {
412  assert("virtual buildViewType(const FWEventItem*, TEveElementList*, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
413 }
bool FWProxyBuilderBase::canHandle ( const FWEventItem item)
virtual

Definition at line 277 of file FWProxyBuilderBase.cc.

References m_item, and FWEventItem::purpose().

278 {
279  if (m_item)
280  return (item.purpose() == m_item->purpose());
281 
282  return false;
283 }
const FWEventItem * m_item
const std::string & purpose() const
Definition: FWEventItem.cc:512
void FWProxyBuilderBase::clean ( )
protectedvirtual

Reimplemented in FWSimpleProxyBuilder, and FWSiStripClusterProxyBuilder.

Definition at line 384 of file FWProxyBuilderBase.cc.

References cleanLocal(), i, and m_products.

Referenced by build().

385 {
386  // Cleans local common element list.
387  for (Product_it i = m_products.begin(); i != m_products.end(); ++i)
388  {
389  if ((*i)->m_elements)
390  (*i)->m_elements->DestroyElements();
391  }
392 
393  cleanLocal();
394 }
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
virtual void cleanLocal()
void FWProxyBuilderBase::cleanLocal ( )
protectedvirtual
void FWProxyBuilderBase::cleanProduct ( Product p)
private
const fireworks::Context & FWProxyBuilderBase::context ( ) const

Definition at line 504 of file FWProxyBuilderBase.cc.

References FWEventItem::context(), and m_item.

Referenced by FWTauProxyBuilderBase::addConstituentTracks(), fireworks::addDashedLine(), FWPFCandidateWithHitsProxyBuilder::addHitsForCandidate(), FWTauProxyBuilderBase::addLeadTrack(), FWPFCandidateWithHitsProxyBuilder::build(), FWCaloRecHitDigitSetProxyBuilder::build(), FWPFClusterRPZProxyBuilder::build(), FWElectronLegoProxyBuilder::build(), FWSecVertexProxyBuilder::build(), FWCandidateProxyBuilder::build(), FWSimTrackProxyBuilder::build(), FWTrackProxyBuilder::build(), FWTrackingParticleProxyBuilder::build(), FWGenParticleProxyBuilder::build(), FWPFEcalRecHitRPProxyBuilder::build(), FWPFPatJetLegoProxyBuilder< T >::build(), FWPFPatJet3DProxyBuilder< T >::build(), FWPFCandidate3DProxyBuilder::build(), FWPFCandidatesLegoProxyBuilder::build(), FWPFEcalRecHitLegoProxyBuilder::build(), FWCandidateLegoProxyBuilder::build(), FWVertexProxyBuilder::build(), FWMET3DProxyBuilder::build(), FWTauProxyBuilderBase::buildBaseTau(), FWMuonBuilder::buildMuon(), FWPFBlockProxyBuilder::buildViewType(), FWMETProxyBuilder::buildViewType(), FWJetProxyBuilder::buildViewType(), FWVertexProxyBuilder::localModelChanges(), fireworks::makeRhoPhiSuperCluster(), fireworks::makeRhoZSuperCluster(), FWElectronProxyBuilder::requestCommon(), FWJetProxyBuilder::requestCommon(), FWPFCandidatesLegoProxyBuilder::scaleProduct(), FWCandidateLegoProxyBuilder::scaleProduct(), FWPFPatJetLegoProxyBuilder< T >::scaleProduct(), FWPFClusterLegoProxyBuilder::scaleProduct(), FWPFBlockProxyBuilder::scaleProduct(), FWCaloTowerProxyBuilderBase::setCaloData(), FWTrackProxyBuilderFF::setItem(), FWVertexProxyBuilder::setItem(), FWJetProxyBuilder::setTextPos(), FWPFBlockProxyBuilder::setupClusterElement(), FWPFClusterRPZProxyBuilder::sharedBuild(), and FWPFClusterLegoProxyBuilder::sharedBuild().

505 {
506  return m_item->context();
507 }
const FWEventItem * m_item
const fireworks::Context & context() const
Definition: FWEventItem.h:127
TEveCompound * FWProxyBuilderBase::createCompound ( bool  set_color = true,
bool  propagate_color_to_all_children = false 
) const
protected

Definition at line 459 of file FWProxyBuilderBase.cc.

References trackerHits::c, FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), m_item, and FWDisplayProperties::transparency().

Referenced by FWPFCandidateWithHitsProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWCSCStripDigiProxyBuilder::build(), FWRPCDigiProxyBuilder::build(), FWCSCWireDigiProxyBuilder::build(), FWPFEcalRecHitRPProxyBuilder::build(), FWPFEcalRecHitLegoProxyBuilder::build(), FWSimpleProxyBuilder::build(), FWTrackProxyBuilderFF::build(), FWPFTauProxyBuilder::buildViewType(), FWCaloTauProxyBuilder::buildViewType(), FWSimpleProxyBuilder::buildViewType(), and FWDTDigiProxyBuilder::buildViewType().

460 {
461  TEveCompound* c = new TEveCompound();
462  c->CSCTakeAnyParentAsMaster();
463  c->CSCImplySelectAllChildren();
464  c->SetPickable(true);
465  if (set_color)
466  {
467  c->SetMainColor(m_item->defaultDisplayProperties().color());
468  c->SetMainTransparency(m_item->defaultDisplayProperties().transparency());
469  }
470  if (propagate_color_to_all_children)
471  {
472  c->CSCApplyMainColorToAllChildren();
473  c->CSCApplyMainTransparencyToAllChildren();
474  }
475  else
476  {
477  c->CSCApplyMainColorToMatchingChildren();
478  c->CSCApplyMainTransparencyToMatchingChildren();
479  }
480  return c;
481 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
const FWEventItem * m_item
Color_t color() const
Char_t transparency() const
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
Definition: eve_macros.cc:154
TEveElementList * FWProxyBuilderBase::createProduct ( FWViewType::EType  viewType,
const FWViewContext viewContext 
)

Definition at line 288 of file FWProxyBuilderBase.cc.

References havePerViewProduct(), haveSingleProduct(), i, item(), FWProxyBuilderBase::Product::m_elements, m_products, FWProxyBuilderBase::Product::m_scaleConnection, mergeVDriftHistosByStation::name, scaleChanged(), and FWViewContext::scaleChanged_.

Referenced by FWEveViewManager::newItem().

289 {
290  if ( havePerViewProduct(viewType) == false && m_products.empty() == false)
291  {
292  if (haveSingleProduct())
293  {
294  return m_products.back()->m_elements;
295  }
296  else
297  {
298  for (Product_it i = m_products.begin(); i!= m_products.end(); ++i)
299  {
300  if (viewType == (*i)->m_viewType)
301  return (*i)->m_elements;
302  }
303  }
304  }
305 
306  // printf("new product %s for item %s \n", FWViewType::idToName(viewType).c_str(), item()->name().c_str()); fflush(stdout);
307 
308  Product* product = new Product(viewType, viewContext);
309  m_products.push_back(product);
310  if (viewContext)
311  {
312  product->m_scaleConnection = viewContext->scaleChanged_.connect(boost::bind(&FWProxyBuilderBase::scaleChanged, this, _1));
313  }
314 
315  if (item())
316  {
317  // debug info in eve browser
318  product->m_elements->SetElementName(item()->name().c_str());
319  }
320  return product->m_elements;
321 }
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
virtual bool havePerViewProduct(FWViewType::EType) const
void scaleChanged(const FWViewContext *)
const FWEventItem * item() const
sigc::signal< void, const FWViewContext * > scaleChanged_
Definition: FWViewContext.h:44
virtual bool haveSingleProduct() const
bool FWProxyBuilderBase::getHaveWindow ( ) const
inline

Definition at line 102 of file FWProxyBuilderBase.h.

References m_haveWindow.

Referenced by FWEveViewManager::itemChanged(), and FWEveViewManager::modelChanges().

102 { return m_haveWindow; }
virtual bool FWProxyBuilderBase::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual
virtual bool FWProxyBuilderBase::haveSingleProduct ( void  ) const
inlinevirtual
void FWProxyBuilderBase::increaseComponentTransparency ( unsigned int  index,
TEveElement *  holder,
const std::string &  name,
Char_t  transpOffset 
)
protected

Definition at line 484 of file FWProxyBuilderBase.cc.

References FWEventItem::ModelInfo::displayProperties(), item(), m, siStripFEDMonitor_P5_cff::Min, FWEventItem::modelInfo(), and FWDisplayProperties::transparency().

Referenced by FWMuonRhoPhiProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWMuonProxyBuilder::build(), FWMuonRhoPhiProxyBuilder::localModelChanges(), FWSiStripClusterProxyBuilder::localModelChanges(), FWMuonProxyBuilder::localModelChanges(), FWTauProxyBuilderBase::localModelChanges(), FWVertexProxyBuilder::localModelChanges(), and FWJetProxyBuilder::localModelChanges().

486 {
487  // Helper function to increse transparency of certain components.
488 
490  Char_t transp = TMath::Min(100, transpOffset + (100 - transpOffset) * dp.transparency() / 100);
491  TEveElement::List_t matches;
492  holder->FindChildren(matches, name.c_str());
493  for (TEveElement::List_i m = matches.begin(); m != matches.end(); ++m)
494  {
495  (*m)->SetMainTransparency(transp);
496  }
497 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
const FWEventItem * item() const
Char_t transparency() const
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
const FWEventItem* FWProxyBuilderBase::item ( ) const
inline

Definition at line 68 of file FWProxyBuilderBase.h.

References m_item.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), FWDigitSetProxyBuilder::addBoxSetToProduct(), FWHFTowerProxyBuilderBase::assertCaloDataSlice(), FWCaloTowerProxyBuilderBase::assertCaloDataSlice(), FWCaloRecHitDigitSetProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), FWCaloClusterProxyBuilder::build(), FWTrackTrackingRecHitProxyBuilder::build(), FWPCaloHitProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWTracksModulesProxyBuilder::build(), FWTracksRecHitsProxyBuilder::build(), FWBeamSpotProxyBuilder::build(), FWCSCRecHitProxyBuilder::build(), FWPFClusterRPZProxyBuilder::build(), FWSecVertexProxyBuilder::build(), FWGenParticleLegoProxyBuilder::build(), FWCSCSegmentProxyBuilder::build(), FWSimTrackProxyBuilder::build(), FWTrackingParticleProxyBuilder::build(), FWPFCandidatesLegoProxyBuilder::build(), FWPFEcalRecHitRPProxyBuilder::build(), FWPFPatJetLegoProxyBuilder< T >::build(), FWPFEcalRecHitLegoProxyBuilder::build(), FWCandidateLegoProxyBuilder::build(), FWCaloDataProxyBuilderBase::build(), FWTrackProxyBuilderFF::build(), FWVertexProxyBuilder::build(), FWPFEcalClusterRPZProxyBuilder::build(), build(), FWPFHcalClusterRPZProxyBuilder::build(), FWTauProxyBuilderBase::buildBaseTau(), FWMuonBuilder::buildMuon(), FWPSimHitProxyBuilder::buildViewType(), FWRPCRecHitProxyBuilder::buildViewType(), FWPhotonProxyBuilder::buildViewType(), FWDTSegmentProxyBuilder::buildViewType(), FWJetProxyBuilder::buildViewType(), createProduct(), FWHFTowerProxyBuilderBase::fillCaloData(), FWCaloTowerProxyBuilderBase::fillCaloData(), FWHFTowerProxyBuilderBase::fillTowerForDetId(), increaseComponentTransparency(), FWPFCandidateWithHitsProxyBuilder::initPFRecHitsCollections(), FWEveViewManager::itemChanged(), Vispa.Views.TableView.TableView::itemSelectionChanged(), FWBeamSpotProxyBuilder::localModelChanges(), FWPFCandidatesLegoProxyBuilder::localModelChanges(), FWCandidateLegoProxyBuilder::localModelChanges(), FWPFPatJetLegoProxyBuilder< T >::localModelChanges(), FWPFClusterLegoProxyBuilder::localModelChanges(), FWPFEcalRecHitLegoProxyBuilder::localModelChanges(), FWVertexProxyBuilder::localModelChanges(), fireworks::makeRhoPhiSuperCluster(), FWCaloDataProxyBuilderBase::modelChanges(), FWDigitSetProxyBuilder::modelChanges(), FWEveViewManager::modelChanges(), FWProxyBuilderTemplate< EcalRecHit >::modelData(), FWSimpleProxyBuilderTemplate< l1extra::L1JetParticle >::modelData(), FWElectronProxyBuilder::requestCommon(), FWConversionProxyBuilder::requestCommon(), FWJetProxyBuilder::requestCommon(), FWCaloRecHitDigitSetProxyBuilder::scaleProduct(), FWPFCandidateWithHitsProxyBuilder::scaleProduct(), Vispa.Views.TableView.TableView::select(), Vispa.Views.TableView.TableView::selection(), FWJetProxyBuilder::setTextPos(), FWPFBlockProxyBuilder::setupClusterElement(), FWPFClusterRPZProxyBuilder::sharedBuild(), and FWPFClusterLegoProxyBuilder::sharedBuild().

68  {
69  return m_item;
70  }
const FWEventItem * m_item
void FWProxyBuilderBase::itemBeingDestroyed ( const FWEventItem iItem)
virtual

Reimplemented in FWCaloDataProxyBuilderBase, FWCaloTowerProxyBuilderBase, and FWHFTowerProxyBuilderBase.

Definition at line 115 of file FWProxyBuilderBase.cc.

References cleanLocal(), i, m_item, and m_products.

Referenced by FWCaloDataProxyBuilderBase::itemBeingDestroyed().

116 {
117  m_item=0;
118 
119  cleanLocal();
120 
121  for (Product_it i = m_products.begin(); i!= m_products.end(); i++)
122  {
123 
124  (*i)->m_scaleConnection.disconnect();
125  delete (*i);
126  }
127 
128  m_products.clear();
129 }
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
virtual void cleanLocal()
const FWEventItem * m_item
void FWProxyBuilderBase::itemChanged ( const FWEventItem iItem)

Definition at line 262 of file FWProxyBuilderBase.cc.

References build(), FWEventItem::layer(), m_haveWindow, m_layer, m_modelsChanged, m_mustBuild, and setProjectionLayer().

Referenced by FWEveViewManager::itemChanged().

263 {
264  if (iItem->layer() != m_layer)
265  setProjectionLayer(iItem->layer());
266 
267  if(m_haveWindow) {
268  build();
269  } else {
270  m_mustBuild=true;
271  }
272  m_modelsChanged=false;
273 }
int layer() const
Definition: FWEventItem.cc:457
void setProjectionLayer(float)
int FWProxyBuilderBase::layer ( ) const
void FWProxyBuilderBase::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
protectedvirtual
void FWProxyBuilderBase::modelChanges ( const FWModelIds iIds)

Definition at line 247 of file FWProxyBuilderBase.cc.

References i, m_haveWindow, m_modelsChanged, and m_products.

Referenced by FWEveViewManager::modelChanges().

248 {
249  if(m_haveWindow) {
250  for (Product_it i = m_products.begin(); i!= m_products.end(); ++i)
251  {
252  modelChanges(iIds, *i);
253  }
254  m_modelsChanged=false;
255  } else {
256  m_modelsChanged=true;
257  }
258 }
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
void modelChanges(const FWModelIds &)
void FWProxyBuilderBase::modelChanges ( const FWModelIds iIds,
Product p 
)
protectedvirtual

Reimplemented in FWDigitSetProxyBuilder, and FWCaloDataProxyBuilderBase.

Definition at line 217 of file FWProxyBuilderBase.cc.

References getHLTprescales::index, localModelChanges(), FWProxyBuilderBase::Product::m_elements, m_item, FWProxyBuilderBase::Product::m_viewContext, FWProxyBuilderBase::Product::m_viewType, FWEventItem::size(), and visibilityModelChanges().

218 {
219  TEveElementList* elms = p->m_elements;
220  assert(m_item && static_cast<int>(m_item->size()) <= elms->NumChildren() && "can not use default modelChanges implementation");
221 
222  TEveElement::List_i itElement = elms->BeginChildren();
223  int index = 0;
224  for (FWModelIds::const_iterator it = iIds.begin(), itEnd = iIds.end();
225  it != itEnd;
226  ++it,++itElement,++index)
227  {
228  assert(itElement != elms->EndChildren());
229  while (index < it->index())
230  {
231  ++itElement;
232  ++index;
233  assert(itElement != elms->EndChildren());
234  }
235  if (visibilityModelChanges(*it, *itElement, p->m_viewType, p->m_viewContext))
236  {
237  elms->ProjectChild(*itElement);
238  }
239  else
240  {
241  localModelChanges(*it, *itElement, p->m_viewType, p->m_viewContext);
242  }
243  }
244 }
virtual bool visibilityModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
const FWEventItem * m_item
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
size_t size() const
Definition: FWEventItem.cc:548
const FWProxyBuilderBase& FWProxyBuilderBase::operator= ( const FWProxyBuilderBase )
protected
void FWProxyBuilderBase::removePerViewProduct ( FWViewType::EType  type,
const FWViewContext vc 
)

Definition at line 326 of file FWProxyBuilderBase.cc.

References havePerViewProduct(), i, and m_products.

327 {
328  for (Product_it i = m_products.begin(); i!= m_products.end(); ++i)
329  {
330  if (havePerViewProduct(type) && (*i)->m_viewContext == vc)
331  {
332  if ((*i)->m_elements)
333  (*i)->m_elements->DestroyElements();
334 
335  if ( (*i)->m_viewContext)
336  (*i)->m_scaleConnection.disconnect();
337 
338  delete (*i);
339  m_products.erase(i);
340  break;
341  }
342  }
343 }
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
virtual bool havePerViewProduct(FWViewType::EType) const
bool FWProxyBuilderBase::representsSubPart ( void  )
static

Used by the plugin system to determine precidence of different proxy builders for same type this returns 'true' if the proxy builder is specialized to only show a sub-part of the object as opposed to showing the object as a whole

Definition at line 524 of file FWProxyBuilderBase.cc.

525 {
526  return false;
527 }
void FWProxyBuilderBase::scaleChanged ( const FWViewContext vc)

Definition at line 371 of file FWProxyBuilderBase.cc.

References havePerViewProduct(), i, m_products, and scaleProduct().

Referenced by createProduct().

372 {
373  for (Product_it i = m_products.begin(); i!= m_products.end(); ++i)
374  {
375  if ( havePerViewProduct((*i)->m_viewType) && (*i)->m_viewContext == vc)
376  {
377  scaleProduct((*i)->m_elements, (*i)->m_viewType, (*i)->m_viewContext);
378  }
379  }
380  gEve->Redraw3D();
381 }
int i
Definition: DBlmapReader.cc:9
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
virtual bool havePerViewProduct(FWViewType::EType) const
virtual void FWProxyBuilderBase::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  ,
const FWViewContext vc 
)
inlineprotectedvirtual
void FWProxyBuilderBase::setHaveWindow ( bool  iFlag)

Definition at line 101 of file FWProxyBuilderBase.cc.

References build(), m_haveWindow, and m_mustBuild.

Referenced by FWEveViewManager::newItem().

102 {
103  bool oldValue = m_haveWindow;
104  m_haveWindow=iFlag;
105 
106  if(iFlag && !oldValue) {
107  //this is our first view so may need to rerun our building
108  if(m_mustBuild) {
109  build();
110  }
111  }
112 }
void FWProxyBuilderBase::setInteractionList ( FWInteractionList l,
const std::string &   
)
virtual

Definition at line 348 of file FWProxyBuilderBase.cc.

References prof2calltree::l, and m_interactionList.

Referenced by FWEveViewManager::newItem().

349 {
350  // Called if willHandleInteraction() returns false. Purpose ignored by default.
351 
353 }
FWInteractionList * m_interactionList
void FWProxyBuilderBase::setItem ( const FWEventItem iItem)
virtual
void FWProxyBuilderBase::setProjectionLayer ( float  layer)
private

Definition at line 416 of file FWProxyBuilderBase.cc.

References i, layer(), m_layer, and m_products.

Referenced by itemChanged().

417 {
418  m_layer = layer;
419  for (Product_it pIt = m_products.begin(); pIt != m_products.end(); ++pIt)
420  {
421  TEveProjectable* pable = static_cast<TEveProjectable*>((*pIt)->m_elements);
422  for (TEveProjectable::ProjList_i i = pable->BeginProjecteds(); i != pable->EndProjecteds(); ++i)
423  (*i)->SetDepth(m_layer);
424  }
425 }
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
void FWProxyBuilderBase::setupAddElement ( TEveElement *  el,
TEveElement *  parent,
bool  set_color = true 
) const

Definition at line 430 of file FWProxyBuilderBase.cc.

References setupElement().

Referenced by fireworks::addBox(), fireworks::addCircle(), FWTauProxyBuilderBase::addConstituentTracks(), fireworks::addDashedArrow(), fireworks::addDashedLine(), fireworks::addDoubleLines(), FWPFCandidateWithHitsProxyBuilder::addHitsForCandidate(), FWTauProxyBuilderBase::addLeadTrack(), fireworks::addRhoZEnergyProjection(), FWPFCandidateWithHitsProxyBuilder::build(), FWCaloClusterProxyBuilder::build(), FWTrackTrackingRecHitProxyBuilder::build(), FWPhotonLegoProxyBuilder::build(), FWMuonGlimpseProxyBuilder::build(), FWSimVertexProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWTracksModulesProxyBuilder::build(), FWTracksRecHitsProxyBuilder::build(), FWMuonLegoProxyBuilder::build(), FWSiPixelClusterDetProxyBuilder::build(), FWTrackingVertexProxyBuilder::build(), FWBeamSpotProxyBuilder::build(), FWCSCRecHitProxyBuilder::build(), FWBeamSpotOnlineProxyBuilder::build(), FWSiStripDigiProxyBuilder::build(), FWCSCStripDigiProxyBuilder::build(), FWElectronLegoProxyBuilder::build(), FWPFClusterRPZProxyBuilder::build(), FWRPCDigiProxyBuilder::build(), FWSecVertexProxyBuilder::build(), FWCSCWireDigiProxyBuilder::build(), FWGenParticleLegoProxyBuilder::build(), FWCandidateProxyBuilder::build(), FWSiPixelClusterProxyBuilder::build(), FWSimTrackProxyBuilder::build(), FWCSCSegmentProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), FWTrackProxyBuilder::build(), FWPFTrack3DProxyBuilder::build(), FWPFTrackRPZProxyBuilder::build(), FWTrackingParticleProxyBuilder::build(), FWPFTrackLegoProxyBuilder::build(), FWGenParticleProxyBuilder::build(), FWPFCandidate3DProxyBuilder::build(), FWPFCandidatesLegoProxyBuilder::build(), FWPFPatJet3DProxyBuilder< T >::build(), FWPFPatJetLegoProxyBuilder< T >::build(), FWCandidateLegoProxyBuilder::build(), FWTrackProxyBuilderFF::build(), FWVertexProxyBuilder::build(), FWMET3DProxyBuilder::build(), FWElectronGlimpseProxyBuilder::build(), FWTauProxyBuilderBase::buildBaseTau(), FWMuonBuilder::buildMuon(), FWPFRhoPhiRecHit::buildRecHit(), FWTrackProxyBuilderFF::buildTrack(), FWPSimHitProxyBuilder::buildViewType(), FWRPCRecHitProxyBuilder::buildViewType(), FWPhotonProxyBuilder::buildViewType(), FWDTSegmentProxyBuilder::buildViewType(), FWPFTauProxyBuilder::buildViewType(), FWCaloTauProxyBuilder::buildViewType(), FWElectronProxyBuilder::buildViewType(), FWConversionProxyBuilder::buildViewType(), FWMETProxyBuilder::buildViewType(), FWDTDigiProxyBuilder::buildViewType(), FWJetProxyBuilder::buildViewType(), FWPFLegoRecHit::FWPFLegoRecHit(), fireworks::makeRhoPhiSuperCluster(), FWPFBlockProxyBuilder::setupClusterElement(), FWPFBlockProxyBuilder::setupTrackElement(), FWPFClusterRPZProxyBuilder::sharedBuild(), and FWPFClusterLegoProxyBuilder::sharedBuild().

431 {
432  setupElement(el, color);
433  parent->AddElement(el);
434 }
list parent
Definition: dbtoconf.py:74
void setupElement(TEveElement *el, bool color=true) const
void FWProxyBuilderBase::setupElement ( TEveElement *  el,
bool  color = true 
) const

This method is invoked to setup the per element properties of the various objects being drawn.

Definition at line 440 of file FWProxyBuilderBase.cc.

References FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), m_item, and FWDisplayProperties::transparency().

Referenced by FWElectronProxyBuilder::requestCommon(), FWConversionProxyBuilder::requestCommon(), and setupAddElement().

441 {
442  el->CSCTakeAnyParentAsMaster();
443  el->SetPickable(true);
444 
445  if (color)
446  {
447  el->CSCApplyMainColorToMatchingChildren();
448  el->CSCApplyMainTransparencyToMatchingChildren();
449  el->SetMainColor(m_item->defaultDisplayProperties().color());
450  assert((m_item->defaultDisplayProperties().transparency() >= 0)
451  && (m_item->defaultDisplayProperties().transparency() <= 100));
452  el->SetMainTransparency(m_item->defaultDisplayProperties().transparency());
453  }
454 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
const FWEventItem * m_item
Color_t color() const
Char_t transparency() const
std::string FWProxyBuilderBase::typeOfBuilder ( )
static

Used by the plugin system to determine how the proxy uses the data from FWEventItem.

Definition at line 519 of file FWProxyBuilderBase.cc.

520 {
521  return std::string();
522 }
bool FWProxyBuilderBase::visibilityModelChanges ( const FWModelId ,
TEveElement *  ,
FWViewType::EType  ,
const FWViewContext  
)
protectedvirtual

Reimplemented in FWSimpleProxyBuilder, and FWTrackProxyBuilderFF.

Definition at line 357 of file FWProxyBuilderBase.cc.

Referenced by modelChanges().

358 {
359  return false;
360 }
virtual bool FWProxyBuilderBase::willHandleInteraction ( ) const
inlinevirtual

Reimplemented in FWCaloDataProxyBuilderBase, and FWDigitSetProxyBuilder.

Definition at line 97 of file FWProxyBuilderBase.h.

Referenced by FWEveViewManager::newItem().

97 { return false; }

Member Data Documentation

bool FWProxyBuilderBase::m_haveWindow
private

Definition at line 153 of file FWProxyBuilderBase.h.

Referenced by getHaveWindow(), itemChanged(), modelChanges(), and setHaveWindow().

FWInteractionList* FWProxyBuilderBase::m_interactionList
private

Definition at line 148 of file FWProxyBuilderBase.h.

Referenced by build(), and setInteractionList().

const FWEventItem* FWProxyBuilderBase::m_item
private
float FWProxyBuilderBase::m_layer
private

Definition at line 156 of file FWProxyBuilderBase.h.

Referenced by itemChanged(), and setProjectionLayer().

bool FWProxyBuilderBase::m_modelsChanged
private

Definition at line 152 of file FWProxyBuilderBase.h.

Referenced by itemChanged(), and modelChanges().

bool FWProxyBuilderBase::m_mustBuild
private

Definition at line 154 of file FWProxyBuilderBase.h.

Referenced by build(), itemChanged(), and setHaveWindow().

std::vector<Product*> FWProxyBuilderBase::m_products
protected