CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWDoubleParameterSetter Class Reference

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

Inheritance diagram for FWDoubleParameterSetter:
FWParameterSetterBase

Public Member Functions

void attach (FWParameterBase *) override
 
TGFrame * build (TGFrame *iParent, bool labelBack=true) override
 
void doUpdate (Long_t)
 
 FWDoubleParameterSetter ()
 
void setEnabled (bool) override
 
 ~FWDoubleParameterSetter () override
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

 FWDoubleParameterSetter (const FWDoubleParameterSetter &)=delete
 
const FWDoubleParameterSetteroperator= (const FWDoubleParameterSetter &)=delete
 

Private Attributes

FWDoubleParameterm_param
 
TGNumberEntry * m_widget
 

Additional Inherited Members

- Static Public Member Functions inherited from FWParameterSetterBase
static std::shared_ptr< FWParameterSetterBasemakeSetterFor (FWParameterBase *)
 
- Protected Member Functions inherited from FWParameterSetterBase
FWParameterSetterEditorBaseframe () const
 
void update () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 32 of file FWDoubleParameterSetter.h.

Constructor & Destructor Documentation

FWDoubleParameterSetter::FWDoubleParameterSetter ( )

Definition at line 34 of file FWDoubleParameterSetter.cc.

34  :
35  m_param(nullptr),
36  m_widget(nullptr)
37 {
38 }
FWDoubleParameterSetter::~FWDoubleParameterSetter ( )
override

Definition at line 45 of file FWDoubleParameterSetter.cc.

46 {
47 }
FWDoubleParameterSetter::FWDoubleParameterSetter ( const FWDoubleParameterSetter )
privatedelete

Member Function Documentation

void FWDoubleParameterSetter::attach ( FWParameterBase iParam)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 66 of file FWDoubleParameterSetter.cc.

References m_param.

67 {
68  m_param = dynamic_cast<FWDoubleParameter*>(iParam);
69  assert(nullptr!=m_param);
70 }
TGFrame * FWDoubleParameterSetter::build ( TGFrame *  iParent,
bool  labelBack = true 
)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 73 of file FWDoubleParameterSetter.cc.

References FWParameterSetterBase::frame(), m_param, m_widget, FWGenericParameterWithRange< T >::max(), SiStripPI::max, min(), FWGenericParameterWithRange< T >::min(), FWParameterBase::name(), and FWGenericParameter< T >::value().

74 {
75  TGCompositeFrame* frame = new TGHorizontalFrame(iParent);
76 
77  // number entry widget
78  TGNumberFormat::ELimit limits = m_param->min()==m_param->max() ?
79  TGNumberFormat::kNELNoLimits :
80  ( m_param->min() > m_param->max() ? TGNumberFormat::kNELLimitMin : TGNumberFormat::kNELLimitMinMax);
81  double min = 0;
82  double max = 1;
83  if(m_param->min()!=m_param->max()) {
84  min=m_param->min();
85  max=m_param->max();
86  }
87  m_widget = new TGNumberEntry
88  (frame, m_param->value(),
89  5, // number of digits
90  0, // widget ID
91  TGNumberFormat::kNESReal, // style
92  TGNumberFormat::kNEAAnyNumber, // input value filter
93  limits, // specify limits
94  min, // min value
95  max); // max value
96 
97  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
98  m_widget->Connect("ValueSet(Long_t)", "FWDoubleParameterSetter", this, "doUpdate(Long_t)");
99 
100  // label
101  frame->AddFrame(new TGLabel(frame,m_param->name().c_str()),
102  new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
103  return frame;
104 }
FWParameterSetterEditorBase * frame() const
T min(T a, T b)
Definition: MathUtil.h:58
const std::string & name() const
void FWDoubleParameterSetter::doUpdate ( Long_t  )

Definition at line 107 of file FWDoubleParameterSetter.cc.

References m_param, m_widget, FWGenericParameter< T >::set(), and FWParameterSetterBase::update().

108 {
109  //std::cout <<"doUpdate called"<<std::endl;
110  assert(nullptr!=m_param);
111  assert(nullptr!=m_widget);
112  //std::cout <<m_widget->GetNumberEntry()->GetNumber()<<std::endl;
113  m_param->set(m_widget->GetNumberEntry()->GetNumber());
114  update();
115 }
const FWDoubleParameterSetter& FWDoubleParameterSetter::operator= ( const FWDoubleParameterSetter )
privatedelete
void FWDoubleParameterSetter::setEnabled ( bool  x)
overridevirtual

Member Data Documentation

FWDoubleParameter* FWDoubleParameterSetter::m_param
private

Definition at line 57 of file FWDoubleParameterSetter.h.

Referenced by attach(), build(), and doUpdate().

TGNumberEntry* FWDoubleParameterSetter::m_widget
private

Definition at line 58 of file FWDoubleParameterSetter.h.

Referenced by build(), doUpdate(), and setEnabled().