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 31 of file FWDoubleParameterSetter.h.

Constructor & Destructor Documentation

◆ FWDoubleParameterSetter() [1/2]

FWDoubleParameterSetter::FWDoubleParameterSetter ( )

Definition at line 33 of file FWDoubleParameterSetter.cc.

33 : m_param(nullptr), m_widget(nullptr) {}

◆ ~FWDoubleParameterSetter()

FWDoubleParameterSetter::~FWDoubleParameterSetter ( )
override

Definition at line 40 of file FWDoubleParameterSetter.cc.

40 {}

◆ FWDoubleParameterSetter() [2/2]

FWDoubleParameterSetter::FWDoubleParameterSetter ( const FWDoubleParameterSetter )
privatedelete

Member Function Documentation

◆ attach()

void FWDoubleParameterSetter::attach ( FWParameterBase iParam)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 58 of file FWDoubleParameterSetter.cc.

58  {
59  m_param = dynamic_cast<FWDoubleParameter*>(iParam);
60  assert(nullptr != m_param);
61 }

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

◆ build()

TGFrame * FWDoubleParameterSetter::build ( TGFrame *  iParent,
bool  labelBack = true 
)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 63 of file FWDoubleParameterSetter.cc.

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 }

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

◆ doUpdate()

void FWDoubleParameterSetter::doUpdate ( Long_t  )

Definition at line 95 of file FWDoubleParameterSetter.cc.

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 }

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

◆ operator=()

const FWDoubleParameterSetter& FWDoubleParameterSetter::operator= ( const FWDoubleParameterSetter )
privatedelete

◆ setEnabled()

void FWDoubleParameterSetter::setEnabled ( bool  x)
overridevirtual

Reimplemented from FWParameterSetterBase.

Definition at line 104 of file FWDoubleParameterSetter.cc.

104 { m_widget->SetState(x); }

References m_widget, and x.

Member Data Documentation

◆ m_param

FWDoubleParameter* FWDoubleParameterSetter::m_param
private

Definition at line 54 of file FWDoubleParameterSetter.h.

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

◆ m_widget

TGNumberEntry* FWDoubleParameterSetter::m_widget
private

Definition at line 55 of file FWDoubleParameterSetter.h.

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

FWGenericParameterWithRange::max
T max() const
Definition: FWGenericParameterWithRange.h:47
min
T min(T a, T b)
Definition: MathUtil.h:58
cms::cuda::assert
assert(be >=bs)
FWGenericParameter::set
void set(T iValue)
Definition: FWGenericParameter.h:70
DDAxes::x
FWGenericParameterWithRange::min
T min() const
Definition: FWGenericParameterWithRange.h:46
FWDoubleParameterSetter::m_param
FWDoubleParameter * m_param
Definition: FWDoubleParameterSetter.h:54
FWParameterSetterBase::update
void update() const
Definition: FWParameterSetterBase.cc:74
FWDoubleParameterSetter::m_widget
TGNumberEntry * m_widget
Definition: FWDoubleParameterSetter.h:55
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
FWParameterBase::name
const std::string & name() const
Definition: FWParameterBase.h:39
TH2PolyOfflineMaps.limits
limits
Definition: TH2PolyOfflineMaps.py:44
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
FWParameterSetterBase::frame
FWParameterSetterEditorBase * frame() const
Definition: FWParameterSetterBase.h:51