• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ iecore::InternedString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中iecore::InternedString的典型用法代码示例。如果您正苦于以下问题:C++ InternedString类的具体用法?C++ InternedString怎么用?C++ InternedString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了InternedString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: contextChanged

void SceneView::contextChanged( const IECore::InternedString &name )
{
	if( name.value() == "ui:scene:selectedPaths" )
	{
		// if only the selection has changed then we can just update the selection
		// on our existing scene representation.
		const StringVectorData *sc = getContext()->get<StringVectorData>( "ui:scene:selectedPaths" );
		RenderableGadget::Selection sr;
		sr.insert( sc->readable().begin(), sc->readable().end() );

		BlockedConnection blockedConnection( m_selectionChangedConnection );
		m_renderableGadget->setSelection( sr );
		return;
	}
	
	if(
		name.value().compare( 0, 3, "ui:" ) == 0 &&
		name.value() != "ui:scene:expandedPaths"
	)
	{
		// if it's just a ui context entry that has changed, and it doesn't
		// affect our expansion, then early out.
		return;
	}
	
	// the context change might affect the scene itself, so we must
	// schedule an update.
	updateRequestSignal()( this );
}
开发者ID:sonyomega,项目名称:gaffer,代码行数:29,代码来源:SceneView.cpp


示例2: contextChanged

void SceneView::contextChanged( const IECore::InternedString &name )
{
	if( name.value() == "ui:scene:selectedPaths" )
	{
		// If only the selection has changed then we can just update the selection
		// on our existing scene representation.
		const StringVectorData *sc = getContext()->get<StringVectorData>( "ui:scene:selectedPaths" );
		/// \todo Store selection as PathMatcherData within the context, so we don't need
		/// this conversion.
		GafferScene::PathMatcherDataPtr sg = new GafferScene::PathMatcherData;
		sg->writable().init( sc->readable().begin(), sc->readable().end() );
		m_sceneGadget->setSelection( sg );
		return;
	}
	else if( name.value() == "ui:scene:expandedPaths" )
	{
		const GafferScene::PathMatcherData *expandedPaths = getContext()->get<GafferScene::PathMatcherData>( "ui:scene:expandedPaths" );
		m_sceneGadget->setExpandedPaths( expandedPaths );
		return;
	}
	else if( boost::starts_with( name.value(), "ui:" ) )
	{
		// ui context entries shouldn't affect computation.
		return;
	}
}
开发者ID:Eryckz,项目名称:gaffer,代码行数:26,代码来源:SceneView.cpp


示例3:

void Shader::NetworkBuilder::parameterValueWalk( const Shader *shaderNode, const Gaffer::Plug *parameterPlug, const IECore::InternedString &parameterName, IECore::CompoundDataMap &values )
{
	for( InputPlugIterator it( parameterPlug ); it != it.end(); ++it )
	{
		IECore::InternedString childParameterName;
		if( parameterName.string().size() )
		{
			childParameterName = parameterName.string() + "." + (*it)->getName().string();
		}
		else
		{
			childParameterName = (*it)->getName();
		}

		if( (*it)->typeId() == CompoundPlug::staticTypeId() )
		{
			parameterValueWalk( shaderNode, it->get(), childParameterName, values );
		}
		else
		{
			if( IECore::DataPtr value = shaderNode->parameterValue( it->get(), *this ) )
			{
				values[childParameterName] = value;
			}
		}
	}
}
开发者ID:espennordahl,项目名称:gaffer,代码行数:27,代码来源:Shader.cpp


示例4: addParameterWalk

		void addParameterWalk( const Gaffer::Plug *parameter, const IECore::InternedString &parameterName, IECoreScene::Shader *shader, vector<IECoreScene::ShaderNetwork::Connection> &connections )
		{
			if( !isLeafParameter( parameter ) || parameter->parent<Node>() )
			{
				// Compound parameter - recurse
				for( InputPlugIterator it( parameter ); !it.done(); ++it )
				{
					IECore::InternedString childParameterName;
					if( parameterName.string().size() )
					{
						childParameterName = parameterName.string() + "." + (*it)->getName().string();
					}
					else
					{
						childParameterName = (*it)->getName();
					}

					addParameterWalk( it->get(), childParameterName, shader, connections );
				}
			}
			else if( const Gaffer::ArrayPlug *array = IECore::runTimeCast<const Gaffer::ArrayPlug>( parameter ) )
			{
				int i = 0;
				for( InputPlugIterator it( array ); !it.done(); ++it, ++i )
				{
					IECore::InternedString childParameterName = parameterName.string() + "[" + std::to_string( i ) + "]";
					addParameter( it->get(), childParameterName, shader, connections );
				}
			}
			else
			{
				addParameter( parameter, parameterName, shader, connections );
			}
		}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:34,代码来源:Shader.cpp


示例5: computeSetNames

IECore::ConstInternedStringVectorDataPtr ObjectSource::computeSetNames( const Gaffer::Context *context, const ScenePlug *parent ) const
{
	IECore::InternedStringVectorDataPtr result = new IECore::InternedStringVectorData;
	Gaffer::tokenize( setsPlug()->getValue(), ' ', result->writable() );
	IECore::InternedString n = standardSetName();
	if( n.string().size() )
	{
		result->writable().push_back( n );
	}
	return result;
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:11,代码来源:ObjectSource.cpp


示例6: checkName

void Path::checkName( const IECore::InternedString &name ) const
{
	if( name.string().find( '/' ) != string::npos )
	{
		throw IECore::Exception( "Path name contains '/'." );
	}

	if( name.string().empty() )
	{
		throw IECore::Exception( "Path name is empty." );
	}
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:12,代码来源:Path.cpp


示例7: contextChanged

void ScenePath::contextChanged( const IECore::InternedString &key )
{
	if( !boost::starts_with( key.c_str(), "ui:" ) )
	{
		emitPathChanged();
	}
}
开发者ID:hradec,项目名称:gaffer,代码行数:7,代码来源:ScenePath.cpp


示例8: nodeMetadataChanged

void NoduleLayout::nodeMetadataChanged( IECore::TypeId nodeTypeId, IECore::InternedString key, const Gaffer::Node *node )
{
	const Node *typedParent = runTimeCast<const Node>( m_parent.get() );
	if( !typedParent || !affectedByChange( typedParent, nodeTypeId, node ) )
	{
		return;
	}

	if( affectsSpacing( key, m_section ) )
	{
		updateSpacing();
	}
	if( affectsDirection( key, m_section ) )
	{
		updateDirection();
	}
	if( affectsOrientation( key, m_section ) )
	{
		updateOrientation();
	}
	if( boost::starts_with( key.string(), "noduleLayout:customGadget" ) )
	{
		updateLayout();
	}
}
开发者ID:boberfly,项目名称:gaffer,代码行数:25,代码来源:NoduleLayout.cpp


示例9: addParameterComponentConnections

		void addParameterComponentConnections( const Gaffer::Plug *parameter, const IECore::InternedString &parameterName, vector<IECoreScene::ShaderNetwork::Connection> &connections )
		{
			if( !isCompoundNumericPlug( parameter ) )
			{
				return;
			}
			for( InputPlugIterator it( parameter ); !it.done(); ++it )
			{
				const Gaffer::Plug *effectiveParameter = this->effectiveParameter( it->get() );
				if( effectiveParameter && isOutputParameter( effectiveParameter ) )
				{
					const Shader *effectiveShader = static_cast<const Shader *>( effectiveParameter->node() );
					IECore::InternedString outputName;
					if( effectiveShader->outPlug()->isAncestorOf( effectiveParameter ) )
					{
						outputName = effectiveParameter->relativeName( effectiveShader->outPlug() );
					}
					IECore::InternedString inputName = parameterName.string() + "." + (*it)->getName().string();
					connections.push_back( {
						{ this->handle( effectiveShader ), outputName },
						{ IECore::InternedString(), inputName }
					} );
				}
			}
		}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:25,代码来源:Shader.cpp


示例10: contextChanged

void CameraTool::contextChanged( const IECore::InternedString &name )
{
	if( !boost::starts_with( name.string(), "ui:" ) )
	{
		m_cameraSelectionDirty = true;
		view()->viewportGadget()->renderRequestSignal()( view()->viewportGadget() );
	}
}
开发者ID:ImageEngine,项目名称:gaffer,代码行数:8,代码来源:CameraTool.cpp


示例11: contextChanged

void ImageGadget::contextChanged( const IECore::InternedString &name )
{
	if( !boost::starts_with( name.string(), "ui:" ) )
	{
		m_dirtyFlags = AllDirty;
		requestRender();
	}
}
开发者ID:boberfly,项目名称:gaffer,代码行数:8,代码来源:ImageGadget.cpp


示例12: operator

	boost::signals::detail::unusable operator()( boost::python::object slot, ConstContextPtr context, const IECore::InternedString &name )
	{
		try
		{
			slot( IECore::constPointerCast<Context>( context ), name.value() );
		}
		catch( const error_already_set &e )
		{
			PyErr_PrintEx( 0 ); // clears the error status
		}
		return boost::signals::detail::unusable();
	}
开发者ID:JohanAberg,项目名称:gaffer,代码行数:12,代码来源:ContextBinding.cpp


示例13: removeShader

		void removeShader( const IECore::InternedString &handle )
		{
			auto it = m_nodes.find( handle );
			if( it == m_nodes.end() )
			{
				throw IECore::Exception( boost::str(
					boost::format(
						"Shader \"%1%\" not in network"
					) % handle.c_str()
				) );
			}
			removeShader( it );
		}
开发者ID:ImageEngine,项目名称:cortex,代码行数:13,代码来源:ShaderNetwork.cpp


示例14: hashSet

void Set::hashSet( const IECore::InternedString &setName, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	const std::string allSets = " " + namePlug()->getValue() + " ";
	const std::string setNameToFind = " " + setName.string() + " ";
	if( allSets.find( setNameToFind ) == std::string::npos )
	{
		h = inPlug()->setPlug()->hash();
		return;
	}

	FilteredSceneProcessor::hashSet( setName, context, parent, h );
	inPlug()->setPlug()->hash( h );
	modePlug()->hash( h );
	pathMatcherPlug()->hash( h );
}
开发者ID:boberfly,项目名称:gaffer,代码行数:15,代码来源:Set.cpp


示例15: outputConnections

		ShaderNetwork::ConnectionRange outputConnections( const IECore::InternedString &handle ) const
		{
			auto it = m_nodes.find( handle );
			if( it == m_nodes.end() )
			{
				throw IECore::Exception( boost::str(
					boost::format(
						"Source shader \"%1%\" not in network"
					) % handle.c_str()
				) );
			}

			return ConnectionRange(
				ConnectionIterator( &it->outputConnections, it->outputConnections.size() ? &*it->outputConnections.begin() : nullptr ),
				ConnectionIterator( &it->outputConnections, nullptr )
			);
		}
开发者ID:ImageEngine,项目名称:cortex,代码行数:17,代码来源:ShaderNetwork.cpp


示例16: ScenePlug

InteractiveRender::InteractiveRender( const IECore::InternedString &rendererType, const std::string &name )
	:	Node( name ),
		m_state( Stopped )
{
	storeIndexOfNextChild( g_firstPlugIndex );
	addChild( new ScenePlug( "in" ) );
	addChild( new StringPlug( rendererType.string().empty() ? "renderer" : "__renderer", Plug::In, rendererType.string() ) );
	addChild( new IntPlug( "state", Plug::In, Stopped, Stopped, Paused, Plug::Default & ~Plug::Serialisable ) );
	addChild( new ScenePlug( "out", Plug::Out, Plug::Default & ~Plug::Serialisable ) );
	addChild( new ScenePlug( "__adaptedIn", Plug::In, Plug::Default & ~Plug::Serialisable ) );

	SceneProcessorPtr adaptors = RendererAlgo::createAdaptors();
	setChild( "__adaptors", adaptors );
	adaptors->inPlug()->setInput( inPlug() );
	adaptedInPlug()->setInput( adaptors->outPlug() );

	outPlug()->setInput( inPlug() );

	plugDirtiedSignal().connect( boost::bind( &InteractiveRender::plugDirtied, this, ::_1 ) );
}
开发者ID:ImageEngine,项目名称:gaffer,代码行数:20,代码来源:InteractiveRender.cpp


示例17: computeSet

GafferScene::ConstPathMatcherDataPtr Set::computeSet( const IECore::InternedString &setName, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	const std::string allSets = " " + namePlug()->getValue() + " ";
	const std::string setNameToFind = " " + setName.string() + " ";
	if( allSets.find( setNameToFind ) == std::string::npos )
	{
		return inPlug()->setPlug()->getValue();
	}

	ConstPathMatcherDataPtr pathMatcher = pathMatcherPlug()->getValue();
	switch( modePlug()->getValue() )
	{
		case Add : {
			ConstPathMatcherDataPtr inputSet = inPlug()->setPlug()->getValue();
			if( !inputSet->readable().isEmpty() )
			{
				PathMatcherDataPtr result = inputSet->copy();
				result->writable().addPaths( pathMatcher->readable() );
				return result;
			}
			// Input set empty - fall through to create mode.
		}
		case Create : {
			return pathMatcher;
		}
		case Remove :
		default : {
			ConstPathMatcherDataPtr inputSet = inPlug()->setPlug()->getValue();
			if( inputSet->readable().isEmpty() )
			{
				return inputSet;
			}
			PathMatcherDataPtr result = inputSet->copy();
			result->writable().removePaths( pathMatcher->readable() );
			return result;
		}
	}
}
开发者ID:boberfly,项目名称:gaffer,代码行数:38,代码来源:Set.cpp


示例18: plugMetadataChanged

void NoduleLayout::plugMetadataChanged( IECore::TypeId nodeTypeId, const Gaffer::MatchPattern &plugPath, IECore::InternedString key, const Gaffer::Plug *plug )
{
	if( childAffectedByChange( m_parent.get(), nodeTypeId, plugPath, plug ) )
	{
		if(
			key == g_sectionKey || key == g_indexKey || key == g_visibleKey ||
			key == g_noduleTypeKey ||
			key == g_nodulePositionKey || key == g_noduleIndexKey
		)
		{
			updateLayout();
		}
	}

	if( const Plug *typedParent = runTimeCast<const Plug>( m_parent.get() ) )
	{
		if( affectedByChange( typedParent, nodeTypeId, plugPath, plug ) )
		{
			if( affectsSpacing( key, m_section ) )
			{
				updateSpacing();
			}
			if( affectsDirection( key, m_section ) )
			{
				updateDirection();
			}
			if( affectsOrientation( key, m_section ) )
			{
				updateOrientation();
			}
			if( boost::starts_with( key.string(), "noduleLayout:customGadget" ) )
			{
				updateLayout();
			}
		}
	}
}
开发者ID:boberfly,项目名称:gaffer,代码行数:37,代码来源:NoduleLayout.cpp


示例19: Exception

const IECore::InternedString &GraphComponent::setName( const IECore::InternedString &name )
{
	// make sure the name is valid
	static boost::regex validator( "^[A-Za-z_]+[A-Za-z_0-9]*" );
	if( !regex_match( name.c_str(), validator ) )
	{
		std::string what = boost::str( boost::format( "Invalid name \"%s\"" ) % name.string() );
		throw IECore::Exception( what );
	}
	
	// make sure the name is unique
	IECore::InternedString newName = name;
	if( m_parent )
	{
		bool uniqueAlready = true;
		for( ChildContainer::const_iterator it=m_parent->m_children.begin(), eIt=m_parent->m_children.end(); it != eIt; it++ )
		{
			if( *it != this && (*it)->m_name == m_name )
			{
				uniqueAlready = false;
				break;
			}
		}
	
		if( !uniqueAlready )
		{
			// split name into a prefix and a numeric suffix. if no suffix
			// exists then it defaults to 1.
			std::string prefix;
			int suffix = numericSuffix( newName.value(), 1, &prefix );

			// iterate over all the siblings to find the minimum value for the suffix which
			// will be greater than any existing suffix.
			for( ChildContainer::const_iterator it=m_parent->m_children.begin(), eIt=m_parent->m_children.end(); it != eIt; it++ )
			{
				if( *it == this )
				{
					continue;
				}
				if( (*it)->m_name.value().compare( 0, prefix.size(), prefix ) == 0 )
				{
					char *endPtr = 0;
					long siblingSuffix = strtol( (*it)->m_name.value().c_str() + prefix.size(), &endPtr, 10 );
					if( *endPtr == '\0' )
					{
						suffix = max( suffix, (int)siblingSuffix + 1 );
					}
				}
			}
			static boost::format formatter( "%s%d" );
			newName = boost::str( formatter % prefix % suffix );
		}
	}
	
	// set the new name if it's different to the old
	if( newName==m_name )
	{
		return m_name;
	}
	
	Action::enact(
		this,
		// ok to bind raw pointers to this, because enact() guarantees
		// the lifetime of the subject.
		boost::bind( &GraphComponent::setNameInternal, this, newName ),
		boost::bind( &GraphComponent::setNameInternal, this, m_name )
	);
	
	return m_name;
}
开发者ID:dboogert,项目名称:gaffer,代码行数:70,代码来源:GraphComponent.cpp


示例20: name

inline PathMatcher::Name::Name( IECore::InternedString name )
	: name( name ), type( name == g_ellipsis || Gaffer::hasWildcards( name.c_str() ) ? Wildcarded : Plain )
{
}
开发者ID:mor-vfx,项目名称:gaffer,代码行数:4,代码来源:PathMatcher.cpp



注:本文中的iecore::InternedString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ iecore::MurmurHash类代码示例发布时间:2022-05-31
下一篇:
C++ iecore::ConstObjectPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap