Example #1
0
    Impl(
        AssemblyItem*   assembly_item,
        Assembly*       assembly,
        Scene&          scene,
        ProjectBuilder& project_builder,
        ParamArray&     settings)
      : m_assembly_item(assembly_item)
      , m_assembly(assembly)
      , m_scene(scene)
      , m_project_builder(project_builder)
    {
        m_color_collection_item = add_single_model_collection_item<ColorEntity>(assembly->colors());

        m_assembly_item->addChild(
            m_texture_collection_item =
                new TextureCollectionItem(
                    *m_assembly,
                    assembly->textures(),
                    m_project_builder,
                    settings));

        m_texture_instance_collection_item = add_single_model_collection_item<TextureInstance>(assembly->texture_instances());
        m_texture_instance_collection_item->set_allow_creation(false);

        m_bsdf_collection_item = add_multi_model_collection_item<BSDF>(assembly->bsdfs());
        m_edf_collection_item = add_multi_model_collection_item<EDF>(assembly->edfs());
        m_surface_shader_collection_item = add_multi_model_collection_item<SurfaceShader>(assembly->surface_shaders());
        m_material_collection_item = add_single_model_collection_item<Material>(assembly->materials());
        m_light_collection_item = add_multi_model_collection_item<Light>(assembly->lights());
        
        m_assembly_item->addChild(
            m_object_collection_item =
                new ObjectCollectionItem(
                    *m_assembly,
                    assembly->objects(),
                    m_project_builder,
                    settings));
        
        m_object_instance_collection_item = add_collection_item(assembly->object_instances());
    }
Example #2
0
    typename ItemTypeMap<EntityContainer>::T* add_collection_item(EntityContainer& entities)
    {
        typedef typename ItemTypeMap<EntityContainer>::T ItemType;

        ItemType* item =
            new ItemType(
                *m_assembly,
                entities,
                m_project_builder);

        m_assembly_item->addChild(item);

        return item;
    }
Example #3
0
    CollectionItem<Entity, Assembly>* add_multi_model_collection_item(EntityContainer& entities)
    {
        CollectionItem<Entity, Assembly>* item =
            new MultiModelCollectionItem<Entity, Assembly>(
                new_guid(),
                EntityTraits<Entity>::get_human_readable_collection_type_name(),
                *m_assembly,
                m_project_builder);

        item->add_items(entities);

        m_assembly_item->addChild(item);

        return item;
    }