示例#1
0
QMenu* AssemblyItem::get_single_item_context_menu() const
{
    QMenu* menu = BaseGroupItem::get_single_item_context_menu();

    menu->addSeparator();
    menu->addAction("Instantiate...", this, SLOT(slot_instantiate()));

    menu->addSeparator();
    menu->addAction("Import Objects...", m_object_collection_item, SLOT(slot_import_objects()));
    menu->addAction("Import Textures...", &get_texture_collection_item(), SLOT(slot_import_textures()));

    menu->addSeparator();
    menu->addAction("Create Assembly...", &get_assembly_collection_item(), SLOT(slot_create()));
    menu->addAction("Create BSDF...", m_bsdf_collection_item, SLOT(slot_create()));
    menu->addAction("Create BSSRDF...", m_bssrdf_collection_item, SLOT(slot_create()));
    menu->addAction("Create Color...", &get_color_collection_item(), SLOT(slot_create()));
    menu->addAction("Create EDF...", m_edf_collection_item, SLOT(slot_create()));
    menu->addAction("Create Light...", m_light_collection_item, SLOT(slot_create()));
    menu->addAction("Create Volume...", m_volume_collection_item, SLOT(slot_create()));

    QMenu* submenu = menu->addMenu("Create Material...");
    submenu->addAction("Create Disney Material...", m_material_collection_item, SLOT(slot_create_disney()));
    submenu->addAction("Create Generic Material...", m_material_collection_item, SLOT(slot_create_generic()));

    menu->addAction("Create Surface Shader...", m_surface_shader_collection_item, SLOT(slot_create()));

    return menu;
}
QMenu* MaterialCollectionItem::get_single_item_context_menu() const
{
    QMenu* menu = ItemBase::get_single_item_context_menu();
    menu->clear();

    menu->addSeparator();
    menu->addAction("Create Generic Material...", this, SLOT(slot_create_generic()));
#ifdef APPLESEED_WITH_OSL
    menu->addAction("Create OSL Material...", this, SLOT(slot_create_osl()));
#endif

#ifdef APPLESEED_WITH_DISNEY_MATERIAL
    menu->addSeparator();
    menu->addAction("Create Disney Material...", this, SLOT(slot_create_disney()));
    menu->addAction("Import Disney Material...", this, SLOT(slot_import_disney()));
#endif

    return menu;
}