// ESAF : Euso Simulation and Analysis Framework
// $Id: EsafConfigurable.cc,v 1.3 2005/02/16 23:18:14 thea Exp $
// D. De Marco, M. Pallavicini created Jan, 18 2002
#include "EsafConfigurable.hh"
#include "Config.hh"
BaseDialogFactory* EsafConfigurable::gFactory = NULL;
ClassImp(EsafConfigurable)
//______________________________________________________________________________
EsafConfigurable::EsafConfigurable(const char* ClassName, const char* parent) {
//
// Constructor
// Get config table for all children classes
if ( parent && ClassName )
Config::Get()->AssociateParent(string(ClassName),string(parent));
}
//______________________________________________________________________________
EsafConfigurable::~EsafConfigurable() {
//
// Destructor
//
}
//______________________________________________________________________________
ConfigFileParser* EsafConfigurable::Conf(const char* name) const {
//
// Returns default config for this class, unless a different name is specified
// ClassType cannot be changed
// If a Standard layout has been selected, each configurable class
// get parameters from the same file
//
if ( Config::Get()->IsStandardConfigDefined() ) {
return Config::Get()->GetStandardConfig();
}
if ( name )
return Config::Get()->GetCF( ClassType(), name );
return Config::Get()->GetCF( ClassType(), ClassName() );
}
//______________________________________________________________________________
TGTransientFrame *EsafConfigurable::GetDialog(EusoApplication* pApp, TGWindow* pWin,
TGMainFrame* pMain) const {
//
// Invoke factory method to return the right dialog window to configure
// this class
//
return gFactory->BuildFrame( ClassName(), pApp, pWin, pMain );
}