This commit is contained in:
Andreas Fabri 2025-12-03 14:01:24 +01:00 committed by GitHub
commit 70be71ac34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 42 additions and 0 deletions

View File

@ -45,4 +45,5 @@ construct the constrained Delaunay triangulation after preprocessing by autorefi
\example Constrained_triangulation_3/ccdt_3_fimap_region_growing.cpp
\example Constrained_triangulation_3/ccdt_3_from_soup_fimap.cpp
\example Constrained_triangulation_3/ccdt_3_preprocessing.cpp
\example Constrained_triangulation_3/ccdt_3_with_info.cpp
*/

View File

@ -11,6 +11,7 @@ add_compile_definitions(QT_NO_KEYWORDS)
create_single_source_cgal_program(conforming_constrained_Delaunay_triangulation_3.cpp)
create_single_source_cgal_program(conforming_constrained_Delaunay_triangulation_3_fimap.cpp)
create_single_source_cgal_program(ccdt_3_from_soup.cpp)
create_single_source_cgal_program(ccdt_3_with_info.cpp)
create_single_source_cgal_program(ccdt_3_from_soup_fimap.cpp)
create_single_source_cgal_program(ccdt_3_after_autorefinement.cpp)
create_single_source_cgal_program(ccdt_3_preprocessing.cpp)

View File

@ -0,0 +1,40 @@
#include <vector>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Triangulation_cell_base_with_info_3.h>
#include <CGAL/Triangulation_3.h>
#include <CGAL/Conforming_constrained_Delaunay_triangulation_3.h>
#include <CGAL/property_map.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_3<std::size_t, K> Vb;
typedef CGAL::Conforming_constrained_Delaunay_triangulation_vertex_base_3<K, Vb> CVb;
typedef CGAL::Triangulation_cell_base_with_info_3<bool, K> Cb;
typedef CGAL::Conforming_constrained_Delaunay_triangulation_cell_base_3<K, Cb> CCb;
typedef CGAL::Triangulation_data_structure_3<CVb, CCb> Tds;
typedef CGAL::Triangulation_3<K, Tds> Trig_3;
typedef CGAL::Conforming_constrained_Delaunay_triangulation_3<K, Trig_3> CstrDelaunayTrig_3;
int main()
{
std::vector<std::pair<K::Point_3, std::size_t>> points;
std::vector<std::vector<std::size_t>> polygons;
using First_pmap = CGAL::First_of_pair_property_map<std::pair<K::Point_3, std::size_t>>;
//Initialize the point list
points.push_back({K::Point_3(0, 0, 0), 1});
points.push_back({K::Point_3(1, 0, 0), 2});
points.push_back({K::Point_3(0, 1, 0), 3});
points.push_back({K::Point_3(0, 0, 1), 4});
polygons.push_back({0, 1, 2});
polygons.push_back({0, 1, 3});
CstrDelaunayTrig_3 cdt(points, polygons, CGAL::parameters::point_map(First_pmap()));
for(const auto& v : cdt.triangulation().finite_vertex_handles())
{
std::cout << "Vertex: " << v->point() << ", Info: " << v->info() << std::endl;
}
return 0;
}