# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _gnm
else:
    import _gnm

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def GetUseExceptions(*args) -> "int":
    r"""GetUseExceptions() -> int"""
    return _gnm.GetUseExceptions(*args)

def UseExceptions(*args) -> "void":
    r"""UseExceptions()"""
    return _gnm.UseExceptions(*args)

def DontUseExceptions(*args) -> "void":
    r"""DontUseExceptions()"""
    return _gnm.DontUseExceptions(*args)
from . import ogr
from . import osr
GATDijkstraShortestPath = _gnm.GATDijkstraShortestPath

GATKShortestPath = _gnm.GATKShortestPath

GATConnectedComponents = _gnm.GATConnectedComponents

GNM_EDGE_DIR_BOTH = _gnm.GNM_EDGE_DIR_BOTH

GNM_EDGE_DIR_SRCTOTGT = _gnm.GNM_EDGE_DIR_SRCTOTGT

GNM_EDGE_DIR_TGTTOSRC = _gnm.GNM_EDGE_DIR_TGTTOSRC


def CastToNetwork(*args) -> "GNMNetworkShadow *":
    r"""CastToNetwork(MajorObject base) -> Network"""
    return _gnm.CastToNetwork(*args)

def CastToGenericNetwork(*args) -> "GNMGenericNetworkShadow *":
    r"""CastToGenericNetwork(MajorObject base) -> GenericNetwork"""
    return _gnm.CastToGenericNetwork(*args)
class Network(ogr.MajorObject):
    r"""Proxy of C++ GNMNetworkShadow class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _gnm.delete_Network

    def ReleaseResultSet(self, *args) -> "void":
        r"""ReleaseResultSet(Network self, Layer layer)"""
        return _gnm.Network_ReleaseResultSet(self, *args)

    def GetVersion(self, *args) -> "int":
        r"""GetVersion(Network self) -> int"""
        return _gnm.Network_GetVersion(self, *args)

    def GetName(self, *args) -> "char const *":
        r"""GetName(Network self) -> char const *"""
        return _gnm.Network_GetName(self, *args)

    def GetFeatureByGlobalFID(self, *args) -> "OGRFeatureShadow *":
        r"""GetFeatureByGlobalFID(Network self, GIntBig GFID) -> Feature"""
        return _gnm.Network_GetFeatureByGlobalFID(self, *args)

    def GetPath(self, *args, **kwargs) -> "OGRLayerShadow *":
        r"""GetPath(Network self, GIntBig nStartFID, GIntBig nEndFID, GNMGraphAlgorithmType eAlgorithm, char ** options=None) -> Layer"""
        return _gnm.Network_GetPath(self, *args, **kwargs)

    def DisconnectAll(self, *args) -> "CPLErr":
        r"""DisconnectAll(Network self) -> CPLErr"""
        return _gnm.Network_DisconnectAll(self, *args)

    def GetProjection(self, *args) -> "char const *":
        r"""GetProjection(Network self) -> char const *"""
        return _gnm.Network_GetProjection(self, *args)

    def GetProjectionRef(self, *args) -> "char const *":
        r"""GetProjectionRef(Network self) -> char const *"""
        return _gnm.Network_GetProjectionRef(self, *args)

    def GetFileList(self, *args) -> "char **":
        r"""GetFileList(Network self) -> char **"""
        return _gnm.Network_GetFileList(self, *args)

    def CreateLayer(self, *args, **kwargs) -> "OGRLayerShadow *":
        r"""CreateLayer(Network self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type=wkbUnknown, char ** options=None) -> Layer"""
        return _gnm.Network_CreateLayer(self, *args, **kwargs)

    def CopyLayer(self, *args, **kwargs) -> "OGRLayerShadow *":
        r"""CopyLayer(Network self, Layer src_layer, char const * new_name, char ** options=None) -> Layer"""
        return _gnm.Network_CopyLayer(self, *args, **kwargs)

    def DeleteLayer(self, *args) -> "OGRErr":
        r"""DeleteLayer(Network self, int index) -> OGRErr"""
        return _gnm.Network_DeleteLayer(self, *args)

    def GetLayerCount(self, *args) -> "int":
        r"""GetLayerCount(Network self) -> int"""
        return _gnm.Network_GetLayerCount(self, *args)

    def GetLayerByIndex(self, *args) -> "OGRLayerShadow *":
        r"""GetLayerByIndex(Network self, int index=0) -> Layer"""
        return _gnm.Network_GetLayerByIndex(self, *args)

    def GetLayerByName(self, *args) -> "OGRLayerShadow *":
        r"""GetLayerByName(Network self, char const * layer_name) -> Layer"""
        return _gnm.Network_GetLayerByName(self, *args)

    def TestCapability(self, *args) -> "bool":
        r"""TestCapability(Network self, char const * cap) -> bool"""
        return _gnm.Network_TestCapability(self, *args)

    def StartTransaction(self, *args, **kwargs) -> "OGRErr":
        r"""StartTransaction(Network self, int force=FALSE) -> OGRErr"""
        return _gnm.Network_StartTransaction(self, *args, **kwargs)

    def CommitTransaction(self, *args) -> "OGRErr":
        r"""CommitTransaction(Network self) -> OGRErr"""
        return _gnm.Network_CommitTransaction(self, *args)

    def RollbackTransaction(self, *args) -> "OGRErr":
        r"""RollbackTransaction(Network self) -> OGRErr"""
        return _gnm.Network_RollbackTransaction(self, *args)

# Register Network in _gnm:
_gnm.Network_swigregister(Network)

class GenericNetwork(Network):
    r"""Proxy of C++ GNMGenericNetworkShadow class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _gnm.delete_GenericNetwork

    def ConnectFeatures(self, *args) -> "CPLErr":
        r"""ConnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
        return _gnm.GenericNetwork_ConnectFeatures(self, *args)

    def DisconnectFeatures(self, *args) -> "CPLErr":
        r"""DisconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID) -> CPLErr"""
        return _gnm.GenericNetwork_DisconnectFeatures(self, *args)

    def DisconnectFeaturesWithId(self, *args) -> "CPLErr":
        r"""DisconnectFeaturesWithId(GenericNetwork self, GIntBig nFID) -> CPLErr"""
        return _gnm.GenericNetwork_DisconnectFeaturesWithId(self, *args)

    def ReconnectFeatures(self, *args) -> "CPLErr":
        r"""ReconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
        return _gnm.GenericNetwork_ReconnectFeatures(self, *args)

    def CreateRule(self, *args) -> "CPLErr":
        r"""CreateRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"""
        return _gnm.GenericNetwork_CreateRule(self, *args)

    def DeleteAllRules(self, *args) -> "CPLErr":
        r"""DeleteAllRules(GenericNetwork self) -> CPLErr"""
        return _gnm.GenericNetwork_DeleteAllRules(self, *args)

    def DeleteRule(self, *args) -> "CPLErr":
        r"""DeleteRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"""
        return _gnm.GenericNetwork_DeleteRule(self, *args)

    def GetRules(self, *args) -> "char **":
        r"""GetRules(GenericNetwork self) -> char **"""
        return _gnm.GenericNetwork_GetRules(self, *args)

    def ConnectPointsByLines(self, *args, **kwargs) -> "CPLErr":
        r"""ConnectPointsByLines(GenericNetwork self, char ** papszLayerList, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
        return _gnm.GenericNetwork_ConnectPointsByLines(self, *args, **kwargs)

    def ChangeBlockState(self, *args) -> "CPLErr":
        r"""ChangeBlockState(GenericNetwork self, GIntBig nFID, bool bIsBlock) -> CPLErr"""
        return _gnm.GenericNetwork_ChangeBlockState(self, *args)

    def ChangeAllBlockState(self, *args) -> "CPLErr":
        r"""ChangeAllBlockState(GenericNetwork self, bool bIsBlock=False) -> CPLErr"""
        return _gnm.GenericNetwork_ChangeAllBlockState(self, *args)

# Register GenericNetwork in _gnm:
_gnm.GenericNetwork_swigregister(GenericNetwork)



