sort_triangles.h 2.8 KB

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