本文整理汇总了C++中UT_String::equal方法的典型用法代码示例。如果您正苦于以下问题:C++ UT_String::equal方法的具体用法?C++ UT_String::equal怎么用?C++ UT_String::equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UT_String
的用法示例。
在下文中一共展示了UT_String::equal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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() );
}
}
}
}
}
}
示例2: hasTag
bool HoudiniScene::hasTag( const Name &name, bool includeChildren ) const
{
const OP_Node *node = retrieveNode();
if ( !node )
{
return false;
}
// check for user supplied tags if we're not inside a SOP
if ( !m_contentIndex && node->hasParm( pTags.getToken() ) )
{
UT_String parmTags;
node->evalString( parmTags, pTags.getToken(), 0, 0 );
if ( UT_String( name.c_str() ).multiMatch( parmTags ) )
{
return true;
}
}
// check with the registered tag readers
std::vector<CustomTagReader> &tagReaders = customTagReaders();
for ( std::vector<CustomTagReader>::const_iterator it = tagReaders.begin(); it != tagReaders.end(); ++it )
{
if ( it->m_has( node, name ) )
{
return true;
}
}
// check 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( "_", ":" );
if ( tag.equal( name.c_str() ) )
{
return true;
}
}
}
}
}
}
return false;
}