当前位置: 首页>>代码示例>>C++>>正文


C++ Element::NextSiblingElement方法代码示例

本文整理汇总了C++中xml::Element::NextSiblingElement方法的典型用法代码示例。如果您正苦于以下问题:C++ Element::NextSiblingElement方法的具体用法?C++ Element::NextSiblingElement怎么用?C++ Element::NextSiblingElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xml::Element的用法示例。


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

示例1: _analyzeXML

	//----------------------------------------------------------------------
	//
	//----------------------------------------------------------------------
	void LNFXManager::_analyzeXML( const char* xml, size_t size )
	{
		XML::Document xmlDoc;
		xmlDoc.Parse( xml, size );

		// まずは Technique → Pass と作成して、コンパイルする。この中で Variable も作る
		XML::Element* xmlElement = xmlDoc.FirstChildElement();
		while ( xmlElement != NULL )
		{
			// <Technique>
			if ( strcmp( xmlElement->Name(), TechniqueElementName ) == 0 ) {
				_analyzeXMLTechniqueElement( xmlElement );
			}

			xmlElement = xmlElement->NextSiblingElement();
		}

		// 次に、作成済みの Variable にアノテーションを割り振る
		xmlElement = xmlDoc.FirstChildElement();
		while ( xmlElement != NULL )
		{
			// <Variable>
			if ( strcmp( xmlElement->Name(), VariableElementName ) == 0 ) {
				_analyzeXMLVariableElement( xmlElement );
			}

			xmlElement = xmlElement->NextSiblingElement();
		}
	}
开发者ID:lriki,项目名称:LightNote,代码行数:32,代码来源:LNFXManager.cpp

示例2: _analyzeXMLVariableElement

	//----------------------------------------------------------------------
	//
	//----------------------------------------------------------------------
	void LNFXManager::_analyzeXMLVariableElement( XML::Element* xmlElement )
	{
		// 属性
		const char* attrName		= xmlElement->Attribute( NameAttributeName );
		const char* attrSemantic	= xmlElement->Attribute( SemanticAttributeName );
		const bool attrShared		= xmlElement->BoolAttribute( SharedAttributeName );
		const char* attrTexture		= xmlElement->Attribute(TextureAttributeName);
		LN_THROW_InvalidFormat(attrName);

		// 適用試行
		IAnnotatedObject* var = mBuilder->OnTrySetVariableParam( attrName, attrSemantic, attrShared, attrTexture );
		if ( var != NULL )
		{
			// 子要素
			XML::Element* xmlChild = xmlElement->FirstChildElement();
			while ( xmlChild != NULL )
			{
				// <Annotation>
				if ( strcmp( xmlChild->Name(), AnnotationElementName ) == 0 ) {
					_analyzeXMLAnnotationElement( xmlChild, var );
				}

				xmlChild = xmlChild->NextSiblingElement();
			}
		}
	}
开发者ID:lriki,项目名称:LightNote,代码行数:29,代码来源:LNFXManager.cpp

示例3: _analyzeXMLPassElement

	//----------------------------------------------------------------------
	//
	//----------------------------------------------------------------------
	void LNFXManager::_analyzeXMLPassElement( XML::Element* xmlElement, IAnnotatedObject* parentTech )
	{
		// 属性
		const char* attrName = xmlElement->Attribute(NameAttributeName);
		LN_THROW_InvalidFormat(attrName);

		IAnnotatedObject* pass = mBuilder->OnCreatePass( parentTech, attrName );

		// 子要素
		XML::Element* xmlChild = xmlElement->FirstChildElement();
		while ( xmlChild != NULL )
		{
			// <VertexShader>
			if ( strcmp( xmlChild->Name(), VertexShaderElementName ) == 0 ) {
				attrName = xmlChild->Attribute( EntryPointAttributeName );
				GLSLCode* code = _findShaderCode(attrName);
				LN_THROW_InvalidFormat(code);
				mBuilder->OnCreateVertexShader( pass, code->Code.c_str(), code->Code.size() );
			}
			// <PixelShader>
			else if ( strcmp( xmlChild->Name(), PixelShaderElementName ) == 0 ) {
				attrName = xmlChild->Attribute( EntryPointAttributeName );
				GLSLCode* code = _findShaderCode(attrName);
				LN_THROW_InvalidFormat(code);
				mBuilder->OnCreatePixelShader( pass, code->Code.c_str(), code->Code.size() );
			}
			// <RenderState>
			else if ( strcmp( xmlChild->Name(), RenderStateElementName ) == 0 ) {
				attrName = xmlChild->Attribute(NameAttributeName);
				LN_THROW_InvalidFormat(attrName);
				const char* value = xmlChild->Attribute( ValueAttributeName );
				mBuilder->OnSetRenderState( pass, attrName, value );
			}
			// <Annotation>
			else if ( strcmp( xmlChild->Name(), AnnotationElementName ) == 0 ) {
				_analyzeXMLAnnotationElement( xmlChild, pass );
			}

			xmlChild = xmlChild->NextSiblingElement();
		}

		// link
		mBuilder->OnEndPass( pass );
	}
开发者ID:lriki,项目名称:LightNote,代码行数:47,代码来源:LNFXManager.cpp

示例4: _analyzeXMLTechniqueElement

	//----------------------------------------------------------------------
	//
	//----------------------------------------------------------------------
	void LNFXManager::_analyzeXMLTechniqueElement( XML::Element* xmlElement )
	{
		// 属性
		const char* attrName = xmlElement->Attribute( NameAttributeName );
		LN_THROW_InvalidFormat(attrName);

		IAnnotatedObject* tech = mBuilder->OnCreateTechnique( attrName );

		// 子要素
		XML::Element* xmlChild = xmlElement->FirstChildElement();
		while ( xmlChild != NULL )
		{
			// <Pass>
			if ( strcmp( xmlChild->Name(), PassElementName ) == 0 ) {
				_analyzeXMLPassElement( xmlChild, tech );
			}
			// <Annotation>
			else if ( strcmp( xmlChild->Name(), AnnotationElementName ) == 0 ) {
				_analyzeXMLAnnotationElement( xmlChild, tech );
			}

			xmlChild = xmlChild->NextSiblingElement();
		}
	}
开发者ID:lriki,项目名称:LightNote,代码行数:27,代码来源:LNFXManager.cpp


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