sort_triangles.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef IGL_SORT_TRIANGLES_H
  2. #define IGL_SORT_TRIANGLES_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. // Inputs:
  8. // V #V by **4** list of homogeneous vertex positions
  9. // F #F by 3 list of triangle indices
  10. // MV 4 by 4 model view matrix
  11. // P 4 by 4 projection matrix
  12. // Outputs:
  13. // FF #F by 3 list of sorted triangles indices
  14. // I #F list of sorted indices
  15. template <
  16. typename DerivedV,
  17. typename DerivedF,
  18. typename DerivedMV,
  19. typename DerivedP,
  20. typename DerivedFF,
  21. typename DerivedI>
  22. IGL_INLINE void sort_triangles(
  23. const Eigen::PlainObjectBase<DerivedV> & V,
  24. const Eigen::PlainObjectBase<DerivedF> & F,
  25. const Eigen::PlainObjectBase<DerivedMV> & MV,
  26. const Eigen::PlainObjectBase<DerivedP> & P,
  27. Eigen::PlainObjectBase<DerivedFF> & FF,
  28. Eigen::PlainObjectBase<DerivedI> & I);
  29. template <
  30. typename DerivedV,
  31. typename DerivedF,
  32. typename DerivedFF,
  33. typename DerivedI>
  34. IGL_INLINE void sort_triangles(
  35. const Eigen::PlainObjectBase<DerivedV> & V,
  36. const Eigen::PlainObjectBase<DerivedF> & F,
  37. Eigen::PlainObjectBase<DerivedFF> & FF,
  38. Eigen::PlainObjectBase<DerivedI> & I);
  39. template <
  40. typename DerivedV,
  41. typename DerivedF,
  42. typename DerivedFF,
  43. typename DerivedI>
  44. IGL_INLINE void sort_triangles_slow(
  45. const Eigen::PlainObjectBase<DerivedV> & V,
  46. const Eigen::PlainObjectBase<DerivedF> & F,
  47. Eigen::PlainObjectBase<DerivedFF> & FF,
  48. Eigen::PlainObjectBase<DerivedI> & I);
  49. }
  50. #ifdef IGL_HEADER_ONLY
  51. # include "sort_triangles.cpp"
  52. #endif
  53. #endif