sort_triangles.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_SORT_TRIANGLES_H
  9. #define IGL_SORT_TRIANGLES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Inputs:
  15. // V #V by **4** list of homogeneous vertex positions
  16. // F #F by 3 list of triangle indices
  17. // MV 4 by 4 model view matrix
  18. // P 4 by 4 projection matrix
  19. // Outputs:
  20. // FF #F by 3 list of sorted triangles indices
  21. // I #F list of sorted indices
  22. template <
  23. typename DerivedV,
  24. typename DerivedF,
  25. typename DerivedMV,
  26. typename DerivedP,
  27. typename DerivedFF,
  28. typename DerivedI>
  29. IGL_INLINE void sort_triangles(
  30. const Eigen::PlainObjectBase<DerivedV> & V,
  31. const Eigen::PlainObjectBase<DerivedF> & F,
  32. const Eigen::PlainObjectBase<DerivedMV> & MV,
  33. const Eigen::PlainObjectBase<DerivedP> & P,
  34. Eigen::PlainObjectBase<DerivedFF> & FF,
  35. Eigen::PlainObjectBase<DerivedI> & I);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "sort_triangles.cpp"
  39. #endif
  40. #endif