Page MenuHomec4science

percolation.cpp
No OneTemporary

File Metadata

Created
Fri, May 3, 08:03

percolation.cpp

/**
* @file
* @section LICENSE
*
* Copyright (©) 2016-19 EPFL (École Polytechnique Fédérale de Lausanne),
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "flood_fill.hh"
#include "wrap.hh"
/* -------------------------------------------------------------------------- */
#include <pybind11/stl.h>
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
namespace wrap {
/* -------------------------------------------------------------------------- */
using namespace py::literals;
/* -------------------------------------------------------------------------- */
void wrapPercolation(py::module& mod) {
py::class_<Cluster>(mod, "Cluster")
.def(py::init<>())
.def("getArea", &Cluster::getArea, "Area of cluster")
.def("getPoints", &Cluster::getPoints, "Get list of points of cluster")
.def("getPerimeter", &Cluster::getPerimeter, "Get perimeter of cluster");
py::class_<FloodFill>(mod, "FloodFill")
.def_static("getClusters", &FloodFill::getClusters,
"Return a list of clusters from boolean map", "contact"_a,
"diagonal"_a);
}
} // namespace wrap
__END_TAMAAS__

Event Timeline