test
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 override
 
 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 56 of file FWGeometryTableView.cc.

Constructor & Destructor Documentation

FWGeoMaterialValidator::FWGeoMaterialValidator ( FWGeometryTableView v)
inline

Definition at line 62 of file FWGeometryTableView.cc.

References m_browser, and findQualityFiles::v.

virtual FWGeoMaterialValidator::~FWGeoMaterialValidator ( )
inlinevirtual

Definition at line 63 of file FWGeometryTableView.cc.

63 {}

Member Function Documentation

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

Definition at line 65 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().

66  {
67  switch (m_browser->getFilterType())
68  {
70  m_list.push_back(v->GetMaterial()->GetName());
71  break;
73  m_list.push_back(v->GetMaterial()->GetTitle());
74  break;
76  m_list.push_back(v->GetShape()->GetName());
77  break;
79  m_list.push_back(v->GetShape()->ClassName());
80  break;
81  default:
82  std::cerr << "FWGeoMaterialValidator unhandeled case. \n";
83  }
84 
85  for (int i = 0; i < v->GetNdaughters(); ++i)
86  addDaughtersRec(v->GetNode(i)->GetVolume());
87 
88  }
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
inlineoverridevirtual

Implements FWValidatorBase.

Definition at line 90 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.

91  {
92  oOptions.clear();
93  m_list.clear();
94 
96  std::advance(tnit, m_browser->getTopNodeIdx());
98  addDaughtersRec(tnit->m_node->GetVolume());
99 
100  std::sort(m_list.begin(), m_list.end());
101  std::vector<const char*>::iterator ui = std::unique(m_list.begin(), m_list.end());
102  m_list.resize(ui - m_list.begin());
103 
104  std::string part(iBegin,iEnd);
105  unsigned int part_size = part.size();
106  std::string h = "";
107  // int cnt = 0;
108  oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(new std::string(*m_list.begin())), h));
109  std::vector<const char*>::iterator startIt = m_list.begin(); startIt++;
110  for (std::vector<const char*>::iterator i = startIt; i!=m_list.end(); ++i)
111  {
112  // std::cout << *i << " " << cnt++ << std::endl;
113  if ((strlen(*i) >= part_size) && strncmp(*i, part.c_str(), part_size ) == 0)
114  {
115  oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(new std::string((*i))),&((*i)[part_size]) ));
116  }
117  }
118  }
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 120 of file FWGeometryTableView.cc.

References dtNoiseDBValidation_cfg::cerr.

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

Member Data Documentation

FWGeometryTableView* FWGeoMaterialValidator::m_browser

Definition at line 60 of file FWGeometryTableView.cc.

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

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

Definition at line 61 of file FWGeometryTableView.cc.

Referenced by addDaughtersRec(), and fillOptions().