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

"""
RWObj module, see official documentation at
https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_rwobj.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 _RWObj
else:
    import _RWObj

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# Register SwigPyIterator in _RWObj:
_RWObj.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 _RWObj.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.Message
import OCC.Core.TCollection
import OCC.Core.OSD
import OCC.Core.TColStd
import OCC.Core.Poly
import OCC.Core.gp
import OCC.Core.TColgp
import OCC.Core.TShort
import OCC.Core.TopoDS
import OCC.Core.TopAbs
import OCC.Core.TopLoc
import OCC.Core.Graphic3d
import OCC.Core.BVH
import OCC.Core.Quantity
import OCC.Core.Aspect
import OCC.Core.Image
import OCC.Core.Bnd
import OCC.Core.Media

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

RWObj_SubMeshReason_NewObject = _RWObj.RWObj_SubMeshReason_NewObject
RWObj_SubMeshReason_NewGroup = _RWObj.RWObj_SubMeshReason_NewGroup
RWObj_SubMeshReason_NewMaterial = _RWObj.RWObj_SubMeshReason_NewMaterial
RWObj_SubMeshReason_NewSmoothGroup = _RWObj.RWObj_SubMeshReason_NewSmoothGroup


class RWObj_SubMeshReason(IntEnum):
	RWObj_SubMeshReason_NewObject = 0
	RWObj_SubMeshReason_NewGroup = 1
	RWObj_SubMeshReason_NewMaterial = 2
	RWObj_SubMeshReason_NewSmoothGroup = 3
RWObj_SubMeshReason_NewObject = RWObj_SubMeshReason.RWObj_SubMeshReason_NewObject
RWObj_SubMeshReason_NewGroup = RWObj_SubMeshReason.RWObj_SubMeshReason_NewGroup
RWObj_SubMeshReason_NewMaterial = RWObj_SubMeshReason.RWObj_SubMeshReason_NewMaterial
RWObj_SubMeshReason_NewSmoothGroup = RWObj_SubMeshReason.RWObj_SubMeshReason_NewSmoothGroup


def Handle_RWObj_Reader_Create() -> "opencascade::handle< RWObj_Reader >":
    return _RWObj.Handle_RWObj_Reader_Create()

def Handle_RWObj_Reader_DownCast(t: "opencascade::handle< Standard_Transient > const &") -> "opencascade::handle< RWObj_Reader >":
    return _RWObj.Handle_RWObj_Reader_DownCast(t)

def Handle_RWObj_Reader_IsNull(t: "opencascade::handle< RWObj_Reader > const &") -> "bool":
    return _RWObj.Handle_RWObj_Reader_IsNull(t)

def Handle_RWObj_TriangulationReader_Create() -> "opencascade::handle< RWObj_TriangulationReader >":
    return _RWObj.Handle_RWObj_TriangulationReader_Create()

def Handle_RWObj_TriangulationReader_DownCast(t: "opencascade::handle< Standard_Transient > const &") -> "opencascade::handle< RWObj_TriangulationReader >":
    return _RWObj.Handle_RWObj_TriangulationReader_DownCast(t)

def Handle_RWObj_TriangulationReader_IsNull(t: "opencascade::handle< RWObj_TriangulationReader > const &") -> "bool":
    return _RWObj.Handle_RWObj_TriangulationReader_IsNull(t)
class rwobj(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    @staticmethod
    def ReadFile(*args) -> "opencascade::handle< Poly_Triangulation >":
        r"""
        Read specified obj file and returns its content as triangulation. in case of error, returns null handle.

        Parameters
        ----------
        theFile: char *
        aProgress: Message_ProgressRange,optional
        	default value is Message_ProgressRange()

        Returns
        -------
        opencascade::handle<Poly_Triangulation>

        """
        return _RWObj.rwobj_ReadFile(*args)

    __repr__ = _dumps_object


    def __init__(self):
        _RWObj.rwobj_swiginit(self, _RWObj.new_rwobj())
    __swig_destroy__ = _RWObj.delete_rwobj

# Register rwobj in _RWObj:
_RWObj.rwobj_swigregister(rwobj)

def rwobj_ReadFile(*args) -> "opencascade::handle< Poly_Triangulation >":
    r"""
    Read specified obj file and returns its content as triangulation. in case of error, returns null handle.

    Parameters
    ----------
    theFile: char *
    aProgress: Message_ProgressRange,optional
    	default value is Message_ProgressRange()

    Returns
    -------
    opencascade::handle<Poly_Triangulation>

    """
    return _RWObj.rwobj_ReadFile(*args)

class RWObj_IShapeReceiver(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 BindNamedShape(self, *args) -> "void":
        r"""
        @param theshape shape to register @param thename shape name @param thematerial shape material @param theisrootshape indicates that this is a root object (free shape).

        Parameters
        ----------
        theShape: TopoDS_Shape
        theName: TCollection_AsciiString
        theMaterial: RWObj_Material *
        theIsRootShape: bool

        Returns
        -------
        None

        """
        return _RWObj.RWObj_IShapeReceiver_BindNamedShape(self, *args)

    __repr__ = _dumps_object

    __swig_destroy__ = _RWObj.delete_RWObj_IShapeReceiver

# Register RWObj_IShapeReceiver in _RWObj:
_RWObj.RWObj_IShapeReceiver_swigregister(RWObj_IShapeReceiver)

class RWObj_Material(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    Name = property(_RWObj.RWObj_Material_Name_get, _RWObj.RWObj_Material_Name_set)
    DiffuseTexture = property(_RWObj.RWObj_Material_DiffuseTexture_get, _RWObj.RWObj_Material_DiffuseTexture_set)
    SpecularTexture = property(_RWObj.RWObj_Material_SpecularTexture_get, _RWObj.RWObj_Material_SpecularTexture_set)
    BumpTexture = property(_RWObj.RWObj_Material_BumpTexture_get, _RWObj.RWObj_Material_BumpTexture_set)
    AmbientColor = property(_RWObj.RWObj_Material_AmbientColor_get, _RWObj.RWObj_Material_AmbientColor_set)
    DiffuseColor = property(_RWObj.RWObj_Material_DiffuseColor_get, _RWObj.RWObj_Material_DiffuseColor_set)
    SpecularColor = property(_RWObj.RWObj_Material_SpecularColor_get, _RWObj.RWObj_Material_SpecularColor_set)
    Shininess = property(_RWObj.RWObj_Material_Shininess_get, _RWObj.RWObj_Material_Shininess_set)
    Transparency = property(_RWObj.RWObj_Material_Transparency_get, _RWObj.RWObj_Material_Transparency_set)

    def __init__(self, *args):
        r"""
        No available documentation.

        Returns
        -------
        None

        """
        _RWObj.RWObj_Material_swiginit(self, _RWObj.new_RWObj_Material(*args))

    __repr__ = _dumps_object

    __swig_destroy__ = _RWObj.delete_RWObj_Material

# Register RWObj_Material in _RWObj:
_RWObj.RWObj_Material_swigregister(RWObj_Material)

class RWObj_Reader(OCC.Core.Standard.Standard_Transient):
    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 ExternalFiles(self, *args) -> "NCollection_IndexedMap< TCollection_AsciiString > const &":
        r"""
        Return the list of external file references.

        Returns
        -------
        NCollection_IndexedMap<TCollection_AsciiString>

        """
        return _RWObj.RWObj_Reader_ExternalFiles(self, *args)

    def FileComments(self, *args) -> "TCollection_AsciiString const &":
        r"""
        Returns file comments (lines starting with # at the beginning of file).

        Returns
        -------
        TCollection_AsciiString

        """
        return _RWObj.RWObj_Reader_FileComments(self, *args)

    def IsSinglePrecision(self, *args) -> "Standard_Boolean":
        r"""
        Return single precision flag for reading vertex data (coordinates); false by default.

        Returns
        -------
        bool

        """
        return _RWObj.RWObj_Reader_IsSinglePrecision(self, *args)

    def MemoryLimit(self, *args) -> "Standard_Size":
        r"""
        Returns memory limit in bytes; -1 (no limit) by default.

        Returns
        -------
        Standard_Size

        """
        return _RWObj.RWObj_Reader_MemoryLimit(self, *args)

    def NbProbeElems(self, *args) -> "Standard_Integer":
        r"""
        //!< number of probed polygon elements (of unknown size).

        Returns
        -------
        int

        """
        return _RWObj.RWObj_Reader_NbProbeElems(self, *args)

    def NbProbeNodes(self, *args) -> "Standard_Integer":
        r"""
        Number of probed nodes.

        Returns
        -------
        int

        """
        return _RWObj.RWObj_Reader_NbProbeNodes(self, *args)

    def Probe(self, *args) -> "Standard_Boolean":
        r"""
        Probe data from obj file (comments, external references) without actually reading mesh data. although mesh data will not be collected, the full file content will be parsed, due to obj format limitations. @param thefile path to the file @param theprogress progress indicator returns true if success, false on error or user break. @sa filecomments(), externalfiles(), nbprobenodes(), nbprobeelems().

        Parameters
        ----------
        theFile: TCollection_AsciiString
        theProgress: Message_ProgressRange

        Returns
        -------
        bool

        """
        return _RWObj.RWObj_Reader_Probe(self, *args)

    def Read(self, *args) -> "Standard_Boolean":
        r"""
        Reads data from obj file. unicode paths can be given in utf-8 encoding. returns true if success, false on error or user break.

        Parameters
        ----------
        theFile: TCollection_AsciiString
        theProgress: Message_ProgressRange

        Returns
        -------
        bool

        """
        return _RWObj.RWObj_Reader_Read(self, *args)

    def SetMemoryLimit(self, *args) -> "void":
        r"""
        Specify memory limit in bytes, so that import will be aborted by specified limit before memory allocation error occurs.

        Parameters
        ----------
        theMemLimit: Standard_Size

        Returns
        -------
        None

        """
        return _RWObj.RWObj_Reader_SetMemoryLimit(self, *args)

    def SetSinglePrecision(self, *args) -> "void":
        r"""
        Setup single/double precision flag for reading vertex data (coordinates).

        Parameters
        ----------
        theIsSinglePrecision: bool

        Returns
        -------
        None

        """
        return _RWObj.RWObj_Reader_SetSinglePrecision(self, *args)

    def SetTransformation(self, *args) -> "void":
        r"""
        Setup transformation from one coordinate system to another. obj file might be exported following various coordinate system conventions, so that it might be useful automatically transform data during file reading.

        Parameters
        ----------
        theCSConverter: RWMesh_CoordinateSystemConverter

        Returns
        -------
        None

        """
        return _RWObj.RWObj_Reader_SetTransformation(self, *args)

    def Transformation(self, *args) -> "RWMesh_CoordinateSystemConverter const &":
        r"""
        Return transformation from one coordinate system to another; no transformation by default.

        Returns
        -------
        RWMesh_CoordinateSystemConverter

        """
        return _RWObj.RWObj_Reader_Transformation(self, *args)


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


    __repr__ = _dumps_object

    __swig_destroy__ = _RWObj.delete_RWObj_Reader

# Register RWObj_Reader in _RWObj:
_RWObj.RWObj_Reader_swigregister(RWObj_Reader)

class RWObj_SubMesh(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    Object = property(_RWObj.RWObj_SubMesh_Object_get, _RWObj.RWObj_SubMesh_Object_set)
    Group = property(_RWObj.RWObj_SubMesh_Group_get, _RWObj.RWObj_SubMesh_Group_set)
    SmoothGroup = property(_RWObj.RWObj_SubMesh_SmoothGroup_get, _RWObj.RWObj_SubMesh_SmoothGroup_set)
    Material = property(_RWObj.RWObj_SubMesh_Material_get, _RWObj.RWObj_SubMesh_Material_set)

    __repr__ = _dumps_object


    def __init__(self):
        _RWObj.RWObj_SubMesh_swiginit(self, _RWObj.new_RWObj_SubMesh())
    __swig_destroy__ = _RWObj.delete_RWObj_SubMesh

# Register RWObj_SubMesh in _RWObj:
_RWObj.RWObj_SubMesh_swigregister(RWObj_SubMesh)

class RWObj_CafReader(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"""
        Empty constructor.

        Returns
        -------
        None

        """
        _RWObj.RWObj_CafReader_swiginit(self, _RWObj.new_RWObj_CafReader(*args))

    def IsSinglePrecision(self, *args) -> "Standard_Boolean":
        r"""
        Return single precision flag for reading vertex data (coordinates); false by default.

        Returns
        -------
        bool

        """
        return _RWObj.RWObj_CafReader_IsSinglePrecision(self, *args)

    def SetSinglePrecision(self, *args) -> "void":
        r"""
        Setup single/double precision flag for reading vertex data (coordinates).

        Parameters
        ----------
        theIsSinglePrecision: bool

        Returns
        -------
        None

        """
        return _RWObj.RWObj_CafReader_SetSinglePrecision(self, *args)

    __repr__ = _dumps_object

    __swig_destroy__ = _RWObj.delete_RWObj_CafReader

# Register RWObj_CafReader in _RWObj:
_RWObj.RWObj_CafReader_swigregister(RWObj_CafReader)

class RWObj_TriangulationReader(RWObj_Reader):
    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"""
        Constructor.

        Returns
        -------
        None

        """
        _RWObj.RWObj_TriangulationReader_swiginit(self, _RWObj.new_RWObj_TriangulationReader(*args))

    def GetTriangulation(self, *args) -> "opencascade::handle< Poly_Triangulation >":
        r"""
        Create poly_triangulation from collected data.

        Returns
        -------
        opencascade::handle<Poly_Triangulation>

        """
        return _RWObj.RWObj_TriangulationReader_GetTriangulation(self, *args)

    def ResultShape(self, *args) -> "TopoDS_Shape":
        r"""
        Return result shape.

        Returns
        -------
        TopoDS_Shape

        """
        return _RWObj.RWObj_TriangulationReader_ResultShape(self, *args)

    def SetCreateShapes(self, *args) -> "void":
        r"""
        Set flag to create shapes.

        Parameters
        ----------
        theToCreateShapes: bool

        Returns
        -------
        None

        """
        return _RWObj.RWObj_TriangulationReader_SetCreateShapes(self, *args)

    def SetShapeReceiver(self, *args) -> "void":
        r"""
        Set shape receiver callback.

        Parameters
        ----------
        theReceiver: RWObj_IShapeReceiver *

        Returns
        -------
        None

        """
        return _RWObj.RWObj_TriangulationReader_SetShapeReceiver(self, *args)


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


    __repr__ = _dumps_object

    __swig_destroy__ = _RWObj.delete_RWObj_TriangulationReader

# Register RWObj_TriangulationReader in _RWObj:
_RWObj.RWObj_TriangulationReader_swigregister(RWObj_TriangulationReader)


@classnotwrapped
class RWObj_MtlReader:
	pass






