__init__.py 36.2 KB
Newer Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
    if embedding:
        embed = g.new_vertex_property("vector<int>")
    else:
        embed = None

    if kuratowski:
        kur = g.new_edge_property("bool")
    else:
        kur = None

    try:
        is_planar = libgraph_tool_topology.is_planar(g._Graph__graph,
                                                     _prop("v", g, embed),
                                                     _prop("e", g, kur))
    finally:
        g.pop_filter(directed=True)

    ret = [is_planar]
1019
    if embed is not None:
1020
        ret.append(embed)
1021
    if kur is not None:
1022
1023
1024
1025
1026
        ret.append(kur)
    if len(ret) == 1:
        return ret[0]
    else:
        return tuple(ret)