本文整理汇总了C++中TfTokenVector::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ TfTokenVector::insert方法的具体用法?C++ TfTokenVector::insert怎么用?C++ TfTokenVector::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TfTokenVector
的用法示例。
在下文中一共展示了TfTokenVector::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: source
void
HdPoints::_PopulateVertexPrimVars(HdDrawItem *drawItem,
HdChangeTracker::DirtyBits *dirtyBits)
{
HD_TRACE_FUNCTION();
HD_MALLOC_TAG_FUNCTION();
SdfPath const& id = GetId();
HdSceneDelegate* delegate = GetDelegate();
HdResourceRegistry *resourceRegistry = &HdResourceRegistry::GetInstance();
// The "points" attribute is expected to be in this list.
TfTokenVector primVarNames = delegate->GetPrimVarVertexNames(id);
TfTokenVector const& vars = delegate->GetPrimVarVaryingNames(id);
primVarNames.insert(primVarNames.end(), vars.begin(), vars.end());
HdBufferSourceVector sources;
sources.reserve(primVarNames.size());
int pointsIndexInSourceArray = -1;
TF_FOR_ALL(nameIt, primVarNames) {
if (not HdChangeTracker::IsPrimVarDirty(*dirtyBits, id, *nameIt))
continue;
// TODO: We don't need to pull primvar metadata every time a value
// changes, but we need support from the delegate.
//assert name not in range.bufferArray.GetResources()
VtValue value = delegate->Get(id, *nameIt);
if (!value.IsEmpty()) {
// Store where the points will be stored in the source array
// we need this later to figure out if the number of points is changing
// and we need to force a garbage collection to resize the buffer
if (*nameIt == HdTokens->points) {
pointsIndexInSourceArray = sources.size();
}
// XXX: do we need special treatment for width as basicCurves?
HdBufferSourceSharedPtr source(new HdVtBufferSource(*nameIt, value));
sources.push_back(source);
}
}
// return before allocation if it's empty.
if (sources.empty())
return;
if (not drawItem->GetVertexPrimVarRange() or
not drawItem->GetVertexPrimVarRange()->IsValid()) {
// initialize buffer array
HdBufferSpecVector bufferSpecs;
TF_FOR_ALL(it, sources) {
(*it)->AddBufferSpecs(&bufferSpecs);
}