CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWProxyBuilderConfiguration Class Reference

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

Inheritance diagram for FWProxyBuilderConfiguration:
FWConfigurableParameterizable FWParameterSetterEditorBase FWParameterizable FWConfigurable

List of all members.

Public Member Functions

virtual void addTo (FWConfiguration &iTo) const
template<class T >
FWGenericParameterWithRange< T > * assertParam (const std::string &name, T def, T min, T max)
template<class T >
FWGenericParameter< T > * assertParam (const std::string &name, T def)
 FWProxyBuilderConfiguration (const FWConfiguration *c, const FWEventItem *item)
void populateFrame (TGCompositeFrame *frame)
virtual void setFrom (const FWConfiguration &iFrom)
template<class T >
T value (const std::string &name)
virtual ~FWProxyBuilderConfiguration ()

Private Member Functions

void makeSetter (TGCompositeFrame *, FWParameterBase *)

Private Attributes

const FWEventItemm_item
std::vector< boost::shared_ptr
< FWParameterSetterBase > > 
m_setters
const FWConfigurationm_txtConfig

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 43 of file FWProxyBuilderConfiguration.h.


Constructor & Destructor Documentation

FWProxyBuilderConfiguration::FWProxyBuilderConfiguration ( const FWConfiguration c,
const FWEventItem item 
)

Definition at line 34 of file FWProxyBuilderConfiguration.cc.

                                                                                                         :
   m_txtConfig(c),
   m_item(item)
{
}
FWProxyBuilderConfiguration::~FWProxyBuilderConfiguration ( ) [virtual]

Definition at line 40 of file FWProxyBuilderConfiguration.cc.

References m_txtConfig.

{
   delete m_txtConfig;
}

Member Function Documentation

void FWProxyBuilderConfiguration::addTo ( FWConfiguration iTo) const [virtual]
template<class T >
FWGenericParameter< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def 
)

Definition at line 99 of file FWProxyBuilderConfiguration.cc.

References FWGenericParameter< T >::changed_, def, FWConfiguration::keyValues(), m_item, m_txtConfig, mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

Referenced by FWVertexProxyBuilder::setItem(), FWJetProxyBuilder::setItem(), and FWTrackingParticleProxyBuilder::setItem().

{
   FWGenericParameter<T>*  mode = new FWGenericParameter<T>(this, name, def);

   //   std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
   if ( m_txtConfig) {
      const FWConfiguration* varConfig = m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
      if (varConfig) mode->setFrom(*varConfig);
   }
   mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
   return mode;
}
template<class T >
FWGenericParameterWithRange< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def,
T  min,
T  max 
)

Definition at line 114 of file FWProxyBuilderConfiguration.cc.

References FWGenericParameter< T >::changed_, def, FWConfiguration::keyValues(), m_item, m_txtConfig, max(), min, mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

{
   FWGenericParameterWithRange<T>*  mode = new FWGenericParameterWithRange<T>(this, name, def, min, max);

   //   std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
   const FWConfiguration* varConfig = m_txtConfig &&  m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
   if (varConfig) mode->setFrom(*varConfig);

   mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
   return mode;
}
void FWProxyBuilderConfiguration::makeSetter ( TGCompositeFrame *  frame,
FWParameterBase pb 
) [private]

Definition at line 72 of file FWProxyBuilderConfiguration.cc.

References m_setters, and FWParameterSetterBase::makeSetterFor().

Referenced by populateFrame().

{
   //  std::cout << "make setter " << pb->name() << std::endl;

   boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(pb) );
   ptr->attach(pb, this); 
   TGFrame* tmpFrame = ptr->build(frame, false);
   frame->AddFrame(tmpFrame, new TGLayoutHints(kLHintsExpandX));
   m_setters.push_back(ptr);
}
void FWProxyBuilderConfiguration::populateFrame ( TGCompositeFrame *  frame)

Definition at line 84 of file FWProxyBuilderConfiguration.cc.

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

Referenced by CmsShowEDI::fillEDIFrame().

{
   //  std::cout << "populate \n";

   TGCompositeFrame* frame =  new TGVerticalFrame(settersFrame);
   settersFrame->AddFrame(frame, new TGLayoutHints(kLHintsExpandX) );//|kLHintsExpandY
  
   for(const_iterator it =begin(); it != end(); ++it)
      makeSetter(frame, *it);

   settersFrame->MapSubwindows();   
}
void FWProxyBuilderConfiguration::setFrom ( const FWConfiguration iFrom) [virtual]

Reimplemented from FWConfigurableParameterizable.

Definition at line 60 of file FWProxyBuilderConfiguration.cc.

{
   /*
     for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
     std::cout << it->first << "FWProxyBuilderConfiguration::setFrom  " << std::endl;
     }*/
}
template<class T >
template double FWProxyBuilderConfiguration::value< double > ( const std::string &  name)

Definition at line 126 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWParameterizable::end(), i, and FWGenericParameter< T >::value().

Referenced by FWVertexProxyBuilder::build(), FWJetProxyBuilder::buildViewType(), and FWJetProxyBuilder::setTextPos().

{
   FWGenericParameter<T>* param = 0;

   for (FWConfigurableParameterizable::const_iterator i = begin(); i != end(); ++i) 
   {
      if ((*i)->name() == pname)
      {
         param = (FWGenericParameter<T>* )(*i);
         break;
      }
   }

   if (param) 
      return param->value();
   else
      throw std::runtime_error("Invalid parameter request.");
}

Member Data Documentation

Definition at line 65 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam().

std::vector<boost::shared_ptr<FWParameterSetterBase> > FWProxyBuilderConfiguration::m_setters [private]

Definition at line 68 of file FWProxyBuilderConfiguration.h.

Referenced by makeSetter().

Definition at line 64 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam(), and ~FWProxyBuilderConfiguration().