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 ()
 
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 ()
 
- 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
 
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
 

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 40 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, ConfigFiles::l, m_drawBreakPoints, m_gamma, m_geomColors, 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 }
int i
Definition: DBlmapReader.cc:9
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:81
FWConfigurableParameterizable(unsigned int iVersion=1)
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:84
FWGeomColorIndex
void setTrackBreakMode()
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:90
sigc::signal< void, T > changed_
const FWColorManager * colorManager() const
FWLongParameter m_gamma
Definition: CmsShowCommon.h:85
bool addEntry(Long_t id, const std::string &txt)
fireworks::Context * m_context
Definition: CmsShowCommon.h:78
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:89
void setDrawBreakMarkers()
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:88
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:93
FWParameters::Long FWLongParameter
Definition: FWParameters.h:35
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:80
CmsShowCommon::~CmsShowCommon ( )
virtual

Definition at line 60 of file CmsShowCommon.cc.

61 {
62 }
CmsShowCommon::CmsShowCommon ( const CmsShowCommon )
private

Member Function Documentation

void CmsShowCommon::addTo ( FWConfiguration oTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 164 of file CmsShowCommon.cc.

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

165 {
166  m_backgroundColor.set(int(colorManager()->background()));
167 
169  m_energyScale->addTo(oTo);
170 
171  if (gEve)
172  {
173  TGLViewer* v = gEve->GetDefaultGLViewer();
174  addGLColorToConfig("SelectionColorLight", v->RefLightColorSet().Selection(1), oTo);
175  addGLColorToConfig("HighlightColorLight", v->RefLightColorSet().Selection(3), oTo);
176  addGLColorToConfig("SelectionColorDark", v->RefDarkColorSet().Selection(1), oTo);
177  addGLColorToConfig("HighlightColorDark", v->RefDarkColorSet().Selection(3), oTo);
178  }
179 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:84
const FWColorManager * colorManager() const
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:93
virtual void addTo(FWConfiguration &) const
const FWColorManager * CmsShowCommon::colorManager ( ) const
protected
int CmsShowCommon::gamma ( )
inline

Definition at line 59 of file CmsShowCommon.h.

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

59 { return m_gamma.value(); }
FWLongParameter m_gamma
Definition: CmsShowCommon.h:85
FWViewEnergyScale* CmsShowCommon::getEnergyScale ( ) const
inline

Definition at line 66 of file CmsShowCommon.h.

References m_energyScale.

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

66 { return m_energyScale.get(); }
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:93
UChar_t CmsShowCommon::getProjTrackBreaking ( ) const
inline

Definition at line 69 of file CmsShowCommon.h.

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

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

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

Definition at line 70 of file CmsShowCommon.h.

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

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

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

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

89 {
90  if (m_context->getTrackPropagator()->GetRnrPTBMarkers() != m_drawBreakPoints.value())
91  {
92  m_context->getTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value());
95  gEve->Redraw3D();
96  }
97 }
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:81
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:74
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:73
fireworks::Context * m_context
Definition: CmsShowCommon.h:78
TEveTrackPropagator * getMuonTrackPropagator() const
Definition: Context.h:75
void CmsShowCommon::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 182 of file CmsShowCommon.cc.

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

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

Definition at line 100 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommon().

101 {
103 }
FWColorManager * colorManager() const
Definition: Context.h:65
FWLongParameter m_gamma
Definition: CmsShowCommon.h:85
void setBrightness(int)
fireworks::Context * m_context
Definition: CmsShowCommon.h:78
void CmsShowCommon::setGeomColor ( FWGeomColorIndex  cidx,
Color_t  iColor 
)

Definition at line 113 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommonPopup::changeGeomColor().

114 {
115  m_geomColors[cidx]->set(iColor);
116  m_context->colorManager()->setGeomColor(cidx, iColor);
117 }
FWColorManager * colorManager() const
Definition: Context.h:65
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:90
void setGeomColor(FWGeomColorIndex, Color_t)
fireworks::Context * m_context
Definition: CmsShowCommon.h:78
void CmsShowCommon::setGeomTransparency ( int  val,
bool  projected 
)

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

121 {
122  if (projected)
123  m_geomTransparency2D.set(iTransp);
124  else
125  m_geomTransparency3D.set(iTransp);
126 
127  m_context->colorManager()->setGeomTransparency(iTransp, projected);
128 }
FWColorManager * colorManager() const
Definition: Context.h:65
void setGeomTransparency(Color_t idx, bool projectedType)
fireworks::Context * m_context
Definition: CmsShowCommon.h:78
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:89
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:88
void CmsShowCommon::setTrackBreakMode ( )

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

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

Definition at line 106 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommonPopup::switchBackground().

107 {
109  m_backgroundColor.set(colorManager()->background());
110 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:84
FWColorManager * colorManager() const
Definition: Context.h:65
const FWColorManager * colorManager() const
fireworks::Context * m_context
Definition: CmsShowCommon.h:78

Friends And Related Function Documentation

friend class CmsShowCommonPopup
friend

Definition at line 42 of file CmsShowCommon.h.

Member Data Documentation

FWLongParameter CmsShowCommon::m_backgroundColor
mutableprotected

Definition at line 84 of file CmsShowCommon.h.

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

fireworks::Context* CmsShowCommon::m_context
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 90 of file CmsShowCommon.h.

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

FWLongParameter CmsShowCommon::m_geomTransparency2D
protected

Definition at line 88 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

FWLongParameter CmsShowCommon::m_geomTransparency3D
protected

Definition at line 89 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

FWEnumParameter CmsShowCommon::m_trackBreak
protected