point_mesh_squared_distance.cpp 981 B

1234567891011121314151617181920212223242526272829303132
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "point_mesh_squared_distance.h"
  9. #include "AABB.h"
  10. template <
  11. typename DerivedP,
  12. typename DerivedV,
  13. typename DerivedsqrD,
  14. typename DerivedI,
  15. typename DerivedC>
  16. IGL_INLINE void igl::point_mesh_squared_distance(
  17. const Eigen::PlainObjectBase<DerivedP> & P,
  18. const Eigen::PlainObjectBase<DerivedV> & V,
  19. const Eigen::MatrixXi & Ele,
  20. Eigen::PlainObjectBase<DerivedsqrD> & sqrD,
  21. Eigen::PlainObjectBase<DerivedI> & I,
  22. Eigen::PlainObjectBase<DerivedC> & C)
  23. {
  24. using namespace std;
  25. AABB<DerivedV,3> tree;
  26. tree.init(V,Ele);
  27. return tree.squared_distance(V,Ele,P,sqrD,I,C);
  28. }
  29. #ifdef IGL_STATIC_LIBRARY
  30. #endif