// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "winding_number.h" #include "WindingNumberAABB.h" #include #include // IF THIS IS EVER TEMPLATED BE SURE THAT V IS COLMAJOR IGL_INLINE void igl::winding_number( const Eigen::MatrixXd & V, const Eigen::MatrixXi & F, const Eigen::MatrixXd & O, Eigen::VectorXd & W) { using namespace Eigen; // make room for output W.resize(O.rows(),1); switch(F.cols()) { case 2: return winding_number_2( V.data(), V.rows(), F.data(), F.rows(), O.data(), O.rows(), W.data()); case 3: { WindingNumberAABB hier(V,F); hier.grow(); // loop over origins const int no = O.rows(); # pragma omp parallel for if (no>IGL_WINDING_NUMBER_OMP_MIN_VALUE) for(int o = 0;o IGL_INLINE void igl::winding_number_3( const Scalar * V, const int n, const DerivedF * F, const int m, const Scalar * O, const int no, Scalar * S) { // Initialize output // loop over origins #pragma omp parallel for if (no>IGL_WINDING_NUMBER_OMP_MIN_VALUE) for(int o = 0;oIGL_WINDING_NUMBER_OMP_MIN_VALUE && no>1) // loop over faces for(int f = 0;f IGL_INLINE void igl::winding_number_2( const double * V, const int n, const DerivedF * F, const int m, const double * O, const int no, double * S) { // Initialize output // loop over origins #pragma omp parallel for if (no>IGL_WINDING_NUMBER_OMP_MIN_VALUE) for(int o = 0;oIGL_WINDING_NUMBER_OMP_MIN_VALUE && no>1) // loop over faces for(int f = 0;f(double const*, int, double const*, int, double const*, int, double*); template void igl::winding_number_3(double const*, int, double const*, int, double const*, int, double*); template void igl::winding_number_3(double const*, int, int const*, int, double const*, int, double*); template void igl::winding_number_2(double const*, int, int const*, int, double const*, int, double*); #endif