order_facets_around_edges.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef IGL_CGAL_ORDER_FACETS_AROUND_EDGES_H
  2. #define IGL_CGAL_ORDER_FACETS_AROUND_EDGES_H
  3. #include "../igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
  6. namespace igl
  7. {
  8. namespace cgal
  9. {
  10. // For each undirected edge, sort its adjacent faces.
  11. //
  12. // Inputs:
  13. // V #V by 3 list of vertices.
  14. // F #F by 3 list of faces
  15. // N #F by 3 list of face normals.
  16. // E #F*3 by 2 list vertex indices, represents directed edges.
  17. // uE #uE by 2 list of vertex_indices, represents undirected edges.
  18. // EMAP #F*3 list of indices that maps E to uE. (a many-to-one map)
  19. // uE2E #uE list of lists that maps uE to E. (a one-to-many map)
  20. //
  21. // Outputs:
  22. // uE2oE #uE list of lists that maps uE to an ordered list of E. (a
  23. // one-to-many map)
  24. // uE2C #uE list of lists of bools indicates whether each face in
  25. // uE2oE[i] is consistently orientated as the ordering.
  26. //
  27. template<
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename DerivedN,
  31. typename DerivedE,
  32. typename DeriveduE,
  33. typename DerivedEMAP,
  34. typename uE2EType,
  35. typename uE2oEType,
  36. typename uE2CType >
  37. IGL_INLINE
  38. typename std::enable_if<!std::is_same<typename DerivedV::Scalar,
  39. typename CGAL::Exact_predicates_exact_constructions_kernel::FT>::value, void>::type
  40. order_facets_around_edges(
  41. const Eigen::PlainObjectBase<DerivedV>& V,
  42. const Eigen::PlainObjectBase<DerivedF>& F,
  43. const Eigen::PlainObjectBase<DerivedN>& N,
  44. const Eigen::PlainObjectBase<DerivedE>& E,
  45. const Eigen::PlainObjectBase<DeriveduE>& uE,
  46. const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  47. const std::vector<std::vector<uE2EType> >& uE2E,
  48. std::vector<std::vector<uE2oEType> >& uE2oE,
  49. std::vector<std::vector<uE2CType > >& uE2C );
  50. template<
  51. typename DerivedV,
  52. typename DerivedF,
  53. typename DerivedN,
  54. typename DerivedE,
  55. typename DeriveduE,
  56. typename DerivedEMAP,
  57. typename uE2EType,
  58. typename uE2oEType,
  59. typename uE2CType >
  60. IGL_INLINE
  61. typename std::enable_if<std::is_same<typename DerivedV::Scalar,
  62. typename CGAL::Exact_predicates_exact_constructions_kernel::FT>::value, void>::type
  63. order_facets_around_edges(
  64. const Eigen::PlainObjectBase<DerivedV>& V,
  65. const Eigen::PlainObjectBase<DerivedF>& F,
  66. const Eigen::PlainObjectBase<DerivedN>& N,
  67. const Eigen::PlainObjectBase<DerivedE>& E,
  68. const Eigen::PlainObjectBase<DeriveduE>& uE,
  69. const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  70. const std::vector<std::vector<uE2EType> >& uE2E,
  71. std::vector<std::vector<uE2oEType> >& uE2oE,
  72. std::vector<std::vector<uE2CType > >& uE2C );
  73. }
  74. }
  75. #ifndef IGL_STATIC_LIBRARY
  76. #include "order_facets_around_edges.cpp"
  77. #endif
  78. #endif