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

"""SWIG wrapper for the CGAL Classification package provided under the GPL-3.0+ license"""

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

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


import CGAL.CGAL_Kernel
import CGAL.CGAL_Point_set_3
class Label(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, base):
        _CGAL_Classification.Label_swiginit(self, _CGAL_Classification.new_Label(base))

    def name(self):
        return _CGAL_Classification.Label_name(self)
    __swig_destroy__ = _CGAL_Classification.delete_Label

# Register Label in _CGAL_Classification:
_CGAL_Classification.Label_swigregister(Label)

class Label_set(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):
        _CGAL_Classification.Label_set_swiginit(self, _CGAL_Classification.new_Label_set())

    def add(self, label):
        return _CGAL_Classification.Label_set_add(self, label)

    def remove(self, label):
        return _CGAL_Classification.Label_set_remove(self, label)

    def clear(self):
        return _CGAL_Classification.Label_set_clear(self)
    __swig_destroy__ = _CGAL_Classification.delete_Label_set

# Register Label_set in _CGAL_Classification:
_CGAL_Classification.Label_set_swigregister(Label_set)

class Feature(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, base):
        _CGAL_Classification.Feature_swiginit(self, _CGAL_Classification.new_Feature(base))

    def name(self):
        return _CGAL_Classification.Feature_name(self)

    def set_name(self, name):
        return _CGAL_Classification.Feature_set_name(self, name)

    def value(self, index):
        return _CGAL_Classification.Feature_value(self, index)
    __swig_destroy__ = _CGAL_Classification.delete_Feature

# Register Feature in _CGAL_Classification:
_CGAL_Classification.Feature_swigregister(Feature)

class Feature_set(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):
        _CGAL_Classification.Feature_set_swiginit(self, _CGAL_Classification.new_Feature_set())

    def begin_parallel_additions(self):
        return _CGAL_Classification.Feature_set_begin_parallel_additions(self)

    def end_parallel_additions(self):
        return _CGAL_Classification.Feature_set_end_parallel_additions(self)

    def clear(self):
        return _CGAL_Classification.Feature_set_clear(self)

    def size(self):
        return _CGAL_Classification.Feature_set_size(self)

    def get(self, index):
        return _CGAL_Classification.Feature_set_get(self, index)

    def remove(self, feature):
        return _CGAL_Classification.Feature_set_remove(self, feature)
    __swig_destroy__ = _CGAL_Classification.delete_Feature_set

# Register Feature_set in _CGAL_Classification:
_CGAL_Classification.Feature_set_swigregister(Feature_set)

class Point_set_neighbor_query(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):
        _CGAL_Classification.Point_set_neighbor_query_swiginit(self, _CGAL_Classification.new_Point_set_neighbor_query())
    __swig_destroy__ = _CGAL_Classification.delete_Point_set_neighbor_query

# Register Point_set_neighbor_query in _CGAL_Classification:
_CGAL_Classification.Point_set_neighbor_query_swigregister(Point_set_neighbor_query)

class Point_set_neighborhood(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, base):
        _CGAL_Classification.Point_set_neighborhood_swiginit(self, _CGAL_Classification.new_Point_set_neighborhood(base))

    def k_neighbor_query(self, k):
        return _CGAL_Classification.Point_set_neighborhood_k_neighbor_query(self, k)

    def sphere_neighbor_query(self, radius):
        return _CGAL_Classification.Point_set_neighborhood_sphere_neighbor_query(self, radius)
    __swig_destroy__ = _CGAL_Classification.delete_Point_set_neighborhood

# Register Point_set_neighborhood in _CGAL_Classification:
_CGAL_Classification.Point_set_neighborhood_swigregister(Point_set_neighborhood)

class Point_set_feature_generator(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, point_set, nb_scales, voxel_size=-1.):
        _CGAL_Classification.Point_set_feature_generator_swiginit(self, _CGAL_Classification.new_Point_set_feature_generator(point_set, nb_scales, voxel_size))

    def generate_point_based_features(self, features):
        return _CGAL_Classification.Point_set_feature_generator_generate_point_based_features(self, features)

    def generate_normal_based_features(self, features, normal_map):
        return _CGAL_Classification.Point_set_feature_generator_generate_normal_based_features(self, features, normal_map)

    def generate_color_based_features(self, features, red_map, green_map, blue_map):
        return _CGAL_Classification.Point_set_feature_generator_generate_color_based_features(self, features, red_map, green_map, blue_map)

    def generate_echo_based_features(self, features, echo_map):
        return _CGAL_Classification.Point_set_feature_generator_generate_echo_based_features(self, features, echo_map)

    def neighborhood(self, scale=0):
        return _CGAL_Classification.Point_set_feature_generator_neighborhood(self, scale)

    def number_of_scales(self):
        return _CGAL_Classification.Point_set_feature_generator_number_of_scales(self)

    def grid_resolution(self, c):
        return _CGAL_Classification.Point_set_feature_generator_grid_resolution(self, c)

    def radius_neighbors(self, c):
        return _CGAL_Classification.Point_set_feature_generator_radius_neighbors(self, c)

    def radius_dtm(self, c):
        return _CGAL_Classification.Point_set_feature_generator_radius_dtm(self, c)
    __swig_destroy__ = _CGAL_Classification.delete_Point_set_feature_generator

# Register Point_set_feature_generator in _CGAL_Classification:
_CGAL_Classification.Point_set_feature_generator_swigregister(Point_set_feature_generator)

class ETHZ_Random_forest_classifier(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, labels, features):
        _CGAL_Classification.ETHZ_Random_forest_classifier_swiginit(self, _CGAL_Classification.new_ETHZ_Random_forest_classifier(labels, features))

    def train(self, ground_truth, reset_trees=True, num_trees=25, max_depth=20):
        return _CGAL_Classification.ETHZ_Random_forest_classifier_train(self, ground_truth, reset_trees, num_trees, max_depth)

    def save_configuration(self, filename):
        return _CGAL_Classification.ETHZ_Random_forest_classifier_save_configuration(self, filename)

    def load_configuration(self, filename):
        return _CGAL_Classification.ETHZ_Random_forest_classifier_load_configuration(self, filename)
    __swig_destroy__ = _CGAL_Classification.delete_ETHZ_Random_forest_classifier

# Register ETHZ_Random_forest_classifier in _CGAL_Classification:
_CGAL_Classification.ETHZ_Random_forest_classifier_swigregister(ETHZ_Random_forest_classifier)

class Evaluation(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, labels, ground_truth, result):
        _CGAL_Classification.Evaluation_swiginit(self, _CGAL_Classification.new_Evaluation(labels, ground_truth, result))

    def precision(self, label):
        return _CGAL_Classification.Evaluation_precision(self, label)

    def recall(self, label):
        return _CGAL_Classification.Evaluation_recall(self, label)

    def f1_score(self, label):
        return _CGAL_Classification.Evaluation_f1_score(self, label)

    def intersection_over_union(self, label):
        return _CGAL_Classification.Evaluation_intersection_over_union(self, label)

    def accuracy(self):
        return _CGAL_Classification.Evaluation_accuracy(self)

    def mean_f1_score(self):
        return _CGAL_Classification.Evaluation_mean_f1_score(self)

    def mean_intersection_over_union(self):
        return _CGAL_Classification.Evaluation_mean_intersection_over_union(self)
    __swig_destroy__ = _CGAL_Classification.delete_Evaluation

# Register Evaluation in _CGAL_Classification:
_CGAL_Classification.Evaluation_swigregister(Evaluation)


def classify(point_set, labels, classifier, output):
    return _CGAL_Classification.classify(point_set, labels, classifier, output)

def classify_with_local_smoothing(point_set, labels, classifier, neighbor_query, output):
    return _CGAL_Classification.classify_with_local_smoothing(point_set, labels, classifier, neighbor_query, output)

def classify_with_graphcut(point_set, labels, classifier, neighbor_query, strength, min_number_of_subdivisions, output):
    return _CGAL_Classification.classify_with_graphcut(point_set, labels, classifier, neighbor_query, strength, min_number_of_subdivisions, output)


