Skip to content

Commit

Permalink
Merge pull request DGtal-team#1700 from phcerdan/add_wrap_python_cmak…
Browse files Browse the repository at this point in the history
…e_option
  • Loading branch information
dcoeurjo authored Sep 9, 2023
2 parents 77995bb + 6100362 commit ad47648
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
## Changes
- *General*
- Renaming AUTHORS→CONTRIBUTORS for HAL (David Coeurjolly, [#1699](https://github.com/DGtal-team/DGtal/pull/1699))

- *Project*
- Add CMake option DGTAL_WRAP_PYTHON (Pablo Hernandez-Cerdan, [#1700](https://github.com/DGtal-team/DGtal/pull/1700))

- *IO*
- New method to change the mode of the light position in Viewer3D (fixed to
Expand Down
1 change: 1 addition & 0 deletions cmake/PythonWrappings.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
option(DGTAL_WRAP_PYTHON "Compile python wrappings" OFF)
if(DGTAL_WRAP_PYTHON)
# Fetch pybind11
include(FetchContent)
Expand Down
6 changes: 2 additions & 4 deletions src/DGtal/topology/VoxelComplex.ih
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ inline void
DGtal::VoxelComplex<TKSpace, TCellContainer>::insertVoxelCell(
const Cell &kcell, const bool &close_it, const Data &data)
{
const auto &ks = this->space();
ASSERT(ks.uDim(kcell) == 3);
ASSERT(this->space().uDim(kcell) == 3);
this->insertCell(3, kcell, data);
if (close_it)
voxelClose(kcell);
Expand Down Expand Up @@ -513,8 +512,7 @@ DGtal::VoxelComplex<TKSpace, TCellContainer>::K_2(const Cell &face2,
ASSERT(ks.uIsSurfel(face2));
using KPreSpace = typename TKSpace::PreCellularGridSpace;
const auto co_faces = KPreSpace::uCoFaces(face2);
const auto nco_faces = co_faces.size();
ASSERT(nco_faces == 2);
ASSERT(co_faces.size() == 2);
const auto &cf0 = co_faces[0];
const auto &cf1 = co_faces[1];
// spels must belong to complex.
Expand Down
4 changes: 2 additions & 2 deletions wrap/images/ImageContainerBySTLVector_declare_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ using Is3D = typename std::enable_if<TPoint::dimension == 3>::type;
template<typename TT>
void def_toindices(pybind11::class_<TT> & py_class,
Is2D<typename TT::Point> * = nullptr) {
py_class.def("toindices", [](const TT & self, const typename TT::Point & a_point) {
py_class.def("toindices", [](const TT &, const typename TT::Point & a_point) {
return pybind11::make_tuple(a_point[1], a_point[0]);
}, "Return tuple of the i,j,k-coordinates of the input point in the c_style format: (k,j,i)");
}
template<typename TT>
void def_toindices(pybind11::class_<TT> & py_class,
Is3D<typename TT::Point> * = nullptr) {
py_class.def("toindices", [](const TT & self, const typename TT::Point & a_point) {
py_class.def("toindices", [](const TT &, const typename TT::Point & a_point) {
return pybind11::make_tuple(a_point[2], a_point[1], a_point[0]);
}, "Return tuple of the i,j,k-coordinates of the input point in the c_style format: (k,j,i)");
}
Expand Down
2 changes: 1 addition & 1 deletion wrap/kernel/HyperRectDomain_declare_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following code snippet demonstrates how to use \p HyperRectDomain
)";
auto py_class = py::class_<TT>(m, typestr.c_str(), docs.c_str());

py_class.def("dtype", [](const TT &self) {
py_class.def("dtype", [](const TT &) {
return DGtal::Python::Integer_str;
});
// ----------------------- Constructors -----------------------------------
Expand Down

0 comments on commit ad47648

Please sign in to comment.