Classes | |
struct | Material |
Public Member Functions | |
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 Attributes | |
FWGeometryTableView * | m_browser |
std::vector< Material > | m_list |
Definition at line 52 of file FWGeometryTableView.cc.
FWGeoMaterialValidator::FWGeoMaterialValidator | ( | FWGeometryTableView * | v | ) | [inline] |
virtual FWGeoMaterialValidator::~FWGeoMaterialValidator | ( | ) | [inline, virtual] |
Definition at line 67 of file FWGeometryTableView.cc.
{}
virtual void FWGeoMaterialValidator::fillOptions | ( | const char * | iBegin, |
const char * | iEnd, | ||
std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > & | oOptions | ||
) | const [inline, virtual] |
Implements FWValidatorBase.
Definition at line 70 of file FWGeometryTableView.cc.
References g, FWGeometryTableView::getTableManager(), FWGeometryTableViewBase::getTopNodeIdx(), h, i, j, m_browser, m_list, FWGeometryTableManagerBase::refEntries(), and python::multivaluedict::sort().
{ oOptions.clear(); std::string part(iBegin,iEnd); unsigned int part_size = part.size(); m_list.clear(); m_list.push_back(0); FWGeometryTableManagerBase::Entries_i it = m_browser->getTableManager()->refEntries().begin(); std::advance(it, m_browser->getTopNodeIdx()); int nLevel = it->m_level; it++; while (it->m_level > nLevel) { TGeoMaterial* g = it->m_node->GetVolume()->GetMaterial(); bool duplicate = false; for (std::vector<Material>::iterator j = m_list.begin(); j!=m_list.end(); ++j) { if (j->g == g) { duplicate = true; break; } } if (!duplicate) m_list.push_back(g); ++it; } std::vector<Material>::iterator startIt = m_list.begin(); startIt++; std::sort(startIt, m_list.end()); std::string h = ""; oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(new std::string(m_list.begin()->n)), h)); for (std::vector<Material>::iterator i = startIt; i!=m_list.end(); ++i) { if(part == (*i).n.substr(0,part_size) ) { // std::cout << i->n <<std::endl; oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(new std::string((*i).n)), (*i).n.substr(part_size, (*i).n.size()-part_size))); } } }
bool FWGeoMaterialValidator::isStringValid | ( | std::string & | exp | ) | [inline] |
Definition at line 114 of file FWGeometryTableView.cc.
Referenced by FWGeometryTableView::filterTextEntryCallback().
Definition at line 63 of file FWGeometryTableView.cc.
Referenced by fillOptions(), and FWGeoMaterialValidator().
std::vector<Material> FWGeoMaterialValidator::m_list [mutable] |
Definition at line 64 of file FWGeometryTableView.cc.
Referenced by fillOptions(), isStringValid(), and FWGeometryTableView::updateFilter().