本文整理汇总了C++中PlugPtr::fullName方法的典型用法代码示例。如果您正苦于以下问题:C++ PlugPtr::fullName方法的具体用法?C++ PlugPtr::fullName怎么用?C++ PlugPtr::fullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlugPtr
的用法示例。
在下文中一共展示了PlugPtr::fullName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setInput
void Plug::setInput( PlugPtr input )
{
if( input.get()==m_input )
{
return;
}
if( input && !acceptsInput( input ) )
{
std::string what = boost::str(
boost::format( "Plug \"%s\" rejects input \"%s\"." )
% fullName()
% input->fullName()
);
throw IECore::Exception( what );
}
if( refCount() )
{
// someone is referring to us, so we're definitely fully constructed and we may have a ScriptNode
// above us, so we should do things in a way compatible with the undo system.
Action::enact(
this,
boost::bind( &Plug::setInputInternal, PlugPtr( this ), input, true ),
boost::bind( &Plug::setInputInternal, PlugPtr( this ), PlugPtr( m_input ), true )
);
}
else
{
// noone is referring to us. we're probably still constructing, and undo is impossible anyway (we
// have no ScriptNode ancestor), so we can't make a smart pointer
// to ourselves (it will result in double destruction). so we just set the input directly.
setInputInternal( input, false );
}
}
示例2: setInput
void CompoundPlug::setInput( PlugPtr input )
{
if( input.get() == getInput<Plug>() )
{
return;
}
// unfortunately we have to duplicate the check in Plug::setInput()
// ourselves as we delay calling Plug::setInput() until we've connected
// the children, but need to do the check first.
/// \todo I think there's a case for not having CompoundPlug at all,
/// and having Plug have all its functionality.
if( input && !acceptsInput( input ) )
{
std::string what = boost::str(
boost::format( "Plug \"%s\" rejects input \"%s\"." )
% fullName()
% input->fullName()
);
throw IECore::Exception( what );
}
{
// we use the plugInputChangedConnection to trigger calls to updateInputFromChildInputs()
// when child inputs are changed by code elsewhere. it would be counterproductive for
// us to call updateInputFromChildInputs() while we ourselves are changing those inputs,
// so we temporarily block the connection.
BlockedConnection block( m_plugInputChangedConnection );
if( !input )
{
for( ChildContainer::const_iterator it = children().begin(); it!=children().end(); it++ )
{
IECore::staticPointerCast<Plug>( *it )->setInput( 0 );
}
}
else
{
CompoundPlugPtr p = IECore::staticPointerCast<CompoundPlug>( input );
ChildContainer::const_iterator it1, it2;
for( it1 = children().begin(), it2 = p->children().begin(); it1!=children().end(); it1++, it2++ )
{
IECore::staticPointerCast<Plug>( *it1 )->setInput( IECore::staticPointerCast<Plug>( *it2 ) );
}
}
}
// we connect ourselves last, so that all our child plugs are correctly connected
// before we signal our own connection change.
ValuePlug::setInput( input );
}
示例3: setInput
void Plug::setInput( PlugPtr input, bool setChildInputs, bool updateParentInput )
{
if( input.get()==m_input )
{
return;
}
if( input && !acceptsInput( input.get() ) )
{
std::string what = boost::str(
boost::format( "Plug \"%s\" rejects input \"%s\"." )
% fullName()
% input->fullName()
);
throw IECore::Exception( what );
}
// Connect our children first.
// We use a dirty propagation scope to defer dirty signalling
// until all connections have been made, when we're in our final
// state.
DirtyPropagationScope dirtyPropagationScope;
if( setChildInputs )
{
if( !input )
{
for( PlugIterator it( this ); !it.done(); ++it )
{
(*it)->setInput( NULL, /* setChildInputs = */ true, /* updateParentInput = */ false );
}
}
else
{
for( PlugIterator it1( this ), it2( input.get() ); !it1.done(); ++it1, ++it2 )
{
(*it1)->setInput( *it2, /* setChildInputs = */ true, /* updateParentInput = */ false );
}
}
}
// then connect ourselves
if( refCount() )
{
// someone is referring to us, so we're definitely fully constructed and we may have a ScriptNode
// above us, so we should do things in a way compatible with the undo system.
Action::enact(
this,
boost::bind( &Plug::setInputInternal, PlugPtr( this ), input, true ),
boost::bind( &Plug::setInputInternal, PlugPtr( this ), PlugPtr( m_input ), true )
);
}
else
{
// noone is referring to us. we're probably still constructing, and undo is impossible anyway (we
// have no ScriptNode ancestor), so we can't make a smart pointer
// to ourselves (it will result in double destruction). so we just set the input directly.
setInputInternal( input, false );
}
// finally, adjust our parent's connection to take account of
// the changes to its child.
if( updateParentInput )
{
if( Plug *parentPlug = parent<Plug>() )
{
parentPlug->updateInputFromChildInputs( this );
}
}
}