CMS 3D CMS Logo

Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

FWDigitSetProxyBuilder Class Reference

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

Inheritance diagram for FWDigitSetProxyBuilder:
FWProxyBuilderBase FWCastorRecHitProxyBuilder FWEcalRecHitProxyBuilder FWHBHERecHitProxyBuilder FWHFRecHitProxyBuilder FWHORecHitProxyBuilder FWPCaloHitProxyBuilder FWPRCaloTowerProxyBuilder FWZDCRecHitProxyBuilder

List of all members.

Classes

struct  BFreeBox_t

Public Member Functions

 FWDigitSetProxyBuilder ()
virtual bool willHandleInteraction () const
virtual ~FWDigitSetProxyBuilder ()

Protected Member Functions

void addBox (TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
TEveBoxSet * addBoxSetToProduct (TEveElementList *product)
TEveBoxSet * getBoxSet () const

Private Member Functions

TEveDigitSet * digitSet (TEveElement *product)
 FWDigitSetProxyBuilder (const FWDigitSetProxyBuilder &)
virtual void modelChanges (const FWModelIds &, Product *)
const FWDigitSetProxyBuilderoperator= (const FWDigitSetProxyBuilder &)

Static Private Member Functions

static TString getTooltip (TEveDigitSet *set, int idx)

Private Attributes

TEveBoxSet * m_boxSet

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 32 of file FWDigitSetProxyBuilder.h.


Constructor & Destructor Documentation

FWDigitSetProxyBuilder::FWDigitSetProxyBuilder ( )

Definition at line 73 of file FWDigitSetProxyBuilder.cc.

                                              :
   m_boxSet(0)
{
}
FWDigitSetProxyBuilder::~FWDigitSetProxyBuilder ( ) [virtual]

Definition at line 78 of file FWDigitSetProxyBuilder.cc.

{
}
FWDigitSetProxyBuilder::FWDigitSetProxyBuilder ( const FWDigitSetProxyBuilder ) [private]

Member Function Documentation

void FWDigitSetProxyBuilder::addBox ( TEveBoxSet *  set,
const float *  pnts,
const FWDisplayProperties dp 
) [protected]
TEveBoxSet * FWDigitSetProxyBuilder::addBoxSetToProduct ( TEveElementList *  product) [protected]

Definition at line 89 of file FWDigitSetProxyBuilder.cc.

References getTooltip(), FWProxyBuilderBase::item(), m_boxSet, and EgammaValidation_Wenu_cff::sel.

Referenced by FWCastorRecHitProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), FWZDCRecHitProxyBuilder::build(), FWPCaloHitProxyBuilder::build(), FWHBHERecHitProxyBuilder::build(), FWHFRecHitProxyBuilder::build(), FWEcalRecHitProxyBuilder::build(), and FWHORecHitProxyBuilder::build().

{
   assert(!product->HasChildren());
   
   m_boxSet = new TEveBoxSet();
   m_boxSet->SetTooltipCBFoo(getTooltip);
   m_boxSet->Reset(TEveBoxSet::kBT_FreeBox, true, 256);
   FWSecondarySelectableSelector* sel = new FWSecondarySelectableSelector(m_boxSet->RefSelectedSet(), item());
   m_boxSet->SetUserData(sel);
   m_boxSet->SetPickable(1);
   m_boxSet->SetAlwaysSecSelect(1);

   product->AddElement(m_boxSet);

   return m_boxSet;
}
TEveDigitSet * FWDigitSetProxyBuilder::digitSet ( TEveElement *  product) [private]

Definition at line 106 of file FWDigitSetProxyBuilder.cc.

Referenced by modelChanges().

{
   assert(product->NumChildren() == 1);
   return static_cast<TEveDigitSet*>(*product->BeginChildren());
}
TEveBoxSet* FWDigitSetProxyBuilder::getBoxSet ( ) const [inline, protected]
TString FWDigitSetProxyBuilder::getTooltip ( TEveDigitSet *  set,
int  idx 
) [static, private]

Definition at line 82 of file FWDigitSetProxyBuilder.cc.

References FWSecondarySelectableSelector::item(), FWEventItem::modelInterestingValueAsString(), and FWEventItem::name().

Referenced by addBoxSetToProduct().

{
   TEveElement* el = static_cast<TEveElement*>(set); // tmp-workaround
   FWSecondarySelectableSelector* ss = static_cast<FWSecondarySelectableSelector*>(el->GetUserData());
   return TString::Format("%d %s %s", idx, ss->item()->name().c_str(), ss->item()->modelInterestingValueAsString(idx).c_str());
}
void FWDigitSetProxyBuilder::modelChanges ( const FWModelIds iIds,
Product product 
) [private, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 124 of file FWDigitSetProxyBuilder.cc.

References FWDisplayProperties::color(), digitSet(), FWEventItem::ModelInfo::displayProperties(), info, FWEventItem::ModelInfo::isSelected(), FWDisplayProperties::isVisible(), FWProxyBuilderBase::item(), FWProxyBuilderBase::Product::m_elements, FWEventItem::modelInfo(), AlCaHLTBitMon_ParallelJobs::p, and FWDisplayProperties::transparency().

{
   TEveDigitSet* digits = digitSet(product->m_elements);
   if (!digits) return;
   
   TEveSecondarySelectable::SelectionSet_t& selected = (TEveSecondarySelectable::SelectionSet_t&)(digits->RefSelectedSet());

   for (std::set<FWModelId>::const_iterator it = iIds.begin(); it != iIds.end(); ++it)
   {
      const FWEventItem::ModelInfo& info = item()->modelInfo(it->index());

      // id display properties
      const FWDisplayProperties &p = info.displayProperties();
      digits->SetCurrentDigit(it->index());
      digits->DigitValue(p.isVisible());
      if (p.isVisible())
         digits->DigitColor(p.color(), p.transparency());

      // id selection
      TEveSecondarySelectable::SelectionSet_ci si = selected.find(it->index());
      if (info.isSelected())
      {
         if (si == selected.end())
            selected.insert(it->index());
      }
      else
      {
         if ( si != selected.end())
            selected.erase(si);
      }
   }

   if(!selected.empty()) {
      if(0==digits->GetSelectedLevel()) {
         gEve->GetSelection()->AddElement(digits);
      }
   } else {
      if(1==digits->GetSelectedLevel()||2==digits->GetSelectedLevel()) {
         gEve->GetSelection()->RemoveElement(digits);
      }
   }

   digits->StampObjProps();
}
const FWDigitSetProxyBuilder& FWDigitSetProxyBuilder::operator= ( const FWDigitSetProxyBuilder ) [private]
virtual bool FWDigitSetProxyBuilder::willHandleInteraction ( ) const [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 41 of file FWDigitSetProxyBuilder.h.

{ return true; }

Member Data Documentation

TEveBoxSet* FWDigitSetProxyBuilder::m_boxSet [private]

Definition at line 77 of file FWDigitSetProxyBuilder.h.

Referenced by addBoxSetToProduct(), and getBoxSet().