本文整理汇总了C++中OP_Node::getInput方法的典型用法代码示例。如果您正苦于以下问题:C++ OP_Node::getInput方法的具体用法?C++ OP_Node::getInput怎么用?C++ OP_Node::getInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OP_Node
的用法示例。
在下文中一共展示了OP_Node::getInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculatePath
void HoudiniScene::calculatePath( const Path &contentPath, const Path &rootPath )
{
OP_Node *node = retrieveNode();
if ( node->isManager() )
{
return;
}
UT_String tmp( m_nodePath );
UT_WorkArgs workArgs;
tmp.tokenize( workArgs, "/" );
OP_Node *current = dynamic_cast<MOT_Director *>( OPgetDirector() )->getObjectManager();
// skipping the token for the OBJ manager
for ( int i = 1; i < workArgs.getArgc(); ++i )
{
current = current->getChild( workArgs[i] );
/// recursively collect all input connections
OP_Node *parent = current->getInput( 0 );
UT_StringArray parentNames;
while ( parent )
{
parentNames.append( parent->getName() );
parent = parent->getInput( 0 );
}
// add them in reverse order
for ( int j = parentNames.entries() - 1; j >= 0; --j )
{
m_path.push_back( Name( parentNames( j ) ) );
}
if ( ( i < workArgs.getArgc() - 1 ) || Name( workArgs[i] ) != contentName )
{
m_path.push_back( Name( workArgs[i] ) );
}
}
if ( !contentPath.empty() )
{
m_contentIndex = m_path.size();
m_path.resize( m_path.size() + contentPath.size() );
std::copy( contentPath.begin(), contentPath.end(), m_path.begin() + m_contentIndex );
}
if ( m_path.size() < rootPath.size() )
{
std::string pStr, rStr;
pathToString( m_path, pStr );
pathToString( rootPath, rStr );
throw Exception( "IECoreHoudini::HoudiniScene: Path \"" + pStr + "\" is not a valid child of root \"" + rStr + "\"." );
}
for ( size_t i = 0; i < rootPath.size(); ++i )
{
if ( rootPath[i] != m_path[i] )
{
std::string pStr, rStr;
pathToString( m_path, pStr );
pathToString( rootPath, rStr );
throw Exception( "IECoreHoudini::HoudiniScene: Path \"" + pStr + "\" is not a valid child of root \"" + rStr + "\"." );
}
}
m_rootIndex = rootPath.size();
}