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

"""
Adaptor2d module, see official documentation at
https://www.opencascade.com/doc/occt-7.7.0/refman/html/package_adaptor2d.html
"""

from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _Adaptor2d
else:
    import _Adaptor2d

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 == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(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__)


class SwigPyIterator(object):
    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 - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _Adaptor2d.delete_SwigPyIterator

    def value(self):
        return _Adaptor2d.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _Adaptor2d.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _Adaptor2d.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _Adaptor2d.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _Adaptor2d.SwigPyIterator_equal(self, x)

    def copy(self):
        return _Adaptor2d.SwigPyIterator_copy(self)

    def next(self):
        return _Adaptor2d.SwigPyIterator_next(self)

    def __next__(self):
        return _Adaptor2d.SwigPyIterator___next__(self)

    def previous(self):
        return _Adaptor2d.SwigPyIterator_previous(self)

    def advance(self, n):
        return _Adaptor2d.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _Adaptor2d.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _Adaptor2d.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _Adaptor2d.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _Adaptor2d.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _Adaptor2d.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _Adaptor2d.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _Adaptor2d:
_Adaptor2d.SwigPyIterator_swigregister(SwigPyIterator)

def _dumps_object(klass):
    """ Overwrite default string output for any wrapped object.
    By default, __repr__ method returns something like:
    <OCC.Core.TopoDS.TopoDS_Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x02BB0758> >
    This is too much verbose.
    We prefer :
    <class 'gp_Pnt'>
    or
    <class 'TopoDS_Shape'>
    """
    klass_name = str(klass.__class__).split(".")[3].split("'")[0]
    repr_string = "<class '" + klass_name + "'"
# for TopoDS_Shape, we also look for the base type
    if klass_name == "TopoDS_Shape":
        if klass.IsNull():
            repr_string += ": Null>"
            return repr_string
        st = klass.ShapeType()
        types = {OCC.Core.TopAbs.TopAbs_VERTEX: "Vertex",
                 OCC.Core.TopAbs.TopAbs_SOLID: "Solid",
                 OCC.Core.TopAbs.TopAbs_EDGE: "Edge",
                 OCC.Core.TopAbs.TopAbs_FACE: "Face",
                 OCC.Core.TopAbs.TopAbs_SHELL: "Shell",
                 OCC.Core.TopAbs.TopAbs_WIRE: "Wire",
                 OCC.Core.TopAbs.TopAbs_COMPOUND: "Compound",
                 OCC.Core.TopAbs.TopAbs_COMPSOLID: "Compsolid"}
        repr_string += "; Type:%s" % types[st]        
    elif hasattr(klass, "IsNull"):
        if klass.IsNull():
            repr_string += "; Null"
    repr_string += ">"
    return repr_string


def process_exception(error, method_name, class_name):
    return _Adaptor2d.process_exception(error, method_name, class_name)

from six import with_metaclass
import warnings
from OCC.Wrapper.wrapper_utils import Proxy, deprecated

import OCC.Core.Standard
import OCC.Core.NCollection
import OCC.Core.Geom2d
import OCC.Core.gp
import OCC.Core.TColStd
import OCC.Core.TCollection
import OCC.Core.GeomAbs
import OCC.Core.TColgp

from enum import IntEnum
from OCC.Core.Exception import *




def Handle_Adaptor2d_Curve2d_Create():
    return _Adaptor2d.Handle_Adaptor2d_Curve2d_Create()

def Handle_Adaptor2d_Curve2d_DownCast(t):
    return _Adaptor2d.Handle_Adaptor2d_Curve2d_DownCast(t)

def Handle_Adaptor2d_Curve2d_IsNull(t):
    return _Adaptor2d.Handle_Adaptor2d_Curve2d_IsNull(t)

def Handle_Adaptor2d_Line2d_Create():
    return _Adaptor2d.Handle_Adaptor2d_Line2d_Create()

def Handle_Adaptor2d_Line2d_DownCast(t):
    return _Adaptor2d.Handle_Adaptor2d_Line2d_DownCast(t)

def Handle_Adaptor2d_Line2d_IsNull(t):
    return _Adaptor2d.Handle_Adaptor2d_Line2d_IsNull(t)

def Handle_Adaptor2d_OffsetCurve_Create():
    return _Adaptor2d.Handle_Adaptor2d_OffsetCurve_Create()

def Handle_Adaptor2d_OffsetCurve_DownCast(t):
    return _Adaptor2d.Handle_Adaptor2d_OffsetCurve_DownCast(t)

def Handle_Adaptor2d_OffsetCurve_IsNull(t):
    return _Adaptor2d.Handle_Adaptor2d_OffsetCurve_IsNull(t)
class Adaptor2d_Curve2d(OCC.Core.Standard.Standard_Transient):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def BSpline(self, *args):
        r"""
        Return
        -------
        opencascade::handle<Geom2d_BSplineCurve>

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_BSpline(self, *args)

    def Bezier(self, *args):
        r"""
        Return
        -------
        opencascade::handle<Geom2d_BezierCurve>

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Bezier(self, *args)

    def Circle(self, *args):
        r"""
        Return
        -------
        gp_Circ2d

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Circle(self, *args)

    def Continuity(self, *args):
        r"""
        Return
        -------
        GeomAbs_Shape

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Continuity(self, *args)

    def D0(self, *args):
        r"""

        Parameters
        ----------
        U: float
        P: gp_Pnt2d

        Return
        -------
        None

        Description
        -----------
        Computes the point of parameter u on the curve.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_D0(self, *args)

    def D1(self, *args):
        r"""

        Parameters
        ----------
        U: float
        P: gp_Pnt2d
        V: gp_Vec2d

        Return
        -------
        None

        Description
        -----------
        Computes the point of parameter u on the curve with its first derivative. raised if the continuity of the current interval is not c1.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_D1(self, *args)

    def D2(self, *args):
        r"""

        Parameters
        ----------
        U: float
        P: gp_Pnt2d
        V1: gp_Vec2d
        V2: gp_Vec2d

        Return
        -------
        None

        Description
        -----------
        Returns the point p of parameter u, the first and second derivatives v1 and v2. raised if the continuity of the current interval is not c2.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_D2(self, *args)

    def D3(self, *args):
        r"""

        Parameters
        ----------
        U: float
        P: gp_Pnt2d
        V1: gp_Vec2d
        V2: gp_Vec2d
        V3: gp_Vec2d

        Return
        -------
        None

        Description
        -----------
        Returns the point p of parameter u, the first, the second and the third derivative. raised if the continuity of the current interval is not c3.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_D3(self, *args)

    def DN(self, *args):
        r"""

        Parameters
        ----------
        U: float
        N: int

        Return
        -------
        gp_Vec2d

        Description
        -----------
        The returned vector gives the value of the derivative for the order of derivation n. raised if the continuity of the current interval is not cn. raised if n < 1.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_DN(self, *args)

    def Degree(self, *args):
        r"""
        Return
        -------
        int

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Degree(self, *args)

    def Ellipse(self, *args):
        r"""
        Return
        -------
        gp_Elips2d

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Ellipse(self, *args)

    def FirstParameter(self, *args):
        r"""
        Return
        -------
        float

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_FirstParameter(self, *args)

    def GetType(self, *args):
        r"""
        Return
        -------
        GeomAbs_CurveType

        Description
        -----------
        Returns the type of the curve in the current interval: line, circle, ellipse, hyperbola, parabola, beziercurve, bsplinecurve, othercurve.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_GetType(self, *args)

    def Hyperbola(self, *args):
        r"""
        Return
        -------
        gp_Hypr2d

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Hyperbola(self, *args)

    def Intervals(self, *args):
        r"""

        Parameters
        ----------
        T: TColStd_Array1OfReal
        S: GeomAbs_Shape

        Return
        -------
        None

        Description
        -----------
        Stores in <t> the parameters bounding the intervals of continuity <s>. //! the array must provide enough room to accommodate for the parameters. i.e. t.length() > nbintervals().

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Intervals(self, *args)

    def IsClosed(self, *args):
        r"""
        Return
        -------
        bool

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_IsClosed(self, *args)

    def IsPeriodic(self, *args):
        r"""
        Return
        -------
        bool

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_IsPeriodic(self, *args)

    def IsRational(self, *args):
        r"""
        Return
        -------
        bool

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_IsRational(self, *args)

    def LastParameter(self, *args):
        r"""
        Return
        -------
        float

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_LastParameter(self, *args)

    def Line(self, *args):
        r"""
        Return
        -------
        gp_Lin2d

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Line(self, *args)

    def NbIntervals(self, *args):
        r"""

        Parameters
        ----------
        S: GeomAbs_Shape

        Return
        -------
        int

        Description
        -----------
        If necessary, breaks the curve in intervals of continuity <s>. and returns the number of intervals.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_NbIntervals(self, *args)

    def NbKnots(self, *args):
        r"""
        Return
        -------
        int

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_NbKnots(self, *args)

    def NbPoles(self, *args):
        r"""
        Return
        -------
        int

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_NbPoles(self, *args)

    def NbSamples(self, *args):
        r"""
        Return
        -------
        int

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_NbSamples(self, *args)

    def Parabola(self, *args):
        r"""
        Return
        -------
        gp_Parab2d

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Parabola(self, *args)

    def Period(self, *args):
        r"""
        Return
        -------
        float

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Period(self, *args)

    def Resolution(self, *args):
        r"""

        Parameters
        ----------
        R3d: float

        Return
        -------
        float

        Description
        -----------
        Returns the parametric resolution corresponding to the real space resolution <r3d>.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Resolution(self, *args)

    def ShallowCopy(self, *args):
        r"""
        Return
        -------
        opencascade::handle<Adaptor2d_Curve2d>

        Description
        -----------
        Shallow copy of adaptor.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_ShallowCopy(self, *args)

    def Trim(self, *args):
        r"""

        Parameters
        ----------
        First: float
        Last: float
        Tol: float

        Return
        -------
        opencascade::handle<Adaptor2d_Curve2d>

        Description
        -----------
        Returns a curve equivalent of <self> between parameters <first> and <last>. <tol> is used to test for 3d points confusion. if <first> >= <last>.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Trim(self, *args)

    def Value(self, *args):
        r"""

        Parameters
        ----------
        U: float

        Return
        -------
        gp_Pnt2d

        Description
        -----------
        Computes the point of parameter u on the curve.

        """
        return _Adaptor2d.Adaptor2d_Curve2d_Value(self, *args)


    @staticmethod
    def DownCast(t):
      return Handle_Adaptor2d_Curve2d_DownCast(t)


    __repr__ = _dumps_object


    def __init__(self):
        _Adaptor2d.Adaptor2d_Curve2d_swiginit(self, _Adaptor2d.new_Adaptor2d_Curve2d())
    __swig_destroy__ = _Adaptor2d.delete_Adaptor2d_Curve2d

# Register Adaptor2d_Curve2d in _Adaptor2d:
_Adaptor2d.Adaptor2d_Curve2d_swigregister(Adaptor2d_Curve2d)
class Adaptor2d_Line2d(Adaptor2d_Curve2d):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        r"""
        Return
        -------
        None

        Description
        -----------
        No available documentation.

        Parameters
        ----------
        P: gp_Pnt2d
        D: gp_Dir2d
        UFirst: float
        ULast: float

        Return
        -------
        None

        Description
        -----------
        No available documentation.

        """
        _Adaptor2d.Adaptor2d_Line2d_swiginit(self, _Adaptor2d.new_Adaptor2d_Line2d(*args))

    def Load(self, *args):
        r"""

        Parameters
        ----------
        L: gp_Lin2d

        Return
        -------
        None

        Description
        -----------
        No available documentation.

        Parameters
        ----------
        L: gp_Lin2d
        UFirst: float
        ULast: float

        Return
        -------
        None

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_Line2d_Load(self, *args)


    @staticmethod
    def DownCast(t):
      return Handle_Adaptor2d_Line2d_DownCast(t)


    __repr__ = _dumps_object

    __swig_destroy__ = _Adaptor2d.delete_Adaptor2d_Line2d

# Register Adaptor2d_Line2d in _Adaptor2d:
_Adaptor2d.Adaptor2d_Line2d_swigregister(Adaptor2d_Line2d)
class Adaptor2d_OffsetCurve(Adaptor2d_Curve2d):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        r"""
        Return
        -------
        None

        Description
        -----------
        The offset is set to 0.

        Parameters
        ----------
        C: Adaptor2d_Curve2d

        Return
        -------
        None

        Description
        -----------
        The curve is loaded. the offset is set to 0.

        Parameters
        ----------
        C: Adaptor2d_Curve2d
        Offset: float

        Return
        -------
        None

        Description
        -----------
        Creates an offsetcurve curve. the offset is set to offset.

        Parameters
        ----------
        C: Adaptor2d_Curve2d
        Offset: float
        WFirst: float
        WLast: float

        Return
        -------
        None

        Description
        -----------
        Create an offset curve. wfirst,wlast define the bounds of the offset curve.

        """
        _Adaptor2d.Adaptor2d_OffsetCurve_swiginit(self, _Adaptor2d.new_Adaptor2d_OffsetCurve(*args))

    def Curve(self, *args):
        r"""
        Return
        -------
        opencascade::handle<Adaptor2d_Curve2d>

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_OffsetCurve_Curve(self, *args)

    def Load(self, *args):
        r"""

        Parameters
        ----------
        S: Adaptor2d_Curve2d

        Return
        -------
        None

        Description
        -----------
        Changes the curve. the offset is reset to 0.

        Parameters
        ----------
        Offset: float

        Return
        -------
        None

        Description
        -----------
        Changes the offset on the current curve.

        Parameters
        ----------
        Offset: float
        WFirst: float
        WLast: float

        Return
        -------
        None

        Description
        -----------
        Changes the offset curve on the current curve.

        """
        return _Adaptor2d.Adaptor2d_OffsetCurve_Load(self, *args)

    def Offset(self, *args):
        r"""
        Return
        -------
        float

        Description
        -----------
        No available documentation.

        """
        return _Adaptor2d.Adaptor2d_OffsetCurve_Offset(self, *args)


    @staticmethod
    def DownCast(t):
      return Handle_Adaptor2d_OffsetCurve_DownCast(t)


    __repr__ = _dumps_object

    __swig_destroy__ = _Adaptor2d.delete_Adaptor2d_OffsetCurve

# Register Adaptor2d_OffsetCurve in _Adaptor2d:
_Adaptor2d.Adaptor2d_OffsetCurve_swigregister(Adaptor2d_OffsetCurve)



