CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
FWGeoMaterialValidator Class Reference
Inheritance diagram for FWGeoMaterialValidator:
FWValidatorBase

Public Member Functions

virtual void addDaughtersRec (TGeoVolume *v) const
 
virtual void fillOptions (const char *iBegin, const char *iEnd, std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > &oOptions) const
 
 FWGeoMaterialValidator (FWGeometryTableView *v)
 
bool isStringValid (std::string &exp)
 
virtual ~FWGeoMaterialValidator ()
 
- Public Member Functions inherited from FWValidatorBase
 FWValidatorBase ()
 
virtual ~FWValidatorBase ()
 

Public Attributes

FWGeometryTableViewm_browser
 
std::vector< const char * > m_list
 

Detailed Description

Definition at line 57 of file FWGeometryTableView.cc.

Constructor & Destructor Documentation

FWGeoMaterialValidator::FWGeoMaterialValidator ( FWGeometryTableView v)
inline

Definition at line 63 of file FWGeometryTableView.cc.

References m_browser, and findQualityFiles::v.

virtual FWGeoMaterialValidator::~FWGeoMaterialValidator ( )
inlinevirtual

Definition at line 64 of file FWGeometryTableView.cc.

64 {}

Member Function Documentation

virtual void FWGeoMaterialValidator::addDaughtersRec ( TGeoVolume *  v) const
inlinevirtual

Definition at line 66 of file FWGeometryTableView.cc.

References dtNoiseDBValidation_cfg::cerr, FWGeometryTableView::getFilterType(), i, FWGeometryTableView::kFilterMaterialName, FWGeometryTableView::kFilterMaterialTitle, FWGeometryTableView::kFilterShapeClassName, FWGeometryTableView::kFilterShapeName, m_browser, and m_list.

Referenced by fillOptions().

67  {
68  switch (m_browser->getFilterType())
69  {
71  m_list.push_back(v->GetMaterial()->GetName());
72  break;
74  m_list.push_back(v->GetMaterial()->GetTitle());
75  break;
77  m_list.push_back(v->GetShape()->GetName());
78  break;
80  m_list.push_back(v->GetShape()->ClassName());
81  break;
82  default:
83  std::cerr << "FWGeoMaterialValidator unhandeled case. \n";
84  }
85 
86  for (int i = 0; i < v->GetNdaughters(); ++i)
87  addDaughtersRec(v->GetNode(i)->GetVolume());
88 
89  }
FWGeometryTableView * m_browser
int i
Definition: DBlmapReader.cc:9
std::vector< const char * > m_list
virtual void addDaughtersRec(TGeoVolume *v) const
virtual void FWGeoMaterialValidator::fillOptions ( const char *  iBegin,
const char *  iEnd,
std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > &  oOptions 
) const
inlinevirtual

Implements FWValidatorBase.

Definition at line 91 of file FWGeometryTableView.cc.

References addDaughtersRec(), FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableView::getTableManager(), FWGeometryTableViewBase::getTopNodeIdx(), h, i, m_browser, m_list, FWGeometryTableManagerBase::refEntries(), python.multivaluedict::sort(), AlCaHLTBitMon_QueryRunRegistry::string, and interactiveExample::ui.

92  {
93  oOptions.clear();
94  m_list.clear();
95 
97  std::advance(tnit, m_browser->getTopNodeIdx());
99  addDaughtersRec(tnit->m_node->GetVolume());
100 
101  std::sort(m_list.begin(), m_list.end());
102  std::vector<const char*>::iterator ui = std::unique(m_list.begin(), m_list.end());
103  m_list.resize(ui - m_list.begin());
104 
105  std::string part(iBegin,iEnd);
106  unsigned int part_size = part.size();
107  std::string h = "";
108  // int cnt = 0;
109  oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(new std::string(*m_list.begin())), h));
110  std::vector<const char*>::iterator startIt = m_list.begin(); startIt++;
111  for (std::vector<const char*>::iterator i = startIt; i!=m_list.end(); ++i)
112  {
113  // std::cout << *i << " " << cnt++ << std::endl;
114  if ((strlen(*i) >= part_size) && strncmp(*i, part.c_str(), part_size ) == 0)
115  {
116  oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(new std::string((*i))),&((*i)[part_size]) ));
117  }
118  }
119  }
FWGeometryTableView * m_browser
int i
Definition: DBlmapReader.cc:9
std::vector< const char * > m_list
virtual void addDaughtersRec(TGeoVolume *v) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
part
Definition: HCALResponse.h:20
virtual FWGeometryTableManagerBase * getTableManager()
bool FWGeoMaterialValidator::isStringValid ( std::string &  exp)
inline

Definition at line 121 of file FWGeometryTableView.cc.

References dtNoiseDBValidation_cfg::cerr.

122  {
123  std::cerr << "validation not used \n";
124  return false;
125  }

Member Data Documentation

FWGeometryTableView* FWGeoMaterialValidator::m_browser

Definition at line 61 of file FWGeometryTableView.cc.

Referenced by addDaughtersRec(), fillOptions(), and FWGeoMaterialValidator().

std::vector<const char*> FWGeoMaterialValidator::m_list
mutable

Definition at line 62 of file FWGeometryTableView.cc.

Referenced by addDaughtersRec(), and fillOptions().