本文整理汇总了C++中TfTokenVector::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ TfTokenVector::resize方法的具体用法?C++ TfTokenVector::resize怎么用?C++ TfTokenVector::resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TfTokenVector
的用法示例。
在下文中一共展示了TfTokenVector::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _MakeProperties
std::vector<UsdProperty>
UsdPrim::_GetPropertiesInNamespace(const std::string &namespaces,
bool onlyAuthored) const
{
// XXX Would be nice to someday plumb the prefix search down through pcp
if (namespaces.empty())
return onlyAuthored ? GetAuthoredProperties() : GetProperties();
const char delim = UsdObject::GetNamespaceDelimiter();
TfTokenVector names = _GetPropertyNames(onlyAuthored, /*applyOrder=*/false);
// Set terminator to the expected position of the delimiter after all the
// supplied namespaces. We perform an explicit test for this char below
// so that we don't need to allocate a new string if namespaces does not
// already end with the delimiter
const size_t terminator = namespaces.size() -
(*namespaces.rbegin() == delim);
// Prune out non-matches before we sort
size_t insertionPt = 0;
for (const auto& name : names) {
const std::string &s = name.GetString();
if (s.size() > terminator &&
TfStringStartsWith(s, namespaces) &&
s[terminator] == delim) {
names[insertionPt++] = name;
}
}
names.resize(insertionPt);
sort(names.begin(), names.end(), TfDictionaryLessThan());
_ApplyOrdering(GetPropertyOrder(), &names);
return _MakeProperties(names);
}