CMS 3D CMS Logo

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

FWViewEnergyScale Class Reference

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

Inheritance diagram for FWViewEnergyScale:
FWConfigurableParameterizable FWParameterizable FWConfigurable

List of all members.

Public Types

enum  EScaleMode { kFixedScale, kAutoScale, kCombinedScale, kNone }

Public Member Functions

 FWViewEnergyScale (std::string name, int version)
bool getPlotEt () const
float getScaleFactor3D () const
float getScaleFactorLego () const
const std::string & name () const
void scaleParameterChanged () const
virtual void setFrom (const FWConfiguration &)
void SetFromCmsShowCommonConfig (long mode, float convert, float maxH, bool et)
void updateScaleFactors (float iMaxVal)
virtual ~FWViewEnergyScale ()

Public Attributes

sigc::signal< void > parameterChanged_

Protected Attributes

FWDoubleParameter m_fixedValToHeight
FWDoubleParameter m_maxTowerHeight
FWBoolParameter m_plotEt
FWEnumParameter m_scaleMode

Private Member Functions

float calculateScaleFactor (float iMaxVal, bool isLego) const
 FWViewEnergyScale (const FWViewEnergyScale &)
const FWViewEnergyScaleoperator= (const FWViewEnergyScale &)

Private Attributes

const std::string m_name
float m_scaleFactor3D
float m_scaleFactorLego

Friends

class FWViewEnergyScaleEditor

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 35 of file FWViewEnergyScale.h.


Member Enumeration Documentation

Enumerator:
kFixedScale 
kAutoScale 
kCombinedScale 
kNone 

Definition at line 40 of file FWViewEnergyScale.h.


Constructor & Destructor Documentation

FWViewEnergyScale::FWViewEnergyScale ( std::string  name,
int  version 
)
FWViewEnergyScale::~FWViewEnergyScale ( ) [virtual]

Definition at line 46 of file FWViewEnergyScale.cc.

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

Member Function Documentation

float FWViewEnergyScale::calculateScaleFactor ( float  iMaxVal,
bool  isLego 
) const [private]

Definition at line 59 of file FWViewEnergyScale.cc.

References kAutoScale, kCombinedScale, kFixedScale, m_fixedValToHeight, m_maxTowerHeight, m_scaleMode, mode, Pi, and FWGenericParameter< T >::value().

Referenced by updateScaleFactors().

{ 
   // check if in combined mode
   int mode = m_scaleMode.value();
   if (mode == kCombinedScale)
   {
      mode = (m_maxTowerHeight.value() > 100*iMaxVal/m_fixedValToHeight.value()) ? kFixedScale : kAutoScale;   
      // printf("COMBINED  \n");
   }
   // get converison
 
   if (mode == kFixedScale)
   {
      //  printf("fixed mode %f \n",m_fixedValToHeight.value());
      // apply default constructor height 
      float length = isLego ? TMath::Pi() : 100;
      return length / m_fixedValToHeight.value();
   }
   else
   {
      float length = isLego ? TMath::Pi() : (100*m_maxTowerHeight.value()) ;
      // printf("[%d] length %f max %f  \n", isLego, length, iMaxVal);
      return length / iMaxVal;
   }
}
bool FWViewEnergyScale::getPlotEt ( ) const [inline]
float FWViewEnergyScale::getScaleFactor3D ( ) const [inline]
float FWViewEnergyScale::getScaleFactorLego ( ) const [inline]
const std::string& FWViewEnergyScale::name ( void  ) const [inline]

Definition at line 56 of file FWViewEnergyScale.h.

References m_name.

{ return m_name; } 
const FWViewEnergyScale& FWViewEnergyScale::operator= ( const FWViewEnergyScale ) [private]
void FWViewEnergyScale::scaleParameterChanged ( ) const

Definition at line 53 of file FWViewEnergyScale.cc.

References parameterChanged_.

Referenced by FWViewEnergyScale().

{
   parameterChanged_.emit();
}
void FWViewEnergyScale::setFrom ( const FWConfiguration iFrom) [virtual]

Reimplemented from FWConfigurableParameterizable.

Definition at line 94 of file FWViewEnergyScale.cc.

References FWParameterizable::begin(), and FWParameterizable::end().

{
   for(const_iterator it =begin(), itEnd = end();
       it != itEnd;
       ++it) {
      (*it)->setFrom(iFrom);
   }  
}
void FWViewEnergyScale::SetFromCmsShowCommonConfig ( long  mode,
float  convert,
float  maxH,
bool  et 
)
void FWViewEnergyScale::updateScaleFactors ( float  iMaxVal)

Friends And Related Function Documentation

friend class FWViewEnergyScaleEditor [friend]

Definition at line 37 of file FWViewEnergyScale.h.


Member Data Documentation

const std::string FWViewEnergyScale::m_name [private]

Definition at line 73 of file FWViewEnergyScale.h.

Referenced by name().

Definition at line 76 of file FWViewEnergyScale.h.

Referenced by getScaleFactor3D(), and updateScaleFactors().

Definition at line 77 of file FWViewEnergyScale.h.

Referenced by getScaleFactorLego(), and updateScaleFactors().

Definition at line 53 of file FWViewEnergyScale.h.

Referenced by scaleParameterChanged(), and FWEveViewManager::setContext().