本文整理汇总了C++中Selection::find方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::find方法的具体用法?C++ Selection::find怎么用?C++ Selection::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSelection
void DisplayedElementsModel::setSelection(const Selection & s)
{
m_startEvent->selection.set(s.find(m_startEvent) != s.end());
m_endEvent->selection.set(s.find(m_endEvent) != s.end());
m_startState->selection.set(s.find(m_startState) != s.end());
m_endState->selection.set(s.find(m_endState) != s.end());
m_constraint->selection.set(s.find(m_constraint) != s.end());
}
示例2: setSelection
void ScenarioModel::setSelection(const Selection& s) const
{
// TODO optimize if possible?
for(auto& elt : m_constraints)
elt->selection.set(s.find(elt) != s.end());
for(auto& elt : m_events)
elt->selection.set(s.find(elt) != s.end());
for(auto& elt : m_timeNodes)
elt->selection.set(s.find(elt) != s.end());
for(auto& elt : m_states)
elt->selection.set(s.find(elt) != s.end());
}
示例3: GetSelectedSet
/// @brief Retrieve a list of selected lines in the actual ASS file (ie. not as displayed in the grid but as represented in the file)
/// @return
///
std::vector<int> SubtitlesGrid::GetAbsoluteSelection() const {
Selection sel = GetSelectedSet();
std::vector<int> result;
result.reserve(sel.size());
int line_index = 0;
for (entryIter it = context->ass->Line.begin(); it != context->ass->Line.end(); ++it, ++line_index) {
if (sel.find(dynamic_cast<AssDialogue*>(*it)) != sel.end())
result.push_back(line_index);
}
return result;
}