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


C++ Assembly::get_uid方法代码示例

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


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

示例1: 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

示例2: 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

示例3: ObjectCollectionItem

AssemblyItem::AssemblyItem(
    EntityEditorContext&    editor_context,
    Assembly&               assembly,
    BaseGroup&              parent,
    BaseGroupItem*          parent_item)
  : BaseGroupItem(editor_context, g_class_uid, assembly)
  , m_assembly(assembly)
  , m_assembly_uid(assembly.get_uid())
  , m_parent(parent)
  , m_parent_item(parent_item)
{
    set_title(QString::fromAscii(assembly.get_name()));

    set_allow_edition(false);

    insertChild(
        3,
        m_bsdf_collection_item = add_multi_model_collection_item<BSDF>(assembly.bsdfs()));

    insertChild(
        4,
        m_bssrdf_collection_item = add_multi_model_collection_item<BSSRDF>(assembly.bssrdfs()));

    insertChild(
        5,
        m_edf_collection_item = add_multi_model_collection_item<EDF>(assembly.edfs()));

    insertChild(
        6,
        m_surface_shader_collection_item = add_multi_model_collection_item<SurfaceShader>(assembly.surface_shaders()));

    insertChild(
        7,
        m_material_collection_item = new MaterialCollectionItem(
            m_editor_context,
            assembly.materials(),
            assembly,
            this));

    insertChild(
        8,
        m_light_collection_item = add_multi_model_collection_item<Light>(assembly.lights()));

    insertChild(
        9,
        m_object_collection_item =
            new ObjectCollectionItem(
                m_editor_context,
                assembly.objects(),
                assembly,
                this));

    insertChild(
        10,
        m_object_instance_collection_item =
            new ObjectInstanceCollectionItem(
                m_editor_context,
                new_guid(),
                EntityTraits<ObjectInstance>::get_human_readable_collection_type_name(),
                assembly));
    m_object_instance_collection_item->add_items(assembly.object_instances());

    insertChild(
        11,
        m_volume_collection_item = add_multi_model_collection_item<Volume>(assembly.volumes()));

    m_editor_context.m_item_registry.insert(m_assembly, this);
}
开发者ID:sriravic,项目名称:appleseed,代码行数:68,代码来源:assemblyitem.cpp


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