示例#1
0
void LinkerBNode::_notification(int p_notification) {
    switch (p_notification) {
        case NOTIFICATION_ENTER_TREE: {
            update_link_path();
            break;
        }
    }
}
示例#2
0
void LinkerBNode::set_link_path(NodePath path) {
    link_path = path;
    update_link_path();
}
示例#3
0
static types::InternalType* import_handles(int dataset)
{
    //get sparse dimensions
    int complex = 0;
    std::vector<int> pdims;
    int size = getDimsNode(dataset, &complex, pdims);

    if (size == 0)
    {
        closeList6(dataset);
        return nullptr;
    }

    //open __refs__ node
    int refs = getDataSetIdFromName(dataset, "__refs__");
    types::GraphicHandle* handles = new types::GraphicHandle(static_cast<int>(pdims.size()), pdims.data());
    long long* h = handles->get();

    if (size == 1)
    {
        //%h_copy
        int ref = getDataSetIdFromName(refs, std::to_string(0).data());
        int val = add_current_entity(ref);
        if (val < 0)
        {
            return nullptr;
        }

        h[0] = getHandle(val);
    }
    else
    {
        for (int i = 0; i < size; ++i)
        {
            int ref = getDataSetIdFromName(refs, std::to_string(i).data());
            int val = import_handle(ref, -1);
            if (val < 0)
            {
                return nullptr;
            }

            h[i] = getHandle(val);
        }
    }
    closeList6(refs);
    closeList6(dataset);


    //update links property of legend handle
    if (Links::count())
    {
        std::list<int> legends = Links::legends();
        for (auto & i : legends)
        {
            Links::PathList paths = Links::get(i);
            update_link_path(i, paths);
        }
    }

    return handles;
}