vertex_triangle_adjacency.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@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. #ifndef IGL_VERTEX_TRIANGLE_ADJACENCY_H
  9. #define IGL_VERTEX_TRIANGLE_ADJACENCY_H
  10. #include <igl/igl_inline.h>
  11. #include <Eigen/Dense>
  12. #include <vector>
  13. namespace igl
  14. {
  15. // vertex_face_adjacency constructs the vertex-face topology of a given mesh (V,F)
  16. //
  17. // Inputs:
  18. // V #V by 3 list of vertex coordinates
  19. // F #F by dim list of mesh faces (must be triangles)
  20. // Outputs:
  21. // VF #V list of lists of incident faces (adjacency list)
  22. // VI #V list of lists of index of incidence within incident faces listed
  23. // in VF
  24. //
  25. // See also: edges, cotmatrix, diag, vv
  26. //
  27. // Known bugs: this should not take V as an input parameter.
  28. template <typename DerivedV, typename DerivedF, typename IndexType>
  29. IGL_INLINE void vertex_triangle_adjacency(
  30. const Eigen::PlainObjectBase<DerivedV>& V,
  31. const Eigen::PlainObjectBase<DerivedF>& F,
  32. std::vector<std::vector<IndexType> >& VF,
  33. std::vector<std::vector<IndexType> >& VFi);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "vertex_triangle_adjacency.cpp"
  37. #endif
  38. #endif