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

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

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

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



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

示例1: pointRays

IECoreGL::ConstRenderablePtr StandardLightVisualiser::pointRays()
{
    IECoreGL::GroupPtr group = new IECoreGL::Group();
    addWireframeCurveState( group.get() );

    IECore::CompoundObjectPtr parameters = new CompoundObject;
    parameters->members()["aimType"] = new IntData( 1 );
    group->getState()->add(
        new IECoreGL::ShaderStateComponent( ShaderLoader::defaultShaderLoader(), TextureLoader::defaultTextureLoader(), faceCameraVertexSource(), "", IECoreGL::Shader::constantFragmentSource(), parameters )
    );

    IntVectorDataPtr vertsPerCurve = new IntVectorData;
    V3fVectorDataPtr p = new V3fVectorData;

    const int numRays = 8;
    for( int i = 0; i < numRays; ++i )
    {
        const float angle = M_PI * 2.0f * float(i)/(float)numRays;
        const V2f dir( cos( angle ), sin( angle ) );
        addRay( dir * .5, dir * 1, vertsPerCurve->writable(), p->writable() );
    }

    IECoreGL::CurvesPrimitivePtr curves = new IECoreGL::CurvesPrimitive( IECore::CubicBasisf::linear(), false, vertsPerCurve );
    curves->addPrimitiveVariable( "P", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Vertex, p ) );
    curves->addPrimitiveVariable( "Cs", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Constant, new Color3fData( Color3f( 1.0f, 0.835f, 0.07f ) ) ) );

    group->addChild( curves );

    return group;
}
开发者ID:HughMacdonald,项目名称:gaffer,代码行数:30,代码来源:StandardLightVisualiser.cpp


示例2: computeGlobals

IECore::ConstCompoundObjectPtr SubTree::computeGlobals( const Gaffer::Context *context, const ScenePlug *parent ) const
{
	IECore::CompoundObjectPtr result = inPlug()->globalsPlug()->getValue()->copy();

	const IECore::CompoundData *inputForwardDeclarations = result->member<IECore::CompoundData>( "gaffer:forwardDeclarations" );
	if( inputForwardDeclarations )
	{
		std::string root = rootPlug()->getValue();
		if( !root.size() || root[root.size()-1] != '/' )
		{
			root += "/";
		}

		IECore::CompoundDataPtr forwardDeclarations = new IECore::CompoundData;
		for( IECore::CompoundDataMap::const_iterator it = inputForwardDeclarations->readable().begin(), eIt = inputForwardDeclarations->readable().end(); it != eIt; it++ )
		{
			const IECore::InternedString &inputPath = it->first;
			if( inputPath.string().compare( 0, root.size(), root ) == 0 )
			{
				std::string outputPath( inputPath, root.size()-1 );
				forwardDeclarations->writable()[outputPath] = it->second;
			}
		}
		result->members()["gaffer:forwardDeclarations"] = forwardDeclarations;
	}

	return result;
}
开发者ID:jonathantopf,项目名称:gaffer,代码行数:28,代码来源:SubTree.cpp


示例3: computeProcessedMetadata

IECore::ConstCompoundObjectPtr CopyImageMetadata::computeProcessedMetadata( const Gaffer::Context *context, const IECore::CompoundObject *inputMetadata ) const
{
	ConstCompoundObjectPtr copyFrom = copyFromPlug()->metadataPlug()->getValue();
	if ( copyFrom->members().empty() )
	{
		return inputMetadata;
	}

	const std::string names = namesPlug()->getValue();
	const bool invert = invertNamesPlug()->getValue();
	if ( !invert && !names.size() )
	{
		return inputMetadata;
	}

	IECore::CompoundObjectPtr result = inputMetadata->copy();
	for ( IECore::CompoundObject::ObjectMap::const_iterator it = copyFrom->members().begin(), eIt = copyFrom->members().end(); it != eIt; ++it )
	{
		bool copy = false;
		if ( matchMultiple( it->first.c_str(), names.c_str() ) != invert )
		{
			copy = true;
		}
		
		if ( copy )
		{
			result->members()[it->first] = it->second;
		}
	}
	
	return result;
}
开发者ID:goddardl,项目名称:gaffer,代码行数:32,代码来源:CopyImageMetadata.cpp


示例4: computeProcessedMetadata

IECore::ConstCompoundObjectPtr DeleteImageMetadata::computeProcessedMetadata( const Gaffer::Context *context, const IECore::CompoundObject *inputMetadata ) const
{
	if ( inputMetadata->members().empty() )
	{
		return inputMetadata;
	}

	const std::string names = namesPlug()->getValue();
	const bool invert = invertNamesPlug()->getValue();
	if ( !invert && !names.size() )
	{
		return inputMetadata;
	}

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	for ( IECore::CompoundObject::ObjectMap::const_iterator it = inputMetadata->members().begin(), eIt = inputMetadata->members().end(); it != eIt; ++it )
	{
		bool keep = true;
		if ( StringAlgo::matchMultiple( it->first.c_str(), names.c_str() ) != invert )
		{
			keep = false;
		}

		if ( keep )
		{
			result->members()[it->first] = it->second;
		}
	}

	return result;
}
开发者ID:hradec,项目名称:gaffer,代码行数:31,代码来源:DeleteImageMetadata.cpp


示例5: fullAttributes

IECore::CompoundObjectPtr ScenePlug::fullAttributes( const ScenePath &scenePath ) const
{
	ContextPtr tmpContext = new Context( *Context::current(), Context::Borrowed );
	Context::Scope scopedContext( tmpContext.get() );

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	IECore::CompoundObject::ObjectMap &resultMembers = result->members();
	ScenePath path( scenePath );
	while( path.size() )
	{
		tmpContext->set( scenePathContextName, path );
		IECore::ConstCompoundObjectPtr a = attributesPlug()->getValue();
		const IECore::CompoundObject::ObjectMap &aMembers = a->members();
		for( IECore::CompoundObject::ObjectMap::const_iterator it = aMembers.begin(), eIt = aMembers.end(); it != eIt; it++ )
		{
			if( resultMembers.find( it->first ) == resultMembers.end() )
			{
				resultMembers.insert( *it );
			}
		}		
		path.pop_back();
	}
	
	return result;
}
开发者ID:dboogert,项目名称:gaffer,代码行数:25,代码来源:ScenePlug.cpp


示例6: addEnvLightVisualiser

void StandardLightVisualiser::addEnvLightVisualiser( GroupPtr &output, Color3f multiplier, const std::string &textureName )
{
    IECoreGL::GroupPtr sphereGroup = new IECoreGL::Group();

    Imath::M44f trans;
    trans.scale( V3f( 1, 1, -1 ) );
    trans.rotate( V3f( -0.5 * M_PI, -0.5 * M_PI, 0 ) );
    sphereGroup->setTransform( trans );

    IECoreGL::SpherePrimitivePtr sphere = new IECoreGL::SpherePrimitive();
    sphereGroup->addChild( sphere );

    IECore::CompoundObjectPtr parameters = new CompoundObject;
    parameters->members()["lightMultiplier"] = new Color3fData( multiplier );
    parameters->members()["previewOpacity"] = new FloatData( 1 );
    parameters->members()["mapSampler"] = new StringData( textureName );
    parameters->members()["defaultColor"] = new Color3fData( Color3f( textureName == "" ? 1.0f : 0.0f ) );
    sphereGroup->getState()->add(
        new IECoreGL::ShaderStateComponent( ShaderLoader::defaultShaderLoader(), TextureLoader::defaultTextureLoader(), IECoreGL::Shader::defaultVertexSource(), "", environmentLightDrawFragSource(), parameters )
    );
    sphereGroup->getState()->add(
        new IECoreGL::DoubleSidedStateComponent( false )
    );

    output->addChild( sphereGroup );
}
开发者ID:HughMacdonald,项目名称:gaffer,代码行数:26,代码来源:StandardLightVisualiser.cpp


示例7: computeProcessedGlobals

IECore::ConstCompoundObjectPtr DeleteGlobals::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
	if( inputGlobals->members().empty() )
	{
		return inputGlobals;
	}

	const std::string names = namesPlug()->getValue();
	const bool invert = invertNamesPlug()->getValue();
	if( !invert && !names.size() )
	{
		return inputGlobals;
	}

	const std::string prefix = namePrefix();

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	for( IECore::CompoundObject::ObjectMap::const_iterator it = inputGlobals->members().begin(), eIt = inputGlobals->members().end(); it != eIt; ++it )
	{
		bool keep = true;
		if( boost::starts_with( it->first.c_str(), prefix ) )
		{
			if( matchMultiple( it->first.c_str() + prefix.size(), names.c_str() ) != invert )
			{
				keep = false;
			}
		}
		if( keep )
		{
			result->members()[it->first] = it->second;
		}
	}

	return result;
}
开发者ID:cedriclaunay,项目名称:gaffer,代码行数:35,代码来源:DeleteGlobals.cpp


示例8: computeProcessedMetadata

IECore::ConstCompoundObjectPtr ImageMetadata::computeProcessedMetadata( const Gaffer::Context *context, const IECore::CompoundObject *inputMetadata ) const
{
	const CompoundDataPlug *p = metadataPlug();
	if ( !p->children().size() )
	{
		return inputMetadata;
	}

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	// Since we're not going to modify any existing members (only add new ones),
	// and our result becomes const on returning it, we can directly reference
	// the input members in our result without copying. Be careful not to modify
	// them though!
	result->members() = inputMetadata->members();

	std::string name;
	for ( CompoundDataPlug::MemberPlugIterator it( p ); !it.done(); ++it )
	{
		IECore::DataPtr d = p->memberDataAndName( it->get(), name );
		if ( d )
		{
			result->members()[name] = d;
		}
	}

	return result;
}
开发者ID:HughMacdonald,项目名称:gaffer,代码行数:27,代码来源:ImageMetadata.cpp


示例9: computeProcessedGlobals

IECore::ConstCompoundObjectPtr Set::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
	std::string name = namePlug()->getValue();
	if( !name.size() )
	{
		return inputGlobals;
	}

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	// Since we're not going to modify any existing members other than the sets,
	// and our result becomes const on returning it, we can directly reference
	// the input members in our result without copying. We have to be careful not
	// to modify the input sets though.
	result->members() = inputGlobals->members();

	CompoundDataPtr sets = new CompoundData;
	if( const CompoundData *inputSets = inputGlobals->member<CompoundData>( "gaffer:sets" ) )
	{
		sets->writable() = inputSets->readable();
	}
	result->members()["gaffer:sets"] = sets;

	ConstObjectPtr set = pathMatcherPlug()->getValue();
	// const cast is acceptable because we're just using it to place a const object into a
	// container that will be treated as const everywhere immediately after return from this method.
	sets->writable()[name] = const_cast<Data *>( static_cast<const Data *>( set.get() ) );

	return result;
}
开发者ID:cedriclaunay,项目名称:gaffer,代码行数:29,代码来源:Set.cpp


示例10: computeProcessedGlobals

IECore::ConstCompoundObjectPtr Options::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
	const CompoundDataPlug *p = optionsPlug();
	if( !p->children().size() )
	{
		return inputGlobals;
	}

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	// Since we're not going to modify any existing members (only add new ones),
	// and our result becomes const on returning it, we can directly reference
	// the input members in our result without copying. Be careful not to modify
	// them though!
	result->members() = inputGlobals->members();

	const std::string prefix = computePrefix( context );

	std::string name;
	for( NameValuePlugIterator it( p ); !it.done(); ++it )
	{
		IECore::DataPtr d = p->memberDataAndName( it->get(), name );
		if( d )
		{
			result->members()[prefix + name] = d;
		}
	}

	return result;
}
开发者ID:ImageEngine,项目名称:gaffer,代码行数:29,代码来源:Options.cpp


示例11: computeGlobals

IECore::ConstCompoundObjectPtr Attributes::computeGlobals( const Gaffer::Context *context, const ScenePlug *parent ) const
{
	ConstCompoundObjectPtr inputGlobals = inPlug()->globalsPlug()->getValue();
	if( !globalPlug()->getValue() )
	{
		return inputGlobals;
	}

	const CompoundDataPlug *p = attributesPlug();
	IECore::CompoundObjectPtr result = new CompoundObject;
	// Since we're not going to modify any existing members (only add new ones),
	// and our result becomes const on returning it, we can directly reference
	// the input members in our result without copying. Be careful not to modify
	// them though!
	result->members() = inputGlobals->members();

	std::string name;
	for( CompoundDataPlug::MemberPlugIterator it( p ); !it.done(); ++it )
	{
		IECore::DataPtr d = p->memberDataAndName( it->get(), name );
		if( d )
		{
			result->members()["attribute:" + name] = d;
		}
	}

	return result;
}
开发者ID:HughMacdonald,项目名称:gaffer,代码行数:28,代码来源:Attributes.cpp


示例12: computeAttributes

IECore::ConstCompoundObjectPtr OSLLight::computeAttributes( const SceneNode::ScenePath &path, const Gaffer::Context *context, const GafferScene::ScenePlug *parent ) const
{
	IECore::CompoundObjectPtr result = new IECore::CompoundObject;

	ConstCompoundObjectPtr shaderAttributes = shaderInPlug()->attributes();
	result->members() = shaderAttributes->members();

	attributesPlug()->fillCompoundObject( result->members() );

	return result;
}
开发者ID:ImageEngine,项目名称:gaffer,代码行数:11,代码来源:OSLLight.cpp


示例13: computeProcessedGlobals

IECore::ConstCompoundObjectPtr Outputs::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
	const CompoundPlug *dsp = outputsPlug();
	if( !dsp->children().size() )
	{
		return inputGlobals;
	}

	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	// Since we're not going to modify any existing members (only add new ones),
	// and our result becomes const on returning it, we can directly reference
	// the input members in our result without copying. Be careful not to modify
	// them though!
	result->members() = inputGlobals->members();

	// add our outputs to the result
	for( InputCompoundPlugIterator it( dsp ); it != it.end(); it++ )
	{
		const CompoundPlug *outputPlug = it->get();
		if( outputPlug->getChild<BoolPlug>( "active" )->getValue() )
		{
			// backwards compatibility with old plug layout
			const StringPlug *namePlug = outputPlug->getChild<StringPlug>( "label" );
			if( !namePlug )
			{
				namePlug = outputPlug->getChild<StringPlug>( "name" );
			}
			const std::string name = namePlug->getValue();

			const StringPlug *fileNamePlug = outputPlug->getChild<StringPlug>( "fileName" );
			if( !fileNamePlug )
			{
				// backwards compatibility with old plug layout
				fileNamePlug = outputPlug->getChild<StringPlug>( "name" );
			}
			const std::string fileName = fileNamePlug->getValue();

			const std::string type = outputPlug->getChild<StringPlug>( "type" )->getValue();
			const std::string data = outputPlug->getChild<StringPlug>( "data" )->getValue();
			if( name.size() && fileName.size() && type.size() && data.size() )
			{
				DisplayPtr d = new Display( fileName, type, data );
				outputPlug->getChild<CompoundDataPlug>( "parameters" )->fillCompoundData( d->parameters() );
				result->members()["output:" + name] = d;
			}
		}
	}

	return result;
}
开发者ID:CRiant,项目名称:gaffer,代码行数:50,代码来源:Outputs.cpp


示例14: computeAttributes

IECore::ConstCompoundObjectPtr Light::computeAttributes( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	IECore::CompoundObjectPtr result = new IECore::CompoundObject;

	std::string lightAttribute = "light";

	IECoreScene::ShaderNetworkPtr lightShaders = computeLight( context );
	if( const IECoreScene::Shader *shader = lightShaders->outputShader() )
	{
		lightAttribute = shader->getType();
	}

	result->members()[lightAttribute] = lightShaders;

	return result;
}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:16,代码来源:Light.cpp


示例15: attributes

IECore::ConstCompoundObjectPtr Shader::attributes( const Gaffer::Plug *output ) const
{
	IECore::CompoundObjectPtr result = new IECore::CompoundObject;
	NetworkBuilder networkBuilder( output );
	if( networkBuilder.network()->size() )
	{
		std::string attr = typePlug()->getValue();
		std::string postfix = attributeSuffixPlug()->getValue();
		if( postfix != "" )
		{
			attr += ":" + postfix;
		}
		result->members()[attr] = boost::const_pointer_cast<IECoreScene::ShaderNetwork>( networkBuilder.network() );
	}
	return result;
}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:16,代码来源:Shader.cpp


示例16: computeProcessedGlobals

IECore::ConstCompoundObjectPtr Options::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
	IECore::CompoundObjectPtr result = inputGlobals->copy();
	const CompoundDataPlug *p = optionsPlug();

	std::string name;
	for( CompoundDataPlug::MemberPlugIterator it( p ); it != it.end(); ++it )
	{
		IECore::DataPtr d = p->memberDataAndName( it->get(), name );
		if( d )
		{
			result->members()["option:" + name] = d;
		}
	}

	return result;
}
开发者ID:daevid,项目名称:gaffer,代码行数:17,代码来源:Options.cpp


示例17: spotlightCone

IECoreGL::ConstRenderablePtr StandardLightVisualiser::spotlightCone( float innerAngle, float outerAngle, float lensRadius )
{
    IECoreGL::GroupPtr group = new IECoreGL::Group();
    addWireframeCurveState( group.get() );

    group->getState()->add( new IECoreGL::CurvesPrimitive::GLLineWidth( 1.0f ) );

    IECore::CompoundObjectPtr parameters = new CompoundObject;
    parameters->members()["aimType"] = new IntData( 0 );
    group->getState()->add(
        new IECoreGL::ShaderStateComponent( ShaderLoader::defaultShaderLoader(), TextureLoader::defaultTextureLoader(), faceCameraVertexSource(), "", IECoreGL::Shader::constantFragmentSource(), parameters )
    );

    IntVectorDataPtr vertsPerCurve = new IntVectorData;
    V3fVectorDataPtr p = new V3fVectorData;
    addCone( innerAngle, lensRadius, vertsPerCurve->writable(), p->writable() );

    IECoreGL::CurvesPrimitivePtr curves = new IECoreGL::CurvesPrimitive( IECore::CubicBasisf::linear(), false, vertsPerCurve );
    curves->addPrimitiveVariable( "P", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Vertex, p ) );
    curves->addPrimitiveVariable( "Cs", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Constant, new Color3fData( Color3f( 1.0f, 0.835f, 0.07f ) ) ) );

    group->addChild( curves );

    if( fabs( innerAngle - outerAngle ) > 0.1 )
    {
        IECoreGL::GroupPtr outerGroup = new Group;
        outerGroup->getState()->add( new IECoreGL::CurvesPrimitive::GLLineWidth( 0.5f ) );

        IntVectorDataPtr vertsPerCurve = new IntVectorData;
        V3fVectorDataPtr p = new V3fVectorData;
        addCone( outerAngle, lensRadius, vertsPerCurve->writable(), p->writable() );

        IECoreGL::CurvesPrimitivePtr curves = new IECoreGL::CurvesPrimitive( IECore::CubicBasisf::linear(), false, vertsPerCurve );
        curves->addPrimitiveVariable( "P", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Vertex, p ) );
        curves->addPrimitiveVariable( "Cs", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Constant, new Color3fData( Color3f( 1.0f, 0.835f, 0.07f ) ) ) );

        outerGroup->addChild( curves );

        group->addChild( outerGroup );
    }

    return group;
}
开发者ID:HughMacdonald,项目名称:gaffer,代码行数:43,代码来源:StandardLightVisualiser.cpp


示例18: computeGlobals

IECore::ConstCompoundObjectPtr Group::computeGlobals( const Gaffer::Context *context, const ScenePlug *parent ) const
{
	IECore::CompoundObjectPtr result = inPlug()->globalsPlug()->getValue()->copy();
	
	std::string groupName = namePlug()->getValue();

	ConstCompoundObjectPtr mapping = staticPointerCast<const CompoundObject>( inputMappingPlug()->getValue() );
	const ObjectVector *forwardMappings = mapping->member<ObjectVector>( "__GroupForwardMappings", true /* throw if missing */ );

	IECore::CompoundDataPtr forwardDeclarations = new IECore::CompoundData;
	for( size_t i = 0, e = m_inPlugs.inputs().size(); i < e; i++ )
	{
		const CompoundData *forwardMapping = static_cast<const IECore::CompoundData *>( forwardMappings->members()[i].get() );
		ConstCompoundObjectPtr inputGlobals = m_inPlugs.inputs()[i]->globalsPlug()->getValue();
		const CompoundData *inputForwardDeclarations = inputGlobals->member<CompoundData>( "gaffer:forwardDeclarations" );
		if( inputForwardDeclarations )
		{
			for( CompoundDataMap::const_iterator it = inputForwardDeclarations->readable().begin(), eIt = inputForwardDeclarations->readable().end(); it != eIt; it++ )
			{
				/// \todo This would all be much nicer if the forward declarations data structure
				/// used ScenePlug::ScenePaths or something similar - then we could ditch all the
				/// string munging.
				const InternedString &inputPath = it->first;
				size_t secondSlashPos = inputPath.string().find( '/', 1 );
				const std::string inputName( inputPath.string(), 1, secondSlashPos - 1 );
				const InternedString &outputName = forwardMapping->member<InternedStringData>( inputName, true /* throw if missing */ )->readable();
				std::string outputPath = std::string( "/" ) + groupName + "/" + outputName.string();
				if( secondSlashPos != string::npos )
				{
					outputPath += inputPath.string().substr( secondSlashPos );
				}
				forwardDeclarations->writable()[outputPath] = it->second;
			}
		}
	}
	result->members()["gaffer:forwardDeclarations"] = forwardDeclarations;
	
	return result;
}
开发者ID:7on7on,项目名称:gaffer,代码行数:39,代码来源:Group.cpp


示例19: computeAttributes

IECore::ConstCompoundObjectPtr Light::computeAttributes( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	IECore::CompoundObjectPtr result = new IECore::CompoundObject;

	std::string lightAttribute = "light";

	IECore::ObjectVectorPtr lightShaders = computeLight( context );
	if( lightShaders->members().size() > 0 )
	{
		IECore::LightPtr light = IECore::runTimeCast< IECore::Light >(
			lightShaders->members()[ lightShaders->members().size() - 1 ] );
		std::string lightName = light->getName();
		size_t colon = lightName.find( ":" );
		if( colon != std::string::npos )
		{
			lightAttribute = lightName.substr( 0, colon ) + ":light";
		}
	}

	result->members()[lightAttribute] = lightShaders;

	return result;
}
开发者ID:cnpinto,项目名称:gaffer,代码行数:23,代码来源:Light.cpp


示例20: ray

IECoreGL::ConstRenderablePtr StandardLightVisualiser::ray()
{
    IECoreGL::GroupPtr group = new IECoreGL::Group();
    addWireframeCurveState( group.get() );

    IECore::CompoundObjectPtr parameters = new CompoundObject;
    parameters->members()["aimType"] = new IntData( 0 );
    group->getState()->add(
        new IECoreGL::ShaderStateComponent( ShaderLoader::defaultShaderLoader(), TextureLoader::defaultTextureLoader(), faceCameraVertexSource(), "", IECoreGL::Shader::constantFragmentSource(), parameters )
    );

    IntVectorDataPtr vertsPerCurve = new IntVectorData;
    V3fVectorDataPtr p = new V3fVectorData;
    addRay( V2f( 0 ), V2f( 1, 0 ), vertsPerCurve->writable(), p->writable() );

    IECoreGL::CurvesPrimitivePtr curves = new IECoreGL::CurvesPrimitive( IECore::CubicBasisf::linear(), false, vertsPerCurve );
    curves->addPrimitiveVariable( "P", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Vertex, p ) );
    curves->addPrimitiveVariable( "Cs", IECore::PrimitiveVariable( IECore::PrimitiveVariable::Constant, new Color3fData( Color3f( 1.0f, 0.835f, 0.07f ) ) ) );

    group->addChild( curves );

    return group;
}
开发者ID:HughMacdonald,项目名称:gaffer,代码行数:23,代码来源:StandardLightVisualiser.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ iecore::ConstCompoundObjectPtr类代码示例发布时间:2022-05-31
下一篇:
C++ idevice::ConstPtr类代码示例发布时间: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