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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# Register SwigPyIterator in _partio:
_partio.SwigPyIterator_swigregister(SwigPyIterator)
NONE = _partio.NONE
VECTOR = _partio.VECTOR
FLOAT = _partio.FLOAT
INT = _partio.INT
INDEXEDSTR = _partio.INDEXEDSTR
class ParticleAttribute(object):
    r"""A handle for operating on attribbutes of a particle set"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    type = property(_partio.ParticleAttribute_type_get, _partio.ParticleAttribute_type_set, doc=r"""Type of the particle data (VECTOR,INT,FLOAT)""")
    count = property(_partio.ParticleAttribute_count_get, _partio.ParticleAttribute_count_set, doc=r"""Number of primitives (int's or float's)""")
    name = property(_partio.ParticleAttribute_name_get, _partio.ParticleAttribute_name_set, doc=r"""Attribute name""")

    def __init__(self):
        r"""
        __init__(ParticleAttribute self) -> ParticleAttribute
        Attribute name
        """
        _partio.ParticleAttribute_swiginit(self, _partio.new_ParticleAttribute())
    __swig_destroy__ = _partio.delete_ParticleAttribute

# Register ParticleAttribute in _partio:
_partio.ParticleAttribute_swigregister(ParticleAttribute)
class FixedAttribute(object):
    r"""A handle for operating on fixed attribbutes of a particle set"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    type = property(_partio.FixedAttribute_type_get, _partio.FixedAttribute_type_set, doc=r"""Type of the particle data (VECTOR,INT,FLOAT)""")
    count = property(_partio.FixedAttribute_count_get, _partio.FixedAttribute_count_set, doc=r"""Number of primitives (int's or float's)""")
    name = property(_partio.FixedAttribute_name_get, _partio.FixedAttribute_name_set, doc=r"""Attribute name""")

    def __init__(self):
        r"""
        __init__(FixedAttribute self) -> FixedAttribute
        Attribute name
        """
        _partio.FixedAttribute_swiginit(self, _partio.new_FixedAttribute())
    __swig_destroy__ = _partio.delete_FixedAttribute

# Register FixedAttribute in _partio:
_partio.FixedAttribute_swigregister(FixedAttribute)
class ParticlesInfo(object):
    r"""A set of particles with associated data attributes."""

    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

    def numParticles(self):
        r"""
        numParticles(ParticlesInfo self) -> int
        Returns the number of particles in the set
        """
        return _partio.ParticlesInfo_numParticles(self)

    def numAttributes(self):
        r"""
        numAttributes(ParticlesInfo self) -> int
        Returns the number of particles in the set
        """
        return _partio.ParticlesInfo_numAttributes(self)

    def numFixedAttributes(self):
        r"""
        numFixedAttributes(ParticlesInfo self) -> int
        Returns the number of fixed attributes
        """
        return _partio.ParticlesInfo_numFixedAttributes(self)

    def attributeInfo(self, *args):
        r"""
        attributeInfo(ParticlesInfo self, char const * name) -> ParticleAttribute
        attributeInfo(ParticlesInfo self, int const index) -> ParticleAttribute
        Returns the attribute handle by index
        """
        return _partio.ParticlesInfo_attributeInfo(self, *args)

    def fixedAttributeInfo(self, *args):
        r"""
        fixedAttributeInfo(ParticlesInfo self, char const * name) -> FixedAttribute
        fixedAttributeInfo(ParticlesInfo self, int const index) -> FixedAttribute
        Returns the fixed attribute handle by index
        """
        return _partio.ParticlesInfo_fixedAttributeInfo(self, *args)
    __swig_destroy__ = _partio.delete_ParticlesInfo

# Register ParticlesInfo in _partio:
_partio.ParticlesInfo_swigregister(ParticlesInfo)
class ParticlesData(ParticlesInfo):
    r"""A reader for a set of particles."""

    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

    def lookupIndexedStr(self, attribute, str):
        r"""
        lookupIndexedStr(ParticlesData self, ParticleAttribute attribute, char const * str) -> int
        Looks up a given indexed string given the index, returns -1 if not found
        """
        return _partio.ParticlesData_lookupIndexedStr(self, attribute, str)

    def lookupFixedIndexedStr(self, attribute, str):
        r"""
        lookupFixedIndexedStr(ParticlesData self, FixedAttribute attribute, char const * str) -> int
        Looks up a given fixed indexed string given the index, returns -1 if not found
        """
        return _partio.ParticlesData_lookupFixedIndexedStr(self, attribute, str)

    def findNPoints(self, center, nPoints, maxRadius):
        r"""
        findNPoints(ParticlesData self, fixedFloatArray center, int nPoints, float maxRadius) -> PyObject *
        Searches for the N nearest points to the center location
        or as many as can be found within maxRadius distance.
        """
        return _partio.ParticlesData_findNPoints(self, center, nPoints, maxRadius)

    def findPoints(self, bboxMin, bboxMax):
        r"""
        findPoints(ParticlesData self, fixedFloatArray bboxMin, fixedFloatArray bboxMax) -> PyObject *
        Returns the indices of all points within the bounding
        box defined by the two cube corners bboxMin and bboxMax
        """
        return _partio.ParticlesData_findPoints(self, bboxMin, bboxMax)

    def get(self, attr, particleIndex):
        r"""
        get(ParticlesData self, ParticleAttribute attr, ParticleIndex const particleIndex) -> PyObject *
        Gets attribute data for particleIndex'th particle
        """
        return _partio.ParticlesData_get(self, attr, particleIndex)

    def getFixed(self, attr):
        r"""
        getFixed(ParticlesData self, FixedAttribute attr) -> PyObject *
        Gets fixed attribute data
        """
        return _partio.ParticlesData_getFixed(self, attr)

    def indexedStrs(self, attr):
        r"""
        indexedStrs(ParticlesData self, ParticleAttribute attr) -> PyObject *
        Gets a list of all indexed strings for the given attribute handle
        """
        return _partio.ParticlesData_indexedStrs(self, attr)

    def fixedIndexedStrs(self, attr):
        r"""
        fixedIndexedStrs(ParticlesData self, FixedAttribute attr) -> PyObject *
        Gets a list of all indexed strings for the given fixed attribute handle
        """
        return _partio.ParticlesData_fixedIndexedStrs(self, attr)
    __swig_destroy__ = _partio.delete_ParticlesData

# Register ParticlesData in _partio:
_partio.ParticlesData_swigregister(ParticlesData)
class ParticleIteratorTrue(object):
    r"""A reader for a set of particles."""

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

    def __init__(self):
        r"""
        __init__(ParticleIteratorTrue self) -> ParticleIteratorTrue
        Return string name of given attribute type
        """
        _partio.ParticleIteratorTrue_swiginit(self, _partio.new_ParticleIteratorTrue())
    __swig_destroy__ = _partio.delete_ParticleIteratorTrue

# Register ParticleIteratorTrue in _partio:
_partio.ParticleIteratorTrue_swigregister(ParticleIteratorTrue)
class ParticleIteratorFalse(object):
    r"""A reader for a set of particles."""

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

    def __init__(self):
        r"""
        __init__(ParticleIteratorFalse self) -> ParticleIteratorFalse
        Return string name of given attribute type
        """
        _partio.ParticleIteratorFalse_swiginit(self, _partio.new_ParticleIteratorFalse())
    __swig_destroy__ = _partio.delete_ParticleIteratorFalse

# Register ParticleIteratorFalse in _partio:
_partio.ParticleIteratorFalse_swigregister(ParticleIteratorFalse)
class ParticlesDataMutable(ParticlesData):
    r"""A writer for a set of particles."""

    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

    def registerIndexedStr(self, attribute, str):
        r"""
        registerIndexedStr(ParticlesDataMutable self, ParticleAttribute attribute, char const * str) -> int
        Registers a string in the particular attribute
        """
        return _partio.ParticlesDataMutable_registerIndexedStr(self, attribute, str)

    def registerFixedIndexedStr(self, attribute, str):
        r"""
        registerFixedIndexedStr(ParticlesDataMutable self, FixedAttribute attribute, char const * str) -> int
        Registers a string in the particular fixed attribute
        """
        return _partio.ParticlesDataMutable_registerFixedIndexedStr(self, attribute, str)

    def setIndexedStr(self, attribute, particleAttributeHandle, str):
        r"""
        setIndexedStr(ParticlesDataMutable self, ParticleAttribute attribute, int particleAttributeHandle, char const * str)
        Changes a given index's associated string (for all particles that use this index too)
        """
        return _partio.ParticlesDataMutable_setIndexedStr(self, attribute, particleAttributeHandle, str)

    def setFixedIndexedStr(self, attribute, particleAttributeHandle, str):
        r"""
        setFixedIndexedStr(ParticlesDataMutable self, FixedAttribute attribute, int particleAttributeHandle, char const * str)
        Changes a given fixed index's associated string
        """
        return _partio.ParticlesDataMutable_setFixedIndexedStr(self, attribute, particleAttributeHandle, str)

    def sort(self):
        r"""
        sort(ParticlesDataMutable self)
        Prepares data for N nearest neighbor searches using the
        attribute in the file with name 'position'
        """
        return _partio.ParticlesDataMutable_sort(self)

    def addAttribute(self, attribute, type, count):
        r"""
        addAttribute(ParticlesDataMutable self, char const * attribute, ParticleAttributeType type, int const count) -> ParticleAttribute
        Adds a new attribute of given name, type and count. If type is
        partio.VECTOR, then count must be 3
        """
        return _partio.ParticlesDataMutable_addAttribute(self, attribute, type, count)

    def addFixedAttribute(self, attribute, type, count):
        r"""
        addFixedAttribute(ParticlesDataMutable self, char const * attribute, ParticleAttributeType type, int const count) -> FixedAttribute
        Adds a new fixed attribute of given name, type and count. If type is
        partio.VECTOR, then count must be 3
        """
        return _partio.ParticlesDataMutable_addFixedAttribute(self, attribute, type, count)

    def addParticle(self):
        r"""
        addParticle(ParticlesDataMutable self) -> ParticleIndex
        Adds a new particle and returns the index
        """
        return _partio.ParticlesDataMutable_addParticle(self)

    def addParticles(self, count):
        r"""
        addParticles(ParticlesDataMutable self, int const count) -> ParticleIteratorFalse
        Adds count particles and returns the offset to the first one
        """
        return _partio.ParticlesDataMutable_addParticles(self, count)

    def set(self, attr, particleIndex, tuple):
        r"""
        set(ParticlesDataMutable self, ParticleAttribute attr, uint64_t const particleIndex, PyObject * tuple) -> PyObject *
        Sets data on a given attribute for a single particle.
        Data must be specified as tuple.
        """
        return _partio.ParticlesDataMutable_set(self, attr, particleIndex, tuple)

    def setFixed(self, attr, tuple):
        r"""
        setFixed(ParticlesDataMutable self, FixedAttribute attr, PyObject * tuple) -> PyObject *
        Sets data on a given fixed attribute.
        Data must be specified as tuple.
        """
        return _partio.ParticlesDataMutable_setFixed(self, attr, tuple)

    def ptr(self):
        r"""
        ptr(ParticlesDataMutable self) -> unsigned long
        Workaround to get the address to the ptr to help with interop python binding
        """
        return _partio.ParticlesDataMutable_ptr(self)
    __swig_destroy__ = _partio.delete_ParticlesDataMutable

# Register ParticlesDataMutable in _partio:
_partio.ParticlesDataMutable_swigregister(ParticlesDataMutable)

def create():
    r"""
    create() -> ParticlesDataMutable
    Create an empty particle array
    """
    return _partio.create()

def read(*args):
    r"""
    read(char const * filename, bool verbose=True, std::ostream & error=std::cerr) -> ParticlesDataMutable
    Reads a particle set from disk
    """
    return _partio.read(*args)

def readVerbose(filename):
    r"""
    readVerbose(char const * filename) -> PyObject *
    Reads a particle set from disk and returns the tuple particleObject,errorMsg
    """
    return _partio.readVerbose(filename)

def readHeadersVerbose(filename):
    r"""
    readHeadersVerbose(char const * filename) -> PyObject *
    Reads the header/attribute information from disk and returns the tuple particleObject,errorMsg
    """
    return _partio.readHeadersVerbose(filename)

def readCachedVerbose(filename, sort):
    r"""
    readCachedVerbose(char const * filename, bool sort) -> PyObject *
    Reads the header/attribute information from disk and returns the tuple particleObject,errorMsg
    """
    return _partio.readCachedVerbose(filename, sort)

def readHeaders(*args):
    r"""
    readHeaders(char const * filename, bool verbose=True, std::ostream & error=std::cerr) -> ParticlesInfo
    Reads a particle set headers from disk
    """
    return _partio.readHeaders(*args)

def write(filename, arg2, arg3=False, arg4=True):
    r"""
    write(char const * filename, ParticlesData arg2, bool const arg3=False, bool const arg4=True)
    Writes a particle set to disk
    """
    return _partio.write(filename, arg2, arg3, arg4)

def _print(particles):
    r"""
    _print(ParticlesData particles)
    Print a summary of particle file
    """
    return _partio._print(particles)

def computeClustering(particles, numNeighbors, radiusSearch, radiusInside, connections, density):
    r"""
    computeClustering(ParticlesDataMutable particles, int const numNeighbors, double const radiusSearch, double const radiusInside, int const connections, double const density) -> ParticlesDataMutable
    Creates a clustered particle set
    """
    return _partio.computeClustering(particles, numNeighbors, radiusSearch, radiusInside, connections, density)

def merge(*args):
    r"""
    merge(ParticlesDataMutable base, ParticlesData delta, std::string const & identifier=std::string())
    Merge two particle sets
    """
    return _partio.merge(*args)

def cloneSchema(other, attrNameMap=None):
    r"""
    cloneSchema(ParticlesData other, std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const * attrNameMap=None) -> ParticlesDataMutable
    Clone a particle set's attribute schema
    """
    return _partio.cloneSchema(other, attrNameMap)

def clone(other, particles, attrNameMap=None):
    r"""
    clone(ParticlesData other, bool particles, std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const * attrNameMap=None) -> ParticlesDataMutable
    Clone a particle set
    """
    return _partio.clone(other, particles, attrNameMap)

def TypeName(attrType):
    r"""
    TypeName(ParticleAttributeType attrType) -> std::string
    Return string name of given attribute type
    """
    return _partio.TypeName(attrType)

