sort_triangles.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. //template <
  50. // typename DerivedV,
  51. // typename DerivedF,
  52. // typename DerivedMV,
  53. // typename DerivedP,
  54. // typename DerivedFF,
  55. // typename DerivedI>
  56. //IGL_INLINE void sort_triangles_robust(
  57. // const Eigen::PlainObjectBase<DerivedV> & V,
  58. // const Eigen::PlainObjectBase<DerivedF> & F,
  59. // const Eigen::PlainObjectBase<DerivedMV> & MV,
  60. // const Eigen::PlainObjectBase<DerivedP> & P,
  61. // Eigen::PlainObjectBase<DerivedFF> & FF,
  62. // Eigen::PlainObjectBase<DerivedI> & I);
  63. //template <
  64. // typename DerivedV,
  65. // typename DerivedF,
  66. // typename DerivedFF,
  67. // typename DerivedI>
  68. //IGL_INLINE void sort_triangles_robust(
  69. // const Eigen::PlainObjectBase<DerivedV> & V,
  70. // const Eigen::PlainObjectBase<DerivedF> & F,
  71. // Eigen::PlainObjectBase<DerivedFF> & FF,
  72. // Eigen::PlainObjectBase<DerivedI> & I);
  73. }
  74. #ifdef IGL_HEADER_ONLY
  75. # include "sort_triangles.cpp"
  76. #endif
  77. #endif