Skip to content

Commit

Permalink
Document functions
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Nov 6, 2024
1 parent c8aa6e4 commit 17af065
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion GraphicsView/demo/Polygon_repair/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is the CMake script for compiling a CGAL application.

cmake_minimum_required(VERSION 3.12...3.29)
project(Triangulation_2_Demo)
project(Polygon_repair_Demo)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
Expand Down
14 changes: 1 addition & 13 deletions GraphicsView/demo/Triangulation_2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,8 @@ target_link_libraries(Regular_triangulation_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6

add_to_cached_list(CGAL_EXECUTABLE_TARGETS Regular_triangulation_2)

#--------------------------------
# The "Boolean" demo: Boolean_2
#--------------------------------

qt_add_executable(
Boolean_2 Boolean_2.cpp
Boolean_2.ui Boolean_2.qrc)
target_link_libraries(Boolean_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Widgets)

add_to_cached_list(CGAL_EXECUTABLE_TARGETS Boolean_2)

include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
foreach(target Constrained_Delaunay_triangulation_2 Delaunay_triangulation_2
Regular_triangulation_2 Boolean_2)
Regular_triangulation_2)
cgal_add_compilation_test(${target})
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ main(int argc, char* argv[])
pB.push_back(Point_2(1,-1));
pB.push_back(Point_2(1,1));
pB.push_back(Point_2(-1,1));
mpwh = CGAL::Polygon_repair::join(pA,pB);
mpwh = CGAL::Polygon_repair::join(mpwh, pB);
CGAL::draw(mpwh);
}
return 0;
Expand Down
24 changes: 24 additions & 0 deletions Polygon_repair/include/CGAL/Polygon_repair/Boolean.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ access to the underlying constrained triangulation.

};



/// \ingroup PkgPolygonRepairFunctions
/// omputes the union of all polygons with holes in `p`
/// \tparam K parameter of the input and output polygons
/// \pre Each polygon with hole must be non-self-intersecting
template <typename K>
Multipolygon_with_holes_2<K>
join(const Multipolygon_with_holes_2<K>& pA)
Expand All @@ -405,6 +411,12 @@ join(const Multipolygon_with_holes_2<K>& pA)
return bops(ltz);
}

/// \ingroup PkgPolygonRepairFunctions
/// computes the union of two polygons
/// \tparam K parameter of the output polygons
/// \tparam PA must be `Polygon_2<K>`, or `Polygon_with_holes_2<K>`, or `Multipolygon_with_holes_2<K>`
/// \tparam PB must be `Polygon_2<K>`, or `Polygon_with_holes_2<K>`, or `Multipolygon_with_holes_2<K>`
/// \pre The polygons `pA` and `pB` must be non-self-intersecting
template <typename PA, typename PB, typename K = Default>
decltype(auto) // Multipolygon_with_holes_2<K>
join(const PA& pA, const PB& pB, const K& = Default())
Expand All @@ -426,6 +438,11 @@ join(const PA& pA, const PB& pB, const K& = Default())
return bops(ltz);
}


/// \ingroup PkgPolygonRepairFunctions
/// computes the intersection of all polygons with holes in `p`
/// \tparam K parameter of the input and output polygons
/// \pre Each polygon with hole must be non-self-intersecting
template <typename K>
Multipolygon_with_holes_2<K>
intersect(const Multipolygon_with_holes_2<K>& pA)
Expand All @@ -449,6 +466,13 @@ intersect(const Multipolygon_with_holes_2<K>& pA)
return bops(equal);
}


/// \ingroup PkgPolygonRepairFunctions
/// Computes the intersection of two polygons
/// \tparam K parameter of the output polygon
/// \tparam PA must be `Polygon_2<K>`, or `Polygon_with_holes_2<K>`, or `Multipolygon_with_holes_2<K>`
/// \tparam PB must be `Polygon_2<K>`, or `Polygon_with_holes_2<K>`, or `Multipolygon_with_holes_2<K>`
/// \pre The polygons `pA` and `pB` must be non-self-intersecting
template <typename PA, typename PB, typename K = Default>
decltype(auto) // Multipolygon_with_holes_2<K>
intersect(const PA& pA, const PB& pB, const K& = Default())
Expand Down

0 comments on commit 17af065

Please sign in to comment.