// 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 "in_element.h" template IGL_INLINE void igl::in_element( const Eigen::PlainObjectBase & V, const Eigen::MatrixXi & Ele, const Eigen::PlainObjectBase & Q, const AABB & aabb, Eigen::VectorXi & I) { using namespace std; using namespace Eigen; const int Qr = Q.rows(); I.setConstant(Qr,1,-1); #pragma omp parallel for if (Qr>10000) for(int e = 0;e IGL_INLINE void igl::in_element( const Eigen::PlainObjectBase & V, const Eigen::MatrixXi & Ele, const Eigen::PlainObjectBase & Q, const AABB & aabb, Eigen::SparseMatrix & I) { using namespace std; using namespace Eigen; const int Qr = Q.rows(); std::vector > IJV; IJV.reserve(Qr); #pragma omp parallel for if (Qr>10000) for(int e = 0;e(e,r,1)); } } I.resize(Qr,Ele.rows()); I.setFromTriplets(IJV.begin(),IJV.end()); } #ifdef IGL_STATIC_LIBRARY template void igl::in_element, Eigen::Matrix, 2>(Eigen::PlainObjectBase > const&, Eigen::Matrix const&, Eigen::PlainObjectBase > const&, igl::AABB, 2> const&, Eigen::Matrix&); template void igl::in_element, Eigen::Matrix, 3>(Eigen::PlainObjectBase > const&, Eigen::Matrix const&, Eigen::PlainObjectBase > const&, igl::AABB, 3> const&, Eigen::Matrix&); #endif