#include <Fireworks/Core/interface/CmsShowCommon.h>
CmsShowCommon::CmsShowCommon | ( | fireworks::Context * | c | ) |
Definition at line 30 of file CmsShowCommon.cc.
References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, colorManager(), i, kFWGeomColorSize, prof2calltree::l, m_drawBreakPoints, m_gamma, m_geomColors, m_trackBreak, mergeVDriftHistosByStation::name, setDrawBreakMarkers(), setGamma(), and setTrackBreakMode().
: FWConfigurableParameterizable(2), m_context(c), m_trackBreak(this, " ", 2l, 0l, 2l), // do not want to render text at setter m_drawBreakPoints(this, "Show y=0 points as markers", true), m_backgroundColor(this, "backgroundColIdx", 1l, 0l, 1000l), m_gamma(this, "Brightness", 0l, -15l, 15l), m_geomTransparency2D(this, "Transparency 2D", long(colorManager()->geomTransparency(true)), 0l, 100l), m_geomTransparency3D(this, "Transparency 3D", long(colorManager()->geomTransparency(false)), 0l, 100l), m_energyScale(new FWViewEnergyScale("global", 2)) { // projections m_trackBreak.addEntry(0, "Jump to proper hemisphere"); m_trackBreak.addEntry(1, "Stay on first point side"); m_trackBreak.addEntry(2, "Stay on last point side"); // colors char name[32]; for (int i = 0; i < kFWGeomColorSize; ++i) { snprintf(name, 31, "GeometryColor %d ", i); m_geomColors[i] = new FWLongParameter(this, name , long(colorManager()->geomColor(FWGeomColorIndex(i))), 1000l, 1100l); } m_trackBreak.changed_.connect(boost::bind(&CmsShowCommon::setTrackBreakMode, this)); m_drawBreakPoints.changed_.connect(boost::bind(&CmsShowCommon::setDrawBreakMarkers, this)); m_gamma.changed_.connect(boost::bind(&CmsShowCommon::setGamma, this)); }
CmsShowCommon::~CmsShowCommon | ( | ) | [virtual] |
Definition at line 59 of file CmsShowCommon.cc.
{ }
CmsShowCommon::CmsShowCommon | ( | const CmsShowCommon & | ) | [private] |
void CmsShowCommon::addTo | ( | FWConfiguration & | oTo | ) | const [virtual] |
Reimplemented from FWConfigurableParameterizable.
Definition at line 132 of file CmsShowCommon.cc.
References colorManager(), m_backgroundColor, m_energyScale, and FWGenericParameter< T >::set().
{ m_backgroundColor.set(int(colorManager()->background())); FWConfigurableParameterizable::addTo(oTo); m_energyScale->addTo(oTo); }
const FWColorManager * CmsShowCommon::colorManager | ( | ) | const [protected] |
Definition at line 64 of file CmsShowCommon.cc.
References fireworks::Context::colorManager(), and m_context.
Referenced by addTo(), CmsShowCommon(), CmsShowCommonPopup::CmsShowCommonPopup(), CmsShowCommonPopup::colorSetChanged(), and switchBackground().
{ return m_context->colorManager(); }
int CmsShowCommon::gamma | ( | ) | [inline] |
Definition at line 60 of file CmsShowCommon.h.
References m_gamma, and FWGenericParameter< T >::value().
FWViewEnergyScale* CmsShowCommon::getEnergyScale | ( | ) | const [inline] |
Definition at line 67 of file CmsShowCommon.h.
References m_energyScale.
Referenced by FWEveViewManager::setContext(), and FWEveView::useGlobalEnergyScaleChanged().
{ return m_energyScale.get(); }
UChar_t CmsShowCommon::getProjTrackBreaking | ( | ) | const [inline] |
Definition at line 70 of file CmsShowCommon.h.
References m_trackBreak, and FWGenericParameter< T >::value().
Referenced by fireworks::Context::initEveElements().
{ return m_trackBreak.value(); }
bool CmsShowCommon::getRnrPTBMarkers | ( | ) | const [inline] |
Definition at line 71 of file CmsShowCommon.h.
References m_drawBreakPoints, and FWGenericParameter< T >::value().
Referenced by fireworks::Context::initEveElements().
{ return m_drawBreakPoints.value(); }
const CmsShowCommon& CmsShowCommon::operator= | ( | const CmsShowCommon & | ) | [private] |
void CmsShowCommon::setDrawBreakMarkers | ( | ) |
Definition at line 87 of file CmsShowCommon.cc.
References fireworks::Context::getMuonTrackPropagator(), fireworks::Context::getTrackerTrackPropagator(), fireworks::Context::getTrackPropagator(), m_context, m_drawBreakPoints, and FWGenericParameter< T >::value().
Referenced by CmsShowCommon().
{ if (m_context->getTrackPropagator()->GetRnrPTBMarkers() != m_drawBreakPoints.value()) { m_context->getTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value()); m_context->getTrackerTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value()); m_context->getMuonTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value()); gEve->Redraw3D(); } }
void CmsShowCommon::setFrom | ( | const FWConfiguration & | iFrom | ) | [virtual] |
Reimplemented from FWConfigurableParameterizable.
Definition at line 141 of file CmsShowCommon.cc.
References FWParameterizable::begin(), fireworks::Context::colorManager(), lhef::cc::convert(), FWParameterizable::end(), i, kFWGeomColorSize, m_backgroundColor, m_context, m_energyScale, m_gamma, m_geomColors, m_geomTransparency2D, m_geomTransparency3D, mode, FWColorManager::setBackgroundAndBrightness(), FWColorManager::setGeomColor(), FWColorManager::setGeomTransparency(), FWGenericParameter< T >::value(), FWConfiguration::value(), relativeConstraints::value, and FWConfiguration::valueForKey().
{ for(const_iterator it =begin(), itEnd = end(); it != itEnd; ++it) { (*it)->setFrom(iFrom); } // handle old and new energy scale configuration if existing if (iFrom.valueForKey("ScaleMode")) { long mode = atol(iFrom.valueForKey("ScaleMode")->value().c_str()); float convert; if (iFrom.valueForKey("EnergyToLength [GeV/m]")) convert = atof(iFrom.valueForKey("EnergyToLength [GeV/m]")->value().c_str()); else convert = atof(iFrom.valueForKey("ValueToHeight [GeV/m]")->value().c_str()); float maxH; if (iFrom.valueForKey("MaximumLength [m]")) maxH = atof(iFrom.valueForKey("MaximumLength [m]")->value().c_str()); else maxH = atof(iFrom.valueForKey("MaxTowerH [m]")->value().c_str()); int et = atoi(iFrom.valueForKey("PlotEt")->value().c_str()); m_energyScale->SetFromCmsShowCommonConfig(mode, convert, maxH, et); } // background FWColorManager* cm = m_context->colorManager(); cm->setBackgroundAndBrightness( FWColorManager::BackgroundColorIndex(m_backgroundColor.value()), m_gamma.value()); // geom colors cm->setGeomTransparency( m_geomTransparency2D.value(), true); cm->setGeomTransparency( m_geomTransparency3D.value(), false); for (int i = 0; i < kFWGeomColorSize; ++i) cm->setGeomColor(FWGeomColorIndex(i), m_geomColors[i]->value()); }
void CmsShowCommon::setGamma | ( | ) |
Definition at line 99 of file CmsShowCommon.cc.
References fireworks::Context::colorManager(), m_context, m_gamma, FWColorManager::setBrightness(), and FWGenericParameter< T >::value().
Referenced by CmsShowCommon().
{ m_context->colorManager()->setBrightness(m_gamma.value()); }
void CmsShowCommon::setGeomColor | ( | FWGeomColorIndex | cidx, |
Color_t | iColor | ||
) |
Definition at line 112 of file CmsShowCommon.cc.
References fireworks::Context::colorManager(), m_context, m_geomColors, FWGenericParameter< T >::set(), and FWColorManager::setGeomColor().
Referenced by CmsShowCommonPopup::changeGeomColor().
{ m_geomColors[cidx]->set(iColor); m_context->colorManager()->setGeomColor(cidx, iColor); }
void CmsShowCommon::setGeomTransparency | ( | int | val, |
bool | projected | ||
) |
Definition at line 119 of file CmsShowCommon.cc.
References fireworks::Context::colorManager(), m_context, m_geomTransparency2D, m_geomTransparency3D, FWGenericParameter< T >::set(), and FWColorManager::setGeomTransparency().
Referenced by CmsShowCommonPopup::changeGeomTransparency2D(), and CmsShowCommonPopup::changeGeomTransparency3D().
{ if (projected) m_geomTransparency2D.set(iTransp); else m_geomTransparency3D.set(iTransp); m_context->colorManager()->setGeomTransparency(iTransp, projected); }
void CmsShowCommon::setTrackBreakMode | ( | ) |
Definition at line 74 of file CmsShowCommon.cc.
References fireworks::Context::getMuonTrackPropagator(), fireworks::Context::getTrackerTrackPropagator(), fireworks::Context::getTrackPropagator(), m_context, m_trackBreak, and FWGenericParameter< T >::value().
Referenced by CmsShowCommon().
{ if (m_context->getTrackPropagator()->GetProjTrackBreaking() != m_trackBreak.value()) { m_context->getTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value()); m_context->getTrackerTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value()); m_context->getMuonTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value()); gEve->Redraw3D(); } }
void CmsShowCommon::switchBackground | ( | ) |
Definition at line 105 of file CmsShowCommon.cc.
References colorManager(), fireworks::Context::colorManager(), m_backgroundColor, m_context, FWGenericParameter< T >::set(), and FWColorManager::switchBackground().
Referenced by CmsShowCommonPopup::switchBackground().
{ m_context->colorManager()->switchBackground(); m_backgroundColor.set(colorManager()->background()); }
friend class CmsShowCommonPopup [friend] |
Definition at line 43 of file CmsShowCommon.h.
FWLongParameter CmsShowCommon::m_backgroundColor [mutable, protected] |
Definition at line 85 of file CmsShowCommon.h.
Referenced by addTo(), setFrom(), and switchBackground().
fireworks::Context* CmsShowCommon::m_context [protected] |
Definition at line 79 of file CmsShowCommon.h.
Referenced by colorManager(), setDrawBreakMarkers(), setFrom(), setGamma(), setGeomColor(), setGeomTransparency(), setTrackBreakMode(), and switchBackground().
FWBoolParameter CmsShowCommon::m_drawBreakPoints [protected] |
Definition at line 82 of file CmsShowCommon.h.
Referenced by CmsShowCommon(), CmsShowCommonPopup::CmsShowCommonPopup(), getRnrPTBMarkers(), and setDrawBreakMarkers().
std::auto_ptr<FWViewEnergyScale> CmsShowCommon::m_energyScale [protected] |
Definition at line 94 of file CmsShowCommon.h.
Referenced by addTo(), CmsShowCommonPopup::CmsShowCommonPopup(), getEnergyScale(), and setFrom().
FWLongParameter CmsShowCommon::m_gamma [protected] |
Definition at line 86 of file CmsShowCommon.h.
Referenced by CmsShowCommon(), CmsShowCommonPopup::CmsShowCommonPopup(), gamma(), setFrom(), and setGamma().
FWLongParameter* CmsShowCommon::m_geomColors[kFWGeomColorSize] [protected] |
Definition at line 91 of file CmsShowCommon.h.
Referenced by CmsShowCommon(), setFrom(), and setGeomColor().
FWLongParameter CmsShowCommon::m_geomTransparency2D [protected] |
Definition at line 89 of file CmsShowCommon.h.
Referenced by setFrom(), and setGeomTransparency().
FWLongParameter CmsShowCommon::m_geomTransparency3D [protected] |
Definition at line 90 of file CmsShowCommon.h.
Referenced by setFrom(), and setGeomTransparency().
FWEnumParameter CmsShowCommon::m_trackBreak [protected] |
Definition at line 81 of file CmsShowCommon.h.
Referenced by CmsShowCommon(), CmsShowCommonPopup::CmsShowCommonPopup(), getProjTrackBreaking(), and setTrackBreakMode().