resolve_intersections.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Alec Jacobson <[email protected]>
  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_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
  9. #define IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. /// Given a list of possible intersecting segments with endpoints, split
  19. /// segments to overlap only at endpoints
  20. ///
  21. /// @param[in] V #V by 2 list of vertex positions
  22. /// @param[in] E #E by 2 list of segment indices into V
  23. /// @param[out] VI #VI by 2 list of output vertex positions, copies of V are always
  24. /// the first #V vertices
  25. /// @param[out] EI #EI by 2 list of segment indices into V, #EI ≥ #E
  26. /// @param[out] J #EI list of indices into E revealing "parent segments"
  27. /// @param[out] IM #VI list of indices into VV of unique vertices.
  28. template <
  29. typename DerivedV,
  30. typename DerivedE,
  31. typename DerivedVI,
  32. typename DerivedEI,
  33. typename DerivedJ,
  34. typename DerivedIM>
  35. IGL_INLINE void resolve_intersections(
  36. const Eigen::MatrixBase<DerivedV> & V,
  37. const Eigen::MatrixBase<DerivedE> & E,
  38. Eigen::PlainObjectBase<DerivedVI> & VI,
  39. Eigen::PlainObjectBase<DerivedEI> & EI,
  40. Eigen::PlainObjectBase<DerivedJ> & J,
  41. Eigen::PlainObjectBase<DerivedIM> & IM);
  42. }
  43. }
  44. }
  45. #ifndef IGL_STATIC_LIBRARY
  46. # include "resolve_intersections.cpp"
  47. #endif
  48. #endif