// 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 "piecewise_constant_winding_number.h" #include "unique_edge_map.h" #include "PI.h" template < typename DerivedF, typename DeriveduE, typename uE2EType> IGL_INLINE bool igl::piecewise_constant_winding_number( const Eigen::MatrixBase& F, const Eigen::MatrixBase& uE, const std::vector >& uE2E) { const size_t num_faces = F.rows(); const size_t num_edges = uE.rows(); const auto edge_index_to_face_index = [&](size_t ei) { return ei % num_faces; }; const auto is_consistent = [&](size_t fid, size_t s, size_t d) { if ((size_t)F(fid, 0) == s && (size_t)F(fid, 1) == d) return true; if ((size_t)F(fid, 1) == s && (size_t)F(fid, 2) == d) return true; if ((size_t)F(fid, 2) == s && (size_t)F(fid, 0) == d) return true; if ((size_t)F(fid, 0) == d && (size_t)F(fid, 1) == s) return false; if ((size_t)F(fid, 1) == d && (size_t)F(fid, 2) == s) return false; if ((size_t)F(fid, 2) == d && (size_t)F(fid, 0) == s) return false; throw "Invalid face!!"; }; for (size_t i=0; i IGL_INLINE bool igl::piecewise_constant_winding_number( const Eigen::MatrixBase& F) { Eigen::Matrix E, uE; Eigen::Matrix EMAP; std::vector > uE2E; unique_edge_map(F, E, uE, EMAP, uE2E); return piecewise_constant_winding_number(F,uE,uE2E); } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh template bool igl::piecewise_constant_winding_number, Eigen::Matrix, unsigned long>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&); template bool igl::piecewise_constant_winding_number, Eigen::Matrix, unsigned long>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&); #ifdef WIN32 template bool igl::piecewise_constant_winding_number, class Eigen::Matrix, unsigned __int64>(class Eigen::MatrixBase> const &, class Eigen::MatrixBase> const &, class std::vector>, class std::allocator>>> const &); template bool igl::piecewise_constant_winding_number, class Eigen::Matrix, unsigned __int64>(class Eigen::MatrixBase> const &, class Eigen::MatrixBase> const &, class std::vector>, class std::allocator>>> const &); #endif #endif