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

C++ inputarray::iterator类代码示例

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

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



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

示例1: bind_texture_instance_to_input

void InputBinder::bind_texture_instance_to_input(
    const TextureInstanceContainer& texture_instances,
    const UniqueID                  assembly_uid,
    const char*                     entity_type,
    const char*                     entity_name,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    const TextureInstance* texture_instance = texture_instances.get_by_name(param_value);
    assert(texture_instance);

    try
    {
        input.bind(
            new TextureSource(
                assembly_uid,
                *texture_instance));
    }
    catch (const exception& e)
    {
        RENDERER_LOG_ERROR(
            "while defining %s \"%s\", failed to bind \"%s\" to input \"%s\" (%s).",
            entity_type,
            entity_name,
            param_value,
            input.name(),
            e.what());

        ++m_error_count;
    }
}
开发者ID:pangoo,项目名称:appleseed,代码行数:31,代码来源:inputbinder.cpp


示例2: bind_color_to_input

void InputBinder::bind_color_to_input(
    const ColorContainer&           colors,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    const ColorEntity* color_entity = colors.get_by_name(param_value);
    assert(color_entity);

    input.bind(new ColorSource(*color_entity, input.format()));
}
开发者ID:marius-avram,项目名称:appleseed,代码行数:10,代码来源:inputbinder.cpp


示例3: try_bind_scene_entity_to_input

bool InputBinder::try_bind_scene_entity_to_input(
    const Scene&                    scene,
    const SymbolTable&              scene_symbols,
    const char*                     entity_type,
    const char*                     entity_name,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    if (input.format() == InputFormatEntity)
    {
        #define BIND(symbol, collection)                        \
            case symbol:                                        \
              input.bind(collection.get_by_name(param_value));  \
              return true

        switch (scene_symbols.lookup(param_value))
        {
          BIND(SymbolTable::SymbolColor, scene.colors());
          BIND(SymbolTable::SymbolTexture, scene.textures());
          BIND(SymbolTable::SymbolTextureInstance, scene.texture_instances());
#ifdef APPLESEED_WITH_OSL
          BIND(SymbolTable::SymbolShaderGroup, scene.shader_groups());
#endif
          BIND(SymbolTable::SymbolEnvironmentEDF, scene.environment_edfs());
          BIND(SymbolTable::SymbolEnvironmentShader, scene.environment_shaders());
        }

        #undef BIND
    }
    else
    {
        switch (scene_symbols.lookup(param_value))
        {
          case SymbolTable::SymbolColor:
            bind_color_to_input(
                scene.colors(),
                param_value,
                input);
            return true;

          case SymbolTable::SymbolTextureInstance:
            bind_texture_instance_to_input(
                scene.texture_instances(),
                ~0,                 // the parent is the scene, not an assembly
                entity_type,
                entity_name,
                param_value,
                input);
            return true;
        }
    }

    return false;
}
开发者ID:pangoo,项目名称:appleseed,代码行数:54,代码来源:inputbinder.cpp


示例4: bind_assembly_entity_to_input

void InputBinder::bind_assembly_entity_to_input(
    const Scene&                    scene,
    const SymbolTable&              scene_symbols,
    const Assembly&                 assembly,
    const SymbolTable&              assembly_symbols,
    const char*                     entity_type,
    const char*                     entity_name,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    switch (assembly_symbols.lookup(param_value))
    {
      case SymbolTable::SymbolColor:
        bind_color_to_input(
            assembly.colors(),
            param_value,
            input);
        break;

      case SymbolTable::SymbolTextureInstance:
        bind_texture_instance_to_input(
            assembly.textures(),
            assembly.texture_instances(),
            assembly.get_uid(),
            entity_type,
            entity_name,
            param_value,
            input);
        break;

      case SymbolTable::SymbolNotFound:
        // No entity with this name was found in this scope.
        // Attempt to bind the input to a scene entity.
        bind_scene_entity_to_input(
            scene,
            scene_symbols,
            entity_type,
            entity_name,
            param_value,
            input);
        break;

      default:
        RENDERER_LOG_ERROR(
            "while defining %s \"%s\": cannot bind \"%s\" to parameter \"%s\".",
            entity_type,
            entity_name,
            param_value,
            input.name());
        ++m_error_count;
        break;
    }
}
开发者ID:willzhou,项目名称:appleseed,代码行数:53,代码来源:inputbinder.cpp


示例5: bind_texture_instance_to_input

void InputBinder::bind_texture_instance_to_input(
    const TextureContainer&         textures,
    const TextureInstanceContainer& texture_instances,
    const UniqueID                  assembly_uid,
    const char*                     entity_type,
    const char*                     entity_name,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    const TextureInstance* texture_instance = texture_instances.get_by_name(param_value);
    assert(texture_instance);

    const size_t texture_index = texture_instance->get_texture_index();
    assert(texture_index != ~0);

    Texture* texture = textures.get_by_index(texture_index);
    assert(texture);

    try
    {
        input.bind(
            new TextureSource(
                assembly_uid,
                *texture_instance,
                texture->properties()));
    }
    catch (const exception& e)
    {
        RENDERER_LOG_ERROR(
            "while defining %s \"%s\", while binding \"%s\" to parameter \"%s\": %s.",
            entity_type,
            entity_name,
            param_value,
            input.name(),
            e.what());
        ++m_error_count;
    }
}
开发者ID:willzhou,项目名称:appleseed,代码行数:38,代码来源:inputbinder.cpp


示例6: try_bind_scalar_to_input

bool InputBinder::try_bind_scalar_to_input(
    const string&                   param_value,
    InputArray::iterator&           input) const
{
    try
    {
        const double value = from_string<double>(param_value);
        input.bind(new ScalarSource(value));
        return true;
    }
    catch (const ExceptionStringConversionError&)
    {
        return false;
    }
}
开发者ID:pangoo,项目名称:appleseed,代码行数:15,代码来源:inputbinder.cpp


示例7: bind_scene_entity_to_input

void InputBinder::bind_scene_entity_to_input(
    const Scene&                    scene,
    const SymbolTable&              scene_symbols,
    const char*                     entity_type,
    const char*                     entity_name,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    switch (scene_symbols.lookup(param_value))
    {
      case SymbolTable::SymbolColor:
        bind_color_to_input(
            scene.colors(),
            param_value,
            input);
        break;

      case SymbolTable::SymbolTextureInstance:
        bind_texture_instance_to_input(
            scene.textures(),
            scene.texture_instances(),
            ~0,                     // the parent is the scene, not an assembly
            entity_type,
            entity_name,
            param_value,
            input);
        break;

      default:
        RENDERER_LOG_ERROR(
            "while defining %s \"%s\": cannot bind \"%s\" to parameter \"%s\".",
            entity_type,
            entity_name,
            param_value,
            input.name());
        ++m_error_count;
        break;
    }
}
开发者ID:willzhou,项目名称:appleseed,代码行数:39,代码来源:inputbinder.cpp


示例8: try_bind_assembly_entity_to_input

bool InputBinder::try_bind_assembly_entity_to_input(
    const Scene&                    scene,
    const SymbolTable&              scene_symbols,
    const Assembly&                 assembly,
    const SymbolTable&              assembly_symbols,
    const char*                     entity_type,
    const char*                     entity_name,
    const char*                     param_value,
    InputArray::iterator&           input)
{
    if (input.format() == InputFormatEntity)
    {
        #define BIND(symbol, collection)                        \
            case symbol:                                        \
              input.bind(collection.get_by_name(param_value));  \
              return true

        switch (assembly_symbols.lookup(param_value))
        {
          BIND(SymbolTable::SymbolColor, assembly.colors());
          BIND(SymbolTable::SymbolTexture, assembly.textures());
          BIND(SymbolTable::SymbolTextureInstance, assembly.texture_instances());
          BIND(SymbolTable::SymbolBSDF, assembly.bsdfs());
          BIND(SymbolTable::SymbolBSSRDF, assembly.bssrdfs());
          BIND(SymbolTable::SymbolEDF, assembly.edfs());
#ifdef APPLESEED_WITH_OSL
          BIND(SymbolTable::SymbolShaderGroup, assembly.shader_groups());
#endif
          BIND(SymbolTable::SymbolSurfaceShader, assembly.surface_shaders());
          BIND(SymbolTable::SymbolMaterial, assembly.materials());
          BIND(SymbolTable::SymbolLight, assembly.lights());
          BIND(SymbolTable::SymbolObject, assembly.objects());
          BIND(SymbolTable::SymbolObjectInstance, assembly.object_instances());
        }

        #undef BIND
    }
    else
    {
        switch (assembly_symbols.lookup(param_value))
        {
          case SymbolTable::SymbolColor:
            bind_color_to_input(
                assembly.colors(),
                param_value,
                input);
            return true;

          case SymbolTable::SymbolTextureInstance:
            bind_texture_instance_to_input(
                assembly.texture_instances(),
                assembly.get_uid(),
                entity_type,
                entity_name,
                param_value,
                input);
            return true;
        }
    }

    return false;
}
开发者ID:pangoo,项目名称:appleseed,代码行数:62,代码来源:inputbinder.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ inputimagetype::Pointer类代码示例发布时间:2022-05-31
下一篇:
C++ inlineasm::ConstraintInfoVector类代码示例发布时间: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