本文整理汇总了C++中Section::GetSectionType方法的典型用法代码示例。如果您正苦于以下问题:C++ Section::GetSectionType方法的具体用法?C++ Section::GetSectionType怎么用?C++ Section::GetSectionType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::GetSectionType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void BinaryWriter<ElemType>::SaveMapping(std::wstring saveId, const std::map<typename BinaryWriter<ElemType>::LabelIdType, typename BinaryWriter<ElemType>::LabelType>& labelMapping)
{
Section* section = m_sections[saveId];
if (section->GetSectionType() == sectionTypeLabelMapping)
{
auto sectionString = (SectionString*) section;
sectionString->SetLabelMapping(labelMapping);
}
}
示例2: selectionChanged
void SectionPopup::selectionChanged(Section* _section, std::vector<Section*> _sections)
{
selections_->clear();
for(std::vector<Section*>::iterator it = _sections.begin(); it != _sections.end(); ++it)
{
std::string name = boost::lexical_cast<std::string, int>((*it)->GetSectionID()) + " :" + (*it)->GetSectionType();
QAction* select_action = new QAction(name.c_str(), this);
select_action->setCheckable(true);
select_action->setData((*it)->GetSectionID());
if(*it == _section)
select_action->setChecked(true);
QObject::connect(select_action, SIGNAL(triggered()), this, SLOT(selection_item_triggered()));
selections_->addAction(select_action);
}
if(!_section->IsCore())
{
Section* parent = _section->GetParent();
std::string name = std::string("Parent: ") + parent->GetSectionType();
QAction* select_action = new QAction(name.c_str(), this);
select_action->setCheckable(true);
select_action->setData(parent->GetSectionID());
QObject::connect(select_action, SIGNAL(triggered()), this, SLOT(selection_item_triggered()));
selections_->addSeparator();
selections_->addAction(select_action);
}
std::vector<Section*>& subsections = _section->GetSubsections();
if(subsections.size())
{
selections_->addSeparator();
}
for(std::vector<Section*>::iterator it = subsections.begin(); it != subsections.end(); ++it)
{
std::string name = std::string("Child: ") + (*it)->GetSectionType();
QAction* select_action = new QAction(name.c_str(), this);
select_action->setCheckable(true);
select_action->setData((*it)->GetSectionID());
QObject::connect(select_action, SIGNAL(triggered()), this, SLOT(selection_item_triggered()));
selections_->addAction(select_action);
}
}