bindings/python/utils.h
author Dmitriy Morozov <dmitriy@mrzv.org>
Thu, 16 Apr 2009 00:23:01 -0700
branchdev
changeset 131 d9e050258358
parent 130 580eaa850c4f
child 143 b555e6587908
permissions -rw-r--r--
Alphashapes and Python bindings * converted alphashapes2d to the new format * added Python bindings for alphashapes * added sample alphashapes.py that dynamically distinguishes between 2D and 3D

#ifndef __PYTHON_UTILS_H__
#define __PYTHON_UTILS_H__

#include <boost/python.hpp>
namespace bp = boost::python;

namespace dionysus {
namespace python   {

struct PythonCmp
{
    template<class T>
    bool            operator()(T x1, T x2) const            { return cmp_(x1, x2) < 0; }

                    PythonCmp(bp::object cmp): cmp_(cmp)    {}

    bp::object cmp_;
};

} } // namespace dionysus::python

#endif