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 42 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_darkColorSet, m_drawBreakPoints, m_gamma, m_geomColors, m_lightColorSet, m_trackBreak, mergeVDriftHistosByStation::name, setDrawBreakMarkers(), setGamma(), and setTrackBreakMode().

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

Definition at line 64 of file CmsShowCommon.cc.

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

Member Function Documentation

void CmsShowCommon::addTo ( FWConfiguration oTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 168 of file CmsShowCommon.cc.

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

169 {
170  m_backgroundColor.set(int(colorManager()->background()));
171 
173  m_energyScale->addTo(oTo);
174 
175  if (gEve)
176  {
177  addGLColorToConfig("SelectionColorLight", m_lightColorSet.Selection(1), oTo);
178  addGLColorToConfig("HighlightColorLight", m_lightColorSet.Selection(3), oTo);
179  addGLColorToConfig("SelectionColorDark", m_darkColorSet .Selection(1), oTo);
180  addGLColorToConfig("HighlightColorDark", m_darkColorSet .Selection(3), oTo);
181  }
182 }
TGLColorSet m_lightColorSet
Definition: CmsShowCommon.h:97
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:89
const FWColorManager * colorManager() const
std::auto_ptr< FWViewEnergyScale > m_energyScale
TGLColorSet m_darkColorSet
Definition: CmsShowCommon.h:98
virtual void addTo(FWConfiguration &) const
const FWColorManager * CmsShowCommon::colorManager ( ) const
protected
int CmsShowCommon::gamma ( )
inline

Definition at line 61 of file CmsShowCommon.h.

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

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

Definition at line 71 of file CmsShowCommon.h.

References m_darkColorSet.

Referenced by FWEveView::setFrom().

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

Definition at line 68 of file CmsShowCommon.h.

References m_energyScale.

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

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

Definition at line 70 of file CmsShowCommon.h.

References m_lightColorSet.

Referenced by FWEveView::setFrom().

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

Definition at line 74 of file CmsShowCommon.h.

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

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

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

Definition at line 75 of file CmsShowCommon.h.

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

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

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

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

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

Reimplemented from FWConfigurableParameterizable.

Definition at line 185 of file CmsShowCommon.cc.

References FWParameterizable::begin(), fireworks::Context::colorManager(), 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().

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

Definition at line 104 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommon().

105 {
107 }
FWColorManager * colorManager() const
Definition: Context.h:66
FWLongParameter m_gamma
Definition: CmsShowCommon.h:90
void setBrightness(int)
fireworks::Context * m_context
Definition: CmsShowCommon.h:83
void CmsShowCommon::setGeomColor ( FWGeomColorIndex  cidx,
Color_t  iColor 
)

Definition at line 117 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommonPopup::changeGeomColor().

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

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

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

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

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

Definition at line 110 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommonPopup::switchBackground().

111 {
113  m_backgroundColor.set(colorManager()->background());
114 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:89
FWColorManager * colorManager() const
Definition: Context.h:66
const FWColorManager * colorManager() const
fireworks::Context * m_context
Definition: CmsShowCommon.h:83

Friends And Related Function Documentation

friend class CmsShowCommonPopup
friend

Definition at line 44 of file CmsShowCommon.h.

Member Data Documentation

FWLongParameter CmsShowCommon::m_backgroundColor
mutableprotected

Definition at line 89 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 95 of file CmsShowCommon.h.

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

FWLongParameter CmsShowCommon::m_geomTransparency2D
protected

Definition at line 93 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

FWLongParameter CmsShowCommon::m_geomTransparency3D
protected

Definition at line 94 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

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