vf.h 1.4 KB

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