Skip to content

Commit

Permalink
start of new way to handle Eve->Fireworks selection (now only used fo…
Browse files Browse the repository at this point in the history
…r Calo selection)
  • Loading branch information
Dr15Jones committed Oct 24, 2009
1 parent e1c8d39 commit c30e36d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Fireworks/Core/src/FW3DLegoEveHistProxyBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Original Author: Chris Jones
// Created: Sat Jul 5 11:26:11 EDT 2008
// $Id: FW3DLegoEveHistProxyBuilder.cc,v 1.4 2009/01/23 21:35:42 amraktad Exp $
// $Id: FW3DLegoEveHistProxyBuilder.cc,v 1.5 2009/10/23 01:02:52 chrjones Exp $
//

// system include files
Expand All @@ -21,6 +21,8 @@
#include "Fireworks/Core/interface/FW3DLegoEveHistProxyBuilder.h"
#include "Fireworks/Core/interface/FWEventItem.h"

#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h"


//
// constants, enums and typedefs
Expand Down Expand Up @@ -67,6 +69,11 @@ FW3DLegoEveHistProxyBuilder::attach(TEveElement* iElement,
TEveCaloDataHist* iHist)
{
m_data = iHist;
if(0==m_data->GetUserData()) {
FWFromTEveCaloDataSelector* sel = new FWFromTEveCaloDataSelector(m_data);
//make sure it is accessible via the base class
iHist->SetUserData(static_cast<FWFromEveSelectorBase*>(sel));
}
}

void
Expand All @@ -76,6 +83,13 @@ FW3DLegoEveHistProxyBuilder::build()
if(0!=m_hist && -1 == m_sliceIndex) {
m_sliceIndex = m_data->AddHistogram(m_hist);
m_data->RefSliceInfo(m_sliceIndex).Setup(item()->name().c_str(), 0., item()->defaultDisplayProperties().color());

FWFromEveSelectorBase* base = reinterpret_cast<FWFromEveSelectorBase*>(m_data->GetUserData());
assert(0!=base);
FWFromTEveCaloDataSelector* sel = dynamic_cast<FWFromTEveCaloDataSelector*> (base);
assert(0!=sel);
sel->addSliceSelector(m_sliceIndex,FWFromSliceSelector(m_hist,item()));

}
m_data->DataChanged();
}
Expand Down

0 comments on commit c30e36d

Please sign in to comment.