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

"""
ShapeConstruct module, see official documentation at
https://www.opencascade.com/doc/occt-7.7.0/refman/html/package_shapeconstruct.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 _ShapeConstruct
else:
    import _ShapeConstruct

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# Register SwigPyIterator in _ShapeConstruct:
_ShapeConstruct.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 _ShapeConstruct.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.Geom
import OCC.Core.gp
import OCC.Core.TColStd
import OCC.Core.TCollection
import OCC.Core.GeomAbs
import OCC.Core.TColgp
import OCC.Core.Geom2d
import OCC.Core.TopAbs
import OCC.Core.TopTools
import OCC.Core.TopoDS
import OCC.Core.Message
import OCC.Core.OSD
import OCC.Core.TopLoc
import OCC.Core.BRepBuilderAPI
import OCC.Core.BRepTools
import OCC.Core.Bnd
import OCC.Core.BVH
import OCC.Core.BRep
import OCC.Core.Poly
import OCC.Core.TShort
import OCC.Core.ShapeAnalysis
import OCC.Core.ShapeExtend
import OCC.Core.TColGeom
import OCC.Core.Adaptor3d
import OCC.Core.Adaptor2d
import OCC.Core.math
import OCC.Core.GeomAdaptor
import OCC.Core.IntRes2d

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




def Handle_ShapeConstruct_ProjectCurveOnSurface_Create():
    return _ShapeConstruct.Handle_ShapeConstruct_ProjectCurveOnSurface_Create()

def Handle_ShapeConstruct_ProjectCurveOnSurface_DownCast(t):
    return _ShapeConstruct.Handle_ShapeConstruct_ProjectCurveOnSurface_DownCast(t)

def Handle_ShapeConstruct_ProjectCurveOnSurface_IsNull(t):
    return _ShapeConstruct.Handle_ShapeConstruct_ProjectCurveOnSurface_IsNull(t)
class shapeconstruct(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    @staticmethod
    def ConvertCurveToBSpline(*args):
        r"""

        Parameters
        ----------
        C3D: Geom_Curve
        First: float
        Last: float
        Tol3d: float
        Continuity: GeomAbs_Shape
        MaxSegments: int
        MaxDegree: int

        Return
        -------
        opencascade::handle<Geom_BSplineCurve>

        Description
        -----------
        Tool for wire triangulation.

        Parameters
        ----------
        C2D: Geom2d_Curve
        First: float
        Last: float
        Tol2d: float
        Continuity: GeomAbs_Shape
        MaxSegments: int
        MaxDegree: int

        Return
        -------
        opencascade::handle<Geom2d_BSplineCurve>

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

        """
        return _ShapeConstruct.shapeconstruct_ConvertCurveToBSpline(*args)

    @staticmethod
    def ConvertSurfaceToBSpline(*args):
        r"""

        Parameters
        ----------
        surf: Geom_Surface
        UF: float
        UL: float
        VF: float
        VL: float
        Tol3d: float
        Continuity: GeomAbs_Shape
        MaxSegments: int
        MaxDegree: int

        Return
        -------
        opencascade::handle<Geom_BSplineSurface>

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

        """
        return _ShapeConstruct.shapeconstruct_ConvertSurfaceToBSpline(*args)

    @staticmethod
    def JoinCurves(*args):
        r"""

        Parameters
        ----------
        c3d1: Geom_Curve
        ac3d2: Geom_Curve
        Orient1: TopAbs_Orientation
        Orient2: TopAbs_Orientation
        c3dOut: Geom_Curve

        Return
        -------
        first1: float
        last1: float
        first2: float
        last2: float
        isRev1: bool
        isRev2: bool

        Description
        -----------
        Method for joininig curves 3d. parameters: c3d1,ac3d2 - initial curves orient1, orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dout - result curve isrev1,isrev2 - out parameters indicative on possible errors. return value: true - if curves were joined successfully, else - false.

        Parameters
        ----------
        c2d1: Geom2d_Curve
        ac2d2: Geom2d_Curve
        Orient1: TopAbs_Orientation
        Orient2: TopAbs_Orientation
        c2dOut: Geom2d_Curve
        isError: bool (optional, default to Standard_False)

        Return
        -------
        first1: float
        last1: float
        first2: float
        last2: float
        isRev1: bool
        isRev2: bool

        Description
        -----------
        Method for joininig curves 3d. parameters: c3d1,ac3d2 - initial curves orient1, orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dout - result curve isrev1,isrev2 - out parameters indicative on possible errors. iserror - input parameter indicative possible errors due to that one from edges have one vertex return value: true - if curves were joined successfully, else - false.

        """
        return _ShapeConstruct.shapeconstruct_JoinCurves(*args)

    @staticmethod
    def JoinPCurves(*args):
        r"""

        Parameters
        ----------
        theEdges: TopTools_HSequenceOfShape
        theFace: TopoDS_Face
        theEdge: TopoDS_Edge

        Return
        -------
        bool

        Description
        -----------
        Join pcurves of the <theedge> on the <theface> try to use pcurves from originas edges <theedges> returns false if cannot join pcurves.

        """
        return _ShapeConstruct.shapeconstruct_JoinPCurves(*args)

    __repr__ = _dumps_object


    def __init__(self):
        _ShapeConstruct.shapeconstruct_swiginit(self, _ShapeConstruct.new_shapeconstruct())
    __swig_destroy__ = _ShapeConstruct.delete_shapeconstruct

# Register shapeconstruct in _ShapeConstruct:
_ShapeConstruct.shapeconstruct_swigregister(shapeconstruct)
class ShapeConstruct_Curve(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

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

        Parameters
        ----------
        C3D: Geom_Curve
        P1: gp_Pnt
        P2: gp_Pnt
        take1: bool (optional, default to Standard_True)
        take2: bool (optional, default to Standard_True)

        Return
        -------
        bool

        Description
        -----------
        Modifies a curve in order to make its bounds confused with given points. works only on lines and b-splines, returns true in this case, else returns false. for line considers both bounding points, for b-splines only specified. //! warning: does not check if curve should be reversed.

        """
        return _ShapeConstruct.ShapeConstruct_Curve_AdjustCurve(self, *args)

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

        Parameters
        ----------
        C2D: Geom2d_Curve
        P1: gp_Pnt2d
        P2: gp_Pnt2d
        take1: bool (optional, default to Standard_True)
        take2: bool (optional, default to Standard_True)

        Return
        -------
        bool

        Description
        -----------
        Modifies a curve in order to make its bounds confused with given points. works only on lines and b-splines, returns true in this case, else returns false. //! for line considers both bounding points, for b-splines only specified. //! warning: does not check if curve should be reversed.

        """
        return _ShapeConstruct.ShapeConstruct_Curve_AdjustCurve2d(self, *args)

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

        Parameters
        ----------
        C3D: Geom_Curve
        P1: gp_Pnt
        P2: gp_Pnt
        U1: float
        U2: float

        Return
        -------
        bool

        Description
        -----------
        Modifies a curve in order to make its bounds confused with given points. works only on lines and b-splines. //! for lines works as previous method, b-splines are segmented at the given values and then are adjusted to the points.

        """
        return _ShapeConstruct.ShapeConstruct_Curve_AdjustCurveSegment(self, *args)

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

        Parameters
        ----------
        C: Geom_Curve
        first: float
        last: float
        prec: float

        Return
        -------
        opencascade::handle<Geom_BSplineCurve>

        Description
        -----------
        Converts a curve of any type (only part from first to last) to bspline. the method of conversion depends on the type of original curve: bspline -> c.segment(first,last) bezier and line -> geomconvert::curvetobsplinecurve(c).segment(first,last) conic and other -> approx_curve3d(c[first,last],prec,c1,9,1000).

        Parameters
        ----------
        C: Geom2d_Curve
        first: float
        last: float
        prec: float

        Return
        -------
        opencascade::handle<Geom2d_BSplineCurve>

        Description
        -----------
        Converts a curve of any type (only part from first to last) to bspline. the method of conversion depends on the type of original curve: bspline -> c.segment(first,last) bezier and line -> geomconvert::curvetobsplinecurve(c).segment(first,last) conic and other -> approx_curve2d(c[first,last],prec,c1,9,1000).

        """
        return _ShapeConstruct.ShapeConstruct_Curve_ConvertToBSpline(self, *args)

    @staticmethod
    def FixKnots(*args):
        r"""

        Parameters
        ----------
        knots: TColStd_HArray1OfReal

        Return
        -------
        bool

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

        Parameters
        ----------
        knots: TColStd_Array1OfReal

        Return
        -------
        bool

        Description
        -----------
        Fix bspline knots to ensure that there is enough gap between neighbouring values returns true if something fixed (by shifting knot).

        """
        return _ShapeConstruct.ShapeConstruct_Curve_FixKnots(*args)

    __repr__ = _dumps_object


    def __init__(self):
        _ShapeConstruct.ShapeConstruct_Curve_swiginit(self, _ShapeConstruct.new_ShapeConstruct_Curve())
    __swig_destroy__ = _ShapeConstruct.delete_ShapeConstruct_Curve

# Register ShapeConstruct_Curve in _ShapeConstruct:
_ShapeConstruct.ShapeConstruct_Curve_swigregister(ShapeConstruct_Curve)
class ShapeConstruct_MakeTriangulation(OCC.Core.BRepBuilderAPI.BRepBuilderAPI_MakeShape):
    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"""

        Parameters
        ----------
        pnts: TColgp_Array1OfPnt
        prec: float (optional, default to 0.0)

        Return
        -------
        None

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

        Parameters
        ----------
        wire: TopoDS_Wire
        prec: float (optional, default to 0.0)

        Return
        -------
        None

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

        """
        _ShapeConstruct.ShapeConstruct_MakeTriangulation_swiginit(self, _ShapeConstruct.new_ShapeConstruct_MakeTriangulation(*args))

    __repr__ = _dumps_object

    __swig_destroy__ = _ShapeConstruct.delete_ShapeConstruct_MakeTriangulation

# Register ShapeConstruct_MakeTriangulation in _ShapeConstruct:
_ShapeConstruct.ShapeConstruct_MakeTriangulation_swigregister(ShapeConstruct_MakeTriangulation)
class ShapeConstruct_ProjectCurveOnSurface(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 __init__(self, *args):
        r"""
        Return
        -------
        None

        Description
        -----------
        Empty constructor.

        """
        _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_swiginit(self, _ShapeConstruct.new_ShapeConstruct_ProjectCurveOnSurface(*args))

    def GetAdjustOverDegenMode(self):
        r"""GetAdjustOverDegenMode(ShapeConstruct_ProjectCurveOnSurface self) -> Standard_Integer"""
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_GetAdjustOverDegenMode(self)

    def SetAdjustOverDegenMode(self, value):
        r"""SetAdjustOverDegenMode(ShapeConstruct_ProjectCurveOnSurface self, Standard_Integer value)"""
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_SetAdjustOverDegenMode(self, value)

    def GetBuildCurveMode(self):
        r"""GetBuildCurveMode(ShapeConstruct_ProjectCurveOnSurface self) -> Standard_Boolean"""
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_GetBuildCurveMode(self)

    def SetBuildCurveMode(self, value):
        r"""SetBuildCurveMode(ShapeConstruct_ProjectCurveOnSurface self, Standard_Boolean value)"""
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_SetBuildCurveMode(self, value)

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

        Parameters
        ----------
        surf: Geom_Surface
        preci: float

        Return
        -------
        None

        Description
        -----------
        Initializes the object with all necessary parameters, i.e. surface and precision.

        Parameters
        ----------
        surf: ShapeAnalysis_Surface
        preci: float

        Return
        -------
        None

        Description
        -----------
        Initializes the object with all necessary parameters, i.e. surface and precision.

        """
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_Init(self, *args)

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

        Parameters
        ----------
        c3d: Geom_Curve
        First: float
        Last: float
        c2d: Geom2d_Curve
        TolFirst: float (optional, default to -1)
        TolLast: float (optional, default to -1)

        Return
        -------
        bool

        Description
        -----------
        Computes the projection of 3d curve onto a surface using the specialized algorithm. returns false if projector fails, otherwise, if pcurve computed successfully, returns true. the output curve 2d is guaranteed to be same-parameter with input curve 3d on the interval [first, last]. if the output curve lies on a direct line the infinite line is returned, in the case same-parameter condition is satisfied. tolfirst and tollast are the tolerances at the ends of input curve 3d.

        """
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_Perform(self, *args)

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

        Parameters
        ----------
        c3d: Geom_Curve
        First: float
        Last: float
        c2d: Geom2d_Curve
        continuity: GeomAbs_Shape (optional, default to GeomAbs_C1)
        maxdeg: int (optional, default to 12)
        nbinterval: int (optional, default to -1)

        Return
        -------
        bool

        Description
        -----------
        Computes the projection of 3d curve onto a surface using the standard algorithm from projlib. returns false if standard projector fails or raises an exception or cuts the curve by parametrical bounds of the surface. else, if pcurve computed successfully, returns true. the continuity, maxdeg and nbinterval are parameters of call to approx_curveonsurface. if nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface.

        """
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_PerformByProjLib(self, *args)

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

        Parameters
        ----------
        preci: float

        Return
        -------
        None

        Description
        -----------
        Sets value for current precision.

        """
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_SetPrecision(self, *args)

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

        Parameters
        ----------
        surf: Geom_Surface

        Return
        -------
        None

        Description
        -----------
        Loads a surface (in the form of geom_surface) to project on.

        Parameters
        ----------
        surf: ShapeAnalysis_Surface

        Return
        -------
        None

        Description
        -----------
        Loads a surface (in the form of shapeanalysis_surface) to project on.

        """
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_SetSurface(self, *args)

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

        Parameters
        ----------
        theStatus: ShapeExtend_Status

        Return
        -------
        bool

        Description
        -----------
        Returns the status of last perform.

        """
        return _ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_Status(self, *args)


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


    __repr__ = _dumps_object

    __swig_destroy__ = _ShapeConstruct.delete_ShapeConstruct_ProjectCurveOnSurface

# Register ShapeConstruct_ProjectCurveOnSurface in _ShapeConstruct:
_ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface_swigregister(ShapeConstruct_ProjectCurveOnSurface)



@deprecated
def shapeconstruct_ConvertCurveToBSpline(*args):
	return shapeconstruct.ConvertCurveToBSpline(*args)

@deprecated
def shapeconstruct_ConvertCurveToBSpline(*args):
	return shapeconstruct.ConvertCurveToBSpline(*args)

@deprecated
def shapeconstruct_ConvertSurfaceToBSpline(*args):
	return shapeconstruct.ConvertSurfaceToBSpline(*args)

@deprecated
def shapeconstruct_JoinCurves(*args):
	return shapeconstruct.JoinCurves(*args)

@deprecated
def shapeconstruct_JoinCurves(*args):
	return shapeconstruct.JoinCurves(*args)

@deprecated
def shapeconstruct_JoinPCurves(*args):
	return shapeconstruct.JoinPCurves(*args)

@deprecated
def ShapeConstruct_Curve_FixKnots(*args):
	return ShapeConstruct_Curve.FixKnots(*args)

@deprecated
def ShapeConstruct_Curve_FixKnots(*args):
	return ShapeConstruct_Curve.FixKnots(*args)



