Ejemplo n.º 1
0
void AssemblyItem::slot_instantiate()
{
    const string instance_name_suggestion =
        get_name_suggestion(
            string(m_assembly.get_name()) + "_inst",
            m_parent.assembly_instances());

    const string instance_name =
        get_entity_name_dialog(
            treeWidget(),
            "Instantiate Assembly",
            "Assembly Instance Name:",
            instance_name_suggestion);

    if (!instance_name.empty())
    {
        auto_release_ptr<AssemblyInstance> assembly_instance(
            AssemblyInstanceFactory::create(
                instance_name.c_str(),
                ParamArray(),
                m_assembly.get_name()));

        m_parent_item->get_assembly_instance_collection_item().add_item(assembly_instance.get());

        m_parent.assembly_instances().insert(assembly_instance);

        m_project_builder.get_project().get_scene()->bump_version_id();
        m_project_builder.notify_project_modification();
    }
}
Ejemplo n.º 2
0
void AssemblyCollectionItem::slot_create()
{
    const string assembly_name_suggestion = get_name_suggestion("assembly", m_parent.assemblies());

    const string assembly_name =
        get_entity_name_dialog(
            treeWidget(),
            "Create Assembly",
            "Assembly Name:",
            assembly_name_suggestion);

    if (!assembly_name.empty())
        m_project_builder.insert_assembly(m_parent, m_parent_item, assembly_name);
}
Ejemplo n.º 3
0
void AssemblyItem::slot_instantiate()
{
    const string instance_name_suggestion =
        get_name_suggestion(
            string(impl->m_assembly->get_name()) + "_inst",
            impl->m_scene.assembly_instances());

    const string instance_name =
        get_entity_name_dialog(
            treeWidget(),
            "Instantiate Assembly",
            "Assembly Instance Name:",
            instance_name_suggestion);

    if (!instance_name.empty())
        impl->m_project_builder.insert_assembly_instance(instance_name, *impl->m_assembly);
}
Ejemplo n.º 4
0
void AssemblyItem::slot_instantiate()
{
    const string instance_name_suggestion =
        get_name_suggestion(
            string(m_assembly.get_name()) + "_inst",
            m_parent.assembly_instances());

    const string instance_name =
        get_entity_name_dialog(
            treeWidget(),
            "Instantiate Assembly",
            "Assembly Instance Name:",
            instance_name_suggestion);

    if (!instance_name.empty())
    {
        if (m_project_builder.get_rendering_manager().is_rendering())
            schedule_instantiate(instance_name);
        else
            do_instantiate(instance_name);
    }
}