sort_triangles.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #ifndef IGL_NO_OPENGL
  30. template <
  31. typename DerivedV,
  32. typename DerivedF,
  33. typename DerivedFF,
  34. typename DerivedI>
  35. IGL_INLINE void sort_triangles(
  36. const Eigen::PlainObjectBase<DerivedV> & V,
  37. const Eigen::PlainObjectBase<DerivedF> & F,
  38. Eigen::PlainObjectBase<DerivedFF> & FF,
  39. Eigen::PlainObjectBase<DerivedI> & I);
  40. template <
  41. typename DerivedV,
  42. typename DerivedF,
  43. typename DerivedFF,
  44. typename DerivedI>
  45. IGL_INLINE void sort_triangles_slow(
  46. const Eigen::PlainObjectBase<DerivedV> & V,
  47. const Eigen::PlainObjectBase<DerivedF> & F,
  48. Eigen::PlainObjectBase<DerivedFF> & FF,
  49. Eigen::PlainObjectBase<DerivedI> & I);
  50. //template <
  51. // typename DerivedV,
  52. // typename DerivedF,
  53. // typename DerivedMV,
  54. // typename DerivedP,
  55. // typename DerivedFF,
  56. // typename DerivedI>
  57. //IGL_INLINE void sort_triangles_robust(
  58. // const Eigen::PlainObjectBase<DerivedV> & V,
  59. // const Eigen::PlainObjectBase<DerivedF> & F,
  60. // const Eigen::PlainObjectBase<DerivedMV> & MV,
  61. // const Eigen::PlainObjectBase<DerivedP> & P,
  62. // Eigen::PlainObjectBase<DerivedFF> & FF,
  63. // Eigen::PlainObjectBase<DerivedI> & I);
  64. //template <
  65. // typename DerivedV,
  66. // typename DerivedF,
  67. // typename DerivedFF,
  68. // typename DerivedI>
  69. //IGL_INLINE void sort_triangles_robust(
  70. // const Eigen::PlainObjectBase<DerivedV> & V,
  71. // const Eigen::PlainObjectBase<DerivedF> & F,
  72. // Eigen::PlainObjectBase<DerivedFF> & FF,
  73. // Eigen::PlainObjectBase<DerivedI> & I);
  74. #endif
  75. }
  76. #ifdef IGL_HEADER_ONLY
  77. # include "sort_triangles.cpp"
  78. #endif
  79. #endif