order_facets_around_edges.h 2.9 KB

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