test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 CmsShowCommon (fireworks::Context *)
 
int gamma ()
 
const TGLColorSet & getDarkColorSet () const
 
FWViewEnergyScalegetEnergyScale () const
 
const TGLColorSet & getLightColorSet () 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 ()
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
virtual ~FWConfigurableParameterizable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 

Protected Member Functions

const FWColorManagercolorManager () const
 

Protected Attributes

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

Private Member Functions

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

Friends

class CmsShowCommonPopup
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 

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 31 of file CmsShowCommon.cc.

References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, colorManager(), i, kFWGeomColorSize, prof2calltree::l, m_darkColorSet, m_drawBreakPoints, m_gamma, m_geomColors, m_lightColorSet, m_trackBreak, mergeVDriftHistosByStation::name, setDrawBreakMarkers(), setGamma(), and setTrackBreakMode().

31  :
33  m_context(c),
34  m_trackBreak(this, " ", 2l, 0l, 2l), // do not want to render text at setter
35  m_drawBreakPoints(this, "Show y=0 points as markers", false),
36  m_backgroundColor(this, "backgroundColIdx", 1l, 0l, 1000l),
37  m_gamma(this, "Brightness", 0l, -15l, 15l),
38  m_geomTransparency2D(this, "Transparency 2D", long(colorManager()->geomTransparency(true)), 0l, 100l),
39  m_geomTransparency3D(this, "Transparency 3D", long(colorManager()->geomTransparency(false)), 0l, 100l),
40  m_energyScale(new FWViewEnergyScale("global", 2))
41 {
42  // projections
43  m_trackBreak.addEntry(0, "Jump to proper hemisphere");
44  m_trackBreak.addEntry(1, "Stay on first point side");
45  m_trackBreak.addEntry(2, "Stay on last point side");
46 
47  // colors
48  char name[32];
49  for (int i = 0; i < kFWGeomColorSize; ++i)
50  {
51  snprintf(name, 31, "GeometryColor %d ", i);
52  m_geomColors[i] = new FWLongParameter(this, name , long(colorManager()->geomColor(FWGeomColorIndex(i))), 1000l, 1100l);
53  }
54 
55  m_trackBreak.changed_.connect(boost::bind(&CmsShowCommon::setTrackBreakMode, this));
57  m_gamma.changed_.connect(boost::bind(&CmsShowCommon::setGamma, this));
58 
59  m_lightColorSet.StdLightBackground();
60  m_darkColorSet .StdDarkBackground();
61 }
int i
Definition: DBlmapReader.cc:9
TGLColorSet m_lightColorSet
Definition: CmsShowCommon.h:96
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:85
FWConfigurableParameterizable(unsigned int iVersion=1)
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:88
FWGeomColorIndex
void setTrackBreakMode()
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:94
sigc::signal< void, T > changed_
const FWColorManager * colorManager() const
FWLongParameter m_gamma
Definition: CmsShowCommon.h:89
bool addEntry(Long_t id, const std::string &txt)
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:93
void setDrawBreakMarkers()
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:92
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:99
TGLColorSet m_darkColorSet
Definition: CmsShowCommon.h:97
FWParameters::Long FWLongParameter
Definition: FWParameters.h:35
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:84
CmsShowCommon::~CmsShowCommon ( )
virtual

Definition at line 63 of file CmsShowCommon.cc.

64 {
65 }
CmsShowCommon::CmsShowCommon ( const CmsShowCommon )
private

Member Function Documentation

void CmsShowCommon::addTo ( FWConfiguration oTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 167 of file CmsShowCommon.cc.

References FWConfigurableParameterizable::addTo(), colorManager(), m_backgroundColor, m_darkColorSet, m_energyScale, m_lightColorSet, and FWGenericParameter< T >::set().

168 {
169  m_backgroundColor.set(int(colorManager()->background()));
170 
172  m_energyScale->addTo(oTo);
173 
174  if (gEve)
175  {
176  addGLColorToConfig("SelectionColorLight", m_lightColorSet.Selection(1), oTo);
177  addGLColorToConfig("HighlightColorLight", m_lightColorSet.Selection(3), oTo);
178  addGLColorToConfig("SelectionColorDark", m_darkColorSet .Selection(1), oTo);
179  addGLColorToConfig("HighlightColorDark", m_darkColorSet .Selection(3), oTo);
180  }
181 }
TGLColorSet m_lightColorSet
Definition: CmsShowCommon.h:96
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:88
const FWColorManager * colorManager() const
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:99
TGLColorSet m_darkColorSet
Definition: CmsShowCommon.h:97
virtual void addTo(FWConfiguration &) const
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().

60 { return m_gamma.value(); }
FWLongParameter m_gamma
Definition: CmsShowCommon.h:89
const TGLColorSet& CmsShowCommon::getDarkColorSet ( ) const
inline

Definition at line 70 of file CmsShowCommon.h.

References m_darkColorSet.

Referenced by FWEveView::setFrom().

70 { return m_darkColorSet; }
TGLColorSet m_darkColorSet
Definition: CmsShowCommon.h:97
FWViewEnergyScale* CmsShowCommon::getEnergyScale ( ) const
inline

Definition at line 67 of file CmsShowCommon.h.

References m_energyScale.

Referenced by FWEveViewManager::setContext(), and FWEveView::useGlobalEnergyScaleChanged().

67 { return m_energyScale.get(); }
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:99
const TGLColorSet& CmsShowCommon::getLightColorSet ( ) const
inline

Definition at line 69 of file CmsShowCommon.h.

References m_lightColorSet.

Referenced by FWEveView::setFrom().

69 { return m_lightColorSet; }
TGLColorSet m_lightColorSet
Definition: CmsShowCommon.h:96
UChar_t CmsShowCommon::getProjTrackBreaking ( ) const
inline

Definition at line 73 of file CmsShowCommon.h.

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

Referenced by fireworks::Context::initEveElements().

73 { return m_trackBreak.value(); }
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:84
bool CmsShowCommon::getRnrPTBMarkers ( ) const
inline

Definition at line 74 of file CmsShowCommon.h.

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

Referenced by fireworks::Context::initEveElements().

74 { return m_drawBreakPoints.value(); }
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:85
const CmsShowCommon& CmsShowCommon::operator= ( const CmsShowCommon )
private
void CmsShowCommon::setDrawBreakMarkers ( )

Definition at line 91 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().

92 {
93  if (m_context->getTrackPropagator()->GetRnrPTBMarkers() != m_drawBreakPoints.value())
94  {
95  m_context->getTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value());
98  gEve->Redraw3D();
99  }
100 }
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:85
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:74
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:73
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
TEveTrackPropagator * getMuonTrackPropagator() const
Definition: Context.h:75
void CmsShowCommon::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 184 of file CmsShowCommon.cc.

References FWParameterizable::begin(), fireworks::Context::colorManager(), fileCollector::convert(), FWParameterizable::end(), i, kFWGeomColorSize, m_backgroundColor, m_context, m_darkColorSet, m_energyScale, m_gamma, m_geomColors, m_geomTransparency2D, m_geomTransparency3D, m_lightColorSet, alignBH_cfg::mode, FWColorManager::setBackgroundAndBrightness(), FWColorManager::setGeomColor(), FWColorManager::setGeomTransparency(), FWConfiguration::value(), relativeConstraints::value, FWGenericParameter< T >::value(), and FWConfiguration::valueForKey().

185 {
186  for(const_iterator it =begin(), itEnd = end();
187  it != itEnd;
188  ++it) {
189  (*it)->setFrom(iFrom);
190  }
191 
192  // handle old and new energy scale configuration if existing
193  if (iFrom.valueForKey("ScaleMode"))
194  {
195  long mode = atol(iFrom.valueForKey("ScaleMode")->value().c_str());
196 
197  float convert;
198  if (iFrom.valueForKey("EnergyToLength [GeV/m]"))
199  convert = atof(iFrom.valueForKey("EnergyToLength [GeV/m]")->value().c_str());
200  else
201  convert = atof(iFrom.valueForKey("ValueToHeight [GeV/m]")->value().c_str());
202 
203  float maxH;
204  if (iFrom.valueForKey("MaximumLength [m]"))
205  maxH = atof(iFrom.valueForKey("MaximumLength [m]")->value().c_str());
206  else
207  maxH = atof(iFrom.valueForKey("MaxTowerH [m]")->value().c_str());
208 
209  int et = atoi(iFrom.valueForKey("PlotEt")->value().c_str());
210  m_energyScale->SetFromCmsShowCommonConfig(mode, convert, maxH, et);
211  }
212 
213  // background
216 
217  // geom colors
220 
221  for (int i = 0; i < kFWGeomColorSize; ++i)
223 
224  if (gEve)
225  {
226  setGLColorFromConfig(m_lightColorSet.Selection(1), iFrom.valueForKey("SelectionColorLight"));
227  setGLColorFromConfig(m_lightColorSet.Selection(3), iFrom.valueForKey("HighlightColorLight"));
228  setGLColorFromConfig(m_darkColorSet .Selection(1), iFrom.valueForKey("SelectionColorDark"));
229  setGLColorFromConfig(m_darkColorSet .Selection(3), iFrom.valueForKey("HighlightColorDark"));
230  }
231 }
int i
Definition: DBlmapReader.cc:9
TGLColorSet m_lightColorSet
Definition: CmsShowCommon.h:96
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:88
FWColorManager * colorManager() const
Definition: Context.h:65
FWGeomColorIndex
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:94
FWLongParameter m_gamma
Definition: CmsShowCommon.h:89
void setGeomColor(FWGeomColorIndex, Color_t)
void setGeomTransparency(Color_t idx, bool projectedType)
const_iterator end() const
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:93
const std::string & value(unsigned int iIndex=0) const
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:92
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:99
void setBackgroundAndBrightness(BackgroundColorIndex, int)
TGLColorSet m_darkColorSet
Definition: CmsShowCommon.h:97
const FWConfiguration * valueForKey(const std::string &iKey) const
void CmsShowCommon::setGamma ( )

Definition at line 103 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), m_context, m_gamma, FWColorManager::setBrightness(), and FWGenericParameter< T >::value().

Referenced by CmsShowCommon().

104 {
106 }
FWColorManager * colorManager() const
Definition: Context.h:65
FWLongParameter m_gamma
Definition: CmsShowCommon.h:89
void setBrightness(int)
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
void CmsShowCommon::setGeomColor ( FWGeomColorIndex  cidx,
Color_t  iColor 
)

Definition at line 116 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), m_context, m_geomColors, FWGenericParameter< T >::set(), and FWColorManager::setGeomColor().

Referenced by CmsShowCommonPopup::changeGeomColor().

117 {
118  m_geomColors[cidx]->set(iColor);
119  m_context->colorManager()->setGeomColor(cidx, iColor);
120 }
FWColorManager * colorManager() const
Definition: Context.h:65
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:94
void setGeomColor(FWGeomColorIndex, Color_t)
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
void CmsShowCommon::setGeomTransparency ( int  val,
bool  projected 
)

Definition at line 123 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().

124 {
125  if (projected)
126  m_geomTransparency2D.set(iTransp);
127  else
128  m_geomTransparency3D.set(iTransp);
129 
130  m_context->colorManager()->setGeomTransparency(iTransp, projected);
131 }
FWColorManager * colorManager() const
Definition: Context.h:65
void setGeomTransparency(Color_t idx, bool projectedType)
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:93
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:92
void CmsShowCommon::setTrackBreakMode ( )

Definition at line 78 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().

79 {
80  if (m_context->getTrackPropagator()->GetProjTrackBreaking() != m_trackBreak.value())
81  {
82  m_context->getTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
83  m_context->getTrackerTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
84  m_context->getMuonTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
85  gEve->Redraw3D();
86  }
87 }
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:74
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:73
fireworks::Context * m_context
Definition: CmsShowCommon.h:82
TEveTrackPropagator * getMuonTrackPropagator() const
Definition: Context.h:75
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:84
void CmsShowCommon::switchBackground ( )

Definition at line 109 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), colorManager(), m_backgroundColor, m_context, FWGenericParameter< T >::set(), and FWColorManager::switchBackground().

Referenced by CmsShowCommonPopup::switchBackground().

110 {
112  m_backgroundColor.set(colorManager()->background());
113 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:88
FWColorManager * colorManager() const
Definition: Context.h:65
const FWColorManager * colorManager() const
fireworks::Context * m_context
Definition: CmsShowCommon.h:82

Friends And Related Function Documentation

friend class CmsShowCommonPopup
friend

Definition at line 43 of file CmsShowCommon.h.

Member Data Documentation

FWLongParameter CmsShowCommon::m_backgroundColor
mutableprotected

Definition at line 88 of file CmsShowCommon.h.

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

fireworks::Context* CmsShowCommon::m_context
protected
TGLColorSet CmsShowCommon::m_darkColorSet
protected
FWBoolParameter CmsShowCommon::m_drawBreakPoints
protected
std::auto_ptr<FWViewEnergyScale> CmsShowCommon::m_energyScale
protected
FWLongParameter CmsShowCommon::m_gamma
protected
FWLongParameter* CmsShowCommon::m_geomColors[kFWGeomColorSize]
protected

Definition at line 94 of file CmsShowCommon.h.

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

FWLongParameter CmsShowCommon::m_geomTransparency2D
protected

Definition at line 92 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

FWLongParameter CmsShowCommon::m_geomTransparency3D
protected

Definition at line 93 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

TGLColorSet CmsShowCommon::m_lightColorSet
protected
FWEnumParameter CmsShowCommon::m_trackBreak
protected