CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends

CmsShowCommon Class Reference

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

Inheritance diagram for CmsShowCommon:
FWConfigurableParameterizable FWParameterizable FWConfigurable

List of all members.

Public Member Functions

virtual void addTo (FWConfiguration &) const
 CmsShowCommon (fireworks::Context *)
int gamma ()
FWViewEnergyScalegetEnergyScale () const
UChar_t getProjTrackBreaking () const
bool getRnrPTBMarkers () const
void setDrawBreakMarkers ()
virtual void setFrom (const FWConfiguration &)
void setGamma ()
void setGeomColor (FWGeomColorIndex, Color_t)
void setGeomTransparency (int val, bool projected)
void setTrackBreakMode ()
void switchBackground ()
virtual ~CmsShowCommon ()

Protected Member Functions

const FWColorManagercolorManager () const

Protected Attributes

FWLongParameter m_backgroundColor
fireworks::Contextm_context
FWBoolParameter m_drawBreakPoints
std::auto_ptr< FWViewEnergyScalem_energyScale
FWLongParameter m_gamma
FWLongParameterm_geomColors [kFWGeomColorSize]
FWLongParameter m_geomTransparency2D
FWLongParameter m_geomTransparency3D
FWEnumParameter m_trackBreak

Private Member Functions

 CmsShowCommon (const CmsShowCommon &)
const CmsShowCommonoperator= (const CmsShowCommon &)

Friends

class CmsShowCommonPopup

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 41 of file CmsShowCommon.h.


Constructor & Destructor Documentation

CmsShowCommon::CmsShowCommon ( fireworks::Context c)

Definition at line 32 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", false),
   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 61 of file CmsShowCommon.cc.

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

Member Function Documentation

void CmsShowCommon::addTo ( FWConfiguration oTo) const [virtual]

Reimplemented from FWConfigurableParameterizable.

Definition at line 165 of file CmsShowCommon.cc.

References colorManager(), m_backgroundColor, m_energyScale, FWGenericParameter< T >::set(), and v.

{
  m_backgroundColor.set(int(colorManager()->background()));

  FWConfigurableParameterizable::addTo(oTo);
  m_energyScale->addTo(oTo);

  if (gEve)
  {
    TGLViewer* v = gEve->GetDefaultGLViewer();
    addGLColorToConfig("SelectionColorLight", v->RefLightColorSet().Selection(1), oTo);
    addGLColorToConfig("HighlightColorLight", v->RefLightColorSet().Selection(3), oTo);
    addGLColorToConfig("SelectionColorDark",  v->RefDarkColorSet().Selection(1), oTo);
    addGLColorToConfig("HighlightColorDark",  v->RefDarkColorSet().Selection(3), oTo);
  }
}
const FWColorManager * CmsShowCommon::colorManager ( ) const [protected]
int CmsShowCommon::gamma ( ) [inline]

Definition at line 60 of file CmsShowCommon.h.

References m_gamma, and FWGenericParameter< T >::value().

{ return m_gamma.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]
const CmsShowCommon& CmsShowCommon::operator= ( const CmsShowCommon ) [private]
void CmsShowCommon::setDrawBreakMarkers ( )
void CmsShowCommon::setFrom ( const FWConfiguration iFrom) [virtual]

Reimplemented from FWConfigurableParameterizable.

Definition at line 183 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(), v, 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());

  if (gEve)
  {
     TGLViewer* v = gEve->GetDefaultGLViewer();
     setGLColorFromConfig(v->RefLightColorSet().Selection(1),  iFrom.valueForKey("SelectionColorLight"));
     setGLColorFromConfig(v->RefLightColorSet().Selection(3),  iFrom.valueForKey("HighlightColorLight"));
     setGLColorFromConfig(v->RefDarkColorSet().Selection(1),  iFrom.valueForKey("SelectionColorDark"));
     setGLColorFromConfig(v->RefDarkColorSet().Selection(3),  iFrom.valueForKey("HighlightColorDark"));
  }
}
void CmsShowCommon::setGamma ( )
void CmsShowCommon::setGeomColor ( FWGeomColorIndex  cidx,
Color_t  iColor 
)
void CmsShowCommon::setGeomTransparency ( int  val,
bool  projected 
)
void CmsShowCommon::setTrackBreakMode ( )
void CmsShowCommon::switchBackground ( )

Friends And Related Function Documentation

friend class CmsShowCommonPopup [friend]

Definition at line 43 of file CmsShowCommon.h.


Member Data Documentation

Definition at line 85 of file CmsShowCommon.h.

Referenced by addTo(), setFrom(), and switchBackground().

std::auto_ptr<FWViewEnergyScale> CmsShowCommon::m_energyScale [protected]
FWLongParameter* CmsShowCommon::m_geomColors[kFWGeomColorSize] [protected]

Definition at line 91 of file CmsShowCommon.h.

Referenced by CmsShowCommon(), setFrom(), and setGeomColor().

Definition at line 89 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

Definition at line 90 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().