# 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.

"""
AdvApprox module, see official documentation at
https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_advapprox.html
"""

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 _AdvApprox
else:
    import _AdvApprox

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__)


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__ = _AdvApprox.delete_SwigPyIterator

    def value(self) -> "PyObject *":
        return _AdvApprox.SwigPyIterator_value(self)

    def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _AdvApprox.SwigPyIterator_incr(self, n)

    def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _AdvApprox.SwigPyIterator_decr(self, n)

    def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
        return _AdvApprox.SwigPyIterator_distance(self, x)

    def equal(self, x: "SwigPyIterator") -> "bool":
        return _AdvApprox.SwigPyIterator_equal(self, x)

    def copy(self) -> "swig::SwigPyIterator *":
        return _AdvApprox.SwigPyIterator_copy(self)

    def next(self) -> "PyObject *":
        return _AdvApprox.SwigPyIterator_next(self)

    def __next__(self) -> "PyObject *":
        return _AdvApprox.SwigPyIterator___next__(self)

    def previous(self) -> "PyObject *":
        return _AdvApprox.SwigPyIterator_previous(self)

    def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _AdvApprox.SwigPyIterator_advance(self, n)

    def __eq__(self, x: "SwigPyIterator") -> "bool":
        return _AdvApprox.SwigPyIterator___eq__(self, x)

    def __ne__(self, x: "SwigPyIterator") -> "bool":
        return _AdvApprox.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _AdvApprox.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _AdvApprox.SwigPyIterator___isub__(self, n)

    def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _AdvApprox.SwigPyIterator___add__(self, n)

    def __sub__(self, *args) -> "ptrdiff_t":
        return _AdvApprox.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _AdvApprox:
_AdvApprox.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: "Standard_Failure", method_name: "std::string", class_name: "std::string") -> "void":
    return _AdvApprox.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.TColStd
import OCC.Core.TCollection
import OCC.Core.GeomAbs
import OCC.Core.TColgp
import OCC.Core.PLib
import OCC.Core.math
import OCC.Core.Message
import OCC.Core.OSD
import OCC.Core.gp

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



class AdvApprox_ApproxAFunction(object):
    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"""
        Constructs approximator tool. //! warning: the func should be valid reference to object of type inherited from class evaluatorfunction from approx with life time longer than that of the approximator tool; //! the result should be formatted in the following way : <--num1dss--> <--2 * num2dss--> <--3 * num3dss--> r[0] .... r[num1dss].....  r[dimension-1] //! the order in which each subspace appears should be consistent with the tolerances given in the create function and the results will be given in that order as well that is : curve2d(n) will correspond to the nth entry described by num2dss, curve(n) will correspond to the nth entry described by num3dss the same type of schema applies to the poles1d, poles2d and poles.

        Parameters
        ----------
        Num1DSS: int
        Num2DSS: int
        Num3DSS: int
        OneDTol: TColStd_HArray1OfReal
        TwoDTol: TColStd_HArray1OfReal
        ThreeDTol: TColStd_HArray1OfReal
        First: float
        Last: float
        Continuity: GeomAbs_Shape
        MaxDeg: int
        MaxSeg: int
        Func: AdvApprox_EvaluatorFunction

        Returns
        -------
        None
        Approximation with user methode of cutting.

        Parameters
        ----------
        Num1DSS: int
        Num2DSS: int
        Num3DSS: int
        OneDTol: TColStd_HArray1OfReal
        TwoDTol: TColStd_HArray1OfReal
        ThreeDTol: TColStd_HArray1OfReal
        First: float
        Last: float
        Continuity: GeomAbs_Shape
        MaxDeg: int
        MaxSeg: int
        Func: AdvApprox_EvaluatorFunction
        CutTool: AdvApprox_Cutting

        Returns
        -------
        None

        """
        _AdvApprox.AdvApprox_ApproxAFunction_swiginit(self, _AdvApprox.new_AdvApprox_ApproxAFunction(*args))

    @staticmethod
    def Approximation(*args) -> "Standard_Integer &, Standard_Integer &":
        r"""
        No available documentation.

        Parameters
        ----------
        TotalDimension: int
        TotalNumSS: int
        LocalDimension: TColStd_Array1OfInteger
        First: float
        Last: float
        Evaluator: AdvApprox_EvaluatorFunction
        CutTool: AdvApprox_Cutting
        ContinuityOrder: int
        NumMaxCoeffs: int
        MaxSegments: int
        TolerancesArray: TColStd_Array1OfReal
        code_precis: int
        NumCoeffPerCurveArray: TColStd_Array1OfInteger
        LocalCoefficientArray: TColStd_Array1OfReal
        IntervalsArray: TColStd_Array1OfReal
        ErrorMaxArray: TColStd_Array1OfReal
        AverageErrorArray: TColStd_Array1OfReal

        Returns
        -------
        NumCurves: int
        ErrorCode: int

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Approximation(*args)

    def AverageError(self, *args) -> "Standard_Real":
        r"""
        Returns the error as is in the algorithms.

        Parameters
        ----------
        Dimension: int

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfReal>
        No available documentation.

        Parameters
        ----------
        Dimension: int
        Index: int

        Returns
        -------
        float

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_AverageError(self, *args)

    def Degree(self, *args) -> "Standard_Integer":
        r"""
        No available documentation.

        Returns
        -------
        int

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Degree(self, *args)

    def DumpToString(self) -> "std::string":
        r"""DumpToString(AdvApprox_ApproxAFunction self) -> std::string"""
        return _AdvApprox.AdvApprox_ApproxAFunction_DumpToString(self)

    def HasResult(self, *args) -> "Standard_Boolean":
        r"""
        No available documentation.

        Returns
        -------
        bool

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_HasResult(self, *args)

    def IsDone(self, *args) -> "Standard_Boolean":
        r"""
        No available documentation.

        Returns
        -------
        bool

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_IsDone(self, *args)

    def Knots(self, *args) -> "opencascade::handle< TColStd_HArray1OfReal >":
        r"""
        No available documentation.

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfReal>

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Knots(self, *args)

    def MaxError(self, *args) -> "Standard_Real":
        r"""
        Returns the error as is in the algorithms.

        Parameters
        ----------
        Dimension: int

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfReal>
        No available documentation.

        Parameters
        ----------
        Dimension: int
        Index: int

        Returns
        -------
        float

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_MaxError(self, *args)

    def Multiplicities(self, *args) -> "opencascade::handle< TColStd_HArray1OfInteger >":
        r"""
        No available documentation.

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfInteger>

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Multiplicities(self, *args)

    def NbKnots(self, *args) -> "Standard_Integer":
        r"""
        No available documentation.

        Returns
        -------
        int

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_NbKnots(self, *args)

    def NbPoles(self, *args) -> "Standard_Integer":
        r"""
        As the name says.

        Returns
        -------
        int

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_NbPoles(self, *args)

    def NumSubSpaces(self, *args) -> "Standard_Integer":
        r"""
        No available documentation.

        Parameters
        ----------
        Dimension: int

        Returns
        -------
        int

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_NumSubSpaces(self, *args)

    def Poles(self, *args) -> "void":
        r"""
        -- returns the poles from the algorithms as is.

        Returns
        -------
        opencascade::handle<TColgp_HArray2OfPnt>
        Returns the poles at index from the 3d subspace.

        Parameters
        ----------
        Index: int
        P: TColgp_Array1OfPnt

        Returns
        -------
        None

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Poles(self, *args)

    def Poles1d(self, *args) -> "void":
        r"""
        Returns the poles from the algorithms as is.

        Returns
        -------
        opencascade::handle<TColStd_HArray2OfReal>
        Returns the poles at index from the 1d subspace.

        Parameters
        ----------
        Index: int
        P: TColStd_Array1OfReal

        Returns
        -------
        None

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Poles1d(self, *args)

    def Poles2d(self, *args) -> "void":
        r"""
        Returns the poles from the algorithms as is.

        Returns
        -------
        opencascade::handle<TColgp_HArray2OfPnt2d>
        Returns the poles at index from the 2d subspace.

        Parameters
        ----------
        Index: int
        P: TColgp_Array1OfPnt2d

        Returns
        -------
        None

        """
        return _AdvApprox.AdvApprox_ApproxAFunction_Poles2d(self, *args)

    __repr__ = _dumps_object

    __swig_destroy__ = _AdvApprox.delete_AdvApprox_ApproxAFunction

# Register AdvApprox_ApproxAFunction in _AdvApprox:
_AdvApprox.AdvApprox_ApproxAFunction_swigregister(AdvApprox_ApproxAFunction)

def AdvApprox_ApproxAFunction_Approximation(*args) -> "Standard_Integer &, Standard_Integer &":
    r"""
    No available documentation.

    Parameters
    ----------
    TotalDimension: int
    TotalNumSS: int
    LocalDimension: TColStd_Array1OfInteger
    First: float
    Last: float
    Evaluator: AdvApprox_EvaluatorFunction
    CutTool: AdvApprox_Cutting
    ContinuityOrder: int
    NumMaxCoeffs: int
    MaxSegments: int
    TolerancesArray: TColStd_Array1OfReal
    code_precis: int
    NumCoeffPerCurveArray: TColStd_Array1OfInteger
    LocalCoefficientArray: TColStd_Array1OfReal
    IntervalsArray: TColStd_Array1OfReal
    ErrorMaxArray: TColStd_Array1OfReal
    AverageErrorArray: TColStd_Array1OfReal

    Returns
    -------
    NumCurves: int
    ErrorCode: int

    """
    return _AdvApprox.AdvApprox_ApproxAFunction_Approximation(*args)

class AdvApprox_Cutting(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")
    __repr__ = _swig_repr

    def Value(self, *args) -> "Standard_Boolean":
        r"""
        No available documentation.

        Parameters
        ----------
        a: float
        b: float

        Returns
        -------
        cuttingvalue: float

        """
        return _AdvApprox.AdvApprox_Cutting_Value(self, *args)

    __repr__ = _dumps_object

    __swig_destroy__ = _AdvApprox.delete_AdvApprox_Cutting

# Register AdvApprox_Cutting in _AdvApprox:
_AdvApprox.AdvApprox_Cutting_swigregister(AdvApprox_Cutting)

class AdvApprox_SimpleApprox(object):
    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"""
        No available documentation.

        Parameters
        ----------
        TotalDimension: int
        TotalNumSS: int
        Continuity: GeomAbs_Shape
        WorkDegree: int
        NbGaussPoints: int
        JacobiBase: PLib_JacobiPolynomial
        Func: AdvApprox_EvaluatorFunction

        Returns
        -------
        None

        """
        _AdvApprox.AdvApprox_SimpleApprox_swiginit(self, _AdvApprox.new_AdvApprox_SimpleApprox(*args))

    def AverageError(self, *args) -> "Standard_Real":
        r"""
        No available documentation.

        Parameters
        ----------
        Index: int

        Returns
        -------
        float

        """
        return _AdvApprox.AdvApprox_SimpleApprox_AverageError(self, *args)

    def Coefficients(self, *args) -> "opencascade::handle< TColStd_HArray1OfReal >":
        r"""
        Returns the coefficients in the jacobi base.

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfReal>

        """
        return _AdvApprox.AdvApprox_SimpleApprox_Coefficients(self, *args)

    def Degree(self, *args) -> "Standard_Integer":
        r"""
        No available documentation.

        Returns
        -------
        int

        """
        return _AdvApprox.AdvApprox_SimpleApprox_Degree(self, *args)

    def DifTab(self, *args) -> "opencascade::handle< TColStd_HArray1OfReal >":
        r"""
        No available documentation.

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfReal>

        """
        return _AdvApprox.AdvApprox_SimpleApprox_DifTab(self, *args)

    def DumpToString(self) -> "std::string":
        r"""DumpToString(AdvApprox_SimpleApprox self) -> std::string"""
        return _AdvApprox.AdvApprox_SimpleApprox_DumpToString(self)

    def FirstConstr(self, *args) -> "opencascade::handle< TColStd_HArray2OfReal >":
        r"""
        Returns the constraints at first.

        Returns
        -------
        opencascade::handle<TColStd_HArray2OfReal>

        """
        return _AdvApprox.AdvApprox_SimpleApprox_FirstConstr(self, *args)

    def IsDone(self, *args) -> "Standard_Boolean":
        r"""
        No available documentation.

        Returns
        -------
        bool

        """
        return _AdvApprox.AdvApprox_SimpleApprox_IsDone(self, *args)

    def LastConstr(self, *args) -> "opencascade::handle< TColStd_HArray2OfReal >":
        r"""
        Returns the constraints at last.

        Returns
        -------
        opencascade::handle<TColStd_HArray2OfReal>

        """
        return _AdvApprox.AdvApprox_SimpleApprox_LastConstr(self, *args)

    def MaxError(self, *args) -> "Standard_Real":
        r"""
        No available documentation.

        Parameters
        ----------
        Index: int

        Returns
        -------
        float

        """
        return _AdvApprox.AdvApprox_SimpleApprox_MaxError(self, *args)

    def Perform(self, *args) -> "void":
        r"""
        Constructs approximator tool. //! warning: the func should be valid reference to object of type inherited from class evaluatorfunction from approx with life time longer than that of the approximator tool;.

        Parameters
        ----------
        LocalDimension: TColStd_Array1OfInteger
        LocalTolerancesArray: TColStd_Array1OfReal
        First: float
        Last: float
        MaxDegree: int

        Returns
        -------
        None

        """
        return _AdvApprox.AdvApprox_SimpleApprox_Perform(self, *args)

    def SomTab(self, *args) -> "opencascade::handle< TColStd_HArray1OfReal >":
        r"""
        No available documentation.

        Returns
        -------
        opencascade::handle<TColStd_HArray1OfReal>

        """
        return _AdvApprox.AdvApprox_SimpleApprox_SomTab(self, *args)

    __repr__ = _dumps_object

    __swig_destroy__ = _AdvApprox.delete_AdvApprox_SimpleApprox

# Register AdvApprox_SimpleApprox in _AdvApprox:
_AdvApprox.AdvApprox_SimpleApprox_swigregister(AdvApprox_SimpleApprox)

class AdvApprox_DichoCutting(AdvApprox_Cutting):
    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"""
        No available documentation.

        Returns
        -------
        None

        """
        _AdvApprox.AdvApprox_DichoCutting_swiginit(self, _AdvApprox.new_AdvApprox_DichoCutting(*args))

    __repr__ = _dumps_object

    __swig_destroy__ = _AdvApprox.delete_AdvApprox_DichoCutting

# Register AdvApprox_DichoCutting in _AdvApprox:
_AdvApprox.AdvApprox_DichoCutting_swigregister(AdvApprox_DichoCutting)

class AdvApprox_PrefAndRec(AdvApprox_Cutting):
    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"""
        No available documentation.

        Parameters
        ----------
        RecomendedCut: TColStd_Array1OfReal
        PrefferedCut: TColStd_Array1OfReal
        Weight: float,optional
        	default value is 5

        Returns
        -------
        None

        """
        _AdvApprox.AdvApprox_PrefAndRec_swiginit(self, _AdvApprox.new_AdvApprox_PrefAndRec(*args))

    __repr__ = _dumps_object

    __swig_destroy__ = _AdvApprox.delete_AdvApprox_PrefAndRec

# Register AdvApprox_PrefAndRec in _AdvApprox:
_AdvApprox.AdvApprox_PrefAndRec_swigregister(AdvApprox_PrefAndRec)

class AdvApprox_PrefCutting(AdvApprox_Cutting):
    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"""
        No available documentation.

        Parameters
        ----------
        CutPnts: TColStd_Array1OfReal

        Returns
        -------
        None

        """
        _AdvApprox.AdvApprox_PrefCutting_swiginit(self, _AdvApprox.new_AdvApprox_PrefCutting(*args))

    __repr__ = _dumps_object

    __swig_destroy__ = _AdvApprox.delete_AdvApprox_PrefCutting

# Register AdvApprox_PrefCutting in _AdvApprox:
_AdvApprox.AdvApprox_PrefCutting_swigregister(AdvApprox_PrefCutting)


@classnotwrapped
class AdvApprox_EvaluatorFunction:
	pass






