本文整理汇总了C++中NameList::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ NameList::insert方法的具体用法?C++ NameList::insert怎么用?C++ NameList::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NameList
的用法示例。
在下文中一共展示了NameList::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readTags
void MayaScene::readTags( NameList &tags, int filter ) const
{
tags.clear();
if ( m_isRoot )
{
return;
}
if( m_dagPath.length() == 0 )
{
throw Exception( "MayaScene::attributeNames: Dag path no longer exists!" );
}
std::set<Name> uniqueTags;
std::vector<CustomTagReader> &tagReaders = customTagReaders();
for ( std::vector<CustomTagReader>::const_iterator it = tagReaders.begin(); it != tagReaders.end(); ++it )
{
NameList values;
it->m_read( m_dagPath, values, filter );
uniqueTags.insert( values.begin(), values.end() );
}
tags.insert( tags.end(), uniqueTags.begin(), uniqueTags.end() );
}
示例2: readTags
void LinkedScene::readTags( NameList &tags, int filter ) const
{
if ( filter!=SceneInterface::LocalTag && !m_readOnly )
{
throw Exception( "readTags with filter != LocalTag is only supported when reading the scene file!" );
}
if ( m_linkedScene )
{
m_linkedScene->readTags( tags, filter );
/// Only queries ancestor tags and local tags (if at the link location) from the main scene.
int mainFilter = filter & ( SceneInterface::AncestorTag | ( m_atLink ? SceneInterface::LocalTag : 0 ) );
if ( !m_atLink && (filter & SceneInterface::AncestorTag) )
{
/// child locations inside the link consider all the local tags at the link location as ancestor tags as well.
mainFilter |= SceneInterface::LocalTag;
}
if ( mainFilter )
{
NameList mainTags;
m_mainScene->readTags( mainTags, mainFilter );
tags.insert( tags.end(), mainTags.begin(), mainTags.end() );
}
}
else
{
m_mainScene->readTags( tags, filter );
}
}
示例3: readTags
void LiveScene::readTags( NameList &tags, int filter ) const
{
tags.clear();
if ( m_isRoot )
{
return;
}
if( m_dagPath.length() == 0 )
{
throw Exception( "IECoreMaya::LiveScene::attributeNames: Dag path no longer exists!" );
}
std::set<Name> uniqueTags;
// read tags from ieTags attribute:
MStatus st;
MFnDependencyNode fnNode( m_dagPath.node() );
MPlug tagsPlug = fnNode.findPlug( "ieTags", false, &st );
if( st )
{
std::string tagsStr( tagsPlug.asString().asChar() );
boost::tokenizer<boost::char_separator<char> > t( tagsStr, boost::char_separator<char>( " " ) );
for (
boost::tokenizer<boost::char_separator<char> >::iterator it = t.begin();
it != t.end();
++it
)
{
uniqueTags.insert( Name( *it ) );
}
}
// read tags from custom readers:
std::vector<CustomTagReader> &tagReaders = customTagReaders();
for ( std::vector<CustomTagReader>::const_iterator it = tagReaders.begin(); it != tagReaders.end(); ++it )
{
NameList values;
it->m_read( m_dagPath, values, filter );
uniqueTags.insert( values.begin(), values.end() );
}
tags.insert( tags.end(), uniqueTags.begin(), uniqueTags.end() );
}
示例4: readTags
void HoudiniScene::readTags( NameList &tags, bool includeChildren ) const
{
tags.clear();
const OP_Node *node = retrieveNode();
if ( !node )
{
return;
}
// add user supplied tags if we're not inside a SOP
if ( !m_contentIndex && node->hasParm( pTags.getToken() ) )
{
UT_String parmTagStr;
node->evalString( parmTagStr, pTags.getToken(), 0, 0 );
if ( !parmTagStr.equal( UT_String::getEmptyString() ) )
{
UT_WorkArgs tokens;
parmTagStr.tokenize( tokens, " " );
for ( int i = 0; i < tokens.getArgc(); ++i )
{
tags.push_back( tokens[i] );
}
}
}
// add tags from the registered tag readers
std::vector<CustomTagReader> &tagReaders = customTagReaders();
for ( std::vector<CustomTagReader>::const_iterator it = tagReaders.begin(); it != tagReaders.end(); ++it )
{
NameList values;
it->m_read( node, values, includeChildren );
tags.insert( tags.end(), values.begin(), values.end() );
}
// add tags based on primitive groups
OBJ_Node *contentNode = retrieveNode( true )->castToOBJNode();
if ( contentNode && contentNode->getObjectType() == OBJ_GEOMETRY && m_splitter )
{
GU_DetailHandle newHandle = m_splitter->split( contentPathValue() );
if ( !newHandle.isNull() )
{
GU_DetailHandleAutoReadLock readHandle( newHandle );
if ( const GU_Detail *geo = readHandle.getGdp() )
{
GA_Range prims = geo->getPrimitiveRange();
for ( GA_GroupTable::iterator<GA_ElementGroup> it=geo->primitiveGroups().beginTraverse(); !it.atEnd(); ++it )
{
GA_PrimitiveGroup *group = static_cast<GA_PrimitiveGroup*>( it.group() );
if ( group->getInternal() || group->isEmpty() )
{
continue;
}
const UT_String &groupName = group->getName();
if ( groupName.startsWith( tagGroupPrefix ) && group->containsAny( prims ) )
{
UT_String tag;
groupName.substr( tag, tagGroupPrefix.length() );
tag.substitute( "_", ":" );
tags.push_back( tag.buffer() );
}
}
}
}
}
}