CMS 3D CMS Logo

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

FWDigitSetProxyBuilder Class Reference

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

Inheritance diagram for FWDigitSetProxyBuilder:
FWProxyBuilderBase FWCaloRecHitDigitSetProxyBuilder FWPCaloHitProxyBuilder FWPRCaloTowerProxyBuilder FWCastorRecHitProxyBuilder FWEcalRecHitProxyBuilder FWHBHERecHitProxyBuilder FWHFRecHitProxyBuilder FWHORecHitProxyBuilder 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)

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)

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.

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

Definition at line 77 of file FWDigitSetProxyBuilder.cc.

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

Member Function Documentation

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

Definition at line 111 of file FWDigitSetProxyBuilder.cc.

References FWDisplayProperties::color(), FWDisplayProperties::isVisible(), and FWDisplayProperties::transparency().

Referenced by FWCaloRecHitDigitSetProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), and FWPCaloHitProxyBuilder::build().

{
   boxSet->AddBox(pnts);
   boxSet->DigitValue(dp.isVisible());

   if (dp.isVisible()) 
      boxSet->DigitColor(dp.color(), dp.transparency());

   if (dp.transparency())
      boxSet->SetMainTransparency(dp.transparency());
}
TEveBoxSet * FWDigitSetProxyBuilder::addBoxSetToProduct ( TEveElementList *  product) [protected]

Definition at line 88 of file FWDigitSetProxyBuilder.cc.

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

Referenced by FWCaloRecHitDigitSetProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), and FWPCaloHitProxyBuilder::build().

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

   product->AddElement(boxSet);

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

Definition at line 105 of file FWDigitSetProxyBuilder.cc.

Referenced by modelChanges().

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

Definition at line 81 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 123 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; }