本文整理汇总了C++中SdfPathVector::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ SdfPathVector::begin方法的具体用法?C++ SdfPathVector::begin怎么用?C++ SdfPathVector::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SdfPathVector
的用法示例。
在下文中一共展示了SdfPathVector::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _VisitImpl
void _VisitImpl(SdfPathVector const &paths) {
if (!paths.empty()) {
for (SdfPath const &p: paths) {
_workQueue.push(p);
}
_consumerTask.Wake();
}
if (_recurse) {
WorkParallelForEach(
paths.begin(), paths.end(),
[this](SdfPath const &path) {
if (!path.HasPrefix(_prim.GetPath())) {
if (UsdPrim owningPrim = _prim.GetStage()->
GetPrimAtPath(path.GetPrimPath())) {
_VisitSubtree(owningPrim);
}
}
});
}
}
示例2: GetPath
void
SdfAttributeSpec::ChangeMapperPath(
const SdfPath& oldPath, const SdfPath& newPath)
{
if (not PermissionToEdit()) {
TF_CODING_ERROR("Change mapper path: Permission denied.");
return;
}
const SdfPath& attrPath = GetPath();
// Absolutize.
SdfPath oldAbsPath = oldPath.MakeAbsolutePath(attrPath.GetPrimPath());
SdfPath newAbsPath = newPath.MakeAbsolutePath(attrPath.GetPrimPath());
// Validate.
if (oldAbsPath == newAbsPath) {
// Nothing to do.
return;
}
if (not newAbsPath.IsPropertyPath()) {
TF_CODING_ERROR("cannot change connection path for attribute %s's "
"mapper at connection path <%s> to <%s> because it's "
"not a property path",
attrPath.GetString().c_str(),
oldAbsPath.GetString().c_str(),
newAbsPath.GetString().c_str());
return;
}
SdfPathVector mapperPaths =
GetFieldAs<SdfPathVector>(SdfChildrenKeys->MapperChildren);
// Check that a mapper actually exists at the old path.
SdfPathVector::iterator mapperIt =
std::find(mapperPaths.begin(), mapperPaths.end(), oldAbsPath);
if (mapperIt == mapperPaths.end()) {
TF_CODING_ERROR("Change mapper path: No mapper exists for "
"connection path <%s>.", oldAbsPath.GetText());
return;
}
// Check that no mapper already exists at the new path.
const bool mapperExistsAtNewPath =
(std::find(mapperPaths.begin(), mapperPaths.end(), newAbsPath) !=
mapperPaths.end());
if (mapperExistsAtNewPath) {
TF_CODING_ERROR("Change mapper path: Mapper already exists for "
"connection path <%s>.", newAbsPath.GetText());
return;
}
// Things look OK -- let's go ahead and move the mapper over to the
// new path.
SdfChangeBlock block;
const SdfPath oldMapperSpecPath = attrPath.AppendMapper(oldAbsPath);
const SdfPath newMapperSpecPath = attrPath.AppendMapper(newAbsPath);
_MoveSpec(oldMapperSpecPath, newMapperSpecPath);
*mapperIt = newAbsPath;
SetField(SdfChildrenKeys->MapperChildren, VtValue(mapperPaths));
}