CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public 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 ()
 
 FWDoubleParameterSetter (const FWDoubleParameterSetter &)=delete
 
const FWDoubleParameterSetteroperator= (const FWDoubleParameterSetter &)=delete
 
void setEnabled (bool) override
 
 ~FWDoubleParameterSetter () override
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
 FWParameterSetterBase (const FWParameterSetterBase &)=delete
 
const FWParameterSetterBaseoperator= (const FWParameterSetterBase &)=delete
 
virtual ~FWParameterSetterBase ()
 

Private Attributes

FWDoubleParameterm_param
 
TGNumberEntry * m_widget
 

Additional Inherited Members

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

Detailed Description

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

Usage: <usage>

Definition at line 31 of file FWDoubleParameterSetter.h.

Constructor & Destructor Documentation

FWDoubleParameterSetter::FWDoubleParameterSetter ( )

Definition at line 33 of file FWDoubleParameterSetter.cc.

33 : m_param(nullptr), m_widget(nullptr) {}
FWDoubleParameterSetter::~FWDoubleParameterSetter ( )
override

Definition at line 40 of file FWDoubleParameterSetter.cc.

40 {}
FWDoubleParameterSetter::FWDoubleParameterSetter ( const FWDoubleParameterSetter )
delete

Member Function Documentation

void FWDoubleParameterSetter::attach ( FWParameterBase iParam)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 58 of file FWDoubleParameterSetter.cc.

References cms::cuda::assert(), and m_param.

58  {
59  m_param = dynamic_cast<FWDoubleParameter*>(iParam);
60  assert(nullptr != m_param);
61 }
assert(be >=bs)
TGFrame * FWDoubleParameterSetter::build ( TGFrame *  iParent,
bool  labelBack = true 
)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 63 of file FWDoubleParameterSetter.cc.

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

63  {
64  TGCompositeFrame* frame = new TGHorizontalFrame(iParent);
65 
66  // number entry widget
67  TGNumberFormat::ELimit limits =
68  m_param->min() == m_param->max()
69  ? TGNumberFormat::kNELNoLimits
70  : (m_param->min() > m_param->max() ? TGNumberFormat::kNELLimitMin : TGNumberFormat::kNELLimitMinMax);
71  double min = 0;
72  double max = 1;
73  if (m_param->min() != m_param->max()) {
74  min = m_param->min();
75  max = m_param->max();
76  }
77  m_widget = new TGNumberEntry(frame,
78  m_param->value(),
79  5, // number of digits
80  0, // widget ID
81  TGNumberFormat::kNESReal, // style
82  TGNumberFormat::kNEAAnyNumber, // input value filter
83  limits, // specify limits
84  min, // min value
85  max); // max value
86 
87  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 8, 2, 2));
88  m_widget->Connect("ValueSet(Long_t)", "FWDoubleParameterSetter", this, "doUpdate(Long_t)");
89 
90  // label
91  frame->AddFrame(new TGLabel(frame, m_param->name().c_str()), new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
92  return frame;
93 }
FWParameterSetterEditorBase * frame() const
const std::string & name() const
void FWDoubleParameterSetter::doUpdate ( Long_t  )

Definition at line 95 of file FWDoubleParameterSetter.cc.

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

95  {
96  //std::cout <<"doUpdate called"<<std::endl;
97  assert(nullptr != m_param);
98  assert(nullptr != m_widget);
99  //std::cout <<m_widget->GetNumberEntry()->GetNumber()<<std::endl;
100  m_param->set(m_widget->GetNumberEntry()->GetNumber());
101  update();
102 }
assert(be >=bs)
const FWDoubleParameterSetter& FWDoubleParameterSetter::operator= ( const FWDoubleParameterSetter )
delete
void FWDoubleParameterSetter::setEnabled ( bool  x)
overridevirtual

Reimplemented from FWParameterSetterBase.

Definition at line 104 of file FWDoubleParameterSetter.cc.

References m_widget.

104 { m_widget->SetState(x); }

Member Data Documentation

FWDoubleParameter* FWDoubleParameterSetter::m_param
private

Definition at line 54 of file FWDoubleParameterSetter.h.

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

TGNumberEntry* FWDoubleParameterSetter::m_widget
private

Definition at line 55 of file FWDoubleParameterSetter.h.

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