diff --git a/.travis/generate_travis.sh b/.travis/generate_travis.sh index c770c9600f0d..cef9ff07c49f 100755 --- a/.travis/generate_travis.sh +++ b/.travis/generate_travis.sh @@ -21,7 +21,7 @@ for f in * do if [ -d "$f/package_info/$f" ] then - echo "$f " >> ./tmp.txt + echo "$f" >> ./tmp.txt fi done LC_ALL=C sort ./tmp.txt > ./.travis/packages.txt diff --git a/.travis/packages.txt b/.travis/packages.txt index 731c19e675c6..b6c8ea4b1f66 100644 --- a/.travis/packages.txt +++ b/.travis/packages.txt @@ -1,138 +1,138 @@ -AABB_tree -Advancing_front_surface_reconstruction -Algebraic_foundations -Algebraic_kernel_d -Algebraic_kernel_for_circles -Algebraic_kernel_for_spheres -Alpha_shapes_2 -Alpha_shapes_3 -Apollonius_graph_2 -Arithmetic_kernel -Arrangement_on_surface_2 -BGL -Barycentric_coordinates_2 -Boolean_set_operations_2 -Bounding_volumes -Box_intersection_d -CGAL_Core -CGAL_ImageIO -CGAL_ipelets -Cartesian_kernel -Circular_kernel_2 -Circular_kernel_3 -Circulator -Classification -Combinatorial_map -Cone_spanners_2 -Convex_decomposition_3 -Convex_hull_2 -Convex_hull_3 -Convex_hull_d -Distance_2 -Distance_3 -Envelope_2 -Envelope_3 -Filtered_kernel -Generalized_map -Generator -Geomview -GraphicsView -HalfedgeDS -Hash_map -Heat_method_3 -Homogeneous_kernel -Hyperbolic_triangulation_2 -Inscribed_areas -Installation -Interpolation -Intersections_2 -Intersections_3 -Interval_skip_list -Interval_support -Inventor -Jet_fitting_3 -Kernel_23 -Kernel_d -LEDA -Linear_cell_complex -MacOSX -Maintenance -Matrix_search -Mesh_2 -Mesh_3 -Mesher_level -Minkowski_sum_2 -Minkowski_sum_3 -Modifier -Modular_arithmetic -Nef_2 -Nef_3 -Nef_S2 -NewKernel_d -Number_types -OpenNL -Optimal_transportation_reconstruction_2 -Optimisation_basic -Partition_2 -Periodic_2_triangulation_2 -Periodic_3_mesh_3 -Periodic_3_triangulation_3 -Periodic_4_hyperbolic_triangulation_2 -Point_set_2 -Point_set_3 -Point_set_processing_3 -Poisson_surface_reconstruction_3 -Polygon -Polygon_mesh_processing -Polygonal_surface_reconstruction -Polyhedron -Polyhedron_IO -Polyline_simplification_2 -Polynomial -Polytope_distance_d -Principal_component_analysis -Principal_component_analysis_LGPL -Profiling_tools -Property_map -QP_solver -Random_numbers -Ridges_3 -STL_Extension -Scale_space_reconstruction_3 -Scripts -SearchStructures -Segment_Delaunay_graph_2 -Segment_Delaunay_graph_Linf_2 -Set_movable_separability_2 -Shape_detection -Skin_surface_3 -Snap_rounding_2 -Solver_interface -Spatial_searching -Spatial_sorting -Straight_skeleton_2 -Stream_lines_2 -Stream_support -Subdivision_method_3 -Surface_mesh -Surface_mesh_approximation -Surface_mesh_deformation -Surface_mesh_parameterization -Surface_mesh_segmentation -Surface_mesh_shortest_path -Surface_mesh_simplification -Surface_mesh_skeletonization -Surface_mesh_topology -Surface_mesher -Surface_sweep_2 -TDS_2 -TDS_3 -Testsuite -Three -Triangulation -Triangulation_2 -Triangulation_3 -Union_find -Visibility_2 -Voronoi_diagram_2 -wininst +AABB_tree +Advancing_front_surface_reconstruction +Algebraic_foundations +Algebraic_kernel_d +Algebraic_kernel_for_circles +Algebraic_kernel_for_spheres +Alpha_shapes_2 +Alpha_shapes_3 +Apollonius_graph_2 +Arithmetic_kernel +Arrangement_on_surface_2 +BGL +Barycentric_coordinates_2 +Boolean_set_operations_2 +Bounding_volumes +Box_intersection_d +CGAL_Core +CGAL_ImageIO +CGAL_ipelets +Cartesian_kernel +Circular_kernel_2 +Circular_kernel_3 +Circulator +Classification +Combinatorial_map +Cone_spanners_2 +Convex_decomposition_3 +Convex_hull_2 +Convex_hull_3 +Convex_hull_d +Distance_2 +Distance_3 +Envelope_2 +Envelope_3 +Filtered_kernel +Generalized_map +Generator +Geomview +GraphicsView +HalfedgeDS +Hash_map +Heat_method_3 +Homogeneous_kernel +Hyperbolic_triangulation_2 +Inscribed_areas +Installation +Interpolation +Intersections_2 +Intersections_3 +Interval_skip_list +Interval_support +Inventor +Jet_fitting_3 +Kernel_23 +Kernel_d +LEDA +Linear_cell_complex +MacOSX +Maintenance +Matrix_search +Mesh_2 +Mesh_3 +Mesher_level +Minkowski_sum_2 +Minkowski_sum_3 +Modifier +Modular_arithmetic +Nef_2 +Nef_3 +Nef_S2 +NewKernel_d +Number_types +OpenNL +Optimal_transportation_reconstruction_2 +Optimisation_basic +Partition_2 +Periodic_2_triangulation_2 +Periodic_3_mesh_3 +Periodic_3_triangulation_3 +Periodic_4_hyperbolic_triangulation_2 +Point_set_2 +Point_set_3 +Point_set_processing_3 +Poisson_surface_reconstruction_3 +Polygon +Polygon_mesh_processing +Polygonal_surface_reconstruction +Polyhedron +Polyhedron_IO +Polyline_simplification_2 +Polynomial +Polytope_distance_d +Principal_component_analysis +Principal_component_analysis_LGPL +Profiling_tools +Property_map +QP_solver +Random_numbers +Ridges_3 +STL_Extension +Scale_space_reconstruction_3 +Scripts +SearchStructures +Segment_Delaunay_graph_2 +Segment_Delaunay_graph_Linf_2 +Set_movable_separability_2 +Shape_detection +Skin_surface_3 +Snap_rounding_2 +Solver_interface +Spatial_searching +Spatial_sorting +Straight_skeleton_2 +Stream_lines_2 +Stream_support +Subdivision_method_3 +Surface_mesh +Surface_mesh_approximation +Surface_mesh_deformation +Surface_mesh_parameterization +Surface_mesh_segmentation +Surface_mesh_shortest_path +Surface_mesh_simplification +Surface_mesh_skeletonization +Surface_mesh_topology +Surface_mesher +Surface_sweep_2 +TDS_2 +TDS_3 +Testsuite +Three +Triangulation +Triangulation_2 +Triangulation_3 +Union_find +Visibility_2 +Voronoi_diagram_2 +wininst diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt index 0716a91ec94c..6199f3c0f0cd 100644 --- a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -10,7 +10,7 @@ if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) else () message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() @@ -20,7 +20,7 @@ find_package( Boost REQUIRED ) # include for local directory if ( NOT Boost_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() # include for local package diff --git a/AABB_tree/benchmark/AABB_tree/test.cpp b/AABB_tree/benchmark/AABB_tree/test.cpp index 22ebbbb08e55..eb2bb6318e4b 100644 --- a/AABB_tree/benchmark/AABB_tree/test.cpp +++ b/AABB_tree/benchmark/AABB_tree/test.cpp @@ -39,7 +39,7 @@ void naive_test(int k, const char* fname, CGAL::Aff_transformation_3 init2(CGAL::TRANSLATION, - K::Vector_3( (box.xmax()-box.xmin()),0,0)); PMP::transform(init2, tm2); - + tmTree.build(); K::Vector_3 unit_vec = (2.0/k * K::Vector_3((box.xmax()-box.xmin()), 0, @@ -56,9 +56,9 @@ void naive_test(int k, const char* fname, rot[7] = std::sin(CGAL_PI/4.0); rot[8] = std::cos(CGAL_PI/4.0); CGAL::Aff_transformation_3 R(rot[0], rot[1], rot[2], - rot[3], rot[4], rot[5], + rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]); - + CGAL::Side_of_triangle_mesh sotm1(tm); for(int i=1; i init2(CGAL::TRANSLATION, - K::Vector_3( (box.xmax()-box.xmin()),0,0)); PMP::transform(init2, tm2); - + tmTree.build(); tmTree2.build(); typedef boost::property_map::type VPM; VPM vpm2 = get(CGAL::vertex_point, tm2); - + K::Vector_3 unit_vec = (2.0/k * K::Vector_3((box.xmax()-box.xmin()), 0, 0)); - + CGAL::Side_of_triangle_mesh sotm1(tmTree); for(int i=1; i R(rot[0], rot[1], rot[2], - rot[3], rot[4], rot[5], + rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]); CGAL::Aff_transformation_3 T1 = CGAL::Aff_transformation_3(CGAL::TRANSLATION, i*unit_vec); CGAL::Aff_transformation_3 transfo = R*T1; @@ -134,10 +134,10 @@ void test_no_collision(int k, const char* fname, CGAL::Interval_nt_advanced::Protector protector; if(tmTree2.do_intersect(tmTree)) ++nb_inter; - else + else { if(sotm1(transfo.transform(vpm2[*tm2.vertices().begin()])) != CGAL::ON_UNBOUNDED_SIDE) - { + { ++nb_include; } else @@ -158,7 +158,7 @@ int main(int argc, const char** argv) int k = (argc>1) ? atoi(argv[1]) : 10; const char* path = (argc>2)?argv[2]:"data/handle" ".off"; - + std::cout<< k<<" steps in "<setupUi(this); + ui = new Ui::MainWindow; + ui->setupUi(this); - // saves some pointers from ui, for latter use. - m_pViewer = ui->viewer; + // saves some pointers from ui, for latter use. + m_pViewer = ui->viewer; - // does not save the state of the viewer - m_pViewer->setStateFileName(QString()); + // does not save the state of the viewer + m_pViewer->setStateFileName(QString()); - // accepts drop events - setAcceptDrops(true); - // setups scene + // accepts drop events + setAcceptDrops(true); + // setups scene m_pScene = new Scene(); - m_pViewer->setScene(m_pScene); + m_pViewer->setScene(m_pScene); m_pViewer->setManipulatedFrame(m_pScene->manipulatedFrame()); - // connects actionQuit (Ctrl+Q) and qApp->quit() - connect(ui->actionQuit, SIGNAL(triggered()), - this, SLOT(quit())); + // connects actionQuit (Ctrl+Q) and qApp->quit() + connect(ui->actionQuit, SIGNAL(triggered()), + this, SLOT(quit())); - this->addRecentFiles(ui->menuFile, ui->actionQuit); - connect(this, SIGNAL(openRecentFile(QString)), - this, SLOT(open(QString))); + this->addRecentFiles(ui->menuFile, ui->actionQuit); + connect(this, SIGNAL(openRecentFile(QString)), + this, SLOT(open(QString))); - readSettings(); + readSettings(); } MainWindow::~MainWindow() { - delete ui; + delete ui; } void MainWindow::dragEnterEvent(QDragEnterEvent *event) { - if (event->mimeData()->hasFormat("text/uri-list")) - event->acceptProposedAction(); + if (event->mimeData()->hasFormat("text/uri-list")) + event->acceptProposedAction(); } void MainWindow::dropEvent(QDropEvent *event) { - Q_FOREACH(QUrl url, event->mimeData()->urls()) { - QString filename = url.toLocalFile(); - if(!filename.isEmpty()) { - QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename); - open(filename); - } - } - event->acceptProposedAction(); + Q_FOREACH(QUrl url, event->mimeData()->urls()) { + QString filename = url.toLocalFile(); + if(!filename.isEmpty()) { + QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename); + open(filename); + } + } + event->acceptProposedAction(); } void MainWindow::updateViewerBBox() { - m_pScene->update_bbox(); - const Scene::Bbox bbox = m_pScene->bbox(); - const double xmin = bbox.xmin(); - const double ymin = bbox.ymin(); - const double zmin = bbox.zmin(); - const double xmax = bbox.xmax(); - const double ymax = bbox.ymax(); - const double zmax = bbox.zmax(); - CGAL::qglviewer::Vec - vec_min(xmin, ymin, zmin), - vec_max(xmax, ymax, zmax); - m_pViewer->setSceneBoundingBox(vec_min,vec_max); - m_pViewer->camera()->showEntireScene(); + m_pScene->update_bbox(); + const Scene::Bbox bbox = m_pScene->bbox(); + const double xmin = bbox.xmin(); + const double ymin = bbox.ymin(); + const double zmin = bbox.zmin(); + const double xmax = bbox.xmax(); + const double ymax = bbox.ymax(); + const double zmax = bbox.zmax(); + CGAL::qglviewer::Vec + vec_min(xmin, ymin, zmin), + vec_max(xmax, ymax, zmax); + m_pViewer->setSceneBoundingBox(vec_min,vec_max); + m_pViewer->camera()->showEntireScene(); } void MainWindow::open(QString filename) { - QFileInfo fileinfo(filename); - if(fileinfo.isFile() && fileinfo.isReadable()) - { - int index = m_pScene->open(filename); - if(index >= 0) - { - QSettings settings; - settings.setValue("OFF open directory", - fileinfo.absoluteDir().absolutePath()); - this->addToRecentFiles(filename); - - // update bbox - updateViewerBBox(); + QFileInfo fileinfo(filename); + if(fileinfo.isFile() && fileinfo.isReadable()) + { + int index = m_pScene->open(filename); + if(index >= 0) + { + QSettings settings; + settings.setValue("OFF open directory", + fileinfo.absoluteDir().absolutePath()); + this->addToRecentFiles(filename); + + // update bbox + updateViewerBBox(); m_pViewer->update(); - } - } + } + } } void MainWindow::readSettings() { - this->readState("MainWindow", Size|State); + this->readState("MainWindow", Size|State); } void MainWindow::writeSettings() { - this->writeState("MainWindow"); - std::cerr << "Write setting... done.\n"; + this->writeState("MainWindow"); + std::cerr << "Write setting... done.\n"; } void MainWindow::quit() { - writeSettings(); - close(); + writeSettings(); + close(); } void MainWindow::closeEvent(QCloseEvent *event) { - writeSettings(); - event->accept(); + writeSettings(); + event->accept(); } void MainWindow::on_actionLoadPolyhedron_triggered() { - QSettings settings; - QString directory = settings.value("OFF open directory", - QDir::current().dirName()).toString(); - QStringList filenames = - QFileDialog::getOpenFileNames(this, - tr("Load polyhedron..."), - directory, - tr("OFF files (*.off)\n" - "All files (*)")); - if(!filenames.isEmpty()) { - Q_FOREACH(QString filename, filenames) { - open(filename); - } - } + QSettings settings; + QString directory = settings.value("OFF open directory", + QDir::current().dirName()).toString(); + QStringList filenames = + QFileDialog::getOpenFileNames(this, + tr("Load polyhedron..."), + directory, + tr("OFF files (*.off)\n" + "All files (*)")); + if(!filenames.isEmpty()) { + Q_FOREACH(QString filename, filenames) { + open(filename); + } + } } void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m) { - m_pViewer->setAddKeyFrameKeyboardModifiers(m); + m_pViewer->setAddKeyFrameKeyboardModifiers(m); } void MainWindow::on_actionInside_points_triggered() { - bool ok; - - const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", - "#Points:",10000,1,100000000,9,&ok); + bool ok; - if(!ok) - return; + const unsigned int nb_points = (unsigned) + QInputDialog::getInt(NULL, "#Points", + "#Points:",10000,1,100000000,9,&ok); - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->generate_inside_points(nb_points); - QApplication::restoreOverrideCursor(); + if(!ok) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->generate_inside_points(nb_points); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionPoints_in_interval_triggered() { - bool ok; - - const unsigned int nb_points = (unsigned) + bool ok; + + const unsigned int nb_points = (unsigned) QInputDialog::getInt(NULL, "#Points", - "#Points:",10000,1,100000000,9,&ok); - - if(!ok) - return; - - const double min = - QInputDialog::getDouble(NULL, "min", - "Min:",-0.1,-1000.0,1000.0,9,&ok); - if(!ok) - return; - const double max = - QInputDialog::getDouble(NULL, "max", - "Max:",0.1,-1000.0,1000.0,9,&ok); - if(!ok) - return; - - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->generate_points_in(nb_points,min,max); - QApplication::restoreOverrideCursor(); + "#Points:",10000,1,100000000,9,&ok); + + if(!ok) + return; + + const double min = + QInputDialog::getDouble(NULL, "min", + "Min:",-0.1,-1000.0,1000.0,9,&ok); + if(!ok) + return; + const double max = + QInputDialog::getDouble(NULL, "max", + "Max:",0.1,-1000.0,1000.0,9,&ok); + if(!ok) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->generate_points_in(nb_points,min,max); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionBoundary_segments_triggered() { - bool ok; - - const unsigned int nb_slices = (unsigned) - QInputDialog::getInt(NULL, "#Slices", - "Slices:",100,1,1000000,8,&ok); + bool ok; - if(!ok) - return; + const unsigned int nb_slices = (unsigned) + QInputDialog::getInt(NULL, "#Slices", + "Slices:",100,1,1000000,8,&ok); - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->generate_boundary_segments(nb_slices); - QApplication::restoreOverrideCursor(); + if(!ok) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->generate_boundary_segments(nb_slices); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionBoundary_points_triggered() { - bool ok; + bool ok; - const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", - "Points:",1000,1,10000000,8,&ok); + const unsigned int nb_points = (unsigned) + QInputDialog::getInt(NULL, "#Points", + "Points:",1000,1,10000000,8,&ok); - if(!ok) - return; + if(!ok) + return; - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->generate_boundary_points(nb_points); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->generate_boundary_points(nb_points); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionEdge_points_triggered() { - bool ok; + bool ok; - const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", - "Points:",1000,1,10000000,8,&ok); + const unsigned int nb_points = (unsigned) + QInputDialog::getInt(NULL, "#Points", + "Points:",1000,1,10000000,8,&ok); - if(!ok) - return; + if(!ok) + return; - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->generate_edge_points(nb_points); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->generate_edge_points(nb_points); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionBench_distances_triggered() { - bool ok; - const double duration = QInputDialog::getDouble(NULL, "Duration", - "Duration (s):",1.0,0.01,1000,8,&ok); - if(!ok) - return; + bool ok; + const double duration = QInputDialog::getDouble(NULL, "Duration", + "Duration (s):",1.0,0.01,1000,8,&ok); + if(!ok) + return; - QApplication::setOverrideCursor(Qt::WaitCursor); - std::cout << std::endl << "Benchmark distances" << std::endl; - m_pScene->benchmark_distances(duration); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + std::cout << std::endl << "Benchmark distances" << std::endl; + m_pScene->benchmark_distances(duration); + QApplication::restoreOverrideCursor(); } void MainWindow::on_actionBench_intersections_triggered() { - bool ok; - const double duration = QInputDialog::getDouble(NULL, "Duration", - "Duration (s):",1.0,0.01,1000.0,8,&ok); - if(!ok) - return; + bool ok; + const double duration = QInputDialog::getDouble(NULL, "Duration", + "Duration (s):",1.0,0.01,1000.0,8,&ok); + if(!ok) + return; - QApplication::setOverrideCursor(Qt::WaitCursor); - std::cout << std::endl << "Benchmark intersections" << std::endl; - m_pScene->benchmark_intersections(duration); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + std::cout << std::endl << "Benchmark intersections" << std::endl; + m_pScene->benchmark_intersections(duration); + QApplication::restoreOverrideCursor(); } void MainWindow::on_actionUnsigned_distance_function_to_facets_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); + QApplication::setOverrideCursor(Qt::WaitCursor); m_pScene->activate_cutting_plane(); - m_pScene->unsigned_distance_function(); - QApplication::restoreOverrideCursor(); + m_pScene->unsigned_distance_function(); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionUnsigned_distance_function_to_edges_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); + QApplication::setOverrideCursor(Qt::WaitCursor); m_pScene->activate_cutting_plane(); - m_pScene->unsigned_distance_function_to_edges(); - QApplication::restoreOverrideCursor(); + m_pScene->unsigned_distance_function_to_edges(); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionSigned_distance_function_to_facets_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); + QApplication::setOverrideCursor(Qt::WaitCursor); m_pScene->activate_cutting_plane(); - m_pScene->signed_distance_function(); - QApplication::restoreOverrideCursor(); + m_pScene->signed_distance_function(); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } @@ -318,19 +318,19 @@ void MainWindow::on_actionCutting_plane_none_triggered() void MainWindow::on_actionView_polyhedron_triggered() { - m_pScene->toggle_view_poyhedron(); + m_pScene->toggle_view_poyhedron(); m_pViewer->update(); } void MainWindow::on_actionView_points_triggered() { - m_pScene->toggle_view_points(); + m_pScene->toggle_view_points(); m_pViewer->update(); } void MainWindow::on_actionView_segments_triggered() { - m_pScene->toggle_view_segments(); + m_pScene->toggle_view_segments(); m_pViewer->update(); } @@ -342,13 +342,13 @@ void MainWindow::on_actionView_cutting_plane_triggered() void MainWindow::on_actionClear_points_triggered() { - m_pScene->clear_points(); + m_pScene->clear_points(); m_pViewer->update(); } void MainWindow::on_actionClear_segments_triggered() { - m_pScene->clear_segments(); + m_pScene->clear_segments(); m_pViewer->update(); } @@ -360,52 +360,52 @@ void MainWindow::on_actionClear_cutting_plane_triggered() void MainWindow::on_actionRefine_bisection_triggered() { - bool ok; - const double max_len = - QInputDialog::getDouble(NULL, "Max edge len", - "Max edge len:",0.1,0.001,100.0,9,&ok); - if(!ok) - return; + bool ok; + const double max_len = + QInputDialog::getDouble(NULL, "Max edge len", + "Max edge len:",0.1,0.001,100.0,9,&ok); + if(!ok) + return; - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->refine_bisection(max_len * max_len); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->refine_bisection(max_len * max_len); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } void MainWindow::on_actionBench_memory_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->bench_memory(); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->bench_memory(); + QApplication::restoreOverrideCursor(); } void MainWindow::on_actionBench_construction_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->bench_construction(); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->bench_construction(); + QApplication::restoreOverrideCursor(); } void MainWindow::on_actionBench_intersections_vs_nbt_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->bench_intersections_vs_nbt(); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->bench_intersections_vs_nbt(); + QApplication::restoreOverrideCursor(); } void MainWindow::on_actionBench_distances_vs_nbt_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->bench_distances_vs_nbt(); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->bench_distances_vs_nbt(); + QApplication::restoreOverrideCursor(); } void MainWindow::on_actionRefine_loop_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_pScene->refine_loop(); - QApplication::restoreOverrideCursor(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_pScene->refine_loop(); + QApplication::restoreOverrideCursor(); m_pViewer->update(); } diff --git a/AABB_tree/demo/AABB_tree/MainWindow.h b/AABB_tree/demo/AABB_tree/MainWindow.h index f04725eaad16..3dac40b96d5a 100644 --- a/AABB_tree/demo/AABB_tree/MainWindow.h +++ b/AABB_tree/demo/AABB_tree/MainWindow.h @@ -9,79 +9,79 @@ class QDropEvent; class Scene; class Viewer; namespace Ui { - class MainWindow; + class MainWindow; } -class MainWindow : - public CGAL::Qt::DemosMainWindow +class MainWindow : + public CGAL::Qt::DemosMainWindow { - Q_OBJECT + Q_OBJECT public: - MainWindow(QWidget* parent = 0); - ~MainWindow(); + MainWindow(QWidget* parent = 0); + ~MainWindow(); - public slots: - void updateViewerBBox(); - void open(QString filename); - void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers); + public slots: + void updateViewerBBox(); + void open(QString filename); + void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers); - protected slots: + protected slots: - // settings - void quit(); - void readSettings(); - void writeSettings(); + // settings + void quit(); + void readSettings(); + void writeSettings(); - // drag & drop - void dropEvent(QDropEvent *event); - void closeEvent(QCloseEvent *event); - void dragEnterEvent(QDragEnterEvent *event); + // drag & drop + void dropEvent(QDropEvent *event); + void closeEvent(QCloseEvent *event); + void dragEnterEvent(QDragEnterEvent *event); - // file menu - void on_actionLoadPolyhedron_triggered(); + // file menu + void on_actionLoadPolyhedron_triggered(); - // edit menu + // edit menu void on_actionSave_snapshot_triggered(); void on_actionCopy_snapshot_triggered(); - void on_actionClear_points_triggered(); - void on_actionClear_segments_triggered(); + void on_actionClear_points_triggered(); + void on_actionClear_segments_triggered(); void on_actionClear_cutting_plane_triggered(); - // algorithm menu + // algorithm menu void on_actionRefine_loop_triggered(); - void on_actionEdge_points_triggered(); - void on_actionInside_points_triggered(); - void on_actionBoundary_points_triggered(); - void on_actionRefine_bisection_triggered(); - void on_actionBoundary_segments_triggered(); + void on_actionEdge_points_triggered(); + void on_actionInside_points_triggered(); + void on_actionBoundary_points_triggered(); + void on_actionRefine_bisection_triggered(); + void on_actionBoundary_segments_triggered(); void on_actionPoints_in_interval_triggered(); - void on_actionSigned_distance_function_to_facets_triggered(); - void on_actionUnsigned_distance_function_to_edges_triggered(); - void on_actionUnsigned_distance_function_to_facets_triggered(); + void on_actionSigned_distance_function_to_facets_triggered(); + void on_actionUnsigned_distance_function_to_edges_triggered(); + void on_actionUnsigned_distance_function_to_facets_triggered(); void on_actionIntersection_cutting_plane_triggered(); void on_actionCutting_plane_none_triggered(); - // benchmark menu - void on_actionBench_memory_triggered(); - void on_actionBench_distances_triggered(); - void on_actionBench_intersections_triggered(); + // benchmark menu + void on_actionBench_memory_triggered(); + void on_actionBench_distances_triggered(); + void on_actionBench_intersections_triggered(); - // benchmark against #triangles - void on_actionBench_construction_triggered(); - void on_actionBench_distances_vs_nbt_triggered(); - void on_actionBench_intersections_vs_nbt_triggered(); + // benchmark against #triangles + void on_actionBench_construction_triggered(); + void on_actionBench_distances_vs_nbt_triggered(); + void on_actionBench_intersections_vs_nbt_triggered(); - // view menu - void on_actionView_points_triggered(); - void on_actionView_segments_triggered(); - void on_actionView_polyhedron_triggered(); + // view menu + void on_actionView_points_triggered(); + void on_actionView_segments_triggered(); + void on_actionView_polyhedron_triggered(); void on_actionView_cutting_plane_triggered(); private: - Scene* m_pScene; - Viewer* m_pViewer; - Ui::MainWindow* ui; + Scene* m_pScene; + Viewer* m_pViewer; + Ui::MainWindow* ui; }; #endif // ifndef MAINWINDOW_H diff --git a/AABB_tree/demo/AABB_tree/Refiner.h b/AABB_tree/demo/AABB_tree/Refiner.h index f03c0ef42166..f0c27be63ed7 100644 --- a/AABB_tree/demo/AABB_tree/Refiner.h +++ b/AABB_tree/demo/AABB_tree/Refiner.h @@ -5,190 +5,190 @@ #include #include -template +template class CEdge { public: - typedef typename Kernel::FT FT; - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Kernel::FT FT; + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; private: - FT m_sqlen; - Halfedge_handle m_he; + FT m_sqlen; + Halfedge_handle m_he; public: - // life cycle - CEdge(const Halfedge_handle& he) - { - m_sqlen = squared_len(he); - m_he = he; - } - CEdge(const CEdge& edge) - : m_sqlen(edge.sqlen()), - m_he(edge.he()) - { - } - ~CEdge() {} + // life cycle + CEdge(const Halfedge_handle& he) + { + m_sqlen = squared_len(he); + m_he = he; + } + CEdge(const CEdge& edge) + : m_sqlen(edge.sqlen()), + m_he(edge.he()) + { + } + ~CEdge() {} public: - // squared length of an edge - static FT squared_len(Halfedge_handle he) - { - return CGAL::squared_distance(he->vertex()->point(), - he->opposite()->vertex()->point()); - } + // squared length of an edge + static FT squared_len(Halfedge_handle he) + { + return CGAL::squared_distance(he->vertex()->point(), + he->opposite()->vertex()->point()); + } public: - // accessors - FT& sqlen() { return m_sqlen; } - const FT sqlen() const { return m_sqlen; } + // accessors + FT& sqlen() { return m_sqlen; } + const FT sqlen() const { return m_sqlen; } - Halfedge_handle he() { return m_he; } - const Halfedge_handle he() const { return m_he; } + Halfedge_handle he() { return m_he; } + const Halfedge_handle he() const { return m_he; } }; // functor for priority queue template struct less // read more priority -{ - bool operator()(const Edge& e1, - const Edge& e2) const - { - return e1.sqlen() < e2.sqlen(); - } +{ + bool operator()(const Edge& e1, + const Edge& e2) const + { + return e1.sqlen() < e2.sqlen(); + } }; -template +template class Refiner { - // types - typedef typename Kernel::FT FT; - typedef CEdge Edge; - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Edge_iterator Edge_iterator; - typedef std::priority_queue, - ::less > PQueue; - // data - PQueue m_queue; - Polyhedron* m_pMesh; + // types + typedef typename Kernel::FT FT; + typedef CEdge Edge; + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Edge_iterator Edge_iterator; + typedef std::priority_queue, + ::less > PQueue; + // data + PQueue m_queue; + Polyhedron* m_pMesh; public : - // life cycle - Refiner(Polyhedron* pMesh) - { - m_pMesh = pMesh; - } - ~Refiner() {} + // life cycle + Refiner(Polyhedron* pMesh) + { + m_pMesh = pMesh; + } + ~Refiner() {} public : - void fill_queue(const FT& max_sqlen) - { - for(Edge_iterator he = m_pMesh->edges_begin(); - he != m_pMesh->edges_end(); - he++) - if(Edge::squared_len(he) > max_sqlen) - m_queue.push(Edge(he)); - } - - void fill_queue() - { - for(Edge_iterator he = m_pMesh->edges_begin(); - he != m_pMesh->edges_end(); - he++) - m_queue.push(Edge(he)); - } - - // run - void run_nb_splits(const unsigned int nb_splits) - { - // fill queue - fill_queue(); - - unsigned int nb = 0; - while(nb < nb_splits) - { - // get a copy of the candidate edge - Edge edge = m_queue.top(); - m_queue.pop(); - - Halfedge_handle he = edge.he(); - // update point - Halfedge_handle hnew = m_pMesh->split_edge(he); - hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(), - he->opposite()->vertex()->point()); - - // hit has been split into two edges - m_queue.push(Edge(hnew)); - m_queue.push(Edge(he)); - - // split facet if possible - if(!hnew->is_border()) - { - m_pMesh->split_facet(hnew,hnew->next()->next()); - m_queue.push(Edge(hnew->next())); - } - - // split facet if possible - if(!hnew->opposite()->is_border()) - { - m_pMesh->split_facet(hnew->opposite()->next(), - hnew->opposite()->next()->next()->next()); - m_queue.push(Edge(hnew->opposite()->prev())); - } - - nb++; - } // end while - } // end run - - - - // run - unsigned int operator()(const FT& max_sqlen) - { - // fill queue - fill_queue(max_sqlen); - - unsigned int nb_split = 0; - while(!m_queue.empty()) - { - // get a copy of the candidate edge - Edge edge = m_queue.top(); - m_queue.pop(); - - Halfedge_handle he = edge.he(); - FT sqlen = Edge::squared_len(he); - if(sqlen > max_sqlen) - { - // update point - Halfedge_handle hnew = m_pMesh->split_edge(he); - hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(), - he->opposite()->vertex()->point()); - - // hit has been split into two edges - m_queue.push(Edge(hnew)); - m_queue.push(Edge(he)); - - // split facet if possible - if(!hnew->is_border()) - { - m_pMesh->split_facet(hnew,hnew->next()->next()); - m_queue.push(Edge(hnew->next())); - } - - // split facet if possible - if(!hnew->opposite()->is_border()) - { - m_pMesh->split_facet(hnew->opposite()->next(), - hnew->opposite()->next()->next()->next()); - m_queue.push(Edge(hnew->opposite()->prev())); - } - - nb_split++; - } // end if(sqlen > max_sqlen) - } // end while(!m_queue.empty()) - return nb_split; - } // end run + void fill_queue(const FT& max_sqlen) + { + for(Edge_iterator he = m_pMesh->edges_begin(); + he != m_pMesh->edges_end(); + he++) + if(Edge::squared_len(he) > max_sqlen) + m_queue.push(Edge(he)); + } + + void fill_queue() + { + for(Edge_iterator he = m_pMesh->edges_begin(); + he != m_pMesh->edges_end(); + he++) + m_queue.push(Edge(he)); + } + + // run + void run_nb_splits(const unsigned int nb_splits) + { + // fill queue + fill_queue(); + + unsigned int nb = 0; + while(nb < nb_splits) + { + // get a copy of the candidate edge + Edge edge = m_queue.top(); + m_queue.pop(); + + Halfedge_handle he = edge.he(); + // update point + Halfedge_handle hnew = m_pMesh->split_edge(he); + hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(), + he->opposite()->vertex()->point()); + + // hit has been split into two edges + m_queue.push(Edge(hnew)); + m_queue.push(Edge(he)); + + // split facet if possible + if(!hnew->is_border()) + { + m_pMesh->split_facet(hnew,hnew->next()->next()); + m_queue.push(Edge(hnew->next())); + } + + // split facet if possible + if(!hnew->opposite()->is_border()) + { + m_pMesh->split_facet(hnew->opposite()->next(), + hnew->opposite()->next()->next()->next()); + m_queue.push(Edge(hnew->opposite()->prev())); + } + + nb++; + } // end while + } // end run + + + + // run + unsigned int operator()(const FT& max_sqlen) + { + // fill queue + fill_queue(max_sqlen); + + unsigned int nb_split = 0; + while(!m_queue.empty()) + { + // get a copy of the candidate edge + Edge edge = m_queue.top(); + m_queue.pop(); + + Halfedge_handle he = edge.he(); + FT sqlen = Edge::squared_len(he); + if(sqlen > max_sqlen) + { + // update point + Halfedge_handle hnew = m_pMesh->split_edge(he); + hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(), + he->opposite()->vertex()->point()); + + // hit has been split into two edges + m_queue.push(Edge(hnew)); + m_queue.push(Edge(he)); + + // split facet if possible + if(!hnew->is_border()) + { + m_pMesh->split_facet(hnew,hnew->next()->next()); + m_queue.push(Edge(hnew->next())); + } + + // split facet if possible + if(!hnew->opposite()->is_border()) + { + m_pMesh->split_facet(hnew->opposite()->next(), + hnew->opposite()->next()->next()->next()); + m_queue.push(Edge(hnew->opposite()->prev())); + } + + nb_split++; + } // end if(sqlen > max_sqlen) + } // end while(!m_queue.empty()) + return nb_split; + } // end run }; #endif // _REFINER_H_ diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp index a0bc61b75d05..f96ac2035262 100644 --- a/AABB_tree/demo/AABB_tree/Scene.cpp +++ b/AABB_tree/demo/AABB_tree/Scene.cpp @@ -590,7 +590,7 @@ void Scene::update_bbox() } void Scene::draw(CGAL::QGLViewer* viewer) -{ +{ if(!gl_init) initGL(); if(!are_buffers_initialized) diff --git a/AABB_tree/demo/AABB_tree/Scene.h b/AABB_tree/demo/AABB_tree/Scene.h index 8bf07460af21..aad623688741 100644 --- a/AABB_tree/demo/AABB_tree/Scene.h +++ b/AABB_tree/demo/AABB_tree/Scene.h @@ -60,22 +60,22 @@ class Scene : public QObject public: // types typedef CGAL::Bbox_3 Bbox; - + private: typedef CGAL::AABB_face_graph_triangle_primitive Facet_Primitive; typedef CGAL::AABB_traits Facet_Traits; typedef CGAL::AABB_tree Facet_tree; - + typedef CGAL::AABB_halfedge_graph_segment_primitive Edge_Primitive; typedef CGAL::AABB_traits Edge_Traits; typedef CGAL::AABB_tree Edge_tree; - + typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame; - + enum Cut_planes_types { NONE, UNSIGNED_FACETS, SIGNED_FACETS, UNSIGNED_EDGES, CUT_SEGMENTS }; - + public: QGLContext* context; void draw(CGAL::QGLViewer*); @@ -102,7 +102,7 @@ class Scene : public QObject FT m_max_distance_function; typedef std::pair Point_distance; Point_distance m_distance_function[100][100]; - + // frame ManipulatedFrame* m_frame; bool m_view_plane; @@ -112,10 +112,10 @@ class Scene : public QObject // An aabb_tree indexing polyhedron facets/segments Facet_tree m_facet_tree; Edge_tree m_edge_tree; - + Cut_planes_types m_cut_plane; bool are_buffers_initialized; - + private: // utility functions Vector random_vector(); @@ -135,7 +135,7 @@ class Scene : public QObject template void compute_distance_function(const Tree& tree); - + template void sign_distance_function(const Tree& tree); @@ -182,7 +182,7 @@ class Scene : public QObject void clear_points() { m_points.clear(); changed(); } void clear_segments() { m_segments.clear(); changed(); } void clear_cutting_plane(); - + // fast distance setter void set_fast_distance(bool b) { m_fast_distance = b; update_grid_size(); } @@ -198,7 +198,7 @@ class Scene : public QObject void refine_loop(); void refine_bisection(const FT max_sqlen); - // distance functions + // distance functions void signed_distance_function(); void unsigned_distance_function(); void unsigned_distance_function_to_edges(); @@ -215,7 +215,7 @@ class Scene : public QObject bool m_view_segments; bool m_view_polyhedron; - // benchmarks + // benchmarks enum {DO_INTERSECT, ANY_INTERSECTION, NB_INTERSECTIONS, @@ -254,7 +254,7 @@ class Scene : public QObject //timer sends a top when all the events are finished void timerEvent(QTimerEvent *); - + public slots: // cutting plane void cutting_plane(bool override = false); diff --git a/AABB_tree/demo/AABB_tree/Viewer.cpp b/AABB_tree/demo/AABB_tree/Viewer.cpp index a1d017235814..348960c5e23e 100644 --- a/AABB_tree/demo/AABB_tree/Viewer.cpp +++ b/AABB_tree/demo/AABB_tree/Viewer.cpp @@ -42,7 +42,7 @@ void Viewer::mousePressEvent(QMouseEvent* e) m_pScene->cutting_plane(true); m_custom_mouse = true; } - + CGAL::QGLViewer::mousePressEvent(e); } @@ -55,10 +55,10 @@ void Viewer::mouseReleaseEvent(QMouseEvent* e) QApplication::setOverrideCursor(Qt::WaitCursor); m_pScene->cutting_plane(true); QApplication::restoreOverrideCursor(); - + m_custom_mouse = false; } - + CGAL::QGLViewer::mouseReleaseEvent(e); } diff --git a/AABB_tree/demo/AABB_tree/Viewer.h b/AABB_tree/demo/AABB_tree/Viewer.h index 696dd0f0ddd6..2bad72876f11 100644 --- a/AABB_tree/demo/AABB_tree/Viewer.h +++ b/AABB_tree/demo/AABB_tree/Viewer.h @@ -22,7 +22,7 @@ class Viewer : public CGAL::QGLViewer{ protected: virtual void mousePressEvent(QMouseEvent* e); virtual void mouseReleaseEvent(QMouseEvent* e); - + private: Scene* m_pScene; bool m_custom_mouse; diff --git a/AABB_tree/demo/AABB_tree/benchmarks.cpp b/AABB_tree/demo/AABB_tree/benchmarks.cpp index 364d19bc04ef..742b07c9a8ce 100644 --- a/AABB_tree/demo/AABB_tree/benchmarks.cpp +++ b/AABB_tree/demo/AABB_tree/benchmarks.cpp @@ -97,7 +97,7 @@ std::size_t Scene::nb_digits(std::size_t value) } // bench memory against number of facets in the tree -// the tree is reconstructed each timer in the mesh +// the tree is reconstructed each timer in the mesh // refinement loop void Scene::bench_memory() { @@ -166,8 +166,8 @@ void Scene::bench_construction() Facet_tree tree2(faces(*m_pPolyhedron).first, faces(*m_pPolyhedron).second,*m_pPolyhedron); double duration_construction_and_kdtree = time2.time(); - std::cout << m_pPolyhedron->size_of_facets() << "\t" - << duration_construction_alone << "\t" + std::cout << m_pPolyhedron->size_of_facets() << "\t" + << duration_construction_alone << "\t" << duration_construction_and_kdtree << std::endl; } } diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h index c5b4eb97f1b3..2f0d0926c221 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h @@ -3,7 +3,7 @@ \ingroup PkgAABBTreeConcepts \cgalConcept -The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class `CGAL::AABB_traits`. It provides predicates and constructors to detect and compute intersections between query objects and the primitives stored in the AABB tree. In addition, it contains predicates and constructors to compute distances between a point query and the primitives stored in the AABB tree. +The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class `CGAL::AABB_traits`. It provides predicates and constructors to detect and compute intersections between query objects and the primitives stored in the AABB tree. In addition, it contains predicates and constructors to compute distances between a point query and the primitives stored in the AABB tree. \cgalRefines `SearchGeomTraits_3` @@ -16,7 +16,7 @@ The concept `AABBGeomTraits` defines the requirements for the first template par class AABBGeomTraits { public: -/// \name Types +/// \name Types /// @{ /*! @@ -25,50 +25,50 @@ A number type model of `Field`. typedef unspecified_type FT; /*! -Sphere type, that should be consistent with the distance function chosen for the distance queries, namely the `Squared_distance_3` functor. -*/ -typedef unspecified_type Sphere_3; +Sphere type, that should be consistent with the distance function chosen for the distance queries, namely the `Squared_distance_3` functor. +*/ +typedef unspecified_type Sphere_3; /*! Point type. -*/ -typedef unspecified_type Point_3; +*/ +typedef unspecified_type Point_3; /*! -A functor object to detect intersections between two geometric objects. -Provides the operators: -`bool operator()(const Type_1& type_1, const Type_2& type_2);` -where `Type_1` and `Type_2` are relevant types -among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box), and a solid primitive is tested against another solid primitive (box against box). The operator returns `true` iff `type_1` and `type_2` have a non empty intersection. -*/ -typedef unspecified_type Do_intersect_3; +A functor object to detect intersections between two geometric objects. +Provides the operators: +`bool operator()(const Type_1& type_1, const Type_2& type_2);` +where `Type_1` and `Type_2` are relevant types +among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box), and a solid primitive is tested against another solid primitive (box against box). The operator returns `true` iff `type_1` and `type_2` have a non empty intersection. +*/ +typedef unspecified_type Do_intersect_3; /*! A functor object to construct the intersection between two geometric objects. -This functor must support the result_of protocol, that is the return +This functor must support the result_of protocol, that is the return type of the `operator()(A, B)` is `CGAL::cpp11::result`. -Provides the operators: -`CGAL::cpp11::result operator()(const A& a, const B& b);` -where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`, -`Triangle_3`, `Plane_3` and `Bbox_3`. -Relevant herein means that a line primitive (ray, segment, line) is tested -against a planar or solid primitive (plane, triangle, box). -A model of `Kernel::Intersect_3` fulfills those requirements. -*/ -typedef unspecified_type Intersect_3; +Provides the operators: +`CGAL::cpp11::result operator()(const A& a, const B& b);` +where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`, +`Triangle_3`, `Plane_3` and `Bbox_3`. +Relevant herein means that a line primitive (ray, segment, line) is tested +against a planar or solid primitive (plane, triangle, box). +A model of `Kernel::Intersect_3` fulfills those requirements. +*/ +typedef unspecified_type Intersect_3; /*! -A functor object to construct the sphere centered at one point and passing through another one. Provides the operator: +A functor object to construct the sphere centered at one point and passing through another one. Provides the operator: - `Sphere_3 operator()(const Point_3& p, const FT & sr)` which returns the sphere centered at `p` with `sr` as squared radius. -*/ -typedef unspecified_type Construct_sphere_3; +*/ +typedef unspecified_type Construct_sphere_3; /*! -A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator: -`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`. -The operator returns the point on `type_2` which is closest to `p`. -*/ +A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator: +`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`. +The operator returns the point on `type_2` which is closest to `p`. +*/ typedef unspecified_type Construct_projected_point_3; /*! @@ -79,17 +79,17 @@ Provides the operator: typedef unspecified_type Compare_distance_3; /*! -A functor object to detect if a point lies inside a sphere or not. -Provides the operator: -`bool operator()(const Sphere_3& s, const Point_3& p);` which returns `true` iff the closed volume bounded by `s` contains `p`. -*/ -typedef unspecified_type Has_on_bounded_side_3; +A functor object to detect if a point lies inside a sphere or not. +Provides the operator: +`bool operator()(const Sphere_3& s, const Point_3& p);` which returns `true` iff the closed volume bounded by `s` contains `p`. +*/ +typedef unspecified_type Has_on_bounded_side_3; /*! -A functor object to compute the squared radius of a sphere. Provides the operator: -`FT operator()(const Sphere_3& s);` which returns the squared radius of `s`. -*/ -typedef unspecified_type Compute_squared_radius_3; +A functor object to compute the squared radius of a sphere. Provides the operator: +`FT operator()(const Sphere_3& s);` which returns the squared radius of `s`. +*/ +typedef unspecified_type Compute_squared_radius_3; /*! A functor object to compute the squared distance between two points. Provides the operator: @@ -126,29 +126,29 @@ typedef unspecified_type Equal_3; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the intersection detection functor. -*/ -Do_intersect_3 do_intersect_3_object(); +Returns the intersection detection functor. +*/ +Do_intersect_3 do_intersect_3_object(); /*! -Returns the intersection constructor. -*/ -Intersect_3 intersect_3_object(); +Returns the intersection constructor. +*/ +Intersect_3 intersect_3_object(); /*! Returns the sphere constructor. -*/ -Construct_sphere_3 construct_sphere_3_object(); +*/ +Construct_sphere_3 construct_sphere_3_object(); /*! -Returns the closest point constructor. -*/ +Returns the closest point constructor. +*/ Construct_projected_point_3 construct_projected_point_3_object(); /*! @@ -157,14 +157,14 @@ Returns the compare distance constructor. Compare_distance_3 compare_distance_3_object(); /*! -Returns the closest point constructor. -*/ -Has_on_bounded_side_3 has_on_bounded_side_3_object(); +Returns the closest point constructor. +*/ +Has_on_bounded_side_3 has_on_bounded_side_3_object(); /*! -Returns the squared radius functor. -*/ -Compute_squared_radius_3 compute_squared_radius_3_object(); +Returns the squared radius functor. +*/ +Compute_squared_radius_3 compute_squared_radius_3_object(); /*! Returns the squared distance functor. diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h b/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h index 64962d12741f..1e6ece8051c9 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h @@ -3,14 +3,14 @@ \ingroup PkgAABBTreeConcepts \cgalConcept -The concept `AABBPrimitive` describes the requirements for the primitives stored in the AABB tree data structure. The concept encapsulates a type for the input datum (a geometric object) and an identifier (id) type through which those primitives are referred to. The concept `AABBPrimitive` also refines the concepts DefaultConstructible and Assignable. +The concept `AABBPrimitive` describes the requirements for the primitives stored in the AABB tree data structure. The concept encapsulates a type for the input datum (a geometric object) and an identifier (id) type through which those primitives are referred to. The concept `AABBPrimitive` also refines the concepts DefaultConstructible and Assignable. -\sa `CGAL::AABB_tree` +\sa `CGAL::AABB_tree` \sa `AABBPrimitiveWithSharedData` \cgalHeading{Example} -The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency. +The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency. \cgalHasModel `CGAL::AABB_primitive` \cgalHasModel `CGAL::AABB_segment_primitive` @@ -22,18 +22,18 @@ The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for insta class AABBPrimitive { public: -/// \name Types +/// \name Types /// @{ /*! -3D point type. -*/ -typedef unspecified_type Point; +3D point type. +*/ +typedef unspecified_type Point; /*! -Type of input datum. -*/ -typedef unspecified_type Datum; +Type of input datum. +*/ +typedef unspecified_type Datum; /*! Point reference type returned by the function `point()`. It is convertible to the type `Point`. @@ -46,29 +46,29 @@ Datum reference type returned by the function `datum()`. It is convertible to th typedef unspecified_type Datum_reference; /*! -Type of identifiers through which the input objects are referred to. It must be a model of the concepts DefaultConstructible and Assignable. -*/ -typedef unspecified_type Id; +Type of identifiers through which the input objects are referred to. It must be a model of the concepts DefaultConstructible and Assignable. +*/ +typedef unspecified_type Id; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the datum (geometric object) represented by the primitive. -*/ -Datum_reference datum(); +Returns the datum (geometric object) represented by the primitive. +*/ +Datum_reference datum(); /*! -Returns the corresponding identifier. This identifier is only used as a reference for the objects in the output of the `AABB_tree` methods. -*/ -Id id(); +Returns the corresponding identifier. This identifier is only used as a reference for the objects in the output of the `AABB_tree` methods. +*/ +Id id(); /*! -Returns a 3D point located on the geometric object represented by the primitive. This function is used to sort the primitives during the AABB tree construction as well as to construct the search KD-tree internal to the AABB tree used to accelerate distance queries. -*/ -Point_reference reference_point(); +Returns a 3D point located on the geometric object represented by the primitive. This function is used to sort the primitives during the AABB tree construction as well as to construct the search KD-tree internal to the AABB tree used to accelerate distance queries. +*/ +Point_reference reference_point(); /// @} diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h index a6348816d316..aacdc45fd367 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h @@ -17,34 +17,34 @@ The concept `AABBTraits` provides the geometric primitive types and methods for class AABBTraits { public: -/// \name Types +/// \name Types /// @{ /*! -Value type of the `Squared_distance` functor. -*/ -typedef unspecified_type FT; +Value type of the `Squared_distance` functor. +*/ +typedef unspecified_type FT; /*! -Type of a 3D point. -*/ -typedef unspecified_type Point_3; +Type of a 3D point. +*/ +typedef unspecified_type Point_3; /*! -Type of primitive. +Type of primitive. Must be a model of the concepts `AABBPrimitive` or `AABBPrimitiveWithSharedData`. -*/ -typedef unspecified_type Primitive; +*/ +typedef unspecified_type Primitive; /*! -Bounding box type. -*/ -typedef unspecified_type Bounding_box; +Bounding box type. +*/ +typedef unspecified_type Bounding_box; /*! enum required for axis selection - */ - enum Axis { + */ + enum Axis { CGAL_X_AXIS, CGAL_Y_AXIS, CGAL_Z_AXIS @@ -52,13 +52,13 @@ typedef unspecified_type Bounding_box; /*! 3D Point and Primitive Id type -*/ -typedef std::pair Point_and_primitive_id; +*/ +typedef std::pair Point_and_primitive_id; /*! -\deprecated +\deprecated This requirement is deprecated and is no longer needed. -*/ +*/ typedef std::pair Object_and_primitive_id; @@ -84,22 +84,22 @@ A functor object to split a range of primitives into two sub-ranges along the lo and have `Primitive` as value type. The operator is used for determining the primitives assigned to the two children nodes of a given node, assuming that the goal is to split the chosen axis dimension of the bounding box of the node. The primitives assigned to this node are passed as argument to the operator. It should modify the iterator range in such a way that its first half and its second half correspond to the two children nodes. -*/ -typedef unspecified_type Split_primitives; +*/ +typedef unspecified_type Split_primitives; /*! -A functor object to compute the bounding box of a set of primitives. Provides the operator: -`Bounding_box operator()(Input_iterator begin, Input_iterator beyond);` %Iterator type `InputIterator` must have `Primitive` as value type. -*/ -typedef unspecified_type Compute_bbox; +A functor object to compute the bounding box of a set of primitives. Provides the operator: +`Bounding_box operator()(Input_iterator begin, Input_iterator beyond);` %Iterator type `InputIterator` must have `Primitive` as value type. +*/ +typedef unspecified_type Compute_bbox; // remove as not used any where in the code: -// A functor object to specify the direction along which the bounding box should be split: +// A functor object to specify the direction along which the bounding box should be split: // `Axis operator()(const Bounding_box& bbox);` which returns the // direction used for splitting `bbox`. It is usually the axis aligned // with the longest edge of `bbox`. -// typedef unspecified_type Splitting_direction; +// typedef unspecified_type Splitting_direction; /// @} @@ -111,20 +111,20 @@ typedef unspecified_type Compute_bbox; /// @{ /*! -A functor object to compute intersection predicates between the query and the nodes of the tree. Provides the operators: +A functor object to compute intersection predicates between the query and the nodes of the tree. Provides the operators: - `bool operator()(const Query & q, const Bounding_box & box);` which returns `true` iff the query intersects the bounding box - `bool operator()(const Query & q, const Primitive & primitive);` which returns `true` iff the query intersects the primitive -*/ -typedef unspecified_type Do_intersect; +*/ +typedef unspecified_type Do_intersect; /*! -A functor object to compute the intersection of a query and a primitive. Provides the operator: -`boost::optional::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. +A functor object to compute the intersection of a query and a primitive. Provides the operator: +`boost::optional::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. \cgalHeading{Note on Backward Compatibility} Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional`. -*/ -typedef unspecified_type Intersection; +*/ +typedef unspecified_type Intersection; /// @} @@ -135,68 +135,68 @@ typedef unspecified_type Intersection; /// @{ /*! -A functor object to compute distance comparisons between the query and the nodes of the tree. Provides the operators: +A functor object to compute distance comparisons between the query and the nodes of the tree. Provides the operators: - `bool operator()(const Query & query, const Bounding_box& box, const Point & closest);` which returns `true` iff the bounding box is closer to `query` than `closest` is - `bool operator()(const Query & query, const Primitive & primitive, const Point & closest);` which returns `true` iff `primitive` is closer to the `query` than `closest` is -*/ -typedef unspecified_type Compare_distance; +*/ +typedef unspecified_type Compare_distance; /*! -A functor object to compute closest point from the query on a primitive. Provides the operator: -`Point_3 operator()(const Query& query, const Primitive& primitive, const Point_3 & closest);` which returns the closest point to `query`, among `closest` and all points of the primitive. -*/ -typedef unspecified_type Closest_point; +A functor object to compute closest point from the query on a primitive. Provides the operator: +`Point_3 operator()(const Query& query, const Primitive& primitive, const Point_3 & closest);` which returns the closest point to `query`, among `closest` and all points of the primitive. +*/ +typedef unspecified_type Closest_point; /*! -A functor object to compute the squared distance between two points. Provides the operator: -`FT operator()(const Point& query, const Point_3 & p);` which returns the squared distance between `p` and `q`. -*/ -typedef unspecified_type Squared_distance; +A functor object to compute the squared distance between two points. Provides the operator: +`FT operator()(const Point& query, const Point_3 & p);` which returns the squared distance between `p` and `q`. +*/ +typedef unspecified_type Squared_distance; /*! A functor object to compare two points. Provides the operator: `bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if `p` is equal to `q`. */ typedef unspecified_type Equal_3; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the primitive splitting functor. -*/ -Split_primitives split_primitives_object(); +Returns the primitive splitting functor. +*/ +Split_primitives split_primitives_object(); /*! -Returns the bounding box constructor. -*/ -Compute_bbox compute_bbox_object(); +Returns the bounding box constructor. +*/ +Compute_bbox compute_bbox_object(); /*! -Returns the intersection detection functor. -*/ -Do_intersect do_intersect_object(); +Returns the intersection detection functor. +*/ +Do_intersect do_intersect_object(); /*! -Returns the intersection constructor. -*/ -Intersection intersection_object(); +Returns the intersection constructor. +*/ +Intersection intersection_object(); /*! -Returns the distance comparison functor. -*/ -Compare_distance compare_distance_object(); +Returns the distance comparison functor. +*/ +Compare_distance compare_distance_object(); /*! -Returns the closest point constructor. -*/ -Closest_point closest_point_object(); +Returns the closest point constructor. +*/ +Closest_point closest_point_object(); /*! Returns the squared distance functor. -*/ -Squared_distance squared_distance_object(); +*/ +Squared_distance squared_distance_object(); /*! Returns the equal functor. diff --git a/AABB_tree/doc/AABB_tree/aabb_tree.txt b/AABB_tree/doc/AABB_tree/aabb_tree.txt index d0b7d99f421a..7bb8e36d7dce 100644 --- a/AABB_tree/doc/AABB_tree/aabb_tree.txt +++ b/AABB_tree/doc/AABB_tree/aabb_tree.txt @@ -2,7 +2,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_3D_Fast_Intersection_and_Distance_Computation \cgalAutoToc @@ -25,7 +25,7 @@ closest point from a point query to a set of triangles. Note that this component is not suited to the problem of finding all intersecting pairs of objects. We refer to the component -\ref chapterBoxIntersection "Intersecting Sequences of dD Iso-oriented Boxes" +\ref chapterBoxIntersection "Intersecting Sequences of dD Iso-oriented Boxes" which can find all intersecting pairs of iso-oriented boxes. The AABB tree data structure takes as input an iterator range of @@ -59,7 +59,7 @@ intersection *tests* which do not construct any intersection objects, from *intersections* which construct the intersection objects. -Tests: +Tests: - Function `AABB_tree::do_intersect()` tests if the input primitives are intersected by the query. This function is fast as it involves only @@ -79,7 +79,7 @@ the intersections with respect to the query. the intersecting primitive id (if any) of the corresponding intersection object that is closest to the source of the ray. -Constructions: +Constructions: - Function `AABB_tree::all_intersections()` detects and constructs all intersection objects with the input primitives. @@ -216,7 +216,7 @@ option which maximizes speed. \subsection aabb_tree_perf_cons Construction The surface triangle mesh chosen for benchmarking the tree -construction is the knot model (14,400 triangles) depicted by +construction is the knot model (14,400 triangles) depicted by \cgalFigureRef{figAABB-tree-bench}. We measure the tree construction time (both AABB tree alone and AABB tree with internal KD-tree) for this model as well as for three denser versions subdivided through the Loop @@ -254,7 +254,7 @@ the function `AABB_tree::accelerate_distance_queries()` which takes an iterator range as input. | Number of triangles | AABB tree (in MBytes) | AABB tree with internal KD-tree (in MBytes)| -| ----: | ----: | ----: | +| ----: | ----: | ----: | 18,400 | 1.10 | 2.76 | 102,400 | 6.33 | 14.73 | 1,022,400 | 59.56 | 151.31 | diff --git a/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp b/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp index c02b622a1c70..8aa5505ad26b 100644 --- a/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp @@ -13,7 +13,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::FT FT; typedef K::Point_3 Point_3; typedef CGAL::Bbox_3 Bbox_3; -typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Surface_mesh Surface_mesh; typedef CGAL::Polyhedron_3 Polyhedron_3; typedef CGAL::Timer Timer; @@ -27,7 +27,7 @@ void triangle_mesh(const char* fname) TriangleMesh tmesh; std::ifstream in(fname); - in >> tmesh; + in >> tmesh; Timer t; t.start(); Tree tree(faces(tmesh).first, faces(tmesh).second, tmesh); @@ -37,7 +37,7 @@ void triangle_mesh(const char* fname) } -Bbox_3 bbox(boost::graph_traits::face_descriptor fd, +Bbox_3 bbox(boost::graph_traits::face_descriptor fd, const Surface_mesh& p) { boost::graph_traits::halfedge_descriptor hd = halfedge(fd,p); @@ -59,11 +59,11 @@ void surface_mesh_cache_bbox(const char* fname) Surface_mesh tmesh; std::ifstream in(fname); in >> tmesh; - + Timer t; t.start(); Bbox_pmap bb = tmesh.add_property_map("f:bbox",Bbox_3()).first; - + for(face_descriptor fd : faces(tmesh)){ put(bb, fd, bbox(fd,tmesh)); } diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_example.cpp index c7cc32fd7bfd..5f225eef950c 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_example.cpp @@ -48,7 +48,7 @@ struct My_triangle_primitive { // this is the type of data that the queries returns. For this example // we imagine that, for some reasons, we do not want to store the iterators // of the vector, but raw pointers. This is to show that the Id type - // does not have to be the same as the one of the input parameter of the + // does not have to be the same as the one of the input parameter of the // constructor. typedef const My_triangle* Id; @@ -62,14 +62,14 @@ struct My_triangle_primitive { public: My_triangle_primitive() {} // default constructor needed - // the following constructor is the one that receives the iterators from the + // the following constructor is the one that receives the iterators from the // iterator range given as input to the AABB_tree My_triangle_primitive(Iterator it) : m_pt(&(*it)) {} const Id& id() const { return m_pt; } - // utility function to convert a custom + // utility function to convert a custom // point type to CGAL point type. Point convert(const My_point *p) const { diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp index 87dfc24553ff..d15c7155cd91 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp @@ -11,7 +11,7 @@ typedef CGAL::Simple_cartesian K; // The points are stored in a flat array of doubles -// The triangles are stored in a flat array of indices +// The triangles are stored in a flat array of indices // referring to an array of coordinates: three consecutive // coordinates represent a point, and three consecutive // indices represent a triangle. @@ -60,7 +60,7 @@ struct My_triangle_primitive { public: My_triangle_primitive() {} // default constructor needed - // the following constructor is the one that receives the iterators from the + // the following constructor is the one that receives the iterators from the // iterator range given as input to the AABB_tree My_triangle_primitive(Triangle_iterator a) : m_it(a) {} @@ -69,18 +69,18 @@ struct My_triangle_primitive { // on the fly conversion from the internal data to the CGAL types Datum datum() const - { + { Point_index_iterator p_it = m_it.base(); - Point p(*(point_container + 3 * (*p_it)), - *(point_container + 3 * (*p_it) + 1), + Point p(*(point_container + 3 * (*p_it)), + *(point_container + 3 * (*p_it) + 1), *(point_container + 3 * (*p_it) + 2) ); ++p_it; - Point q(*(point_container + 3 * (*p_it)), - *(point_container + 3 * (*p_it) + 1), + Point q(*(point_container + 3 * (*p_it)), + *(point_container + 3 * (*p_it) + 1), *(point_container + 3 * (*p_it) + 2)); ++p_it; - Point r(*(point_container + 3 * (*p_it)), - *(point_container + 3 * (*p_it) + 1), + Point r(*(point_container + 3 * (*p_it)), + *(point_container + 3 * (*p_it) + 1), *(point_container + 3 * (*p_it) + 2)); return Datum(p, q, r); // assembles triangle from three points @@ -88,9 +88,9 @@ struct My_triangle_primitive { // one point which must be on the primitive Point reference_point() const - { - return Point(*(point_container + 3 * (*m_it)), - *(point_container + 3 * (*m_it) + 1), + { + return Point(*(point_container + 3 * (*m_it)), + *(point_container + 3 * (*m_it) + 1), *(point_container + 3 * (*m_it) + 2)); } }; @@ -119,7 +119,7 @@ int main() triangles[6] = 0; triangles[7] = 3; triangles[8] = 2; // constructs AABB tree - Tree tree(Triangle_iterator(triangles), + Tree tree(Triangle_iterator(triangles), Triangle_iterator(triangles+9)); // counts #intersections diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp index 4311d1cbbf8a..a3436eed89e5 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp @@ -24,7 +24,7 @@ struct My_point { : x(_x), y(_y), z(_z) {} }; -// The triangles are stored in a flat array of indices +// The triangles are stored in a flat array of indices // referring to an array of points: three consecutive // indices represent a triangle. typedef std::vector::const_iterator Point_index_iterator; @@ -71,7 +71,7 @@ struct My_triangle_primitive { public: My_triangle_primitive() {} // default constructor needed - // the following constructor is the one that receives the iterators from the + // the following constructor is the one that receives the iterators from the // iterator range given as input to the AABB_tree My_triangle_primitive(Triangle_iterator a) : m_it(a) {} @@ -80,7 +80,7 @@ struct My_triangle_primitive { // on the fly conversion from the internal data to the CGAL types Datum datum() const - { + { Point_index_iterator p_it = m_it.base(); const My_point& mp = (*point_container)[*p_it]; Point p(mp.x, mp.y, mp.z); @@ -96,7 +96,7 @@ struct My_triangle_primitive { // one point which must be on the primitive Point reference_point() const - { + { const My_point& mp = (*point_container)[*m_it]; return Point(mp.x, mp.y, mp.z); } @@ -121,16 +121,16 @@ int main() points.push_back(a); points.push_back(b); points.push_back(c); - points.push_back(d); + points.push_back(d); // generates indexed triangle set std::vector triangles; - triangles.push_back(0); triangles.push_back(1); triangles.push_back(2); - triangles.push_back(0); triangles.push_back(1); triangles.push_back(3); - triangles.push_back(0); triangles.push_back(3); triangles.push_back(2); + triangles.push_back(0); triangles.push_back(1); triangles.push_back(2); + triangles.push_back(0); triangles.push_back(1); triangles.push_back(3); + triangles.push_back(0); triangles.push_back(3); triangles.push_back(2); // constructs AABB tree - Tree tree(Triangle_iterator(triangles.begin()), + Tree tree(Triangle_iterator(triangles.begin()), Triangle_iterator(triangles.end())); // counts #intersections diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_triangle_soup_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_triangle_soup_example.cpp index 590c5c0c7ba3..0fe8ffb713ad 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_triangle_soup_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_triangle_soup_example.cpp @@ -1,6 +1,6 @@ // Author(s) : Camille Wormser, Pierre Alliez -// Example of an AABB tree used with a simple list of +// Example of an AABB tree used with a simple list of // triangles (a triangle soup) stored into an array of points. #include @@ -25,7 +25,7 @@ struct My_point { My_point (double _x, double _y, double _z) : x(_x), y(_y), z(_z) {} }; -// The triangles are stored in a flat vector of points (a triangle soup): +// The triangles are stored in a flat vector of points (a triangle soup): // three consecutive points represent a triangle typedef std::vector::const_iterator Point_iterator; @@ -66,7 +66,7 @@ struct My_triangle_primitive { public: My_triangle_primitive() {} // default constructor needed - // the following constructor is the one that receives the iterators from the + // the following constructor is the one that receives the iterators from the // iterator range given as input to the AABB_tree My_triangle_primitive(Triangle_iterator a) : m_it(a) {} @@ -76,7 +76,7 @@ struct My_triangle_primitive { // on the fly conversion from the internal data // to the CGAL types Datum datum() const - { + { Point_iterator p_it = m_it.base(); Point p(p_it->x, p_it->y, p_it->z); ++p_it; @@ -89,7 +89,7 @@ struct My_triangle_primitive { // returns one point which must be on the primitive Point reference_point() const - { + { return Point(m_it->x, m_it->y, m_it->z); } }; @@ -107,12 +107,12 @@ int main() My_point d(0.0, 0.0, 0.0); std::vector triangles; - triangles.push_back(a); triangles.push_back(b); triangles.push_back(c); - triangles.push_back(a); triangles.push_back(b); triangles.push_back(d); - triangles.push_back(a); triangles.push_back(d); triangles.push_back(c); + triangles.push_back(a); triangles.push_back(b); triangles.push_back(c); + triangles.push_back(a); triangles.push_back(b); triangles.push_back(d); + triangles.push_back(a); triangles.push_back(d); triangles.push_back(c); // constructs AABB tree - Tree tree(Triangle_iterator(triangles.begin()), + Tree tree(Triangle_iterator(triangles.begin()), Triangle_iterator(triangles.end())); // counts #intersections diff --git a/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp b/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp index 7767ba735c0d..57eade14b284 100644 --- a/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp @@ -23,8 +23,8 @@ void run(const HalfedgeGraph& graph){ typename Kernel::Point_3 q(0.0, 1.0, 0.0); typename Kernel::Point_3 r(0.0, 0.0, 1.0); - // constructs the AABB tree and the internal search tree for - // efficient distance queries. + // constructs the AABB tree and the internal search tree for + // efficient distance queries. Tree tree( CGAL::edges(graph).first, CGAL::edges(graph).second, graph); @@ -39,7 +39,7 @@ void run(const HalfedgeGraph& graph){ typename Kernel::Point_3 point_query(2.0, 2.0, 2.0); typename Kernel::Point_3 closest = tree.closest_point(point_query); - std::cerr << "closest point is: " << closest << std::endl; + std::cerr << "closest point is: " << closest << std::endl; } int main() @@ -50,7 +50,7 @@ int main() Point s(0.0, 0.0, 0.0); Polyhedron polyhedron; polyhedron.make_tetrahedron(p, q, r, s); - + run(polyhedron); return EXIT_SUCCESS; } diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp index cac955a5b8f5..8e8c776032ca 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp @@ -26,7 +26,7 @@ int main() Polyhedron polyhedron; polyhedron.make_tetrahedron(p, q, r, s); - // constructs the AABB tree and the internal search tree for + // constructs the AABB tree and the internal search tree for // efficient distance queries. Tree tree( CGAL::edges(polyhedron).first, CGAL::edges(polyhedron).second, diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp index bb9ad89e463e..5da2e15bd849 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp @@ -28,7 +28,7 @@ int main() Polyhedron polyhedron; polyhedron.make_tetrahedron(p, q, r, s); - // constructs AABB tree and computes internal KD-tree + // constructs AABB tree and computes internal KD-tree // data structure to accelerate distance queries Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron); @@ -49,7 +49,7 @@ int main() Polyhedron::Face_handle f = pp.second; // closest primitive id std::cout << "closest point: " << closest_point << std::endl; std::cout << "closest triangle: ( " - << f->halfedge()->vertex()->point() << " , " + << f->halfedge()->vertex()->point() << " , " << f->halfedge()->next()->vertex()->point() << " , " << f->halfedge()->next()->next()->vertex()->point() << " )" << std::endl; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp index 822d6affee8c..4a4a1e613064 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp @@ -80,10 +80,10 @@ int main() Plane_intersection plane_intersection = tree.any_intersection(plane_query); if(plane_intersection) { - + if(boost::get(&(plane_intersection->first))) std::cout << "intersection object is a segment" << std::endl; } - + return EXIT_SUCCESS; } diff --git a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp index 5ce92466ed18..84321218cd63 100644 --- a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp @@ -38,7 +38,7 @@ struct Skip { }; return(t == fd); } - + }; int main(int argc, char* argv[]) @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) Mesh mesh; input >> mesh; Tree tree(faces(mesh).first, faces(mesh).second, mesh); - + double d = CGAL::Polygon_mesh_processing::is_outward_oriented(mesh)?-1:1; for(face_descriptor fd : faces(mesh)){ @@ -56,8 +56,8 @@ int main(int argc, char* argv[]) Point p = CGAL::centroid(mesh.point(source(hd,mesh)), mesh.point(target(hd,mesh)), mesh.point(target(next(hd,mesh),mesh))); - Vector v = CGAL::Polygon_mesh_processing::compute_face_normal(fd,mesh); - + Vector v = CGAL::Polygon_mesh_processing::compute_face_normal(fd,mesh); + Ray ray(p,d * v); Skip skip(fd); Ray_intersection intersection = tree.first_intersection(ray, skip); diff --git a/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp b/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp index 95e8c1c7664f..73b4d56e2d03 100644 --- a/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp @@ -33,7 +33,7 @@ int main() segments.push_back(Segment(a,c)); segments.push_back(Segment(c,d)); - // constructs the AABB tree and the internal search tree for + // constructs the AABB tree and the internal search tree for // efficient distance computations. Tree tree(segments.begin(),segments.end()); @@ -47,7 +47,7 @@ int main() std::cout << tree.number_of_intersected_primitives(triangle_query) << " intersections(s) with triangle" << std::endl; - // computes the closest point from a point query + // computes the closest point from a point query Point point_query(2.0, 2.0, 2.0); Point closest = tree.closest_point(point_query); diff --git a/AABB_tree/examples/AABB_tree/CMakeLists.txt b/AABB_tree/examples/AABB_tree/CMakeLists.txt index 87fa3857ab51..b66f7ec5f151 100644 --- a/AABB_tree/examples/AABB_tree/CMakeLists.txt +++ b/AABB_tree/examples/AABB_tree/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h index a8b1cca343ac..619b5a027e25 100644 --- a/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h @@ -96,7 +96,7 @@ class AABB_face_graph_triangle_primitive { return std::make_pair(fd, &fg); } - + public: #ifdef DOXYGEN_RUNNING /// \name Types @@ -115,7 +115,7 @@ class AABB_face_graph_triangle_primitive - `std::pair::%face_descriptor, FaceGraph>` if `OneFaceGraphPerTree` is `CGAL::Tag_false` */ unspecified_type Id; - + /// @} /*! diff --git a/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h b/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h index 92596a813f61..1010525d5c3a 100644 --- a/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h @@ -47,7 +47,7 @@ namespace CGAL { * and `AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`. * * \tparam HalfedgeGraph is a model of the halfedge graph concept. - * as key type and a \cgal Kernel `Point_3` as value type. + * as key type and a \cgal Kernel `Point_3` as value type. * \tparam VertexPointPMap is a property map with `boost::graph_traits::%vertex_descriptor`. * The default is `typename boost::property_map< HalfedgeGraph,vertex_point_t>::%const_type`. * \tparam OneHalfedgeGraphPerTree is either `CGAL::Tag_true` or `CGAL::Tag_false`. diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index 41d26d3d722f..8ff12dfe8623 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -105,7 +105,7 @@ struct AABB_traits_base_2{ } else { FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter; FT t2 = ((bbox.max)(i) - *source_iter) / *direction_iter; - + t_near = (std::max)(t_near, (std::min)(t1, t2)); t_far = (std::min)(t_far, (std::max)(t1, t2)); @@ -300,7 +300,7 @@ class AABB_traits: public: Compute_bbox(const AABB_traits& traits) :m_traits (traits) {} - + template typename AT::Bounding_box operator()(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond) const @@ -312,7 +312,7 @@ class AABB_traits: } return bbox; } - + }; Compute_bbox compute_bbox_object() const {return Compute_bbox(*this);} @@ -444,7 +444,7 @@ class AABB_traits: { return internal::Primitive_helper::get_datum(pr,*this).bbox(); } - + typedef enum { CGAL_AXIS_X = 0, CGAL_AXIS_Y = 1, diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 99dfd89f7f9f..0216405563ce 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -38,7 +38,7 @@ namespace CGAL { /// \addtogroup PkgAABBTreeRef /// @{ - /** + /** * Class AABB_tree is a static data structure for efficient * intersection and distance computations in 3D. It builds a * hierarchy of axis-aligned bounding boxes (an AABB tree) from a set @@ -51,41 +51,41 @@ namespace CGAL { * \sa `AABBPrimitive` * */ - template - class AABB_tree - { - private: - // internal KD-tree used to accelerate the distance queries - typedef AABB_search_tree Search_tree; + template + class AABB_tree + { + private: + // internal KD-tree used to accelerate the distance queries + typedef AABB_search_tree Search_tree; - // type of the primitives container - typedef std::vector Primitives; + // type of the primitives container + typedef std::vector Primitives; - public: + public: typedef AABBTraits AABB_traits; - + /// \name Types ///@{ /// Number type returned by the distance queries. - typedef typename AABBTraits::FT FT; + typedef typename AABBTraits::FT FT; /// Type of 3D point. - typedef typename AABBTraits::Point_3 Point; + typedef typename AABBTraits::Point_3 Point; /// Type of input primitive. - typedef typename AABBTraits::Primitive Primitive; - /// Identifier for a primitive in the tree. - typedef typename Primitive::Id Primitive_id; - /// Unsigned integral size type. - typedef typename Primitives::size_type size_type; + typedef typename AABBTraits::Primitive Primitive; + /// Identifier for a primitive in the tree. + typedef typename Primitive::Id Primitive_id; + /// Unsigned integral size type. + typedef typename Primitives::size_type size_type; /// Type of bounding box. - typedef typename AABBTraits::Bounding_box Bounding_box; + typedef typename AABBTraits::Bounding_box Bounding_box; /// 3D Point and Primitive Id type - typedef typename AABBTraits::Point_and_primitive_id Point_and_primitive_id; - /// \deprecated - typedef typename AABBTraits::Object_and_primitive_id Object_and_primitive_id; + typedef typename AABBTraits::Point_and_primitive_id Point_and_primitive_id; + /// \deprecated + typedef typename AABBTraits::Object_and_primitive_id Object_and_primitive_id; /*! An alias to `AABBTraits::Intersection_and_primitive_id` @@ -100,10 +100,10 @@ namespace CGAL { }; #endif - + ///@} - public: + public: /// \name Creation ///@{ @@ -119,8 +119,8 @@ namespace CGAL { * It is equivalent to constructing an empty tree and calling `insert(first,last,t...)`. * The tree stays empty if the memory allocation is not successful. */ - template - AABB_tree(InputIterator first, InputIterator beyond,T&& ...); + template + AABB_tree(InputIterator first, InputIterator beyond,T&& ...); /// After one or more calls to `insert()` the internal data /// structure of the tree must be reconstructed. This procedure @@ -139,12 +139,12 @@ namespace CGAL { #endif ///@} - /// \name Operations - ///@{ + /// \name Operations + ///@{ /// Equivalent to calling `clear()` and then `insert(first,last,t...)`. - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T&& ...); + template + void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T&& ...); /// Add a sequence of primitives to the set of primitives of the AABB tree. @@ -153,51 +153,51 @@ namespace CGAL { /// `Primitive(%InputIterator, T...)`. If `Primitive` is a model of the concept /// `AABBPrimitiveWithSharedData`, a call to `AABBTraits::set_shared_data(t...)` /// is made using the internally stored traits. - template - void insert(InputIterator first, InputIterator beyond,T&& ...); + template + void insert(InputIterator first, InputIterator beyond,T&& ...); /// Adds a primitive to the set of primitives of the tree. inline void insert(const Primitive& p); - /// Clears and destroys the tree. - ~AABB_tree() - { - clear(); - } + /// Clears and destroys the tree. + ~AABB_tree() + { + clear(); + } /// Returns a const reference to the internally stored traits class. const AABBTraits& traits() const{ - return m_traits; + return m_traits; } - - /// Clears the tree. - void clear() - { - // clear AABB tree + + /// Clears the tree. + void clear() + { + // clear AABB tree clear_nodes(); - m_primitives.clear(); - clear_search_tree(); - m_default_search_tree_constructed = true; - } - - /// Returns the axis-aligned bounding box of the whole tree. - /// \pre `!empty()` - const Bounding_box bbox() const { - CGAL_precondition(!empty()); - if(size() > 1) - return root_node()->bbox(); - else - return traits().compute_bbox_object()(m_primitives.begin(), - m_primitives.end()); - } - + m_primitives.clear(); + clear_search_tree(); + m_default_search_tree_constructed = true; + } + + /// Returns the axis-aligned bounding box of the whole tree. + /// \pre `!empty()` + const Bounding_box bbox() const { + CGAL_precondition(!empty()); + if(size() > 1) + return root_node()->bbox(); + else + return traits().compute_bbox_object()(m_primitives.begin(), + m_primitives.end()); + } + /// Returns the number of primitives in the tree. - size_type size() const { return m_primitives.size(); } - + size_type size() const { return m_primitives.size(); } + /// Returns \c true, iff the tree contains no primitive. - bool empty() const { return m_primitives.empty(); } - ///@} + bool empty() const { return m_primitives.empty(); } + ///@} - private: + private: template void set_primitive_data_impl(CGAL::Boolean_tag,T ... ){} template @@ -209,27 +209,27 @@ namespace CGAL { set_primitive_data_impl(CGAL::Boolean_tag::value>(),std::forward(t)...); } - bool build_kd_tree() const; - template - bool build_kd_tree(ConstPointIterator first, ConstPointIterator beyond) const; + bool build_kd_tree() const; + template + bool build_kd_tree(ConstPointIterator first, ConstPointIterator beyond) const; public: /// \name Intersection Tests ///@{ - /// Returns `true`, iff the query intersects at least one of - /// the input primitives. \tparam Query must be a type for - /// which `do_intersect` predicates are - /// defined in the traits class `AABBTraits`. - template - bool do_intersect(const Query& query) const; + /// Returns `true`, iff the query intersects at least one of + /// the input primitives. \tparam Query must be a type for + /// which `do_intersect` predicates are + /// defined in the traits class `AABBTraits`. + template + bool do_intersect(const Query& query) const; /// Returns the number of primitives intersected by the /// query. \tparam Query must be a type for which /// `do_intersect` predicates are defined /// in the traits class `AABBTraits`. - template - size_type number_of_intersected_primitives(const Query& query) const; + template + size_type number_of_intersected_primitives(const Query& query) const; /// Outputs to the iterator the list of all intersected primitives /// ids. This function does not compute the intersection points @@ -237,12 +237,12 @@ namespace CGAL { /// function below. \tparam Query must be a type for which /// `do_intersect` predicates are defined /// in the traits class `AABBTraits`. - template - OutputIterator all_intersected_primitives(const Query& query, OutputIterator out) const; + template + OutputIterator all_intersected_primitives(const Query& query, OutputIterator out) const; - /// Returns the intersected primitive id that is encountered first - /// in the tree traversal, iff + /// Returns the intersected primitive id that is encountered first + /// in the tree traversal, iff /// the query intersects at least one of the input primitives. No /// particular order is guaranteed over the tree traversal, such /// that, e.g, the primitive returned is not necessarily the @@ -250,8 +250,8 @@ namespace CGAL { /// must be a type for which /// `do_intersect` predicates are defined /// in the traits class `AABBTraits`. - template - boost::optional any_intersected_primitive(const Query& query) const; + template + boost::optional any_intersected_primitive(const Query& query) const; ///@} /// \name Intersections @@ -263,18 +263,18 @@ namespace CGAL { /// the iterator. `do_intersect()` /// predicates and intersections must be defined for `Query` /// in the `AABBTraits` class. - template - OutputIterator all_intersections(const Query& query, OutputIterator out) const; + template + OutputIterator all_intersections(const Query& query, OutputIterator out) const; - /// Returns the intersection that is encountered first - /// in the tree traversal. No particular + /// Returns the intersection that is encountered first + /// in the tree traversal. No particular /// order is guaranteed over the tree traversal, e.g, the /// primitive returned is not necessarily the closest from the /// source point of a ray query. Type `Query` must be a type /// for which `do_intersect` predicates /// and intersections are defined in the traits class AABBTraits. - template + template boost::optional< typename Intersection_and_primitive_id::Type > any_intersection(const Query& query) const; @@ -345,8 +345,8 @@ namespace CGAL { /// `accelerate_distance_queries()` should be called before the /// first distance query, so that an internal secondary search /// structure is build, for improving performance. - /// \pre `!empty()` - FT squared_distance(const Point& query) const; + /// \pre `!empty()` + FT squared_distance(const Point& query) const; /// Returns the point in the union of all input primitives which /// is closest to the query. In case there are several closest @@ -355,24 +355,24 @@ namespace CGAL { /// called before the first distance query, so that an internal /// secondary search structure is build, for improving /// performance. - /// \pre `!empty()` - Point closest_point(const Point& query) const; + /// \pre `!empty()` + Point closest_point(const Point& query) const; + - /// Returns a `Point_and_primitive_id` which realizes the /// smallest distance between the query point and all input /// primitives. Method `accelerate_distance_queries()` should be /// called before the first distance query, so that an internal /// secondary search structure is build, for improving /// performance. - /// \pre `!empty()` - Point_and_primitive_id closest_point_and_primitive(const Point& query) const; + /// \pre `!empty()` + Point_and_primitive_id closest_point_and_primitive(const Point& query) const; ///@} /// \name Accelerating the Distance Queries - /// + /// /// In the following paragraphs, we discuss details of the /// implementation of the distance queries. We explain the /// internal use of hints, how the user can pass his own hints to @@ -387,7 +387,7 @@ namespace CGAL { /// exact specification of these internal algorithms is that they /// minimize the distance to the object composed of the union of /// the primitives and the hint. - /// It follows that + /// It follows that /// - in order to return the exact distance to the set of /// primitives, the algorithms need the hint to be exactly on the /// primitives; @@ -426,173 +426,173 @@ namespace CGAL { /// relevant in some cases. ///@{ - /// Constructs internal search tree from - /// a point set taken on the internal primitives - /// returns `true` iff successful memory allocation - bool accelerate_distance_queries() const; - ///Turns off the lazy construction of the internal search tree. - void do_not_accelerate_distance_queries() const; + /// Constructs internal search tree from + /// a point set taken on the internal primitives + /// returns `true` iff successful memory allocation + bool accelerate_distance_queries() const; + ///Turns off the lazy construction of the internal search tree. + void do_not_accelerate_distance_queries() const; /// Constructs an internal KD-tree containing the specified point /// set, to be used as the set of potential hints for accelerating /// the distance queries. /// \tparam ConstPointIterator is an iterator with /// value type `Point_and_primitive_id`. - template - bool accelerate_distance_queries(ConstPointIterator first, ConstPointIterator beyond) const - { - #ifdef CGAL_HAS_THREADS - //this ensures that this is done once at a time - CGAL_SCOPED_LOCK(kd_tree_mutex); - #endif - clear_search_tree(); - m_default_search_tree_constructed = false; // not a default kd-tree - return build_kd_tree(first,beyond); - } - + template + bool accelerate_distance_queries(ConstPointIterator first, ConstPointIterator beyond) const + { + #ifdef CGAL_HAS_THREADS + //this ensures that this is done once at a time + CGAL_SCOPED_LOCK(kd_tree_mutex); + #endif + clear_search_tree(); + m_default_search_tree_constructed = false; // not a default kd-tree + return build_kd_tree(first,beyond); + } + /// Returns the minimum squared distance between the query point /// and all input primitives. The internal KD-tree is not used. - /// \pre `!empty()` - FT squared_distance(const Point& query, const Point& hint) const; + /// \pre `!empty()` + FT squared_distance(const Point& query, const Point& hint) const; /// Returns the point in the union of all input primitives which /// is closest to the query. In case there are several closest /// points, one arbitrarily chosen closest point is returned. The /// internal KD-tree is not used. - /// \pre `!empty()` - Point closest_point(const Point& query, const Point& hint) const; - + /// \pre `!empty()` + Point closest_point(const Point& query, const Point& hint) const; + /// Returns a `Point_and_primitive_id` which realizes the /// smallest distance between the query point and all input /// primitives. The internal KD-tree is not used. - /// \pre `!empty()` - Point_and_primitive_id closest_point_and_primitive(const Point& query, const Point_and_primitive_id& hint) const; + /// \pre `!empty()` + Point_and_primitive_id closest_point_and_primitive(const Point& query, const Point_and_primitive_id& hint) const; ///@} - private: + private: template friend class AABB_ray_intersection; // clear nodes void clear_nodes() { - if( size() > 1 ) { - delete [] m_p_root_node; - } - m_p_root_node = nullptr; + if( size() > 1 ) { + delete [] m_p_root_node; + } + m_p_root_node = nullptr; } - // clears internal KD tree - void clear_search_tree() const - { - if ( m_search_tree_constructed ) - { - CGAL_assertion( m_p_search_tree!=nullptr ); - delete m_p_search_tree; - m_p_search_tree = nullptr; - m_search_tree_constructed = false; + // clears internal KD tree + void clear_search_tree() const + { + if ( m_search_tree_constructed ) + { + CGAL_assertion( m_p_search_tree!=nullptr ); + delete m_p_search_tree; + m_p_search_tree = nullptr; + m_search_tree_constructed = false; } - } + } - public: + public: /// \internal - template - void traversal(const Query& query, Traversal_traits& traits) const - { - switch(size()) - { - case 0: - break; - case 1: - traits.intersection(query, singleton_data()); - break; - default: // if(size() >= 2) - root_node()->template traversal(query, traits, m_primitives.size()); - } - } - - private: - typedef AABB_node Node; - - - public: - // returns a point which must be on one primitive - Point_and_primitive_id any_reference_point_and_id() const - { - CGAL_assertion(!empty()); - return Point_and_primitive_id( + template + void traversal(const Query& query, Traversal_traits& traits) const + { + switch(size()) + { + case 0: + break; + case 1: + traits.intersection(query, singleton_data()); + break; + default: // if(size() >= 2) + root_node()->template traversal(query, traits, m_primitives.size()); + } + } + + private: + typedef AABB_node Node; + + + public: + // returns a point which must be on one primitive + Point_and_primitive_id any_reference_point_and_id() const + { + CGAL_assertion(!empty()); + return Point_and_primitive_id( internal::Primitive_helper::get_reference_point(m_primitives[0],m_traits), m_primitives[0].id() ); - } + } - public: - Point_and_primitive_id best_hint(const Point& query) const - { - if(m_search_tree_constructed) + public: + Point_and_primitive_id best_hint(const Point& query) const + { + if(m_search_tree_constructed) { - return m_p_search_tree->closest_point(query); + return m_p_search_tree->closest_point(query); } - else - return this->any_reference_point_and_id(); - } - - //! Returns the datum (geometric object) represented `p`. + else + return this->any_reference_point_and_id(); + } + + //! Returns the datum (geometric object) represented `p`. #ifndef DOXYGEN_RUNNING - typename internal::Primitive_helper::Datum_type + typename internal::Primitive_helper::Datum_type #else - typename AABBTraits::Primitive::Datum_reference + typename AABBTraits::Primitive::Datum_reference #endif - datum(Primitive& p)const - { - return internal::Primitive_helper:: - get_datum(p, this->traits()); - } + datum(Primitive& p)const + { + return internal::Primitive_helper:: + get_datum(p, this->traits()); + } - private: + private: //Traits class AABBTraits m_traits; - // set of input primitives - Primitives m_primitives; - // single root node - Node* m_p_root_node; + // set of input primitives + Primitives m_primitives; + // single root node + Node* m_p_root_node; #ifdef CGAL_HAS_THREADS mutable CGAL_MUTEX internal_tree_mutex;//mutex used to protect const calls inducing build() mutable CGAL_MUTEX kd_tree_mutex;//mutex used to protect calls to accelerate_distance_queries #endif - + const Node* root_node() const { - CGAL_assertion(size() > 1); + CGAL_assertion(size() > 1); if(m_need_build){ #ifdef CGAL_HAS_THREADS //this ensures that build() will be called once CGAL_SCOPED_LOCK(internal_tree_mutex); if(m_need_build) #endif - const_cast< AABB_tree* >(this)->build(); + const_cast< AABB_tree* >(this)->build(); } return m_p_root_node; } - const Primitive& singleton_data() const { - CGAL_assertion(size() == 1); - return *m_primitives.begin(); - } + const Primitive& singleton_data() const { + CGAL_assertion(size() == 1); + return *m_primitives.begin(); + } - // search KD-tree - mutable const Search_tree* m_p_search_tree; - mutable bool m_search_tree_constructed; + // search KD-tree + mutable const Search_tree* m_p_search_tree; + mutable bool m_search_tree_constructed; mutable bool m_default_search_tree_constructed; // indicates whether the internal kd-tree should be built bool m_need_build; - private: - // Disabled copy constructor & assignment operator - typedef AABB_tree Self; - AABB_tree(const Self& src); - Self& operator=(const Self& src); + private: + // Disabled copy constructor & assignment operator + typedef AABB_tree Self; + AABB_tree(const Self& src); + Self& operator=(const Self& src); - }; // end class AABB_tree + }; // end class AABB_tree /// @} @@ -607,54 +607,54 @@ namespace CGAL { , m_need_build(false) {} - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, + template + template + AABB_tree::AABB_tree(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond, T&& ... t) - : m_traits() + : m_traits() , m_primitives() - , m_p_root_node(nullptr) - , m_p_search_tree(nullptr) - , m_search_tree_constructed(false) + , m_p_root_node(nullptr) + , m_p_search_tree(nullptr) + , m_search_tree_constructed(false) , m_default_search_tree_constructed(true) , m_need_build(false) - { - // Insert each primitive into tree + { + // Insert each primitive into tree insert(first, beyond,std::forward(t)...); - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, + } + + template + template + void AABB_tree::insert(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond, T&& ... t) - { - set_shared_data(std::forward(t)...); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,std::forward(t)...)); - ++first; - } + { + set_shared_data(std::forward(t)...); + while(first != beyond) + { + m_primitives.push_back(Primitive(first,std::forward(t)...)); + ++first; + } m_need_build = true; } - + // Clears tree and insert a set of primitives - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, + template + template + void AABB_tree::rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond, T&& ... t) - { - // cleanup current tree and internal KD tree - clear(); + { + // cleanup current tree and internal KD tree + clear(); - // inserts primitives + // inserts primitives insert(first, beyond,std::forward(t)...); build(); - } - + } + template template void AABB_tree::build(T&& ... t) @@ -663,141 +663,141 @@ namespace CGAL { build(); } - template - void AABB_tree::insert(const Primitive& p) - { + template + void AABB_tree::insert(const Primitive& p) + { m_primitives.push_back(p); m_need_build = true; } - // Build the data structure, after calls to insert(..) - template - void AABB_tree::build() - { + // Build the data structure, after calls to insert(..) + template + void AABB_tree::build() + { clear_nodes(); if(m_primitives.size() > 1) { - // allocates tree nodes - m_p_root_node = new Node[m_primitives.size()-1](); - if(m_p_root_node == nullptr) - { - std::cerr << "Unable to allocate memory for AABB tree" << std::endl; - CGAL_assertion(m_p_root_node != nullptr); - m_primitives.clear(); - clear(); - } - - // constructs the tree - m_p_root_node->expand(m_primitives.begin(), m_primitives.end(), - m_primitives.size(), m_traits); - } - - - // In case the users has switched on the accelerated distance query - // data structure with the default arguments, then it has to be - // /built/rebuilt. - if(m_default_search_tree_constructed && !empty()){ - build_kd_tree(); - } - m_need_build = false; - } - // constructs the search KD tree from given points - // to accelerate the distance queries - template - bool AABB_tree::build_kd_tree() const - { - // iterate over primitives to get reference points on them - std::vector points; - points.reserve(m_primitives.size()); - typename Primitives::const_iterator it; - for(it = m_primitives.begin(); it != m_primitives.end(); ++it) - points.push_back( Point_and_primitive_id( - internal::Primitive_helper::get_reference_point( - *it,m_traits), it->id() ) ); - - // clears current KD tree - clear_search_tree(); - bool res = build_kd_tree(points.begin(), points.end()); - m_default_search_tree_constructed = true; - return res; - } - - // constructs the search KD tree from given points - // to accelerate the distance queries - template - template - bool AABB_tree::build_kd_tree(ConstPointIterator first, - ConstPointIterator beyond) const - { - m_p_search_tree = new Search_tree(first, beyond); + // allocates tree nodes + m_p_root_node = new Node[m_primitives.size()-1](); + if(m_p_root_node == nullptr) + { + std::cerr << "Unable to allocate memory for AABB tree" << std::endl; + CGAL_assertion(m_p_root_node != nullptr); + m_primitives.clear(); + clear(); + } + + // constructs the tree + m_p_root_node->expand(m_primitives.begin(), m_primitives.end(), + m_primitives.size(), m_traits); + } + + + // In case the users has switched on the accelerated distance query + // data structure with the default arguments, then it has to be + // /built/rebuilt. + if(m_default_search_tree_constructed && !empty()){ + build_kd_tree(); + } + m_need_build = false; + } + // constructs the search KD tree from given points + // to accelerate the distance queries + template + bool AABB_tree::build_kd_tree() const + { + // iterate over primitives to get reference points on them + std::vector points; + points.reserve(m_primitives.size()); + typename Primitives::const_iterator it; + for(it = m_primitives.begin(); it != m_primitives.end(); ++it) + points.push_back( Point_and_primitive_id( + internal::Primitive_helper::get_reference_point( + *it,m_traits), it->id() ) ); + + // clears current KD tree + clear_search_tree(); + bool res = build_kd_tree(points.begin(), points.end()); + m_default_search_tree_constructed = true; + return res; + } + + // constructs the search KD tree from given points + // to accelerate the distance queries + template + template + bool AABB_tree::build_kd_tree(ConstPointIterator first, + ConstPointIterator beyond) const + { + m_p_search_tree = new Search_tree(first, beyond); m_default_search_tree_constructed = true; - if(m_p_search_tree != nullptr) - { - m_search_tree_constructed = true; - return true; - } - else + if(m_p_search_tree != nullptr) + { + m_search_tree_constructed = true; + return true; + } + else { - std::cerr << "Unable to allocate memory for accelerating distance queries" << std::endl; - return false; + std::cerr << "Unable to allocate memory for accelerating distance queries" << std::endl; + return false; } - } - - template - void AABB_tree::do_not_accelerate_distance_queries()const - { - clear_search_tree(); - m_default_search_tree_constructed = false; - } - - - // constructs the search KD tree from internal primitives - template - bool AABB_tree::accelerate_distance_queries() const - { - if(m_primitives.empty()) return true; - if (m_default_search_tree_constructed) - { - if (!m_need_build) return m_search_tree_constructed; - return true; // default return type, no tree built - } - - if(!m_need_build) // the tree was already built, build the kd-tree - { - #ifdef CGAL_HAS_THREADS - //this ensures that this function will be done once - CGAL_SCOPED_LOCK(kd_tree_mutex); - #endif - if (!m_need_build) - { - // clears current KD tree - clear_search_tree(); - bool res = build_kd_tree(); - m_default_search_tree_constructed = true; - return res; - }; - } - m_default_search_tree_constructed = true; - return m_search_tree_constructed; - } - - template - template - bool - AABB_tree::do_intersect(const Query& query) const - { + } + + template + void AABB_tree::do_not_accelerate_distance_queries()const + { + clear_search_tree(); + m_default_search_tree_constructed = false; + } + + + // constructs the search KD tree from internal primitives + template + bool AABB_tree::accelerate_distance_queries() const + { + if(m_primitives.empty()) return true; + if (m_default_search_tree_constructed) + { + if (!m_need_build) return m_search_tree_constructed; + return true; // default return type, no tree built + } + + if(!m_need_build) // the tree was already built, build the kd-tree + { + #ifdef CGAL_HAS_THREADS + //this ensures that this function will be done once + CGAL_SCOPED_LOCK(kd_tree_mutex); + #endif + if (!m_need_build) + { + // clears current KD tree + clear_search_tree(); + bool res = build_kd_tree(); + m_default_search_tree_constructed = true; + return res; + }; + } + m_default_search_tree_constructed = true; + return m_search_tree_constructed; + } + + template + template + bool + AABB_tree::do_intersect(const Query& query) const + { using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - Do_intersect_traits traversal_traits(m_traits); - this->traversal(query, traversal_traits); - return traversal_traits.is_intersection_found(); - } + Do_intersect_traits traversal_traits(m_traits); + this->traversal(query, traversal_traits); + return traversal_traits.is_intersection_found(); + } #ifndef DOXYGEN_RUNNING //To avoid doxygen to consider definition and declaration as 2 different functions (size_type causes problems) - template - template - typename AABB_tree::size_type - AABB_tree::number_of_intersected_primitives(const Query& query) const - { + template + template + typename AABB_tree::size_type + AABB_tree::number_of_intersected_primitives(const Query& query) const + { using namespace CGAL::internal::AABB_tree; using CGAL::internal::AABB_tree::Counting_output_iterator; typedef typename AABB_tree::AABB_traits AABBTraits; @@ -806,134 +806,134 @@ namespace CGAL { size_type counter = 0; Counting_iterator out(&counter); - Listing_primitive_traits traversal_traits(out,m_traits); - this->traversal(query, traversal_traits); - return counter; - } + this->traversal(query, traversal_traits); + return counter; + } #endif - template - template - OutputIterator - AABB_tree::all_intersected_primitives(const Query& query, - OutputIterator out) const - { + template + template + OutputIterator + AABB_tree::all_intersected_primitives(const Query& query, + OutputIterator out) const + { using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - Listing_primitive_traits traversal_traits(out,m_traits); - this->traversal(query, traversal_traits); - return out; - } - - template - template - OutputIterator - AABB_tree::all_intersections(const Query& query, - OutputIterator out) const - { + this->traversal(query, traversal_traits); + return out; + } + + template + template + OutputIterator + AABB_tree::all_intersections(const Query& query, + OutputIterator out) const + { using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - Listing_intersection_traits traversal_traits(out,m_traits); - this->traversal(query, traversal_traits); - return out; - } + this->traversal(query, traversal_traits); + return out; + } - template - template + template + template boost::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > - AABB_tree::any_intersection(const Query& query) const - { + AABB_tree::any_intersection(const Query& query) const + { using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - First_intersection_traits traversal_traits(m_traits); - this->traversal(query, traversal_traits); - return traversal_traits.result(); - } - - template - template - boost::optional::Primitive_id> - AABB_tree::any_intersected_primitive(const Query& query) const - { + First_intersection_traits traversal_traits(m_traits); + this->traversal(query, traversal_traits); + return traversal_traits.result(); + } + + template + template + boost::optional::Primitive_id> + AABB_tree::any_intersected_primitive(const Query& query) const + { using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - First_primitive_traits traversal_traits(m_traits); - this->traversal(query, traversal_traits); - return traversal_traits.result(); - } - - // closest point with user-specified hint - template - typename AABB_tree::Point - AABB_tree::closest_point(const Point& query, - const Point& hint) const - { - CGAL_precondition(!empty()); - typename Primitive::Id hint_primitive = m_primitives[0].id(); + First_primitive_traits traversal_traits(m_traits); + this->traversal(query, traversal_traits); + return traversal_traits.result(); + } + + // closest point with user-specified hint + template + typename AABB_tree::Point + AABB_tree::closest_point(const Point& query, + const Point& hint) const + { + CGAL_precondition(!empty()); + typename Primitive::Id hint_primitive = m_primitives[0].id(); using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - Projection_traits projection_traits(hint,hint_primitive,m_traits); - this->traversal(query, projection_traits); - return projection_traits.closest_point(); - } - - // closest point without hint, the search KD-tree is queried for the - // first closest neighbor point to get a hint - template - typename AABB_tree::Point - AABB_tree::closest_point(const Point& query) const - { - CGAL_precondition(!empty()); - const Point_and_primitive_id hint = best_hint(query); - return closest_point(query,hint.first); - } - - // squared distance with user-specified hint - template - typename AABB_tree::FT - AABB_tree::squared_distance(const Point& query, - const Point& hint) const - { - CGAL_precondition(!empty()); - const Point closest = this->closest_point(query, hint); - return Tr().squared_distance_object()(query, closest); - } - - // squared distance without user-specified hint - template - typename AABB_tree::FT - AABB_tree::squared_distance(const Point& query) const - { - CGAL_precondition(!empty()); - const Point closest = this->closest_point(query); - return Tr().squared_distance_object()(query, closest); - } - - // closest point with user-specified hint - template - typename AABB_tree::Point_and_primitive_id - AABB_tree::closest_point_and_primitive(const Point& query) const - { - CGAL_precondition(!empty()); - return closest_point_and_primitive(query,best_hint(query)); - } - - // closest point with user-specified hint - template - typename AABB_tree::Point_and_primitive_id - AABB_tree::closest_point_and_primitive(const Point& query, - const Point_and_primitive_id& hint) const - { - CGAL_precondition(!empty()); + Projection_traits projection_traits(hint,hint_primitive,m_traits); + this->traversal(query, projection_traits); + return projection_traits.closest_point(); + } + + // closest point without hint, the search KD-tree is queried for the + // first closest neighbor point to get a hint + template + typename AABB_tree::Point + AABB_tree::closest_point(const Point& query) const + { + CGAL_precondition(!empty()); + const Point_and_primitive_id hint = best_hint(query); + return closest_point(query,hint.first); + } + + // squared distance with user-specified hint + template + typename AABB_tree::FT + AABB_tree::squared_distance(const Point& query, + const Point& hint) const + { + CGAL_precondition(!empty()); + const Point closest = this->closest_point(query, hint); + return Tr().squared_distance_object()(query, closest); + } + + // squared distance without user-specified hint + template + typename AABB_tree::FT + AABB_tree::squared_distance(const Point& query) const + { + CGAL_precondition(!empty()); + const Point closest = this->closest_point(query); + return Tr().squared_distance_object()(query, closest); + } + + // closest point with user-specified hint + template + typename AABB_tree::Point_and_primitive_id + AABB_tree::closest_point_and_primitive(const Point& query) const + { + CGAL_precondition(!empty()); + return closest_point_and_primitive(query,best_hint(query)); + } + + // closest point with user-specified hint + template + typename AABB_tree::Point_and_primitive_id + AABB_tree::closest_point_and_primitive(const Point& query, + const Point_and_primitive_id& hint) const + { + CGAL_precondition(!empty()); using namespace CGAL::internal::AABB_tree; typedef typename AABB_tree::AABB_traits AABBTraits; - Projection_traits projection_traits(hint.first,hint.second,m_traits); - this->traversal(query, projection_traits); - return projection_traits.closest_point_and_primitive(); - } + Projection_traits projection_traits(hint.first,hint.second,m_traits); + this->traversal(query, projection_traits); + return projection_traits.closest_point_and_primitive(); + } } // end namespace CGAL diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h index 3c64cc66e9c6..efa329b1b7ba 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h @@ -215,7 +215,7 @@ template boost::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > AABB_tree::first_intersection(const Ray& query, const SkipFunctor& skip) const { - CGAL_static_assertion_msg((boost::is_same::value), + CGAL_static_assertion_msg((boost::is_same::value), "Ray and Ray_3 must be the same type"); switch(size()) // copy-paste from AABB_tree::traversal diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h index ba69d753ab9e..593ee2d16d99 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h @@ -19,7 +19,7 @@ #include #include -namespace CGAL { +namespace CGAL { namespace internal { namespace AABB_tree { @@ -76,7 +76,7 @@ class First_intersection_traits : m_result(), m_traits(traits) {} - bool go_further() const { + bool go_further() const { return !m_result; } @@ -91,7 +91,7 @@ class First_intersection_traits } Result result() const { return m_result; } - bool is_intersection_found() const { + bool is_intersection_found() const { return m_result; } @@ -291,7 +291,7 @@ class Projection_traits const typename Primitive::Id& hint_primitive, const AABBTraits& traits) : m_closest_point(hint), - m_closest_primitive(hint_primitive), + m_closest_primitive(hint_primitive), m_traits(traits) {} @@ -304,7 +304,7 @@ class Projection_traits if( !m_traits.equal_3_object()(new_closest_point, m_closest_point) ) { m_closest_primitive = primitive.id(); - m_closest_point = new_closest_point; // this effectively shrinks the sphere + m_closest_point = new_closest_point; // this effectively shrinks the sphere } } diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_helper.h b/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_helper.h index 827db11e87c1..c169a9c2b734 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_helper.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_helper.h @@ -36,7 +36,7 @@ template struct Point_result_type{ typedef typename Primitive::Point type; }; -//helper controlling whether extra data should be stored in the AABB_tree traits class +//helper controlling whether extra data should be stored in the AABB_tree traits class template ::value> struct Primitive_helper; @@ -52,7 +52,7 @@ struct Primitive_helper{ return p.reference_point(traits.shared_data()); } }; - + template struct Primitive_helper{ typedef typename Datum_result_type::type Datum_type; diff --git a/AABB_tree/package_info/AABB_tree/long_description.txt b/AABB_tree/package_info/AABB_tree/long_description.txt index f000a059b8fb..ad49fc371b0e 100644 --- a/AABB_tree/package_info/AABB_tree/long_description.txt +++ b/AABB_tree/package_info/AABB_tree/long_description.txt @@ -1 +1 @@ -This component implements a hierarchy of axis-aligned bounding boxes (a AABB tree) for efficient intersection and distance computations between 3D queries and sets of input 3D geometric objects. +This component implements a hierarchy of axis-aligned bounding boxes (a AABB tree) for efficient intersection and distance computations between 3D queries and sets of input 3D geometric objects. diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index 2707aadd2576..1c446a5397ad 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -96,7 +96,7 @@ void test_all_intersection_query_types(Tree& tree) // any_intersection boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > r = tree.any_intersection(ray); - boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > l = tree.any_intersection(line); + boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > l = tree.any_intersection(line); boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > s = tree.any_intersection(segment); // any_intersected_primitive @@ -162,7 +162,7 @@ void test_distance_speed(Tree& tree, // picks a random point in the tree bbox Point query = random_point_in(tree.bbox()); Point closest = tree.closest_point(query); - (void) closest; + (void) closest; nb++; } double speed = (double)nb / timer.time(); @@ -323,7 +323,7 @@ class Naive_implementations typedef typename Traits::Point_and_primitive_id Point_and_primitive_id; typedef boost::optional Intersection_result; - + const Traits& m_traits; public: Naive_implementations(const Traits& traits):m_traits(traits){} @@ -691,8 +691,8 @@ class Tree_vs_naive typename Tree::AABB_traits::template Intersection_and_primitive_id::Type Obj_type; - typedef - std::vector + typedef + std::vector Obj_Id_vector; Obj_Id_vector intersections_naive; diff --git a/AABB_tree/test/AABB_tree/CMakeLists.txt b/AABB_tree/test/AABB_tree/CMakeLists.txt index 7e06dbb87009..997be1089d0a 100644 --- a/AABB_tree/test/AABB_tree/CMakeLists.txt +++ b/AABB_tree/test/AABB_tree/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp b/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp index fbd3d215a966..73c8f7faba3a 100644 --- a/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp +++ b/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp @@ -29,7 +29,7 @@ const int runs = 10; template struct FilterP { const Tree* t; - + template bool operator()(const T& tt) { return !t->do_intersect(tt); } }; @@ -55,7 +55,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo } template -boost::tuple test(const char* name) { +boost::tuple test(const char* name) { typedef typename K::FT FT; typedef typename K::Ray_3 Ray; typedef typename K::Line_3 Line; @@ -75,15 +75,15 @@ boost::tuple test(const char* name) // Random seeded to 23, cube size equal to the magic number 2 CGAL::Random r(23); CGAL::Random_points_in_cube_3 > g( 2., r); - + std::vector points; points.reserve(elements * 2); std::copy_n(g, elements * 2, std::back_inserter(points)); - + // generate a bunch of happy random primitives std::vector lines; lines.reserve(elements); - + // forward for(std::size_t i = 0; i < points.size(); i += 2) { @@ -112,13 +112,13 @@ boost::tuple test(const char* name) // filter all primitives that do not intersect FilterP p = { &tree }; - + lines.erase(std::remove_if(lines.begin(), lines.end(), p), lines.end()); rays.erase(std::remove_if(rays.begin(), rays.end(), p), rays.end()); segments.erase(std::remove_if(segments.begin(), segments.end(), p), segments.end()); - + boost::tuple tu; { @@ -130,7 +130,7 @@ boost::tuple test(const char* name) long counter = 0L; tu = boost::make_tuple(intersect(lines.begin(), lines.end(), tree, counter), intersect(rays.begin(), rays.end(), tree, counter), - intersect(segments.begin(), segments.end(), tree, counter), + intersect(segments.begin(), segments.end(), tree, counter), // cant use counter here 0); boost::get<3>(tu) = counter; @@ -164,7 +164,7 @@ int main() std::cout << "| Epic kernel |"; boost::tuple t5 = test(filename); std::cout << " | " << std::endl; - + std::size_t a, b, c; long d; diff --git a/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp index 29bb2b1f45b6..5489c2c9c157 100644 --- a/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp @@ -29,100 +29,100 @@ template int test() { - // types - typedef typename K::FT FT; - typedef typename K::Line_3 Line; - typedef typename K::Point_3 Point; - typedef typename K::Segment_3 Segment; - - // load polyhedron - typedef CGAL::Polyhedron_3 Polyhedron; - Polyhedron polyhedron; - std::ifstream ifs("./data/tetrahedron.off"); - ifs >> polyhedron; - - // construct tree from facets - typedef typename CGAL::AABB_face_graph_triangle_primitive Primitive; - typedef typename CGAL::AABB_traits Traits; - typedef typename CGAL::AABB_tree Tree; - typedef typename Tree::Object_and_primitive_id Object_and_primitive_id; - Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron); - - // segment intersection query - Point p((FT)-0.25, (FT)0.251, (FT)0.255); - Point q((FT) 0.25, (FT)0.253, (FT)0.256); - Segment pq(p,q); - - if(!tree.do_intersect(pq)) - { - std::cerr << "no intersection found" << std::endl; - return EXIT_FAILURE; - } - - if(tree.number_of_intersected_primitives(pq) != 1) - { - std::cerr << "number of intersections different than one" << std::endl; - return EXIT_FAILURE; - } - - boost::optional any; - any = tree.any_intersection(pq); - if(!any) - { - std::cerr << "did not find any intersection" << std::endl; - return EXIT_FAILURE; - } - Object_and_primitive_id op = *any; - CGAL::Object object = op.first; - Point point; - if(CGAL::assign(point,object)) - { - std::cout << "Intersection point: " << point << std::endl; - } - else - { - std::cerr << "intersection does not assign to a point" << std::endl; - return EXIT_FAILURE; - } - - // line intersection query - Line line_pq(p,q); - if(!tree.do_intersect(line_pq)) - { - std::cerr << "no intersection found with line" << std::endl; - return EXIT_FAILURE; - } - if(tree.number_of_intersected_primitives(line_pq) != 2) - { - std::cerr << "number of intersections different than two with line" << std::endl; - return EXIT_FAILURE; - } - - // closest point query - Point r((FT)0.0, (FT)0.0, (FT)3.0); - Point closest((FT)0.0, (FT)0.0, (FT)1.0); - Point result = tree.closest_point(r); - if(result != closest) - { - std::cerr << "wrong closest point" << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; + // types + typedef typename K::FT FT; + typedef typename K::Line_3 Line; + typedef typename K::Point_3 Point; + typedef typename K::Segment_3 Segment; + + // load polyhedron + typedef CGAL::Polyhedron_3 Polyhedron; + Polyhedron polyhedron; + std::ifstream ifs("./data/tetrahedron.off"); + ifs >> polyhedron; + + // construct tree from facets + typedef typename CGAL::AABB_face_graph_triangle_primitive Primitive; + typedef typename CGAL::AABB_traits Traits; + typedef typename CGAL::AABB_tree Tree; + typedef typename Tree::Object_and_primitive_id Object_and_primitive_id; + Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron); + + // segment intersection query + Point p((FT)-0.25, (FT)0.251, (FT)0.255); + Point q((FT) 0.25, (FT)0.253, (FT)0.256); + Segment pq(p,q); + + if(!tree.do_intersect(pq)) + { + std::cerr << "no intersection found" << std::endl; + return EXIT_FAILURE; + } + + if(tree.number_of_intersected_primitives(pq) != 1) + { + std::cerr << "number of intersections different than one" << std::endl; + return EXIT_FAILURE; + } + + boost::optional any; + any = tree.any_intersection(pq); + if(!any) + { + std::cerr << "did not find any intersection" << std::endl; + return EXIT_FAILURE; + } + Object_and_primitive_id op = *any; + CGAL::Object object = op.first; + Point point; + if(CGAL::assign(point,object)) + { + std::cout << "Intersection point: " << point << std::endl; + } + else + { + std::cerr << "intersection does not assign to a point" << std::endl; + return EXIT_FAILURE; + } + + // line intersection query + Line line_pq(p,q); + if(!tree.do_intersect(line_pq)) + { + std::cerr << "no intersection found with line" << std::endl; + return EXIT_FAILURE; + } + if(tree.number_of_intersected_primitives(line_pq) != 2) + { + std::cerr << "number of intersections different than two with line" << std::endl; + return EXIT_FAILURE; + } + + // closest point query + Point r((FT)0.0, (FT)0.0, (FT)3.0); + Point closest((FT)0.0, (FT)0.0, (FT)1.0); + Point result = tree.closest_point(r); + if(result != closest) + { + std::cerr << "wrong closest point" << std::endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; } int main() { - if(test >() == EXIT_FAILURE) - return EXIT_FAILURE; + if(test >() == EXIT_FAILURE) + return EXIT_FAILURE; - if(test >() == EXIT_FAILURE) - return EXIT_FAILURE; + if(test >() == EXIT_FAILURE) + return EXIT_FAILURE; - if(test() == EXIT_FAILURE) - return EXIT_FAILURE; + if(test() == EXIT_FAILURE) + return EXIT_FAILURE; - return EXIT_SUCCESS; + return EXIT_SUCCESS; } /***EMACS SETTINGS***/ diff --git a/AABB_tree/test/AABB_tree/aabb_test_datum.cpp b/AABB_tree/test/AABB_tree/aabb_test_datum.cpp index dac02e5349b4..dc732d402656 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_datum.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_datum.cpp @@ -43,17 +43,17 @@ int main(void) std::cout << "error reading bunny" << std::endl; return 1; } - + Tree t1(faces(m).begin(), faces(m).end(), m); Tree2 t2(faces(m).begin(), faces(m).end(), m); Tree3 t3(faces(m).begin(), faces(m).end(), m); Tree4 t4(faces(m).begin(), faces(m).end(), m); - + t1.build(); t2.build(); t3.build(); t4.build(); - + Primitive p1(faces(m).begin(), m); Primitive2 p2(faces(m).begin(), m); Primitive3 p3(faces(m).begin(), m); diff --git a/AABB_tree/test/AABB_tree/aabb_test_empty_tree.cpp b/AABB_tree/test/AABB_tree/aabb_test_empty_tree.cpp index 3ba407641308..c10ea5f1acf6 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_empty_tree.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_empty_tree.cpp @@ -38,7 +38,7 @@ int main() tree.all_intersected_primitives(triangle_query, devnull); assert(!tree.any_intersected_primitive(triangle_query)); assert(!tree.any_intersection(triangle_query)); - //Cannot call tree.bbox(); + //Cannot call tree.bbox(); tree.build(); tree.clear(); //Cannot call tree.closest_*(...) diff --git a/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp b/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp index 21d201a00623..1993556fee7d 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp @@ -25,14 +25,14 @@ typedef K::Segment_3 Segment; typedef K::Ray_3 Ray; typedef CGAL::Surface_mesh > Mesh; typedef CGAL::AABB_face_graph_triangle_primitive T_Primitive; typedef CGAL::AABB_traits T_Traits; typedef CGAL::AABB_tree T_Tree; typedef T_Tree::Primitive_id T_Primitive_id; typedef CGAL::AABB_halfedge_graph_segment_primitive E_Primitive; typedef CGAL::AABB_traits E_Traits; typedef CGAL::AABB_tree E_Tree; @@ -61,8 +61,8 @@ int main() tree.insert(faces(m2).first, faces(m2).second, m2); tree.build(); T_Tree::Bounding_box bbox = tree.bbox(); - Point bbox_center((bbox.xmin() + bbox.xmax()) / 2, - (bbox.ymin() + bbox.ymax()) / 2, + Point bbox_center((bbox.xmin() + bbox.xmax()) / 2, + (bbox.ymin() + bbox.ymax()) / 2, (bbox.zmin() + bbox.zmax()) / 2); std::vector< T_Primitive_id > intersections; Ray ray(bbox_center+Vector(3,-0.25,0),bbox_center+Vector(-3,+0.25,0)); @@ -75,8 +75,8 @@ int main() Ray e_ray(Point(0,0,0),Point(0,1,1)); e_tree.all_intersected_primitives(e_ray, std::back_inserter(e_intersections)); - - - + + + return 0; } diff --git a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp index 06adc76dae7d..debf7e255225 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp @@ -89,8 +89,8 @@ int main() Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron); Tree::Bounding_box bbox = tree.bbox(); - Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2, - (bbox.ymin() + bbox.ymax()) / 2, + Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2, + (bbox.ymin() + bbox.ymax()) / 2, (bbox.zmin() + bbox.zmax()) / 2); boost::array extents; extents[0] = bbox.xmax() - bbox.xmin(); @@ -101,7 +101,7 @@ int main() std::cout << bbox << std::endl; std::cout << bbox_center << std::endl; std::cout << max_extent << std::endl; - + const int NB_RAYS = 1000; std::vector v1, v2; v1.reserve(NB_RAYS); v2.reserve(NB_RAYS); @@ -119,7 +119,7 @@ int main() for(std::vector::iterator it = v2.begin(); it != v2.end(); ++it) { *it = *it + bbox_center; } - + // Generate NB_RAYS using v1 as source and v2 as target. std::vector rays; rays.reserve(NB_RAYS); @@ -143,7 +143,7 @@ int main() "Primitives mismatch."); std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none); std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl; - std::cout << "Primitive method had to sort " << accum/NB_RAYS + std::cout << "Primitive method had to sort " << accum/NB_RAYS << " intersections on average." << std::endl; t.stop(); std::cout << t.time() << std::endl; diff --git a/AABB_tree/test/AABB_tree/aabb_test_singleton_tree.cpp b/AABB_tree/test/AABB_tree/aabb_test_singleton_tree.cpp index aaf49dbf12b7..cc26689d64e1 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_singleton_tree.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_singleton_tree.cpp @@ -46,10 +46,10 @@ int main() tree.insert(segments.begin(), segments.end()); tree.build(); assert(tree.closest_point(Point(-0.1, -0.1, -0.1)) == Point(0, 0, 0)); - assert(tree.closest_point(Point(-0.1, -0.1, -0.1), Point(0, 0, 0)) == - Point(0, 0, 0)); + assert(tree.closest_point(Point(-0.1, -0.1, -0.1), Point(0, 0, 0)) == + Point(0, 0, 0)); assert(tree.closest_point_and_primitive(Point(-0.1, -0.1, -0.1)).second == - segments.begin()); + segments.begin()); // Too lazy to call closest_point_and_primitive with a hint. The API is // strange. --Laurent Rineau, 2013/01/16 assert(tree.do_intersect(plane_query) == true); diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt index 269a60864e87..e62cfe0689ac 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp index 4b984f317d9d..d944cf985dff 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp @@ -45,7 +45,7 @@ struct On_the_fly_pair{ typedef std::pair result_type; On_the_fly_pair(const Pwn_vector& points) : points(points) {} - + result_type operator()(std::size_t i) const { @@ -59,7 +59,7 @@ struct Priority_with_structure_coherence { Structure& structure; double bound; - + Priority_with_structure_coherence(Structure& structure, double bound) : structure (structure), bound (bound) @@ -111,10 +111,10 @@ int main (int argc, char* argv[]) Pwn_vector points; const char* fname = (argc>1) ? argv[1] : "data/cube.pwn"; - // Loading point set from a file. + // Loading point set from a file. std::ifstream stream(fname); - if (!stream || + if (!stream || !CGAL::read_xyz_points(stream, std::back_inserter(points), CGAL::parameters::point_map(Point_map()). @@ -194,6 +194,6 @@ int main (int argc, char* argv[]) std::cerr << "all done\n" << std::endl; f.close(); - + return 0; } diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h index d39f54faeb26..e997bd55870a 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h @@ -401,12 +401,12 @@ namespace CGAL { { if (vh->m_incident_border == nullptr) return false; //vh is interior if (vh->m_incident_border->first->first != nullptr) - { - if (vh->m_incident_border->second->first != nullptr) - return ((vh->m_incident_border->first->second.second == i)|| - (vh->m_incident_border->second->second.second == i)); - return (vh->m_incident_border->first->second.second == i); - } + { + if (vh->m_incident_border->second->first != nullptr) + return ((vh->m_incident_border->first->second.second == i)|| + (vh->m_incident_border->second->second.second == i)); + return (vh->m_incident_border->first->second.second == i); + } return false; //vh is still exterior } @@ -414,32 +414,32 @@ namespace CGAL { void remove_border_edge(Vertex_handle w, Vertex_handle v) { if (w->m_incident_border != nullptr) - { - if (w->m_incident_border->second->first == v) - { - w->m_incident_border->second->first = nullptr; - set_interior_edge(w,v); - return; - } - if (w->m_incident_border->first->first == v) - { - if (w->m_incident_border->second->first != nullptr) - { - Next_border_elt* tmp = w->m_incident_border->first; - w->m_incident_border->first = w->m_incident_border->second; - w->m_incident_border->second = tmp; - w->m_incident_border->second->first = nullptr; - set_interior_edge(w,v); - return; - } - else - { - w->m_incident_border->first->first = nullptr; - set_interior_edge(w,v); - return; - } - } - } + { + if (w->m_incident_border->second->first == v) + { + w->m_incident_border->second->first = nullptr; + set_interior_edge(w,v); + return; + } + if (w->m_incident_border->first->first == v) + { + if (w->m_incident_border->second->first != nullptr) + { + Next_border_elt* tmp = w->m_incident_border->first; + w->m_incident_border->first = w->m_incident_border->second; + w->m_incident_border->second = tmp; + w->m_incident_border->second->first = nullptr; + set_interior_edge(w,v); + return; + } + else + { + w->m_incident_border->first->first = nullptr; + set_interior_edge(w,v); + return; + } + } + } } @@ -448,12 +448,12 @@ namespace CGAL { bool r1; if(w->m_ie_first == ie_sentinel){ - r1 = false; + r1 = false; }else { - typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); - e++; - typename std::list::iterator r = std::find(b, e, v); - r1 = ( r != e); + typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); + e++; + typename std::list::iterator r = std::find(b, e, v); + r1 = ( r != e); } return r1; @@ -467,17 +467,17 @@ namespace CGAL { inline void set_interior_edge(Vertex_handle w, Vertex_handle v) { if(w->m_ie_last == ie_sentinel){ // empty set - CGAL_assertion(w->m_ie_first == w->m_ie_last); - w->m_ie_last = interior_edges.insert(w->m_ie_last, v); - w->m_ie_first = w->m_ie_last; + CGAL_assertion(w->m_ie_first == w->m_ie_last); + w->m_ie_last = interior_edges.insert(w->m_ie_last, v); + w->m_ie_first = w->m_ie_last; } else { - typename std::list::iterator e(w->m_ie_last); - e++; + typename std::list::iterator e(w->m_ie_last); + e++; #ifdef DEBUG - typename std::list::iterator r = std::find(w->m_ie_first, e, v); - CGAL_assertion(r == e); + typename std::list::iterator r = std::find(w->m_ie_first, e, v); + CGAL_assertion(r == e); #endif - w->m_ie_last = interior_edges.insert(e, v); + w->m_ie_last = interior_edges.insert(e, v); } } @@ -485,26 +485,26 @@ namespace CGAL { inline void remove_interior_edge(Vertex_handle w, Vertex_handle v) { if(w->m_ie_first == ie_sentinel){ - CGAL_assertion(w->m_ie_last == w->m_ie_first); + CGAL_assertion(w->m_ie_last == w->m_ie_first); } else if(w->m_ie_first == w->m_ie_last){ // there is only one element - if(*(w->m_ie_first) == v){ - interior_edges.erase(w->m_ie_first); - w->m_ie_last = ie_sentinel; - w->m_ie_first = w->m_ie_last; - } + if(*(w->m_ie_first) == v){ + interior_edges.erase(w->m_ie_first); + w->m_ie_last = ie_sentinel; + w->m_ie_first = w->m_ie_last; + } } else { - typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); - e++; - typename std::list::iterator r = std::find(b, e, v); - if(r != e){ - if(r == w->m_ie_first){ - w->m_ie_first++; - } - if(r == w->m_ie_last){ - w->m_ie_last--; - } - interior_edges.erase(r); - } + typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); + e++; + typename std::list::iterator r = std::find(b, e, v); + if(r != e){ + if(r == w->m_ie_first){ + w->m_ie_first++; + } + if(r == w->m_ie_last){ + w->m_ie_last--; + } + interior_edges.erase(r); + } } } @@ -514,20 +514,20 @@ namespace CGAL { inline void set_incidence_request(Vertex_handle w, const Incidence_request_elt& ir) { if(w->m_ir_last == sentinel ){ - CGAL_assertion(w->m_ir_first == w->m_ir_last); - w->m_ir_last = incidence_requests.insert(w->m_ir_last, ir); - w->m_ir_first = w->m_ir_last; + CGAL_assertion(w->m_ir_first == w->m_ir_last); + w->m_ir_last = incidence_requests.insert(w->m_ir_last, ir); + w->m_ir_first = w->m_ir_last; } else { - typename std::list::iterator e(w->m_ir_last); - e++; - w->m_ir_last = incidence_requests.insert(e, ir); + typename std::list::iterator e(w->m_ir_last); + e++; + w->m_ir_last = incidence_requests.insert(e, ir); } } inline bool is_incidence_requested(Vertex_handle w) const { if(w->m_ir_last == sentinel ){ - CGAL_assertion(w->m_ir_first == sentinel ); + CGAL_assertion(w->m_ir_first == sentinel ); } return (w->m_ir_last != sentinel ); } @@ -540,10 +540,10 @@ namespace CGAL { inline Incidence_request_iterator incidence_request_end(Vertex_handle w) { if(w->m_ir_last != sentinel ){ - CGAL_assertion(w->m_ir_first != sentinel ); - Incidence_request_iterator it(w->m_ir_last); - it++; - return it; + CGAL_assertion(w->m_ir_first != sentinel ); + Incidence_request_iterator it(w->m_ir_last); + it++; + return it; } return w->m_ir_last; } @@ -551,11 +551,11 @@ namespace CGAL { inline void erase_incidence_request(Vertex_handle w) { if(w->m_ir_last != sentinel ){ - CGAL_assertion(w->m_ir_first != sentinel ); - w->m_ir_last++; - incidence_requests.erase(w->m_ir_first, w->m_ir_last); - w->m_ir_first = sentinel ; - w->m_ir_last = sentinel ; + CGAL_assertion(w->m_ir_first != sentinel ); + w->m_ir_last++; + incidence_requests.erase(w->m_ir_first, w->m_ir_last); + w->m_ir_first = sentinel ; + w->m_ir_last = sentinel ; } } @@ -563,17 +563,17 @@ namespace CGAL { void re_init(Vertex_handle w) { if (w->m_incident_border != nullptr) - { - w->delete_border(); - } + { + w->delete_border(); + } if(w->m_ir_first != sentinel ){ - CGAL_assertion(w->m_ir_last != sentinel ); - typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last); - e++; - incidence_requests.erase(b, e); - w->m_ir_first = sentinel ; - w->m_ir_last = sentinel ; + CGAL_assertion(w->m_ir_last != sentinel ); + typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last); + e++; + incidence_requests.erase(b, e); + w->m_ir_first = sentinel ; + w->m_ir_last = sentinel ; } w->m_incident_border = new_border(); @@ -587,10 +587,10 @@ namespace CGAL { { w->m_mark--; if(w->m_mark == 0) - { - w->delete_border(); - erase_incidence_request(w); - } + { + w->delete_border(); + erase_incidence_request(w); + } } @@ -621,21 +621,21 @@ namespace CGAL { void clear_vertex(Vertex_handle w) { if (w->m_incident_border != nullptr) - { - w->delete_border(); - } + { + w->delete_border(); + } if(w->m_ir_first != sentinel ){ - CGAL_assertion(w->m_ir_last != sentinel ); - typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last); - e++; - incidence_requests.erase(b, e); + CGAL_assertion(w->m_ir_last != sentinel ); + typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last); + e++; + incidence_requests.erase(b, e); } if(w->m_ie_first != ie_sentinel){ - CGAL_assertion(w->m_ie_last != ie_sentinel); - typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); - e++; - interior_edges.erase(b, e); + CGAL_assertion(w->m_ie_last != ie_sentinel); + typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); + e++; + interior_edges.erase(b, e); } } @@ -1315,7 +1315,7 @@ namespace CGAL { returns the infinite floating value that prevents a facet to be used. */ coord_type infinity() const { return std::numeric_limits::infinity(); } - /// @} + /// @} //--------------------------------------------------------------------- // For a border edge e we determine the incident facet which has the highest @@ -1801,150 +1801,150 @@ namespace CGAL { return EXTERIOR_CASE; } else // c->vertex(i) is a border point (and now there's only 1 - // border incident to a point... _mark<1 even if th orientation - // may be such as one vh has 2 successorson the same border... - { - // a ce niveau on peut tester si le recollement se fait en - // maintenant la compatibilite d'orientation des bords (pour - // surface orientable...) ou si elle est brisee... - Edge_incident_facet edge_Ifacet_1(Edge(c, i, edge_Efacet.first.second), + // border incident to a point... _mark<1 even if th orientation + // may be such as one vh has 2 successorson the same border... + { + // a ce niveau on peut tester si le recollement se fait en + // maintenant la compatibilite d'orientation des bords (pour + // surface orientable...) ou si elle est brisee... + Edge_incident_facet edge_Ifacet_1(Edge(c, i, edge_Efacet.first.second), edge_Efacet.second); - Edge_incident_facet edge_Ifacet_2(Edge(c, i, edge_Efacet.first.third), + Edge_incident_facet edge_Ifacet_2(Edge(c, i, edge_Efacet.first.third), edge_Efacet.second); - e1 = compute_value(edge_Ifacet_1); - e2 = compute_value(edge_Ifacet_2); - - if ((e1.first >= STANDBY_CANDIDATE)&&(e2.first >= STANDBY_CANDIDATE)) - return NOT_VALID_CONNECTING_CASE; - - // vu compute value: les candidats oreilles fournis sont sans - // aretes interieures et le sommet oppose n'est pas non plus interieur - Edge_incident_facet ear1 = e1.second.second; - Edge_incident_facet ear2 = e2.second.second; - - int ear1_i = (6 - ear1.second - - ear1.first.second - - ear1.first.third); - Cell_handle ear1_c = ear1.first.first; - Border_elt result_ear1; - - int ear2_i = (6 - ear2.second - - ear2.first.second - - ear2.first.third); - Cell_handle ear2_c = ear2.first.first; - Border_elt result_ear2; - - Edge_like ear1_e, ear2_e; - // pour maintenir la reconstruction d'une surface orientable : - // on verifie que les bords se recollent dans des sens opposes - if (ordered_key.first==v1) - { - ear1_e = Edge_like(c->vertex(i), ear1_c ->vertex(ear1_i)); - ear2_e = Edge_like(ear2_c ->vertex(ear2_i), c->vertex(i)); - } - else - { - ear1_e = Edge_like(ear1_c ->vertex(ear1_i), c->vertex(i)); - ear2_e = Edge_like(c->vertex(i), ear2_c ->vertex(ear2_i)); - } - - //maintient la surface orientable - bool is_border_ear1 = is_ordered_border_elt(ear1_e, result_ear1); - bool is_border_ear2 = is_ordered_border_elt(ear2_e, result_ear2); - bool ear1_valid(false), ear2_valid(false); - if (is_border_ear1&&(e1.first < STANDBY_CANDIDATE)&& - (e1.first <= value)&& - (result12.second==result_ear1.second)) - { - ear1_valid = test_merge(ear1_e, result_ear1, v1, - priority(*this, ear1_c, ear1.second)) != 0; - } - if (is_border_ear2&&(e2.first < STANDBY_CANDIDATE)&& - (e2.first <= value)&& - (result12.second==result_ear2.second)) - { - ear2_valid = test_merge(ear2_e, result_ear2, v2, - priority(*this, ear2_c, ear2.second)) != 0; - } - if ((!ear1_valid)&&(!ear2_valid)) - return NOT_VALID_CONNECTING_CASE; - - IO_edge_type* p1; - IO_edge_type* p2; - - border_extend(ordered_key, result12, - v1, v2, c->vertex(i), - e1, e2, p1, p2); - - if (ear1_valid&&ear2_valid&&(ear1_e==ear2_e)) - { - if (e1.first < e2.first) - { - Validation_case res = validate(ear1, e1.first); - if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; - e2 = compute_value(edge_Ifacet_2); - - if (ordered_key.first == v1) - p2 = set_again_border_elt(c->vertex(i), v2, - Border_elt(e2, result2.second)); - else - p2 = set_again_border_elt(v2, c->vertex(i), - Border_elt(e2, result2.second)); - - _ordered_border.insert(Radius_ptr_type(e2.first, p2)); - } - else - { - Validation_case res = validate(ear2, e2.first); - if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; - e1 = compute_value(edge_Ifacet_1); - - if (ordered_key.first == v1) - p1 = set_again_border_elt(v1, c->vertex(i), - Border_elt(e1, result1.second)); - else - p1 = set_again_border_elt(c->vertex(i), v1, - Border_elt(e1, result1.second)); - - _ordered_border.insert(Radius_ptr_type(e1.first, p1)); - } - } - else// les deux oreilles ne se recollent pas sur la meme arete... - { - // on resoud la singularite. - if (ear1_valid) - { - Validation_case res = validate(ear1, e1.first); - if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; - } - if (ear2_valid) - { - Validation_case res = validate(ear2, e2.first); - if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; - } - // on met a jour la PQ s'il y a lieu... mais surtout pas - // avant la resolution de la singularite - if (!ear1_valid) - { - _ordered_border.insert(Radius_ptr_type(e1.first, p1)); - } - if (!ear2_valid) - { - _ordered_border.insert(Radius_ptr_type(e2.first, p2)); - } - } - select_facet(c, edge_Efacet.second); - return CONNECTING_CASE; - } + e1 = compute_value(edge_Ifacet_1); + e2 = compute_value(edge_Ifacet_2); + + if ((e1.first >= STANDBY_CANDIDATE)&&(e2.first >= STANDBY_CANDIDATE)) + return NOT_VALID_CONNECTING_CASE; + + // vu compute value: les candidats oreilles fournis sont sans + // aretes interieures et le sommet oppose n'est pas non plus interieur + Edge_incident_facet ear1 = e1.second.second; + Edge_incident_facet ear2 = e2.second.second; + + int ear1_i = (6 - ear1.second + - ear1.first.second + - ear1.first.third); + Cell_handle ear1_c = ear1.first.first; + Border_elt result_ear1; + + int ear2_i = (6 - ear2.second + - ear2.first.second + - ear2.first.third); + Cell_handle ear2_c = ear2.first.first; + Border_elt result_ear2; + + Edge_like ear1_e, ear2_e; + // pour maintenir la reconstruction d'une surface orientable : + // on verifie que les bords se recollent dans des sens opposes + if (ordered_key.first==v1) + { + ear1_e = Edge_like(c->vertex(i), ear1_c ->vertex(ear1_i)); + ear2_e = Edge_like(ear2_c ->vertex(ear2_i), c->vertex(i)); + } + else + { + ear1_e = Edge_like(ear1_c ->vertex(ear1_i), c->vertex(i)); + ear2_e = Edge_like(c->vertex(i), ear2_c ->vertex(ear2_i)); + } + + //maintient la surface orientable + bool is_border_ear1 = is_ordered_border_elt(ear1_e, result_ear1); + bool is_border_ear2 = is_ordered_border_elt(ear2_e, result_ear2); + bool ear1_valid(false), ear2_valid(false); + if (is_border_ear1&&(e1.first < STANDBY_CANDIDATE)&& + (e1.first <= value)&& + (result12.second==result_ear1.second)) + { + ear1_valid = test_merge(ear1_e, result_ear1, v1, + priority(*this, ear1_c, ear1.second)) != 0; + } + if (is_border_ear2&&(e2.first < STANDBY_CANDIDATE)&& + (e2.first <= value)&& + (result12.second==result_ear2.second)) + { + ear2_valid = test_merge(ear2_e, result_ear2, v2, + priority(*this, ear2_c, ear2.second)) != 0; + } + if ((!ear1_valid)&&(!ear2_valid)) + return NOT_VALID_CONNECTING_CASE; + + IO_edge_type* p1; + IO_edge_type* p2; + + border_extend(ordered_key, result12, + v1, v2, c->vertex(i), + e1, e2, p1, p2); + + if (ear1_valid&&ear2_valid&&(ear1_e==ear2_e)) + { + if (e1.first < e2.first) + { + Validation_case res = validate(ear1, e1.first); + if (!((res == EAR_CASE)||(res == FINAL_CASE))) + std::cerr << "+++probleme de recollement : cas " + << res << std::endl; + e2 = compute_value(edge_Ifacet_2); + + if (ordered_key.first == v1) + p2 = set_again_border_elt(c->vertex(i), v2, + Border_elt(e2, result2.second)); + else + p2 = set_again_border_elt(v2, c->vertex(i), + Border_elt(e2, result2.second)); + + _ordered_border.insert(Radius_ptr_type(e2.first, p2)); + } + else + { + Validation_case res = validate(ear2, e2.first); + if (!((res == EAR_CASE)||(res == FINAL_CASE))) + std::cerr << "+++probleme de recollement : cas " + << res << std::endl; + e1 = compute_value(edge_Ifacet_1); + + if (ordered_key.first == v1) + p1 = set_again_border_elt(v1, c->vertex(i), + Border_elt(e1, result1.second)); + else + p1 = set_again_border_elt(c->vertex(i), v1, + Border_elt(e1, result1.second)); + + _ordered_border.insert(Radius_ptr_type(e1.first, p1)); + } + } + else// les deux oreilles ne se recollent pas sur la meme arete... + { + // on resoud la singularite. + if (ear1_valid) + { + Validation_case res = validate(ear1, e1.first); + if (!((res == EAR_CASE)||(res == FINAL_CASE))) + std::cerr << "+++probleme de recollement : cas " + << res << std::endl; + } + if (ear2_valid) + { + Validation_case res = validate(ear2, e2.first); + if (!((res == EAR_CASE)||(res == FINAL_CASE))) + std::cerr << "+++probleme de recollement : cas " + << res << std::endl; + } + // on met a jour la PQ s'il y a lieu... mais surtout pas + // avant la resolution de la singularite + if (!ear1_valid) + { + _ordered_border.insert(Radius_ptr_type(e1.first, p1)); + } + if (!ear2_valid) + { + _ordered_border.insert(Radius_ptr_type(e2.first, p2)); + } + } + select_facet(c, edge_Efacet.second); + return CONNECTING_CASE; + } } } } @@ -2047,7 +2047,7 @@ namespace CGAL { { new_candidate = compute_value(mem_Ifacet); if ((new_candidate != mem_e_it)) - // &&(new_candidate.first < NOT_VALID_CANDIDATE)) + // &&(new_candidate.first < NOT_VALID_CANDIDATE)) { IO_edge_type* pnew = set_again_border_elt(key_tmp.first, key_tmp.second, @@ -2369,7 +2369,7 @@ namespace CGAL { { std::list L_v_tmp; Vertex_handle vprev_it(v_it), done(vprev_it), vh_it; - // Vertex_handle vsucc_it; + // Vertex_handle vsucc_it; int v_count(0); // collect all vertices on the border do diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h index d01ad4c3db41..4cd733655b23 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h @@ -73,7 +73,7 @@ namespace CGAL { { #ifdef AFSR_FACET_NUMBER for(int i = 0; i < 4; i++){ - _facet_number[i] = -1; + _facet_number[i] = -1; } #endif } @@ -87,7 +87,7 @@ namespace CGAL { { #ifdef FACET_NUMBER for(int i = 0; i < 4; i++){ - _facet_number[i] = -1; + _facet_number[i] = -1; } #endif } @@ -103,7 +103,7 @@ namespace CGAL { { #ifdef AFSR_FACET_NUMBER for(int i = 0; i < 4; i++){ - _facet_number[i] = -1; + _facet_number[i] = -1; } #endif } @@ -116,9 +116,9 @@ namespace CGAL { delete[] _smallest_radius_facet_tab; #ifdef AFSR_LAZY if (_circumcenter != nullptr) - delete _circumcenter; + delete _circumcenter; if (_squared_radius != nullptr) - delete _squared_radius; + delete _squared_radius; #endif } @@ -128,15 +128,15 @@ namespace CGAL { inline void clear() { if (_smallest_radius_facet_tab != nullptr) - delete[] _smallest_radius_facet_tab; + delete[] _smallest_radius_facet_tab; _smallest_radius_facet_tab = nullptr; selected_facet = 0; #ifdef AFSR_LAZY if (_circumcenter != nullptr) - delete _circumcenter; + delete _circumcenter; _circumcenter = nullptr; if (_squared_radius != nullptr) - delete _squared_radius; + delete _squared_radius; _squared_radius = nullptr; #endif } @@ -145,18 +145,18 @@ namespace CGAL { inline coord_type smallest_radius(const int& i) { if (_smallest_radius_facet_tab == nullptr) - return -1; + return -1; return _smallest_radius_facet_tab[i]; } inline void set_smallest_radius(const int& i, const coord_type& c) { if (_smallest_radius_facet_tab == nullptr) - { - _smallest_radius_facet_tab = new coord_type[4]; - for(int i = 0; i < 4; i++) - _smallest_radius_facet_tab[i] = -1; - } + { + _smallest_radius_facet_tab = new coord_type[4]; + for(int i = 0; i < 4; i++) + _smallest_radius_facet_tab[i] = -1; + } _smallest_radius_facet_tab[i] = c; } @@ -164,10 +164,10 @@ namespace CGAL { inline bool alloc_smallest_radius_tab(coord_type* ptr) { if (_smallest_radius_facet_tab==nullptr) - { - _smallest_radius_facet_tab = ptr; - return true; - } + { + _smallest_radius_facet_tab = ptr; + return true; + } return false; } diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h index 5142e579f8a0..a8c2bf4b2b4c 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h @@ -173,11 +173,11 @@ namespace CGAL { { if (m_incident_border == nullptr) return nullptr; //vh is interior if (m_incident_border->first->first != nullptr) - if (m_incident_border->first->second.second == i) - return m_incident_border->first; + if (m_incident_border->first->second.second == i) + return m_incident_border->first; if (m_incident_border->second->first != nullptr) - if (m_incident_border->second->second.second == i) - return m_incident_border->second; + if (m_incident_border->second->second.second == i) + return m_incident_border->second; return nullptr; } @@ -188,7 +188,7 @@ namespace CGAL { { if (m_incident_border == nullptr) return false; return ((m_incident_border->first->first == v)|| - (m_incident_border->second->first == v)); + (m_incident_border->second->first == v)); } inline Next_border_elt* border_elt(Vertex_handle v) const @@ -216,13 +216,13 @@ namespace CGAL { inline void set_next_border_elt(const Next_border_elt& elt) { if (m_incident_border->first->first == nullptr) - *m_incident_border->first = elt; + *m_incident_border->first = elt; else - { - if (m_incident_border->second->first != nullptr) - std::cerr << "+++probleme de MAJ du bord " << std::endl; - *m_incident_border->second = elt; - } + { + if (m_incident_border->second->first != nullptr) + std::cerr << "+++probleme de MAJ du bord " << std::endl; + *m_incident_border->second = elt; + } } @@ -257,9 +257,9 @@ namespace CGAL { inline void inc_mark() { if (m_mark==-1) - m_mark=1; + m_mark=1; else - m_mark++; + m_mark++; } //------------------------------------------------------------------- diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt index 4112e7a65ce2..07b424ed3607 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt b/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt index b15d831286cb..de0ca3695a44 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt +++ b/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt @@ -1,7 +1,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_Algebraic_Foundations \cgalAutoToc @@ -9,25 +9,25 @@ namespace CGAL { \section Algebraic_foundationsIntroduction Introduction -\cgal is targeting towards exact computation with non-linear objects, -in particular objects defined on algebraic curves and surfaces. -As a consequence types representing polynomials, algebraic extensions and -finite fields play a more important role in related implementations. -This package has been introduced to stay abreast of these changes. +\cgal is targeting towards exact computation with non-linear objects, +in particular objects defined on algebraic curves and surfaces. +As a consequence types representing polynomials, algebraic extensions and +finite fields play a more important role in related implementations. +This package has been introduced to stay abreast of these changes. Since in particular polynomials must be supported by the introduced framework -the package avoids the term number type. Instead the package distinguishes -between the algebraic structure of a type and whether a type is embeddable on -the real axis, or real embeddable for short. -Moreover, the package introduces the notion of interoperable types which -allows an explicit handling of mixed operations. +the package avoids the term number type. Instead the package distinguishes +between the algebraic structure of a type and whether a type is embeddable on +the real axis, or real embeddable for short. +Moreover, the package introduces the notion of interoperable types which +allows an explicit handling of mixed operations. \section Algebraic_foundationsAlgebraic Algebraic Structures -The algebraic structure concepts introduced within this section are -motivated by their well known counterparts in traditional algebra, -but we also had to pay tribute to existing types and their restrictions. +The algebraic structure concepts introduced within this section are +motivated by their well known counterparts in traditional algebra, +but we also had to pay tribute to existing types and their restrictions. To keep the interface minimal, -it was not desirable to cover all known algebraic structures, +it was not desirable to cover all known algebraic structures, e.g., we did not introduce concepts for such basic structures as groups or exceptional structures as skew fields. @@ -35,95 +35,95 @@ exceptional structures as skew fields. Concept Hierarchy of Algebraic Structures \cgalFigureEnd -\cgalFigureRef{figConceptHierarchyOfAlgebraicStructures} shows the refinement -relationship of the algebraic structure concepts. -`IntegralDomain`, `UniqueFactorizationDomain`, `EuclideanRing` and +\cgalFigureRef{figConceptHierarchyOfAlgebraicStructures} shows the refinement +relationship of the algebraic structure concepts. +`IntegralDomain`, `UniqueFactorizationDomain`, `EuclideanRing` and `Field` correspond to the algebraic structures with the -same name. `FieldWithSqrt`, `FieldWithKthRoot` and -`FieldWithRootOf` are fields that in addition are closed under -the operations 'sqrt', 'k-th root' and 'real root of a polynomial', +same name. `FieldWithSqrt`, `FieldWithKthRoot` and +`FieldWithRootOf` are fields that in addition are closed under +the operations 'sqrt', 'k-th root' and 'real root of a polynomial', respectively. The concept `IntegralDomainWithoutDivision` also corresponds to integral domains in the algebraic sense, the distinction results from the fact that some implementations of -integral domains lack the (algebraically always well defined) integral +integral domains lack the (algebraically always well defined) integral division. -Note that `Field` refines `IntegralDomain`. This is because -most ring-theoretic notions like greatest common divisors become trivial for -`Field`s. Hence we see `Field` as a refinement of -`IntegralDomain` and not as a -refinement of one of the more advanced ring concepts. -If an algorithm wants to rely on gcd or remainder computation, it is trying +Note that `Field` refines `IntegralDomain`. This is because +most ring-theoretic notions like greatest common divisors become trivial for +`Field`s. Hence we see `Field` as a refinement of +`IntegralDomain` and not as a +refinement of one of the more advanced ring concepts. +If an algorithm wants to rely on gcd or remainder computation, it is trying to do things it should not do with a `Field` in the first place. -The main properties of an algebraic structure are collected in the class -`Algebraic_structure_traits`. -In particular the (most refined) concept each concrete model `AS` -fulfills is encoded in the tag +The main properties of an algebraic structure are collected in the class +`Algebraic_structure_traits`. +In particular the (most refined) concept each concrete model `AS` +fulfills is encoded in the tag \link AlgebraicStructureTraits::Algebraic_category `Algebraic_structure_traits::Algebraic_category` \endlink . -An algebraic structure is at least `Assignable`, -`CopyConstructible`, `DefaultConstructible` and +An algebraic structure is at least `Assignable`, +`CopyConstructible`, `DefaultConstructible` and `EqualityComparable`. Moreover, we require that it is constructible from `int`. -For ease of use and since their semantic is sufficiently standard to presume +For ease of use and since their semantic is sufficiently standard to presume their existence, the usual arithmetic and comparison operators are required -to be realized via \cpp operator overloading. -The division operator is reserved for division in fields. -All other unary (e.g., sqrt) and binary functions +to be realized via \cpp operator overloading. +The division operator is reserved for division in fields. +All other unary (e.g., sqrt) and binary functions (e.g., gcd, div) must be models of the well known \stl-concepts `AdaptableUnaryFunction` or `AdaptableBinaryFunction` -concept and local to the traits class -(e.g., \link AlgebraicStructureTraits::Sqrt `Algebraic_structure_traits::Sqrt()(x)` \endlink). -This design allows us to profit from all parts in the -\stl and its programming style and avoids the name-lookup and -two-pass template compilation problems experienced with the old design -using overloaded functions. However, for ease of use and backward -compatibility all functionality is also -accessible through global functions defined within namespace `CGAL`, +concept and local to the traits class +(e.g., \link AlgebraicStructureTraits::Sqrt `Algebraic_structure_traits::Sqrt()(x)` \endlink). +This design allows us to profit from all parts in the +\stl and its programming style and avoids the name-lookup and +two-pass template compilation problems experienced with the old design +using overloaded functions. However, for ease of use and backward +compatibility all functionality is also +accessible through global functions defined within namespace `CGAL`, e.g., \link sqrt `CGAL::sqrt(x)` \endlink. This is realized via function templates using -the according functor of the traits class. For an overview see +the according functor of the traits class. For an overview see Section \ref PkgAlgebraicFoundationsRef in the reference manual. \subsection Algebraic_foundationsTagsinAlgebraicStructure Tags in Algebraic Structure Traits \subsection Algebraic_foundationsAlgebraicCategory Algebraic Category -For a type `AS`, `Algebraic_structure_traits` -provides several tags. The most important tag is the `Algebraic_category` -tag, which indicates the most refined algebraic concept the type `AS` -fulfills. The tag is one of; -`Integral_domain_without_division_tag`, `Integral_domain_tag`, -`Field_tag`, `Field_with_sqrt_tag`, `Field_with_kth_root_tag`, -`Field_with_root_of_tag`, `Unique_factorization_domain_tag`, -`Euclidean_ring_tag`, or even `Null_tag` -in case the type is not a model of an algebraic structure concept. -The tags are derived from each other such that they reflect the -hierarchy of the algebraic structure concept, e.g., -`Field_with_sqrt_tag` is derived from `Field_tag`. +For a type `AS`, `Algebraic_structure_traits` +provides several tags. The most important tag is the `Algebraic_category` +tag, which indicates the most refined algebraic concept the type `AS` +fulfills. The tag is one of; +`Integral_domain_without_division_tag`, `Integral_domain_tag`, +`Field_tag`, `Field_with_sqrt_tag`, `Field_with_kth_root_tag`, +`Field_with_root_of_tag`, `Unique_factorization_domain_tag`, +`Euclidean_ring_tag`, or even `Null_tag` +in case the type is not a model of an algebraic structure concept. +The tags are derived from each other such that they reflect the +hierarchy of the algebraic structure concept, e.g., +`Field_with_sqrt_tag` is derived from `Field_tag`. \subsection Algebraic_foundationsExactandNumericalSensitive Exact and Numerical Sensitive -Moreover, `Algebraic_structure_traits` provides the tags `Is_exact` -and `Is_numerical_sensitive`, which are both `Boolean_tag`s. +Moreover, `Algebraic_structure_traits` provides the tags `Is_exact` +and `Is_numerical_sensitive`, which are both `Boolean_tag`s. An algebraic structure is considered exact, -if all operations required by its concept are computed such that a comparison +if all operations required by its concept are computed such that a comparison of two algebraic expressions is always correct. An algebraic structure is considered as numerically sensitive, -if the performance of the type is sensitive to the condition number of an +if the performance of the type is sensitive to the condition number of an algorithm. -Note that there is really a difference among these two notions, -e.g., the fundamental type `int` is not numerical sensitive but -considered inexact due to overflow. -Conversely, types as `leda_real` or `CORE::Expr` are exact but sensitive -to numerical issues due to the internal use of multi precision floating point +Note that there is really a difference among these two notions, +e.g., the fundamental type `int` is not numerical sensitive but +considered inexact due to overflow. +Conversely, types as `leda_real` or `CORE::Expr` are exact but sensitive +to numerical issues due to the internal use of multi precision floating point arithmetic. We expect that `Is_numerical_sensitive` is used for dispatching -of algorithms, while `Is_exact` is useful to enable assertions that can be +of algorithms, while `Is_exact` is useful to enable assertions that can be check for exact types only. -Tags are very useful to dispatch between alternative implementations. -The following example illustrates a dispatch for `Field`s using overloaded -functions. The example only needs two overloads since the algebraic +Tags are very useful to dispatch between alternative implementations. +The following example illustrates a dispatch for `Field`s using overloaded +functions. The example only needs two overloads since the algebraic category tags reflect the algebraic structure hierarchy. \cgalExample{Algebraic_foundations/algebraic_structure_dispatch.cpp} @@ -132,35 +132,35 @@ category tags reflect the algebraic structure hierarchy. \anchor secRealEmbeddable -Most number types represent some subset of the real numbers. From those types -we expect functionality to compute the sign, absolute value or double -approximations. In particular we can expect an order on such a type that -reflects the order along the real axis. +Most number types represent some subset of the real numbers. From those types +we expect functionality to compute the sign, absolute value or double +approximations. In particular we can expect an order on such a type that +reflects the order along the real axis. All these properties are gathered in the concept `::RealEmbeddable`. -The concept is orthogonal to the algebraic structure concepts, -i.e., it is possible -that a type is a model of `RealEmbeddable` only, +The concept is orthogonal to the algebraic structure concepts, +i.e., it is possible +that a type is a model of `RealEmbeddable` only, since the type may just represent values on the real axis but does not provide any arithmetic operations. As for algebraic structures this concept is also traits class oriented. -The main functionality related to `RealEmbeddable` is gathered in -the class `Real_embeddable_traits`. In particular, it provides the boolean -tag `Is_real_embeddable` indicating whether a type is a model of -`RealEmbeddable`. The comparison operators are required to be realized via -\cpp operator overloading. -All unary functions (e.g. sign, to_double) and -binary functions (e.g. compare ) are models of the \stl-concepts -`AdaptableUnaryFunction` and `AdaptableBinaryFunction` and are local +The main functionality related to `RealEmbeddable` is gathered in +the class `Real_embeddable_traits`. In particular, it provides the boolean +tag `Is_real_embeddable` indicating whether a type is a model of +`RealEmbeddable`. The comparison operators are required to be realized via +\cpp operator overloading. +All unary functions (e.g. sign, to_double) and +binary functions (e.g. compare ) are models of the \stl-concepts +`AdaptableUnaryFunction` and `AdaptableBinaryFunction` and are local to `Real_embeddable_traits`. -In case a type is a model of `IntegralDomainWithoutDivision` and -`RealEmbeddable` the number represented by an object of this type is +In case a type is a model of `IntegralDomainWithoutDivision` and +`RealEmbeddable` the number represented by an object of this type is the same for arithmetic and comparison. It follows that the ring represented by this type is a superset of the integers and a subset of the real numbers and hence has characteristic zero. -In case the type is a model of `Field` and `RealEmbeddable` it is a +In case the type is a model of `Field` and `RealEmbeddable` it is a superset of the rational numbers. \section Algebraic_foundationsRealN Real Number Types @@ -181,51 +181,51 @@ hierarchy of \cgalFigureRef{figConceptHierarchyOfAlgebraicStructures}. \section Algebraic_foundationsInteroperability Interoperability -This section introduces two concepts for interoperability of types, -namely `ImplicitInteroperable` and `ExplicitInteroperable`. While -`ExplicitInteroperable` is the base concept, we start with +This section introduces two concepts for interoperability of types, +namely `ImplicitInteroperable` and `ExplicitInteroperable`. While +`ExplicitInteroperable` is the base concept, we start with `ImplicitInteroperable` since it is the more intuitive one. In general mixed operations are provided by overloaded operators and -functions or just via implicit constructor calls. -This level of interoperability is reflected by the concept -`ImplicitInteroperable`. However, within template code the result type, +functions or just via implicit constructor calls. +This level of interoperability is reflected by the concept +`ImplicitInteroperable`. However, within template code the result type, or so called coercion type, of a mixed arithmetic operation may be unclear. Therefore, the package introduces `Coercion_traits` giving access to the coercion type via \link Coercion_traits::Type `Coercion_traits::Type` \endlink for two interoperable types `A` and `B`. -Some trivial example are `int` and `double` with coercion type double +Some trivial example are `int` and `double` with coercion type double or `Gmpz` and `Gmpq` with coercion type `Gmpq`. However, the coercion type is not necessarily one of the input types, -e.g. the coercion type of a polynomial -with integer coefficients that is multiplied by a rational type +e.g. the coercion type of a polynomial +with integer coefficients that is multiplied by a rational type is supposed to be a polynomial with rational coefficients. `Coercion_traits` is also -required to provide a functor \link Coercion_traits::Cast `Coercion_traits::Cast()` \endlink, that +required to provide a functor \link Coercion_traits::Cast `Coercion_traits::Cast()` \endlink, that converts from an input type into the coercion type. This is in fact the core -of the more basic concept `ExplicitInteroperable`. -`ExplicitInteroperable` has been introduced to cover more complex cases -for which it is hard or impossible to guarantee implicit interoperability. -Note that this functor can be useful for `ImplicitInteroperable` types +of the more basic concept `ExplicitInteroperable`. +`ExplicitInteroperable` has been introduced to cover more complex cases +for which it is hard or impossible to guarantee implicit interoperability. +Note that this functor can be useful for `ImplicitInteroperable` types as well, since it can be used to void redundant type conversions. -In case two types `A` and `B` are `ExplicitInteroperable` with -coercion type `C` they are valid argument types for all binary functors +In case two types `A` and `B` are `ExplicitInteroperable` with +coercion type `C` they are valid argument types for all binary functors provided by `Algebraic_structure_traits` and `Real_embeddable_traits` of `C`. This is also true for the according global functions. \subsection Algebraic_foundationsExamples Examples -The following example illustrates how two write code for +The following example illustrates how two write code for `ExplicitInteroperable` types. \cgalExample{Algebraic_foundations/interoperable.cpp} -The following example illustrates a dispatch for `ImplicitInteroperable` and -`ExplicitInteroperable` types. -The binary function (that just multiplies its two arguments) is supposed to +The following example illustrates a dispatch for `ImplicitInteroperable` and +`ExplicitInteroperable` types. +The binary function (that just multiplies its two arguments) is supposed to take two `ExplicitInteroperable` arguments. For `ImplicitInteroperable` types a variant that avoids the explicit cast is selected. @@ -233,21 +233,21 @@ types a variant that avoids the explicit cast is selected. \section Algebraic_foundationsFractions Fractions -Beyond the need for performing algebraic operations on objects as a -whole, there are also number types which one would like to decompose into -numerator and denominator. This does not only hold for rational numbers -as `Quotient`, `Gmpq`, `mpq_class` or `leda_rational`, but -also for compound objects as `Sqrt_extension` or `Polynomial` -which may decompose into a (scalar) -denominator and a compound numerator with a simpler coefficient type -(e.g. integer instead of rational). Often operations can be performed faster on -these denominator-free multiples. In case a type is a `Fraction` -the relevant functionality as well as the numerator and denominator -type are provided by `Fraction_traits`. In particular +Beyond the need for performing algebraic operations on objects as a +whole, there are also number types which one would like to decompose into +numerator and denominator. This does not only hold for rational numbers +as `Quotient`, `Gmpq`, `mpq_class` or `leda_rational`, but +also for compound objects as `Sqrt_extension` or `Polynomial` +which may decompose into a (scalar) +denominator and a compound numerator with a simpler coefficient type +(e.g. integer instead of rational). Often operations can be performed faster on +these denominator-free multiples. In case a type is a `Fraction` +the relevant functionality as well as the numerator and denominator +type are provided by `Fraction_traits`. In particular `Fraction_traits` provides a tag \link FractionTraits::Is_fraction `Is_fraction` \endlink that can be used for dispatching. -A related class is `Rational_traits` which has been kept for backward +A related class is `Rational_traits` which has been kept for backward compatibility reasons. However, we recommend to use `Fraction_traits` since it is more general and offers dispatching functionality. @@ -256,25 +256,25 @@ it is more general and offers dispatching functionality. The following example show a simple use of `Fraction_traits`: \cgalExample{Algebraic_foundations/fraction_traits.cpp} -The following example illustrates the integralization of a vector, -i.e., the coefficient vector of a polynomial. Note that for minimizing -coefficient growth \link FractionTraits::Common_factor `Fraction_traits::Common_factor` \endlink is used to +The following example illustrates the integralization of a vector, +i.e., the coefficient vector of a polynomial. Note that for minimizing +coefficient growth \link FractionTraits::Common_factor `Fraction_traits::Common_factor` \endlink is used to compute the least common multiple of the denominators. \cgalExample{Algebraic_foundations/integralize.cpp} \section Algebraic_foundationsDesign Design and Implementation History -The package is part of \cgal since release 3.3. Of course the package is based -on the former Number type support of CGAL. This goes back to Stefan Schirra and Andreas Fabri. But on the other hand the package is to a large extend influenced -by the experience with the number type support in Exacus \cgalCite{beh-eeeafcs-05}, -which in the main goes back to -Lutz Kettner, Susan Hert, Arno Eigenwillig and Michael Hemmer. -However, the package abstracts from the pure support for -number types that are embedded on the real axis which allows the support of -polynomials, finite fields, and algebraic extensions as well. See also related +The package is part of \cgal since release 3.3. Of course the package is based +on the former Number type support of CGAL. This goes back to Stefan Schirra and Andreas Fabri. But on the other hand the package is to a large extend influenced +by the experience with the number type support in Exacus \cgalCite{beh-eeeafcs-05}, +which in the main goes back to +Lutz Kettner, Susan Hert, Arno Eigenwillig and Michael Hemmer. +However, the package abstracts from the pure support for +number types that are embedded on the real axis which allows the support of +polynomials, finite fields, and algebraic extensions as well. See also related subsequent chapters. -*/ +*/ } /* namespace CGAL */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h index fee8e9b1daa7..ebc961629571 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where T is the associated type. +An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where T is the associated type. \cgalModels `AlgebraicStructureTraits` @@ -19,13 +19,13 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the -`EuclideanRing` concept. +Tag indicating that a type is a model of the +`EuclideanRing` concept. \cgalModels `DefaultConstructible` -\sa `EuclideanRing` -\sa `AlgebraicStructureTraits` +\sa `EuclideanRing` +\sa `AlgebraicStructureTraits` */ @@ -36,12 +36,12 @@ struct Euclidean_ring_tag : public Unique_factorization_domain_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `Field` concept. +Tag indicating that a type is a model of the `Field` concept. \cgalModels `DefaultConstructible` -\sa `Field` -\sa `AlgebraicStructureTraits` +\sa `Field` +\sa `AlgebraicStructureTraits` */ @@ -52,12 +52,12 @@ struct Field_tag : public Integral_domain_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `FieldWithKthRoot` concept. +Tag indicating that a type is a model of the `FieldWithKthRoot` concept. \cgalModels `DefaultConstructible` -\sa `FieldWithKthRoot` -\sa `AlgebraicStructureTraits` +\sa `FieldWithKthRoot` +\sa `AlgebraicStructureTraits` */ @@ -68,12 +68,12 @@ struct Field_with_kth_root_tag : public Field_with_sqrt_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `FieldWithRootOf` concept. +Tag indicating that a type is a model of the `FieldWithRootOf` concept. \cgalModels `DefaultConstructible` -\sa `FieldWithRootOf` -\sa `AlgebraicStructureTraits` +\sa `FieldWithRootOf` +\sa `AlgebraicStructureTraits` */ @@ -84,12 +84,12 @@ struct Field_with_root_of_tag : public Field_with_kth_root_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `FieldWithSqrt` concept. +Tag indicating that a type is a model of the `FieldWithSqrt` concept. \cgalModels `DefaultConstructible` -\sa `FieldWithSqrt` -\sa `AlgebraicStructureTraits` +\sa `FieldWithSqrt` +\sa `AlgebraicStructureTraits` */ @@ -100,12 +100,12 @@ struct Field_with_sqrt_tag : public Field_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `IntegralDomain` concept. +Tag indicating that a type is a model of the `IntegralDomain` concept. \cgalModels `DefaultConstructible` -\sa `IntegralDomain` -\sa `AlgebraicStructureTraits` +\sa `IntegralDomain` +\sa `AlgebraicStructureTraits` */ @@ -116,11 +116,11 @@ struct Integral_domain_tag : public Integral_domain_without_division_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept. +Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept. \cgalModels `DefaultConstructible` -\sa `IntegralDomainWithoutDivision` +\sa `IntegralDomainWithoutDivision` */ @@ -131,12 +131,12 @@ struct Integral_domain_without_division_tag { /*! \ingroup PkgAlgebraicFoundationsRef -Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept. +Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept. \cgalModels `DefaultConstructible` -\sa `UniqueFactorizationDomain` -\sa `AlgebraicStructureTraits` +\sa `UniqueFactorizationDomain` +\sa `AlgebraicStructureTraits` */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h index 51241f2fec21..311630dca76c 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h @@ -4,46 +4,46 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -An instance of `Coercion_traits` reflects the type coercion of the types -A and B, it is symmetric in the two template arguments. +An instance of `Coercion_traits` reflects the type coercion of the types +A and B, it is symmetric in the two template arguments. -\sa `ExplicitInteroperable` -\sa `ImplicitInteroperable` +\sa `ExplicitInteroperable` +\sa `ImplicitInteroperable` */ template< typename A, typename B > struct Coercion_traits { -/// \name Types +/// \name Types /// @{ /*! -Tag indicating whether the two types A and B are a model of `ExplicitInteroperable` +Tag indicating whether the two types A and B are a model of `ExplicitInteroperable` -This is either `CGAL::Tag_true` or `CGAL::Tag_false`. -*/ -typedef unspecified_type Are_explicit_interoperable; +This is either `CGAL::Tag_true` or `CGAL::Tag_false`. +*/ +typedef unspecified_type Are_explicit_interoperable; /*! -Tag indicating whether the two types A and B are a model of `ImplicitInteroperable` +Tag indicating whether the two types A and B are a model of `ImplicitInteroperable` -This is either `CGAL::Tag_true` or `CGAL::Tag_false`. -*/ -typedef unspecified_type Are_implicit_interoperable; +This is either `CGAL::Tag_true` or `CGAL::Tag_false`. +*/ +typedef unspecified_type Are_implicit_interoperable; /*! -The coercion type of `A` and `B`. +The coercion type of `A` and `B`. -In case A and B are not `ExplicitInteroperable` this is undefined. -*/ -typedef unspecified_type Type; +In case A and B are not `ExplicitInteroperable` this is undefined. +*/ +typedef unspecified_type Type; /*! -A model of the `AdaptableFunctor` concept, providing the conversion of `A` or `B` to `Type`. +A model of the `AdaptableFunctor` concept, providing the conversion of `A` or `B` to `Type`. -In case A and B are not `ExplicitInteroperable` this is undefined. -*/ -typedef unspecified_type Cast; +In case A and B are not `ExplicitInteroperable` this is undefined. +*/ +typedef unspecified_type Cast; /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h index 1e168ca3e0f2..d54d382dfd9f 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h @@ -3,8 +3,8 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -An instance of `Fraction_traits` is a model of `FractionTraits`, -where `T` is the associated type. +An instance of `Fraction_traits` is a model of `FractionTraits`, +where `T` is the associated type. \cgalModels `FractionTraits` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h index fa61be8f8df9..90953f33c910 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where T is the associated type. +An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where T is the associated type. \cgalModels `RealEmbeddableTraits` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h index 153988e6d93d..f81aa3945c26 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h @@ -3,13 +3,13 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The template function `abs()` returns the absolute value of a number. +The template function `abs()` returns the absolute value of a number. -The function is defined if the argument type -is a model of the `RealEmbeddable` concept. +The function is defined if the argument type +is a model of the `RealEmbeddable` concept. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::Abs` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::Abs` */ template NT abs(const NT& x); @@ -21,21 +21,21 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The template function `compare()` compares the first argument with respect to -the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$. +The template function `compare()` compares the first argument with respect to +the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$. -In case the argument types `NT1` and `NT2` differ, -`compare` is performed with the semantic of the type determined via -`Coercion_traits`. -The function is defined if this type -is a model of the `RealEmbeddable` concept. +In case the argument types `NT1` and `NT2` differ, +`compare` is performed with the semantic of the type determined via +`Coercion_traits`. +The function is defined if this type +is a model of the `RealEmbeddable` concept. -The `result_type` is convertible to `CGAL::Comparison_result`. +The `result_type` is convertible to `CGAL::Comparison_result`. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::Compare` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::Compare` */ -template +template result_type compare(const NT &x, const NT &y); } /* namespace CGAL */ @@ -45,28 +45,28 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `div()` computes the integral quotient of division -with remainder. +The function `div()` computes the integral quotient of division +with remainder. -In case the argument types `NT1` and `NT2` differ, -the `result_type` is determined via `Coercion_traits`. +In case the argument types `NT1` and `NT2` differ, +the `result_type` is determined via `Coercion_traits`. -Thus, the `result_type` is well defined if `NT1` and `NT2` -are a model of `ExplicitInteroperable`. +Thus, the `result_type` is well defined if `NT1` and `NT2` +are a model of `ExplicitInteroperable`. -The actual `div` is performed with the semantic of that type. +The actual `div` is performed with the semantic of that type. -The function is defined if `result_type` -is a model of the `EuclideanRing` concept. +The function is defined if `result_type` +is a model of the `EuclideanRing` concept. -\sa `EuclideanRing` -\sa `AlgebraicStructureTraits_::Div` +\sa `EuclideanRing` +\sa `AlgebraicStructureTraits_::Div` \sa `CGAL::mod()` \sa `CGAL::div_mod()` */ -template< class NT1, class NT2> -result_type +template< class NT1, class NT2> +result_type div(const NT1& x, const NT2& y); } /* namespace CGAL */ @@ -76,32 +76,32 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$ -and \f$ r\f$ minimal with respect to the Euclidean Norm of the +computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$ +and \f$ r\f$ minimal with respect to the Euclidean Norm of the `result_type`. -The function `div_mod()` computes the integral quotient and remainder of -division with remainder. +The function `div_mod()` computes the integral quotient and remainder of +division with remainder. -In case the argument types `NT1` and `NT2` differ, -the `result_type` is determined via `Coercion_traits`. +In case the argument types `NT1` and `NT2` differ, +the `result_type` is determined via `Coercion_traits`. -Thus, the `result_type` is well defined if `NT1` and `NT2` -are a model of `ExplicitInteroperable`. +Thus, the `result_type` is well defined if `NT1` and `NT2` +are a model of `ExplicitInteroperable`. -The actual `div_mod` is performed with the semantic of that type. +The actual `div_mod` is performed with the semantic of that type. -The function is defined if `result_type` -is a model of the `EuclideanRing` concept. +The function is defined if `result_type` +is a model of the `EuclideanRing` concept. -\sa `EuclideanRing` +\sa `EuclideanRing` \sa `AlgebraicStructureTraits_::DivMod` \sa `CGAL::mod()` \sa `CGAL::div()` */ -template -void +template +void div_mod(const NT1& x, const NT2& y, result_type& q, result_type& r); } /* namespace CGAL */ @@ -111,24 +111,24 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `gcd()` computes the greatest common divisor of two values. +The function `gcd()` computes the greatest common divisor of two values. -In case the argument types `NT1` and `NT2` differ, -the `result_type` is determined via `Coercion_traits`. +In case the argument types `NT1` and `NT2` differ, +the `result_type` is determined via `Coercion_traits`. -Thus, the `result_type` is well defined if `NT1` and `NT2` -are a model of `ExplicitInteroperable`. +Thus, the `result_type` is well defined if `NT1` and `NT2` +are a model of `ExplicitInteroperable`. -The actual `gcd` is performed with the semantic of that type. +The actual `gcd` is performed with the semantic of that type. -The function is defined if `result_type` -is a model of the `UniqueFactorizationDomain` concept. +The function is defined if `result_type` +is a model of the `UniqueFactorizationDomain` concept. -\sa `UniqueFactorizationDomain` -\sa `AlgebraicStructureTraits_::Gcd` +\sa `UniqueFactorizationDomain` +\sa `AlgebraicStructureTraits_::Gcd` */ -template result_type +template result_type gcd(const NT1& x, const NT2& y); } /* namespace CGAL */ @@ -138,28 +138,28 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `integral_division()` (a.k.a.\ exact division or division without remainder) -maps ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$ -exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking -this operation is undefined. Since the ring represented is an integral domain, -\f$ z\f$ is uniquely defined if it exists. +The function `integral_division()` (a.k.a.\ exact division or division without remainder) +maps ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$ +exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking +this operation is undefined. Since the ring represented is an integral domain, +\f$ z\f$ is uniquely defined if it exists. -In case the argument types `NT1` and `NT2` differ, -the `result_type` is determined via `Coercion_traits`. +In case the argument types `NT1` and `NT2` differ, +the `result_type` is determined via `Coercion_traits`. -Thus, the `result_type` is well defined if `NT1` and `NT2` -are a model of `ExplicitInteroperable`. +Thus, the `result_type` is well defined if `NT1` and `NT2` +are a model of `ExplicitInteroperable`. -The actual `integral_division` is performed with the semantic of that type. +The actual `integral_division` is performed with the semantic of that type. -The function is defined if `result_type` -is a model of the `IntegralDomain` concept. +The function is defined if `result_type` +is a model of the `IntegralDomain` concept. -\sa `IntegralDomain` -\sa `AlgebraicStructureTraits_::IntegralDivision` +\sa `IntegralDomain` +\sa `AlgebraicStructureTraits_::IntegralDivision` */ -template result_type +template result_type integral_division(const NT1& x, const NT2& y); } /* namespace CGAL */ @@ -169,15 +169,15 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `inverse()` returns the inverse element with respect to multiplication. +The function `inverse()` returns the inverse element with respect to multiplication. -The function is defined if the argument type -is a model of the `Field` concept. +The function is defined if the argument type +is a model of the `Field` concept. \pre \f$ x \neq0\f$. -\sa `Field` -\sa `AlgebraicStructureTraits_::Inverse` +\sa `Field` +\sa `AlgebraicStructureTraits_::Inverse` */ template NT inverse(const NT& x); @@ -189,14 +189,14 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The template function `is_negative()` determines if a value is negative or not. -The function is defined if the argument type -is a model of the `RealEmbeddable` concept. +The template function `is_negative()` determines if a value is negative or not. +The function is defined if the argument type +is a model of the `RealEmbeddable` concept. -The `result_type` is convertible to `bool`. +The `result_type` is convertible to `bool`. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::IsNegative` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::IsNegative` */ result_type is_negative(const NT& x); @@ -208,15 +208,15 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `is_one()` determines if a value is equal to 1 or not. +The function `is_one()` determines if a value is equal to 1 or not. -The function is defined if the argument type -is a model of the `IntegralDomainWithoutDivision` concept. +The function is defined if the argument type +is a model of the `IntegralDomainWithoutDivision` concept. -The `result_type` is convertible to `bool`. +The `result_type` is convertible to `bool`. -\sa `IntegralDomainWithoutDivision` -\sa `AlgebraicStructureTraits_::IsOne` +\sa `IntegralDomainWithoutDivision` +\sa `AlgebraicStructureTraits_::IsOne` */ template result_type is_one(const NT& x); @@ -228,14 +228,14 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The template function `is_positive()` determines if a value is positive or not. -The function is defined if the argument type -is a model of the `RealEmbeddable` concept. +The template function `is_positive()` determines if a value is positive or not. +The function is defined if the argument type +is a model of the `RealEmbeddable` concept. -The `result_type` is convertible to `bool`. +The `result_type` is convertible to `bool`. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::IsPositive` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::IsPositive` */ result_type is_positive(const NT& x); @@ -247,18 +247,18 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -An ring element \f$ x\f$ is said to be a square iff there exists a ring element -\f$ y\f$ such -that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, -\f$ y\f$ is uniquely defined up to multiplication by units. +An ring element \f$ x\f$ is said to be a square iff there exists a ring element +\f$ y\f$ such +that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, +\f$ y\f$ is uniquely defined up to multiplication by units. -The function `is_square()` is available if -`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`. +The function `is_square()` is available if +`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`. -The `result_type` is convertible to `bool`. +The `result_type` is convertible to `bool`. -\sa `UniqueFactorizationDomain` -\sa `AlgebraicStructureTraits_::IsSquare` +\sa `UniqueFactorizationDomain` +\sa `AlgebraicStructureTraits_::IsSquare` */ template result_type is_square(const NT& x); @@ -266,18 +266,18 @@ template result_type is_square(const NT& x); /*! \ingroup PkgAlgebraicFoundationsRef -An ring element \f$ x\f$ is said to be a square iff there exists a ring element -\f$ y\f$ such -that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, -\f$ y\f$ is uniquely defined up to multiplication by units. +An ring element \f$ x\f$ is said to be a square iff there exists a ring element +\f$ y\f$ such +that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, +\f$ y\f$ is uniquely defined up to multiplication by units. -The function `is_square()` is available if -`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`. +The function `is_square()` is available if +`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`. The `result_type` is convertible to `bool`. -\sa `UniqueFactorizationDomain` -\sa `AlgebraicStructureTraits_::IsSquare` +\sa `UniqueFactorizationDomain` +\sa `AlgebraicStructureTraits_::IsSquare` */ template result_type is_square(const NT& x, NT& y); @@ -289,18 +289,18 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `is_zero()` determines if a value is equal to 0 or not. +The function `is_zero()` determines if a value is equal to 0 or not. -The function is defined if the argument type -is a model of the `RealEmbeddable` or of -the `IntegralDomainWithoutDivision` concept. +The function is defined if the argument type +is a model of the `RealEmbeddable` or of +the `IntegralDomainWithoutDivision` concept. -The `result_type` is convertible to `bool`. +The `result_type` is convertible to `bool`. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::IsZero` -\sa `IntegralDomainWithoutDivision` -\sa `AlgebraicStructureTraits_::IsZero` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::IsZero` +\sa `IntegralDomainWithoutDivision` +\sa `AlgebraicStructureTraits_::IsZero` */ template result_type is_zero(const NT& x); @@ -311,13 +311,13 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `kth_root()` returns the k-th root of a value. +The function `kth_root()` returns the k-th root of a value. -The function is defined if the second argument type -is a model of the `FieldWithKthRoot` concept. +The function is defined if the second argument type +is a model of the `FieldWithKthRoot` concept. -\sa `FieldWithKthRoot` -\sa `AlgebraicStructureTraits_::KthRoot` +\sa `FieldWithKthRoot` +\sa `AlgebraicStructureTraits_::KthRoot` */ template NT kth_root(int k, const NT& x); @@ -329,27 +329,27 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `mod()` computes the remainder of division with remainder. +The function `mod()` computes the remainder of division with remainder. -In case the argument types `NT1` and `NT2` differ, -the `result_type` is determined via `Coercion_traits`. +In case the argument types `NT1` and `NT2` differ, +the `result_type` is determined via `Coercion_traits`. -Thus, the `result_type` is well defined if `NT1` and `NT2` -are a model of `ExplicitInteroperable`. +Thus, the `result_type` is well defined if `NT1` and `NT2` +are a model of `ExplicitInteroperable`. -The actual `mod` is performed with the semantic of that type. +The actual `mod` is performed with the semantic of that type. -The function is defined if `result_type` -is a model of the `EuclideanRing` concept. +The function is defined if `result_type` +is a model of the `EuclideanRing` concept. -\sa `EuclideanRing` -\sa `AlgebraicStructureTraits_::DivMod` +\sa `EuclideanRing` +\sa `AlgebraicStructureTraits_::DivMod` \sa `CGAL::div_mod()` \sa `CGAL::div()` */ -template< class NT1, class NT2> -result_type +template< class NT1, class NT2> +result_type mod(const NT1& x, const NT2& y); } /* namespace CGAL */ @@ -363,19 +363,19 @@ returns the k-th real root of the univariate polynomial, which is defined by the iterator range, where begin refers to the constant term. -The function `root_of()` computes a real root of a square-free univariate -polynomial. +The function `root_of()` computes a real root of a square-free univariate +polynomial. -The function is defined if the value type, `NT`, -of the iterator range is a model of the `FieldWithRootOf` concept. +The function is defined if the value type, `NT`, +of the iterator range is a model of the `FieldWithRootOf` concept. \pre The polynomial is square-free. -\sa `FieldWithRootOf` -\sa `AlgebraicStructureTraits_::RootOf` +\sa `FieldWithRootOf` +\sa `AlgebraicStructureTraits_::RootOf` */ -template NT +template NT root_of(int k, InputIterator begin, InputIterator end); } /* namespace CGAL */ @@ -385,15 +385,15 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The template function `sign()` returns the sign of its argument. +The template function `sign()` returns the sign of its argument. -The function is defined if the argument type -is a model of the `RealEmbeddable` concept. +The function is defined if the argument type +is a model of the `RealEmbeddable` concept. -The `result_type` is convertible to `CGAL::Sign`. +The `result_type` is convertible to `CGAL::Sign`. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::Sgn` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::Sgn` */ template result_type sign(const NT& x); @@ -405,13 +405,13 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `simplify()` may simplify a given object. +The function `simplify()` may simplify a given object. -The function is defined if the argument type -is a model of the `IntegralDomainWithoutDivision` concept. +The function is defined if the argument type +is a model of the `IntegralDomainWithoutDivision` concept. -\sa `IntegralDomainWithoutDivision` -\sa `AlgebraicStructureTraits_::Simplify` +\sa `IntegralDomainWithoutDivision` +\sa `AlgebraicStructureTraits_::Simplify` */ template void simplify(const NT& x); @@ -423,13 +423,13 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `sqrt()` returns the square root of a value. +The function `sqrt()` returns the square root of a value. -The function is defined if the argument type -is a model of the `FieldWithSqrt` concept. +The function is defined if the argument type +is a model of the `FieldWithSqrt` concept. -\sa `FieldWithSqrt` -\sa `AlgebraicStructureTraits_::Sqrt` +\sa `FieldWithSqrt` +\sa `AlgebraicStructureTraits_::Sqrt` */ template NT sqrt(const NT& x); @@ -441,13 +441,13 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `square()` returns the square of a number. +The function `square()` returns the square of a number. -The function is defined if the argument type -is a model of the `IntegralDomainWithoutDivision` concept. +The function is defined if the argument type +is a model of the `IntegralDomainWithoutDivision` concept. -\sa `IntegralDomainWithoutDivision` -\sa `AlgebraicStructureTraits_::Square` +\sa `IntegralDomainWithoutDivision` +\sa `AlgebraicStructureTraits_::Square` */ template NT square(const NT& x); @@ -466,13 +466,13 @@ number type (such as an instance of `CGAL::Lazy_exact_nt`), the double approxima returned might be affected by an exact computation internally triggered (that might have improved the double approximation). -The function is defined if the argument type -is a model of the `RealEmbeddable` concept. +The function is defined if the argument type +is a model of the `RealEmbeddable` concept. -Remark: In order to control the quality of approximation one has to resort to methods that are specific to NT. There are no general guarantees whatsoever. +Remark: In order to control the quality of approximation one has to resort to methods that are specific to NT. There are no general guarantees whatsoever. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::ToDouble` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::ToDouble` */ template double to_double(const NT& x); @@ -484,17 +484,17 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The template function `to_interval()` computes for a given real embeddable -number \f$ x\f$ a double interval containing \f$ x\f$. -This interval is represented by a `std::pair`. -The function is defined if the argument type -is a model of the `RealEmbeddable` concept. +The template function `to_interval()` computes for a given real embeddable +number \f$ x\f$ a double interval containing \f$ x\f$. +This interval is represented by a `std::pair`. +The function is defined if the argument type +is a model of the `RealEmbeddable` concept. -\sa `RealEmbeddable` -\sa `RealEmbeddableTraits_::ToInterval` +\sa `RealEmbeddable` +\sa `RealEmbeddableTraits_::ToInterval` */ -template +template std::pair to_interval(const NT& x); } /* namespace CGAL */ @@ -504,14 +504,14 @@ namespace CGAL { /*! \ingroup PkgAlgebraicFoundationsRef -The function `unit_part()` computes the unit part of a given ring -element. +The function `unit_part()` computes the unit part of a given ring +element. -The function is defined if the argument type -is a model of the `IntegralDomainWithoutDivision` concept. +The function is defined if the argument type +is a model of the `IntegralDomainWithoutDivision` concept. -\sa `IntegralDomainWithoutDivision` -\sa `AlgebraicStructureTraits_::UnitPart` +\sa `IntegralDomainWithoutDivision` +\sa `AlgebraicStructureTraits_::UnitPart` */ template NT unit_part(const NT& x); diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Div.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Div.h index 9c14942316fd..f26365293438 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Div.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Div.h @@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` computes the integral quotient of division -with remainder. +`AdaptableBinaryFunction` computes the integral quotient of division +with remainder. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits_::Mod` @@ -19,40 +19,40 @@ with remainder. class Div { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -*/ -result_type operator()(first_argument_type x, -second_argument_type y); +*/ +result_type operator()(first_argument_type x, +second_argument_type y); /*! -This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` -with coercion type `AlgebraicStructureTraits::Type`. -*/ -template result_type operator()(NT1 x, NT2 y); +This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` +with coercion type `AlgebraicStructureTraits::Type`. +*/ +template result_type operator()(NT1 x, NT2 y); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--DivMod.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--DivMod.h index f974221b8eaa..2e2e4d2cd0f1 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--DivMod.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--DivMod.h @@ -5,191 +5,191 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableFunctor` computes both integral quotient and remainder -of division with remainder. The quotient \f$ q\f$ and remainder \f$ r\f$ are computed -such that \f$ x = q*y + r\f$ and \f$ |r| < |y|\f$ with respect to the proper integer norm of -the represented ring. -\cgalFootnote{For integers this norm is the absolute value. -For univariate polynomials this norm is the degree.} -In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible. -Moreover, we require \f$ q\f$ to be minimized with respect to the proper integer norm. +`AdaptableFunctor` computes both integral quotient and remainder +of division with remainder. The quotient \f$ q\f$ and remainder \f$ r\f$ are computed +such that \f$ x = q*y + r\f$ and \f$ |r| < |y|\f$ with respect to the proper integer norm of +the represented ring. +\cgalFootnote{For integers this norm is the absolute value. +For univariate polynomials this norm is the degree.} +In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible. +Moreover, we require \f$ q\f$ to be minimized with respect to the proper integer norm. -Note that the last condition is needed to ensure a unique computation of the -pair \f$ (q,r)\f$. However, an other option is to require minimality for \f$ |r|\f$, -with the advantage that -a mod(x,y) operation would return the unique representative of the -residue class of \f$ x\f$ with respect to \f$ y\f$, e.g. \f$ mod(2,3)\f$ should return \f$ -1\f$. -But this conflicts with nearly all current implementation -of integer types. From there, we decided to stay conform with common -implementations and require \f$ q\f$ to be computed as \f$ x/y\f$ rounded towards zero. +Note that the last condition is needed to ensure a unique computation of the +pair \f$ (q,r)\f$. However, an other option is to require minimality for \f$ |r|\f$, +with the advantage that +a mod(x,y) operation would return the unique representative of the +residue class of \f$ x\f$ with respect to \f$ y\f$, e.g. \f$ mod(2,3)\f$ should return \f$ -1\f$. +But this conflicts with nearly all current implementation +of integer types. From there, we decided to stay conform with common +implementations and require \f$ q\f$ to be computed as \f$ x/y\f$ rounded towards zero. -The following table illustrates the behavior for integers: +The following table illustrates the behavior for integers: - - -
- - - - - - - - - -

-
-x - -y - -q - -r -

-
-3 - -3 - -1 - -0 -
-2 - -3 - -0 - -2 -
-1 - -3 - -0 - -1 -
-0 - -3 - -0 - -0 -
--1 - -3 - -0 - --1 -
--2 - -3 - -0 - --2 -
--3 - -3 - --1 - -0 -

-
+ + +
+ + + + + + + + + +

+
+x + +y + +q + +r +

+
+3 + +3 + +1 + +0 +
+2 + +3 + +0 + +2 +
+1 + +3 + +0 + +1 +
+0 + +3 + +0 + +0 +
+-1 + +3 + +0 + +-1 +
+-2 + +3 + +0 + +-2 +
+-3 + +3 + +-1 + +0 +

+
-
-- - - - - - - - - - - -

-
-x - -y - -q - -r -

-
-3 - --3 - --1 - -0 -
-2 - --3 - -0 - -2 -
-1 - --3 - -0 - -1 -
-0 - --3 - -0 - -0 -
--1 - --3 - -0 - --1 -
--2 - --3 - -0 - --2 -
--3 - --3 - -1 - -0 -

-
+
+- + + + + + + + + + + +

+
+x + +y + +q + +r +

+
+3 + +-3 + +-1 + +0 +
+2 + +-3 + +0 + +2 +
+1 + +-3 + +0 + +1 +
+0 + +-3 + +0 + +0 +
+-1 + +-3 + +0 + +-1 +
+-2 + +-3 + +0 + +-2 +
+-3 + +-3 + +1 + +0 +

+
-
+
-\cgalRefines `AdaptableFunctor` +\cgalRefines `AdaptableFunctor` \sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits_::Mod` @@ -200,56 +200,56 @@ r class DivMod { public: -/// \name Types +/// \name Types /// @{ /*! -Is void. -*/ -typedef unspecified_type result_type; +Is void. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument_type; /*! -Is `AlgebraicStructureTraits::Type&`. -*/ -typedef unspecified_type third_argument_type; +Is `AlgebraicStructureTraits::Type&`. +*/ +typedef unspecified_type third_argument_type; /*! -Is `AlgebraicStructureTraits::Type&`. -*/ -typedef unspecified_type fourth_argument_type; +Is `AlgebraicStructureTraits::Type&`. +*/ +typedef unspecified_type fourth_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$ -and \f$ r\f$ minimal with respect to the Euclidean Norm on -`Type`. -*/ -result_type operator()( first_argument_type x, -second_argument_type y, -third_argument_type q, -fourth_argument_type r); +computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$ +and \f$ r\f$ minimal with respect to the Euclidean Norm on +`Type`. +*/ +result_type operator()( first_argument_type x, +second_argument_type y, +third_argument_type q, +fourth_argument_type r); /*! -This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` -with coercion type `AlgebraicStructureTraits::Type`. -*/ -template result_type -operator()(NT1 x, NT2 y, third_argument_type q, fourth_argument_type r); +This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` +with coercion type `AlgebraicStructureTraits::Type`. +*/ +template result_type +operator()(NT1 x, NT2 y, third_argument_type q, fourth_argument_type r); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Divides.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Divides.h index ef8896bbda03..b6296f69ff85 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Divides.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Divides.h @@ -5,18 +5,18 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction`, -returns true if the first argument divides the second argument. +`AdaptableBinaryFunction`, +returns true if the first argument divides the second argument. -Integral division (a.k.a. exact division or division without remainder) maps -ring elements \f$ (n,d)\f$ to ring element \f$ c\f$ such that \f$ n = dc\f$ if such a \f$ c\f$ -exists. In this case it is said that \f$ d\f$ divides \f$ n\f$. +Integral division (a.k.a. exact division or division without remainder) maps +ring elements \f$ (n,d)\f$ to ring element \f$ c\f$ such that \f$ n = dc\f$ if such a \f$ c\f$ +exists. In this case it is said that \f$ d\f$ divides \f$ n\f$. -This functor is required to provide two operators. The first operator takes two -arguments and returns true if the first argument divides the second argument. -The second operator returns \f$ c\f$ via the additional third argument. +This functor is required to provide two operators. The first operator takes two +arguments and returns true if the first argument divides the second argument. +The second operator returns \f$ c\f$ via the additional third argument. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits_::IntegralDivision` @@ -26,46 +26,46 @@ The second operator returns \f$ c\f$ via the additional third argument. class Divides { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Boolean`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Boolean`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes whether \f$ d\f$ divides \f$ n\f$. -*/ -result_type operator()(first_argument_type d, -second_argument_type n); +Computes whether \f$ d\f$ divides \f$ n\f$. +*/ +result_type operator()(first_argument_type d, +second_argument_type n); /*! -Computes whether \f$ d\f$ divides \f$ n\f$. -Moreover it computes \f$ c\f$ if \f$ d\f$ divides \f$ n\f$, -otherwise the value of \f$ c\f$ is undefined. +Computes whether \f$ d\f$ divides \f$ n\f$. +Moreover it computes \f$ c\f$ if \f$ d\f$ divides \f$ n\f$, +otherwise the value of \f$ c\f$ is undefined. -*/ -result_type operator()( -first_argument_type d, -second_argument_type n, -AlgebraicStructureTraits::Type& c); +*/ +result_type operator()( +first_argument_type d, +second_argument_type n, +AlgebraicStructureTraits::Type& c); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Gcd.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Gcd.h index ae00a2fdffc7..1dfc1c08856b 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Gcd.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Gcd.h @@ -5,19 +5,19 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` providing the gcd. +`AdaptableBinaryFunction` providing the gcd. -The greatest common divisor (\f$ gcd\f$) of ring elements \f$ x\f$ and \f$ y\f$ is the unique -ring element \f$ d\f$ (up to a unit) with the property that any common divisor of -\f$ x\f$ and \f$ y\f$ also divides \f$ d\f$. (In other words: \f$ d\f$ is the greatest lower bound -of \f$ x\f$ and \f$ y\f$ in the partial order of divisibility.) We demand the \f$ gcd\f$ to be -unit-normal (i.e.\ have unit part 1). +The greatest common divisor (\f$ gcd\f$) of ring elements \f$ x\f$ and \f$ y\f$ is the unique +ring element \f$ d\f$ (up to a unit) with the property that any common divisor of +\f$ x\f$ and \f$ y\f$ also divides \f$ d\f$. (In other words: \f$ d\f$ is the greatest lower bound +of \f$ x\f$ and \f$ y\f$ in the partial order of divisibility.) We demand the \f$ gcd\f$ to be +unit-normal (i.e.\ have unit part 1). -\f$ gcd(0,0)\f$ is defined as \f$ 0\f$, since \f$ 0\f$ is the greatest element with respect -to the partial order of divisibility. This is because an element \f$ a \in R\f$ is said to divide \f$ b \in R\f$, iff \f$ \exists r \in R\f$ such that \f$ a \cdot r = b\f$. -Thus, \f$ 0\f$ is divided by every element of the Ring, in particular by itself. +\f$ gcd(0,0)\f$ is defined as \f$ 0\f$, since \f$ 0\f$ is the greatest element with respect +to the partial order of divisibility. This is because an element \f$ a \in R\f$ is said to divide \f$ b \in R\f$, iff \f$ \exists r \in R\f$ such that \f$ a \cdot r = b\f$. +Thus, \f$ 0\f$ is divided by every element of the Ring, in particular by itself. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicStructureTraits` @@ -26,40 +26,40 @@ Thus, \f$ 0\f$ is divided by every element of the Ring, in particular by itself. class Gcd { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns \f$ gcd(x,y)\f$. -*/ -result_type operator()(first_argument_type x, -second_argument_type y); +returns \f$ gcd(x,y)\f$. +*/ +result_type operator()(first_argument_type x, +second_argument_type y); /*! -This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` -with coercion type `AlgebraicStructureTraits::Type`. -*/ -template result_type operator()(NT1 x, NT2 y); +This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` +with coercion type `AlgebraicStructureTraits::Type`. +*/ +template result_type operator()(NT1 x, NT2 y); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IntegralDivision.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IntegralDivision.h index 17f054df6dcf..8627e7249440 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IntegralDivision.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IntegralDivision.h @@ -5,15 +5,15 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` providing an integral division. +`AdaptableBinaryFunction` providing an integral division. -Integral division (a.k.a. exact division or division without remainder) maps -ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$ -exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking -this operation is undefined. Since the ring represented is an integral domain, -\f$ z\f$ is uniquely defined if it exists. +Integral division (a.k.a. exact division or division without remainder) maps +ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$ +exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking +this operation is undefined. Since the ring represented is an integral domain, +\f$ z\f$ is uniquely defined if it exists. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits_::Divides` @@ -23,40 +23,40 @@ this operation is undefined. Since the ring represented is an integral domain, class IntegralDivision { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns \f$ x/y\f$, this is an integral division. -*/ -result_type operator()(first_argument_type x, -second_argument_type y); +returns \f$ x/y\f$, this is an integral division. +*/ +result_type operator()(first_argument_type x, +second_argument_type y); /*! -This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` -with coercion type `AlgebraicStructureTraits::Type`. -*/ -template result_type operator()(NT1 x, NT2 y); +This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` +with coercion type `AlgebraicStructureTraits::Type`. +*/ +template result_type operator()(NT1 x, NT2 y); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Inverse.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Inverse.h index e24b955b2ac9..4c7602959a22 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Inverse.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Inverse.h @@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction` providing the inverse element with -respect to multiplication of a `Field`. +`AdaptableUnaryFunction` providing the inverse element with +respect to multiplication of a `Field`. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` @@ -17,30 +17,30 @@ respect to multiplication of a `Field`. class Inverse { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the inverse element of \f$ x\f$ with respect to multiplication. -\pre \f$ x \neq0\f$. +returns the inverse element of \f$ x\f$ with respect to multiplication. +\pre \f$ x \neq0\f$. -*/ -result_type operator()(argument_type x) const; +*/ +result_type operator()(argument_type x) const; /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsOne.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsOne.h index 9ac402f0e70b..47c2486c1129 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsOne.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsOne.h @@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction`, -returns true in case the argument is the one of the ring. +`AdaptableUnaryFunction`, +returns true in case the argument is the one of the ring. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` @@ -17,29 +17,29 @@ returns true in case the argument is the one of the ring. class IsOne { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Boolean`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Boolean`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns true in case \f$ x\f$ is the one of the ring. -*/ -result_type operator()(argument_type x); +returns true in case \f$ x\f$ is the one of the ring. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsSquare.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsSquare.h index 90e7e1a1776e..f50af0ba0481 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsSquare.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsSquare.h @@ -5,15 +5,15 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` that computes whether the first argument is a square. -If the first argument is a square the second argument, which is taken by reference, contains the square root. -Otherwise, the content of the second argument is undefined. +`AdaptableBinaryFunction` that computes whether the first argument is a square. +If the first argument is a square the second argument, which is taken by reference, contains the square root. +Otherwise, the content of the second argument is undefined. -A ring element \f$ x\f$ is said to be a square iff there exists a ring element \f$ y\f$ such -that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, -\f$ y\f$ is uniquely defined up to multiplication by units. +A ring element \f$ x\f$ is said to be a square iff there exists a ring element \f$ y\f$ such +that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, +\f$ y\f$ is uniquely defined up to multiplication by units. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicStructureTraits` @@ -22,42 +22,42 @@ that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`, class IsSquare { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Boolean`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Boolean`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type&`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type&`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns true in case \f$ x\f$ is a square, i.e.\ \f$ x = y*y\f$. -\post \f$ unit\_part(y) == 1\f$. +returns true in case \f$ x\f$ is a square, i.e.\ \f$ x = y*y\f$. +\post \f$ unit\_part(y) == 1\f$. -*/ -result_type operator()(first_argument_type x, -second_argument_type y); +*/ +result_type operator()(first_argument_type x, +second_argument_type y); /*! -returns true in case \f$ x\f$ is a square. +returns true in case \f$ x\f$ is a square. -*/ -result_type operator()(first_argument_type x); +*/ +result_type operator()(first_argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsZero.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsZero.h index 00d41328ec52..8fd2c91c3432 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsZero.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--IsZero.h @@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction`, returns true in case the argument is the zero element of the ring. +`AdaptableUnaryFunction`, returns true in case the argument is the zero element of the ring. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` \sa `RealEmbeddableTraits_::IsZero` @@ -17,29 +17,29 @@ namespace AlgebraicStructureTraits_{ class IsZero { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Boolean`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Boolean`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns true in case \f$ x\f$ is the zero element of the ring. -*/ -result_type operator()(argument_type x) const; +returns true in case \f$ x\f$ is the zero element of the ring. +*/ +result_type operator()(argument_type x) const; /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--KthRoot.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--KthRoot.h index 1869799f46c8..c9e6bed7986c 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--KthRoot.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--KthRoot.h @@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` providing the k-th root. +`AdaptableBinaryFunction` providing the k-th root. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `FieldWithRootOf` \sa `AlgebraicStructureTraits` @@ -17,35 +17,35 @@ namespace AlgebraicStructureTraits_{ class KthRoot { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is int. -*/ -typedef unspecified_type first_argument; +Is int. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the \f$ k\f$-th root of \f$ x\f$. -\pre \f$ k \geq1\f$ +returns the \f$ k\f$-th root of \f$ x\f$. +\pre \f$ k \geq1\f$ -*/ -result_type operator()(int k, second_argument_type x); +*/ +result_type operator()(int k, second_argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Mod.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Mod.h index cf06f2aa6199..5f45b13441ca 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Mod.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Mod.h @@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` computes the remainder of division with remainder. +`AdaptableBinaryFunction` computes the remainder of division with remainder. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits_::Div` @@ -18,40 +18,40 @@ namespace AlgebraicStructureTraits_ { class Mod { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type first_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type first_argument; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type second_argument; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type second_argument; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -*/ -result_type operator()(first_argument_type x, -second_argument_type y); +*/ +result_type operator()(first_argument_type x, +second_argument_type y); /*! -This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` -with coercion type `AlgebraicStructureTraits::Type`. -*/ -template result_type operator()(NT1 x, NT2 y); +This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable` +with coercion type `AlgebraicStructureTraits::Type`. +*/ +template result_type operator()(NT1 x, NT2 y); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--RootOf.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--RootOf.h index 6473628a8874..1d925e33ae9c 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--RootOf.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--RootOf.h @@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableFunctor` computes a real root of a square-free univariate -polynomial. +`AdaptableFunctor` computes a real root of a square-free univariate +polynomial. -\cgalRefines `AdaptableFunctor` +\cgalRefines `AdaptableFunctor` \sa `FieldWithRootOf` \sa `AlgebraicStructureTraits` @@ -18,28 +18,28 @@ polynomial. class RootOf { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the k-th real root of the univariate polynomial, -which is defined by the iterator range, -where begin refers to the constant term. -\pre The polynomial is square-free. -\pre The value type of the InputIterator is `AlgebraicStructureTraits::Type`. -*/ -template -result_type operator() (int k, InputIterator begin, InputIterator end); +returns the k-th real root of the univariate polynomial, +which is defined by the iterator range, +where begin refers to the constant term. +\pre The polynomial is square-free. +\pre The value type of the InputIterator is `AlgebraicStructureTraits::Type`. +*/ +template +result_type operator() (int k, InputIterator begin, InputIterator end); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Simplify.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Simplify.h index 0d74c3c45ceb..4d5e5858a269 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Simplify.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Simplify.h @@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -This `AdaptableUnaryFunction` may simplify a given object. +This `AdaptableUnaryFunction` may simplify a given object. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` @@ -16,28 +16,28 @@ This `AdaptableUnaryFunction` may simplify a given object. class Simplify { public: -/// \name Types +/// \name Types /// @{ /*! -Is void. -*/ -typedef unspecified_type result_type; +Is void. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -may simplify \f$ x\f$. -*/ -result_type operator()(argument_type x); +may simplify \f$ x\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Sqrt.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Sqrt.h index d8dbb3502ff0..5186f117a585 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Sqrt.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Sqrt.h @@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction` providing the square root. +`AdaptableUnaryFunction` providing the square root. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` @@ -16,28 +16,28 @@ namespace AlgebraicStructureTraits_{ class Sqrt { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns \f$ \sqrt{x}\f$. -*/ -result_type operator()(argument_type x) const; +returns \f$ \sqrt{x}\f$. +*/ +result_type operator()(argument_type x) const; /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Square.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Square.h index fcfb1fd83322..a21df7852182 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Square.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--Square.h @@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction`, computing the square of the argument. +`AdaptableUnaryFunction`, computing the square of the argument. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` @@ -16,28 +16,28 @@ namespace AlgebraicStructureTraits_{ class Square { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the square of \f$ x\f$. -*/ -result_type operator()(argument_type x); +returns the square of \f$ x\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--UnitPart.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--UnitPart.h index 8851cccce7a0..2f5cc4d4b2d7 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--UnitPart.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits--UnitPart.h @@ -5,23 +5,23 @@ namespace AlgebraicStructureTraits_{ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -This `AdaptableUnaryFunction` computes the unit part of a given ring -element. +This `AdaptableUnaryFunction` computes the unit part of a given ring +element. -The mathematical definition of unit part is as follows: Two ring elements \f$ a\f$ -and \f$ b\f$ are said to be associate if there exists an invertible ring element -(i.e.\ a unit) \f$ u\f$ such that \f$ a = ub\f$. This defines an equivalence relation. -We can distinguish exactly one element of every equivalence class as being -unit normal. Then each element of a ring possesses a factorization into a unit -(called its unit part) and a unit-normal ring element -(called its unit normal associate). +The mathematical definition of unit part is as follows: Two ring elements \f$ a\f$ +and \f$ b\f$ are said to be associate if there exists an invertible ring element +(i.e.\ a unit) \f$ u\f$ such that \f$ a = ub\f$. This defines an equivalence relation. +We can distinguish exactly one element of every equivalence class as being +unit normal. Then each element of a ring possesses a factorization into a unit +(called its unit part) and a unit-normal ring element +(called its unit normal associate). -For the integers, the non-negative numbers are by convention unit normal, -hence the unit-part of a non-zero integer is its sign. For a `Field`, every -non-zero element is a unit and is its own unit part, its unit normal -associate being one. The unit part of zero is, by convention, one. +For the integers, the non-negative numbers are by convention unit normal, +hence the unit-part of a non-zero integer is its sign. For a `Field`, every +non-zero element is a unit and is its own unit part, its unit normal +associate being one. The unit part of zero is, by convention, one. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicStructureTraits` @@ -31,28 +31,28 @@ associate being one. The unit part of zero is, by convention, one. class UnitPart { public: -/// \name Types +/// \name Types /// @{ /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `AlgebraicStructureTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `AlgebraicStructureTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the unit part of \f$ x\f$. -*/ -result_type operator()(argument_type x); +returns the unit part of \f$ x\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits.h index 54f3ed47af79..43ff35fe8341 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/AlgebraicStructureTraits.h @@ -3,13 +3,13 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `AlgebraicStructureTraits` reflects the algebraic structure -of an associated type `Type`. +A model of `AlgebraicStructureTraits` reflects the algebraic structure +of an associated type `Type`. -Depending on the concepts that `Type` fulfills, -it contains various functors and descriptive tags. -Moreover it gives access to the several possible -algebraic operations within that structure. +Depending on the concepts that `Type` fulfills, +it contains various functors and descriptive tags. +Moreover it gives access to the several possible +algebraic operations within that structure. \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` @@ -35,267 +35,267 @@ algebraic operations within that structure. class AlgebraicStructureTraits { public: -/// \name Types +/// \name Types /// A model of `AlgebraicStructureTraits` is supposed to provide: /// @{ /*! -The associated type. -*/ -typedef unspecified_type Type; +The associated type. +*/ +typedef unspecified_type Type; /*! -Tag indicating the algebraic structure of the associated type. - - - - - - - - - - - - -

-
-Tag is: - -`Type` is model of: -

-
-`CGAL::Null_tag` - -no algebraic concept -
-`CGAL::Integral_domain_without_division_tag` - -`IntegralDomainWithoutDivision` -
-`CGAL::Integral_domain_tag` - -`IntegralDomain` -
-`CGAL::Unique_factorization_domain_tag` - -`UniqueFactorizationDomain` -
-`CGAL::Euclidean_ring_tag` - -`EuclideanRing` -
-`CGAL::Field_tag` - -`Field` -
-`CGAL::Field_with_sqrt_tag` - -`FieldWithSqrt` -
-`CGAL::Field_with_kth_root_tag` - -`FieldWithKthRoot` -
-`CGAL::Field_with_root_of_tag` - -`FieldWithRootOf` -

-
- -*/ -typedef unspecified_type Algebraic_category; +Tag indicating the algebraic structure of the associated type. + + + + + + + + + + + + +

+
+Tag is: + +`Type` is model of: +

+
+`CGAL::Null_tag` + +no algebraic concept +
+`CGAL::Integral_domain_without_division_tag` + +`IntegralDomainWithoutDivision` +
+`CGAL::Integral_domain_tag` + +`IntegralDomain` +
+`CGAL::Unique_factorization_domain_tag` + +`UniqueFactorizationDomain` +
+`CGAL::Euclidean_ring_tag` + +`EuclideanRing` +
+`CGAL::Field_tag` + +`Field` +
+`CGAL::Field_with_sqrt_tag` + +`FieldWithSqrt` +
+`CGAL::Field_with_kth_root_tag` + +`FieldWithKthRoot` +
+`CGAL::Field_with_root_of_tag` + +`FieldWithRootOf` +

+
+ +*/ +typedef unspecified_type Algebraic_category; /*! -Tag indicating whether `Type` is exact. +Tag indicating whether `Type` is exact. -This is either `CGAL::Tag_true` or `CGAL::Tag_false`. +This is either `CGAL::Tag_true` or `CGAL::Tag_false`. -An algebraic structure is considered exact, if all operations -required by its concept are computed such that a comparison -of two algebraic expressions is always correct. -The exactness covers only those operations that are required by -the algebraic structure concept. +An algebraic structure is considered exact, if all operations +required by its concept are computed such that a comparison +of two algebraic expressions is always correct. +The exactness covers only those operations that are required by +the algebraic structure concept. -e.g. an exact `Field` may have a `Sqrt` functor that -is not exact. +e.g. an exact `Field` may have a `Sqrt` functor that +is not exact. -*/ -typedef unspecified_type Is_exact; +*/ +typedef unspecified_type Is_exact; /*! -Tag indicating whether `Type` is numerical sensitive. +Tag indicating whether `Type` is numerical sensitive. -This is either `CGAL::Tag_true` or `CGAL::Tag_false`. +This is either `CGAL::Tag_true` or `CGAL::Tag_false`. -An algebraic structure is considered as numerically sensitive, -if the performance of the type is sensitive to the condition -number of an algorithm. +An algebraic structure is considered as numerically sensitive, +if the performance of the type is sensitive to the condition +number of an algorithm. -*/ -typedef unspecified_type Is_numerical_sensitive; +*/ +typedef unspecified_type Is_numerical_sensitive; /*! -This type specifies the return type of the predicates provided -by this traits. The type must be convertible to `bool` and -typically the type indeed maps to `bool`. However, there are also -cases such as interval arithmetic, in which it is `Uncertain` -or some similar type. +This type specifies the return type of the predicates provided +by this traits. The type must be convertible to `bool` and +typically the type indeed maps to `bool`. However, there are also +cases such as interval arithmetic, in which it is `Uncertain` +or some similar type. -*/ -typedef unspecified_type Boolean; +*/ +typedef unspecified_type Boolean; -/// @} +/// @} -/// \name Functors +/// \name Functors /// In case a functor is not provided, it is set to `CGAL::Null_functor`. /// @{ /*! -A model of `AlgebraicStructureTraits_::IsZero`. +A model of `AlgebraicStructureTraits_::IsZero`. -Required by the concept `IntegralDomainWithoutDivision`. -In case `Type` is also model of `RealEmbeddable` this is a -model of `RealEmbeddableTraits_::IsZero`. +Required by the concept `IntegralDomainWithoutDivision`. +In case `Type` is also model of `RealEmbeddable` this is a +model of `RealEmbeddableTraits_::IsZero`. -*/ -typedef unspecified_type Is_zero; +*/ +typedef unspecified_type Is_zero; /*! -A model of `AlgebraicStructureTraits_::IsOne`. +A model of `AlgebraicStructureTraits_::IsOne`. -Required by the concept `IntegralDomainWithoutDivision`. +Required by the concept `IntegralDomainWithoutDivision`. -*/ -typedef unspecified_type Is_one; +*/ +typedef unspecified_type Is_one; /*! -A model of `AlgebraicStructureTraits_::Square`. +A model of `AlgebraicStructureTraits_::Square`. -Required by the concept `IntegralDomainWithoutDivision`. +Required by the concept `IntegralDomainWithoutDivision`. -*/ -typedef unspecified_type Square; +*/ +typedef unspecified_type Square; /*! -A model of `AlgebraicStructureTraits_::Simplify`. +A model of `AlgebraicStructureTraits_::Simplify`. -Required by the concept `IntegralDomainWithoutDivision`. +Required by the concept `IntegralDomainWithoutDivision`. -*/ -typedef unspecified_type Simplify; +*/ +typedef unspecified_type Simplify; /*! -A model of `AlgebraicStructureTraits_::UnitPart`. +A model of `AlgebraicStructureTraits_::UnitPart`. -Required by the concept `IntegralDomainWithoutDivision`. +Required by the concept `IntegralDomainWithoutDivision`. -*/ -typedef unspecified_type Unit_part; +*/ +typedef unspecified_type Unit_part; /*! -A model of `AlgebraicStructureTraits_::IntegralDivision`. +A model of `AlgebraicStructureTraits_::IntegralDivision`. -Required by the concept `IntegralDomain`. +Required by the concept `IntegralDomain`. -*/ -typedef unspecified_type Integral_division; +*/ +typedef unspecified_type Integral_division; /*! -A model of `AlgebraicStructureTraits_::Divides`. +A model of `AlgebraicStructureTraits_::Divides`. -Required by the concept `IntegralDomain`. +Required by the concept `IntegralDomain`. -*/ -typedef unspecified_type Divides; +*/ +typedef unspecified_type Divides; /*! -A model of `AlgebraicStructureTraits_::IsSquare`. +A model of `AlgebraicStructureTraits_::IsSquare`. -Required by the concept `IntegralDomainWithoutDivision`. +Required by the concept `IntegralDomainWithoutDivision`. -*/ -typedef unspecified_type Is_square; +*/ +typedef unspecified_type Is_square; /*! -A model of `AlgebraicStructureTraits_::Gcd`. +A model of `AlgebraicStructureTraits_::Gcd`. -Required by the concept `UniqueFactorizationDomain`. +Required by the concept `UniqueFactorizationDomain`. -*/ -typedef unspecified_type Gcd; +*/ +typedef unspecified_type Gcd; /*! -A model of `AlgebraicStructureTraits_::Mod`. +A model of `AlgebraicStructureTraits_::Mod`. -Required by the concept `EuclideanRing`. +Required by the concept `EuclideanRing`. -*/ -typedef unspecified_type Mod; +*/ +typedef unspecified_type Mod; /*! -A model of `AlgebraicStructureTraits_::Div`. +A model of `AlgebraicStructureTraits_::Div`. -Required by the concept `EuclideanRing`. +Required by the concept `EuclideanRing`. -*/ -typedef unspecified_type Div; +*/ +typedef unspecified_type Div; /*! -A model of `AlgebraicStructureTraits_::DivMod`. +A model of `AlgebraicStructureTraits_::DivMod`. -Required by the concept `EuclideanRing`. +Required by the concept `EuclideanRing`. -*/ -typedef unspecified_type Div_mod; +*/ +typedef unspecified_type Div_mod; /*! -A model of `AlgebraicStructureTraits_::Inverse`. +A model of `AlgebraicStructureTraits_::Inverse`. -Required by the concept `Field`. +Required by the concept `Field`. -*/ -typedef unspecified_type Inverse; +*/ +typedef unspecified_type Inverse; /*! -A model of `AlgebraicStructureTraits_::Sqrt`. +A model of `AlgebraicStructureTraits_::Sqrt`. -Required by the concept `FieldWithSqrt`. +Required by the concept `FieldWithSqrt`. -*/ -typedef unspecified_type Sqrt; +*/ +typedef unspecified_type Sqrt; /*! -A model of `AlgebraicStructureTraits_::KthRoot`. +A model of `AlgebraicStructureTraits_::KthRoot`. -Required by the concept `FieldWithKthRoot`. +Required by the concept `FieldWithKthRoot`. -*/ -typedef unspecified_type Kth_root; +*/ +typedef unspecified_type Kth_root; /*! -A model of `AlgebraicStructureTraits_::RootOf`. +A model of `AlgebraicStructureTraits_::RootOf`. -Required by the concept `FieldWithRootOf`. +Required by the concept `FieldWithRootOf`. -*/ -typedef unspecified_type Root_of; +*/ +typedef unspecified_type Root_of; /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h index 764d96fb35dd..d7d340b0bc3e 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h @@ -3,29 +3,29 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain). -It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders -such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to -\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$. -In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible. +A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain). +It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders +such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to +\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$. +In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible. -Moreover, `CGAL::Algebraic_structure_traits< EuclideanRing >` is a model of -`AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< EuclideanRing >` is a model of +`AlgebraicStructureTraits` providing: -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< EuclideanRing >::Algebraic_category` \endlink derived from `CGAL::Unique_factorization_domain_tag` +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< EuclideanRing >::Algebraic_category` \endlink derived from `CGAL::Unique_factorization_domain_tag` - \link AlgebraicStructureTraits::Mod `CGAL::Algebraic_structure_traits< EuclideanRing >::Mod` \endlink which is a model of `AlgebraicStructureTraits_::Mod` -- \link AlgebraicStructureTraits::Div `CGAL::Algebraic_structure_traits< EuclideanRing >::Div` \endlink which is a model of `AlgebraicStructureTraits_::Div` +- \link AlgebraicStructureTraits::Div `CGAL::Algebraic_structure_traits< EuclideanRing >::Div` \endlink which is a model of `AlgebraicStructureTraits_::Div` - \link AlgebraicStructureTraits::Div_mod `CGAL::Algebraic_structure_traits< EuclideanRing >::Div_mod` \endlink which is a model of `AlgebraicStructureTraits_::DivMod` -

+

\cgalHeading{Remarks} -The most prominent example of a Euclidean ring are the integers. -Whenever both \f$ x\f$ and \f$ y\f$ are positive, then it is conventional to choose -the smallest positive remainder \f$ r\f$. +The most prominent example of a Euclidean ring are the integers. +Whenever both \f$ x\f$ and \f$ y\f$ are positive, then it is conventional to choose +the smallest positive remainder \f$ r\f$. -\cgalRefines `UniqueFactorizationDomain` +\cgalRefines `UniqueFactorizationDomain` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ExplicitInteroperable.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ExplicitInteroperable.h index 40f4e1b9c2a9..c76784d0059a 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ExplicitInteroperable.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ExplicitInteroperable.h @@ -3,23 +3,23 @@ \ingroup PkgAlgebraicFoundationsInteroperabilityConcepts \cgalConcept -Two types `A` and `B` are a model of the `ExplicitInteroperable` -concept, if it is possible to derive a superior type for `A` and `B`, -such that both types are embeddable into this type. -This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits::Type`\endlink. +Two types `A` and `B` are a model of the `ExplicitInteroperable` +concept, if it is possible to derive a superior type for `A` and `B`, +such that both types are embeddable into this type. +This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits::Type`\endlink. -In this case +In this case \link CGAL::Coercion_traits::Are_explicit_interoperable `CGAL::Coercion_traits::Are_explicit_interoperable`\endlink -is `Tag_true`. +is `Tag_true`. -`A` and `B` are valid argument types for all binary functors in -`CGAL::Algebraic_structure_traits` and `CGAL::Real_embeddable_traits`. -This is also the case for the respective global functions. +`A` and `B` are valid argument types for all binary functors in +`CGAL::Algebraic_structure_traits` and `CGAL::Real_embeddable_traits`. +This is also the case for the respective global functions. -\sa `CGAL::Coercion_traits` -\sa `ImplicitInteroperable` -\sa `AlgebraicStructureTraits` -\sa `RealEmbeddableTraits` +\sa `CGAL::Coercion_traits` +\sa `ImplicitInteroperable` +\sa `AlgebraicStructureTraits` +\sa `RealEmbeddableTraits` */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Field.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Field.h index 852b4a77d14b..0393f355733b 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Field.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Field.h @@ -3,20 +3,20 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `Field` is an `IntegralDomain` in which every non-zero element -has a multiplicative inverse. -Thus, one can divide by any non-zero element. -Hence division is defined for any divisor != 0. -For a Field, we require this division operation to be available through -operators / and /=. +A model of `Field` is an `IntegralDomain` in which every non-zero element +has a multiplicative inverse. +Thus, one can divide by any non-zero element. +Hence division is defined for any divisor != 0. +For a Field, we require this division operation to be available through +operators / and /=. -Moreover, `CGAL::Algebraic_structure_traits< Field >` is a model of -`AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< Field >` is a model of +`AlgebraicStructureTraits` providing: -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< Field >::Algebraic_category` \endlink derived from `CGAL::Field_tag` +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< Field >::Algebraic_category` \endlink derived from `CGAL::Field_tag` - \link AlgebraicStructureTraits::Inverse `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Inverse` \endlink which is a model of `AlgebraicStructureTraits_::Inverse` -\cgalRefines `IntegralDomain` +\cgalRefines `IntegralDomain` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` @@ -33,19 +33,19 @@ Moreover, `CGAL::Algebraic_structure_traits< Field >` is a model of class Field { public: -/// \name Operations +/// \name Operations /// @{ /*! -*/ -Field operator/(const Field &a, const Field &b); +*/ +Field operator/(const Field &a, const Field &b); /*! -*/ -Field operator/=(const Field &b); +*/ +Field operator/=(const Field &b); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldNumberType.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldNumberType.h index 9a58da5493e5..cb86878a6cbf 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldNumberType.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldNumberType.h @@ -2,27 +2,27 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -The concept `FieldNumberType` combines the requirements of the concepts -`Field` and `RealEmbeddable`. -A model of `FieldNumberType` can be used as a template parameter -for Cartesian kernels. - -\cgalRefines `Field` -\cgalRefines `RealEmbeddable` - -\cgalHasModel float -\cgalHasModel double -\cgalHasModel `CGAL::Gmpq` -\cgalHasModel `CGAL::Interval_nt` +The concept `FieldNumberType` combines the requirements of the concepts +`Field` and `RealEmbeddable`. +A model of `FieldNumberType` can be used as a template parameter +for Cartesian kernels. + +\cgalRefines `Field` +\cgalRefines `RealEmbeddable` + +\cgalHasModel float +\cgalHasModel double +\cgalHasModel `CGAL::Gmpq` +\cgalHasModel `CGAL::Interval_nt` \cgalHasModel \ref CGAL::Interval_nt_advanced -\cgalHasModel `CGAL::Lazy_exact_nt` -\cgalHasModel `CGAL::Quotient` -\cgalHasModel `leda_rational` -\cgalHasModel `leda_bigfloat` -\cgalHasModel `leda_real` - -\sa `RingNumberType` -\sa `Kernel` +\cgalHasModel `CGAL::Lazy_exact_nt` +\cgalHasModel `CGAL::Quotient` +\cgalHasModel `leda_rational` +\cgalHasModel `leda_bigfloat` +\cgalHasModel `leda_real` + +\sa `RingNumberType` +\sa `Kernel` */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithKthRoot.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithKthRoot.h index a46025ce6ea6..fdf80ccb5d53 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithKthRoot.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithKthRoot.h @@ -3,14 +3,14 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `FieldWithKthRoot` is a `FieldWithSqrt` that has operations to take k-th roots. +A model of `FieldWithKthRoot` is a `FieldWithSqrt` that has operations to take k-th roots. -Moreover, `CGAL::Algebraic_structure_traits< FieldWithKthRoot >` is a model of `AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< FieldWithKthRoot >` is a model of `AlgebraicStructureTraits` providing: - \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Algebraic_category` \endlink derived from `CGAL::Field_with_kth_root_tag` - \link AlgebraicStructureTraits::Kth_root `CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Kth_root` \endlink which is a model of `AlgebraicStructureTraits_::KthRoot` -\cgalRefines `FieldWithSqrt` +\cgalRefines `FieldWithSqrt` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithRootOf.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithRootOf.h index ded7cd06000c..beb3f93bfaf0 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithRootOf.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithRootOf.h @@ -3,15 +3,15 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `FieldWithRootOf` is a `FieldWithKthRoot` with the possibility to -construct it as the root of a univariate polynomial. +A model of `FieldWithRootOf` is a `FieldWithKthRoot` with the possibility to +construct it as the root of a univariate polynomial. -Moreover, `CGAL::Algebraic_structure_traits< FieldWithRootOf >` is a model of `AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< FieldWithRootOf >` is a model of `AlgebraicStructureTraits` providing: -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithRootOf >::Algebraic_category` \endlink derived from `CGAL::Field_with_kth_root_tag` +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithRootOf >::Algebraic_category` \endlink derived from `CGAL::Field_with_kth_root_tag` - \link AlgebraicStructureTraits::Root_of `CGAL::Algebraic_structure_traits< FieldWithRootOf >::Root_of` \endlink which is a model of `AlgebraicStructureTraits_::RootOf` -\cgalRefines `FieldWithKthRoot` +\cgalRefines `FieldWithKthRoot` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithSqrt.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithSqrt.h index 9dd745ff4740..a00fc6117af6 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithSqrt.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FieldWithSqrt.h @@ -3,14 +3,14 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `FieldWithSqrt` is a `Field` that has operations to take square roots. +A model of `FieldWithSqrt` is a `Field` that has operations to take square roots. -Moreover, `CGAL::Algebraic_structure_traits< FieldWithSqrt >` is a model of `AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< FieldWithSqrt >` is a model of `AlgebraicStructureTraits` providing: -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Algebraic_category` \endlink derived from `CGAL::Field_with_sqrt_tag` -- \link AlgebraicStructureTraits::Sqrt `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Sqrt` \endlink which is a model of `AlgebraicStructureTraits_::Sqrt` +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Algebraic_category` \endlink derived from `CGAL::Field_with_sqrt_tag` +- \link AlgebraicStructureTraits::Sqrt `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Sqrt` \endlink which is a model of `AlgebraicStructureTraits_::Sqrt` -\cgalRefines `Field` +\cgalRefines `Field` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Fraction.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Fraction.h index 10f3a5c69512..c250309555ca 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Fraction.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/Fraction.h @@ -3,13 +3,13 @@ \ingroup PkgAlgebraicFoundationsFractionsConcepts \cgalConcept -A type is considered as a `Fraction`, if there is a reasonable way to -decompose it into a numerator and denominator. In this case the relevant -functionality for decomposing and re-composing as well as the numerator and -denominator type are provided by `CGAL::Fraction_traits`. +A type is considered as a `Fraction`, if there is a reasonable way to +decompose it into a numerator and denominator. In this case the relevant +functionality for decomposing and re-composing as well as the numerator and +denominator type are provided by `CGAL::Fraction_traits`. \sa `FractionTraits` -\sa `CGAL::Fraction_traits` +\sa `CGAL::Fraction_traits` */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FractionTraits.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FractionTraits.h index c06985289873..a078885017cf 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FractionTraits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FractionTraits.h @@ -3,53 +3,53 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `FractionTraits` is associated with a type `Type`. +A model of `FractionTraits` is associated with a type `Type`. -In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well -as the numerator and denominator type. +In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well +as the numerator and denominator type. \cgalHasModel `CGAL::Fraction_traits` -\sa `FractionTraits_::Decompose` -\sa `FractionTraits_::Compose` -\sa `FractionTraits_::CommonFactor` +\sa `FractionTraits_::Decompose` +\sa `FractionTraits_::Compose` +\sa `FractionTraits_::CommonFactor` */ class FractionTraits { public: -/// \name Types +/// \name Types /// @{ /*! -The associated type -*/ -typedef unspecified_type Type; +The associated type +*/ +typedef unspecified_type Type; /*! -Tag indicating whether the associated type is a fraction and can be -decomposed into a numerator and denominator. +Tag indicating whether the associated type is a fraction and can be +decomposed into a numerator and denominator. -This is either `CGAL::Tag_true` or `CGAL::Tag_false`. -*/ -typedef unspecified_type Is_fraction; +This is either `CGAL::Tag_true` or `CGAL::Tag_false`. +*/ +typedef unspecified_type Is_fraction; /*! -The type to represent the numerator. -This is undefined in case the associated type is not a fraction. -*/ -typedef unspecified_type Numerator_type ; +The type to represent the numerator. +This is undefined in case the associated type is not a fraction. +*/ +typedef unspecified_type Numerator_type ; /*! -The (simpler) type to represent the denominator. -This is undefined in case the associated type is not a fraction. -*/ -typedef unspecified_type Denominator_type; +The (simpler) type to represent the denominator. +This is undefined in case the associated type is not a fraction. +*/ +typedef unspecified_type Denominator_type; -/// @} +/// @} -/// \name Functors +/// \name Functors /// In case `Type` is not a `Fraction` all functors are `Null_functor`. /// @{ @@ -81,27 +81,27 @@ namespace FractionTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -Functor decomposing a `Fraction` into its numerator and denominator. +Functor decomposing a `Fraction` into its numerator and denominator. -\sa `Fraction` -\sa `FractionTraits` -\sa `FractionTraits_::Compose` -\sa `FractionTraits_::CommonFactor` +\sa `Fraction` +\sa `FractionTraits` +\sa `FractionTraits_::Compose` +\sa `FractionTraits_::CommonFactor` */ class Decompose { public: -/// \name Operations +/// \name Operations /// @{ /*! -decompose \f$ f\f$ into numerator \f$ n\f$ and denominator \f$ d\f$. -*/ -void operator()( FractionTraits::Type f, -FractionTraits::Numerator_type & n, -FractionTraits::Denominator_type & d); +decompose \f$ f\f$ into numerator \f$ n\f$ and denominator \f$ d\f$. +*/ +void operator()( FractionTraits::Type f, +FractionTraits::Numerator_type & n, +FractionTraits::Denominator_type & d); /// @} @@ -111,47 +111,47 @@ FractionTraits::Denominator_type & d); \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction`, returns the fraction of its arguments. +`AdaptableBinaryFunction`, returns the fraction of its arguments. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` -\sa `Fraction` -\sa `FractionTraits` -\sa `FractionTraits_::Decompose` -\sa `FractionTraits_::CommonFactor` +\sa `Fraction` +\sa `FractionTraits` +\sa `FractionTraits_::Decompose` +\sa `FractionTraits_::CommonFactor` */ class Compose { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef FractionTraits::Type result_type; +*/ +typedef FractionTraits::Type result_type; /*! -*/ -typedef FractionTraits::Numerator_type first_argument_type; +*/ +typedef FractionTraits::Numerator_type first_argument_type; /*! -*/ -typedef FractionTraits::Denominator_type second_argument_type; +*/ +typedef FractionTraits::Denominator_type second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -return the fraction \f$ n/d\f$. -*/ -result_type operator()(first_argument_type n, second_argument_type d); +return the fraction \f$ n/d\f$. +*/ +result_type operator()(first_argument_type n, second_argument_type d); /// @} @@ -162,54 +162,54 @@ result_type operator()(first_argument_type n, second_argument_type d); \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction`, finds great common factor of denominators. +`AdaptableBinaryFunction`, finds great common factor of denominators. -This can be considered as a relaxed version of `AlgebraicStructureTraits_::Gcd`, -this is needed because it is not guaranteed that `FractionTraits::Denominator_type` is a model of -`UniqueFactorizationDomain`. +This can be considered as a relaxed version of `AlgebraicStructureTraits_::Gcd`, +this is needed because it is not guaranteed that `FractionTraits::Denominator_type` is a model of +`UniqueFactorizationDomain`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` -\sa `Fraction` -\sa `FractionTraits` -\sa `FractionTraits_::Decompose` -\sa `FractionTraits_::Compose` -\sa `AlgebraicStructureTraits_::Gcd` +\sa `Fraction` +\sa `FractionTraits` +\sa `FractionTraits_::Decompose` +\sa `FractionTraits_::Compose` +\sa `AlgebraicStructureTraits_::Gcd` */ class CommonFactor { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef FractionTraits::Denominator_type result_type; +*/ +typedef FractionTraits::Denominator_type result_type; /*! -*/ -typedef FractionTraits::Denominator_type first_argument_type; +*/ +typedef FractionTraits::Denominator_type first_argument_type; /*! -*/ -typedef FractionTraits::Denominator_type second_argument_type; +*/ +typedef FractionTraits::Denominator_type second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -return a great common factor of \f$ d1\f$ and \f$ d2\f$. +return a great common factor of \f$ d1\f$ and \f$ d2\f$. -Note: operator()(0,0) = 0 -*/ -result_type operator()(first_argument_type d1, second_argument_type d2); +Note: operator()(0,0) = 0 +*/ +result_type operator()(first_argument_type d1, second_argument_type d2); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromDoubleConstructible.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromDoubleConstructible.h index 18c34eea6534..879d9b45ed38 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromDoubleConstructible.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromDoubleConstructible.h @@ -3,26 +3,26 @@ \ingroup PkgAlgebraicFoundationsConcepts \cgalConcept -A model of the concept `FromDoubleConstructible` is required -to be constructible from the type `double`. +A model of the concept `FromDoubleConstructible` is required +to be constructible from the type `double`. -In case the type is a model of `RealEmbeddable` too, for any double d -the identity: `d == CGAL::to_double(T(d))`, is guaranteed. +In case the type is a model of `RealEmbeddable` too, for any double d +the identity: `d == CGAL::to_double(T(d))`, is guaranteed. */ class FromDoubleConstructible { public: -/// \name Creation +/// \name Creation /// @{ /*! -conversion constructor from double. +conversion constructor from double. -*/ -FromDoubleConstructible(const double& d); +*/ +FromDoubleConstructible(const double& d); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromIntConstructible.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromIntConstructible.h index 1a5bcfac2e11..58d2190329ad 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromIntConstructible.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/FromIntConstructible.h @@ -3,25 +3,25 @@ \ingroup PkgAlgebraicFoundationsConcepts \cgalConcept -A model of the concept `FromIntConstructible` is required -to be constructible from int. +A model of the concept `FromIntConstructible` is required +to be constructible from int. -\cgalHasModel int -\cgalHasModel long -\cgalHasModel double +\cgalHasModel int +\cgalHasModel long +\cgalHasModel double */ class FromIntConstructible { public: -/// \name Creation +/// \name Creation /// @{ /*! -*/ -FromIntConstructible(int& i); +*/ +FromIntConstructible(int& i); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ImplicitInteroperable.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ImplicitInteroperable.h index 4e4854347ec3..092de9ee6513 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ImplicitInteroperable.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/ImplicitInteroperable.h @@ -3,25 +3,25 @@ \ingroup PkgAlgebraicFoundationsInteroperabilityConcepts \cgalConcept -Two types `A` and `B` are a model of the concept -`ImplicitInteroperable`, if there is a superior type, such that -binary arithmetic operations involving `A` and `B` result in -this type. This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits::Type`\endlink. +Two types `A` and `B` are a model of the concept +`ImplicitInteroperable`, if there is a superior type, such that +binary arithmetic operations involving `A` and `B` result in +this type. This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits::Type`\endlink. In case types are `RealEmbeddable` this also implies that mixed compare operators are available. -The type \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits::Type`\endlink is required to be -implicit constructible from `A` and `B`. +The type \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits::Type`\endlink is required to be +implicit constructible from `A` and `B`. -In this case +In this case \link CGAL::Coercion_traits::Are_implicit_interoperable `CGAL::Coercion_traits::Are_implicit_interoperable`\endlink -is `CGAL::Tag_true`. +is `CGAL::Tag_true`. -\cgalRefines `ExplicitInteroperable` +\cgalRefines `ExplicitInteroperable` -\sa `CGAL::Coercion_traits` -\sa `ExplicitInteroperable` -\sa `AlgebraicStructureTraits` -\sa `RealEmbeddableTraits` +\sa `CGAL::Coercion_traits` +\sa `ExplicitInteroperable` +\sa `AlgebraicStructureTraits` +\sa `RealEmbeddableTraits` */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomain.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomain.h index fc6c643605df..a0fa98677889 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomain.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomain.h @@ -3,20 +3,20 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`IntegralDomain` refines `IntegralDomainWithoutDivision` by -providing an integral division. +`IntegralDomain` refines `IntegralDomainWithoutDivision` by +providing an integral division. -Note: The concept does not require the operator / for this operation. -We intend to reserve the operator syntax for use with a `Field`. +Note: The concept does not require the operator / for this operation. +We intend to reserve the operator syntax for use with a `Field`. -Moreover, `CGAL::Algebraic_structure_traits< IntegralDomain >` is a model of -`AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< IntegralDomain >` is a model of +`AlgebraicStructureTraits` providing: -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomain >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_tag` +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomain >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_tag` - \link AlgebraicStructureTraits::Integral_division `CGAL::Algebraic_structure_traits< IntegralDomain >::Integral_division` \endlink which is a model of `AlgebraicStructureTraits_::IntegralDivision` - \link AlgebraicStructureTraits::Divides `CGAL::Algebraic_structure_traits< IntegralDomain >::Divides` \endlink which is a model of `AlgebraicStructureTraits_::Divides` -\cgalRefines `IntegralDomainWithoutDivision` +\cgalRefines `IntegralDomainWithoutDivision` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomainWithoutDivision.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomainWithoutDivision.h index 6d694ad1690d..9f6467406ddb 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomainWithoutDivision.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/IntegralDomainWithoutDivision.h @@ -3,37 +3,37 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -This is the most basic concept for algebraic structures considered within \cgal. +This is the most basic concept for algebraic structures considered within \cgal. -A model `IntegralDomainWithoutDivision` represents an integral domain, -i.e.\ commutative ring with 0, 1, +, * and unity free of zero divisors. +A model `IntegralDomainWithoutDivision` represents an integral domain, +i.e.\ commutative ring with 0, 1, +, * and unity free of zero divisors. -Note: A model is not required to offer the always well defined integral division. +Note: A model is not required to offer the always well defined integral division. -It refines `Assignable`, `CopyConstructible`, `DefaultConstructible` -and `FromIntConstructible`. +It refines `Assignable`, `CopyConstructible`, `DefaultConstructible` +and `FromIntConstructible`. -It refines `EqualityComparable`, where equality is defined w.r.t.\ the ring element being represented. +It refines `EqualityComparable`, where equality is defined w.r.t.\ the ring element being represented. -The operators unary and binary plus +, unary and binary minus -, -multiplication * and their compound forms +=, -=, *= are required and -implement the respective ring operations. +The operators unary and binary plus +, unary and binary minus -, +multiplication * and their compound forms +=, -=, *= are required and +implement the respective ring operations. -Moreover, `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >` is a model of -`AlgebraicStructureTraits` providing: +Moreover, `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >` is a model of +`AlgebraicStructureTraits` providing: -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_without_division_tag` +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_without_division_tag` - \link AlgebraicStructureTraits::Is_zero `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_zero` \endlink which is a model of `AlgebraicStructureTraits_::IsZero` - \link AlgebraicStructureTraits::Is_one `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_one` \endlink which is a model of `AlgebraicStructureTraits_::IsOne` - \link AlgebraicStructureTraits::Square `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Square` \endlink which is a model of `AlgebraicStructureTraits_::Square` - \link AlgebraicStructureTraits::Simplify `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Simplify` \endlink which is a model of `AlgebraicStructureTraits_::Simplify` - \link AlgebraicStructureTraits::Unit_part `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Unit_part` \endlink which is a model of `AlgebraicStructureTraits_::UnitPart` -\cgalRefines `Assignable` -\cgalRefines `CopyConstructible` -\cgalRefines `DefaultConstructible` -\cgalRefines `EqualityComparable` -\cgalRefines `FromIntConstructible` +\cgalRefines `Assignable` +\cgalRefines `CopyConstructible` +\cgalRefines `DefaultConstructible` +\cgalRefines `EqualityComparable` +\cgalRefines `FromIntConstructible` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` @@ -50,72 +50,72 @@ Moreover, `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >` is class IntegralDomainWithoutDivision { public: -/// \name Operations +/// \name Operations /// @{ /*! -unary plus -*/ -IntegralDomainWithoutDivision -operator+(const IntegralDomainWithoutDivision &a); +unary plus +*/ +IntegralDomainWithoutDivision +operator+(const IntegralDomainWithoutDivision &a); /*! -unary minus -*/ -IntegralDomainWithoutDivision -operator-(const IntegralDomainWithoutDivision &a); +unary minus +*/ +IntegralDomainWithoutDivision +operator-(const IntegralDomainWithoutDivision &a); /*! -*/ -IntegralDomainWithoutDivision -operator+(const IntegralDomainWithoutDivision &a, -const IntegralDomainWithoutDivision &b); +*/ +IntegralDomainWithoutDivision +operator+(const IntegralDomainWithoutDivision &a, +const IntegralDomainWithoutDivision &b); /*! -*/ -IntegralDomainWithoutDivision -operator-(const IntegralDomainWithoutDivision &a, -const IntegralDomainWithoutDivision &b); +*/ +IntegralDomainWithoutDivision +operator-(const IntegralDomainWithoutDivision &a, +const IntegralDomainWithoutDivision &b); /*! -*/ -IntegralDomainWithoutDivision -operator*(const IntegralDomainWithoutDivision &a, -const IntegralDomainWithoutDivision &b); +*/ +IntegralDomainWithoutDivision +operator*(const IntegralDomainWithoutDivision &a, +const IntegralDomainWithoutDivision &b); /*! -*/ -IntegralDomainWithoutDivision -operator+=(const IntegralDomainWithoutDivision &b); +*/ +IntegralDomainWithoutDivision +operator+=(const IntegralDomainWithoutDivision &b); /*! -*/ -IntegralDomainWithoutDivision -operator-=(const IntegralDomainWithoutDivision &b); +*/ +IntegralDomainWithoutDivision +operator-=(const IntegralDomainWithoutDivision &b); /*! -*/ -IntegralDomainWithoutDivision -operator*=(const IntegralDomainWithoutDivision &b); +*/ +IntegralDomainWithoutDivision +operator*=(const IntegralDomainWithoutDivision &b); /*! -The `result_type` is convertible to `bool`. -*/ -result_type -operator==(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b); +The `result_type` is convertible to `bool`. +*/ +result_type +operator==(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b); /*! -The `result_type` is convertible to `bool`. -*/ -result_type -operator!=(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b); +The `result_type` is convertible to `bool`. +*/ +result_type +operator!=(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddable.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddable.h index d63ee30a7241..ca66c5637279 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddable.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddable.h @@ -3,18 +3,18 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of this concepts represents numbers that are embeddable on the real -axis. The type obeys the algebraic structure and compares two values according -to the total order of the real numbers. +A model of this concepts represents numbers that are embeddable on the real +axis. The type obeys the algebraic structure and compares two values according +to the total order of the real numbers. -Moreover, `CGAL::Real_embeddable_traits< RealEmbeddable >` is a model of -`RealEmbeddableTraits` +Moreover, `CGAL::Real_embeddable_traits< RealEmbeddable >` is a model of +`RealEmbeddableTraits` -with: +with: -- \link RealEmbeddableTraits::Is_real_embeddable `CGAL::Real_embeddable_traits< RealEmbeddable >::Is_real_embeddable` \endlink set to `Tag_true` +- \link RealEmbeddableTraits::Is_real_embeddable `CGAL::Real_embeddable_traits< RealEmbeddable >::Is_real_embeddable` \endlink set to `Tag_true` -and functors : +and functors : - \link RealEmbeddableTraits::Is_zero `CGAL::Real_embeddable_traits< RealEmbeddable >::Is_zero` \endlink which is a model of `RealEmbeddableTraits_::IsZero` @@ -32,14 +32,14 @@ and functors : - \link RealEmbeddableTraits::To_interval `CGAL::Real_embeddable_traits< RealEmbeddable >::To_interval` \endlink which is a model of `RealEmbeddableTraits_::ToInterval` -Remark: +Remark: -If a number type is a model of both `IntegralDomainWithoutDivision` and -`RealEmbeddable`, it follows that the ring represented by such a number type -is a sub-ring of the real numbers and hence has characteristic zero. +If a number type is a model of both `IntegralDomainWithoutDivision` and +`RealEmbeddable`, it follows that the ring represented by such a number type +is a sub-ring of the real numbers and hence has characteristic zero. \cgalRefines `EqualityComparable` -\cgalRefines `LessThanComparable` +\cgalRefines `LessThanComparable` \sa `RealEmbeddableTraits` @@ -48,47 +48,47 @@ is a sub-ring of the real numbers and hence has characteristic zero. class RealEmbeddable { public: -/// \name Operations +/// \name Operations /// @{ /*! -*/ -bool operator==(const RealEmbeddable &a, -const RealEmbeddable &b); +*/ +bool operator==(const RealEmbeddable &a, +const RealEmbeddable &b); /*! -*/ -bool operator!=(const RealEmbeddable &a, -const RealEmbeddable &b); +*/ +bool operator!=(const RealEmbeddable &a, +const RealEmbeddable &b); /*! -*/ -bool operator< (const RealEmbeddable &a, -const RealEmbeddable &b); +*/ +bool operator< (const RealEmbeddable &a, +const RealEmbeddable &b); /*! -*/ -bool operator<=(const RealEmbeddable &a, -const RealEmbeddable &b); +*/ +bool operator<=(const RealEmbeddable &a, +const RealEmbeddable &b); /*! -*/ -bool operator> (const RealEmbeddable &a, -const RealEmbeddable &b); +*/ +bool operator> (const RealEmbeddable &a, +const RealEmbeddable &b); /*! -\relates RealEmbeddable -*/ -bool operator>=(const RealEmbeddable &a, -const RealEmbeddable &b); +\relates RealEmbeddable +*/ +bool operator>=(const RealEmbeddable &a, +const RealEmbeddable &b); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Abs.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Abs.h index f68ecd3ae0ca..bc4c71769a4e 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Abs.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Abs.h @@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction` computes the absolute value of a number. +`AdaptableUnaryFunction` computes the absolute value of a number. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` @@ -16,28 +16,28 @@ namespace RealEmbeddableTraits_ { class Abs { public: -/// \name Types +/// \name Types /// @{ /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type result_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -computes the absolute value of \f$ x\f$. -*/ -result_type operator()(argument_type x); +computes the absolute value of \f$ x\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Compare.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Compare.h index 07e7139544d6..9f2d4d7fcf15 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Compare.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Compare.h @@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableBinaryFunction` compares two real embeddable numbers. +`AdaptableBinaryFunction` compares two real embeddable numbers. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `RealEmbeddableTraits` @@ -16,43 +16,43 @@ namespace RealEmbeddableTraits_ { class Compare { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Comparison_result`. -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Comparison_result`. +*/ +typedef unspecified_type result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type first_argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type first_argument_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type second_argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -compares \f$ x\f$ with respect to \f$ y\f$. -*/ -result_type operator()(first_argument_type x, -second_argument_type y); +compares \f$ x\f$ with respect to \f$ y\f$. +*/ +result_type operator()(first_argument_type x, +second_argument_type y); /*! -This operator is defined if `NT1` and `NT2` are -`ExplicitInteroperable` with coercion type -`RealEmbeddableTraits::Type`. -*/ -template -result_type operator()(NT1 x, NT2 y); +This operator is defined if `NT1` and `NT2` are +`ExplicitInteroperable` with coercion type +`RealEmbeddableTraits::Type`. +*/ +template +result_type operator()(NT1 x, NT2 y); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsNegative.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsNegative.h index 76eab24473bc..a976457061a4 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsNegative.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsNegative.h @@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction`, returns true in case the argument is negative. +`AdaptableUnaryFunction`, returns true in case the argument is negative. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` @@ -16,28 +16,28 @@ namespace RealEmbeddableTraits_ { class IsNegative { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `bool`. -*/ -typedef unspecified_type result_type; +Type convertible to `bool`. +*/ +typedef unspecified_type result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns true in case \f$ x\f$ is negative. -*/ -result_type operator()(argument_type x); +returns true in case \f$ x\f$ is negative. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsPositive.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsPositive.h index 622badab9cb1..237a3be3cc2c 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsPositive.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsPositive.h @@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction`, returns true in case the argument is positive. +`AdaptableUnaryFunction`, returns true in case the argument is positive. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` @@ -16,28 +16,28 @@ namespace RealEmbeddableTraits_ { class IsPositive { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `bool`. -*/ -typedef unspecified_type result_type; +Type convertible to `bool`. +*/ +typedef unspecified_type result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns true in case \f$ x\f$ is positive. -*/ -result_type operator()(argument_type x); +returns true in case \f$ x\f$ is positive. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsZero.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsZero.h index afa24fc54175..1e0eec328502 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsZero.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--IsZero.h @@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction`, returns true in case the argument is 0. +`AdaptableUnaryFunction`, returns true in case the argument is 0. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` \sa `AlgebraicStructureTraits_::IsZero` @@ -17,29 +17,29 @@ namespace RealEmbeddableTraits_ { class IsZero { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `bool`. -*/ -typedef unspecified_type result_type; +Type convertible to `bool`. +*/ +typedef unspecified_type result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns true in case \f$ x\f$ is the zero element of the ring. -*/ -result_type operator()(argument_type x); +returns true in case \f$ x\f$ is the zero element of the ring. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Sgn.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Sgn.h index 259ae2dfbb64..783caf4f115e 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Sgn.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--Sgn.h @@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -This `AdaptableUnaryFunction` computes the sign of a real embeddable number. +This `AdaptableUnaryFunction` computes the sign of a real embeddable number. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` @@ -16,28 +16,28 @@ This `AdaptableUnaryFunction` computes the sign of a real embeddable number. class Sgn { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Sign`. -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Sign`. +*/ +typedef unspecified_type result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes the sign of \f$ x\f$. -*/ -result_type operator()(argument_type x); +Computes the sign of \f$ x\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToDouble.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToDouble.h index 62b3c531e9d9..b09a262eea1d 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToDouble.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToDouble.h @@ -5,13 +5,13 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction` computes a double approximation of a real -embeddable number. +`AdaptableUnaryFunction` computes a double approximation of a real +embeddable number. -Remark: In order to control the quality of approximation one has to resort -to methods that are specific to NT. There are no general guarantees whatsoever. +Remark: In order to control the quality of approximation one has to resort +to methods that are specific to NT. There are no general guarantees whatsoever. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` @@ -20,28 +20,28 @@ to methods that are specific to NT. There are no general guarantees whatsoever. class ToDouble { public: -/// \name Types +/// \name Types /// @{ /*! -The result type. -*/ +The result type. +*/ typedef double result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -computes a double approximation of a real embeddable number. -*/ -result_type operator()(argument_type x); +computes a double approximation of a real embeddable number. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToInterval.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToInterval.h index 20faf6db9ef1..9d73121096c9 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToInterval.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits--ToInterval.h @@ -5,11 +5,11 @@ namespace RealEmbeddableTraits_ { \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -`AdaptableUnaryFunction` computes for a given real embeddable -number \f$ x\f$ a double interval containing \f$ x\f$. -This interval is represented by `std::pair`. +`AdaptableUnaryFunction` computes for a given real embeddable +number \f$ x\f$ a double interval containing \f$ x\f$. +This interval is represented by `std::pair`. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `RealEmbeddableTraits` @@ -18,28 +18,28 @@ This interval is represented by `std::pair`. class ToInterval { public: -/// \name Types +/// \name Types /// @{ /*! The result type. -*/ +*/ typedef std::pair result_type; /*! -Is `RealEmbeddableTraits::Type`. -*/ -typedef unspecified_type argument_type; +Is `RealEmbeddableTraits::Type`. +*/ +typedef unspecified_type argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -computes a double interval containing \f$ x\f$. -*/ -result_type operator()(argument_type x); +computes a double interval containing \f$ x\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits.h index f246c99637c2..0d27f3d4489b 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `RealEmbeddableTraits` is associated to a number type -`Type` and reflects the properties of this type with respect -to the concept `RealEmbeddable`. +A model of `RealEmbeddableTraits` is associated to a number type +`Type` and reflects the properties of this type with respect +to the concept `RealEmbeddable`. \cgalHasModel `CGAL::Real_embeddable_traits` */ @@ -13,55 +13,55 @@ to the concept `RealEmbeddable`. class RealEmbeddableTraits { public: -/// \name Types +/// \name Types /// A model of `RealEmbeddableTraits` is supposed to provide: /// @{ /*! -The associated number type. -*/ -typedef unspecified_type Type; +The associated number type. +*/ +typedef unspecified_type Type; /*! -Tag indicating whether the associated type is real embeddable. +Tag indicating whether the associated type is real embeddable. -This is either \link Tag_true `Tag_true`\endlink or \link Tag_false `Tag_false`\endlink. -*/ -typedef unspecified_type Is_real_embeddable; +This is either \link Tag_true `Tag_true`\endlink or \link Tag_false `Tag_false`\endlink. +*/ +typedef unspecified_type Is_real_embeddable; /*! -This type specifies the return type of the predicates provided -by this traits. The type must be convertible to `bool` and -typically the type indeed maps to `bool`. However, there are also -cases such as interval arithmetic, in which it is `Uncertain` -or some similar type. +This type specifies the return type of the predicates provided +by this traits. The type must be convertible to `bool` and +typically the type indeed maps to `bool`. However, there are also +cases such as interval arithmetic, in which it is `Uncertain` +or some similar type. -*/ -typedef unspecified_type Boolean; +*/ +typedef unspecified_type Boolean; /*! -This type specifies the return type of the `Sgn` functor. -The type must be convertible to `CGAL::Sign` and -typically the type indeed maps to `CGAL::Sign`. However, there are also -cases such as interval arithmetic, in which it is `Uncertain` -or some similar type. +This type specifies the return type of the `Sgn` functor. +The type must be convertible to `CGAL::Sign` and +typically the type indeed maps to `CGAL::Sign`. However, there are also +cases such as interval arithmetic, in which it is `Uncertain` +or some similar type. -*/ -typedef unspecified_type Sign; +*/ +typedef unspecified_type Sign; /*! -This type specifies the return type of the `Compare` functor. -The type must be convertible to `CGAL::Comparison_result` and -typically the type indeed maps to `CGAL::Comparison_result`. However, there are also -cases such as interval arithmetic, in which it is `Uncertain` -or some similar type. +This type specifies the return type of the `Compare` functor. +The type must be convertible to `CGAL::Comparison_result` and +typically the type indeed maps to `CGAL::Comparison_result`. However, there are also +cases such as interval arithmetic, in which it is `Uncertain` +or some similar type. -*/ -typedef unspecified_type Comparison_result; +*/ +typedef unspecified_type Comparison_result; -/// @} +/// @} -/// \name Functors +/// \name Functors /// In case the associated type is `RealEmbeddable` all functors are /// provided. In case a functor is not provided, it is set to /// `CGAL::Null_functor`. @@ -69,46 +69,46 @@ typedef unspecified_type Comparison_result; /*! -A model of `RealEmbeddableTraits_::IsZero` -In case `Type` is also model of `IntegralDomainWithoutDivision` -this is a model of `AlgebraicStructureTraits_::IsZero`. -*/ -typedef unspecified_type Is_zero; +A model of `RealEmbeddableTraits_::IsZero` +In case `Type` is also model of `IntegralDomainWithoutDivision` +this is a model of `AlgebraicStructureTraits_::IsZero`. +*/ +typedef unspecified_type Is_zero; /*! -A model of `RealEmbeddableTraits_::Abs` -*/ -typedef unspecified_type Abs; +A model of `RealEmbeddableTraits_::Abs` +*/ +typedef unspecified_type Abs; /*! -A model of `RealEmbeddableTraits_::Sgn` -*/ -typedef unspecified_type Sgn; +A model of `RealEmbeddableTraits_::Sgn` +*/ +typedef unspecified_type Sgn; /*! -A model of `RealEmbeddableTraits_::IsPositive` -*/ -typedef unspecified_type Is_positive; +A model of `RealEmbeddableTraits_::IsPositive` +*/ +typedef unspecified_type Is_positive; /*! -A model of `RealEmbeddableTraits_::IsNegative` -*/ -typedef unspecified_type Is_negative; +A model of `RealEmbeddableTraits_::IsNegative` +*/ +typedef unspecified_type Is_negative; /*! -A model of `RealEmbeddableTraits_::Compare` -*/ -typedef unspecified_type Compare; +A model of `RealEmbeddableTraits_::Compare` +*/ +typedef unspecified_type Compare; /*! -A model of `RealEmbeddableTraits_::ToDouble` -*/ -typedef unspecified_type To_double; +A model of `RealEmbeddableTraits_::ToDouble` +*/ +typedef unspecified_type To_double; /*! -A model of `RealEmbeddableTraits_::ToInterval` -*/ -typedef unspecified_type To_interval; +A model of `RealEmbeddableTraits_::ToInterval` +*/ +typedef unspecified_type To_interval; /// @} diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RingNumberType.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RingNumberType.h index 492eaa557df4..13178d73deff 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RingNumberType.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/RingNumberType.h @@ -3,29 +3,29 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -The concept `RingNumberType` combines the requirements of the concepts -`IntegralDomainWithoutDivision` and `RealEmbeddable`. -A model of `RingNumberType` can be used as a template parameter -for Homogeneous kernels. - -\cgalRefines `IntegralDomainWithoutDivision` -\cgalRefines `RealEmbeddable` - -\cgalHasModel \cpp built-in number types -\cgalHasModel `CGAL::Gmpq` -\cgalHasModel `CGAL::Gmpz` -\cgalHasModel` CGAL::Interval_nt` +The concept `RingNumberType` combines the requirements of the concepts +`IntegralDomainWithoutDivision` and `RealEmbeddable`. +A model of `RingNumberType` can be used as a template parameter +for Homogeneous kernels. + +\cgalRefines `IntegralDomainWithoutDivision` +\cgalRefines `RealEmbeddable` + +\cgalHasModel \cpp built-in number types +\cgalHasModel `CGAL::Gmpq` +\cgalHasModel `CGAL::Gmpz` +\cgalHasModel` CGAL::Interval_nt` \cgalHasModel \ref CGAL::Interval_nt_advanced -\cgalHasModel `CGAL::Lazy_exact_nt` -\cgalHasModel `CGAL::MP_Float` +\cgalHasModel `CGAL::Lazy_exact_nt` +\cgalHasModel `CGAL::MP_Float` \cgalHasModel `CGAL::Gmpzf` -\cgalHasModel `CGAL::Quotient` -\cgalHasModel `leda_integer` -\cgalHasModel `leda_rational` -\cgalHasModel `leda_bigfloat` -\cgalHasModel `leda_real` +\cgalHasModel `CGAL::Quotient` +\cgalHasModel `leda_integer` +\cgalHasModel `leda_rational` +\cgalHasModel `leda_bigfloat` +\cgalHasModel `leda_real` -\sa `FieldNumberType` +\sa `FieldNumberType` */ diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/UniqueFactorizationDomain.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/UniqueFactorizationDomain.h index 25a0d1572284..0471c50f6140 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/UniqueFactorizationDomain.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/UniqueFactorizationDomain.h @@ -3,27 +3,27 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `UniqueFactorizationDomain` is an `IntegralDomain` with the -additional property -that the ring it represents is a unique factorization domain -(a.k.a. UFD or factorial ring), meaning that every non-zero non-unit -element has a factorization into irreducible elements that is unique -up to order and up to multiplication by invertible elements (units). -(An irreducible element is a non-unit ring element that cannot be factored -further into two non-unit elements. In a UFD, the irreducible elements -are precisely the prime elements.) - -In a UFD, any two elements, not both zero, possess a greatest common -divisor (gcd). - -Moreover, `CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >` -is a model of `AlgebraicStructureTraits` providing: - -- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >::Algebraic_category` \endlink -derived from `CGAL::Unique_factorization_domain_tag` +A model of `UniqueFactorizationDomain` is an `IntegralDomain` with the +additional property +that the ring it represents is a unique factorization domain +(a.k.a. UFD or factorial ring), meaning that every non-zero non-unit +element has a factorization into irreducible elements that is unique +up to order and up to multiplication by invertible elements (units). +(An irreducible element is a non-unit ring element that cannot be factored +further into two non-unit elements. In a UFD, the irreducible elements +are precisely the prime elements.) + +In a UFD, any two elements, not both zero, possess a greatest common +divisor (gcd). + +Moreover, `CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >` +is a model of `AlgebraicStructureTraits` providing: + +- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >::Algebraic_category` \endlink +derived from `CGAL::Unique_factorization_domain_tag` - \link AlgebraicStructureTraits::Gcd `CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >::Gcd` \endlink which is a model of `AlgebraicStructureTraits_::Gcd` -\cgalRefines `IntegralDomain` +\cgalRefines `IntegralDomain` \sa `IntegralDomainWithoutDivision` \sa `IntegralDomain` diff --git a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt index 64184b35a89b..c616d6befdc0 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Algebraic_foundations/examples/Algebraic_foundations/algebraic_structure_dispatch.cpp b/Algebraic_foundations/examples/Algebraic_foundations/algebraic_structure_dispatch.cpp index 6f33787bc9d9..391eea9e8cd9 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/algebraic_structure_dispatch.cpp +++ b/Algebraic_foundations/examples/Algebraic_foundations/algebraic_structure_dispatch.cpp @@ -4,18 +4,18 @@ #include template< typename NT > NT unit_part(const NT& x); -template< typename NT > +template< typename NT > NT unit_part_(const NT& x, CGAL::Field_tag); -template< typename NT > +template< typename NT > NT unit_part_(const NT& x, CGAL::Integral_domain_without_division_tag); template< typename NT > NT unit_part(const NT& x){ - // the unit part of 0 is defined as 1. + // the unit part of 0 is defined as 1. if (x == 0 ) return NT(1); typedef CGAL::Algebraic_structure_traits AST; - typedef typename AST::Algebraic_category Algebraic_category; + typedef typename AST::Algebraic_category Algebraic_category; return unit_part_(x,Algebraic_category()); } @@ -28,21 +28,21 @@ NT unit_part_(const NT& x, CGAL::Integral_domain_without_division_tag){ template< typename NT > NT unit_part_(const NT& x, CGAL::Field_tag){ // For Fields every x != 0 is a unit. - // Therefore, every x != 0 is its own unit part. + // Therefore, every x != 0 is its own unit part. return x; } int main(){ - // Function call for a model of EuclideanRing, i.e. int. + // Function call for a model of EuclideanRing, i.e. int. std::cout<< "int: unit_part(-3 ): " << unit_part(-3 ) << std::endl; - // Function call for a model of FieldWithSqrt, i.e. double + // Function call for a model of FieldWithSqrt, i.e. double std::cout<< "double: unit_part(-3.0): " << unit_part(-3.0) << std::endl; return 0; } -// Note that this is just an example -// This implementation for unit part won't work for some types, e.g., -// types that are not RealEmbeddable or types representing structures that have +// Note that this is just an example +// This implementation for unit part won't work for some types, e.g., +// types that are not RealEmbeddable or types representing structures that have // more units than just -1 and +1. (e.g. MP_Float representing Z[1/2]) -// From there Algebraic_structure_traits provides the functor Unit_part. +// From there Algebraic_structure_traits provides the functor Unit_part. diff --git a/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h b/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h index fdd2837c65a7..32c74d7f355f 100644 --- a/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h +++ b/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h @@ -14,7 +14,7 @@ /*! \file CGAL/Algebraic_extension_traits.h - * \brief Defines traits class CGAL::Algebraic_extension_traits. + * \brief Defines traits class CGAL::Algebraic_extension_traits. */ #ifndef CGAL_ALGEBRAIC_NUMBER_TRAITS_H @@ -29,22 +29,22 @@ namespace CGAL { template< class T > class Algebraic_extension_traits { public: - //! \name Typedefs + //! \name Typedefs //! the number type for which this instance has been instantiated typedef T Type; //! standard number types are not extended typedef CGAL::Tag_false Is_extended; - - //! computes the factor which normalizes a number to be integral after + + //! computes the factor which normalizes a number to be integral after // multiplication - class Normalization_factor + class Normalization_factor : public CGAL::cpp98::unary_function { private: - static Type + static Type normalization_factor(const Type&,Integral_domain_without_division_tag){ return Type(1); } - static Type + static Type normalization_factor(const Type& a, Field_tag){ return Type(1)/a; } @@ -57,15 +57,15 @@ class Algebraic_extension_traits { return normalization_factor(a, Tag()); } }; - - class Denominator_for_algebraic_integers + + class Denominator_for_algebraic_integers : public CGAL::cpp98::unary_function { - public: + public: //! determine normalization factor Type operator () (const Type&) { return Type(1); } - + template Type operator () (InputIterator, InputIterator) { return Type(1); diff --git a/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h b/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h index f8b495c0908d..5c3b6f0ee2ef 100644 --- a/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h +++ b/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h @@ -58,7 +58,7 @@ struct Field_with_root_of_tag : public Field_with_kth_root_tag {}; // The algebraic structure traits template // ========================================================================= -template< class Type_ > +template< class Type_ > class Algebraic_structure_traits { public: typedef Type_ Type; @@ -69,19 +69,19 @@ class Algebraic_structure_traits { typedef Null_functor Simplify; typedef Null_functor Unit_part; typedef Null_functor Integral_division; - typedef Null_functor Is_square; + typedef Null_functor Is_square; typedef Null_functor Gcd; typedef Null_functor Div_mod; typedef Null_functor Div; typedef Null_functor Mod; typedef Null_functor Square; typedef Null_functor Is_zero; - typedef Null_functor Is_one; + typedef Null_functor Is_one; typedef Null_functor Sqrt; typedef Null_functor Kth_root; - typedef Null_functor Root_of; - typedef Null_functor Divides; - typedef Null_functor Inverse; + typedef Null_functor Root_of; + typedef Null_functor Divides; + typedef Null_functor Inverse; }; // The algebraic structure traits base class @@ -99,10 +99,10 @@ class Algebraic_structure_traits_base< Type_, Null_tag > { typedef Null_tag Algebraic_category; typedef Tag_false Is_exact; typedef Null_tag Is_numerical_sensitive; - typedef Null_tag Boolean; + typedef Null_tag Boolean; // does nothing by default - class Simplify + class Simplify : public CGAL::cpp98::unary_function< Type&, void > { public: void operator()( Type& ) const {} @@ -110,17 +110,17 @@ class Algebraic_structure_traits_base< Type_, Null_tag > { typedef Null_functor Unit_part; typedef Null_functor Integral_division; - typedef Null_functor Is_square; + typedef Null_functor Is_square; typedef Null_functor Gcd; typedef Null_functor Div_mod; typedef Null_functor Div; typedef Null_functor Mod; typedef Null_functor Square; typedef Null_functor Is_zero; - typedef Null_functor Is_one; + typedef Null_functor Is_one; typedef Null_functor Sqrt; typedef Null_functor Kth_root; - typedef Null_functor Root_of; + typedef Null_functor Root_of; typedef Null_functor Divides; typedef Null_functor Inverse; }; @@ -128,12 +128,12 @@ class Algebraic_structure_traits_base< Type_, Null_tag > { //! The template specialization that is used if the number type is //! a model of the \c IntegralDomainWithoutDiv concept. The \c Simplify //! does nothing by default and the \c Unit_part is equal to -//! \c Type(-1) for negative numbers and +//! \c Type(-1) for negative numbers and //! \c Type(1) otherwise template< class Type_ > -class Algebraic_structure_traits_base< Type_, - Integral_domain_without_division_tag > - : public Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, + Integral_domain_without_division_tag > + : public Algebraic_structure_traits_base< Type_, Null_tag > { public: typedef Type_ Type; @@ -141,34 +141,34 @@ class Algebraic_structure_traits_base< Type_, typedef bool Boolean; // returns Type(1) by default - class Unit_part + class Unit_part : public CGAL::cpp98::unary_function< Type, Type > { public: Type operator()( const Type& x ) const { - return( x < Type(0)) ? - Type(-1) : Type(1); + return( x < Type(0)) ? + Type(-1) : Type(1); } }; - - class Square + + class Square : public CGAL::cpp98::unary_function< Type, Type > { - public: + public: Type operator()( const Type& x ) const { return x*x; } }; - - class Is_zero + + class Is_zero : public CGAL::cpp98::unary_function< Type, bool > { - public: + public: bool operator()( const Type& x ) const { return x == Type(0); } }; - class Is_one + class Is_one : public CGAL::cpp98::unary_function< Type, bool > { - public: + public: bool operator()( const Type& x ) const { return x == Type(1); } @@ -178,15 +178,15 @@ class Algebraic_structure_traits_base< Type_, //! The template specialization that is used if the number type is -//! a model of the \c IntegralDomain concept. It is equivalent to the +//! a model of the \c IntegralDomain concept. It is equivalent to the //! specialization -//! for the \c IntegralDomainWithoutDiv concept. The additionally required -//! \c Integral_division functor needs to be implemented in the +//! for the \c IntegralDomainWithoutDiv concept. The additionally required +//! \c Integral_division functor needs to be implemented in the //! \c Algebraic_structure_traits itself. template< class Type_ > -class Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, Integral_domain_tag > - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Integral_domain_without_division_tag > { public: typedef Type_ Type; @@ -196,39 +196,39 @@ class Algebraic_structure_traits_base< Type_, //! The template specialization that is used if the number type is //! a model of the \c UFDomain concept. It is equivalent to the specialization -//! for the \c IntegralDomain concept. The additionally required +//! for the \c IntegralDomain concept. The additionally required //! \c Integral_div functor -//! and \c Gcd functor need to be implemented in the +//! and \c Gcd functor need to be implemented in the //! \c Algebraic_structure_traits itself. template< class Type_ > -class Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, Unique_factorization_domain_tag > - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Integral_domain_tag > { public: typedef Type_ Type; typedef Unique_factorization_domain_tag Algebraic_category; // Default implementation of Divides functor for unique factorization domains - // x divides y if gcd(y,x) equals x up to inverses - class Divides + // x divides y if gcd(y,x) equals x up to inverses + class Divides : public CGAL::cpp98::binary_function{ public: - bool operator()( const Type& x, const Type& y) const { + bool operator()( const Type& x, const Type& y) const { typedef CGAL::Algebraic_structure_traits AST; typename AST::Gcd gcd; typename AST::Unit_part unit_part; typename AST::Integral_division idiv; return gcd(y,x) == idiv(x,unit_part(x)); } - // second operator computing q = x/y - bool operator()( const Type& x, const Type& y, Type& q) const { + // second operator computing q = x/y + bool operator()( const Type& x, const Type& y, Type& q) const { typedef CGAL::Algebraic_structure_traits AST; typename AST::Integral_division idiv; bool result = (*this)(x,y); - if( result == true ) + if( result == true ) q = idiv(x,y); - return result; + return result; } CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT(Type,bool) }; @@ -238,43 +238,43 @@ class Algebraic_structure_traits_base< Type_, //! The template specialization that is used if the number type is //! a model of the \c EuclideanRing concept. template< class Type_ > -class Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, Euclidean_ring_tag > - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Unique_factorization_domain_tag > { public: typedef Type_ Type; typedef Euclidean_ring_tag Algebraic_category; // maps to \c Div by default. - class Integral_division + class Integral_division : public CGAL::cpp98::binary_function< Type, Type, - Type > { + Type > { public: - Type operator()( - const Type& x, - const Type& y) const { - typedef Algebraic_structure_traits AST; + Type operator()( + const Type& x, + const Type& y) const { + typedef Algebraic_structure_traits AST; typedef typename AST::Is_exact Is_exact; CGAL_USE_TYPE(Is_exact); typename AST::Div actual_div; - - CGAL_precondition_msg( + + CGAL_precondition_msg( !Is_exact::value || actual_div( x, y) * y == x, "'x' must be divisible by 'y' in " "Algebraic_structure_traits<...>::Integral_div()(x,y)" ); - return actual_div( x, y); + return actual_div( x, y); } CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; // Algorithm from NiX/euclids_algorithm.h - class Gcd + class Gcd : public CGAL::cpp98::binary_function< Type, Type, - Type > { + Type > { public: - Type operator()( - const Type& x, + Type operator()( + const Type& x, const Type& y) const { typedef Algebraic_structure_traits AST; typename AST::Mod mod; @@ -282,7 +282,7 @@ class Algebraic_structure_traits_base< Type_, typename AST::Integral_division integral_div; // First: the extreme cases and negative sign corrections. if (x == Type(0)) { - if (y == Type(0)) + if (y == Type(0)) return Type(0); return integral_div( y, unit_part(y) ); } @@ -290,7 +290,7 @@ class Algebraic_structure_traits_base< Type_, return integral_div(x, unit_part(x) ); Type u = integral_div( x, unit_part(x) ); Type v = integral_div( y, unit_part(y) ); - // Second: assuming mod is the most expensive op here, + // Second: assuming mod is the most expensive op here, // we don't compute it unnecessarily if u < v if (u < v) { v = mod(v,u); @@ -321,84 +321,84 @@ class Algebraic_structure_traits_base< Type_, v = mod(w,u); } while (v != Type(0)); return u; - } + } CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; // based on \c Div and \c Mod. - class Div_mod { + class Div_mod { public: typedef Type first_argument_type; typedef Type second_argument_type; typedef Type& third_argument_type; typedef Type& fourth_argument_type; typedef void result_type; - void operator()( const Type& x, - const Type& y, + void operator()( const Type& x, + const Type& y, Type& q, Type& r) const { typedef Algebraic_structure_traits Traits; typename Traits::Div actual_div; typename Traits::Mod actual_mod; q = actual_div( x, y ); - r = actual_mod( x, y ); + r = actual_mod( x, y ); return; } - + template < class NT1, class NT2 > - void operator()( - const NT1& x, + void operator()( + const NT1& x, const NT2& y, - Type& q, + Type& q, Type& r ) const { typedef Coercion_traits< NT1, NT2 > CT; - typedef typename CT::Type Coercion_type_NT1_NT2; + typedef typename CT::Type Coercion_type_NT1_NT2; CGAL_USE_TYPE(Coercion_type_NT1_NT2); - CGAL_static_assertion(( + CGAL_static_assertion(( ::boost::is_same::value)); - + typename Coercion_traits< NT1, NT2 >::Cast cast; - operator()( cast(x), cast(y), q, r ); + operator()( cast(x), cast(y), q, r ); } }; - + // based on \c Div_mod. - class Div + class Div : public CGAL::cpp98::binary_function< Type, Type, Type > { public: - Type operator()( const Type& x, + Type operator()( const Type& x, const Type& y) const { typename Algebraic_structure_traits ::Div_mod actual_div_mod; - Type q; + Type q; Type r; actual_div_mod( x, y, q, r ); return q; }; - + CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; // based on \c Div_mod. - class Mod + class Mod : public CGAL::cpp98::binary_function< Type, Type, - Type > { + Type > { public: - Type operator()( const Type& x, + Type operator()( const Type& x, const Type& y) const { typename Algebraic_structure_traits ::Div_mod actual_div_mod; - Type q; + Type q; Type r; actual_div_mod( x, y, q, r ); return r; }; - + CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; - // Divides for Euclidean Ring - class Divides + // Divides for Euclidean Ring + class Divides : public CGAL::cpp98::binary_function{ public: bool operator()( const Type& x, const Type& y) const { @@ -407,7 +407,7 @@ class Algebraic_structure_traits_base< Type_, CGAL_precondition(typename AST::Is_zero()(x) == false ); return typename AST::Is_zero()(mod(y,x)); } - // second operator computing q + // second operator computing q bool operator()( const Type& x, const Type& y, Type& q) const { typedef Algebraic_structure_traits AST; typename AST::Div_mod div_mod; @@ -431,14 +431,14 @@ class Algebraic_structure_traits_base< Type_, // template< class Type_ > class Algebraic_structure_traits_base< Type_, Field_tag > - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Integral_domain_tag > { public: typedef Type_ Type; typedef Field_tag Algebraic_category; // returns the argument \a a by default - class Unit_part + class Unit_part : public CGAL::cpp98::unary_function< Type, Type > { public: Type operator()( const Type& x ) const { @@ -446,16 +446,16 @@ class Algebraic_structure_traits_base< Type_, Field_tag > } }; // maps to \c operator/ by default. - class Integral_division + class Integral_division : public CGAL::cpp98::binary_function< Type, Type, - Type > { + Type > { public: - Type operator()( const Type& x, - const Type& y) const { - typedef Algebraic_structure_traits AST; + Type operator()( const Type& x, + const Type& y) const { + typedef Algebraic_structure_traits AST; typedef typename AST::Is_exact Is_exact; CGAL_USE_TYPE(Is_exact); - CGAL_precondition_code( bool ie = Is_exact::value; ) + CGAL_precondition_code( bool ie = Is_exact::value; ) CGAL_precondition_msg( !ie || (x / y) * y == x, "'x' must be divisible by 'y' in " "Algebraic_structure_traits<...>::Integral_div()(x,y)" ); @@ -463,18 +463,18 @@ class Algebraic_structure_traits_base< Type_, Field_tag > } CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; - + // maps to \c 1/x by default. - class Inverse + class Inverse : public CGAL::cpp98::unary_function< Type, Type > { public: - Type operator()( const Type& x ) const { + Type operator()( const Type& x ) const { return Type(1)/x; } }; - - // Default implementation of Divides functor for Field: + + // Default implementation of Divides functor for Field: // returns always true // \pre: x != 0 class Divides @@ -484,7 +484,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag > CGAL_precondition_code( typedef Algebraic_structure_traits AST); CGAL_precondition( typename AST::Is_zero()(x) == false ); return true; - } + } // second operator computing q bool operator()( const Type& x, const Type& y, Type& q) const { CGAL_precondition_code(typedef Algebraic_structure_traits AST); @@ -498,16 +498,16 @@ class Algebraic_structure_traits_base< Type_, Field_tag > //! The template specialization that is used if the number type is a model -//! of the \c FieldWithSqrt concept. It is equivalent to the -//! specialization for the \c Field concept. The additionally required +//! of the \c FieldWithSqrt concept. It is equivalent to the +//! specialization for the \c Field concept. The additionally required //! \c NiX::NT_traits::Sqrt functor need to be //! implemented in the \c NT_traits itself. //! \ingroup NiX_NT_traits_bases // template< class Type_ > -class Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, Field_with_sqrt_tag> - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Field_tag> { public: typedef Type_ Type; @@ -528,20 +528,20 @@ class Algebraic_structure_traits_base< Type_, }; //! The template specialization that is used if the number type is a model -//! of the \c FieldWithKthRoot concept. It is equivalent to the -//! specialization for the \c Field concept. The additionally required +//! of the \c FieldWithKthRoot concept. It is equivalent to the +//! specialization for the \c Field concept. The additionally required //! \c NiX::NT_traits::Kth_root functor need to be //! implemented in the \c Algebraic_structure_traits itself. //! \ingroup NiX_NT_traits_bases // template< class Type_ > -class Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, Field_with_kth_root_tag> - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Field_with_sqrt_tag> { - - - + + + public: typedef Type_ Type; typedef Field_with_kth_root_tag Algebraic_category; @@ -551,16 +551,16 @@ class Algebraic_structure_traits_base< Type_, //! The template specialization that is used if the number type is a model -//! of the \c FieldWithRootOf concept. It is equivalent to the -//! specialization for the \c FieldWithKthRoot concept. The additionally +//! of the \c FieldWithRootOf concept. It is equivalent to the +//! specialization for the \c FieldWithKthRoot concept. The additionally //! required \c NiX::NT_traits::Root_of functor need to be //! implemented in the \c NT_traits itself. //! \ingroup NiX_NT_traits_bases // template< class Type_ > -class Algebraic_structure_traits_base< Type_, +class Algebraic_structure_traits_base< Type_, Field_with_root_of_tag > - : public Algebraic_structure_traits_base< Type_, + : public Algebraic_structure_traits_base< Type_, Field_with_kth_root_tag > { public: typedef Type_ Type; @@ -570,37 +570,37 @@ class Algebraic_structure_traits_base< Type_, // Some common functors to be used by AST specializations namespace INTERN_AST { template< class Type > - class Div_per_operator + class Div_per_operator : public CGAL::cpp98::binary_function< Type, Type, Type > { - public: - Type operator()( const Type& x, + public: + Type operator()( const Type& x, const Type& y ) const { return x / y; } - + CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; - + template< class Type > - class Mod_per_operator + class Mod_per_operator : public CGAL::cpp98::binary_function< Type, Type, Type > { public: - Type operator()( const Type& x, + Type operator()( const Type& x, const Type& y ) const { return x % y; } - + CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR( Type ) }; - + template< class Type > class Is_square_per_sqrt : public CGAL::cpp98::binary_function< Type, Type&, bool > { - public: - bool operator()( const Type& x, + public: + bool operator()( const Type& x, Type& y ) const { typename Algebraic_structure_traits< Type >::Sqrt actual_sqrt; diff --git a/Algebraic_foundations/include/CGAL/Chinese_remainder_traits.h b/Algebraic_foundations/include/CGAL/Chinese_remainder_traits.h index c7884e1bf026..d1ad86daa507 100644 --- a/Algebraic_foundations/include/CGAL/Chinese_remainder_traits.h +++ b/Algebraic_foundations/include/CGAL/Chinese_remainder_traits.h @@ -25,7 +25,7 @@ namespace CGAL{ namespace internal{ -template +template class Chinese_remainder_traits_base{ public: typedef T_ Type; @@ -40,20 +40,20 @@ template class Chinese_remainder_traits namespace internal { -template +template class Chinese_remainder_traits_base{ public: typedef NT Type; - typedef NT Scalar_type; - + typedef NT Scalar_type; + struct Chinese_remainder{ void operator() ( - const Scalar_type& m1, const Scalar_type& m2, const Scalar_type& m, - const Scalar_type& s, const Scalar_type& CGAL_precondition_code(t), - NT u1, NT u2, + const Scalar_type& m1, const Scalar_type& m2, const Scalar_type& m, + const Scalar_type& s, const Scalar_type& CGAL_precondition_code(t), + NT u1, NT u2, NT& u) const { -#ifndef CGAL_NDEBUG +#ifndef CGAL_NDEBUG NT tmp,s_,t_; tmp = CGAL::extended_euclidean_algorithm(m1,m2,s_,t_); CGAL_precondition(tmp == NT(1)); @@ -64,34 +64,34 @@ class Chinese_remainder_traits_base{ typedef Algebraic_structure_traits AST; typename AST::Mod mod; //typename AST::Unit_part unit_part; - typename AST::Integral_division idiv; + typename AST::Integral_division idiv; if(u1 < NT(0) ) u1 += m1; if(u2 < NT(0) ) u2 += m2; - + CGAL_precondition(0 < m1); CGAL_precondition(u1 < m1); CGAL_precondition(u1 >= NT(0)); - + CGAL_precondition(0 < m2); CGAL_precondition(u2 < m2); CGAL_precondition(u2 >= NT(0)); - + NT v = mod(s*(u2-u1),m2); u = m1*v + u1; - + // u is not unique yet! NT m_half = idiv(m-mod(m,NT(2)),NT(2)); if (u > m_half) u -= m ; - if (u <= -m_half) u += m ; + if (u <= -m_half) u += m ; } - + void operator() ( const Scalar_type& m1, const Type& u1, const Scalar_type& m2, const Type& u2, Scalar_type& m, Type& u) const { - Scalar_type s,t; - + Scalar_type s,t; + CGAL::extended_euclidean_algorithm(m1,m2,s,t); m = m1 * m2; this->operator()(m1,m2,m,s,t,u1,u2,u); diff --git a/Algebraic_foundations/include/CGAL/Coercion_traits.h b/Algebraic_foundations/include/CGAL/Coercion_traits.h index c1a98ad1a8e2..b61d24af57e9 100644 --- a/Algebraic_foundations/include/CGAL/Coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Coercion_traits.h @@ -13,8 +13,8 @@ // ============================================================================= /*! \file NiX/Coercion_traits.h - * \brief Defines class NiX::Coercion_traits. - * + * \brief Defines class NiX::Coercion_traits. + * * Provides the general definition of the \c Coercion_traits class, with * specializations for the builtin number types. */ @@ -70,7 +70,7 @@ CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, NT ) Type operator()(const FROM& x) const { \ return Type(x);} \ }; \ - }; + }; #define CGAL_DEFINE_COERCION_TRAITS_FROM_TO_TEM(FROM,TO,TEM) \ template \ @@ -96,9 +96,9 @@ CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, NT ) Type operator()(const FROM& x) const { \ return Type(x);} \ }; \ - }; + }; + - #define CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(A) \ template <> \ @@ -110,7 +110,7 @@ CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, NT ) typedef Type result_type; \ Type operator()(const A& x) const { return x;} \ }; \ - }; + }; #define CGAL_DEFINE_COERCION_TRAITS_FOR_SELF_TEM(A,TEM) \ template \ @@ -122,12 +122,12 @@ CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, NT ) typedef Type result_type; \ Type operator()(const A& x) const {return x;} \ }; \ - }; + }; namespace CGAL { -namespace INTERN_CT{ +namespace INTERN_CT{ template< class FROM, class TO >struct Cast_from_to{ typedef TO result_type; TO operator()(const TO& x) const {return x;} @@ -143,7 +143,7 @@ struct Cast_from_to{ template struct Coercion_traits; template struct Coercion_traits_for_level; - + CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,int) @@ -154,7 +154,7 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,long) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,float) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,long double) - + CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,long) #ifdef CGAL_USE_LONG_LONG CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,long long) @@ -178,25 +178,25 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long,long double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float,double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float,long double) - + CGAL_DEFINE_COERCION_TRAITS_FROM_TO(double,long double) //! Specialization for equal types. -template -struct Coercion_traits{ +template +struct Coercion_traits{ typedef Tag_true Are_explicit_interoperable; typedef Tag_true Are_implicit_interoperable; - typedef A Type; - struct Cast{ - typedef Type result_type; - Type inline operator()(const A& x) const { + typedef A Type; + struct Cast{ + typedef Type result_type; + Type inline operator()(const A& x) const { return x; - } + } }; }; - + CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(short) -CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(int) +CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(int) CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long) #ifdef CGAL_USE_LONG_LONG CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long long) @@ -207,16 +207,16 @@ CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long double) enum COERCION_TRAITS_LEVEL { CTL_TOP = 4, - CTL_POLYNOMIAL = 4, + CTL_POLYNOMIAL = 4, CTL_COMPLEX = 3, CTL_INTERVAL = 2, - CTL_SQRT_EXT = 1 + CTL_SQRT_EXT = 1 }; -template +template struct Coercion_traits_for_level: public Coercion_traits_for_level{}; -template +template struct Coercion_traits_for_level { typedef Tag_false Are_explicit_interoperable; typedef Tag_false Are_implicit_interoperable; @@ -224,10 +224,10 @@ struct Coercion_traits_for_level { typedef Null_functor Cast; }; -template +template struct Coercion_traits :public Coercion_traits_for_level{}; - + } //namespace CGAL #endif //NiX_COERCION_TRAITS_H diff --git a/Algebraic_foundations/include/CGAL/Fraction_traits.h b/Algebraic_foundations/include/CGAL/Fraction_traits.h index c0c587dce419..752db4d65547 100644 --- a/Algebraic_foundations/include/CGAL/Fraction_traits.h +++ b/Algebraic_foundations/include/CGAL/Fraction_traits.h @@ -17,29 +17,29 @@ // they may be wrong now. /*! \file NiX/Fraction_traits.h - \brief Defines class NiX::Fraction_traits. - + \brief Defines class NiX::Fraction_traits. + Provides dependent types and function objects for all the functions beyond operators with specializations of the \c Fraction_traits class for each number type. */ #ifndef CGAL_FRACTION_TRAITS_H -#define CGAL_FRACTION_TRAITS_H +#define CGAL_FRACTION_TRAITS_H #include namespace CGAL { /*! \ingroup NiX_Fraction_traits_spec - * \brief Traits class for accessing numerator and denominator.\n - * It is a model of the concept TypeTraits. + * \brief Traits class for accessing numerator and denominator.\n + * It is a model of the concept TypeTraits. * - * This is the default version of NiX::Fraction_traits. + * This is the default version of NiX::Fraction_traits. * It typedefs NiX::Fraction_traits::Is_decomposable * as Tag_false and all functors to LiS::Null_type. - * - * \see module NiX_Fraction_traits + * + * \see module NiX_Fraction_traits * \see module NiX_Cofraction_traits */ template diff --git a/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h b/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h index 865b656a6c48..53582b56604e 100644 --- a/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h +++ b/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h @@ -18,16 +18,16 @@ #include #include - + namespace CGAL { -/*! +/*! * oformat flag for parentheses if needed for a coefficient */ class Parens_as_product_tag {}; /*! \ingroup NiX_io_parens - * \brief Decides whether this number requires parentheses + * \brief Decides whether this number requires parentheses * in case it appears within a produkt. */ template @@ -36,7 +36,7 @@ struct Needs_parens_as_product{ }; /*! \ingroup NiX_io_parens - * \brief Decides whether this number requires parentheses + * \brief Decides whether this number requires parentheses * in case it appears within a produkt. */ template @@ -54,7 +54,7 @@ class Output_rep { const T& t; public: Output_rep(const T& tt) : t(tt) {} - std::ostream& operator () (std::ostream& out) const { + std::ostream& operator () (std::ostream& out) const { if ( needs_parens_as_product(t)) { return out << "(" << oformat(t) << ")"; } else { @@ -66,29 +66,29 @@ class Output_rep { // built-in number types: template <> struct Needs_parens_as_product{ - bool operator()(const short& x){return x < short(0);} + bool operator()(const short& x){return x < short(0);} }; template <> struct Needs_parens_as_product{ - bool operator()(const int& x){return x < int(0);} + bool operator()(const int& x){return x < int(0);} }; template <> struct Needs_parens_as_product{ - bool operator()(const long& x){return x < long(0);} + bool operator()(const long& x){return x < long(0);} }; #ifdef CGAL_USE_LONG_LONG template <> struct Needs_parens_as_product{ - bool operator()(const long long& x){return x < (long long)(0);} + bool operator()(const long long& x){return x < (long long)(0);} }; #endif template <> struct Needs_parens_as_product{ - bool operator()(const float& x){return x < float(0);} + bool operator()(const float& x){return x < float(0);} }; template <> struct Needs_parens_as_product{ - bool operator()(const double& x){return x < double(0);} + bool operator()(const double& x){return x < double(0);} }; template <> struct Needs_parens_as_product{ - bool operator()(const long double& x){return x < (long double)(0);} + bool operator()(const long double& x){return x < (long double)(0);} }; } //namespace CGAL diff --git a/Algebraic_foundations/include/CGAL/Rational_traits.h b/Algebraic_foundations/include/CGAL/Rational_traits.h index 04748afeffb4..1db2180f8446 100644 --- a/Algebraic_foundations/include/CGAL/Rational_traits.h +++ b/Algebraic_foundations/include/CGAL/Rational_traits.h @@ -12,11 +12,11 @@ // // ============================================================================= -// This file is for backward compatibility +// This file is for backward compatibility // Rational_traits will be replaced by Fraction_traits #ifndef CGAL_RATIONAL_TRAITS_H -#define CGAL_RATIONAL_TRAITS_H +#define CGAL_RATIONAL_TRAITS_H #include #include @@ -27,14 +27,14 @@ namespace CGAL { namespace internal{ -template +template struct Rational_traits_base { typedef Rational RT; - + const RT& numerator (const Rational& r) const { return r; } RT denominator (const Rational&) const { return RT(1); } - + template Rational make_rational(const T & x) const { return x; } @@ -44,10 +44,10 @@ struct Rational_traits_base { return make_rational(x.first, x.second); } Rational make_rational(const RT & n, const RT & d) const - { return n / d; } + { return n / d; } }; -template +template struct Rational_traits_base { private: @@ -57,19 +57,19 @@ struct Rational_traits_base public: typedef typename FT::Numerator_type RT; - + RT numerator (const Rational& r) const { - RT num,den; + RT num,den; Decomose()(r,num,den); return num; } - RT denominator (const Rational& r) const { - RT num,den; - Decomose()(r,num,den); - return den; + RT denominator (const Rational& r) const { + RT num,den; + Decomose()(r,num,den); + return den; } - + template Rational make_rational(const T & x) const { return x; } @@ -80,7 +80,7 @@ struct Rational_traits_base template Rational make_rational(const N& n, const D& d,typename boost::enable_if_c::value&&is_implicit_convertible::value,int>::type=0) const - { return Compose()(n,d); } + { return Compose()(n,d); } template Rational make_rational(const N& n, const D& d,typename boost::enable_if_c::value||!is_implicit_convertible::value,int>::type=0) const @@ -88,11 +88,11 @@ struct Rational_traits_base }; }// namespace internal -// use Fraction_traits if Is_fraction && Num and Den are the same +// use Fraction_traits if Is_fraction && Num and Den are the same template -class Rational_traits +class Rational_traits : public internal::Rational_traits_base::Is_fraction,Tag_true>::value +::boost::is_same::Is_fraction,Tag_true>::value && ::boost::is_same< typename Fraction_traits::Numerator_type, diff --git a/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h b/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h index 978c9f526421..41a6819f9620 100644 --- a/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h +++ b/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h @@ -32,17 +32,17 @@ struct Is_zero_selector< T, Null_functor > bool operator()( const T& x ) const { return x == T(0); } - }; + }; }; -template < class Type_ , class Is_real_embeddable_ > +template < class Type_ , class Is_real_embeddable_ > class Real_embeddable_traits_base{ public: typedef Type_ Type; typedef Is_real_embeddable_ Is_real_embeddable; typedef Null_tag Boolean; - typedef Null_tag Sign; - typedef Null_tag Comparison_result; + typedef Null_tag Sign; + typedef Null_tag Comparison_result; typedef Null_functor Abs; typedef Null_functor Sgn; @@ -54,23 +54,23 @@ class Real_embeddable_traits_base{ typedef Null_functor To_double; typedef Null_functor To_interval; }; - + template< class Type_ > class Real_embeddable_traits_base { public: typedef Type_ Type; - typedef Tag_true Is_real_embeddable; + typedef Tag_true Is_real_embeddable; typedef bool Boolean; - typedef CGAL::Sign Sign; - typedef CGAL::Comparison_result Comparison_result; - + typedef CGAL::Sign Sign; + typedef CGAL::Comparison_result Comparison_result; + private: - typedef typename Algebraic_structure_traits< Type >::Is_zero AST_Is_zero; + typedef typename Algebraic_structure_traits< Type >::Is_zero AST_Is_zero; public: //! The generic \c Is_zero functor implementation uses one comparison - typedef typename INTERN_RET::Is_zero_selector< Type, AST_Is_zero >::Type + typedef typename INTERN_RET::Is_zero_selector< Type, AST_Is_zero >::Type Is_zero; - + //! The generic \c Is_finite functor returns true class Is_finite : public CGAL::cpp98::unary_function< Type, Boolean > { public: @@ -78,7 +78,7 @@ class Real_embeddable_traits_base { return true; } }; - + //! The generic \c Abs functor implementation //! uses one comparisons and the unary minus if necessary. class Abs @@ -89,9 +89,9 @@ class Real_embeddable_traits_base { return( x < Type(0) ) ? -x : x; } }; - + //! The generic \c Sgn functor implementation uses two comparisons. - class Sgn + class Sgn : public CGAL::cpp98::unary_function< Type, ::CGAL::Sign > { public: //! the function call. @@ -103,34 +103,34 @@ class Real_embeddable_traits_base { return ZERO; } }; - + //! The generic \c Is_positive functor implementation uses one comparison. - class Is_positive + class Is_positive : public CGAL::cpp98::unary_function< Type, Boolean > { - public: + public: //! the function call. Boolean operator()( const Type& x ) const { return x > Type(0); } }; - + //! The generic \c Is_negative functor implementation uses one comparison. - class Is_negative + class Is_negative : public CGAL::cpp98::unary_function< Type, Boolean > { - public: + public: //! the function call. Boolean operator()( const Type& x ) const { return x < Type(0); } }; - + //! The generic \c Compare functor implementation uses two comparisons. - class Compare + class Compare : public CGAL::cpp98::binary_function< Type, Type, Comparison_result > { public: //! the function call. - Comparison_result operator()( const Type& x, + Comparison_result operator()( const Type& x, const Type& y) const { if( x < y ) return SMALLER; @@ -138,19 +138,19 @@ class Real_embeddable_traits_base { return LARGER; return EQUAL; } - + CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( Type, Comparison_result ) }; - + class To_double : public CGAL::cpp98::unary_function< Type, double > { public: double operator()( const Type& x ) const { return static_cast(x); } }; - - class To_interval + + class To_interval : public CGAL::cpp98::unary_function< Type, std::pair > { public: std::pair operator()( const Type& x ) const { @@ -159,12 +159,12 @@ class Real_embeddable_traits_base { } }; }; - + } // INTERN_RET -template< class Type_ > -class Real_embeddable_traits +template< class Type_ > +class Real_embeddable_traits : public INTERN_RET::Real_embeddable_traits_base {}; } //namespace CGAL diff --git a/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h b/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h index b817188d1767..5078831c3ba4 100644 --- a/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h +++ b/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h @@ -29,21 +29,21 @@ namespace CGAL { /*! \nosubgrouping * \ingroup NiX_Scalar_factor_traits_spec * \brief traits class for scalar factor extraction - * - * A model of the concept ScalarFactorTraits. - * - * This is the default implementation of NiX::Scalar_factor_traits. - * It is valid for most basic number types as Integer, Rational etc. + * + * A model of the concept ScalarFactorTraits. + * + * This is the default implementation of NiX::Scalar_factor_traits. + * It is valid for most basic number types as Integer, Rational etc. */ template< class NT > class Scalar_factor_traits { public: // the supported number type typedef NT Type; - // NT is also + // NT is also typedef NT Scalar; - // functor computing the scalar factor of a basic number type. + // functor computing the scalar factor of a basic number type. class Scalar_factor { static Scalar scalar_factor(const NT& a, Integral_domain_tag) { typename Algebraic_structure_traits::Unit_part upart; @@ -53,19 +53,19 @@ class Scalar_factor_traits { static Scalar scalar_factor(const NT& a, Field_tag) { return (a == NT(0)) ? NT(0) : NT(1); } - static Scalar scalar_factor(const NT& /* a */, + static Scalar scalar_factor(const NT& /* a */, const Scalar& /* d */, Integral_domain_tag) { return Scalar(1); } - static Scalar scalar_factor(const NT& a, + static Scalar scalar_factor(const NT& a, const Scalar& d, Field_tag) { return (a == NT(0) && d == Scalar(0)) ? NT(0) : NT(1); } - static Scalar scalar_factor(const NT& a, + static Scalar scalar_factor(const NT& a, const Scalar& d, - Unique_factorization_domain_tag) { + Unique_factorization_domain_tag) { if( d == Scalar(0)) { return a; } else { @@ -73,7 +73,7 @@ class Scalar_factor_traits { return gcd(a,d); } } - public: + public: // argument type typedef NT argument_type; // first argument type @@ -82,16 +82,16 @@ class Scalar_factor_traits { typedef Scalar second_argument_type; // result type typedef Scalar result_type; - + // determine extractable scalar factor Scalar operator () (const NT& a) { - CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value)); + CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value)); typedef typename Algebraic_structure_traits::Algebraic_category SAT; return scalar_factor(a, SAT()); } // determine extractable scalar factor - Scalar operator () (const NT& a, const Scalar& d) { - CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value)); + Scalar operator () (const NT& a, const Scalar& d) { + CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value)); typedef typename Algebraic_structure_traits::Algebraic_category SAT; return scalar_factor(a,d,SAT()); } @@ -116,7 +116,7 @@ class Scalar_factor_traits { /*! \ingroup NiX_Scalar_factor_traits * \brief removes the scalar factor - * + * * Removes the scalar factor provided by NiX::Scalar_factor_traits */ template @@ -125,7 +125,7 @@ void remove_scalar_factor(NT& x){ typedef typename SFT::Scalar Scalar; typename SFT::Scalar_factor sfac; typename SFT::Scalar_div sdiv; - + Scalar scalar=sfac(x); if(scalar != Scalar(0)) sdiv(x,scalar); @@ -136,12 +136,12 @@ inline typename CGAL::Scalar_factor_traits::Scalar scalar_factor(const NT& x){ typename CGAL::Scalar_factor_traits::Scalar_factor scalar_factor; - return scalar_factor(x); + return scalar_factor(x); } template inline -typename CGAL::Scalar_factor_traits::Scalar +typename CGAL::Scalar_factor_traits::Scalar scalar_factor(const NT& x, const typename CGAL::Scalar_factor_traits::Scalar& d) { diff --git a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h index 099e6087de66..db74015c6758 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h @@ -40,7 +40,7 @@ #include -// checks the result type of a functor +// checks the result type of a functor template void check_result_type(AdaptableFunctor, ResultType){ typedef typename AdaptableFunctor::result_type result_type; @@ -84,13 +84,13 @@ void check_result_type(CGAL::Null_functor, ResultType){} CGAL_USE_TYPE(Root_of); namespace CGAL { - + template< class AS > bool test_equality_epsilon( const AS & a, const AS & b, const AS & epsilon ) { typedef Algebraic_structure_traits AST; - typedef typename AST::Is_exact Is_exact; + typedef typename AST::Is_exact Is_exact; if( Is_exact::value ) return a == b; else { @@ -105,22 +105,22 @@ AS unit_normal( const AS& x ) { CGAL_SNAP_AST_FUNCTORS(AST); const Unit_part unit_part = Unit_part(); const Integral_division integral_division = Integral_division(); - + return integral_division( x, unit_part(x) ); } //Syntax tests template< class AS > -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const CGAL::Integral_domain_without_division_tag& ) {} template< class AS > void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) { - + // test of functors typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); - + using CGAL::Null_functor; CGAL_static_assertion( (!::boost::is_same< Integral_division, Null_functor >::value)); @@ -128,16 +128,16 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) { CGAL_static_assertion((!::boost::is_same< Is_zero, Null_functor >::value)); CGAL_static_assertion((!::boost::is_same< Is_one, Null_functor >::value)); CGAL_static_assertion((!::boost::is_same< Square, Null_functor >::value)); - + // functor const Is_zero is_zero = Is_zero(); assert( is_zero( AS (0)) ); assert(! is_zero( AS (23)) ); - assert( is_zero( AS (0) + AS(0) ) ); + assert( is_zero( AS (0) + AS(0) ) ); assert( CGAL_NTS is_zero( AS (0)) ); assert(! CGAL_NTS is_zero( AS (23)) ); - assert( CGAL_NTS is_zero( AS (0) + AS(0) ) ); - + assert( CGAL_NTS is_zero( AS (0) + AS(0) ) ); + const Is_one is_one = Is_one(); assert( is_one( AS (1)) ); assert(! is_one( AS (23)) ); @@ -145,11 +145,11 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) { assert( CGAL_NTS is_one( AS (1)) ); assert(! CGAL_NTS is_one( AS (23)) ); assert( CGAL_NTS is_one( AS (1) + AS(0) ) ); - + const Square square = Square(); assert( square( AS (23)) == AS (23*23) ); assert( CGAL_NTS square( AS (23)) == AS (23*23) ); - + const Integral_division integral_division = Integral_division(); AS a(6); AS b(2); @@ -167,39 +167,39 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) { assert( divides(b,a)); assert( divides(c,a)); //assert( divides(c*b-c,a+a-a)); - assert( CGAL_NTS divides(b,AS(0))); - assert( CGAL_NTS divides(b,a)); + assert( CGAL_NTS divides(b,AS(0))); + assert( CGAL_NTS divides(b,a)); assert( CGAL_NTS divides(c,a)); //assert( CGAL_NTS divides(c*b-c,a+a-a)); - + typedef typename AST::Is_exact Is_exact; // VC7 produced an ICE for // assert( ! Is_exact::value || ... ); bool ie = Is_exact::value; (void) ie; - AS tmp; + AS tmp; assert( divides(b,AS(0),tmp)); assert( !ie || tmp == integral_division(AS(0),b)); - assert( divides(b,a,tmp)); + assert( divides(b,a,tmp)); assert( !ie || tmp == integral_division(a,b)); assert( divides(c,a,tmp)); assert( !ie || tmp == integral_division(a,c)); assert( divides(c*b-c,a+a-a,tmp)); assert( !ie || tmp == integral_division(a+a-a,c*b-c)); - - - assert( CGAL_NTS divides(b,AS(0),tmp)); + + + assert( CGAL_NTS divides(b,AS(0),tmp)); assert( !ie || tmp == integral_division(AS(0),b)); - assert( CGAL_NTS divides(b,a,tmp)); + assert( CGAL_NTS divides(b,a,tmp)); assert( !ie || tmp == integral_division(a,b)); assert( CGAL_NTS divides(c,a,tmp)); assert( !ie || tmp == integral_division(a,c)); assert( CGAL_NTS divides(AS(c*b-c),AS(a+a-a),tmp)); - assert( !ie || tmp == integral_division(a+a-a,c*b-c)); + assert( !ie || tmp == integral_division(a+a-a,c*b-c)); } - + template< class AS > -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const CGAL::Unique_factorization_domain_tag& ) { test_algebraic_structure_intern< AS >(CGAL::Integral_domain_tag()); typedef CGAL::Algebraic_structure_traits< AS > AST; @@ -214,48 +214,48 @@ void test_algebraic_structure_intern( assert( gcd( AS (-7), AS ( 0)) == unit_normal( AS (7) ) ); assert( gcd( AS ( 0), AS ( 7)) == unit_normal( AS (7) ) ); assert( gcd( AS ( 0), AS (-7)) == unit_normal( AS (7) ) ); - + assert( gcd( AS (-7), AS ( 1)) == unit_normal( AS (1) ) ); assert( gcd( AS ( 1), AS (-7)) == unit_normal( AS (1) ) ); - + assert( gcd( AS ( 15), AS ( 12)) == unit_normal( AS (3) ) ); assert( gcd( AS (-15), AS ( 12)) == unit_normal( AS (3) ) ); assert( gcd( AS ( 15), AS (-12)) == unit_normal( AS (3) ) ); assert( gcd( AS (-15), AS (-12)) == unit_normal( AS (3) ) ); - // special test for expression template, e.g. mpz_class - assert( gcd(AS(-10)+AS(-5),AS(-4)*AS(-3)) + // special test for expression template, e.g. mpz_class + assert( gcd(AS(-10)+AS(-5),AS(-4)*AS(-3)) == unit_normal( AS (3) ) ); - - assert( CGAL_NTS gcd( AS ( 0), AS ( 0)) + + assert( CGAL_NTS gcd( AS ( 0), AS ( 0)) == unit_normal( AS (0) ) ); - assert( CGAL_NTS gcd( AS ( 7), AS ( 0)) + assert( CGAL_NTS gcd( AS ( 7), AS ( 0)) == unit_normal( AS (7) ) ); - assert( CGAL_NTS gcd( AS (-7), AS ( 0)) + assert( CGAL_NTS gcd( AS (-7), AS ( 0)) == unit_normal( AS (7) ) ); - assert( CGAL_NTS gcd( AS ( 0), AS ( 7)) + assert( CGAL_NTS gcd( AS ( 0), AS ( 7)) == unit_normal( AS (7) ) ); - assert( CGAL_NTS gcd( AS ( 0), AS (-7)) + assert( CGAL_NTS gcd( AS ( 0), AS (-7)) == unit_normal( AS (7) ) ); - - assert( CGAL_NTS gcd( AS (-7), AS ( 1)) + + assert( CGAL_NTS gcd( AS (-7), AS ( 1)) == unit_normal( AS (1) ) ); - assert( CGAL_NTS gcd( AS ( 1), AS (-7)) + assert( CGAL_NTS gcd( AS ( 1), AS (-7)) == unit_normal( AS (1) ) ); - - assert( CGAL_NTS gcd( AS ( 15), AS ( 12)) + + assert( CGAL_NTS gcd( AS ( 15), AS ( 12)) == unit_normal( AS (3) ) ); - assert( CGAL_NTS gcd( AS (-15), AS ( 12)) + assert( CGAL_NTS gcd( AS (-15), AS ( 12)) == unit_normal( AS (3) ) ); - assert( CGAL_NTS gcd( AS ( 15), AS (-12)) + assert( CGAL_NTS gcd( AS ( 15), AS (-12)) == unit_normal( AS (3) ) ); - assert( CGAL_NTS gcd( AS (-15), AS (-12)) + assert( CGAL_NTS gcd( AS (-15), AS (-12)) == unit_normal( AS (3) ) ); - // special test for expression template, e.g. mpz_class - assert( CGAL_NTS gcd(AS(-10)+AS(-5),AS(-4)*AS(-3)) + // special test for expression template, e.g. mpz_class + assert( CGAL_NTS gcd(AS(-10)+AS(-5),AS(-4)*AS(-3)) == unit_normal( AS (3) ) ); } @@ -266,16 +266,16 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) { typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); - + using CGAL::Null_functor; CGAL_static_assertion((!::boost::is_same< Div, Null_functor>::value)); CGAL_static_assertion((!::boost::is_same< Mod, Null_functor>::value)); CGAL_static_assertion((!::boost::is_same< Div_mod, Null_functor>::value)); - + const Div div=Div(); const Mod mod=Mod(); const Div_mod div_mod=Div_mod(); - + // Rounding mode for div is: to zero assert( div( AS ( 3), AS (3)) == AS (1)); assert( div( AS ( 2), AS (3)) == AS (0)); @@ -312,7 +312,7 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) { for (int i = -12; i <= 12; i++){ for (int j = 1; j < 10; j++){ AS q,r; - { + { AS a(i),b(j); div_mod(a,b,q,r); assert(q == div(a,b)); @@ -325,7 +325,7 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) { } } } - + // special syntax test for expression template, e.g. mpz_class assert( div(AS(-4)+AS(-4),AS(3)*AS(1)) == AS (-2)); assert( mod(AS(-4)+AS(-4),AS(3)*AS(1)) == AS (-2)); @@ -351,7 +351,7 @@ void test_algebraic_structure_intern( const CGAL::Field_tag& ) { a /= AS (2); a /= AS (2); // that must work correctly also for float types assert( a * AS (4) == AS (1)); - + typename AST::Divides divides; assert(divides(AS(2),AS(0))); assert(divides(AS(2),AS(5))); @@ -374,35 +374,35 @@ void test_algebraic_structure_intern( const CGAL::Field_tag& ) { typename AST::Inverse inverse; assert(AS(1)/AS(2) == inverse(AS(2))); assert(AS(1)/AS(2) == CGAL::inverse(AS(2))); - - + + } template void test_algebraic_structure_intern( const CGAL::Field_with_sqrt_tag& ) { test_algebraic_structure_intern< AS >( CGAL::Field_tag()); typedef CGAL::Algebraic_structure_traits< AS > AST; - typedef typename AST::Is_exact Is_exact; + typedef typename AST::Is_exact Is_exact; CGAL_SNAP_AST_FUNCTORS(AST); CGAL_static_assertion((!::boost::is_same< Sqrt, Null_functor>::value)); - const Sqrt sqrt =Sqrt(); + const Sqrt sqrt =Sqrt(); AS a(4); - + AS c = sqrt( a); bool ie = Is_exact::value; - assert( ! ie || (c == AS (2)) ); + assert( ! ie || (c == AS (2)) ); c = AS (5); assert( !ie || sqrt(c) * sqrt(c) == c ); (void)c; // avoid warnings for unused variables // #### more involved square root and root tests } - - + + //semantic test template -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const AS & a ,const AS & b, const AS & c, const CGAL::Integral_domain_without_division_tag&) { assert( a != AS (0)); @@ -434,16 +434,16 @@ void test_algebraic_structure_intern( assert((a-b)*(a-b)==a*a- AS (2)*a*b+b*b); assert((a-b)*(a+b)==a*a-b*b); // unary operators - assert(a==+a); - assert(b==+b); + assert(a==+a); + assert(b==+b); assert(c==+c); - assert(-a* AS (-1)==a); - assert(-b* AS (-1)==b); + assert(-a* AS (-1)==a); + assert(-b* AS (-1)==b); assert(-c* AS (-1)==c); } - + template - void test_algebraic_structure_intern( + void test_algebraic_structure_intern( const AS & a ,const AS & b, const AS & c, const CGAL::Integral_domain_tag&) { assert( a != AS (0)); @@ -454,7 +454,7 @@ void test_algebraic_structure_intern( typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); - + //Integral_div const Integral_division integral_division = Integral_division(); assert(integral_division(a*b,a)==b); @@ -464,7 +464,7 @@ void test_algebraic_structure_intern( assert(integral_division(c*a,c)==a); assert(integral_division(c*b,c)==b); assert(CGAL_NTS integral_division(c*b,c)==b); - + const Divides divides = Divides(); assert(divides(a,a*b)); assert(divides(a,a*c)); @@ -474,11 +474,11 @@ void test_algebraic_structure_intern( assert(divides(c,c*b)); assert(CGAL_NTS divides(c,c*b)); } - + template -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const AS & a , - const AS & b, + const AS & b, const AS & c, const CGAL::Unique_factorization_domain_tag&) { @@ -486,7 +486,7 @@ void test_algebraic_structure_intern( assert( b != AS (0)); assert( c != AS (0)); test_algebraic_structure_intern(a,b,c,CGAL::Integral_domain_tag()); - + typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); const Gcd gcd = Gcd(); @@ -503,26 +503,26 @@ void test_algebraic_structure_intern( } template -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const AS & a , - const AS & b, + const AS & b, const AS & c, const CGAL::Euclidean_ring_tag&) { - + assert( a != AS (0)); assert( b != AS (0)); assert( c != AS (0)); - + test_algebraic_structure_intern(a,b,c, CGAL::Unique_factorization_domain_tag()); - + typedef CGAL::Algebraic_structure_traits< AS > AST; - CGAL_SNAP_AST_FUNCTORS(AST); + CGAL_SNAP_AST_FUNCTORS(AST); const Div div = Div(); const Mod mod = Mod(); const Div_mod div_mod = Div_mod(); - - // do we have any + + // do we have any AS tmp_mod,tmp_div; div_mod(a,b,tmp_div,tmp_mod); assert(tmp_div==div(a,b)); @@ -541,21 +541,21 @@ void test_algebraic_structure_intern( } template -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const AS & a, - const AS & b, + const AS & b, const AS & c, const CGAL::Field_tag&) { - + assert( a != AS (0)); assert( b != AS (0)); assert( c != AS (0)); - + test_algebraic_structure_intern(a,b,c,CGAL::Integral_domain_tag()); - + AS epsilon = AS (1)/ AS (128); - assert( test_equality_epsilon( AS ((a/b)*b), + assert( test_equality_epsilon( AS ((a/b)*b), AS ( a ), epsilon ) ); assert( test_equality_epsilon( AS ( (a/c)*c ), AS ( a ), epsilon ) ); @@ -568,41 +568,41 @@ void test_algebraic_structure_intern( assert( test_equality_epsilon( AS ( (c/a)*a ), AS ( c ), epsilon ) ); } - + template -void test_algebraic_structure_intern( +void test_algebraic_structure_intern( const AS & a , - const AS & b, + const AS & b, const AS & c, const CGAL::Field_with_sqrt_tag&) { - + assert( a != AS (0)); assert( b != AS (0)); assert( c != AS (0)); - + test_algebraic_structure_intern(a,b,c,CGAL::Field_tag()); - + typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); const Sqrt sqrt = Sqrt(); - + AS tmp; AS epsilon = AS (1); - + tmp=CGAL_NTS unit_part(a)*a; assert( test_equality_epsilon( sqrt(tmp)*sqrt(tmp), tmp, epsilon ) ); - + tmp=CGAL_NTS unit_part(b)*b; assert( test_equality_epsilon( sqrt(tmp)*sqrt(tmp), tmp, epsilon ) ); - + tmp=CGAL_NTS unit_part(c)*c; assert( test_equality_epsilon( sqrt(tmp)*sqrt(tmp), tmp, epsilon ) ); } - -template< class AS, class Is_square > + +template< class AS, class Is_square > class Test_is_square { public: void operator()( const Is_square& is_square ) { @@ -618,7 +618,7 @@ class Test_is_square { ( ::boost::is_same< AS& , Second_argument_type>::value)); //CGAL_static_assertion(( ::boost::is_same< bool , Result_type>::value)); bool b = Result_type(true); CGAL_USE(b); - + AS test_number = AS(3)*AS(3); AS result; assert( is_square( test_number)); @@ -651,7 +651,7 @@ class Test_sqrt { CGAL_static_assertion(( ::boost::is_same< AS , Argument_type>::value)); CGAL_static_assertion(( ::boost::is_same< AS , Result_type>::value)); typedef Algebraic_structure_traits AST; - typedef typename AST::Is_exact Is_exact; + typedef typename AST::Is_exact Is_exact; assert( !Is_exact::value || AS (3) == sqrt( AS (9))); } }; @@ -695,10 +695,10 @@ class Test_root< AS , CGAL::Null_functor> { // ok, nothing to test } }; - + // Type_functions ----------------------------------------------- template -void test_Type_functions( +void test_Type_functions( const CGAL::Integral_domain_without_division_tag&) { AS x(-15); CGAL_NTS simplify(x); @@ -708,21 +708,21 @@ void test_Type_functions( assert( CGAL_NTS is_one( AS (1)) ); assert( CGAL_NTS square( AS (23)) == AS (23*23) ); } - + template void test_Type_functions( const CGAL::Integral_domain_tag&) { test_Type_functions< AS > (CGAL::Integral_domain_without_division_tag()); assert(CGAL_NTS integral_division( AS (10), AS (2))== AS (5)); } - + template -void test_Type_functions( +void test_Type_functions( const CGAL::Unique_factorization_domain_tag&) { test_Type_functions< AS >(CGAL::Integral_domain_tag()); - + assert(CGAL_NTS gcd( AS (21), AS (15)) == unit_normal(AS (3))); - + } template @@ -733,13 +733,13 @@ void test_Type_functions( const CGAL::Euclidean_ring_tag&) { AS q,r,a,b; a = AS(14); b = AS(5); - r = CGAL_NTS mod(a,b); + r = CGAL_NTS mod(a,b); q = CGAL_NTS div(a,b); assert( a == b*q+r); CGAL_NTS div_mod(a,b,q,r); assert( a == b*q+r); } - + template void test_Type_functions( const CGAL::Field_tag&) { test_Type_functions< AS >(CGAL::Integral_domain_tag()); @@ -747,28 +747,28 @@ void test_Type_functions( const CGAL::Field_tag&) { assert(CGAL_NTS unit_part( AS (1 ))== AS ( 1)); assert(CGAL_NTS unit_part( AS (0 ))== AS ( 1)); } - + template -void test_Type_functions( const CGAL::Field_with_sqrt_tag&) { - test_Type_functions< AS >(CGAL::Field_tag()); +void test_Type_functions( const CGAL::Field_with_sqrt_tag&) { + test_Type_functions< AS >(CGAL::Field_tag()); typedef Algebraic_structure_traits AST; - typedef typename AST::Is_exact Is_exact; + typedef typename AST::Is_exact Is_exact; AS c = CGAL_NTS sqrt( AS (4)); bool ie = Is_exact::value; assert( !ie || c == AS (2) ); } template void test_Type_functions( const CGAL::Field_with_root_of_tag&) { - test_Type_functions< AS >(CGAL::Field_with_sqrt_tag()); + test_Type_functions< AS >(CGAL::Field_with_sqrt_tag()); std::vector< AS > coeffs(4); coeffs[0]= AS (-27); coeffs[1]= AS (0); coeffs[2]= AS (0); coeffs[3]= AS (1); - + typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); - + // typedef typename Root_of::Boundary Boundary; const Root_of root_of = Root_of(); @@ -777,16 +777,16 @@ void test_Type_functions( const CGAL::Field_with_root_of_tag&) { assert(real*real == AS (9)); assert(real-real == AS (0)); assert(CGAL_NTS sqrt(real) == CGAL_NTS sqrt( AS (3))); - + // Test the function assert( CGAL_NTS root_of(1, coeffs.begin(), coeffs.end() ) == - root_of( 1, coeffs.begin(), coeffs.end() ) ); - -/* - AS real2 = root_of( AS (2), + root_of( 1, coeffs.begin(), coeffs.end() ) ); + +/* + AS real2 = root_of( AS (2), AS (4), coeffs.begin(), coeffs.end() ); - + assert( real2 == AS (3)); assert(real2*real2 == AS (9)); assert(real2-real2 == AS (0)); @@ -796,14 +796,14 @@ void test_Type_functions( const CGAL::Field_with_root_of_tag&) { template void test_algebraic_structure(){ - + test_Type_functions< AS >(Algebraic_category()); - + typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); - + CGAL_static_assertion((::boost::is_same::value)); - + typedef typename AST::Boolean Boolean; assert(!Boolean()); check_result_type(Is_zero(), Boolean()); @@ -812,20 +812,20 @@ void test_algebraic_structure(){ check_result_type(Is_square(), Boolean()); typedef typename AST::Algebraic_category Tag; - using CGAL::Integral_domain_without_division_tag; + using CGAL::Integral_domain_without_division_tag; using CGAL::Null_functor; // Test for desired exactness CGAL_static_assertion( ( ::boost::is_same< typename AST::Is_exact, Is_exact >::value)); - CGAL_static_assertion(( ::boost::is_convertible< Tag, + CGAL_static_assertion(( ::boost::is_convertible< Tag, Integral_domain_without_division_tag >::value )); CGAL_static_assertion(( ::boost::is_same< Tag, Algebraic_category>::value)); CGAL_static_assertion((!::boost::is_same< Simplify, Null_functor>::value)); CGAL_static_assertion((!::boost::is_same< Unit_part, Null_functor>::value)); const Simplify simplify=Simplify();; const Unit_part unit_part= Unit_part(); - + // the other functors must exist as well, but they might be Null_functor's Integral_division integral_div; Gcd gcd; @@ -848,7 +848,7 @@ void test_algebraic_structure(){ (void)is_square; // (void)find_only_zero_element; // (void)find_only_equal_pair; - + AS a; // DefaultConstructible AS b(127); // construction from small integers AS c(-127); @@ -927,26 +927,26 @@ void test_algebraic_structure(){ // w.begin(),w.end()); // assert(1 == equal_pair.first); // assert(2 == equal_pair.second); - - } + + } } template void test_algebraic_structure( const AS & a, const AS & b, const AS & c) { - + assert( a != AS (0)); assert( b != AS (0)); assert( c != AS (0)); test_algebraic_structure< AS ,Algebraic_category, Is_exact>(); test_algebraic_structure_intern(a,b,c,Algebraic_category()); - + typedef CGAL::Algebraic_structure_traits AST; typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive; CGAL_static_assertion( !(::boost::is_same::value)); CGAL_USE_TYPE(Is_numerical_sensitive); } - + } //namespace CGAL #include diff --git a/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h index 6a9b2a45c4a4..ea66218eb28a 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h @@ -13,7 +13,7 @@ // ============================================================================= -/*! \file test_coercion_traits.h +/*! \file test_coercion_traits.h \brief test functions for class NiX::Coercion_traits */ @@ -27,7 +27,7 @@ // These are test functions for the Coercion_traits namespace CGAL { -// this test implicit interoperable +// this test implicit interoperable template< class A, class B, class Type > void test_implicit_interoperable(); template< class FROM, class TO > void test_implicit_interoperable_from_to(); @@ -42,7 +42,7 @@ void test_implicit_interoperable_for_real_embeddable (CGAL::Tag_false){} template void test_implicit_interoperable_for_real_embeddable (CGAL::Tag_true){ - // two sided test for interoperability with int + // two sided test for interoperability with int A a; B b; @@ -63,24 +63,24 @@ void test_implicit_interoperable_for_real_embeddable (CGAL::Tag_true){ a = A(value_a); b = B(value_b); - // a < b + // a < b assert (!(a == b)); assert ( (a != b)); assert ( (a < b)); assert ( (a <= b)); assert (!(a > b)); assert (!(a >= b)); - + assert (!(b == a)); assert ( (b != a)); assert (!(b < a)); assert (!(b <= a)); assert ( (b > a)); - assert ( (b >= a)); + assert ( (b >= a)); value_a = 5; value_b = 2; - // a > b + // a > b a = A(value_a); b = B(value_b); assert (!(a == b)); @@ -89,7 +89,7 @@ void test_implicit_interoperable_for_real_embeddable (CGAL::Tag_true){ assert (!(a <= b)); assert ( (a > b)); assert ( (a >= b)); - + assert (!(b == a)); assert ( (b != a)); assert ( (b < a)); @@ -108,7 +108,7 @@ void test_implicit_interoperable_for_real_embeddable (CGAL::Tag_true){ assert ( (a <= b)); assert (!(a > b)); assert ( (a >= b)); - + assert ( (b == a)); assert (!(b != a)); assert (!(b < a)); @@ -119,47 +119,47 @@ void test_implicit_interoperable_for_real_embeddable (CGAL::Tag_true){ template -void test_implicit_interoperable_for_algebraic_structure +void test_implicit_interoperable_for_algebraic_structure (CGAL::Null_tag){} template -void test_implicit_interoperable_for_algebraic_structure +void test_implicit_interoperable_for_algebraic_structure (CGAL::Integral_domain_without_division_tag){ - typedef CGAL::Coercion_traits CT; - typedef typename CT::Type C; + typedef CGAL::Coercion_traits CT; + typedef typename CT::Type C; A a(6); B b(2); assert(a + b == C(8)); assert(a - b == C(4)); assert(a * b == C(12)); - + assert(b + a == C(8)); assert(b - a == C(-4)); assert(b * a == C(12)); - - C c; + + C c; c = C(4); assert((c+= A(3)) == C(7)); c = C(4); assert((c-= A(3)) == C(1)); c = C(4); assert((c*= A(3)) == C(12)); - + c = C(4); assert((c+= B(3)) == C(7)); c = C(4); assert((c-= B(3)) == C(1)); - c = C(4); assert((c*= B(3)) == C(12)); + c = C(4); assert((c*= B(3)) == C(12)); } template -void test_implicit_interoperable_for_algebraic_structure +void test_implicit_interoperable_for_algebraic_structure (CGAL::Field_tag){ test_implicit_interoperable_for_algebraic_structure (CGAL::Integral_domain_without_division_tag()); - - typedef CGAL::Coercion_traits CT; - typedef typename CT::Type C; + + typedef CGAL::Coercion_traits CT; + typedef typename CT::Type C; A a(6); B b(2); C aa = C(6); C bb = C(2); assert(a / b == C(3)); - assert(b / a == bb/aa); - C c; + assert(b / a == bb/aa); + C c; c = C(4); assert((c /= A(2)) == C(2)); c = C(4); assert((c /= B(2)) == C(2)); } @@ -188,7 +188,7 @@ class Test_integral_division { typename CGAL::Coercion_traits< A, B >::Cast cast; Type a_ret = cast(a); Type b_ret = cast(b); - assert( integral_division( a, b ) == + assert( integral_division( a, b ) == CGAL_NTS integral_division( a_ret, b_ret ) ); } }; @@ -210,7 +210,7 @@ class Test_gcd { typename CGAL::Coercion_traits< A, B >::Cast cast; Type a_ret = cast(a); Type b_ret = cast(b); - assert( gcd( a, b ) == + assert( gcd( a, b ) == CGAL_NTS gcd( a_ret, b_ret ) ); } }; @@ -260,16 +260,16 @@ class Test_div { typename CGAL::Coercion_traits< A, B >::Cast cast; Type a_ret = cast(a); Type b_ret = cast(b); - assert( div( a, b ) == + assert( div( a, b ) == CGAL_NTS div( a_ret, b_ret ) ); } }; template< class A, class B, class Type > -class Test_div< A, B, Type, CGAL::Null_functor > { +class Test_div< A, B, Type, CGAL::Null_functor > { public: // Nothing to test - void operator()(){} + void operator()(){} }; template< class A, class B, class Type, class Mod > @@ -282,7 +282,7 @@ class Test_mod { typename CGAL::Coercion_traits< A, B >::Cast cast; Type a_ret = cast(a); Type b_ret = cast(b); - assert( mod( a, b ) == + assert( mod( a, b ) == CGAL_NTS mod( a_ret, b_ret ) ); } }; @@ -301,12 +301,12 @@ template< class A, class B, class Type, class Are_implicit_interoperable > class Implicit_test_implicit_interoperable { public: void operator()() { - // enforce implicit construction from A/B to Type + // enforce implicit construction from A/B to Type // Results in 'no matching function for call to...' compile error, if type Type // is not implicit constructable from A and B (which is part of the concept) test_implicit_construction(A(1)); test_implicit_construction(B(2)); - + // test explicit construction Type test_var = Type(A(1)); test_var = Type(B(2)); @@ -321,15 +321,15 @@ class Implicit_test_implicit_interoperable { template< class A, class B, class Type > void test_implicit_interoperable_one_way() { - - typedef CGAL::Coercion_traits CT; - typedef typename CT::Type C; + + typedef CGAL::Coercion_traits CT; + typedef typename CT::Type C; typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable; CGAL_static_assertion( (::boost::is_same::value)); - assert((::boost::is_same::value)); - + assert((::boost::is_same::value)); + typename CGAL::Real_embeddable_traits::Is_real_embeddable is_real_embeddable; test_implicit_interoperable_for_real_embeddable(is_real_embeddable); typename CGAL::Algebraic_structure_traits::Algebraic_category category; @@ -338,26 +338,26 @@ void test_implicit_interoperable_one_way() { -// test for explicit interoperable types +// test for explicit interoperable types template void test_explicit_interoperable_one_way(){ typedef CGAL::Coercion_traits CT; typedef typename CT::Type Type; - typedef typename CT::Cast Cast; - typedef typename Cast::result_type result_type; + typedef typename CT::Cast Cast; + typedef typename Cast::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); CGAL_static_assertion((::boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value)); CGAL_static_assertion((::boost::is_same::value)); typename CT::Cast cast; - + A a(3); B b(3); RT rt(3); assert(rt==cast(a)); - assert(rt==cast(b)); - - // Binary Functors should support explicit interoperable types + assert(rt==cast(b)); + + // Binary Functors should support explicit interoperable types typedef typename CGAL::Algebraic_structure_traits::Integral_division Idiv; Test_integral_division< A, B, Type, Idiv>()(); typedef typename CGAL::Algebraic_structure_traits::Gcd Gcd; @@ -374,13 +374,13 @@ void test_explicit_interoperable_one_way(){ }// namespace INTERN_COERCION_TRAITS -// this test implicit interoperable -template< class A, class B, class Type > +// this test implicit interoperable +template< class A, class B, class Type > void test_implicit_interoperable() { INTERN_COERCION_TRAITS::test_implicit_interoperable_one_way< A, B, Type >(); - INTERN_COERCION_TRAITS::test_implicit_interoperable_one_way< B, A, Type >(); + INTERN_COERCION_TRAITS::test_implicit_interoperable_one_way< B, A, Type >(); INTERN_COERCION_TRAITS::test_explicit_interoperable_one_way(); - INTERN_COERCION_TRAITS::test_explicit_interoperable_one_way(); + INTERN_COERCION_TRAITS::test_explicit_interoperable_one_way(); } template< class FROM, class TO > @@ -392,9 +392,9 @@ void test_implicit_interoperable_from_to() { template void test_explicit_interoperable(){ INTERN_COERCION_TRAITS::test_explicit_interoperable_one_way(); - INTERN_COERCION_TRAITS::test_explicit_interoperable_one_way(); + INTERN_COERCION_TRAITS::test_explicit_interoperable_one_way(); } - + template void test_explicit_interoperable_from_to(){ test_explicit_interoperable(); diff --git a/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h index c6dd5b5eeed3..83f023606a09 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h @@ -27,7 +27,7 @@ namespace CGAL { template void test_fraction_traits(){ - typedef CGAL::Fraction_traits FT; + typedef CGAL::Fraction_traits FT; typedef typename FT::Type Type; typedef typename FT::Is_fraction Is_fraction; typedef typename FT::Numerator_type Num; @@ -42,18 +42,18 @@ void test_fraction_traits(){ CGAL_static_assertion(!(::boost::is_same::value)); CGAL_static_assertion(!(::boost::is_same::value)); CGAL_static_assertion(!(::boost::is_same::value)); - - + + // Decompose Type frac = Type(7) / Type (5); - Num num; + Num num; Den den; Decompose()(frac,num,den); assert(num == Num(7)); assert(den == Num(5)); assert(frac == Compose()(num,den)); - - // almost the same as gcd + + // almost the same as gcd Common_factor common_factor; assert(common_factor(Den(0),Den(0)) == Den(0)); assert(common_factor(Den(1),Den(0)) == Den(1)); @@ -62,7 +62,7 @@ void test_fraction_traits(){ assert(common_factor(Den(12),Den(15)) == Den(3)); assert(common_factor(Den(-12),Den(15)) == Den(3)); assert(common_factor(Den(12),Den(-15)) == Den(3)); - assert(common_factor(Den(-12),Den(-15)) == Den(3)); + assert(common_factor(Den(-12),Den(-15)) == Den(3)); } } //namespace CGAL diff --git a/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h index b629a8583b99..0c1b06a9fff1 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h @@ -26,11 +26,11 @@ namespace CGAL { template void test_rational_traits(){ Rational x = Rational(7)/Rational(2); - + typedef Rational_traits Rational_traits; typedef typename Rational_traits::RT RT; CGAL_static_assertion((::boost::is_same::value)); - + assert( Rational_traits().numerator(x) == RT(7)); assert( Rational_traits().denominator(x) == RT(2)); assert( Rational_traits().make_rational(RT(7),RT(2)) == x); @@ -39,7 +39,7 @@ void test_rational_traits(){ assert( Rational_traits().make_rational(std::make_pair(x,x)) == Rational(1)); assert( Rational_traits().make_rational(std::make_pair(7,RT(2))) == x); - // gloabal function to_rational + // gloabal function to_rational x = CGAL::to_rational(3.5); assert( x == Rational(7)/Rational(2)); } diff --git a/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h b/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h index 19a7af494cbf..b7d68a0b7ffd 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h @@ -35,7 +35,7 @@ typedef typename RET::Is_zero Is_zero; \ typedef typename RET::Compare Compare; \ typedef typename RET::To_double To_double; \ - typedef typename RET::To_interval To_interval; + typedef typename RET::To_interval To_interval; #ifndef CGAL_TEST_REAL_EMBEDDABLE_H #define CGAL_TEST_REAL_EMBEDDABLE_H @@ -63,7 +63,7 @@ namespace CGAL { CGAL_error_msg("To_double functor not implemented"); } }; - + template class Test_to_interval { public: @@ -83,31 +83,31 @@ namespace CGAL { assert(to_interval(Type(42)).first > 41.99); assert(to_interval(Type(42)).second < 42.01); - - // test neagtive numbers as well to catch obvious sign - // errors - assert( -42.0 >= to_interval( -Type(42) ).first ); + + // test neagtive numbers as well to catch obvious sign + // errors + assert( -42.0 >= to_interval( -Type(42) ).first ); assert( -42.0 <= to_interval( -Type(42) ).second ); assert(to_interval(-Type(42)).first < -41.99); assert(to_interval(-Type(42)).second > -42.01); - - /* - Type notdouble = ipower(2,60); + + /* + Type notdouble = ipower(2,60); notdouble = notdouble + Type(1); Interval test = to_Interval(notdouble); double lower = ipower(2.0,60); double upper = ipower(2.0,53); upper++; upper *= ipower(2.0,7); - std::cout << lower << "," << upper << std::endl; - std::cout << test.lower() << "," << test.upper() << std::endl; + std::cout << lower << "," << upper << std::endl; + std::cout << test.lower() << "," << test.upper() << std::endl; assert( (in(lower,test) == true) && (in(upper,test) == true) ); */ } }; - + template< class Type > class Test_to_interval< Type, CGAL::Null_tag> { public: @@ -119,12 +119,12 @@ namespace CGAL { // Several libraries do not want to enforce the use of std::min/max // for the case that there is a special function for min/max -// However, this may be a problem for template CGAL::min/max in case NT is a -// CGAL type. These types have to overload CGAL::min/max. +// However, this may be a problem for template CGAL::min/max in case NT is a +// CGAL type. These types have to overload CGAL::min/max. template void test_min_max(){ using std:: min BOOST_PREVENT_MACRO_SUBSTITUTION ; - using std:: max BOOST_PREVENT_MACRO_SUBSTITUTION ; + using std:: max BOOST_PREVENT_MACRO_SUBSTITUTION ; NT x(1),y(2); assert(min BOOST_PREVENT_MACRO_SUBSTITUTION (x,y)==NT(1)); assert(max BOOST_PREVENT_MACRO_SUBSTITUTION (x,y)==NT(2)); @@ -133,8 +133,8 @@ void test_min_max(){ //! tests if \c Type is a model for the \c RealComparable concept //! and terminates the program with an error message if not. template -void test_real_embeddable() { - test_min_max(); +void test_real_embeddable() { + test_min_max(); typedef CGAL::Real_embeddable_traits RET; CGAL_SNAP_RET_FUNCTORS(RET); typedef typename RET::Is_real_embeddable Is_real_embeddable; @@ -157,10 +157,10 @@ void test_real_embeddable() { assert(Boolean() == bool()); assert(Sign() == CGAL::Sign()); assert(Comparison_result() == CGAL::Comparison_result()); - + typename RET::Compare compare; const Sgn sign = Sgn(); - const Abs abs=Abs(); + const Abs abs=Abs(); const Is_finite is_finite=Is_finite(); const Is_positive is_positive=Is_positive(); const Is_negative is_negative=Is_negative(); @@ -180,7 +180,7 @@ void test_real_embeddable() { assert( !is_negative(c) ); assert( !is_zero(a) ); assert( !is_zero(b) ); - assert( is_zero(c) ); + assert( is_zero(c) ); assert( a < b); assert( b > a); assert( a <= b); @@ -202,7 +202,7 @@ void test_real_embeddable() { assert( sign(c) < sign(b)); assert( sign(b) > sign(c)); assert( sign(c) <= sign(b)); - assert( sign(b) >= sign(c)); + assert( sign(b) >= sign(c)); assert( sign(c) <= sign(c)); assert( sign(c) >= sign(c)); assert( sign(a) < sign(c)); @@ -211,21 +211,21 @@ void test_real_embeddable() { assert( sign(c) >= sign(a)); assert( abs(a) == Type(2)); assert( abs(b) == Type(1)); - assert( abs(c) == Type(0)); - + assert( abs(c) == Type(0)); + // To_double -------------------------------------------------------------- const To_double to_double = To_double(); (void)to_double; Test_to_double ttd; ttd(to_double); - + // To_Interval ------------------------------------------------------------ const To_interval to_interval = To_interval(); (void)to_interval; Test_to_interval tti; tti(to_interval); - - // additional functions + + // additional functions assert( CGAL_NTS is_finite( Type(1) ) ); assert( CGAL_NTS sign(Type(-5))==CGAL::NEGATIVE); assert( CGAL_NTS abs(Type(-5))==Type(5)); @@ -238,8 +238,8 @@ void test_real_embeddable() { } -//! tests if \c Type says it is not a model for the \c RealComparable -//! concept and terminates the program with an error message if it +//! tests if \c Type says it is not a model for the \c RealComparable +//! concept and terminates the program with an error message if it //! actually is. template void test_not_real_embeddable() { diff --git a/Algebraic_foundations/include/CGAL/ipower.h b/Algebraic_foundations/include/CGAL/ipower.h index 273b52444754..09c9521f25b5 100644 --- a/Algebraic_foundations/include/CGAL/ipower.h +++ b/Algebraic_foundations/include/CGAL/ipower.h @@ -6,9 +6,9 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Michael Hemmer +// +// Author(s) : Michael Hemmer // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -27,15 +27,15 @@ inline NT ipower(const NT& base, int expn) { // compute base^expn using square-and-multiply CGAL_precondition(expn >= 0); - + // handle trivial cases efficiently if (expn == 0) return NT(1); if (expn == 1) return base; - + // find the most significant non-zero bit of expn int e = expn, msb = 0; while (e >>= 1) msb++; - + // computing base^expn by square-and-multiply NT res = base; int b = 1<= 0); - + // handle trivial cases efficiently if (expn == 0) return NT(1); if (expn == 1) return base; - + // find the most significant non-zero bit of expn long e = expn, msb = 0; while (e >>= 1) msb++; - + // computing base^expn by square-and-multiply NT res = base; long b = 1L< -inline +inline void simplify( AS& x ) { typename Algebraic_structure_traits< AS >::Simplify simplify; @@ -46,8 +46,8 @@ unit_part( const AS& x ) { template< class AS > inline typename Algebraic_structure_traits< AS >::Is_square::result_type -is_square( const AS& x, - typename Algebraic_structure_traits< AS >::Is_square::second_argument_type y ) +is_square( const AS& x, + typename Algebraic_structure_traits< AS >::Is_square::second_argument_type y ) { typename Algebraic_structure_traits< AS >::Is_square is_square; return is_square( x, y ); @@ -80,7 +80,7 @@ inverse( const AS& x ) { } template< class AS > -inline +inline typename Algebraic_structure_traits::Is_one::result_type is_one( const AS& x ) { typename Algebraic_structure_traits< AS >::Is_one is_one; @@ -103,14 +103,14 @@ typename Algebraic_structure_traits< typename Coercion_traits::Type> ::Integral_division::result_type integral_division( const A& x, const B& y ) { typedef typename Coercion_traits::Type Type; - typename Algebraic_structure_traits< Type >::Integral_division + typename Algebraic_structure_traits< Type >::Integral_division integral_division; return integral_division( x, y ); } template< class A, class B > inline -typename Algebraic_structure_traits< typename Coercion_traits::Type> +typename Algebraic_structure_traits< typename Coercion_traits::Type> ::Divides::result_type divides( const A& x, const B& y ) { typedef typename Coercion_traits::Type Type; @@ -157,26 +157,26 @@ div( const A& x, const B& y ) { } template< class A, class B > -inline +inline void -div_mod( +div_mod( const A& x, const B& y, - typename Coercion_traits::Type& q, + typename Coercion_traits::Type& q, typename Coercion_traits::Type& r ) { typedef typename Coercion_traits::Type Type; typename Algebraic_structure_traits< Type >::Div_mod div_mod; div_mod( x, y, q, r ); } -// others +// others template< class AS > inline typename Algebraic_structure_traits< AS >::Kth_root::result_type kth_root( int k, const AS& x ) { typename Algebraic_structure_traits< AS >::Kth_root kth_root; - return kth_root( k, x ); + return kth_root( k, x ); } @@ -185,15 +185,15 @@ inline typename Algebraic_structure_traits< typename std::iterator_traits::value_type > ::Root_of::result_type root_of( int k, Input_iterator begin, Input_iterator end ) { - typedef typename std::iterator_traits::value_type AS; + typedef typename std::iterator_traits::value_type AS; return typename Algebraic_structure_traits::Root_of()( k, begin, end ); } // AST- and RET-functor adapting function template< class Number_type > -inline +inline // select a Is_zero functor -typename boost::mpl::if_c< +typename boost::mpl::if_c< ::boost::is_same< typename Algebraic_structure_traits< Number_type >::Is_zero, Null_functor >::value , typename Real_embeddable_traits< Number_type >::Is_zero, @@ -202,43 +202,43 @@ typename boost::mpl::if_c< is_zero( const Number_type& x ) { // We take the Algebraic_structure_traits<>::Is_zero functor by default. If it // is not available, we take the Real_embeddable_traits functor - typename ::boost::mpl::if_c< + typename ::boost::mpl::if_c< ::boost::is_same< typename Algebraic_structure_traits< Number_type >::Is_zero, Null_functor >::value , typename Real_embeddable_traits< Number_type >::Is_zero, typename Algebraic_structure_traits< Number_type >::Is_zero >::type is_zero; -return is_zero( x ); +return is_zero( x ); } template inline typename Real_embeddable_traits< typename Coercion_traits::Type > -::Compare::result_type +::Compare::result_type compare(const A& a, const B& b) -{ +{ typedef typename Coercion_traits::Type Type; typename Real_embeddable_traits::Compare compare; return compare (a,b); - // return (a < b) ? SMALLER : (b < a) ? LARGER : EQUAL; + // return (a < b) ? SMALLER : (b < a) ? LARGER : EQUAL; } // RET-Functor adapting functions template< class Real_embeddable > -inline -//Real_embeddable -typename Real_embeddable_traits< Real_embeddable >::Abs::result_type +inline +//Real_embeddable +typename Real_embeddable_traits< Real_embeddable >::Abs::result_type abs( const Real_embeddable& x ) { typename Real_embeddable_traits< Real_embeddable >::Abs abs; return abs( x ); } template< class Real_embeddable > -inline -//::Sign +inline +//::Sign typename Real_embeddable_traits< Real_embeddable >::Sgn::result_type sign( const Real_embeddable& x ) { typename Real_embeddable_traits< Real_embeddable >::Sgn sgn; @@ -246,7 +246,7 @@ sign( const Real_embeddable& x ) { } template< class Real_embeddable > -inline +inline //bool typename Real_embeddable_traits< Real_embeddable >::Is_finite::result_type is_finite( const Real_embeddable& x ) { @@ -254,10 +254,10 @@ is_finite( const Real_embeddable& x ) { } template< class Real_embeddable > -inline +inline typename Real_embeddable_traits< Real_embeddable >::Is_positive::result_type is_positive( const Real_embeddable& x ) { - typename Real_embeddable_traits< Real_embeddable >::Is_positive + typename Real_embeddable_traits< Real_embeddable >::Is_positive is_positive; return is_positive( x ); } @@ -287,7 +287,7 @@ inline typename Real_embeddable_traits< Real_embeddable >::To_double::result_type //double to_double( const Real_embeddable& x ) { - typename Real_embeddable_traits< Real_embeddable >::To_double to_double; + typename Real_embeddable_traits< Real_embeddable >::To_double to_double; return to_double( x ); } @@ -296,7 +296,7 @@ inline typename Real_embeddable_traits< Real_embeddable >::To_interval::result_type //std::pair< double, double > to_interval( const Real_embeddable& x) { - typename Real_embeddable_traits< Real_embeddable >::To_interval + typename Real_embeddable_traits< Real_embeddable >::To_interval to_interval; return to_interval( x ); } diff --git a/Algebraic_foundations/include/CGAL/number_utils_classes.h b/Algebraic_foundations/include/CGAL/number_utils_classes.h index 1dadb83092f5..22b55a21de0a 100644 --- a/Algebraic_foundations/include/CGAL/number_utils_classes.h +++ b/Algebraic_foundations/include/CGAL/number_utils_classes.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hoffmann // : Michael Hemmer @@ -70,10 +70,10 @@ struct Gcd : Algebraic_structure_traits::Gcd{}; template < class NT > struct Is_one : Algebraic_structure_traits::Is_one {}; -// This is due to the fact that Is_zero may be provided by +// This is due to the fact that Is_zero may be provided by // Algebraic_structure_traits as well as Real_embeddable_traits -// Of course it is not possible to derive from both since this -// would cause an ambiguity. +// Of course it is not possible to derive from both since this +// would cause an ambiguity. namespace internal{ template struct Is_zero_base : AST_Is_zero {} ; @@ -81,13 +81,13 @@ template struct Is_zero_base : RET_Is_zero {} ; } // namespace internal template < class NT > -struct Is_zero : +struct Is_zero : internal::Is_zero_base ::Is_zero, - typename Real_embeddable_traits::Is_zero>{}; + typename Real_embeddable_traits::Is_zero>{}; -// This is due to the fact that CGAL::Compare is used for other +// This is due to the fact that CGAL::Compare is used for other // non-realembeddable types as well. // In this case we try to provide a default implementation namespace internal { @@ -99,7 +99,7 @@ template struct Compare_base if (x < y) return SMALLER; if (x > y) return LARGER; CGAL_postcondition(x == y); - return EQUAL; + return EQUAL; } }; } // namespace internal diff --git a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp index f974955819a0..9b7b93240946 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp @@ -6,17 +6,17 @@ int main(){ { typedef CGAL::Algebraic_extension_traits AET; - + typedef AET::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); typedef AET::Is_extended Is_extended; CGAL_USE_TYPE(Is_extended); CGAL_static_assertion( (::boost::is_same::value)); - - typedef AET::Normalization_factor Normalization_factor; + + typedef AET::Normalization_factor Normalization_factor; { typedef Normalization_factor::argument_type argument_type; CGAL_USE_TYPE(argument_type); @@ -27,7 +27,7 @@ int main(){ Normalization_factor nfac; assert(nfac(3)==1); } - typedef AET::Denominator_for_algebraic_integers DFAI; + typedef AET::Denominator_for_algebraic_integers DFAI; { typedef DFAI::argument_type argument_type; CGAL_USE_TYPE(argument_type); @@ -40,19 +40,19 @@ int main(){ } } { - typedef CGAL::Sqrt_extension EXT; + typedef CGAL::Sqrt_extension EXT; typedef CGAL::Algebraic_extension_traits AET; - + typedef AET::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); typedef AET::Is_extended Is_extended; CGAL_USE_TYPE(Is_extended); CGAL_static_assertion( (::boost::is_same::value)); - - typedef AET::Normalization_factor Normalization_factor; + + typedef AET::Normalization_factor Normalization_factor; { typedef Normalization_factor::argument_type argument_type; CGAL_USE_TYPE(argument_type); @@ -65,7 +65,7 @@ int main(){ assert(nfac(EXT(3,0,5))==1); assert(nfac(EXT(3,1,5))==EXT(3,-1,5)); } - typedef AET::Denominator_for_algebraic_integers DFAI; + typedef AET::Denominator_for_algebraic_integers DFAI; { typedef DFAI::argument_type argument_type; CGAL_USE_TYPE(argument_type); diff --git a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp index 28f3d1f19e4d..a16b9f2ee006 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp @@ -9,40 +9,40 @@ CGAL_USE_TYPE(NAME); \ CGAL_static_assertion( \ (::boost::is_same::value)); \ - } + } int main(){ typedef CGAL::Algebraic_structure_traits AST; - + typedef AST::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); typedef AST::Algebraic_category Algebraic_category; CGAL_USE_TYPE(Algebraic_category); CGAL_static_assertion( - (::boost::is_same::value)); + (::boost::is_same::value)); typedef AST::Is_exact Is_exact; CGAL_USE_TYPE(Is_exact); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); typedef AST::Is_numerical_sensitive Is_sensitive; CGAL_USE_TYPE(Is_sensitive); - CGAL_static_assertion((::boost::is_same::value)); - + CGAL_static_assertion((::boost::is_same::value)); + CGAL_IS_AST_NULL_FUNCTOR ( Simplify); CGAL_IS_AST_NULL_FUNCTOR ( Unit_part); CGAL_IS_AST_NULL_FUNCTOR ( Integral_division); CGAL_IS_AST_NULL_FUNCTOR ( Divides); - CGAL_IS_AST_NULL_FUNCTOR ( Is_square); + CGAL_IS_AST_NULL_FUNCTOR ( Is_square); CGAL_IS_AST_NULL_FUNCTOR ( Gcd); CGAL_IS_AST_NULL_FUNCTOR ( Div_mod); CGAL_IS_AST_NULL_FUNCTOR ( Div); CGAL_IS_AST_NULL_FUNCTOR ( Mod); CGAL_IS_AST_NULL_FUNCTOR ( Square); CGAL_IS_AST_NULL_FUNCTOR ( Is_zero); - CGAL_IS_AST_NULL_FUNCTOR ( Is_one); + CGAL_IS_AST_NULL_FUNCTOR ( Is_one); CGAL_IS_AST_NULL_FUNCTOR ( Sqrt); CGAL_IS_AST_NULL_FUNCTOR ( Kth_root); - CGAL_IS_AST_NULL_FUNCTOR ( Root_of); + CGAL_IS_AST_NULL_FUNCTOR ( Root_of); } diff --git a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt index 9b3ee11b5e7e..682fa668f93d 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp index ebbb70c9f4a7..d1a8b19c9f41 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp @@ -7,7 +7,7 @@ // // ---------------------------------------------------------------------------- // -// Library : CGAL +// Library : CGAL // File : test/Chinese_remaminder_traits.cpp // CGAL_release : $Name: $ // Revision : $Revision$ @@ -35,98 +35,98 @@ //#define WITH_OUTPUT 1 template -struct Get_max_coefficient{ - typedef NT result_type; - result_type operator () (const NT& a) { +struct Get_max_coefficient{ + typedef NT result_type; + result_type operator () (const NT& a) { return CGAL::abs(a); } }; template -struct Get_max_coefficient >{ +struct Get_max_coefficient >{ typedef Get_max_coefficient GMC; typedef typename GMC::result_type result_type; - - result_type operator () (const CGAL::Sqrt_extension& a) { + + result_type operator () (const CGAL::Sqrt_extension& a) { GMC gmc; - return (std::max)((std::max)(gmc(a.a0()), gmc(a.a1())), gmc(NT(a.root()))); + return (std::max)((std::max)(gmc(a.a0()), gmc(a.a1())), gmc(NT(a.root()))); } }; template -struct Get_max_coefficient >{ +struct Get_max_coefficient >{ typedef Get_max_coefficient GMC; typedef typename GMC::result_type result_type; - - result_type operator () (const CGAL::Polynomial& a) { + + result_type operator () (const CGAL::Polynomial& a) { GMC gmc; result_type m=0; for(int i=0; i<=a.degree(); i++){ m = (std::max)(gmc(a[i]),m); } - return m; + return m; } }; template void test_CR_for(const NT& f){ - + // Enforce IEEE double precision before using modular arithmetic CGAL::Set_ieee_double_precision pfr; - + typedef CGAL::Modular_traits MT; CGAL_USE_TYPE(typename CGAL::Modular_traits::Residue_type); typename MT::Modular_image modular_image; - typename MT::Modular_image_representative modular_image_representative; - + typename MT::Modular_image_representative modular_image_representative; + - typedef CGAL::Chinese_remainder_traits CRT; - typedef typename CRT::Scalar_type Scalar_type; + typedef CGAL::Chinese_remainder_traits CRT; + typedef typename CRT::Scalar_type Scalar_type; typename CRT::Chinese_remainder chinese_remainder; - + Scalar_type max_coeff = Get_max_coefficient()(f); - + NT g, g_old; Scalar_type p,q,pq; - + int prime_index, current_prime; bool test = true; prime_index = 0; - + // init chinese remainder q = current_prime = CGAL::internal::primes[prime_index]; - CGAL::Residue::set_current_prime(current_prime); + CGAL::Residue::set_current_prime(current_prime); g_old = modular_image_representative(modular_image(f)); pq= p = q; - - + + // try chinese remainder do{ - // chinese remainder failed if q > 2*max_coeff(f) + // chinese remainder failed if q > 2*max_coeff(f) CGAL_postcondition_msg(pq < p*(2*max_coeff), " chinese remainder failed "); - + prime_index++; if(prime_index < 1000){ - current_prime = CGAL::internal::primes[prime_index]; + current_prime = CGAL::internal::primes[prime_index]; } else{ std::cerr<<"primes in the array exhausted"< void test_CR() { - typedef typename AT::Integer Integer; + typedef typename AT::Integer Integer; typedef CGAL::Sqrt_extension EXT; typedef CGAL::Polynomial Poly; test_CR_for(Integer("13472398473248763214987")); test_CR_for(EXT( - Integer("13472398473248763214987"), - Integer("43857430987524589"), + Integer("13472398473248763214987"), + Integer("43857430987524589"), Integer("84397984359843"))); test_CR_for(EXT( - Integer("13472398473248763214987"), - Integer("0"), + Integer("13472398473248763214987"), + Integer("0"), Integer("84397984359843"))); test_CR_for(Poly( - Integer("13472398473248763214987"), - Integer("-43857430987524589"), + Integer("13472398473248763214987"), + Integer("-43857430987524589"), Integer("84397984359843"))); } int main(){ - + #ifdef CGAL_USE_LEDA test_CR(); -#endif // CGAL_USE_LEDA +#endif // CGAL_USE_LEDA -#ifdef CGAL_USE_CORE +#ifdef CGAL_USE_CORE test_CR(); #endif // CGAL_USE_CORE - + return 0; } diff --git a/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp index f9d27b8640bd..2ccdb398cb13 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp @@ -12,7 +12,7 @@ int main(){ CGAL_static_assertion( ( boost::is_same::value)); assert( 5 == CT::Cast()(5)); - } + } { typedef CGAL::Coercion_traits CT; CGAL_USE_TYPE(CT); @@ -23,5 +23,5 @@ int main(){ ( boost::is_same::value)); CGAL_static_assertion( ( boost::is_same::value)); - } + } } diff --git a/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp index 721b6cb81c7d..0620710c2efe 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp @@ -9,19 +9,19 @@ CGAL_USE_TYPE(NAME); \ CGAL_static_assertion( \ (::boost::is_same::value)); \ - } + } int main(){ typedef CGAL::Real_embeddable_traits RET; - + typedef RET::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); typedef RET::Is_real_embeddable Is_real_embeddable; CGAL_USE_TYPE(Is_real_embeddable); - CGAL_static_assertion((::boost::is_same::value)); - + CGAL_static_assertion((::boost::is_same::value)); + CGAL_IS_RET_NULL_FUNCTOR(Abs); CGAL_IS_RET_NULL_FUNCTOR(Sgn); CGAL_IS_RET_NULL_FUNCTOR(Is_finite); diff --git a/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp index a67651684e86..77b35fa66f0b 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp @@ -7,15 +7,15 @@ int main(){ typedef CGAL::Scalar_factor_traits SFT; CGAL_USE_TYPE(SFT); - CGAL_static_assertion((::boost::is_same::value)); + CGAL_static_assertion((::boost::is_same::value)); CGAL_static_assertion((::boost::is_same::value)); - + typedef SFT::Scalar_factor Scalar_factor; { typedef Scalar_factor::result_type result_type; CGAL_USE_TYPE(result_type); CGAL_static_assertion((::boost::is_same::value)); - + typedef Scalar_factor::argument_type argument_type; CGAL_USE_TYPE(argument_type); CGAL_static_assertion((::boost::is_same::value)); @@ -25,7 +25,7 @@ int main(){ typedef Scalar_div::result_type result_type; CGAL_USE_TYPE(result_type); CGAL_static_assertion((::boost::is_same::value)); - + typedef Scalar_div::first_argument_type first_argument_type; CGAL_USE_TYPE(first_argument_type); CGAL_static_assertion( @@ -36,7 +36,7 @@ int main(){ (::boost::is_same::value)); } - int i; + int i; i = 0 ; CGAL::remove_scalar_factor(i); assert( 0 == i); i = 1 ; CGAL::remove_scalar_factor(i); assert( 1 == i); i = 2 ; CGAL::remove_scalar_factor(i); assert( 1 == i); diff --git a/Algebraic_foundations/test/Algebraic_foundations/extended_euclidean_algorithm.cpp b/Algebraic_foundations/test/Algebraic_foundations/extended_euclidean_algorithm.cpp index 4c387f9bafbb..0ca7a7d8477c 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/extended_euclidean_algorithm.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/extended_euclidean_algorithm.cpp @@ -20,7 +20,7 @@ template void test_extended_euclidean_algorithm() { - Integer a, b, e, u, v; + Integer a, b, e, u, v; // common factor is 2 a = Integer(1008); @@ -54,15 +54,15 @@ void test_extended_euclidean_algorithm() { assert(Integer(1) == e); assert(e == a*u + b*v); - // special cases + // special cases // common factor is 1 a = Integer(17); b = Integer(13); e = CGAL::extended_euclidean_algorithm(a, b,u ,v ); assert(Integer(1) == e); assert(e == a*u + b*v); - - // one number is 0 + + // one number is 0 a = Integer(0); b = Integer(13); e = CGAL::extended_euclidean_algorithm(a, b,u ,v ); @@ -84,7 +84,7 @@ void test_extended_euclidean_algorithm() { } int main(){ - test_extended_euclidean_algorithm(); + test_extended_euclidean_algorithm(); return 0; } diff --git a/Algebraic_foundations/test/Algebraic_foundations/ipower.cpp b/Algebraic_foundations/test/Algebraic_foundations/ipower.cpp index e7d9477d99e5..dd1fa10004a6 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/ipower.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/ipower.cpp @@ -38,8 +38,8 @@ void test_ipower() { } int main(){ - test_ipower(); + test_ipower(); return 0; } -// EOF +// EOF diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt index d6082d26967c..a14af4da5c68 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt @@ -1,7 +1,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_Algebraic_Kernel \anchor chapteralgebraickerneld \cgalAutoToc @@ -9,13 +9,13 @@ namespace CGAL { \section Algebraic_kernel_dIntroduction Introduction -Real solving of polynomials is a fundamental problem with a wide application range. -This package is targeted at providing black-box implementations of state-of-the-art +Real solving of polynomials is a fundamental problem with a wide application range. +This package is targeted at providing black-box implementations of state-of-the-art algorithms to determine, compare, and approximate real roots of univariate polynomials -and bivariate polynomial systems. Such a black-box is called an *Algebraic Kernel*. -Since this package is aimed at providing more than one implementation, the interface of -the algebraic kernels is expressed in concepts. The main concepts provided by this package are the -`AlgebraicKernel_d_1` for univariate polynomial systems and `AlgebraicKernel_d_2` +and bivariate polynomial systems. Such a black-box is called an *Algebraic Kernel*. +Since this package is aimed at providing more than one implementation, the interface of +the algebraic kernels is expressed in concepts. The main concepts provided by this package are the +`AlgebraicKernel_d_1` for univariate polynomial systems and `AlgebraicKernel_d_2` for bivariate polynomial systems, the latter being a refinement of the first. \section Algebraic_kernel_dAlgebraic Algebraic Kernel Concepts @@ -24,18 +24,18 @@ for bivariate polynomial systems, the latter being a refinement of the first. \subsection Algebraic_kernel_dMajorTypes Major Types -First of all, the univariate algebraic kernel provides construction, comparison and -approximation of real roots of univariate polynomials. -Thus, the major public types the `AlgebraicKernel_d_1` provides are: +First of all, the univariate algebraic kernel provides construction, comparison and +approximation of real roots of univariate polynomials. +Thus, the major public types the `AlgebraicKernel_d_1` provides are: `AlgebraicKernel_d_1::Polynomial_1` - the type representing univariate polynomials, -`AlgebraicKernel_d_1::Coefficient` - the coefficient type of these polynomials, +`AlgebraicKernel_d_1::Coefficient` - the coefficient type of these polynomials, `AlgebraicKernel_d_1::Algebraic_real_1` - the type representing real roots, -`AlgebraicKernel_d_1::Bound` - the type which is used to approximate these algebraic reals, -in particular, it is used to represent the boundaries of isolating intervals. +`AlgebraicKernel_d_1::Bound` - the type which is used to approximate these algebraic reals, +in particular, it is used to represent the boundaries of isolating intervals. \subsection Algebraic_kernel_dConstructionofAlgebraic Construction of Algebraic Real Numbers @@ -64,22 +64,22 @@ comparison with int, the coefficient type and the bound type. There are several ways to approximate an `AlgebraicKernel_d_1::Algebraic_real_1`: -`AlgebraicKernel_d_1::Approximate_absolute_1` - provides an approximation that is +`AlgebraicKernel_d_1::Approximate_absolute_1` - provides an approximation that is better than the passed absolute error bound, -`AlgebraicKernel_d_1::Approximate_relative_1` - provides an approximation that is +`AlgebraicKernel_d_1::Approximate_relative_1` - provides an approximation that is better than the passed relative error bound, -`AlgebraicKernel_d_1::Isolate_1` - returns an isolating interval with respect to +`AlgebraicKernel_d_1::Isolate_1` - returns an isolating interval with respect to a given univariate polynomial, -A related function object is `AlgebraicKernel_d_1::Bound_between_1`, which computes +A related function object is `AlgebraicKernel_d_1::Bound_between_1`, which computes a number that isolates two algebraic real numbers. \subsection Algebraic_kernel_dInterplaywithPolynomials Interplay with Polynomials It is also possible to retrieve a representing polynomial from an -algebraic real using `AlgebraicKernel_d_1::Compute_polynomial_1`, +algebraic real using `AlgebraicKernel_d_1::Compute_polynomial_1`, which guarantees that the algebraic real is a root of the returned polynomial. As the name already indicates, this operation may be very costly since the polynomial may not be computed yet. Moreover, it is @@ -116,17 +116,17 @@ provides several function objects to handle polynomials: `AlgebraicKernel_d_1::Make_coprime_1` - decomposes two polynomials into the coprime factors and their common factor. -Though the polynomial package provides similar functionality we suggest to use -the function objects provided by the kernel, since the design of the algebraic kernel +Though the polynomial package provides similar functionality we suggest to use +the function objects provided by the kernel, since the design of the algebraic kernel allows for instance internal caching by the kernel. -Also note that `AlgebraicKernel_d_1::Square_free_factorize_1` only computes the square free -factorization up to a constant factor. This is a slight modification with respect to its -counterpart in `Polynomial_traits_d`. In this way it was possible that the concepts just require -the coefficient type to be a model of `IntegralDomain`, instead of `Field` or `UniqueFactorizationDomain`. +Also note that `AlgebraicKernel_d_1::Square_free_factorize_1` only computes the square free +factorization up to a constant factor. This is a slight modification with respect to its +counterpart in `Polynomial_traits_d`. In this way it was possible that the concepts just require +the coefficient type to be a model of `IntegralDomain`, instead of `Field` or `UniqueFactorizationDomain`. For more details see also: -- \ref PolynomialTraits_d::SquareFreeFactorize +- \ref PolynomialTraits_d::SquareFreeFactorize - \ref PolynomialTraits_d::SquareFreeFactorizeUpToConstantFactor \subsection Algebraic_kernel_dDesignRationale Design Rationale @@ -142,7 +142,7 @@ one can also imagine the representation by a polynomial and the index of the root, e.g., as the \f$ i\f$th real root when enumerated from minus to plus infinity. Moreover, it may very well be that the kernel just computes an approximation of the number, whereas the representing -polynomial is not computed yet. +polynomial is not computed yet. This is in particular relevant in relation to the `AlgebraicKernel_d_2`, where `AlgebraicKernel_d_1::Algebraic_real_1` is used to represent coordinates of solutions of bivariate systems. Hence, the design does @@ -156,10 +156,10 @@ an `AlgebraicKernel_d_1::Algebraic_real_1`. \subsection Algebraic_kernel_dBivariateAlgebraicKernel Bivariate Algebraic Kernel -The concept `AlgebraicKernel_d_2` is a refinement of `AlgebraicKernel_d_1`, -that is, a model of `AlgebraicKernel_d_2` is also a model of `AlgebraicKernel_d_1`. -Hence, the `AlgebraicKernel_d_2` concept is designed such that occurring -names and functionalities are as similar as possible to those in the +The concept `AlgebraicKernel_d_2` is a refinement of `AlgebraicKernel_d_1`, +that is, a model of `AlgebraicKernel_d_2` is also a model of `AlgebraicKernel_d_1`. +Hence, the `AlgebraicKernel_d_2` concept is designed such that occurring +names and functionalities are as similar as possible to those in the `AlgebraicKernel_d_1` concept. The following are a direct generalization of their univariate counterparts: @@ -192,22 +192,22 @@ The following are a direct generalization of their univariate counterparts: `AlgebraicKernel_d_2::Is_zero_at_2`. For instance, `AlgebraicKernel_d_2::Solve_2` -provides the solution for a bivariate polynomial system. -However, it is also possible to obtain the coordinates of these +provides the solution for a bivariate polynomial system. +However, it is also possible to obtain the coordinates of these solutions with the additional functors: `AlgebraicKernel_d_2::Compute_x_2`, `AlgebraicKernel_d_2::Compute_y_2`. -In principal this would be sufficient generalization, -since functions such as isolating, approximating algebraic real numbers -could be implemented using these access functions ant -the corresponding functionalities in the univariate algebraic kernel. +In principal this would be sufficient generalization, +since functions such as isolating, approximating algebraic real numbers +could be implemented using these access functions ant +the corresponding functionalities in the univariate algebraic kernel. However, one should be aware that an `AlgebraicKernel_d_2::Algebraic_real_2` -is not necessarily represented as a pair of univariate solutions, that is, -using `AlgebraicKernel_d_2::Compute_y_2` may entail considerable -computations. Therefore, the concept also requires the following +is not necessarily represented as a pair of univariate solutions, that is, +using `AlgebraicKernel_d_2::Compute_y_2` may entail considerable +computations. Therefore, the concept also requires the following additional functors that may allow a model to bypass this issue: `AlgebraicKernel_d_2::Compute_polynomial_x_2`, @@ -238,33 +238,33 @@ additional functors that may allow a model to bypass this issue: \subsection Algebraic_kernel_dGenericAlgebraicKernels Generic Algebraic Kernels -The package provides generic models of the univariate and bivariate algebraic +The package provides generic models of the univariate and bivariate algebraic kernel, namely `Algebraic_kernel_d_1` and `Algebraic_kernel_d_2`, -respectively. Both kernels support a large set of number types as their -template argument, which defines the supported coefficient type. The supported +respectively. Both kernels support a large set of number types as their +template argument, which defines the supported coefficient type. The supported types are, for instance, `Gmpz` and `Gmpq` as well as the corresponding types of LEDA and CORE. -The `Algebraic_kernel_d_1` represents an algebraic real root by a square -free polynomial and an isolating interval that uniquely defines the root. +The `Algebraic_kernel_d_1` represents an algebraic real root by a square +free polynomial and an isolating interval that uniquely defines the root. The current method to isolate roots is the Bitstream Descartes -method \cgalCite{eigenwillig-phd-08}. -The used method to refine the approximation of an algebraic real root is a -slightly modified (filtered) version of the one presented in \cgalCite{abbott-qir-06}. +method \cgalCite{eigenwillig-phd-08}. +The used method to refine the approximation of an algebraic real root is a +slightly modified (filtered) version of the one presented in \cgalCite{abbott-qir-06}. The method has quadratic convergence. -`Algebraic_kernel_d_2` is based on an algorithm computing a +`Algebraic_kernel_d_2` is based on an algorithm computing a geometric-topological analysis of a single curve \cgalCite{ekw-fast-07} and of a pair of curves \cgalCite{ek-exact-08}. The main idea behind both analyses is to compute the critical x-coordinates of curves and curve pairs by projection (resultants), and compute additional information about the critical fibers using subresultants -and Sturm-Habicht sequences \cgalCite{grlr-sturm-habicht-98}. -With that information, the fiber at +and Sturm-Habicht sequences \cgalCite{grlr-sturm-habicht-98}. +With that information, the fiber at critical x-coordinates is computed by a variant of the Bitstream Descartes method. See also \cgalCite{kerber-phd-09} for a comprehensive description of -these techniques. +these techniques. Almost all functors in the class that take a `Polynomial_2` object as argument trigger such an analysis as a main computation step. For efficiency, these analyses (of single curves and curve @@ -278,17 +278,17 @@ by its \f$ x\f$-coordinate \f$ x_0\f$ (as described in the `Algebraic_kernel_d_1 paragraph above), an algebraic curve where \f$ p\f$ lies on, and an integer \f$ i\f$, denoting that \f$ p\f$ is the \f$ i\f$th point in the fiber at \f$ x_0\f$, counted from the bottom (ignoring a possible vertical line at \f$ x_0\f$). -Note that this determines the point uniquely, but the \f$ y\f$-coordinate +Note that this determines the point uniquely, but the \f$ y\f$-coordinate is not stored internally in terms of an `Algebraic_real_1` object. Querying such a representation by calling `Compute_y_2` is a time-consuming step, and should be avoided for efficiency reasons if possible. \subsection Algebraic_kernel_dAlgebraicKernelsBasedon Algebraic Kernels Based on RS -The package offers two univariate algebraic kernels that are based on +The package offers two univariate algebraic kernels that are based on the library RS \cgalCite{cgal:r-rs}, namely `Algebraic_kernel_rs_gmpz_d_1` -and `Algebraic_kernel_rs_gmpq_d_1`. As the names indicate, -the kernels are based on the library RS \cgalCite{cgal:r-rs} and support univariate +and `Algebraic_kernel_rs_gmpq_d_1`. As the names indicate, +the kernels are based on the library RS \cgalCite{cgal:r-rs} and support univariate polynomials over `Gmpz` or `Gmpq`, respectively. In general we encourage to use `Algebraic_kernel_rs_gmpz_d_1` @@ -301,9 +301,9 @@ overhead caused by the necessary conversions. However, since this may not always be a major issue, the `Algebraic_kernel_rs_gmpq_d_1` is provided for convenience. -The core of both kernels is the implementation of the interval Descartes -algorithm \cgalCite{cgal:rz-jcam-04} of the library RS \cgalCite{cgal:r-rs}, -which is used to isolate the roots of the polynomial. +The core of both kernels is the implementation of the interval Descartes +algorithm \cgalCite{cgal:rz-jcam-04} of the library RS \cgalCite{cgal:r-rs}, +which is used to isolate the roots of the polynomial. The RS library restricts its attention to univariate integer polynomials and some substantial gain of efficiency can be made by using a kernel that does not follow the generic programming paradigm, by avoiding @@ -314,7 +314,7 @@ make heavy use of the Mpfr \cgalCite{cgal:mt-mpfr} a libraries, and of their \cgal interfaces, `Gmpfr` and `Gmpfi`. The algebraic numbers (roots of the polynomials) are represented in the two RS kernels by a `Gmpfi` interval and a pointer to -the polynomial of which they are roots. See \cgalCite{cgal:lpt-wea-09} +the polynomial of which they are roots. See \cgalCite{cgal:lpt-wea-09} for more details on the implementation, tests of these kernels, comparisons with other algebraic kernels and discussions about the efficiency. @@ -323,26 +323,26 @@ efficiency. \subsection CGALAK1ConstructionExamples Construction of Algebraic Real Numbers -The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` +The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` using `AlgebraicKernel_d_1::Construct_algebraic_real_1`: \cgalExample{Algebraic_kernel_d/Construct_algebraic_real_1.cpp} \subsection CGALAK1Solving Solving Univariate Polynomials -The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` -using `AlgebraicKernel_d_1::Solve_1`: \cgalExample{Algebraic_kernel_d/Solve_1.cpp} +The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` +using `AlgebraicKernel_d_1::Solve_1`: \cgalExample{Algebraic_kernel_d/Solve_1.cpp} \subsection CGALAK1EGCompare_1 Comparison and Approximation of Algebraic Real Numbers -The following example illustrates the comparison of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: +The following example illustrates the comparison of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: \cgalExample{Algebraic_kernel_d/Compare_1.cpp} -\subsection CGALAK1EGIsolate_1 Isolation of Algebraic Real Numbers with respect to roots of other polynomials +\subsection CGALAK1EGIsolate_1 Isolation of Algebraic Real Numbers with respect to roots of other polynomials -The following example illustrates the isolation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: +The following example illustrates the isolation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: \cgalExample{Algebraic_kernel_d/Isolate_1.cpp} -\subsection CGALAK1EGSign_at_1 Interplay with Polynomials +\subsection CGALAK1EGSign_at_1 Interplay with Polynomials The following example illustrates the sign evaluation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers in polynomials: \cgalExample{Algebraic_kernel_d/Sign_at_1.cpp} @@ -353,9 +353,9 @@ This package is clearly split into a univariate and bivariate kernel. However, with respect to its history the package splits into a design part and an implementation part. -The concepts, which make up the design part, +The concepts, which make up the design part, were written by Eric Berberich, Michael Hemmer, and -Monique Teillaud. +Monique Teillaud. The design history of the package is fairly old and several ideas that influenced this package can already be found in \cgalCite{cgal:bhkt-risak-07}. Since then, the initial design underwent @@ -368,20 +368,20 @@ ideas that was brought to them throughout the last years. In particular, they want to thank Menelaos Karavelas and Elias Tsigaridas for their initial contributions. -The two generic models where initially developed as part of the Exacus \cgalCite{beh-eeeafcs-05} project. -However, the models are now fully integrated into the \cgal library, +The two generic models where initially developed as part of the Exacus \cgalCite{beh-eeeafcs-05} project. +However, the models are now fully integrated into the \cgal library, since also the relevant layers of Exacus are now part of \cgal. -The main authors for `Algebraic_kernel_d_1` and `Algebraic_kernel_d_2` are -Michael Hemmer and Michael Kerber, respectively. Notwithstanding, the authors also want to emphasize the -contribution of all authors of the Exacus project, +The main authors for `Algebraic_kernel_d_1` and `Algebraic_kernel_d_2` are +Michael Hemmer and Michael Kerber, respectively. Notwithstanding, the authors also want to emphasize the +contribution of all authors of the Exacus project, particularly the contribution of Arno Eigenwillig, Sebastian Limbach and Pavel Emeliyanenko. -The two univariate kernels that interface the library RS \cgalCite{cgal:r-rs} were -written by Luis Peñaranda and Sylvain Lazard. -Both models interface the library RS \cgalCite{cgal:r-rs} by Fabrice Rouillier. -The authors want to thank Fabrice Rouillier and Elias Tsigaridas for +The two univariate kernels that interface the library RS \cgalCite{cgal:r-rs} were +written by Luis Peñaranda and Sylvain Lazard. +Both models interface the library RS \cgalCite{cgal:r-rs} by Fabrice Rouillier. +The authors want to thank Fabrice Rouillier and Elias Tsigaridas for strong support and many useful discussions that lead to the integration of RS. -*/ +*/ } /* namespace CGAL */ diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h index 632bd0c756bd..02abff7d35d8 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h @@ -4,23 +4,23 @@ namespace CGAL { /*! \ingroup PkgAlgebraicKernelDModels -The class represents an algebraic real root by a square free polynomial and an -isolating interval that uniquely defines the root. -The template argument `Coeff` determines the coefficient type of the -kernel, which is also the coefficient type of the supported polynomials. +The class represents an algebraic real root by a square free polynomial and an +isolating interval that uniquely defines the root. +The template argument `Coeff` determines the coefficient type of the +kernel, which is also the coefficient type of the supported polynomials. -Currently, the following coefficient types are supported: +Currently, the following coefficient types are supported: -- `Gmpz`, `Gmpq`, (requires configuration with external libraries GMP, MPFR and MPFI) +- `Gmpz`, `Gmpq`, (requires configuration with external libraries GMP, MPFR and MPFI) -- `CORE::BigInt`, `CORE::BigRat`, (requires configuration with external library GMP) +- `CORE::BigInt`, `CORE::BigRat`, (requires configuration with external library GMP) -- `leda_integer`, `leda_rational`. (requires configuration with external library LEDA) +- `leda_integer`, `leda_rational`. (requires configuration with external library LEDA) \cgalAdvancedBegin -The template argument type can also be set to `Sqrt_extension`, where `NT` is -one of the types listed above. `ROOT` should be one of the integer types. -See also the documentation of `Sqrt_extension`. +The template argument type can also be set to `Sqrt_extension`, where `NT` is +one of the types listed above. `ROOT` should be one of the integer types. +See also the documentation of `Sqrt_extension`. \cgalAdvancedEnd The current method to isolate roots is the bitstream Descartes method @@ -31,8 +31,8 @@ method has quadratic convergence. \cgalModels `AlgebraicKernel_d_1` -\sa `AlgebraicKernel_d_1` -\sa `Polynomial_d` +\sa `AlgebraicKernel_d_1` +\sa `Polynomial_d` \sa `CGAL::Algebraic_kernel_d_2` */ @@ -40,40 +40,40 @@ template< typename Coeff > class Algebraic_kernel_d_1 { public: -/// \name Types +/// \name Types /// @{ /*! -Same type as the template argument `Coeff`. -*/ -typedef unspecified_type Coefficient; +Same type as the template argument `Coeff`. +*/ +typedef unspecified_type Coefficient; /*! A model of `::AlgebraicKernel_d_1::Polynomial_1`. -*/ -typedef unspecified_type Polynomial_1; +*/ +typedef unspecified_type Polynomial_1; /*! A model of `::AlgebraicKernel_d_1::Algebraic_real_1`. -*/ -typedef unspecified_type Algebraic_real_1; +*/ +typedef unspecified_type Algebraic_real_1; /*! The choice of `Coeff` also determines the provided bound type. -In case of `Coeff` is: +In case of `Coeff` is: - `Gmpz` or `Gmpq`, this is `Gmpq`, - `CORE::BigInt` or `CORE::BigRat`, this is `CORE::BigRat`, - `leda_integer` or `leda_rational`, this is `leda_rational`. -*/ -typedef unspecified_type Bound; +*/ +typedef unspecified_type Bound; /*! -The multiplicity type is `int`. -*/ -typedef unspecified_type Multiplicity_type; +The multiplicity type is `int`. +*/ +typedef unspecified_type Multiplicity_type; /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h index 7e8cbc602911..ea9cf0b4d43a 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h @@ -4,41 +4,41 @@ namespace CGAL { /*! \ingroup PkgAlgebraicKernelDModels -This class gathers necessary tools for solving and handling bivariate +This class gathers necessary tools for solving and handling bivariate polynomial systems of general degree \f$ d\f$. -This class is based on an algorithm computing a -geometric-topological analysis of a single curve \cite ekw-fast-07 and of a -pair of curves \cite ek-exact-08. -The main idea behind both analyses is to compute the critical -x-coordinates of curves and curve pairs by projection (resultants), and compute -additional information about the critical fibers using subresultants -and Sturm-Habicht sequences \cite grlr-sturm-habicht-98. -With that information, the fiber at -critical x-coordinates is computed by a variant of the Bitstream -Descartes method. -See also \cite kerber-phd-09 for a comprehensive description of -these techniques. - -A point \f$ p\f$ of type `Algebraic_real_2` is represented -by its \f$ x\f$-coordinate \f$ x_0\f$ (as described in the `Algebraic_kernel_d_1` -paragraph above), an algebraic curve where \f$ p\f$ lies on, and an -integer \f$ i\f$, denoting that \f$ p\f$ is the \f$ i\f$th point in the fiber at \f$ x_0\f$, -counted from the bottom (ignoring a possible vertical line at \f$ x_0\f$). -This determines the point uniquely, but the \f$ y\f$-coordinate -is not stored internally in terms of an `Algebraic_real_1` object. -Querying such a representation by calling `Compute_y_2` is a -time-consuming step, and should be avoided for efficiency reasons if possible. -Note that this representation is not exposed in the interface. - -The template argument `Coeff` determines the coefficient type of the -kernel, which is also the innermost coefficient type of the supported polynomials. - -Currently, the following coefficient types are supported: - -- `Gmpz`, `Gmpq`, (requires configuration with external libraries GMP, MPFR and MPFI) -- `CORE::BigInt`, `CORE::BigRat`, (requires configuration with external library GMP) -- `leda_integer`, `leda_rational`. (requires configuration with external library LEDA) +This class is based on an algorithm computing a +geometric-topological analysis of a single curve \cite ekw-fast-07 and of a +pair of curves \cite ek-exact-08. +The main idea behind both analyses is to compute the critical +x-coordinates of curves and curve pairs by projection (resultants), and compute +additional information about the critical fibers using subresultants +and Sturm-Habicht sequences \cite grlr-sturm-habicht-98. +With that information, the fiber at +critical x-coordinates is computed by a variant of the Bitstream +Descartes method. +See also \cite kerber-phd-09 for a comprehensive description of +these techniques. + +A point \f$ p\f$ of type `Algebraic_real_2` is represented +by its \f$ x\f$-coordinate \f$ x_0\f$ (as described in the `Algebraic_kernel_d_1` +paragraph above), an algebraic curve where \f$ p\f$ lies on, and an +integer \f$ i\f$, denoting that \f$ p\f$ is the \f$ i\f$th point in the fiber at \f$ x_0\f$, +counted from the bottom (ignoring a possible vertical line at \f$ x_0\f$). +This determines the point uniquely, but the \f$ y\f$-coordinate +is not stored internally in terms of an `Algebraic_real_1` object. +Querying such a representation by calling `Compute_y_2` is a +time-consuming step, and should be avoided for efficiency reasons if possible. +Note that this representation is not exposed in the interface. + +The template argument `Coeff` determines the coefficient type of the +kernel, which is also the innermost coefficient type of the supported polynomials. + +Currently, the following coefficient types are supported: + +- `Gmpz`, `Gmpq`, (requires configuration with external libraries GMP, MPFR and MPFI) +- `CORE::BigInt`, `CORE::BigRat`, (requires configuration with external library GMP) +- `leda_integer`, `leda_rational`. (requires configuration with external library LEDA) \cgalAdvancedBegin The template argument type can also be set to @@ -49,9 +49,9 @@ documentation of `Sqrt_extension`. \cgalModels `AlgebraicKernel_d_2` -\sa `AlgebraicKernel_d_1` -\sa `AlgebraicKernel_d_2` -\sa `Polynomial_d` +\sa `AlgebraicKernel_d_1` +\sa `AlgebraicKernel_d_2` +\sa `Polynomial_d` \sa `CGAL::Algebraic_kernel_d_2` */ @@ -59,40 +59,40 @@ template< typename Coeff > class Algebraic_kernel_d_2 { public: -/// \name Types +/// \name Types /// @{ -/*! -Same type as the template argument `Coeff`. -*/ -typedef unspecified_type Coefficient; +/*! +Same type as the template argument `Coeff`. +*/ +typedef unspecified_type Coefficient; -/*! -A model of `AlgebraicKernel_d_2::Polynomial_2` -*/ -typedef unspecified_type Polynomial_2; +/*! +A model of `AlgebraicKernel_d_2::Polynomial_2` +*/ +typedef unspecified_type Polynomial_2; -/*! -A model of `AlgebraicKernel_d_2::AlgebraicReal_2` -*/ -typedef unspecified_type Algebraic_real_2; +/*! +A model of `AlgebraicKernel_d_2::AlgebraicReal_2` +*/ +typedef unspecified_type Algebraic_real_2; -/*! +/*! The choice of `Coeff` also determines the provided bound type. -In case of `Coeff` is +In case of `Coeff` is - `Gmpz` or `Gmpq`, this is `Gmpq` - `CORE::BigInt` or `CORE::BigRat`, this is `CORE::BigRat` - `leda_integer` or `leda_rational`, this is `leda_rational` -*/ -typedef unspecified_type Bound; +*/ +typedef unspecified_type Bound; -/*! -The multiplicity type is `int`. -*/ -typedef unspecified_type Multiplicity_type; +/*! +The multiplicity type is `int`. +*/ +typedef unspecified_type Multiplicity_type; /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h index 3498dcb2ab8e..204f5b233fc7 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h @@ -4,54 +4,54 @@ namespace CGAL { /*! \ingroup PkgAlgebraicKernelDModels -\anchor Algebraic_kernel_rs_gmpq_d_1 +\anchor Algebraic_kernel_rs_gmpq_d_1 -This univariate algebraic kernel uses the Rs library to perform -rational univariate polynomial root isolation. It is a model of the -`AlgebraicKernel_d_1` concept. Due to the fact that RS can only -isolate integer polynomials, the operations of this kernel have the -overhead of converting the polynomials to integer. +This univariate algebraic kernel uses the Rs library to perform +rational univariate polynomial root isolation. It is a model of the +`AlgebraicKernel_d_1` concept. Due to the fact that RS can only +isolate integer polynomials, the operations of this kernel have the +overhead of converting the polynomials to integer. \cgalModels `AlgebraicKernel_d_1` -\sa `Algebraic_kernel_rs_gmpz_d_1` +\sa `Algebraic_kernel_rs_gmpz_d_1` */ class Algebraic_kernel_rs_gmpq_d_1 { public: -/// \name Types +/// \name Types /// @{ /*! -It is a typedef to `CGAL::Gmpq`. -*/ -typedef unspecified_type Coefficient; +It is a typedef to `CGAL::Gmpq`. +*/ +typedef unspecified_type Coefficient; /*! -It is defined as `CGAL::Polynomial`. -*/ -typedef unspecified_type Polynomial_1; +It is defined as `CGAL::Polynomial`. +*/ +typedef unspecified_type Polynomial_1; /*! -Type that represents the real roots of -integer univariate polynomials, containing a pointer to the polynomial of -which the represented algebraic number is root and and a `CGAL::Gmpfi` -isolating interval. -*/ -typedef unspecified_type Algebraic_real_1; +Type that represents the real roots of +integer univariate polynomials, containing a pointer to the polynomial of +which the represented algebraic number is root and and a `CGAL::Gmpfi` +isolating interval. +*/ +typedef unspecified_type Algebraic_real_1; /*! -Since the isolating intervals of the roots have type -`CGAL::Gmpfi`, the bounds have type `CGAL::Gmpfr`. -*/ -typedef unspecified_type Bound; +Since the isolating intervals of the roots have type +`CGAL::Gmpfi`, the bounds have type `CGAL::Gmpfr`. +*/ +typedef unspecified_type Bound; /*! -The multiplicity is an `int`. -*/ -typedef unspecified_type Multiplicity_type; +The multiplicity is an `int`. +*/ +typedef unspecified_type Multiplicity_type; /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h index 665aa563e403..029066a0119c 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h @@ -4,52 +4,52 @@ namespace CGAL { /*! \ingroup PkgAlgebraicKernelDModels -\anchor Algebraic_kernel_rs_gmpz_d_1 +\anchor Algebraic_kernel_rs_gmpz_d_1 -This univariate algebraic kernel uses the Rs library to perform -integer univariate polynomial root isolation. It is a model of the -`AlgebraicKernel_d_1` concept. +This univariate algebraic kernel uses the Rs library to perform +integer univariate polynomial root isolation. It is a model of the +`AlgebraicKernel_d_1` concept. \cgalModels `AlgebraicKernel_d_1` -\sa `Algebraic_kernel_rs_gmpz_d_1` +\sa `Algebraic_kernel_rs_gmpz_d_1` */ class Algebraic_kernel_rs_gmpz_d_1 { public: -/// \name Types +/// \name Types /// @{ /*! -It is a typedef to `CGAL::Gmpz`. -*/ -typedef unspecified_type Coefficient; +It is a typedef to `CGAL::Gmpz`. +*/ +typedef unspecified_type Coefficient; /*! -It is defined as `CGAL::Polynomial`. -*/ -typedef unspecified_type Polynomial_1; +It is defined as `CGAL::Polynomial`. +*/ +typedef unspecified_type Polynomial_1; /*! -Type that represents the real roots of -integer univariate polynomials, containing a pointer to the polynomial of -which the represented algebraic number is root and and a `CGAL::Gmpfi` -isolating interval. -*/ -typedef unspecified_type Algebraic_real_1; +Type that represents the real roots of +integer univariate polynomials, containing a pointer to the polynomial of +which the represented algebraic number is root and and a `CGAL::Gmpfi` +isolating interval. +*/ +typedef unspecified_type Algebraic_real_1; /*! -Since the isolating intervals of the roots have type -`CGAL::Gmpfi`, the bounds have type `CGAL::Gmpfr`. -*/ -typedef unspecified_type Bound; +Since the isolating intervals of the roots have type +`CGAL::Gmpfi`, the bounds have type `CGAL::Gmpfr`. +*/ +typedef unspecified_type Bound; /*! -The multiplicity is an `int`. -*/ -typedef unspecified_type Multiplicity_type; +The multiplicity is an `int`. +*/ +typedef unspecified_type Multiplicity_type; /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h index 9c142688f05c..48c231df209e 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -A model of `AlgebraicKernel_d_1::ApproximateAbsolute_1` is an `AdaptableBinaryFunction` that computes an -approximation of an `AlgebraicKernel_d_1::Algebraic_real_1` value with -respect to a given absolute precision. +A model of `AlgebraicKernel_d_1::ApproximateAbsolute_1` is an `AdaptableBinaryFunction` that computes an +approximation of an `AlgebraicKernel_d_1::Algebraic_real_1` value with +respect to a given absolute precision. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_1::ApproximateRelative_1` @@ -16,44 +16,44 @@ respect to a given absolute precision. class AlgebraicKernel_d_1::ApproximateAbsolute_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; /*! -*/ -typedef int second_argument_type; +*/ +typedef int second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, -where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents -the upper approximation. The pair \f$ p\f$ approximates the given value \f$ x\f$ -with respect to the given absolute precision \f$ a\f$. -\post \f$ p.first <= x \f$ -\post \f$ x <= p.second \f$ -\post \f$ (x - p.first) <= 2^{-a} \f$ -\post \f$ (p.second - x) <= 2^{-a} \f$ - -*/ -result_type -operator()(const first_argument_type & x, -const second_argument_type & a ); +The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, +where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents +the upper approximation. The pair \f$ p\f$ approximates the given value \f$ x\f$ +with respect to the given absolute precision \f$ a\f$. +\post \f$ p.first <= x \f$ +\post \f$ x <= p.second \f$ +\post \f$ (x - p.first) <= 2^{-a} \f$ +\post \f$ (p.second - x) <= 2^{-a} \f$ + +*/ +result_type +operator()(const first_argument_type & x, +const second_argument_type & a ); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h index 977c3eb05109..b9ce0d868b37 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -A model of `AlgebraicKernel_d_1::ApproximateRelative_1` is an `AdaptableBinaryFunction` that computes an -approximation of an `AlgebraicKernel_d_1::Algebraic_real_1` value with -respect to a given relative precision. +A model of `AlgebraicKernel_d_1::ApproximateRelative_1` is an `AdaptableBinaryFunction` that computes an +approximation of an `AlgebraicKernel_d_1::Algebraic_real_1` value with +respect to a given relative precision. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_1::ApproximateAbsolute_1` @@ -16,44 +16,44 @@ respect to a given relative precision. class AlgebraicKernel_d_1::ApproximateRelative_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; /*! -*/ -typedef int second_argument_type; +*/ +typedef int second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, -where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents -the upper approximation. The pair \f$ p\f$ approximates the given value \f$ x\f$ -with respect to the given relative precision \f$ r\f$. -\post \f$ p.first <= x \f$ -\post \f$ x <= p.second \f$ -\post \f$ (x - p.first) <= 2^{-r} *|x|\f$ -\post \f$ (p.second - x) <= 2^{-r} *|x|\f$ - -*/ -result_type -operator()(const first_argument_type & x, -const second_argument_type & r ); +The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, +where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents +the upper approximation. The pair \f$ p\f$ approximates the given value \f$ x\f$ +with respect to the given relative precision \f$ r\f$. +\post \f$ p.first <= x \f$ +\post \f$ x <= p.second \f$ +\post \f$ (x - p.first) <= 2^{-r} *|x|\f$ +\post \f$ (p.second - x) <= 2^{-r} *|x|\f$ + +*/ +result_type +operator()(const first_argument_type & x, +const second_argument_type & r ); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h index 532708bbc666..ae6b9c14d0b1 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h @@ -3,52 +3,52 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes a number of type -`AlgebraicKernel_d_1::Bound` in-between two -`AlgebraicKernel_d_1::Algebraic_real_1` values. +Computes a number of type +`AlgebraicKernel_d_1::Bound` in-between two +`AlgebraicKernel_d_1::Algebraic_real_1` values. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` */ class AlgebraicKernel_d_1::BoundBetween_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Bound result_type; +*/ +typedef AlgebraicKernel_d_1::Bound result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes a value \f$ r\f$, which is between \f$ a\f$ and \f$ b\f$. +Computes a value \f$ r\f$, which is between \f$ a\f$ and \f$ b\f$. -\pre \f$ a \neq b\f$ -\post \f$ r > min(a,b)\f$ -\post \f$ r < max(a,b)\f$ +\pre \f$ a \neq b\f$ +\post \f$ r > min(a,b)\f$ +\post \f$ r < max(a,b)\f$ -*/ -result_type -operator()(const first_argument_type & a, -const second_argument_type & b); +*/ +result_type +operator()(const first_argument_type & a, +const second_argument_type & b); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h index 93a3245ccb8c..9588064cd040 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h @@ -3,58 +3,58 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Compares `AlgebraicKernel_d_1::Algebraic_real_1` values. +Compares `AlgebraicKernel_d_1::Algebraic_real_1` values. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` */ class AlgebraicKernel_d_1::Compare_1 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Comparison_result` -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Comparison_result` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// The following operators and their symmetric counterparts are /// required: /// @{ /*! -Compares `a` and `b`. -*/ -result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, AlgebraicKernel_d_1::Algebraic_real_1 b); +Compares `a` and `b`. +*/ +result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, AlgebraicKernel_d_1::Algebraic_real_1 b); /*! -Compares `a` and `b`. -*/ -result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, int b); +Compares `a` and `b`. +*/ +result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, int b); /*! -Compares `a` and `b`. -*/ -result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, AlgebraicKernel_d_1::Bound b); +Compares `a` and `b`. +*/ +result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, AlgebraicKernel_d_1::Bound b); /*! -Compares `a` and `b`. -*/ -result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, AlgebraicKernel_d_1::Coefficient b); +Compares `a` and `b`. +*/ +result_type operator()(AlgebraicKernel_d_1::Algebraic_real_1 a, AlgebraicKernel_d_1::Coefficient b); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h index 29fc14de9537..81e5feb778c6 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes a square free univariate polynomial \f$ p\f$, such that the given -`AlgebraicKernel_d_1::Algebraic_real_1` is a root of \f$ p\f$. +Computes a square free univariate polynomial \f$ p\f$, such that the given +`AlgebraicKernel_d_1::Algebraic_real_1` is a root of \f$ p\f$. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_1::Isolate_1` @@ -15,28 +15,28 @@ Computes a square free univariate polynomial \f$ p\f$, such that the given class AlgebraicKernel_d_1::ComputePolynomial_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 result_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes a square free polynomial \f$ p\f$, such that \f$ x\f$ is a real root of \f$ p\f$. -*/ -result_type operator()(argument_type x); +Computes a square free polynomial \f$ p\f$, such that \f$ x\f$ is a real root of \f$ p\f$. +*/ +result_type operator()(argument_type x); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h index 82ccd3d56f1b..fcc7b68feaa5 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Constructs `AlgebraicKernel_d_1::Algebraic_real_1`. +Constructs `AlgebraicKernel_d_1::Algebraic_real_1`. -\cgalRefines `AdaptableFunctor` +\cgalRefines `AdaptableFunctor` \sa `AlgebraicKernel_d_2::ConstructAlgebraicReal_2` @@ -14,56 +14,56 @@ Constructs `AlgebraicKernel_d_1::Algebraic_real_1`. class AlgebraicKernel_d_1::ConstructAlgebraicReal_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 result_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 result_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to \f$ a\f$. -*/ -result_type operator()(int a); +introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to \f$ a\f$. +*/ +result_type operator()(int a); /*! -introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to \f$ a\f$. -*/ -result_type operator()(AlgebraicKernel_d_1::Bound a); +introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to \f$ a\f$. +*/ +result_type operator()(AlgebraicKernel_d_1::Bound a); /*! -introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to \f$ a\f$. -*/ -result_type operator()(AlgebraicKernel_d_1::Coefficient a); +introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to \f$ a\f$. +*/ +result_type operator()(AlgebraicKernel_d_1::Coefficient a); /*! -introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to the \f$ i\f$-th real root of \f$ p\f$. -The index starts at \f$ 0\f$, that is, \f$ p\f$ must have at least \f$ i+1\f$ real roots. -\pre \f$ p\f$ is square free. -\pre \f$ p\f$ has at least \f$ i+1\f$ real roots. +introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to the \f$ i\f$-th real root of \f$ p\f$. +The index starts at \f$ 0\f$, that is, \f$ p\f$ must have at least \f$ i+1\f$ real roots. +\pre \f$ p\f$ is square free. +\pre \f$ p\f$ has at least \f$ i+1\f$ real roots. -*/ -result_type operator()(AlgebraicKernel_d_1::Polynomial_1 p, AlgebraicKernel_d_1::size_type i); +*/ +result_type operator()(AlgebraicKernel_d_1::Polynomial_1 p, AlgebraicKernel_d_1::size_type i); /*! -introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to the -only real root of \f$ p\f$ in the open interval \f$ I = (l,u)\f$. -\pre \f$ l < u\f$ -\pre \f$ p\f$ is square free. -\pre \f$ p\f$ has exactly one real root in \f$ I\f$ -\pre \f$ p\f$ has no real root on \f$ \partial I\f$ - -*/ -result_type operator()( -AlgebraicKernel_d_1::Polynomial_1 p, -AlgebraicKernel_d_1::Bound l, -AlgebraicKernel_d_1::Bound u); +introduces an `AlgebraicKernel_d_1::Algebraic_real_1` initialized to the +only real root of \f$ p\f$ in the open interval \f$ I = (l,u)\f$. +\pre \f$ l < u\f$ +\pre \f$ p\f$ is square free. +\pre \f$ p\f$ has exactly one real root in \f$ I\f$ +\pre \f$ p\f$ has no real root on \f$ \partial I\f$ + +*/ +result_type operator()( +AlgebraicKernel_d_1::Polynomial_1 p, +AlgebraicKernel_d_1::Bound l, +AlgebraicKernel_d_1::Bound u); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h index e8d8ddd1d202..2e28f355dd63 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Determines whether a given pair of univariate polynomials \f$ p_1, p_2\f$ is coprime, -namely if \f$ \deg({\rm gcd}(p_1 ,p_2)) = 0\f$. +Determines whether a given pair of univariate polynomials \f$ p_1, p_2\f$ is coprime, +namely if \f$ \deg({\rm gcd}(p_1 ,p_2)) = 0\f$. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_1::MakeCoprime_1` @@ -15,35 +15,35 @@ namely if \f$ \deg({\rm gcd}(p_1 ,p_2)) = 0\f$. class AlgebraicKernel_d_1::IsCoprime_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef bool result_type; +*/ +typedef bool result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns true if `p1` and `p2` are coprime. -*/ -result_type -operator()(const first_argument_type & p1, -const second_argument_type & p2); +Returns true if `p1` and `p2` are coprime. +*/ +result_type +operator()(const first_argument_type & p1, +const second_argument_type & p2); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h index b6cfbaac082d..1e3a350dc982 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes whether the given univariate polynomial is square free. +Computes whether the given univariate polynomial is square free. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_1::MakeSquareFree_1` \sa `AlgebraicKernel_d_1::SquareFreeFactorize_1` @@ -15,29 +15,29 @@ Computes whether the given univariate polynomial is square free. class AlgebraicKernel_d_1::IsSquareFree_1 { public: -/// \name Types +/// \name Types /// A model of this type must provide: /// @{ /*! -*/ -typedef bool result_type; +*/ +typedef bool result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns true if \f$ p\f$ is square free. -*/ -result_type operator()(argument_type p); +Returns true if \f$ p\f$ is square free. +*/ +result_type operator()(argument_type p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h index 7c43c21ba54c..f46b2e003c9b 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes whether an `AlgebraicKernel_d_1::Polynomial_1` -is zero at a given `AlgebraicKernel_d_1::Algebraic_real_1`. +Computes whether an `AlgebraicKernel_d_1::Polynomial_1` +is zero at a given `AlgebraicKernel_d_1::Algebraic_real_1`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_1::SignAt_1` @@ -15,35 +15,35 @@ is zero at a given `AlgebraicKernel_d_1::Algebraic_real_1`. class AlgebraicKernel_d_1::IsZeroAt_1 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `bool` -*/ -typedef unspecified_type result_type; +Type convertible to `bool` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes whether \f$ p\f$ is zero at \f$ x\f$. -*/ -result_type -operator()(const first_argument_type & p, -const second_argument_type & x); +Computes whether \f$ p\f$ is zero at \f$ x\f$. +*/ +result_type +operator()(const first_argument_type & p, +const second_argument_type & x); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h index 9613ee516378..2396ab840891 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes an open isolating interval for an `AlgebraicKernel_d_1::Algebraic_real_1` -with respect to the real roots of a given univariate polynomial. +Computes an open isolating interval for an `AlgebraicKernel_d_1::Algebraic_real_1` +with respect to the real roots of a given univariate polynomial. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_1::ComputePolynomial_1` @@ -15,37 +15,37 @@ with respect to the real roots of a given univariate polynomial. class AlgebraicKernel_d_1::Isolate_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes an open isolating interval \f$ I=(l,u)\f$ for \f$ a\f$ with respect to the real roots of \f$ p\f$. -It is not required that \f$ a\f$ is a root of \f$ p\f$. -\post \f$ a \in I\f$. -\post \f$ p(x) \neq0 | \forall x \in\overline{I}\backslash a\f$. +Computes an open isolating interval \f$ I=(l,u)\f$ for \f$ a\f$ with respect to the real roots of \f$ p\f$. +It is not required that \f$ a\f$ is a root of \f$ p\f$. +\post \f$ a \in I\f$. +\post \f$ p(x) \neq0 | \forall x \in\overline{I}\backslash a\f$. -*/ -result_type operator()(first_argument_type a, second_argument_type p); +*/ +result_type operator()(first_argument_type a, second_argument_type p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h index 3ac3797a7064..4ccc43286775 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h @@ -3,20 +3,20 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes for a given pair of univariate polynomials \f$ p_1\f$, \f$ p_2\f$ their -common part \f$ g\f$ up to a constant factor and coprime parts \f$ q_1\f$, \f$ q_2\f$ -respectively. +Computes for a given pair of univariate polynomials \f$ p_1\f$, \f$ p_2\f$ their +common part \f$ g\f$ up to a constant factor and coprime parts \f$ q_1\f$, \f$ q_2\f$ +respectively. -That is, it computes \f$ g, q_1, q_2\f$ such that: +That is, it computes \f$ g, q_1, q_2\f$ such that: -\f$ c_1 \cdot p_1 = g \cdot q_1\f$ for some constant \f$ c_1\f$ and +\f$ c_1 \cdot p_1 = g \cdot q_1\f$ for some constant \f$ c_1\f$ and -\f$ c_2 \cdot p_2 = g \cdot q_2\f$ for some constant \f$ c_2\f$, -such that \f$ q_1\f$ and \f$ q_2\f$ are coprime. +\f$ c_2 \cdot p_2 = g \cdot q_2\f$ for some constant \f$ c_2\f$, +such that \f$ q_1\f$ and \f$ q_2\f$ are coprime. -It returns true if \f$ p_1\f$ and \f$ p_2\f$ are already coprime. +It returns true if \f$ p_1\f$ and \f$ p_2\f$ are already coprime. -\cgalRefines `AdaptableFunctor` with five arguments +\cgalRefines `AdaptableFunctor` with five arguments \sa `AlgebraicKernel_d_1::IsCoprime_1` @@ -25,31 +25,31 @@ It returns true if \f$ p_1\f$ and \f$ p_2\f$ are already coprime. class AlgebraicKernel_d_1::MakeCoprime_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef bool result_type; +*/ +typedef bool result_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes \f$ g, q_1, q_2\f$ as described above. +Computes \f$ g, q_1, q_2\f$ as described above. -Returns whether \f$ p_1\f$ and \f$ p_2\f$ where already coprime. +Returns whether \f$ p_1\f$ and \f$ p_2\f$ where already coprime. -*/ -result_type -operator()(const AlgebraicKernel_d_1::Polynomial_1 & p1, -const AlgebraicKernel_d_1::Polynomial_1 & p2, -AlgebraicKernel_d_1::Polynomial_1 & g, -AlgebraicKernel_d_1::Polynomial_1 & q1, -AlgebraicKernel_d_1::Polynomial_1 & q2); +*/ +result_type +operator()(const AlgebraicKernel_d_1::Polynomial_1 & p1, +const AlgebraicKernel_d_1::Polynomial_1 & p2, +AlgebraicKernel_d_1::Polynomial_1 & g, +AlgebraicKernel_d_1::Polynomial_1 & q1, +AlgebraicKernel_d_1::Polynomial_1 & q2); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h index 8b71414d61f7..c45b33274fb2 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Returns a square free part of a univariate polynomial. +Returns a square free part of a univariate polynomial. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_1::IsSquareFree_1` \sa `AlgebraicKernel_d_1::SquareFreeFactorize_1` @@ -15,28 +15,28 @@ Returns a square free part of a univariate polynomial. class AlgebraicKernel_d_1::MakeSquareFree_1 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 result_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns a square free part of \f$ p\f$ -*/ -result_type operator()(argument_type p); +Returns a square free part of \f$ p\f$ +*/ +result_type operator()(argument_type p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h index 52bf33c00670..1ddba4f69511 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes the number of real solutions of the given univariate polynomial. +Computes the number of real solutions of the given univariate polynomial. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_1::ConstructAlgebraicReal_1` @@ -14,30 +14,30 @@ Computes the number of real solutions of the given univariate polynomial. class AlgebraicKernel_d_1::NumberOfSolutions_1 { public: -/// \name Types +/// \name Types /// A model of this type must provide: /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::size_type result_type; +*/ +typedef AlgebraicKernel_d_1::size_type result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the number of real solutions of \f$ p\f$. -\pre \f$ p\f$ is square free. -*/ -result_type operator()(argument_type p); +Returns the number of real solutions of \f$ p\f$. +\pre \f$ p\f$ is square free. +*/ +result_type operator()(argument_type p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h index 565ce13b992e..56009e09f910 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes the sign of a univariate polynomial -`AlgebraicKernel_d_1::Polynomial_1` at a real value of type -`AlgebraicKernel_d_1::Algebraic_real_1`. +Computes the sign of a univariate polynomial +`AlgebraicKernel_d_1::Polynomial_1` at a real value of type +`AlgebraicKernel_d_1::Algebraic_real_1`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_1::IsZeroAt_1` @@ -16,35 +16,35 @@ Computes the sign of a univariate polynomial class AlgebraicKernel_d_1::SignAt_1 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Sign` -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Sign` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 first_argument_type; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes the sign of \f$ p\f$ at \f$ x\f$. -*/ -result_type -operator()(const first_argument_type & p, -const second_argument_type & x); +Computes the sign of \f$ p\f$ at \f$ x\f$. +*/ +result_type +operator()(const first_argument_type & p, +const second_argument_type & x); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h index b7f976f04861..add3def2d3cd 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h @@ -3,63 +3,63 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes the real roots of a univariate polynomial. +Computes the real roots of a univariate polynomial. -\cgalRefines `Assignable` -\cgalRefines `CopyConstructible` +\cgalRefines `Assignable` +\cgalRefines `CopyConstructible` */ class AlgebraicKernel_d_1::Solve_1 { public: -/// \name Operations +/// \name Operations /// A model of this type must provide: /// @{ /*! -Computes all real solutions of \f$ p\f$ with multiplicity, and copies them as objects of type -`std::pair` in `res`. -*/ -template < class OutputIterator > -OutputIterator -operator()( AlgebraicKernel_d_1::Polynomial_1 p, -OutputIterator res); +Computes all real solutions of \f$ p\f$ with multiplicity, and copies them as objects of type +`std::pair` in `res`. +*/ +template < class OutputIterator > +OutputIterator +operator()( AlgebraicKernel_d_1::Polynomial_1 p, +OutputIterator res); /*! -Computes all real solutions of \f$ p\f$, and copies them as objects of type -`AlgebraicKernel_d_1::Algebraic_real_1` in `res`. -The `bool` `known_to_be_square_free` indicates whether \f$ p\f$ is known to be square free. -Each root, though it might be a multiple root, is reported only once. -*/ -template < class OutputIterator > -OutputIterator -operator()( -AlgebraicKernel_d_1::Polynomial_1 p, -bool known_to_be_square_free, -OutputIterator res ); +Computes all real solutions of \f$ p\f$, and copies them as objects of type +`AlgebraicKernel_d_1::Algebraic_real_1` in `res`. +The `bool` `known_to_be_square_free` indicates whether \f$ p\f$ is known to be square free. +Each root, though it might be a multiple root, is reported only once. +*/ +template < class OutputIterator > +OutputIterator +operator()( +AlgebraicKernel_d_1::Polynomial_1 p, +bool known_to_be_square_free, +OutputIterator res ); /*! -Computes all real solutions of \f$ p\f$ in the closed interval \f$ [l,u]\f$ with multiplicity, and copies them as objects of type -`std::pair` in `res`. -*/ -template < class OutputIterator > -OutputIterator -operator()( AlgebraicKernel_d_1::Polynomial_1 p, AlgebraicKernel_d_1::Bound l, AlgebraicKernel_d_1::Bound u, -OutputIterator res); +Computes all real solutions of \f$ p\f$ in the closed interval \f$ [l,u]\f$ with multiplicity, and copies them as objects of type +`std::pair` in `res`. +*/ +template < class OutputIterator > +OutputIterator +operator()( AlgebraicKernel_d_1::Polynomial_1 p, AlgebraicKernel_d_1::Bound l, AlgebraicKernel_d_1::Bound u, +OutputIterator res); /*! -Computes all real solutions of \f$ p\f$ in the closed interval \f$ [l,u]\f$, and copies them as objects of -type `AlgebraicKernel_d_1::Algebraic_real_1` in `res`. -The `bool` `known_to_be_square_free` indicates whether \f$ p\f$ is known to be square free. -Each root, though it might be a multiple root, is reported only once. -*/ -template < class OutputIterator > OutputIterator operator()( -AlgebraicKernel_d_1::Polynomial_1 p, -bool known_to_be_square_free, -AlgebraicKernel_d_1::Bound l, -AlgebraicKernel_d_1::Bound u, -OutputIterator res); +Computes all real solutions of \f$ p\f$ in the closed interval \f$ [l,u]\f$, and copies them as objects of +type `AlgebraicKernel_d_1::Algebraic_real_1` in `res`. +The `bool` `known_to_be_square_free` indicates whether \f$ p\f$ is known to be square free. +Each root, though it might be a multiple root, is reported only once. +*/ +template < class OutputIterator > OutputIterator operator()( +AlgebraicKernel_d_1::Polynomial_1 p, +bool known_to_be_square_free, +AlgebraicKernel_d_1::Bound l, +AlgebraicKernel_d_1::Bound u, +OutputIterator res); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h index 91971c4f5757..acfdf7c3778e 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h @@ -3,19 +3,19 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -Computes a square free factorization of an -`AlgebraicKernel_d_1::Polynomial_1`. +Computes a square free factorization of an +`AlgebraicKernel_d_1::Polynomial_1`. -A polynomial \f$ p\f$ is factored into square free and pairwise -coprime non-constant factors \f$ q_i\f$ with multiplicities \f$ m_i\f$ -and a constant factor \f$ c\f$, such that -\f$ p = c \cdot q_1^{m_1} \cdot ... \cdot q_n^{m_n}\f$. +A polynomial \f$ p\f$ is factored into square free and pairwise +coprime non-constant factors \f$ q_i\f$ with multiplicities \f$ m_i\f$ +and a constant factor \f$ c\f$, such that +\f$ p = c \cdot q_1^{m_1} \cdot ... \cdot q_n^{m_n}\f$. -The factor multiplicity pairs \f$ \f$ are written to the -given output iterator. The constant factor \f$ c\f$ is not computed. +The factor multiplicity pairs \f$ \f$ are written to the +given output iterator. The constant factor \f$ c\f$ is not computed. -\cgalRefines `Assignable` -\cgalRefines `CopyConstructible` +\cgalRefines `Assignable` +\cgalRefines `CopyConstructible` \sa `AlgebraicKernel_d_1::IsSquareFree_1` \sa `AlgebraicKernel_d_1::MakeSquareFree_1` @@ -25,18 +25,18 @@ given output iterator. The constant factor \f$ c\f$ is not computed. class AlgebraicKernel_d_1::SquareFreeFactorize_1 { public: -/// \name Operations +/// \name Operations /// @{ /*! -Copies in the output iterator the factors of a square free -factorization of \f$ p\f$, with their multiplicity, as objects of type -`std::pair`. -*/ -template < class OutputIterator > -OutputIterator -operator()(AlgebraicKernel_d_1::Polynomial_1 p, -OutputIterator res); +Copies in the output iterator the factors of a square free +factorization of \f$ p\f$, with their multiplicity, as objects of type +`std::pair`. +*/ +template < class OutputIterator > +OutputIterator +operator()(AlgebraicKernel_d_1::Polynomial_1 p, +OutputIterator res); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h index 7d7cd3b4289c..26d30e364bd7 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h @@ -3,157 +3,157 @@ \ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept -A model of the `AlgebraicKernel_d_1` concept is meant to provide the -algebraic functionalities on univariate polynomials of general degree \f$ d\f$. +A model of the `AlgebraicKernel_d_1` concept is meant to provide the +algebraic functionalities on univariate polynomials of general degree \f$ d\f$. -\cgalRefines `CopyConstructible` -\cgalRefines `Assignable` +\cgalRefines `CopyConstructible` +\cgalRefines `Assignable` \cgalHasModel `CGAL::Algebraic_kernel_rs_gmpz_d_1` \cgalHasModel `CGAL::Algebraic_kernel_rs_gmpq_d_1` \sa `AlgebraicKernel_d_2` -A model of `AlgebraicKernel_d_1` must provide: +A model of `AlgebraicKernel_d_1` must provide: */ class AlgebraicKernel_d_1 { public: -/// \name Types +/// \name Types /// @{ /*! -A model of `IntegralDomain` and `RealEmbeddable`. +A model of `IntegralDomain` and `RealEmbeddable`. -`ExplicitInteroperable` with `AlgebraicKernel_d_1::Bound`. +`ExplicitInteroperable` with `AlgebraicKernel_d_1::Bound`. -*/ -typedef unspecified_type Coefficient; +*/ +typedef unspecified_type Coefficient; /*! -A univariate polynomial that is a model of `Polynomial_d`, +A univariate polynomial that is a model of `Polynomial_d`, where \link PolynomialTraits_d::Innermost_coefficient_type `CGAL::Polynomial_traits_d::Innermost_coefficient_type` \endlink -is `AlgebraicKernel_d_1::Coefficient`. +is `AlgebraicKernel_d_1::Coefficient`. -*/ -typedef unspecified_type Polynomial_1; +*/ +typedef unspecified_type Polynomial_1; /*! -A type that is used to represent real roots of univariate polynomials. -The type must be a model of `DefaultConstructible`, -`CopyConstructible`, `Assignable` and `RealEmbeddable`. +A type that is used to represent real roots of univariate polynomials. +The type must be a model of `DefaultConstructible`, +`CopyConstructible`, `Assignable` and `RealEmbeddable`. -*/ -typedef unspecified_type Algebraic_real_1; +*/ +typedef unspecified_type Algebraic_real_1; /*! -A type to represent upper and lower bounds of `AlgebraicKernel_d_1::Algebraic_real_1`. +A type to represent upper and lower bounds of `AlgebraicKernel_d_1::Algebraic_real_1`. -The type is `ExplicitInteroperable` with -`AlgebraicKernel_d_1::Coefficient` and must be a model -`IntegralDomain`, `RealEmbeddable` and dense in \f$ \mathbb{R}\f$. +The type is `ExplicitInteroperable` with +`AlgebraicKernel_d_1::Coefficient` and must be a model +`IntegralDomain`, `RealEmbeddable` and dense in \f$ \mathbb{R}\f$. -*/ -typedef unspecified_type Bound; +*/ +typedef unspecified_type Bound; /*! -Size type (unsigned integral type). -*/ -typedef unspecified_type size_type; +Size type (unsigned integral type). +*/ +typedef unspecified_type size_type; /*! -Multiplicity type (unsigned integral type). -*/ -typedef unspecified_type Multiplicity_type; +Multiplicity type (unsigned integral type). +*/ +typedef unspecified_type Multiplicity_type; -/// @} +/// @} -/// \name Functors +/// \name Functors /// @{ /*! -A model of `AlgebraicKernel_d_1::ConstructAlgebraicReal_1`. -*/ -typedef unspecified_type Construct_algebraic_real_1; +A model of `AlgebraicKernel_d_1::ConstructAlgebraicReal_1`. +*/ +typedef unspecified_type Construct_algebraic_real_1; /*! -A model of `AlgebraicKernel_d_1::ComputePolynomial_1`. -*/ -typedef unspecified_type Compute_polynomial_1; +A model of `AlgebraicKernel_d_1::ComputePolynomial_1`. +*/ +typedef unspecified_type Compute_polynomial_1; /*! -A model of `AlgebraicKernel_d_1::Isolate_1`. -*/ -typedef unspecified_type Isolate_1; +A model of `AlgebraicKernel_d_1::Isolate_1`. +*/ +typedef unspecified_type Isolate_1; /*! -A model of `AlgebraicKernel_d_1::IsSquareFree_1`. -*/ -typedef unspecified_type Is_square_free_1; +A model of `AlgebraicKernel_d_1::IsSquareFree_1`. +*/ +typedef unspecified_type Is_square_free_1; /*! -A model of `AlgebraicKernel_d_1::MakeSquareFree_1`. -*/ -typedef unspecified_type Make_square_free_1; +A model of `AlgebraicKernel_d_1::MakeSquareFree_1`. +*/ +typedef unspecified_type Make_square_free_1; /*! -A model of `AlgebraicKernel_d_1::SquareFreeFactorize_1`. -*/ -typedef unspecified_type Square_free_factorize_1; +A model of `AlgebraicKernel_d_1::SquareFreeFactorize_1`. +*/ +typedef unspecified_type Square_free_factorize_1; /*! -A model of `AlgebraicKernel_d_1::IsCoprime_1`. -*/ -typedef unspecified_type Is_coprime_1; +A model of `AlgebraicKernel_d_1::IsCoprime_1`. +*/ +typedef unspecified_type Is_coprime_1; /*! -A model of `AlgebraicKernel_d_1::MakeCoprime_1`. -*/ -typedef unspecified_type Make_coprime_1; +A model of `AlgebraicKernel_d_1::MakeCoprime_1`. +*/ +typedef unspecified_type Make_coprime_1; /*! -A model of `AlgebraicKernel_d_1::Solve_1`. -*/ -typedef unspecified_type Solve_1; +A model of `AlgebraicKernel_d_1::Solve_1`. +*/ +typedef unspecified_type Solve_1; /*! -A model of `AlgebraicKernel_d_1::NumberOfSolutions_1`. -*/ -typedef unspecified_type Number_of_solutions_1; +A model of `AlgebraicKernel_d_1::NumberOfSolutions_1`. +*/ +typedef unspecified_type Number_of_solutions_1; /*! -A model of `AlgebraicKernel_d_1::SignAt_1`. -*/ -typedef unspecified_type Sign_at_1; +A model of `AlgebraicKernel_d_1::SignAt_1`. +*/ +typedef unspecified_type Sign_at_1; /*! -A model of `AlgebraicKernel_d_1::Compare_1`. -*/ -typedef unspecified_type Compare_1; +A model of `AlgebraicKernel_d_1::Compare_1`. +*/ +typedef unspecified_type Compare_1; /*! -A model of `AlgebraicKernel_d_1::BoundBetween_1`. -*/ -typedef unspecified_type Bound_between_1; +A model of `AlgebraicKernel_d_1::BoundBetween_1`. +*/ +typedef unspecified_type Bound_between_1; /*! -A model of `AlgebraicKernel_d_1::ApproximateAbsolute_1`. -*/ -typedef unspecified_type Approximate_absolute_1; +A model of `AlgebraicKernel_d_1::ApproximateAbsolute_1`. +*/ +typedef unspecified_type Approximate_absolute_1; /*! -A model of `AlgebraicKernel_d_1::ApproximateRelative_1`. -*/ -typedef unspecified_type Approximate_relative_1; +A model of `AlgebraicKernel_d_1::ApproximateRelative_1`. +*/ +typedef unspecified_type Approximate_relative_1; -/// @} +/// @} -/// \name Operations +/// \name Operations /// For each of the function objects above, there must exist a member /// function that requires no arguments and returns an instance of /// that function object. The name of the member function is the @@ -165,8 +165,8 @@ typedef unspecified_type Approximate_relative_1; /*! -*/ -AlgebraicKernel_d_1::Bound_between_1 bound_between_1_object() const; +*/ +AlgebraicKernel_d_1::Bound_between_1 bound_between_1_object() const; /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h index 8fb754c7cc25..79a14f66cc22 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -A model of `AlgebraicKernel_d_2::ApproximateAbsoluteX_2` is an `AdaptableBinaryFunction` that computes an -approximation of the \f$ x\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value -with respect to a given absolute precision. +A model of `AlgebraicKernel_d_2::ApproximateAbsoluteX_2` is an `AdaptableBinaryFunction` that computes an +approximation of the \f$ x\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value +with respect to a given absolute precision. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::ApproximateRelativeX_2` \sa `AlgebraicKernel_d_1::ApproximateAbsolute_1` @@ -18,45 +18,45 @@ with respect to a given absolute precision. class AlgebraicKernel_d_2::ApproximateAbsoluteX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef int second_argument_type; +*/ +typedef int second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, -where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents -the upper approximation. The pair \f$ p\f$ approximates the \f$ x\f$-coordinate \f$ x\f$ -of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to -the absolute precision \f$ a\f$. -\post \f$ p.first <= x \f$ -\post \f$ x <= p.second \f$ -\post \f$ (x - p.first) <= 2^{-a} \f$ -\post \f$ (p.second - x) <= 2^{-a} \f$ - -*/ -result_type -operator()(const first_argument_type & v, -const second_argument_type & a ); +The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, +where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents +the upper approximation. The pair \f$ p\f$ approximates the \f$ x\f$-coordinate \f$ x\f$ +of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to +the absolute precision \f$ a\f$. +\post \f$ p.first <= x \f$ +\post \f$ x <= p.second \f$ +\post \f$ (x - p.first) <= 2^{-a} \f$ +\post \f$ (p.second - x) <= 2^{-a} \f$ + +*/ +result_type +operator()(const first_argument_type & v, +const second_argument_type & a ); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h index 298cf2ea7a25..934ba0bdeb4f 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -A model of `AlgebraicKernel_d_2::ApproximateAbsoluteY_2` is an `AdaptableBinaryFunction` that computes an -approximation of the \f$ y\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value -with respect to a given absolute precision. +A model of `AlgebraicKernel_d_2::ApproximateAbsoluteY_2` is an `AdaptableBinaryFunction` that computes an +approximation of the \f$ y\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value +with respect to a given absolute precision. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::ApproximateRelativeY_2` \sa `AlgebraicKernel_d_1::ApproximateAbsolute_1` @@ -18,45 +18,45 @@ with respect to a given absolute precision. class AlgebraicKernel_d_2::ApproximateAbsoluteY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef int second_argument_type; +*/ +typedef int second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, -where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents -the upper approximation. The pair \f$ p\f$ approximates the \f$ y\f$-coordinate \f$ y\f$ -of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to -the absolute precision \f$ a\f$. -\post \f$ p.first <= y \f$ -\post \f$ y <= p.second \f$ -\post \f$ (y - p.first) <= 2^{-a} \f$ -\post \f$ (p.second - y) <= 2^{-a} \f$ - -*/ -result_type -operator()(const first_argument_type & v, -const second_argument_type & a ); +The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, +where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents +the upper approximation. The pair \f$ p\f$ approximates the \f$ y\f$-coordinate \f$ y\f$ +of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to +the absolute precision \f$ a\f$. +\post \f$ p.first <= y \f$ +\post \f$ y <= p.second \f$ +\post \f$ (y - p.first) <= 2^{-a} \f$ +\post \f$ (p.second - y) <= 2^{-a} \f$ + +*/ +result_type +operator()(const first_argument_type & v, +const second_argument_type & a ); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h index 0b07fdbdf847..c19a7d3407aa 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -A model of `AlgebraicKernel_d_2::ApproximateRelativeX_2` is an `AdaptableBinaryFunction` that computes an -approximation of the \f$ x\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value -with respect to a given relative precision. +A model of `AlgebraicKernel_d_2::ApproximateRelativeX_2` is an `AdaptableBinaryFunction` that computes an +approximation of the \f$ x\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value +with respect to a given relative precision. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::ApproximateAbsoluteY_2` \sa `AlgebraicKernel_d_1::ApproximateAbsolute_1` @@ -18,45 +18,45 @@ with respect to a given relative precision. class AlgebraicKernel_d_2::ApproximateRelativeX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef int second_argument_type; +*/ +typedef int second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, -where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents -the upper approximation. The pair \f$ p\f$ approximates the \f$ x\f$-coordinate \f$ x\f$ -of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to -the relative precision \f$ a\f$. -\post \f$ p.first <= x \f$ -\post \f$ x <= p.second \f$ -\post \f$ (x - p.first) <= 2^{-a} |x|\f$ -\post \f$ (p.second - x) <= 2^{-a} |x|\f$ - -*/ -result_type -operator()(const first_argument_type & v, -const second_argument_type & a ); +The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, +where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents +the upper approximation. The pair \f$ p\f$ approximates the \f$ x\f$-coordinate \f$ x\f$ +of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to +the relative precision \f$ a\f$. +\post \f$ p.first <= x \f$ +\post \f$ x <= p.second \f$ +\post \f$ (x - p.first) <= 2^{-a} |x|\f$ +\post \f$ (p.second - x) <= 2^{-a} |x|\f$ + +*/ +result_type +operator()(const first_argument_type & v, +const second_argument_type & a ); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h index 00676a98ded3..d666401a9e47 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -A model of `AlgebraicKernel_d_2::ApproximateRelativeY_2` is an `AdaptableBinaryFunction` that computes an -approximation of the \f$ y\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value -with respect to a given relative precision. +A model of `AlgebraicKernel_d_2::ApproximateRelativeY_2` is an `AdaptableBinaryFunction` that computes an +approximation of the \f$ y\f$-coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` value +with respect to a given relative precision. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::ApproximateAbsoluteY_2` \sa `AlgebraicKernel_d_1::ApproximateAbsolute_1` @@ -18,45 +18,45 @@ with respect to a given relative precision. class AlgebraicKernel_d_2::ApproximateRelativeY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef int second_argument_type; +*/ +typedef int second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, -where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents -the upper approximation. The pair \f$ p\f$ approximates the \f$ y\f$-coordinate \f$ y\f$ -of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to -the relative precision \f$ a\f$. -\post \f$ p.first <= y \f$ -\post \f$ y <= p.second \f$ -\post \f$ (y - p.first) <= 2^{-a} |y|\f$ -\post \f$ (p.second - y) <= 2^{-a} |y|\f$ - -*/ -result_type -operator()(const first_argument_type & v, -const second_argument_type & a ); +The function computes a pair \f$ p\f$ of `AlgebraicKernel_d_1::Bound`, +where \f$ p.first\f$ represents the lower approximation and \f$ p.second\f$ represents +the upper approximation. The pair \f$ p\f$ approximates the \f$ y\f$-coordinate \f$ y\f$ +of the `AlgebraicKernel_d_2::Algebraic_real_2` value \f$ v\f$ with respect to +the relative precision \f$ a\f$. +\post \f$ p.first <= y \f$ +\post \f$ y <= p.second \f$ +\post \f$ (y - p.first) <= 2^{-a} |y|\f$ +\post \f$ (p.second - y) <= 2^{-a} |y|\f$ + +*/ +result_type +operator()(const first_argument_type & v, +const second_argument_type & a ); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h index ccaac45c12b6..73f949503310 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes a number of type -`AlgebraicKernel_d_1::Bound` in-between the first coordinates of two -`AlgebraicKernel_d_2::AlgebraicReal_2`. +Computes a number of type +`AlgebraicKernel_d_1::Bound` in-between the first coordinates of two +`AlgebraicKernel_d_2::AlgebraicReal_2`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::BoundBetweenY_2` @@ -16,39 +16,39 @@ Computes a number of type class AlgebraicKernel_d_2::BoundBetweenX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Bound result_type; +*/ +typedef AlgebraicKernel_d_1::Bound result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes a number of type `AlgebraicKernel_d_1::Bound` -in-between the first coordinates of \f$ a\f$ and \f$ b\f$. -\pre \f$ a_x \neq b_x\f$. +Computes a number of type `AlgebraicKernel_d_1::Bound` +in-between the first coordinates of \f$ a\f$ and \f$ b\f$. +\pre \f$ a_x \neq b_x\f$. -*/ -result_type -operator()(const first_argument_type & a, -const second_argument_type & b); +*/ +result_type +operator()(const first_argument_type & a, +const second_argument_type & b); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h index 901c3162d970..abfa45a09c3c 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes a number of type -`AlgebraicKernel_d_1::Bound` in-between the second coordinates of two -`AlgebraicKernel_d_2::AlgebraicReal_2`. +Computes a number of type +`AlgebraicKernel_d_1::Bound` in-between the second coordinates of two +`AlgebraicKernel_d_2::AlgebraicReal_2`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::BoundBetweenX_2` @@ -16,39 +16,39 @@ Computes a number of type class AlgebraicKernel_d_2::BoundBetweenY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Bound result_type; +*/ +typedef AlgebraicKernel_d_1::Bound result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes a number of type `AlgebraicKernel_d_1::Bound` -in-between the second coordinates of \f$ a\f$ and \f$ b\f$. -\pre \f$ a_y \neq b_y\f$. +Computes a number of type `AlgebraicKernel_d_1::Bound` +in-between the second coordinates of \f$ a\f$ and \f$ b\f$. +\pre \f$ a_y \neq b_y\f$. -*/ -result_type -operator()(const first_argument_type & a, -const second_argument_type & b); +*/ +result_type +operator()(const first_argument_type & a, +const second_argument_type & b); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h index c8bb07c059d4..6ca57ad52eba 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Compares `AlgebraicKernel_d_2::Algebraic_real_2`s lexicographically. +Compares `AlgebraicKernel_d_2::Algebraic_real_2`s lexicographically. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::CompareX_2` \sa `AlgebraicKernel_d_2::CompareY_2` @@ -15,54 +15,54 @@ Compares `AlgebraicKernel_d_2::Algebraic_real_2`s lexicographically. class AlgebraicKernel_d_2::CompareXY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Comparison_result` -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Comparison_result` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Compares \f$ a\f$ and \f$ b\f$ lexicographically. -*/ -result_type operator()(const first_argument_type & a, const second_argument_type & b); +Compares \f$ a\f$ and \f$ b\f$ lexicographically. +*/ +result_type operator()(const first_argument_type & a, const second_argument_type & b); /*! -Compares \f$ a\f$ with \f$ (x,y)\f$ lexicographically. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, int x, int y); +Compares \f$ a\f$ with \f$ (x,y)\f$ lexicographically. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, int x, int y); /*! -Compares \f$ a\f$ with \f$ (x,y)\f$ lexicographically. -*/ -result_type operator()( -AlgebraicKernel_d_2::Algebraic_real_2 a, -AlgebraicKernel_d_2::Bound x, -AlgebraicKernel_d_2::Bound y); +Compares \f$ a\f$ with \f$ (x,y)\f$ lexicographically. +*/ +result_type operator()( +AlgebraicKernel_d_2::Algebraic_real_2 a, +AlgebraicKernel_d_2::Bound x, +AlgebraicKernel_d_2::Bound y); /*! -Compares \f$ a\f$ with \f$ (x,y)\f$ lexicographically. -*/ -result_type operator()( -AlgebraicKernel_d_2::Algebraic_real_2 a, -AlgebraicKernel_d_2::Coefficient x, -AlgebraicKernel_d_2::Coefficient y); +Compares \f$ a\f$ with \f$ (x,y)\f$ lexicographically. +*/ +result_type operator()( +AlgebraicKernel_d_2::Algebraic_real_2 a, +AlgebraicKernel_d_2::Coefficient x, +AlgebraicKernel_d_2::Coefficient y); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h index 380aded006c8..efbbae9df514 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Compares the first coordinates of `AlgebraicKernel_d_2::Algebraic_real_2`s. +Compares the first coordinates of `AlgebraicKernel_d_2::Algebraic_real_2`s. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::CompareY_2` \sa `AlgebraicKernel_d_2::CompareXY_2` @@ -15,54 +15,54 @@ Compares the first coordinates of `AlgebraicKernel_d_2::Algebraic_real_2`s. class AlgebraicKernel_d_2::CompareX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Comparison_result` -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Comparison_result` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// The following operators and their symmetric counterparts are required: /// @{ /*! -Compares the first coordinates of \f$ a\f$ and \f$ b\f$. -*/ -result_type operator()(const first_argument_type & a, const second_argument_type & b); +Compares the first coordinates of \f$ a\f$ and \f$ b\f$. +*/ +result_type operator()(const first_argument_type & a, const second_argument_type & b); /*! -Compares the first coordinate of \f$ a\f$ with \f$ x\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, int x); +Compares the first coordinate of \f$ a\f$ with \f$ x\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, int x); /*! -Compares the first coordinate of \f$ a\f$ with \f$ x\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Bound x); +Compares the first coordinate of \f$ a\f$ with \f$ x\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Bound x); /*! -Compares the first coordinate of \f$ a\f$ with \f$ x\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Coefficient x); +Compares the first coordinate of \f$ a\f$ with \f$ x\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Coefficient x); /*! -Compares the first coordinate of \f$ a\f$ with \f$ x\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Algebraic_real_1 x); +Compares the first coordinate of \f$ a\f$ with \f$ x\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Algebraic_real_1 x); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h index 6c58335c8a88..5b1728385683 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Compares the second coordinated of `AlgebraicKernel_d_2::Algebraic_real_2`s. +Compares the second coordinated of `AlgebraicKernel_d_2::Algebraic_real_2`s. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::CompareX_2` \sa `AlgebraicKernel_d_2::CompareXY_2` @@ -15,54 +15,54 @@ Compares the second coordinated of `AlgebraicKernel_d_2::Algebraic_real_2`s. class AlgebraicKernel_d_2::CompareY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Comparison_result` -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Comparison_result` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// The following operators and their symmetric counterparts are required: /// @{ /*! -Compares the second coordinates of \f$ a\f$ and \f$ b\f$. -*/ -result_type operator()(const first_argument_type & a, const second_argument_type & b); +Compares the second coordinates of \f$ a\f$ and \f$ b\f$. +*/ +result_type operator()(const first_argument_type & a, const second_argument_type & b); /*! -Compares the second coordinate of \f$ a\f$ with \f$ y\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, int y); +Compares the second coordinate of \f$ a\f$ with \f$ y\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, int y); /*! -Compares the second coordinate of \f$ a\f$ with \f$ y\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Bound y); +Compares the second coordinate of \f$ a\f$ with \f$ y\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Bound y); /*! -Compares the second coordinate of \f$ a\f$ with \f$ y\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Coefficient y); +Compares the second coordinate of \f$ a\f$ with \f$ y\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Coefficient y); /*! -Compares the second coordinate of \f$ a\f$ with \f$ y\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Algebraic_real_1 y); +Compares the second coordinate of \f$ a\f$ with \f$ y\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Algebraic_real_1 y); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h index c412d6fce761..3ce2fb4357cf 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes a univariate square free polynomial \f$ p\f$, such that the first coordinate of -a given `AlgebraicKernel_d_2::Algebraic_real_2` is a real root of \f$ p\f$. +Computes a univariate square free polynomial \f$ p\f$, such that the first coordinate of +a given `AlgebraicKernel_d_2::Algebraic_real_2` is a real root of \f$ p\f$. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_2::ComputePolynomialY_2` @@ -15,29 +15,29 @@ a given `AlgebraicKernel_d_2::Algebraic_real_2` is a real root of \f$ p\f$. class AlgebraicKernel_d_2::ComputePolynomialX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_1 result_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_1 result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes a univariate square free polynomial \f$ p\f$, such that the first -coordinate of \f$ a\f$ is a real root of \f$ p\f$. -*/ -result_type operator()(argument_type a); +Computes a univariate square free polynomial \f$ p\f$, such that the first +coordinate of \f$ a\f$ is a real root of \f$ p\f$. +*/ +result_type operator()(argument_type a); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h index 7a9e46a4cbb6..da93c279b9dd 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes a univariate square free polynomial \f$ p\f$, such that the second coordinate of -a given `AlgebraicKernel_d_2::Algebraic_real_2` is a real root of \f$ p\f$. +Computes a univariate square free polynomial \f$ p\f$, such that the second coordinate of +a given `AlgebraicKernel_d_2::Algebraic_real_2` is a real root of \f$ p\f$. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_2::ComputePolynomialX_2` @@ -15,29 +15,29 @@ a given `AlgebraicKernel_d_2::Algebraic_real_2` is a real root of \f$ p\f$. class AlgebraicKernel_d_2::ComputePolynomialY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_1 result_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_1 result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes a univariate square free polynomial \f$ p\f$, such that the second coordinate of \f$ a\f$ -is a real root of \f$ p\f$. -*/ -result_type operator()(argument_type a); +Computes a univariate square free polynomial \f$ p\f$, such that the second coordinate of \f$ a\f$ +is a real root of \f$ p\f$. +*/ +result_type operator()(argument_type a); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h index 3f3b19583ec9..fd5f1beb55c5 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes the first coordinate of an -`AlgebraicKernel_d_2::AlgebraicReal_2`. +Computes the first coordinate of an +`AlgebraicKernel_d_2::AlgebraicReal_2`. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_2::ComputeY_2` @@ -15,31 +15,31 @@ Computes the first coordinate of an class AlgebraicKernel_d_2::ComputeX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_1 result_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_1 result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// A model of this type must provide: /// @{ /*! -Computes the first coordinate of \f$ a\f$. +Computes the first coordinate of \f$ a\f$. -*/ -result_type operator()(const argument_type & a); +*/ +result_type operator()(const argument_type & a); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h index 5edc195f8a68..1452d243f958 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes the second coordinate of an -`AlgebraicKernel_d_2::AlgebraicReal_2`. +Computes the second coordinate of an +`AlgebraicKernel_d_2::AlgebraicReal_2`. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_2::ComputeY_2` @@ -15,31 +15,31 @@ Computes the second coordinate of an class AlgebraicKernel_d_2::ComputeY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_1 result_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_1 result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// A model of this type must provide: /// @{ /*! -Computes the second coordinate of \f$ a\f$. +Computes the second coordinate of \f$ a\f$. -*/ -result_type operator()(const argument_type & a); +*/ +result_type operator()(const argument_type & a); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h index 4eaaeda2f26f..4ebd692fd83f 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Constructs an `AlgebraicKernel_d_2::Algebraic_real_2`. +Constructs an `AlgebraicKernel_d_2::Algebraic_real_2`. -\cgalRefines `AdaptableFunctor` +\cgalRefines `AdaptableFunctor` \sa `AlgebraicKernel_d_1::ConstructAlgebraicReal_1` @@ -14,74 +14,74 @@ Constructs an `AlgebraicKernel_d_2::Algebraic_real_2`. class AlgebraicKernel_d_2::ConstructAlgebraicReal_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 result_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 result_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. -*/ -result_type operator()(int x, int y); +introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. +*/ +result_type operator()(int x, int y); /*! -introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Bound x,AlgebraicKernel_d_2::Bound y); +introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Bound x,AlgebraicKernel_d_2::Bound y); /*! -introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Coefficient x,AlgebraicKernel_d_2::Coefficient y); +introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Coefficient x,AlgebraicKernel_d_2::Coefficient y); /*! -introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. -*/ -result_type operator()(AlgebraicKernel_d_2::Algebraic_real_1 x,AlgebraicKernel_d_2::Algebraic_real_1 y); +introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to \f$ (x,y)\f$. +*/ +result_type operator()(AlgebraicKernel_d_2::Algebraic_real_1 x,AlgebraicKernel_d_2::Algebraic_real_1 y); /*! -introduces an `AlgebraicKernel_d_2::Algebraic_real_2` -initialized to the \f$ i\f$-th real common solution of \f$ f\f$ and \f$ g\f$, -with respect to `xy`-lexicographic order. -The index starts at \f$ 0\f$, that is, the system must have at least \f$ i+1\f$ real solutions. -\pre \f$ f\f$ is square free. -\pre \f$ g\f$ is square free. -\pre \f$ f\f$ and \f$ g\f$ are coprime. +introduces an `AlgebraicKernel_d_2::Algebraic_real_2` +initialized to the \f$ i\f$-th real common solution of \f$ f\f$ and \f$ g\f$, +with respect to `xy`-lexicographic order. +The index starts at \f$ 0\f$, that is, the system must have at least \f$ i+1\f$ real solutions. +\pre \f$ f\f$ is square free. +\pre \f$ g\f$ is square free. +\pre \f$ f\f$ and \f$ g\f$ are coprime. -*/ -result_type operator()( -AlgebraicKernel_d_2::Polynomial_2 f, -AlgebraicKernel_d_2::Polynomial_2 g, -AlgebraicKernel_d_2::size_type i); +*/ +result_type operator()( +AlgebraicKernel_d_2::Polynomial_2 f, +AlgebraicKernel_d_2::Polynomial_2 g, +AlgebraicKernel_d_2::size_type i); /*! -introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to the only real intersection of -\f$ f\f$ and \f$ g\f$ in the open box \f$ B = (x_l,x_u)\times(y_l,y_u)\f$. -\pre \f$ x_l < x_u\f$ -\pre \f$ y_l < y_u\f$ -\pre \f$ f\f$ is square free. -\pre \f$ g\f$ is square free. -\pre \f$ f\f$ and \f$ g\f$ are coprime. -\pre \f$ f\f$ and \f$ g\f$ have exactly one common solution in \f$ B\f$ -\pre \f$ f\f$ and \f$ g\f$ have no common solution on \f$ \partial B\f$ - -*/ -result_type operator()( -AlgebraicKernel_d_2::Polynomial_2 f, -AlgebraicKernel_d_2::Polynomial_2 g, -AlgebraicKernel_d_2::Bound x_l, -AlgebraicKernel_d_2::Bound x_u, -AlgebraicKernel_d_2::Bound y_l, -AlgebraicKernel_d_2::Bound y_u); +introduces an `AlgebraicKernel_d_2::Algebraic_real_2` initialized to the only real intersection of +\f$ f\f$ and \f$ g\f$ in the open box \f$ B = (x_l,x_u)\times(y_l,y_u)\f$. +\pre \f$ x_l < x_u\f$ +\pre \f$ y_l < y_u\f$ +\pre \f$ f\f$ is square free. +\pre \f$ g\f$ is square free. +\pre \f$ f\f$ and \f$ g\f$ are coprime. +\pre \f$ f\f$ and \f$ g\f$ have exactly one common solution in \f$ B\f$ +\pre \f$ f\f$ and \f$ g\f$ have no common solution on \f$ \partial B\f$ + +*/ +result_type operator()( +AlgebraicKernel_d_2::Polynomial_2 f, +AlgebraicKernel_d_2::Polynomial_2 g, +AlgebraicKernel_d_2::Bound x_l, +AlgebraicKernel_d_2::Bound x_u, +AlgebraicKernel_d_2::Bound y_l, +AlgebraicKernel_d_2::Bound y_u); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h index 70e920f5abc7..350d11d07259 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes whether a given pair of bivariate polynomials is coprime. +Computes whether a given pair of bivariate polynomials is coprime. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::MakeCoprime_2` @@ -14,35 +14,35 @@ Computes whether a given pair of bivariate polynomials is coprime. class AlgebraicKernel_d_2::IsCoprime_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef bool result_type; +*/ +typedef bool result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes whether \f$ f\f$ and \f$ g\f$ are coprime. -*/ -result_type -operator()(const first_argument_type& p1, -const second_argument_type& p2); +Computes whether \f$ f\f$ and \f$ g\f$ are coprime. +*/ +result_type +operator()(const first_argument_type& p1, +const second_argument_type& p2); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h index bd8fb58f5889..d7d7d953f91b 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes whether the given bivariate polynomial is square free. +Computes whether the given bivariate polynomial is square free. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_2::MakeSquareFree_2` \sa `AlgebraicKernel_d_2::SquareFreeFactorize_2` @@ -15,29 +15,29 @@ Computes whether the given bivariate polynomial is square free. class AlgebraicKernel_d_2::IsSquareFree_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef bool result_type; +*/ +typedef bool result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes whether \f$ p\f$ is square free. -*/ -result_type operator()(const argument_type& p); +Computes whether \f$ p\f$ is square free. +*/ +result_type operator()(const argument_type& p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h index bd7871600c62..7102e0a0a0f6 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes whether an `AlgebraicKernel_d_2::Polynomial_2` -is zero at a given `AlgebraicKernel_d_2::Algebraic_real_2`. +Computes whether an `AlgebraicKernel_d_2::Polynomial_2` +is zero at a given `AlgebraicKernel_d_2::Algebraic_real_2`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::SignAt_2` \sa `AlgebraicKernel_d_1::IsZeroAt_1` @@ -16,35 +16,35 @@ is zero at a given `AlgebraicKernel_d_2::Algebraic_real_2`. class AlgebraicKernel_d_2::IsZeroAt_2 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `bool` -*/ -typedef unspecified_type result_type; +Type convertible to `bool` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes whether \f$ p\f$ is zero at \f$ a\f$. -*/ -result_type -operator()(const first_argument_type & p, -const second_argument_type & a); +Computes whether \f$ p\f$ is zero at \f$ a\f$. +*/ +result_type +operator()(const first_argument_type & p, +const second_argument_type & a); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h index 5574fa4db2d2..e53144c26217 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes an isolating interval for the first coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` -with respect to the real roots of a univariate polynomial. +Computes an isolating interval for the first coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` +with respect to the real roots of a univariate polynomial. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::IsolateY_2` \sa `AlgebraicKernel_d_2::ComputePolynomialX_2` @@ -17,37 +17,37 @@ with respect to the real roots of a univariate polynomial. class AlgebraicKernel_d_2::IsolateX_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes an open isolating interval \f$ I=(l,u)\f$ for the first coordinate \f$ x\f$ of \f$ a\f$ with respect to the real roots of \f$ p\f$. -It is not required that \f$ x\f$ is a root of \f$ p\f$. -\post \f$ x \in I\f$. -\post \f$ p(\alpha) \neq0 | \forall\alpha\in\overline{I}\backslash x\f$. +Computes an open isolating interval \f$ I=(l,u)\f$ for the first coordinate \f$ x\f$ of \f$ a\f$ with respect to the real roots of \f$ p\f$. +It is not required that \f$ x\f$ is a root of \f$ p\f$. +\post \f$ x \in I\f$. +\post \f$ p(\alpha) \neq0 | \forall\alpha\in\overline{I}\backslash x\f$. -*/ -result_type operator()(first_argument_type a, second_argument_type p); +*/ +result_type operator()(first_argument_type a, second_argument_type p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h index 0d5e978d9410..257eeca6c41c 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h @@ -3,10 +3,10 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes an isolating interval for the second coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` -with respect to the real roots of a univariate polynomial. +Computes an isolating interval for the second coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` +with respect to the real roots of a univariate polynomial. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::IsolateX_2` \sa `AlgebraicKernel_d_2::ComputePolynomialX_2` @@ -17,37 +17,37 @@ with respect to the real roots of a univariate polynomial. class AlgebraicKernel_d_2::IsolateY_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef std::pair result_type; +*/ +typedef std::pair result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_1 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes an open isolating interval \f$ I=(l,u)\f$ for the second coordinate \f$ y\f$ of \f$ a\f$ with respect to the real roots of \f$ p\f$. -It is not required that \f$ x\f$ is a root of \f$ p\f$. -\post \f$ y \in I\f$. -\post \f$ p(\alpha) \neq0 | \forall\alpha\in\overline{I}\backslash y\f$. +Computes an open isolating interval \f$ I=(l,u)\f$ for the second coordinate \f$ y\f$ of \f$ a\f$ with respect to the real roots of \f$ p\f$. +It is not required that \f$ x\f$ is a root of \f$ p\f$. +\post \f$ y \in I\f$. +\post \f$ p(\alpha) \neq0 | \forall\alpha\in\overline{I}\backslash y\f$. -*/ -result_type operator()(first_argument_type a, second_argument_type p); +*/ +result_type operator()(first_argument_type a, second_argument_type p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h index 155bdbf65d5c..f07cfb83469c 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h @@ -3,17 +3,17 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes for a given pair of bivariate polynomials \f$ p_1\f$, \f$ p_2\f$ their -common part \f$ g\f$ and coprime parts \f$ q_1\f$, \f$ q_2\f$ respectively. +Computes for a given pair of bivariate polynomials \f$ p_1\f$, \f$ p_2\f$ their +common part \f$ g\f$ and coprime parts \f$ q_1\f$, \f$ q_2\f$ respectively. -That is, it computes \f$ g, q_1, q_2\f$ such that: +That is, it computes \f$ g, q_1, q_2\f$ such that: -\f$ c_1 \cdot p_1 = g \cdot q_1\f$ for some constant \f$ c_1\f$ and +\f$ c_1 \cdot p_1 = g \cdot q_1\f$ for some constant \f$ c_1\f$ and -\f$ c_2 \cdot p_2 = g \cdot q_2\f$ for some constant \f$ c_2\f$, -such that \f$ q_1\f$ and \f$ q_2\f$ are coprime. +\f$ c_2 \cdot p_2 = g \cdot q_2\f$ for some constant \f$ c_2\f$, +such that \f$ q_1\f$ and \f$ q_2\f$ are coprime. -\cgalRefines `AdaptableFunctor` with five arguments +\cgalRefines `AdaptableFunctor` with five arguments \sa `AlgebraicKernel_d_2::IsCoprime_2` @@ -22,31 +22,31 @@ such that \f$ q_1\f$ and \f$ q_2\f$ are coprime. class AlgebraicKernel_d_2::MakeCoprime_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef bool result_type; +*/ +typedef bool result_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes \f$ g, q_1, q_2\f$ as described above. +Computes \f$ g, q_1, q_2\f$ as described above. -Returns whether \f$ p_1\f$ and \f$ p_2\f$ where already coprime. +Returns whether \f$ p_1\f$ and \f$ p_2\f$ where already coprime. -*/ -result_type -operator()(const AlgebraicKernel_d_2::Polynomial_2 & p1, -const AlgebraicKernel_d_2::Polynomial_2 & p2, -AlgebraicKernel_d_2::Polynomial_2 & g, -AlgebraicKernel_d_2::Polynomial_2 & q1, -AlgebraicKernel_d_2::Polynomial_2 & q2); +*/ +result_type +operator()(const AlgebraicKernel_d_2::Polynomial_2 & p1, +const AlgebraicKernel_d_2::Polynomial_2 & p2, +AlgebraicKernel_d_2::Polynomial_2 & g, +AlgebraicKernel_d_2::Polynomial_2 & q1, +AlgebraicKernel_d_2::Polynomial_2 & q2); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h index acf5ec20cf78..7fcfda1c043d 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Returns a square free part of a bivariate polynomial. +Returns a square free part of a bivariate polynomial. -\cgalRefines `AdaptableUnaryFunction` +\cgalRefines `AdaptableUnaryFunction` \sa `AlgebraicKernel_d_2::IsSquareFree_2` \sa `AlgebraicKernel_d_2::SquareFreeFactorize_2` @@ -15,29 +15,29 @@ Returns a square free part of a bivariate polynomial. class AlgebraicKernel_d_2::MakeSquareFree_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 result_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns a square free part of \f$ p\f$. -*/ -result_type operator()(const argument_type& p); +Returns a square free part of \f$ p\f$. +*/ +result_type operator()(const argument_type& p); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h index 9d89a8a885f4..ab188387ae26 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h @@ -3,9 +3,9 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes the number of real solutions of the given bivariate polynomial system. +Computes the number of real solutions of the given bivariate polynomial system. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::ConstructAlgebraicReal_2` @@ -14,37 +14,37 @@ Computes the number of real solutions of the given bivariate polynomial system. class AlgebraicKernel_d_2::NumberOfSolutions_2 { public: -/// \name Types +/// \name Types /// A model of this type must provide: /// @{ /*! -*/ -typedef AlgebraicKernel_d_2::size_type result_type; +*/ +typedef AlgebraicKernel_d_2::size_type result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the number of real solutions of the bivariate polynomial system \f$ (f,g)\f$. -\pre \f$ f\f$ is square free. -\pre \f$ g\f$ is square free. -\pre \f$ f\f$ and \f$ g\f$ are coprime. -*/ -result_type operator()(first_argument_type f, second_argument_type g); +Returns the number of real solutions of the bivariate polynomial system \f$ (f,g)\f$. +\pre \f$ f\f$ is square free. +\pre \f$ g\f$ is square free. +\pre \f$ f\f$ and \f$ g\f$ are coprime. +*/ +result_type operator()(first_argument_type f, second_argument_type g); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h index c63604b2d386..ec661097621e 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h @@ -3,11 +3,11 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes the sign of a bivariate polynomial -`AlgebraicKernel_d_2::Polynomial_2` at a value of type -`AlgebraicKernel_d_2::Algebraic_real_2`. +Computes the sign of a bivariate polynomial +`AlgebraicKernel_d_2::Polynomial_2` at a value of type +`AlgebraicKernel_d_2::Algebraic_real_2`. -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` \sa `AlgebraicKernel_d_2::IsZeroAt_2` \sa `AlgebraicKernel_d_1::SignAt_1` @@ -17,34 +17,34 @@ Computes the sign of a bivariate polynomial class AlgebraicKernel_d_2::SignAt_2 { public: -/// \name Types +/// \name Types /// @{ /*! -Type convertible to `CGAL::Sign` -*/ -typedef unspecified_type result_type; +Type convertible to `CGAL::Sign` +*/ +typedef unspecified_type result_type; /*! -*/ -typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; +*/ +typedef AlgebraicKernel_d_2::Polynomial_2 first_argument_type; /*! -*/ -typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; +*/ +typedef AlgebraicKernel_d_2::Algebraic_real_2 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Computes the sign of a bivariate polynomial \f$ p\f$ evaluated at \f$ a\f$. -*/ -result_type -operator()(const first_argument_type & p, const second_argument_type & a); +Computes the sign of a bivariate polynomial \f$ p\f$ evaluated at \f$ a\f$. +*/ +result_type +operator()(const first_argument_type & p, const second_argument_type & a); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h index fefefd5b3226..64b81633bcf7 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h @@ -3,50 +3,50 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes the real zero-dimensional solutions of a bivariate polynomial system. -The multiplicity stored in the output iterator is the multiplicity in the system. +Computes the real zero-dimensional solutions of a bivariate polynomial system. +The multiplicity stored in the output iterator is the multiplicity in the system. -\cgalRefines `Assignable` -\cgalRefines `CopyConstructible` +\cgalRefines `Assignable` +\cgalRefines `CopyConstructible` */ class AlgebraicKernel_d_2::Solve_2 { public: -/// \name Operations -/// A model of this type must provide: +/// \name Operations +/// A model of this type must provide: /// @{ /*! -Computes all common solutions of \f$ f\f$ and \f$ g\f$ with multiplicity, and copies them as objects of type -`std::pair` in `res`. -\pre \f$ f\f$ is square free. -\pre \f$ g\f$ is square free. -\pre \f$ f\f$ and \f$ g\f$ are coprime. - -*/ -template < class OutputIterator > -OutputIterator -operator()( -AlgebraicKernel_d_2::Polynomial_2 f, -AlgebraicKernel_d_2::Polynomial_2 g, -OutputIterator res ); +Computes all common solutions of \f$ f\f$ and \f$ g\f$ with multiplicity, and copies them as objects of type +`std::pair` in `res`. +\pre \f$ f\f$ is square free. +\pre \f$ g\f$ is square free. +\pre \f$ f\f$ and \f$ g\f$ are coprime. + +*/ +template < class OutputIterator > +OutputIterator +operator()( +AlgebraicKernel_d_2::Polynomial_2 f, +AlgebraicKernel_d_2::Polynomial_2 g, +OutputIterator res ); /*! -Computes all common solutions of \f$ f\f$ and \f$ g\f$ in the closed box \f$ [xl,xu]\times[yl,yu]\f$, and copies them as objects of -type `std::pair` in `res`. -\pre \f$ f\f$ is square free. -\pre \f$ g\f$ is square free. -\pre \f$ f\f$ and \f$ g\f$ are coprime. - -*/ -template < class OutputIterator > OutputIterator operator()( -AlgebraicKernel_d_2::Polynomial_2 f, -AlgebraicKernel_d_2::Polynomial_2 g, -AlgebraicKernel_d_2::Bound xl, -AlgebraicKernel_d_2::Bound xu, -AlgebraicKernel_d_2::Bound yl, -AlgebraicKernel_d_2::Bound yu, -OutputIterator res); +Computes all common solutions of \f$ f\f$ and \f$ g\f$ in the closed box \f$ [xl,xu]\times[yl,yu]\f$, and copies them as objects of +type `std::pair` in `res`. +\pre \f$ f\f$ is square free. +\pre \f$ g\f$ is square free. +\pre \f$ f\f$ and \f$ g\f$ are coprime. + +*/ +template < class OutputIterator > OutputIterator operator()( +AlgebraicKernel_d_2::Polynomial_2 f, +AlgebraicKernel_d_2::Polynomial_2 g, +AlgebraicKernel_d_2::Bound xl, +AlgebraicKernel_d_2::Bound xu, +AlgebraicKernel_d_2::Bound yl, +AlgebraicKernel_d_2::Bound yu, +OutputIterator res); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h index 48a73376c7ca..f83faaa1561e 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h @@ -3,19 +3,19 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -Computes a square free factorization of an -`AlgebraicKernel_d_2::Polynomial_2`. +Computes a square free factorization of an +`AlgebraicKernel_d_2::Polynomial_2`. -A polynomial \f$ p\f$ is factored into square free and pairwise -coprime non-constant factors \f$ q_i\f$ with multiplicities \f$ m_i\f$ -and a constant factor \f$ c\f$, such that -\f$ p = c \cdot q_1^{m_1} \cdot ... \cdot q_n^{m_n}\f$. +A polynomial \f$ p\f$ is factored into square free and pairwise +coprime non-constant factors \f$ q_i\f$ with multiplicities \f$ m_i\f$ +and a constant factor \f$ c\f$, such that +\f$ p = c \cdot q_1^{m_1} \cdot ... \cdot q_n^{m_n}\f$. -The factor multiplicity pairs \f$ \f$ are written to the -given output iterator. The constant factor \f$ c\f$ is not computed. +The factor multiplicity pairs \f$ \f$ are written to the +given output iterator. The constant factor \f$ c\f$ is not computed. -\cgalRefines `Assignable` -\cgalRefines `CopyConstructible` +\cgalRefines `Assignable` +\cgalRefines `CopyConstructible` \sa `AlgebraicKernel_d_2::IsSquareFree_2` \sa `AlgebraicKernel_d_2::MakeSquareFree_2` @@ -25,17 +25,17 @@ given output iterator. The constant factor \f$ c\f$ is not computed. class AlgebraicKernel_d_2::SquareFreeFactorize_2 { public: -/// \name Operations +/// \name Operations /// @{ /*! -Copies in the output iterator the factors of a square free -factorization of \f$ p\f$, with their multiplicity, as objects of type -`std::pair`. -*/ -template < class OutputIterator > -OutputIterator -operator()(const AlgebraicKernel_d_2::Polynomial_2& p, OutputIterator res); +Copies in the output iterator the factors of a square free +factorization of \f$ p\f$, with their multiplicity, as objects of type +`std::pair`. +*/ +template < class OutputIterator > +OutputIterator +operator()(const AlgebraicKernel_d_2::Polynomial_2& p, OutputIterator res); /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h index 53d701efa69c..e0a5888020a7 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h @@ -3,12 +3,12 @@ \ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept -A model of the `AlgebraicKernel_d_2` concept gathers necessary tools -for solving and handling bivariate polynomial systems of general degree \f$ d\f$. +A model of the `AlgebraicKernel_d_2` concept gathers necessary tools +for solving and handling bivariate polynomial systems of general degree \f$ d\f$. -\cgalRefines `AlgebraicKernel_d_1` -\cgalRefines `CopyConstructible` -\cgalRefines `Assignable` +\cgalRefines `AlgebraicKernel_d_1` +\cgalRefines `CopyConstructible` +\cgalRefines `Assignable` \sa `AlgebraicKernel_d_1` @@ -17,150 +17,150 @@ for solving and handling bivariate polynomial systems of general degree \f$ d\f$ class AlgebraicKernel_d_2 { public: -/// \name Types +/// \name Types /// @{ /*! -A bivariate polynomial that is a model of `Polynomial_d`, +A bivariate polynomial that is a model of `Polynomial_d`, where \link PolynomialTraits_d::Innermost_coefficient_type `CGAL::Polynomial_traits_d::Innermost_coefficient_type` \endlink -is `AlgebraicKernel_d_1::Coefficient`. +is `AlgebraicKernel_d_1::Coefficient`. -*/ -typedef unspecified_type Polynomial_2; +*/ +typedef unspecified_type Polynomial_2; /*! -A type that is used to represent real solutions of bivariate zero dimensional polynomial systems. -A model of `DefaultConstructible`, `CopyConstructible` and -`Assignable`. +A type that is used to represent real solutions of bivariate zero dimensional polynomial systems. +A model of `DefaultConstructible`, `CopyConstructible` and +`Assignable`. -*/ -typedef unspecified_type Algebraic_real_2; +*/ +typedef unspecified_type Algebraic_real_2; -/// @} +/// @} -/// \name Functors +/// \name Functors /// @{ /*! -A model of `AlgebraicKernel_d_2::ConstructAlgebraicReal_2`. -*/ -typedef unspecified_type Construct_algebraic_real_2; +A model of `AlgebraicKernel_d_2::ConstructAlgebraicReal_2`. +*/ +typedef unspecified_type Construct_algebraic_real_2; /*! -A model of `AlgebraicKernel_d_2::ComputePolynomialX_2`. -*/ -typedef unspecified_type Compute_polynomial_x_2; +A model of `AlgebraicKernel_d_2::ComputePolynomialX_2`. +*/ +typedef unspecified_type Compute_polynomial_x_2; /*! -A model of `AlgebraicKernel_d_2::ComputePolynomialY_2`. -*/ -typedef unspecified_type Compute_polynomial_y_2; +A model of `AlgebraicKernel_d_2::ComputePolynomialY_2`. +*/ +typedef unspecified_type Compute_polynomial_y_2; /*! -A model of `AlgebraicKernel_d_2::Isolate_2`. -*/ -typedef unspecified_type Isolate_2; +A model of `AlgebraicKernel_d_2::Isolate_2`. +*/ +typedef unspecified_type Isolate_2; /*! -A model of `AlgebraicKernel_d_2::IsolateX_2`. -*/ -typedef unspecified_type Isolate_x_2; +A model of `AlgebraicKernel_d_2::IsolateX_2`. +*/ +typedef unspecified_type Isolate_x_2; /*! -A model of `AlgebraicKernel_d_2::IsolateY_2`. -*/ -typedef unspecified_type Isolate_y_2; +A model of `AlgebraicKernel_d_2::IsolateY_2`. +*/ +typedef unspecified_type Isolate_y_2; /*! -A model of `AlgebraicKernel_d_2::IsSquareFree_2`. -*/ -typedef unspecified_type Is_square_free_2; +A model of `AlgebraicKernel_d_2::IsSquareFree_2`. +*/ +typedef unspecified_type Is_square_free_2; /*! -A model of `AlgebraicKernel_d_2::MakeSquareFree_2`. -*/ -typedef unspecified_type Make_square_free_2; +A model of `AlgebraicKernel_d_2::MakeSquareFree_2`. +*/ +typedef unspecified_type Make_square_free_2; /*! -A model of `AlgebraicKernel_d_2::SquareFreeFactorize_2`. -*/ -typedef unspecified_type Square_free_factorize_2; +A model of `AlgebraicKernel_d_2::SquareFreeFactorize_2`. +*/ +typedef unspecified_type Square_free_factorize_2; /*! -A model of `AlgebraicKernel_d_2::IsCoprime_2`. -*/ -typedef unspecified_type Is_coprime_2; +A model of `AlgebraicKernel_d_2::IsCoprime_2`. +*/ +typedef unspecified_type Is_coprime_2; /*! -A model of `AlgebraicKernel_d_2::MakeCoprime_2`. -*/ -typedef unspecified_type Make_coprime_2; +A model of `AlgebraicKernel_d_2::MakeCoprime_2`. +*/ +typedef unspecified_type Make_coprime_2; /*! -A model of `AlgebraicKernel_d_2::Solve_2`. -*/ -typedef unspecified_type Solve_2; +A model of `AlgebraicKernel_d_2::Solve_2`. +*/ +typedef unspecified_type Solve_2; /*! -A model of `AlgebraicKernel_d_2::NumberOfSolutions_2`. -*/ -typedef unspecified_type Number_of_solutions_2; +A model of `AlgebraicKernel_d_2::NumberOfSolutions_2`. +*/ +typedef unspecified_type Number_of_solutions_2; /*! -A model of `AlgebraicKernel_d_2::SignAt_2`. -*/ -typedef unspecified_type Sign_at_2; +A model of `AlgebraicKernel_d_2::SignAt_2`. +*/ +typedef unspecified_type Sign_at_2; /*! -A model of `AlgebraicKernel_d_2::CompareX_2`. -*/ -typedef unspecified_type Compare_x_2; +A model of `AlgebraicKernel_d_2::CompareX_2`. +*/ +typedef unspecified_type Compare_x_2; /*! -A model of `AlgebraicKernel_d_2::CompareY_2`. -*/ -typedef unspecified_type Compare_y_2; +A model of `AlgebraicKernel_d_2::CompareY_2`. +*/ +typedef unspecified_type Compare_y_2; /*! -A model of `AlgebraicKernel_d_2::CompareXY_2`. -*/ -typedef unspecified_type Compare_xy_2; +A model of `AlgebraicKernel_d_2::CompareXY_2`. +*/ +typedef unspecified_type Compare_xy_2; /*! -A model of `AlgebraicKernel_d_2::BoundBetweenX_2`. -*/ -typedef unspecified_type Bound_between_x_2; +A model of `AlgebraicKernel_d_2::BoundBetweenX_2`. +*/ +typedef unspecified_type Bound_between_x_2; /*! -A model of `AlgebraicKernel_d_2::BoundBetweenY_2`. -*/ -typedef unspecified_type Bound_between_y_2; +A model of `AlgebraicKernel_d_2::BoundBetweenY_2`. +*/ +typedef unspecified_type Bound_between_y_2; /*! -A model of `AlgebraicKernel_d_2::ApproximateAbsoluteX_2`. -*/ -typedef unspecified_type Approximate_absolute_x_2; +A model of `AlgebraicKernel_d_2::ApproximateAbsoluteX_2`. +*/ +typedef unspecified_type Approximate_absolute_x_2; /*! -A model of `AlgebraicKernel_d_2::ApproximateAbsoluteY_2`. -*/ -typedef unspecified_type Approximate_absolute_y_2; +A model of `AlgebraicKernel_d_2::ApproximateAbsoluteY_2`. +*/ +typedef unspecified_type Approximate_absolute_y_2; /*! -A model of `AlgebraicKernel_d_2::ApproximateRelativeX_2`. -*/ -typedef unspecified_type Approximate_relative_x_2; +A model of `AlgebraicKernel_d_2::ApproximateRelativeX_2`. +*/ +typedef unspecified_type Approximate_relative_x_2; /*! -A model of `AlgebraicKernel_d_2::ApproximateRelativeY_2`. -*/ -typedef unspecified_type Approximate_relative_y_2; +A model of `AlgebraicKernel_d_2::ApproximateRelativeY_2`. +*/ +typedef unspecified_type Approximate_relative_y_2; -/// @} +/// @} -/// \name Operations +/// \name Operations /// For each of the function objects above, there must exist a member /// function that requires no arguments and returns an instance of /// that function object. The name of the member function is the @@ -172,8 +172,8 @@ typedef unspecified_type Approximate_relative_y_2; /*! -*/ -AlgebraicKernel_d_2::Bound_between_x_2 bound_between_x_2_object() const; +*/ +AlgebraicKernel_d_2::Bound_between_x_2 bound_between_x_2_object() const; /// @} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt b/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt index 0b43ecbbf4b5..aa61f788908f 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt @@ -3,10 +3,10 @@ /// \defgroup PkgAlgebraicKernelDConcepts Concepts /// \ingroup PkgAlgebraicKernelDRef -/// \defgroup PkgAlgebraicKernelDConceptsUni Univariate Algebraic Kernel +/// \defgroup PkgAlgebraicKernelDConceptsUni Univariate Algebraic Kernel /// \ingroup PkgAlgebraicKernelDConcepts -/// \defgroup PkgAlgebraicKernelDConceptsBi Bivariate Algebraic Kernel +/// \defgroup PkgAlgebraicKernelDConceptsBi Bivariate Algebraic Kernel /// \ingroup PkgAlgebraicKernelDConcepts diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index 901221f91d0d..02f1ac1c563b 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -22,7 +22,7 @@ if( CGAL_FOUND AND MPFI_FOUND) create_single_source_cgal_program( "Solve_1.cpp" ) else() - + message(STATUS "This program requires the CGAL library and MPFI, and will not be compiled.") - + endif() diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Compare_1.cpp b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Compare_1.cpp index f0248e221dff..c04c3cfcf263 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Compare_1.cpp +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Compare_1.cpp @@ -2,7 +2,7 @@ // $Id$ #include -#ifdef CGAL_USE_MPFI +#ifdef CGAL_USE_MPFI #include #include #include diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Construct_algebraic_real_1.cpp b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Construct_algebraic_real_1.cpp index 9218461721d1..599076868e13 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Construct_algebraic_real_1.cpp +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Construct_algebraic_real_1.cpp @@ -2,7 +2,7 @@ // $Id$ #include -#ifdef CGAL_USE_MPFI +#ifdef CGAL_USE_MPFI #include #include #include @@ -16,7 +16,7 @@ typedef AK::Bound Bound; typedef AK::Multiplicity_type Multiplicity_type; int main(){ - AK ak; // an object of + AK ak; // an object of AK::Construct_algebraic_real_1 construct_algreal_1 = ak.construct_algebraic_real_1_object(); std::cout << "Construct from int : " << construct_algreal_1(int(2)) << "\n"; diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Isolate_1.cpp b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Isolate_1.cpp index b04233f714b2..7aafd3032e48 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Isolate_1.cpp +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Isolate_1.cpp @@ -2,7 +2,7 @@ // $Id$ #include -#ifdef CGAL_USE_MPFI +#ifdef CGAL_USE_MPFI #include #include #include @@ -15,7 +15,7 @@ typedef AK::Bound Bound; typedef AK::Multiplicity_type Multiplicity_type; int main(){ - AK ak; // an object of + AK ak; // an object of AK::Construct_algebraic_real_1 construct_algreal_1 = ak.construct_algebraic_real_1_object(); AK::Isolate_1 isolate_1 = ak.isolate_1_object(); AK::Compute_polynomial_1 compute_polynomial_1 = ak.compute_polynomial_1_object(); diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Sign_at_1.cpp b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Sign_at_1.cpp index 59c2a0423581..92af487e1f26 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Sign_at_1.cpp +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Sign_at_1.cpp @@ -2,7 +2,7 @@ // $Id$ #include -#ifdef CGAL_USE_MPFI +#ifdef CGAL_USE_MPFI #include #include #include diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Solve_1.cpp b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Solve_1.cpp index 1920ce6dc6db..7983244f82b6 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/Solve_1.cpp +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/Solve_1.cpp @@ -2,7 +2,7 @@ // $Id$ #include -#ifdef CGAL_USE_MPFI +#ifdef CGAL_USE_MPFI #include #include #include @@ -14,7 +14,7 @@ typedef AK::Bound Bound; typedef AK::Multiplicity_type Multiplicity_type; int main(){ - AK ak; // an object of + AK ak; // an object of AK::Solve_1 solve_1 = ak.solve_1_object(); Polynomial_1 x = CGAL::shift(AK::Polynomial_1(1),1); // the monomial x diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index 06e2b8b84f63..cefa0a924c9b 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Eric Berberich // Pavel Emeliyanenko @@ -61,10 +61,10 @@ namespace CGAL { * As such, it contains functionality * for solving and manipulating (systems of) bivariate polynomials, * of arbitrary degree, - * as required by the \c AlgebraicKernel_d_2 concept. + * as required by the \c AlgebraicKernel_d_2 concept. * Additionally, it contains functionality for the topological-geometric - * analysis of a single algebraic curve - * (given as the vanishing set of the polynomial), + * analysis of a single algebraic curve + * (given as the vanishing set of the polynomial), * and of a pair of curves (given as a pair of polynomials), as required by the * \c AlgebraicKernelWithAnalysis_d_2 concept. These two analyses are * available via the types \c Curve_analysis_2 and Curve_pair_analysis_2. @@ -79,7 +79,7 @@ namespace CGAL { * \b Algebraic_curve_kernel_2 is a template class, and needs a model * of the \c AlgebraicKernel_d_1 concept as parameter. * - * Internally, the curve- and curve-pair analysis + * Internally, the curve- and curve-pair analysis * are the computational fundament of the kernel. That means, whenever * a polynomial is considered within the kernel, the curve analysis * of the corresponding algebraic curve is performed. @@ -98,16 +98,16 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ // the same for construction functors #define CGAL_Algebraic_Kernel_cons(Y,Z) CGAL_Algebraic_Kernel_pred(Y,Z) -protected: +protected: // temporary types - + public: //!\name public typedefs //!@{ //! type of 1D algebraic kernel typedef AlgebraicKernel_d_1 Algebraic_kernel_d_1; - + //! type of x-coordinate typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real_1; @@ -118,43 +118,43 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ typedef Algebraic_curve_kernel_2 Self; typedef Self Algebraic_kernel_d_2; - + // Bound type typedef typename Algebraic_kernel_d_1::Bound Bound; typedef typename Algebraic_kernel_d_1::size_type size_type; typedef typename Algebraic_kernel_d_1::Multiplicity_type Multiplicity_type; - + typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel Arithmetic_kernel; - + typedef typename Arithmetic_kernel::Bigfloat Bigfloat; typedef typename Arithmetic_kernel::Bigfloat_interval Bigfloat_interval; - - //! Univariate polynomial type + + //! Univariate polynomial type typedef typename Algebraic_kernel_d_1::Polynomial_1 Polynomial_1; - + //! Bivariate polynomial type typedef typename CGAL::Polynomial_traits_d :: template Rebind::Other::Type Polynomial_2; - + //! bivariate polynomial traits typedef ::CGAL::Polynomial_traits_d< Polynomial_2 > Polynomial_traits_2; /*! - * \brief type of a curve point, a model for the + * \brief type of a curve point, a model for the * \c AlgebraicKernel_d_2::AlgebraicReal_2 concept */ typedef internal::Xy_coordinate_2 Algebraic_real_2; - /*! + /*! * type of the curve analysis, a model for the * \c AlgebraicKernelWithAnalysis_d_2::CurveAnalysis_2 concept */ - typedef CGAL::Curve_analysis_2 Curve_analysis_2; + typedef CGAL::Curve_analysis_2 Curve_analysis_2; - /*! + /*! * type of the curve pair analysis, a model for the * \c AlgebraicKernelWithAnalysis_d_2::CurvePairAnalysis_2 concept */ @@ -166,29 +166,29 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ // berfriending representations to make protected typedefs available friend class internal::Curve_analysis_2_rep; friend class internal::Curve_pair_analysis_2_rep; - + //!@} //! \name rebind operator //!@{ - template - struct rebind { - typedef Algebraic_curve_kernel_2 Other; + template + struct rebind { + typedef Algebraic_curve_kernel_2 Other; }; //!@} protected: //! \name private functors //!@{ - + #if 0 - + //! polynomial canonicalizer, needed for the cache - template + template struct Poly_canonicalizer : public CGAL::cpp98::unary_function< Poly, Poly > { // use Polynomial_traits_d<>::Canonicalize ? - Poly operator()(Poly p) + Poly operator()(Poly p) { typedef CGAL::Scalar_factor_traits Sf_traits; typedef typename Sf_traits::Scalar Scalar; @@ -200,19 +200,19 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ return p; } CGAL_assertion(g != Scalar(0)); - if(g != Scalar(1)) + if(g != Scalar(1)) scalar_div(p,g); - if(CGAL::leading_coefficient(CGAL::leading_coefficient(p))) < 0) + if(CGAL::leading_coefficient(CGAL::leading_coefficient(p))) < 0) scalar_div(p,Scalar(-1)); - return p; + return p; } - + }; #endif // NOT a curve pair in our notation, simply a std::pair of Curve_analysis_2 typedef std::pair Pair_of_curves_2; - + //! orders pair items by ids struct Pair_id_order { #ifdef CGAL_ALGEBRAIC_KERNEL_DONT_SWAP @@ -220,17 +220,17 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const std::pair& operator()(const std::pair& p) const { return p; } -#else +#else template std::pair operator()(const std::pair& p) const { - + if(p.first.id() > p.second.id()) return std::make_pair(p.second, p.first); return p; } #endif }; - + class Curve_creator { public: @@ -241,9 +241,9 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } protected: - + Algebraic_kernel_d_2* _m_kernel; - + }; template @@ -259,11 +259,11 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } protected: - + Algebraic_kernel_d_2* _m_kernel; - + }; - + struct Pair_id_equal_to { template @@ -281,29 +281,29 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ typename Polynomial_traits_2::Canonicalize, Curve_creator > Curve_cache_2; - //! type of curve pair analysis cache + //! type of curve pair analysis cache typedef internal::LRU_hashed_map_with_kernel > Curve_pair_cache_2; - + typedef std::pair Pair_of_polynomial_2; template struct Gcd { - + T operator() (std::pair pair) { return typename CGAL::Polynomial_traits_d ::Gcd_up_to_constant_factor()(pair.first,pair.second); } - } ; + } ; template struct Pair_cannonicalize { - + std::pair operator() (std::pair pair) { - - if(pair.first > pair.second) + + if(pair.first > pair.second) return std::make_pair(pair.second,pair.first); return pair; } @@ -313,7 +313,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ , std::less > Polynomial_2_compare; - + //! Cache for gcd computations typedef CGAL::Cache - class Unary_compose + class Unary_compose : public CGAL::cpp98::unary_function { - + public: - + Unary_compose(const InnerFunctor& inner, - const OuterFunctor& outer) - : _inner(inner), _outer(outer) {} - + const OuterFunctor& outer) + : _inner(inner), _outer(outer) {} + Unary_compose(const Unary_compose& other) - : _inner(other._inner), _outer(other._outer) {} + : _inner(other._inner), _outer(other._outer) {} - Unary_compose() : _inner(::boost::none),_outer(::boost::none) {} + Unary_compose() : _inner(::boost::none),_outer(::boost::none) {} typedef typename InnerFunctor::argument_type argument_type; typedef typename OuterFunctor::result_type result_type; - + result_type operator() (const argument_type& arg) const { - CGAL_assertion(bool(_inner)); - CGAL_assertion(bool(_outer)); - return _outer.get()(_inner.get()(arg)); + CGAL_assertion(bool(_inner)); + CGAL_assertion(bool(_outer)); + return _outer.get()(_inner.get()(arg)); } private: ::boost::optional _inner; @@ -377,7 +377,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ template Unary_compose - unary_compose(const InnerFunctor& inner, const OuterFunctor& outer) + unary_compose(const InnerFunctor& inner, const OuterFunctor& outer) const { return Unary_compose(inner, outer); } @@ -386,19 +386,19 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ //!@} //! \name public functors and predicates //!@{ - - + + public: - //! \brief default constructor - Algebraic_curve_kernel_2() + //! \brief default constructor + Algebraic_curve_kernel_2() : _m_gcd_cache_2(new Gcd_cache_2()) - { - _m_curve_cache_2 = boost::shared_ptr(new Curve_cache_2(this)); - _m_curve_pair_cache_2 = boost::shared_ptr (new Curve_pair_cache_2(this)); - // std::cout << "CONSTRUCTION Algebraic_curve_kernel_2 " << std::endl; + { + _m_curve_cache_2 = boost::shared_ptr(new Curve_cache_2(this)); + _m_curve_pair_cache_2 = boost::shared_ptr (new Curve_pair_cache_2(this)); + // std::cout << "CONSTRUCTION Algebraic_curve_kernel_2 " << std::endl; } - -public: + +public: static auto initialize_poly_0() { Polynomial_2 poly_0; return poly_0; @@ -427,7 +427,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public: Construct_curve_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + Curve_analysis_2 operator() (const Polynomial_2& f) const { return _m_kernel->curve_cache_2()(f); @@ -436,7 +436,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ protected: const Algebraic_kernel_d_2* _m_kernel; - + }; CGAL_Algebraic_Kernel_cons(Construct_curve_2, construct_curve_2_object); @@ -451,12 +451,12 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public: - Construct_curve_pair_2(const Algebraic_kernel_d_2* kernel) + Construct_curve_pair_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + Curve_pair_analysis_2 operator() (const Curve_analysis_2& ca1, const Curve_analysis_2& ca2) const { - + Curve_pair_analysis_2 cpa_2 = _m_kernel->curve_pair_cache_2()(std::make_pair(ca1, ca2)); return cpa_2; @@ -475,445 +475,445 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ private: Curve_analysis_2 _construct_defining_polynomial_from(Bound b) const { - typedef CGAL::Fraction_traits FT; - // We rely on the fact that the Bound is a fraction - CGAL_static_assertion((::boost::is_same::value)); - typedef typename FT::Numerator_type Numerator; - typedef typename FT::Denominator_type Denominator; - typedef CGAL::Coercion_traits Num_coercion; - CGAL_static_assertion((::boost::is_same - ::value)); - typedef CGAL::Coercion_traits Denom_coercion; - CGAL_static_assertion((::boost::is_same - ::value)); - typename Num_coercion::Cast num_cast; - typename Denom_coercion::Cast denom_cast; - typename FT::Decompose decompose; - - Numerator num_uncasted; - Denominator denom_uncasted; - decompose(b,num_uncasted,denom_uncasted); - - Coefficient num = num_cast(num_uncasted); - Coefficient denom = denom_cast(denom_uncasted); - - typedef CGAL::Exponent_vector Exponent; - std::pair coeffs[2] - = {std::make_pair(Exponent(0,0),num), - std::make_pair(Exponent(0,1),-denom)}; - Polynomial_2 pol = typename Polynomial_traits_2 - ::Construct_polynomial()(coeffs,coeffs+2); - return _m_kernel->construct_curve_2_object()(pol); + typedef CGAL::Fraction_traits FT; + // We rely on the fact that the Bound is a fraction + CGAL_static_assertion((::boost::is_same::value)); + typedef typename FT::Numerator_type Numerator; + typedef typename FT::Denominator_type Denominator; + typedef CGAL::Coercion_traits Num_coercion; + CGAL_static_assertion((::boost::is_same + ::value)); + typedef CGAL::Coercion_traits Denom_coercion; + CGAL_static_assertion((::boost::is_same + ::value)); + typename Num_coercion::Cast num_cast; + typename Denom_coercion::Cast denom_cast; + typename FT::Decompose decompose; + + Numerator num_uncasted; + Denominator denom_uncasted; + decompose(b,num_uncasted,denom_uncasted); + + Coefficient num = num_cast(num_uncasted); + Coefficient denom = denom_cast(denom_uncasted); + + typedef CGAL::Exponent_vector Exponent; + std::pair coeffs[2] + = {std::make_pair(Exponent(0,0),num), + std::make_pair(Exponent(0,1),-denom)}; + Polynomial_2 pol = typename Polynomial_traits_2 + ::Construct_polynomial()(coeffs,coeffs+2); + return _m_kernel->construct_curve_2_object()(pol); } - + Curve_analysis_2 _construct_defining_polynomial_from - (typename CGAL::First_if_different::Type c) const { - typedef CGAL::Exponent_vector Exponent; - std::pair coeffs[2] - = {std::make_pair(Exponent(0,0),c),std::make_pair(Exponent(0,1),-1)}; - Polynomial_2 pol = typename Polynomial_traits_2 - ::Construct_polynomial()(coeffs,coeffs+2); - return _m_kernel->construct_curve_2_object()(pol); + (typename CGAL::First_if_different::Type c) const { + typedef CGAL::Exponent_vector Exponent; + std::pair coeffs[2] + = {std::make_pair(Exponent(0,0),c),std::make_pair(Exponent(0,1),-1)}; + Polynomial_2 pol = typename Polynomial_traits_2 + ::Construct_polynomial()(coeffs,coeffs+2); + return _m_kernel->construct_curve_2_object()(pol); } public: - + typedef Algebraic_real_2 result_type; - Construct_algebraic_real_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + Construct_algebraic_real_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + result_type operator() (int x,int y) const { - return this->operator()(Bound(x),Bound(y)); + return this->operator()(Bound(x),Bound(y)); } result_type operator() (Bound x,Bound y) const { - Algebraic_real_1 x_alg - = _m_kernel->construct_algebraic_real_1_object()(x); - Curve_analysis_2 ca - = this->_construct_defining_polynomial_from(y); - return Algebraic_real_2(x_alg,ca,0); + Algebraic_real_1 x_alg + = _m_kernel->construct_algebraic_real_1_object()(x); + Curve_analysis_2 ca + = this->_construct_defining_polynomial_from(y); + return Algebraic_real_2(x_alg,ca,0); } - result_type operator() - (typename CGAL::First_if_different::Type x, - typename CGAL::First_if_different::Type y) const { - Algebraic_real_1 x_alg - = _m_kernel->construct_algebraic_real_1_object()(x); - Curve_analysis_2 ca - = this->_construct_defining_polynomial_from(y); - return Algebraic_real_2(x_alg,ca,0); + result_type operator() + (typename CGAL::First_if_different::Type x, + typename CGAL::First_if_different::Type y) const { + Algebraic_real_1 x_alg + = _m_kernel->construct_algebraic_real_1_object()(x); + Curve_analysis_2 ca + = this->_construct_defining_polynomial_from(y); + return Algebraic_real_2(x_alg,ca,0); } - + result_type operator() (Algebraic_real_1 x, Algebraic_real_1 y) const { - std::vector< Algebraic_real_1> roots; - Polynomial_1 y_pol =_m_kernel->compute_polynomial_1_object()(y); - _m_kernel->solve_1_object()(y_pol,true,std::back_inserter(roots)); - std::pair::iterator, - typename std::vector< Algebraic_real_1>::iterator> - it_pair = std::equal_range(roots.begin(),roots.end(),y); - CGAL_assertion(std::distance(it_pair.first,it_pair.second)==1); - int index = static_cast(std::distance(roots.begin(),it_pair.first)); - - int degree = CGAL::degree(y_pol); - std::vector > coeffs; - for(int i=0;i<=degree;i++) { - Coefficient c = CGAL::get_coefficient(y_pol,i); - coeffs.push_back(std::make_pair(CGAL::Exponent_vector(0,i),c)); - } - Polynomial_2 y_pol_in_xy - = typename Polynomial_traits_2::Construct_polynomial() - (coeffs.begin(),coeffs.end()); - Curve_analysis_2 ca - = _m_kernel->construct_curve_2_object()(y_pol_in_xy); - return Algebraic_real_2(x,ca,index); + std::vector< Algebraic_real_1> roots; + Polynomial_1 y_pol =_m_kernel->compute_polynomial_1_object()(y); + _m_kernel->solve_1_object()(y_pol,true,std::back_inserter(roots)); + std::pair::iterator, + typename std::vector< Algebraic_real_1>::iterator> + it_pair = std::equal_range(roots.begin(),roots.end(),y); + CGAL_assertion(std::distance(it_pair.first,it_pair.second)==1); + int index = static_cast(std::distance(roots.begin(),it_pair.first)); + + int degree = CGAL::degree(y_pol); + std::vector > coeffs; + for(int i=0;i<=degree;i++) { + Coefficient c = CGAL::get_coefficient(y_pol,i); + coeffs.push_back(std::make_pair(CGAL::Exponent_vector(0,i),c)); + } + Polynomial_2 y_pol_in_xy + = typename Polynomial_traits_2::Construct_polynomial() + (coeffs.begin(),coeffs.end()); + Curve_analysis_2 ca + = _m_kernel->construct_curve_2_object()(y_pol_in_xy); + return Algebraic_real_2(x,ca,index); } - - result_type operator() (Polynomial_2 f,Polynomial_2 g,size_type i) - const { - CGAL_precondition(_m_kernel->is_square_free_2_object()(f)); - CGAL_precondition(_m_kernel->is_square_free_2_object()(g)); - CGAL_precondition(_m_kernel->is_coprime_2_object()(f,g)); - std::vector > roots; - this->_m_kernel->solve_2_object()(f,g,std::back_inserter(roots)); - CGAL_assertion(roots.size()>static_cast(i)); - return roots[i].first; + + result_type operator() (Polynomial_2 f,Polynomial_2 g,size_type i) + const { + CGAL_precondition(_m_kernel->is_square_free_2_object()(f)); + CGAL_precondition(_m_kernel->is_square_free_2_object()(g)); + CGAL_precondition(_m_kernel->is_coprime_2_object()(f,g)); + std::vector > roots; + this->_m_kernel->solve_2_object()(f,g,std::back_inserter(roots)); + CGAL_assertion(roots.size()>static_cast(i)); + return roots[i].first; } result_type operator() (Polynomial_2 f,Polynomial_2 g, - Bound x_l, Bound x_u, - Bound y_l, Bound y_u) const { - CGAL_precondition(x_lis_square_free_2_object()(f)); - CGAL_precondition(_m_kernel->is_square_free_2_object()(g)); - CGAL_precondition(_m_kernel->is_coprime_2_object()(f,g)); - std::vector > roots; - this->_m_kernel->solve_2_object()(f,g,x_l,x_u,y_l,y_u, - std::back_inserter(roots)); - CGAL_precondition(roots.size()==1); - CGAL_precondition(_m_kernel->compare_x_2_object()(roots[0].first,x_l) - == CGAL::LARGER); - CGAL_precondition(_m_kernel->compare_x_2_object()(roots[0].first,x_u) - == CGAL::SMALLER); - CGAL_precondition(_m_kernel->compare_y_2_object()(roots[0].first,y_l) - == CGAL::LARGER); - CGAL_precondition(_m_kernel->compare_y_2_object()(roots[0].first,y_u) - == CGAL::SMALLER); - return roots[0].first; + Bound x_l, Bound x_u, + Bound y_l, Bound y_u) const { + CGAL_precondition(x_lis_square_free_2_object()(f)); + CGAL_precondition(_m_kernel->is_square_free_2_object()(g)); + CGAL_precondition(_m_kernel->is_coprime_2_object()(f,g)); + std::vector > roots; + this->_m_kernel->solve_2_object()(f,g,x_l,x_u,y_l,y_u, + std::back_inserter(roots)); + CGAL_precondition(roots.size()==1); + CGAL_precondition(_m_kernel->compare_x_2_object()(roots[0].first,x_l) + == CGAL::LARGER); + CGAL_precondition(_m_kernel->compare_x_2_object()(roots[0].first,x_u) + == CGAL::SMALLER); + CGAL_precondition(_m_kernel->compare_y_2_object()(roots[0].first,y_l) + == CGAL::LARGER); + CGAL_precondition(_m_kernel->compare_y_2_object()(roots[0].first,y_u) + == CGAL::SMALLER); + return roots[0].first; } // These are not part of the concept, but used internally result_type operator() (Algebraic_real_1 x,int y) const { - return this->operator()(x,Bound(y)); + return this->operator()(x,Bound(y)); } result_type operator() (Algebraic_real_1 x,Bound y) const { - Curve_analysis_2 ca - = this->_construct_defining_polynomial_from(y); - return Algebraic_real_2(x,ca,0); + Curve_analysis_2 ca + = this->_construct_defining_polynomial_from(y); + return Algebraic_real_2(x,ca,0); } - result_type operator() - (Algebraic_real_1 x, - typename CGAL::First_if_different::Type y) const { - Curve_analysis_2 ca - = this->_construct_defining_polynomial_from(y); - return Algebraic_real_2(x,ca,0); + result_type operator() + (Algebraic_real_1 x, + typename CGAL::First_if_different::Type y) const { + Curve_analysis_2 ca + = this->_construct_defining_polynomial_from(y); + return Algebraic_real_2(x,ca,0); } - + protected: const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Construct_algebraic_real_2, - construct_algebraic_real_2_object); - + CGAL_Algebraic_Kernel_cons(Construct_algebraic_real_2, + construct_algebraic_real_2_object); + + - class Compute_polynomial_x_2 : public CGAL::cpp98::unary_function { public: - Compute_polynomial_x_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + Compute_polynomial_x_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + Polynomial_1 operator()(const Algebraic_real_2& xy) const { - return _m_kernel->compute_polynomial_1_object()(xy.x()); + return _m_kernel->compute_polynomial_1_object()(xy.x()); } protected: - + const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Compute_polynomial_x_2, - compute_polynomial_x_2_object); + CGAL_Algebraic_Kernel_cons(Compute_polynomial_x_2, + compute_polynomial_x_2_object); class Compute_polynomial_y_2 : public CGAL::cpp98::unary_function { public: - Compute_polynomial_y_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + Compute_polynomial_y_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + Polynomial_1 operator()(const Algebraic_real_2& xy) const { - return _m_kernel->compute_polynomial_1_object()(xy.y()); + return _m_kernel->compute_polynomial_1_object()(xy.y()); } protected: - + const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Compute_polynomial_y_2, - compute_polynomial_y_2_object); + CGAL_Algebraic_Kernel_cons(Compute_polynomial_y_2, + compute_polynomial_y_2_object); class Isolate_x_2 : public CGAL::cpp98::binary_function > { - + public: - Isolate_x_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - - std::pair operator()(Algebraic_real_2 a, - Polynomial_1 p) const { - return _m_kernel->isolate_1_object() - (_m_kernel->compute_x_2_object()(a),p); - } - + Isolate_x_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + + std::pair operator()(Algebraic_real_2 a, + Polynomial_1 p) const { + return _m_kernel->isolate_1_object() + (_m_kernel->compute_x_2_object()(a),p); + } + protected: - + const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Isolate_x_2, - isolate_x_2_object); + CGAL_Algebraic_Kernel_cons(Isolate_x_2, + isolate_x_2_object); class Isolate_y_2 : public CGAL::cpp98::binary_function > { - + public: - Isolate_y_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - - std::pair operator()(Algebraic_real_2 a, - Polynomial_1 p) const { - // Note: One can avoid to compute the y-coordinate: - // 1.) Construct a Polynomial_2 out of p (with no x-variable) - // 2.) Check whether a lies on p - // 3.) If no, approx the y-coordinate until it is isolated - // from all roots of p - // 4.) If yes, return the isolating interval of the - // corresponding roots of p - // - // It is not clear, however, whether this is less expensive, - // especially if p has high degree - return _m_kernel->isolate_1_object() - (_m_kernel->compute_y_2_object()(a),p); - } - + Isolate_y_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + + std::pair operator()(Algebraic_real_2 a, + Polynomial_1 p) const { + // Note: One can avoid to compute the y-coordinate: + // 1.) Construct a Polynomial_2 out of p (with no x-variable) + // 2.) Check whether a lies on p + // 3.) If no, approx the y-coordinate until it is isolated + // from all roots of p + // 4.) If yes, return the isolating interval of the + // corresponding roots of p + // + // It is not clear, however, whether this is less expensive, + // especially if p has high degree + return _m_kernel->isolate_1_object() + (_m_kernel->compute_y_2_object()(a),p); + } + protected: - + const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Isolate_y_2, - isolate_y_2_object); + CGAL_Algebraic_Kernel_cons(Isolate_y_2, + isolate_y_2_object); class Isolate_2 { - + public: typedef std::array result_type; - Isolate_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + Isolate_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + protected: // refines the approximation of a until the box is away from all // common solutions of f and g result_type _approx_interval(Algebraic_real_2 a, - Polynomial_2 f, - Polynomial_2 g) const { - CGAL_precondition(!_m_kernel->is_zero_at_2_object()(f,a)); - + Polynomial_2 f, + Polynomial_2 g) const { + CGAL_precondition(!_m_kernel->is_zero_at_2_object()(f,a)); + typename Algebraic_curve_kernel_2::Approximate_absolute_x_2 - approx_x = _m_kernel->approximate_absolute_x_2_object(); - typename Algebraic_curve_kernel_2::Approximate_absolute_y_2 - approx_y = _m_kernel->approximate_absolute_y_2_object(); - - typedef CGAL::internal::Interval_evaluate_2< Polynomial_2, Bound > + approx_x = _m_kernel->approximate_absolute_x_2_object(); + typename Algebraic_curve_kernel_2::Approximate_absolute_y_2 + approx_y = _m_kernel->approximate_absolute_y_2_object(); + + typedef CGAL::internal::Interval_evaluate_2< Polynomial_2, Bound > Interval_evaluate_2; - typedef typename Interval_evaluate_2::result_type + typedef typename Interval_evaluate_2::result_type Interval_result_type; Interval_evaluate_2 interval_evaluate_2; long prec = 4; - - while(true) { - std::pair x_pair = approx_x(a,prec); - std::pair y_pair = approx_y(a,prec); - result_type curr_box = CGAL::make_array(x_pair.first, - x_pair.second, - y_pair.first, - y_pair.second); - Interval_result_type eval_f = interval_evaluate_2(f,curr_box); - if((CGAL::sign(eval_f.first)==CGAL::sign(eval_f.second)) && - (CGAL::sign(eval_f.first)!=CGAL::ZERO)) { - return curr_box; - } - Interval_result_type eval_g = interval_evaluate_2(g,curr_box); - if((CGAL::sign(eval_g.first)==CGAL::sign(eval_g.second)) && - (CGAL::sign(eval_g.first)!=CGAL::ZERO)) { - return curr_box; - } - prec*=2; - - } + + while(true) { + std::pair x_pair = approx_x(a,prec); + std::pair y_pair = approx_y(a,prec); + result_type curr_box = CGAL::make_array(x_pair.first, + x_pair.second, + y_pair.first, + y_pair.second); + Interval_result_type eval_f = interval_evaluate_2(f,curr_box); + if((CGAL::sign(eval_f.first)==CGAL::sign(eval_f.second)) && + (CGAL::sign(eval_f.first)!=CGAL::ZERO)) { + return curr_box; + } + Interval_result_type eval_g = interval_evaluate_2(g,curr_box); + if((CGAL::sign(eval_g.first)==CGAL::sign(eval_g.second)) && + (CGAL::sign(eval_g.first)!=CGAL::ZERO)) { + return curr_box; + } + prec*=2; + + } } public: result_type operator()(Algebraic_real_2 a, - Polynomial_2 f) const { - return this->_approx_interval(a,f,Polynomial_2(Coefficient(0))); + Polynomial_2 f) const { + return this->_approx_interval(a,f,Polynomial_2(Coefficient(0))); } - + result_type operator()(Algebraic_real_2 a, - Polynomial_2 f, - Polynomial_2 g) const { - - Curve_analysis_2 ca1 = _m_kernel->construct_curve_2_object()(f); - Curve_analysis_2 ca2 = _m_kernel->construct_curve_2_object()(g); - Curve_pair_analysis_2 cpa_2 - = _m_kernel->construct_curve_pair_2_object()(ca1,ca2); - int idx; bool event; - cpa_2.x_to_index(_m_kernel->compute_x_2_object()(a),idx,event); - if(! event) { // No critical point, no intersection - return this->_approx_interval(a,f,g); - } - std::vector > roots; - _m_kernel->solve_at_x_2_object()(cpa_2,idx,std::back_inserter(roots)); - if(roots.size()==0) { - // easy case: No intersection at a's x-coordinate: - return this->_approx_interval(a,f,g); - } - // Check whether a is really an intersection - if(!_m_kernel->is_zero_at_2_object()(f,a)) { - return this->operator()(a,f); - } - if(!_m_kernel->is_zero_at_2_object()(g,a)) { - return this->operator()(a,g); - } - // At this point, a is a common solution of f and g, it must - // be one of the points in roots - // Isolating x-interval is immediately available from CPA: - Bound xl = cpa_2.bound_value_in_interval(idx), - xu = cpa_2.bound_value_in_interval(idx+1); - // Often, there is just one point, so filter this easy case - if(roots.size()==1) { - // Any y-interval containing roots[0].first is isolating - std::pair y_pair - = _m_kernel->approximate_absolute_y_2_object()(roots[0].first,4); - return CGAL::make_array(xl,xu,y_pair.first,y_pair.second); - } else { - // more work! We should not assume that each - // roots[i].first has f or g as defining polynomial, because - // the representation might have been simplifed - - // Here's the safe way: Take the simpler of the curves - // (but the one without vertical component!) - Curve_analysis_2 ca; - typedef typename Curve_analysis_2::Status_line_1 Status_line_CA_1; - Status_line_CA_1 status_line; - Status_line_CA_1 status_line1 - = ca1.status_line_at_exact_x(_m_kernel->compute_x_2_object()(a)); - Status_line_CA_1 status_line2 - = ca2.status_line_at_exact_x(_m_kernel->compute_x_2_object()(a)); - if(status_line1.covers_line()) { - ca=ca2; - status_line=status_line2; - } else if(status_line2.covers_line()) { - ca=ca1; - status_line=status_line1; - } else if(CGAL::total_degree(f)construct_curve_2_object()(f); + Curve_analysis_2 ca2 = _m_kernel->construct_curve_2_object()(g); + Curve_pair_analysis_2 cpa_2 + = _m_kernel->construct_curve_pair_2_object()(ca1,ca2); + int idx; bool event; + cpa_2.x_to_index(_m_kernel->compute_x_2_object()(a),idx,event); + if(! event) { // No critical point, no intersection + return this->_approx_interval(a,f,g); + } + std::vector > roots; + _m_kernel->solve_at_x_2_object()(cpa_2,idx,std::back_inserter(roots)); + if(roots.size()==0) { + // easy case: No intersection at a's x-coordinate: + return this->_approx_interval(a,f,g); + } + // Check whether a is really an intersection + if(!_m_kernel->is_zero_at_2_object()(f,a)) { + return this->operator()(a,f); + } + if(!_m_kernel->is_zero_at_2_object()(g,a)) { + return this->operator()(a,g); + } + // At this point, a is a common solution of f and g, it must + // be one of the points in roots + // Isolating x-interval is immediately available from CPA: + Bound xl = cpa_2.bound_value_in_interval(idx), + xu = cpa_2.bound_value_in_interval(idx+1); + // Often, there is just one point, so filter this easy case + if(roots.size()==1) { + // Any y-interval containing roots[0].first is isolating + std::pair y_pair + = _m_kernel->approximate_absolute_y_2_object()(roots[0].first,4); + return CGAL::make_array(xl,xu,y_pair.first,y_pair.second); + } else { + // more work! We should not assume that each + // roots[i].first has f or g as defining polynomial, because + // the representation might have been simplifed + + // Here's the safe way: Take the simpler of the curves + // (but the one without vertical component!) + Curve_analysis_2 ca; + typedef typename Curve_analysis_2::Status_line_1 Status_line_CA_1; + Status_line_CA_1 status_line; + Status_line_CA_1 status_line1 + = ca1.status_line_at_exact_x(_m_kernel->compute_x_2_object()(a)); + Status_line_CA_1 status_line2 + = ca2.status_line_at_exact_x(_m_kernel->compute_x_2_object()(a)); + if(status_line1.covers_line()) { + ca=ca2; + status_line=status_line2; + } else if(status_line2.covers_line()) { + ca=ca1; + status_line=status_line1; + } else if(CGAL::total_degree(f) { public: - Compute_x_2(const Algebraic_kernel_d_2* kernel) + Compute_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + Algebraic_real_1 operator()(const Algebraic_real_2& xy) const { return xy.x(); } protected: - + const Algebraic_kernel_d_2* _m_kernel; }; CGAL_Algebraic_Kernel_cons(Compute_x_2, compute_x_2_object); - + #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE typedef Compute_x_2 Get_x_2; CGAL_Algebraic_Kernel_cons(Get_x_2, get_x_2_object); #endif - /*! + /*! * \brief returns the y-coordinate of \c Algebraic_real_2 object * * \attention{This method returns the y-coordinate in isolating interval @@ -921,61 +921,61 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ * consuming taks, since it is against the "y-per-x"-view that we take * in our kernel. Therefore, it is recommended, if possible, * to use the functors - * \c Approximate_absolute_y_2 and \c Approximate_relative_y_2 that - * return approximation of the y-coordinate. + * \c Approximate_absolute_y_2 and \c Approximate_relative_y_2 that + * return approximation of the y-coordinate. */ class Compute_y_2 : public CGAL::cpp98::unary_function { - + public: - - Compute_y_2(const Algebraic_kernel_d_2* kernel) + + Compute_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} Algebraic_real_1 operator()(const Algebraic_real_2& xy) const { return xy.y(); } protected: - + const Algebraic_kernel_d_2* _m_kernel; }; CGAL_Algebraic_Kernel_cons(Compute_y_2, compute_y_2_object); - + #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE typedef Compute_x_2 Get_y_2; CGAL_Algebraic_Kernel_cons(Get_y_2, get_y_2_object); #endif - class Approximate_absolute_x_2 + class Approximate_absolute_x_2 : public CGAL::cpp98::binary_function >{ - + public: - Approximate_absolute_x_2(const Algebraic_kernel_d_2* kernel) + Approximate_absolute_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} std::pair operator() (Algebraic_real_2 xy, int prec) const { Compute_x_2 get_x = _m_kernel->compute_x_2_object(); - return _m_kernel->approximate_absolute_1_object() - (get_x(xy),prec); + return _m_kernel->approximate_absolute_1_object() + (get_x(xy),prec); } protected: - + const Algebraic_kernel_d_2* _m_kernel; - + }; - CGAL_Algebraic_Kernel_cons(Approximate_absolute_x_2, + CGAL_Algebraic_Kernel_cons(Approximate_absolute_x_2, approximate_absolute_x_2_object); - class Approximate_relative_x_2 + class Approximate_relative_x_2 : public CGAL::cpp98::binary_function >{ - + public: - - Approximate_relative_x_2(const Algebraic_kernel_d_2* kernel) + + Approximate_relative_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} std::pair operator() (Algebraic_real_2 xy, @@ -985,25 +985,25 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } protected: - + const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Approximate_relative_x_2, + CGAL_Algebraic_Kernel_cons(Approximate_relative_x_2, approximate_relative_x_2_object); - class Approximate_absolute_y_2 + class Approximate_absolute_y_2 : public CGAL::cpp98::binary_function >{ public: - Approximate_absolute_y_2(const Algebraic_kernel_d_2* kernel) + Approximate_absolute_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + std::pair operator() (Algebraic_real_2 xy, int prec) const { - - Bound l = xy.lower_bound_y(); + + Bound l = xy.lower_bound_y(); Bound u = xy.upper_bound_y(); Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec)); while((u-l)*error>Bound(1)) { @@ -1013,21 +1013,21 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } return std::make_pair(l,u); } - + protected: const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Approximate_absolute_y_2, + CGAL_Algebraic_Kernel_cons(Approximate_absolute_y_2, approximate_absolute_y_2_object); - class Approximate_relative_y_2 + class Approximate_relative_y_2 : public CGAL::cpp98::binary_function >{ - + public: - - Approximate_relative_y_2(const Algebraic_kernel_d_2* kernel) + + Approximate_relative_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} std::pair operator() (Algebraic_real_2 xy, @@ -1039,7 +1039,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ !=CGAL::POSITIVE) { xy.refine_y(); } - Bound l = xy.lower_bound_y(); + Bound l = xy.lower_bound_y(); Bound u = xy.upper_bound_y(); Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec)); Bound min_b = (CGAL::min)(CGAL::abs(u),CGAL::abs(l)); @@ -1057,11 +1057,11 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Approximate_relative_y_2, + CGAL_Algebraic_Kernel_cons(Approximate_relative_y_2, approximate_relative_y_2_object); - - /*! + + /*! * \brief returns a value of type \c Bound that lies between * the x-coordinates of the \c Algebraic_real_2s. * @@ -1070,17 +1070,17 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ class Bound_between_x_2 { public: - - Bound_between_x_2(const Algebraic_kernel_d_2* kernel) + + Bound_between_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + typedef Algebraic_real_2 first_argument_type; typedef Algebraic_real_2 second_argument_type; typedef Bound result_type; - - result_type operator()(const Algebraic_real_2& r1, + + result_type operator()(const Algebraic_real_2& r1, const Algebraic_real_2& r2) const { - return this->_m_kernel->bound_between_1_object() + return this->_m_kernel->bound_between_1_object() (r1.x(), r2.x()); } @@ -1089,30 +1089,30 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Bound_between_x_2, + CGAL_Algebraic_Kernel_cons(Bound_between_x_2, bound_between_x_2_object); - - /*! + + /*! * \brief returns a value of type \c Bound that lies between * the y-coordinates of the \c Algebraic_real_2s. * * \pre{The y-coordinates must not be equal} */ class Bound_between_y_2 { - + public: - - Bound_between_y_2(const Algebraic_kernel_d_2* kernel) + + Bound_between_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} typedef Algebraic_real_2 first_argument_type; typedef Algebraic_real_2 second_argument_type; typedef Bound result_type; - typedef typename Algebraic_kernel_d_2::Curve_analysis_2 - ::Status_line_1::Bitstream_descartes Isolator; + typedef typename Algebraic_kernel_d_2::Curve_analysis_2 + ::Status_line_1::Bitstream_descartes Isolator; - result_type operator()(const Algebraic_real_2& r1, + result_type operator()(const Algebraic_real_2& r1, const Algebraic_real_2& r2) const { CGAL_precondition(r1.y() != r2.y()); @@ -1124,16 +1124,16 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ Isolator isol2 = r2.curve().status_line_at_exact_x(r2.x()).isolator(); - + Bound low1, low2, high1, high2; - + while (true) { low1 = isol1.left_bound(r1.arcno()); high1 = isol1.right_bound(r1.arcno()); - + low2 = isol2.left_bound(r2.arcno()); high2 = isol2.right_bound(r2.arcno()); - + if (low1 > high2) { res = ((low1 + high2)/Bound(2)); break; @@ -1142,7 +1142,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ res = ((low2 + high1)/Bound(2)); break; } - + // else isol1.refine_interval(r1.arcno()); isol2.refine_interval(r2.arcno()); @@ -1169,83 +1169,83 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Bound_between_y_2, + CGAL_Algebraic_Kernel_cons(Bound_between_y_2, bound_between_y_2_object); - - //! \brief comparison of x-coordinates + + //! \brief comparison of x-coordinates class Compare_x_2 : public CGAL::cpp98::binary_function { public: - - Compare_x_2(const Algebraic_kernel_d_2* kernel) + + Compare_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - Comparison_result operator()(const Algebraic_real_2& xy1, + Comparison_result operator()(const Algebraic_real_2& xy1, const Algebraic_real_2& xy2) const { - return _m_kernel->compare_1_object()(xy1.x(), xy2.x()); + return _m_kernel->compare_1_object()(xy1.x(), xy2.x()); } #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE - Comparison_result operator()(const Algebraic_real_1& xy1, + Comparison_result operator()(const Algebraic_real_1& xy1, const Algebraic_real_1& xy2) const { - return _m_kernel->compare_1_object()(xy1, xy2); + return _m_kernel->compare_1_object()(xy1, xy2); } #endif - Comparison_result operator()(const Algebraic_real_2& xy, + Comparison_result operator()(const Algebraic_real_2& xy, int i) const { - return _m_kernel->compare_1_object() - ( _m_kernel->compute_x_2_object()(xy), - _m_kernel->construct_algebraic_real_1_object()(i) ); + return _m_kernel->compare_1_object() + ( _m_kernel->compute_x_2_object()(xy), + _m_kernel->construct_algebraic_real_1_object()(i) ); } Comparison_result operator()(int i, const Algebraic_real_2& xy) const { - return _m_kernel->compare_1_object() - ( _m_kernel->construct_algebraic_real_1_object()(i), - _m_kernel->compute_x_2_object()(xy) ); + return _m_kernel->compare_1_object() + ( _m_kernel->construct_algebraic_real_1_object()(i), + _m_kernel->compute_x_2_object()(xy) ); } - Comparison_result operator()(const Algebraic_real_2& xy, + Comparison_result operator()(const Algebraic_real_2& xy, Bound b) const { - return _m_kernel->compare_1_object() - ( _m_kernel->compute_x_2_object()(xy), - _m_kernel->construct_algebraic_real_1_object()(b) ); + return _m_kernel->compare_1_object() + ( _m_kernel->compute_x_2_object()(xy), + _m_kernel->construct_algebraic_real_1_object()(b) ); } - Comparison_result operator()(Bound b, - const Algebraic_real_2& xy) const { - return _m_kernel->compare_1_object() - ( _m_kernel->construct_algebraic_real_1_object()(b), - _m_kernel->compute_x_2_object()(xy) ); + Comparison_result operator()(Bound b, + const Algebraic_real_2& xy) const { + return _m_kernel->compare_1_object() + ( _m_kernel->construct_algebraic_real_1_object()(b), + _m_kernel->compute_x_2_object()(xy) ); } Comparison_result operator() - (const Algebraic_real_2& xy, - typename CGAL::First_if_different::Type c) - const { - return _m_kernel->compare_1_object() - ( _m_kernel->compute_x_2_object()(xy), - _m_kernel->construct_algebraic_real_1_object()(c) ); + (const Algebraic_real_2& xy, + typename CGAL::First_if_different::Type c) + const { + return _m_kernel->compare_1_object() + ( _m_kernel->compute_x_2_object()(xy), + _m_kernel->construct_algebraic_real_1_object()(c) ); } Comparison_result operator() - (typename CGAL::First_if_different::Type c, - const Algebraic_real_2& xy) const { - return _m_kernel->compare_1_object() - ( _m_kernel->construct_algebraic_real_1_object()(c), - _m_kernel->compute_x_2_object()(xy) ); + (typename CGAL::First_if_different::Type c, + const Algebraic_real_2& xy) const { + return _m_kernel->compare_1_object() + ( _m_kernel->construct_algebraic_real_1_object()(c), + _m_kernel->compute_x_2_object()(xy) ); } - Comparison_result operator()(const Algebraic_real_2& xy, + Comparison_result operator()(const Algebraic_real_2& xy, const Algebraic_real_1 a) const { - return _m_kernel->compare_1_object() - ( _m_kernel->compute_x_2_object()(xy),a ); + return _m_kernel->compare_1_object() + ( _m_kernel->compute_x_2_object()(xy),a ); } - Comparison_result operator()(const Algebraic_real_1& a, - const Algebraic_real_2& xy) const { - return _m_kernel->compare_1_object() - ( a,_m_kernel->compute_x_2_object()(xy) ); + Comparison_result operator()(const Algebraic_real_1& a, + const Algebraic_real_2& xy) const { + return _m_kernel->compare_1_object() + ( a,_m_kernel->compute_x_2_object()(xy) ); } @@ -1257,11 +1257,11 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_pred(Compare_x_2, compare_x_2_object); - /*! + /*! * \brief comparison of y-coordinates of two points * * \attention{If both points have different x-coordinates, this method - * has to translate both y-coordinates + * has to translate both y-coordinates * into isolating interval representations which is a time-consuming * operation (compare the documentation of the \c Get_y_2 functor) * If possible, it is recommended to avoid this functor for efficiency.} @@ -1269,113 +1269,113 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ class Compare_y_2 : public CGAL::cpp98::binary_function< Algebraic_real_2, Algebraic_real_2, Comparison_result > { - + public: - Compare_y_2(const Algebraic_kernel_d_2* kernel) + Compare_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - - Comparison_result operator()(const Algebraic_real_2& xy1, + + Comparison_result operator()(const Algebraic_real_2& xy1, const Algebraic_real_2& xy2) const { - - // It is easier if the x coordinates are equal! - if(_m_kernel->compare_x_2_object()(xy1, xy2) == - CGAL::EQUAL) - return _m_kernel->compare_xy_2_object()(xy1, xy2, true); - - return _m_kernel->compare_1_object()(xy1.y(), xy2.y()); - } - - Comparison_result operator()(const Algebraic_real_2& xy, + + // It is easier if the x coordinates are equal! + if(_m_kernel->compare_x_2_object()(xy1, xy2) == + CGAL::EQUAL) + return _m_kernel->compare_xy_2_object()(xy1, xy2, true); + + return _m_kernel->compare_1_object()(xy1.y(), xy2.y()); + } + + Comparison_result operator()(const Algebraic_real_2& xy, int i) const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_i - = _m_kernel->construct_algebraic_real_2_object()(x,i); - return _m_kernel->compare_xy_2_object()(xy, xy_from_i, true); - + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_i + = _m_kernel->construct_algebraic_real_2_object()(x,i); + return _m_kernel->compare_xy_2_object()(xy, xy_from_i, true); + } - Comparison_result operator()(int i,const Algebraic_real_2& xy) const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_i - = _m_kernel->construct_algebraic_real_2_object()(x,i); - return _m_kernel->compare_xy_2_object()(xy_from_i, xy, true); - + Comparison_result operator()(int i,const Algebraic_real_2& xy) const { + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_i + = _m_kernel->construct_algebraic_real_2_object()(x,i); + return _m_kernel->compare_xy_2_object()(xy_from_i, xy, true); + } - Comparison_result operator()(const Algebraic_real_2& xy, + Comparison_result operator()(const Algebraic_real_2& xy, Bound b) const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_b - = _m_kernel->construct_algebraic_real_2_object()(x,b); - return _m_kernel->compare_xy_2_object()(xy, xy_from_b, true); - - } - - Comparison_result operator()(Bound b, - const Algebraic_real_2& xy) const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_b - = _m_kernel->construct_algebraic_real_2_object()(x,b); - return _m_kernel->compare_xy_2_object()(xy_from_b, xy, true); - } - - Comparison_result operator() - (const Algebraic_real_2& xy, - typename CGAL::First_if_different::Type c) - const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_c - = _m_kernel->construct_algebraic_real_2_object()(x,c); - return _m_kernel->compare_xy_2_object()(xy, xy_from_c, true); - } - - Comparison_result operator() - (typename CGAL::First_if_different::Type c, - const Algebraic_real_2& xy) - const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_c - = _m_kernel->construct_algebraic_real_2_object()(x,c); - return _m_kernel->compare_xy_2_object()(xy_from_c, xy, true); - } - - Comparison_result operator()(const Algebraic_real_2& xy, + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_b + = _m_kernel->construct_algebraic_real_2_object()(x,b); + return _m_kernel->compare_xy_2_object()(xy, xy_from_b, true); + + } + + Comparison_result operator()(Bound b, + const Algebraic_real_2& xy) const { + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_b + = _m_kernel->construct_algebraic_real_2_object()(x,b); + return _m_kernel->compare_xy_2_object()(xy_from_b, xy, true); + } + + Comparison_result operator() + (const Algebraic_real_2& xy, + typename CGAL::First_if_different::Type c) + const { + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_c + = _m_kernel->construct_algebraic_real_2_object()(x,c); + return _m_kernel->compare_xy_2_object()(xy, xy_from_c, true); + } + + Comparison_result operator() + (typename CGAL::First_if_different::Type c, + const Algebraic_real_2& xy) + const { + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_c + = _m_kernel->construct_algebraic_real_2_object()(x,c); + return _m_kernel->compare_xy_2_object()(xy_from_c, xy, true); + } + + Comparison_result operator()(const Algebraic_real_2& xy, const Algebraic_real_1& a) const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_a - = _m_kernel->construct_algebraic_real_2_object()(x,a); - return _m_kernel->compare_xy_2_object()(xy, xy_from_a, true); - - } - - Comparison_result operator()(const Algebraic_real_1& a, - const Algebraic_real_2& xy) const { - - Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); - Algebraic_real_2 xy_from_a - = _m_kernel->construct_algebraic_real_2_object()(x,a); - return _m_kernel->compare_xy_2_object()(xy_from_a, xy, true); - } + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_a + = _m_kernel->construct_algebraic_real_2_object()(x,a); + return _m_kernel->compare_xy_2_object()(xy, xy_from_a, true); + + } + + Comparison_result operator()(const Algebraic_real_1& a, + const Algebraic_real_2& xy) const { + + Algebraic_real_1 x = _m_kernel->compute_x_2_object()(xy); + Algebraic_real_2 xy_from_a + = _m_kernel->construct_algebraic_real_2_object()(x,a); + return _m_kernel->compare_xy_2_object()(xy_from_a, xy, true); + } protected: - + const Algebraic_kernel_d_2* _m_kernel; - + }; CGAL_Algebraic_Kernel_pred(Compare_y_2, compare_y_2_object); - - /*! + + /*! * \brief lexicographical comparison of two \c Algebraic_real_2 objects * - * \param equal_x if set, the points are assumed + * \param equal_x if set, the points are assumed * to have equal x-coordinates, thus only the y-coordinates are compared. */ class Compare_xy_2 : @@ -1384,26 +1384,26 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public: - Compare_xy_2(const Algebraic_kernel_d_2* kernel) + Compare_xy_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - - Comparison_result operator()(const Algebraic_real_2& xy1, + + Comparison_result operator()(const Algebraic_real_2& xy1, const Algebraic_real_2& xy2, bool equal_x = false) const { // handle easy cases first /*if(xy1.is_identical(xy2)) return CGAL::EQUAL; - + if(equal_x && xy1.curve().is_identical(xy2.curve())) return CGAL::sign(xy1.arcno() - xy2.arcno()); - + bool swap = (xy1.id() > xy2.id()); std::pair p(xy1, xy2); if(swap) { p.first = xy2; p.second = xy1; } - + typename Cmp_xy_map::Find_result r = _m_kernel->_m_cmp_xy.find(p); if(r.second) { @@ -1411,89 +1411,89 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ return (swap ? -(r.first->second) : r.first->second); }*/ - return xy1.compare_xy(xy2, equal_x); + return xy1.compare_xy(xy2, equal_x); //_m_kernel->_m_cmp_xy.insert(std::make_pair(p, res)); //return (swap ? -res : res); - } - - Comparison_result operator() (const Algebraic_real_2& xy, - int x, int y) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(xy,x); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(xy,y) ); - } - - Comparison_result operator() (int x,int y, - const Algebraic_real_2& xy) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(x,xy); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(y,xy) ); - } - - Comparison_result operator() (const Algebraic_real_2& xy, - Bound x, Bound y) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(xy,x); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(xy,y) ); - } - - Comparison_result operator() (Bound x,Bound y, - const Algebraic_real_2& xy) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(x,xy); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(y,xy) ); - } - - Comparison_result operator() - (const Algebraic_real_2& xy, - typename CGAL::First_if_different::Type x, - typename CGAL::First_if_different::Type y) - const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(xy,x); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(xy,y) ); - } - - Comparison_result operator() - (typename CGAL::First_if_different::Type x, - typename CGAL::First_if_different::Type y, - const Algebraic_real_2& xy) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(x,xy); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(y,xy) ); - } - - Comparison_result operator() (const Algebraic_real_2& xy, - const Algebraic_real_1& x, - const Algebraic_real_1& y) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(xy,x); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(xy,y) ); - } - - Comparison_result operator() (const Algebraic_real_1& x, - const Algebraic_real_1& y, - const Algebraic_real_2& xy) const { - Comparison_result comp_x - = _m_kernel->compare_x_2_object()(x,xy); - return (comp_x != CGAL::EQUAL - ? comp_x - : _m_kernel->compare_y_2_object()(y,xy) ); - } + } + + Comparison_result operator() (const Algebraic_real_2& xy, + int x, int y) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(xy,x); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(xy,y) ); + } + + Comparison_result operator() (int x,int y, + const Algebraic_real_2& xy) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(x,xy); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(y,xy) ); + } + + Comparison_result operator() (const Algebraic_real_2& xy, + Bound x, Bound y) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(xy,x); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(xy,y) ); + } + + Comparison_result operator() (Bound x,Bound y, + const Algebraic_real_2& xy) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(x,xy); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(y,xy) ); + } + + Comparison_result operator() + (const Algebraic_real_2& xy, + typename CGAL::First_if_different::Type x, + typename CGAL::First_if_different::Type y) + const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(xy,x); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(xy,y) ); + } + + Comparison_result operator() + (typename CGAL::First_if_different::Type x, + typename CGAL::First_if_different::Type y, + const Algebraic_real_2& xy) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(x,xy); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(y,xy) ); + } + + Comparison_result operator() (const Algebraic_real_2& xy, + const Algebraic_real_1& x, + const Algebraic_real_1& y) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(xy,x); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(xy,y) ); + } + + Comparison_result operator() (const Algebraic_real_1& x, + const Algebraic_real_1& y, + const Algebraic_real_2& xy) const { + Comparison_result comp_x + = _m_kernel->compare_x_2_object()(x,xy); + return (comp_x != CGAL::EQUAL + ? comp_x + : _m_kernel->compare_y_2_object()(y,xy) ); + } protected: @@ -1501,22 +1501,22 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_pred(Compare_xy_2, compare_xy_2_object); - + /*! - * \brief checks whether the curve induced by \c p + * \brief checks whether the curve induced by \c p * has only finitely many self-intersection points * - * In algebraic terms, it is checked whether + * In algebraic terms, it is checked whether * the polynomial \c p is square free. */ class Has_finite_number_of_self_intersections_2 : public CGAL::cpp98::unary_function< Polynomial_2, bool > { - + public: - Has_finite_number_of_self_intersections_2(const Algebraic_kernel_d_2* kernel) + Has_finite_number_of_self_intersections_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + bool operator()(const Polynomial_2& p) const { typename Polynomial_traits_2::Is_square_free is_square_free; @@ -1524,26 +1524,26 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } protected: - + const Algebraic_kernel_d_2* _m_kernel; - + }; - CGAL_Algebraic_Kernel_pred(Has_finite_number_of_self_intersections_2, + CGAL_Algebraic_Kernel_pred(Has_finite_number_of_self_intersections_2, has_finite_number_of_self_intersections_2_object); - - /*! - * \brief checks whether two curves induced bt \c f and \c g + + /*! + * \brief checks whether two curves induced bt \c f and \c g * habe finitely many intersections. * - * In algebraic terms, it is checked whether + * In algebraic terms, it is checked whether * the two polynomials \c f and \c g are coprime. - */ + */ class Has_finite_number_of_intersections_2 : public CGAL::cpp98::binary_function< Polynomial_2, Polynomial_2, bool > { - + public: - Has_finite_number_of_intersections_2(const Algebraic_kernel_d_2* kernel) + Has_finite_number_of_intersections_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} bool operator()(const Polynomial_2& f, @@ -1557,28 +1557,28 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } protected: - + const Algebraic_kernel_d_2* _m_kernel; - + }; - CGAL_Algebraic_Kernel_pred(Has_finite_number_of_intersections_2, + CGAL_Algebraic_Kernel_pred(Has_finite_number_of_intersections_2, has_finite_number_of_intersections_2_object); - + // Square_free_factorize_2 class Square_free_factorize_2 { public: - - Square_free_factorize_2(const Algebraic_kernel_d_2* kernel) + + Square_free_factorize_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + typedef Polynomial_2 first_argument_type; template< class OutputIterator> - OutputIterator operator()( const Polynomial_2& p, OutputIterator it) + OutputIterator operator()( const Polynomial_2& p, OutputIterator it) const { return CGAL::square_free_factorize_up_to_constant_factor(p,it); - } - + } + protected: const Algebraic_kernel_d_2* _m_kernel; @@ -1587,15 +1587,15 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ CGAL_Algebraic_Kernel_cons( Square_free_factorize_2, square_free_factorize_2_object); - //this is deprecated ! + //this is deprecated ! //! Various curve and curve pair decomposition functions class Decompose_2 { - + public: typedef bool result_type; - Decompose_2(const Algebraic_kernel_d_2* kernel) + Decompose_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} //! returns the square free part of the curve induced by \c p @@ -1603,11 +1603,11 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ typename Polynomial_traits_2::Make_square_free msf; return msf(p); } - - /*! - * \brief computes a square-free factorization of a curve \c c, + + /*! + * \brief computes a square-free factorization of a curve \c c, * returns the number of pairwise coprime square-free factors - * + * * returns square-free pairwise coprime factors in \c fit and * multiplicities in \c mit. The value type of \c fit is * \c Curve_analysis_2, the value type of \c mit is \c int @@ -1615,17 +1615,17 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ template< class OutputIterator1, class OutputIterator2 > int operator()(const Curve_analysis_2& ca, OutputIterator1 fit, OutputIterator2 mit ) const { - + typename Polynomial_traits_2:: Square_free_factorize_up_to_constant_factor factorize; std::vector factors; - + int n_factors = factorize(ca.polynomial_2(), std::back_inserter(factors), mit); Construct_curve_2 cc_2 = _m_kernel->construct_curve_2_object(); - for(int i = 0; i < static_cast(factors.size()); i++) + for(int i = 0; i < static_cast(factors.size()); i++) *fit++ = cc_2(factors[i]); - + return n_factors; } @@ -1636,23 +1636,23 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ * The common part of the curves \c ca1 and \c ca2 is written in * \c oib, the coprime parts are written to \c oi1 and \c oi2, * respectively. - * - * \return {true, if the two curves were not coprime (i.e., have a + * + * \return {true, if the two curves were not coprime (i.e., have a * non-trivial common part} * * The value type of \c oi{1,2,b} is \c Curve_analysis_2 */ - template < class OutputIterator > + template < class OutputIterator > bool operator()(const Curve_analysis_2& ca1, const Curve_analysis_2& ca2, OutputIterator oi1, OutputIterator oi2, OutputIterator oib) const { #if CGAL_ACK_DONT_CHECK_POLYNOMIALS_FOR_COPRIMALITY - return false; -#else + return false; +#else Construct_curve_2 cc_2 = _m_kernel->construct_curve_2_object(); - + if (ca1.id() == ca2.id()) { return false; @@ -1660,7 +1660,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Polynomial_2& f = ca1.polynomial_2(); const Polynomial_2& g = ca2.polynomial_2(); - + if(f == g) { // both curves are equal, but have different representations! // std::cout <<"f: " << f <=1 || + if( CGAL::degree(divided_curve)>=1 || CGAL::degree( CGAL::univariate_content_up_to_constant_factor (divided_curve)) >=1 ) { @@ -1697,7 +1697,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ return true; } - + // copy original curves to the output iterator: *oi1++ = ca1; *oi2++ = ca2; @@ -1711,12 +1711,12 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_cons(Decompose_2, decompose_2_object); - + //!@} public: //! \name types and functors for \c CurvedKernelViaAnalysis_2 //!@{ - + //! Algebraic name typedef Algebraic_real_1 Coordinate_1; @@ -1727,13 +1727,13 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public: - Is_square_free_2(const Algebraic_kernel_d_2* kernel) + Is_square_free_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} bool operator()(const Polynomial_2& p) const { - return typename Polynomial_traits_2::Is_square_free() (p); + return typename Polynomial_traits_2::Is_square_free() (p); } - + private: const Algebraic_kernel_d_2* _m_kernel; @@ -1749,13 +1749,13 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ Polynomial_2> { public: - Make_square_free_2(const Algebraic_kernel_d_2* kernel) + Make_square_free_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} Polynomial_2 operator()(const Polynomial_2& p) const { - return typename Polynomial_traits_2::Make_square_free() (p); + return typename Polynomial_traits_2::Make_square_free() (p); } - + private: const Algebraic_kernel_d_2* _m_kernel; @@ -1769,32 +1769,32 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ typedef bool result_type; - Make_coprime_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + Make_coprime_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + bool operator()(const Polynomial_2& p1, - const Polynomial_2& p2, - Polynomial_2& g, - Polynomial_2& q1, - Polynomial_2& q2) const { - - Polynomial_2 one(Coefficient(1)); - - if (p1==p2) { - g=p1; q1=one; q2=one; - return false; - } - Gcd_cache_2& gcd_cache = _m_kernel->gcd_cache_2(); - g = gcd_cache(std::make_pair(p1,p2)); - q1=CGAL::integral_division_up_to_constant_factor(p1,g); - q2=CGAL::integral_division_up_to_constant_factor(p2,g); - return CGAL::total_degree(g)==0; + const Polynomial_2& p2, + Polynomial_2& g, + Polynomial_2& q1, + Polynomial_2& q2) const { + + Polynomial_2 one(Coefficient(1)); + + if (p1==p2) { + g=p1; q1=one; q2=one; + return false; + } + Gcd_cache_2& gcd_cache = _m_kernel->gcd_cache_2(); + g = gcd_cache(std::make_pair(p1,p2)); + q1=CGAL::integral_division_up_to_constant_factor(p1,g); + q2=CGAL::integral_division_up_to_constant_factor(p2,g); + return CGAL::total_degree(g)==0; } - + private: - + const Algebraic_kernel_d_2* _m_kernel; - + }; CGAL_Algebraic_Kernel_cons(Make_coprime_2, make_coprime_2_object); @@ -1804,42 +1804,42 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ /*! * \brief computes the x-critical points of of a curve/a polynomial * - * An x-critical point (x,y) of \c f (or its induced curve) - * satisfies f(x,y) = f_y(x,y) = 0, + * An x-critical point (x,y) of \c f (or its induced curve) + * satisfies f(x,y) = f_y(x,y) = 0, * where f_y means the derivative w.r.t. y. * In pariticular, each singular point is x-critical. */ - class X_critical_points_2 : + class X_critical_points_2 : public CGAL::cpp98::binary_function< Curve_analysis_2, CGAL::cpp98::iterator, CGAL::cpp98::iterator > { - + public: - - X_critical_points_2(const Algebraic_kernel_d_2* kernel) + + X_critical_points_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - /*! - * \brief writes the x-critical points of \c ca_2 into \c oi + /*! + * \brief writes the x-critical points of \c ca_2 into \c oi */ template OutputIterator operator()(const Curve_analysis_2& ca_2, OutputIterator oi) const { - + typename Polynomial_traits_2::Differentiate diff; Construct_curve_2 cc_2 = _m_kernel->construct_curve_2_object(); - Construct_curve_pair_2 ccp_2 + Construct_curve_pair_2 ccp_2 = _m_kernel->construct_curve_pair_2_object(); // construct curve analysis of a derivative in y Curve_analysis_2 ca_2x = cc_2(diff(ca_2.polynomial_2(),0)); Curve_pair_analysis_2 cpa_2 = ccp_2(ca_2, ca_2x); typename Curve_pair_analysis_2::Status_line_1 cpv_line; typename Curve_analysis_2::Status_line_1 cv_line; - + int i, j, n_arcs, n_events = cpa_2.number_of_status_lines_with_event(); std::pair ipair; bool vline_constructed = false; - + for(i = 0; i < n_events; i++) { cpv_line = cpa_2.status_line_at_event(i); // no 2-curve intersections over this status line @@ -1848,7 +1848,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ n_arcs = cpv_line.number_of_events(); for(j = 0; j < n_arcs; j++) { ipair = cpv_line.curves_at_event(j, ca_2,ca_2x); - if(ipair.first == -1|| ipair.second == -1) + if(ipair.first == -1|| ipair.second == -1) continue; if(!vline_constructed) { cv_line = ca_2.status_line_at_exact_x(cpv_line.x()); @@ -1862,7 +1862,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ } return oi; } - + //! \brief computes the \c i-th x-critical point of \c ca Algebraic_real_2 operator()(const Curve_analysis_2& ca, int i) const { @@ -1871,7 +1871,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ CGAL_precondition(0 >= i&&i < x_points.size()); return x_points[i]; } - + protected: const Algebraic_kernel_d_2* _m_kernel; @@ -1879,12 +1879,12 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_cons(X_critical_points_2, x_critical_points_2_object); - + /*! * \brief computes the y-critical points of of a curve/a polynomial * - * An y-critical point (x,y) of \c f (or its induced curve) - * satisfies f(x,y) = f_x(x,y) = 0, + * An y-critical point (x,y) of \c f (or its induced curve) + * satisfies f(x,y) = f_x(x,y) = 0, * where f_x means the derivative w.r.t. x. * In pariticular, each singular point is y-critical. */ @@ -1892,34 +1892,34 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public CGAL::cpp98::binary_function< Curve_analysis_2, CGAL::cpp98::iterator, CGAL::cpp98::iterator > { - + public: - Y_critical_points_2(const Algebraic_kernel_d_2* kernel) + Y_critical_points_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - /*! - * \brief writes the y-critical points of \c ca_2 into \c oi + /*! + * \brief writes the y-critical points of \c ca_2 into \c oi */ template - OutputIterator operator()(const Curve_analysis_2& ca_2, + OutputIterator operator()(const Curve_analysis_2& ca_2, OutputIterator oi) const { Construct_curve_2 cc_2 = _m_kernel->construct_curve_2_object(); - Construct_curve_pair_2 ccp_2 + Construct_curve_pair_2 ccp_2 = _m_kernel->construct_curve_pair_2_object(); - + typename Curve_analysis_2::Status_line_1 cv_line; std::pair ipair; int i, j, k, n_arcs, n_events = ca_2.number_of_status_lines_with_event(); - - bool cpa_constructed = false, vline_constructed = false; + + bool cpa_constructed = false, vline_constructed = false; typename Curve_pair_analysis_2::Status_line_1 cpv_line; Curve_pair_analysis_2 cpa_2; - + for(i = 0; i < n_events; i++) { cv_line = ca_2.status_line_at_event(i); n_arcs = cv_line.number_of_events(); @@ -1947,7 +1947,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ // obtain the y-position of j-th event of curve p k = cpv_line.event_of_curve(j, ca_2); ipair = cpv_line.curves_at_event(k); - + // pick up only event comprised of both curve and its der if(ipair.first != -1&&ipair.second != -1) *oi++ = cv_line.algebraic_real_2(j); @@ -1983,74 +1983,74 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ // Overload the Sign_at_1 functor, to enable filter steps in the // Curve analysis in a coherent way - class Sign_at_1 + class Sign_at_1 : public::CGAL::cpp98::binary_function { - + public: - - Sign_at_1(const Algebraic_kernel_d_2* kernel) + + Sign_at_1(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - - - // Version that refines r up to a certain precision. - // If the (non-zero) sign was not computed until this - // precision, CGAL::ZERO is returned. This can be used internally - // as a filter to detect easy cases - Sign operator()(const Polynomial_1& p, - const Algebraic_real_1& r, - int max_prec) const { - typename Algebraic_kernel_d_2::Approximate_absolute_1 approx_x - = _m_kernel->approximate_absolute_1_object(); - - typedef CGAL::internal::Interval_evaluate_1< Polynomial_1, Bound > + + + // Version that refines r up to a certain precision. + // If the (non-zero) sign was not computed until this + // precision, CGAL::ZERO is returned. This can be used internally + // as a filter to detect easy cases + Sign operator()(const Polynomial_1& p, + const Algebraic_real_1& r, + int max_prec) const { + typename Algebraic_kernel_d_2::Approximate_absolute_1 approx_x + = _m_kernel->approximate_absolute_1_object(); + + typedef CGAL::internal::Interval_evaluate_1< Polynomial_1, Bound > Interval_evaluate_1; - typedef typename Interval_evaluate_1::result_type + typedef typename Interval_evaluate_1::result_type Interval_result_type; Interval_evaluate_1 interval_evaluate_1; - - long prec = 1; + + long prec = 1; while(prec<=max_prec) { - std::pair x_pair = approx_x(r,prec); - - Interval_result_type iv + std::pair x_pair = approx_x(r,prec); + + Interval_result_type iv = interval_evaluate_1(p, - std::make_pair(x_pair.first, - x_pair.second)); + std::make_pair(x_pair.first, + x_pair.second)); CGAL::Sign s_lower = CGAL::sign(iv.first); if(s_lower == CGAL::sign(iv.second)) { - return s_lower; - } else { - prec*=2; - } - } - return CGAL::ZERO; - - } + return s_lower; + } else { + prec*=2; + } + } + return CGAL::ZERO; + + } Sign operator()(const Polynomial_1& p, const Algebraic_real_1& r, - bool known_to_be_non_zero=false) const { - - if(!known_to_be_non_zero && - _m_kernel->is_zero_at_1_object()(p, r)) { - return CGAL::ZERO; - } - CGAL::Sign result = this->operator() - (p,r,(std::numeric_limits::max)()); - CGAL_assertion(result != CGAL::ZERO); - return result; - } - + bool known_to_be_non_zero=false) const { + + if(!known_to_be_non_zero && + _m_kernel->is_zero_at_1_object()(p, r)) { + return CGAL::ZERO; + } + CGAL::Sign result = this->operator() + (p,r,(std::numeric_limits::max)()); + CGAL_assertion(result != CGAL::ZERO); + return result; + } + protected: - + const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_pred(Sign_at_1, sign_at_1_object); + CGAL_Algebraic_Kernel_pred(Sign_at_1, sign_at_1_object); /*! @@ -2064,159 +2064,159 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public CGAL::cpp98::binary_function { public: - - Sign_at_2(const Algebraic_kernel_d_2* kernel) + + Sign_at_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - - Sign operator()(const Polynomial_2& f, + + Sign operator()(const Polynomial_2& f, const Algebraic_real_2& r, - bool known_to_be_non_zero=false) const { - - return this->operator()(_m_kernel->construct_curve_2_object()(f),r, - known_to_be_non_zero); - } - - // Version that refines x- and y-coordinate up to a certain - // precision. If the non-zero sign was not computed until this - // precision, CGAL::ZERO is returned. This can used internally - // as a filter to detect easy cases - Sign operator()(const Polynomial_2& f, - const Algebraic_real_2& r, - int max_prec) const { - return this->operator()(_m_kernel->construct_curve_2_object()(f),r, - max_prec); - } - - // Version that refines x- and y-coordinate up to a certain - // precision. If the non-zero sign was not computed until this - // precision, CGAL::ZERO is returned. This can be used internally - // as a filter to detect easy cases - Sign operator()(const Curve_analysis_2& ca_2, - const Algebraic_real_2& r, - int max_prec) const { - if(ca_2.is_identical(r.curve())) { - return CGAL::ZERO; - } - typename Algebraic_kernel_d_2::Approximate_absolute_x_2 approx_x - = _m_kernel->approximate_absolute_x_2_object(); - typename Algebraic_kernel_d_2::Approximate_absolute_y_2 approx_y - = _m_kernel->approximate_absolute_y_2_object(); - - typedef CGAL::internal::Interval_evaluate_2< Polynomial_2, Bound > + bool known_to_be_non_zero=false) const { + + return this->operator()(_m_kernel->construct_curve_2_object()(f),r, + known_to_be_non_zero); + } + + // Version that refines x- and y-coordinate up to a certain + // precision. If the non-zero sign was not computed until this + // precision, CGAL::ZERO is returned. This can used internally + // as a filter to detect easy cases + Sign operator()(const Polynomial_2& f, + const Algebraic_real_2& r, + int max_prec) const { + return this->operator()(_m_kernel->construct_curve_2_object()(f),r, + max_prec); + } + + // Version that refines x- and y-coordinate up to a certain + // precision. If the non-zero sign was not computed until this + // precision, CGAL::ZERO is returned. This can be used internally + // as a filter to detect easy cases + Sign operator()(const Curve_analysis_2& ca_2, + const Algebraic_real_2& r, + int max_prec) const { + if(ca_2.is_identical(r.curve())) { + return CGAL::ZERO; + } + typename Algebraic_kernel_d_2::Approximate_absolute_x_2 approx_x + = _m_kernel->approximate_absolute_x_2_object(); + typename Algebraic_kernel_d_2::Approximate_absolute_y_2 approx_y + = _m_kernel->approximate_absolute_y_2_object(); + + typedef CGAL::internal::Interval_evaluate_2< Polynomial_2, Bound > Interval_evaluate_2; - typedef typename Interval_evaluate_2::result_type + typedef typename Interval_evaluate_2::result_type Interval_result_type; Interval_evaluate_2 interval_evaluate_2; - - long prec = 4; + + long prec = 4; while(prec<=max_prec) { - std::pair x_pair = approx_x(r,prec); - std::pair y_pair = approx_y(r,prec); - - Interval_result_type iv + std::pair x_pair = approx_x(r,prec); + std::pair y_pair = approx_y(r,prec); + + Interval_result_type iv = interval_evaluate_2(ca_2.polynomial_2(), - CGAL::make_array(x_pair.first, - x_pair.second, - y_pair.first, - y_pair.second)); + CGAL::make_array(x_pair.first, + x_pair.second, + y_pair.first, + y_pair.second)); CGAL::Sign s_lower = CGAL::sign(iv.first); if(s_lower == CGAL::sign(iv.second)) { - return s_lower; - } else { - prec*=2; - } - } - return CGAL::ZERO; - - } + return s_lower; + } else { + prec*=2; + } + } + return CGAL::ZERO; + + } Sign operator()(const Curve_analysis_2& ca_2, const Algebraic_real_2& r, - bool known_to_be_non_zero=false) const { - - if(ca_2.is_identical(r.curve())) { - return CGAL::ZERO; - } - if(!known_to_be_non_zero && - _m_kernel->is_zero_at_2_object()(ca_2, r)) { - return CGAL::ZERO; - } - CGAL::Sign result = this->operator() - (ca_2,r,(std::numeric_limits::max)()); - CGAL_assertion(result != CGAL::ZERO); - return result; - } - + bool known_to_be_non_zero=false) const { + + if(ca_2.is_identical(r.curve())) { + return CGAL::ZERO; + } + if(!known_to_be_non_zero && + _m_kernel->is_zero_at_2_object()(ca_2, r)) { + return CGAL::ZERO; + } + CGAL::Sign result = this->operator() + (ca_2,r,(std::numeric_limits::max)()); + CGAL_assertion(result != CGAL::ZERO); + return result; + } + protected: - + const Algebraic_kernel_d_2* _m_kernel; - + }; CGAL_Algebraic_Kernel_pred(Sign_at_2, sign_at_2_object); - class Is_zero_at_2 + class Is_zero_at_2 : public CGAL::cpp98::binary_function { - + public: - - Is_zero_at_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + + Is_zero_at_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + bool operator() (const Polynomial_2& f, const Algebraic_real_2& r) const { - return this->operator() (_m_kernel->construct_curve_2_object()(f),r); + return this->operator() (_m_kernel->construct_curve_2_object()(f),r); } - bool operator() (const Curve_analysis_2& ca_2, - const Algebraic_real_2& r) const { - - - if (CGAL::is_zero(ca_2.polynomial_2())) { - return true; - } - - Construct_curve_2 cc_2 = _m_kernel->construct_curve_2_object(); - Construct_curve_pair_2 ccp_2 - = _m_kernel->construct_curve_pair_2_object(); - - typename Curve_analysis_2::Status_line_1 - cv_line = ca_2.status_line_for_x(r.x()); - // fast check for the presence of status line at r.x() - if(cv_line.covers_line()) - return true; - - // Handle non-coprime polynomial - Polynomial_2 gcd = _m_kernel->gcd_cache_2() - (std::make_pair(ca_2.polynomial_2(), r.curve().polynomial_2())); - - Curve_analysis_2 gcd_curve = cc_2(gcd); - if(CGAL::total_degree(gcd)>0) { - - Construct_curve_pair_2 ccp_2 - = _m_kernel->construct_curve_pair_2_object(); - Curve_analysis_2 r_curve_remainder = - cc_2(CGAL::integral_division_up_to_constant_factor - (r.curve().polynomial_2(), gcd)); - - r.simplify_by(ccp_2(gcd_curve, r_curve_remainder)); - if(r.curve().polynomial_2() == gcd) - return true; - } - - Curve_pair_analysis_2 cpa_2 = ccp_2(ca_2, r.curve()); - typename Curve_pair_analysis_2::Status_line_1 - cpv_line = cpa_2.status_line_for_x(r.x()); - - if(cpv_line.is_event() && cpv_line.is_intersection()) { - // get an y-position of the point r - int idx = cpv_line.event_of_curve(r.arcno(), r.curve()); - std::pair ipair = - cpv_line.curves_at_event(idx); - if(ipair.first != -1 && ipair.second != -1) - return true; - } - return false; + bool operator() (const Curve_analysis_2& ca_2, + const Algebraic_real_2& r) const { + + + if (CGAL::is_zero(ca_2.polynomial_2())) { + return true; + } + + Construct_curve_2 cc_2 = _m_kernel->construct_curve_2_object(); + Construct_curve_pair_2 ccp_2 + = _m_kernel->construct_curve_pair_2_object(); + + typename Curve_analysis_2::Status_line_1 + cv_line = ca_2.status_line_for_x(r.x()); + // fast check for the presence of status line at r.x() + if(cv_line.covers_line()) + return true; + + // Handle non-coprime polynomial + Polynomial_2 gcd = _m_kernel->gcd_cache_2() + (std::make_pair(ca_2.polynomial_2(), r.curve().polynomial_2())); + + Curve_analysis_2 gcd_curve = cc_2(gcd); + if(CGAL::total_degree(gcd)>0) { + + Construct_curve_pair_2 ccp_2 + = _m_kernel->construct_curve_pair_2_object(); + Curve_analysis_2 r_curve_remainder = + cc_2(CGAL::integral_division_up_to_constant_factor + (r.curve().polynomial_2(), gcd)); + + r.simplify_by(ccp_2(gcd_curve, r_curve_remainder)); + if(r.curve().polynomial_2() == gcd) + return true; + } + + Curve_pair_analysis_2 cpa_2 = ccp_2(ca_2, r.curve()); + typename Curve_pair_analysis_2::Status_line_1 + cpv_line = cpa_2.status_line_for_x(r.x()); + + if(cpv_line.is_event() && cpv_line.is_intersection()) { + // get an y-position of the point r + int idx = cpv_line.event_of_curve(r.arcno(), r.curve()); + std::pair ipair = + cpv_line.curves_at_event(idx); + if(ipair.first != -1 && ipair.second != -1) + return true; + } + return false; } protected: @@ -2224,8 +2224,8 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Is_zero_at_2, - is_zero_at_2_object); + CGAL_Algebraic_Kernel_cons(Is_zero_at_2, + is_zero_at_2_object); protected: @@ -2235,79 +2235,79 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public: - Solve_at_x_2(const Algebraic_kernel_d_2* kernel) + Solve_at_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - //! Version with Algebraic_real_1 + //! Version with Algebraic_real_1 template - OutputIterator - operator()(const Curve_pair_analysis_2& cpa_2, - Algebraic_real_1 a, - OutputIterator res) const { - int idx; bool event; - cpa_2.x_to_index(a,idx,event); - if(! event) { - return res; // no intersections at a - } else { - return this->operator()(cpa_2,idx,res); - } - } + OutputIterator + operator()(const Curve_pair_analysis_2& cpa_2, + Algebraic_real_1 a, + OutputIterator res) const { + int idx; bool event; + cpa_2.x_to_index(a,idx,event); + if(! event) { + return res; // no intersections at a + } else { + return this->operator()(cpa_2,idx,res); + } + } //! Version with index (faster) template - OutputIterator - operator()(const Curve_pair_analysis_2& cpa_2, - size_type index, - OutputIterator res) const + OutputIterator + operator()(const Curve_pair_analysis_2& cpa_2, + size_type index, + OutputIterator res) const { - Curve_analysis_2 ca1 = cpa_2.curve_analysis(true), - ca2 = cpa_2.curve_analysis(false); + Curve_analysis_2 ca1 = cpa_2.curve_analysis(true), + ca2 = cpa_2.curve_analysis(false); typename Curve_pair_analysis_2::Status_line_1 cpv_line; - // do we need to check which supporting curve is simpler ? + // do we need to check which supporting curve is simpler ? typename Polynomial_traits_2::Total_degree total_degree; Polynomial_2 f1 = ca1.polynomial_2(), f2 = ca2.polynomial_2(); bool first_curve = (total_degree(f1) < total_degree(f2)); - + CGAL_assertion(index ipair = cpv_line.curves_at_event(j,ca1,ca2); - if(ipair.first != -1 && ipair.second != -1) { - Algebraic_real_2 new_root - = Algebraic_real_2(x, - (first_curve ? ca1 : ca2), - (first_curve ? ipair.first - : ipair.second)); - Multiplicity_type new_mult - = cpv_line.multiplicity_of_intersection(j); - *res++ = std::make_pair(new_root,new_mult); - continue; - } - if(ipair.first!=-1 && ca2_covers_line) { - Algebraic_real_2 new_root - = Algebraic_real_2(x,ca1,ipair.first); - Multiplicity_type new_mult=-1; - *res++ = std::make_pair(new_root,new_mult); - continue; - } - if(ipair.second!=-1 && ca1_covers_line) { - Algebraic_real_2 new_root - = Algebraic_real_2(x,ca2,ipair.second); - Multiplicity_type new_mult=-1; - *res++ = std::make_pair(new_root,new_mult); - continue; - } - } - return res; + cpv_line = cpa_2.status_line_at_event(index); + Algebraic_real_1 x = cpv_line.x(); + bool ca1_covers_line + = ca1.status_line_at_exact_x(x).covers_line(); + bool ca2_covers_line + = ca2.status_line_at_exact_x(x).covers_line(); + + for(int j = 0; j < cpv_line.number_of_events(); j++) { + std::pair ipair = cpv_line.curves_at_event(j,ca1,ca2); + if(ipair.first != -1 && ipair.second != -1) { + Algebraic_real_2 new_root + = Algebraic_real_2(x, + (first_curve ? ca1 : ca2), + (first_curve ? ipair.first + : ipair.second)); + Multiplicity_type new_mult + = cpv_line.multiplicity_of_intersection(j); + *res++ = std::make_pair(new_root,new_mult); + continue; + } + if(ipair.first!=-1 && ca2_covers_line) { + Algebraic_real_2 new_root + = Algebraic_real_2(x,ca1,ipair.first); + Multiplicity_type new_mult=-1; + *res++ = std::make_pair(new_root,new_mult); + continue; + } + if(ipair.second!=-1 && ca1_covers_line) { + Algebraic_real_2 new_root + = Algebraic_real_2(x,ca2,ipair.second); + Multiplicity_type new_mult=-1; + *res++ = std::make_pair(new_root,new_mult); + continue; + } + } + return res; } protected: @@ -2324,12 +2324,12 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ * \brief computes solutions of systems of two 2 equations and 2 variables * * \pre the polynomials must be square-free and coprime - */ + */ class Solve_2 { - + public: - Solve_2(const Algebraic_kernel_d_2* kernel) + Solve_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE @@ -2338,32 +2338,32 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ operator() (const Polynomial_2& f, const Polynomial_2& g, OutputIteratorRoots roots, OutputIteratorMult mults) const { - std::vector > - roots_vec; - this->operator()(f,g,std::back_inserter(roots_vec)); - typename Algebraic_kernel_d_1::template Pair_first - pair_first; - typename Algebraic_kernel_d_1::template Pair_second - pair_second; - std::copy(::boost::make_transform_iterator - (roots_vec.begin(),pair_first), - ::boost::make_transform_iterator - (roots_vec.end(),pair_first), - roots); - std::copy(::boost::make_transform_iterator - (roots_vec.begin(),pair_second), - ::boost::make_transform_iterator - (roots_vec.end(),pair_second), - mults); - return std::make_pair(roots,mults); - } - + std::vector > + roots_vec; + this->operator()(f,g,std::back_inserter(roots_vec)); + typename Algebraic_kernel_d_1::template Pair_first + pair_first; + typename Algebraic_kernel_d_1::template Pair_second + pair_second; + std::copy(::boost::make_transform_iterator + (roots_vec.begin(),pair_first), + ::boost::make_transform_iterator + (roots_vec.end(),pair_first), + roots); + std::copy(::boost::make_transform_iterator + (roots_vec.begin(),pair_second), + ::boost::make_transform_iterator + (roots_vec.end(),pair_second), + mults); + return std::make_pair(roots,mults); + } + #endif - /*! + /*! * \brief solves the system (f=0,g=0) * - * All solutions of the system are written into \c roots + * All solutions of the system are written into \c roots * (whose value type is \c Algebraic_real_2). The multiplicities * are written into \c mults (whose value type is \c int) */ @@ -2371,7 +2371,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ operator() (const Polynomial_2& f, const Polynomial_2& g, OutputIterator res) const { - return + return (*this)(_m_kernel->construct_curve_2_object()(f), _m_kernel->construct_curve_2_object()(g), res); @@ -2383,42 +2383,42 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ operator() (const Curve_analysis_2& f, const Curve_analysis_2& g, OutputIteratorRoots roots, OutputIteratorMult mults) const { - std::vector > - roots_vec; - this->operator()(f,g,std::back_inserter(roots_vec)); - typename Algebraic_kernel_d_1::template Pair_first - pair_first; - typename Algebraic_kernel_d_1::template Pair_second - pair_second; - std::copy(::boost::make_transform_iterator - (roots_vec.begin(),pair_first), - ::boost::make_transform_iterator - (roots_vec.end(),pair_first), - roots); - std::copy(::boost::make_transform_iterator - (roots_vec.begin(),pair_second), - ::boost::make_transform_iterator - (roots_vec.end(),pair_second), - mults); - return std::make_pair(roots,mults); - } - + std::vector > + roots_vec; + this->operator()(f,g,std::back_inserter(roots_vec)); + typename Algebraic_kernel_d_1::template Pair_first + pair_first; + typename Algebraic_kernel_d_1::template Pair_second + pair_second; + std::copy(::boost::make_transform_iterator + (roots_vec.begin(),pair_first), + ::boost::make_transform_iterator + (roots_vec.end(),pair_first), + roots); + std::copy(::boost::make_transform_iterator + (roots_vec.begin(),pair_second), + ::boost::make_transform_iterator + (roots_vec.end(),pair_second), + mults); + return std::make_pair(roots,mults); + } + #endif //! Version with curve analyses template - OutputIterator - operator()(const Curve_analysis_2& ca1, - const Curve_analysis_2& ca2, - OutputIterator res) const + OutputIterator + operator()(const Curve_analysis_2& ca1, + const Curve_analysis_2& ca2, + OutputIterator res) const { // these tests are quite expensive... do we really need them ?? /* CGAL_precondition_code ( - typename Self::Has_finite_number_of_self_intersections_2 + typename Self::Has_finite_number_of_self_intersections_2 not_self_overlapped; - typename Self::Has_finite_number_of_intersections_2 + typename Self::Has_finite_number_of_intersections_2 do_not_overlap; CGAL_precondition(not_self_overlapped(ca1) && not_self_overlapped(ca2)); @@ -2429,70 +2429,70 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ = _m_kernel->construct_curve_pair_2_object(); Curve_pair_analysis_2 cpa_2 = ccp_2(ca1, ca2); typename Curve_pair_analysis_2::Status_line_1 cpv_line; - // do we need to check which supporting curve is simpler ? + // do we need to check which supporting curve is simpler ? //typename Polynomial_traits_2::Total_degree total_degree; //Polynomial_2 f1 = ca1.polynomial_2(), // f2 = ca2.polynomial_2(); //bool first_curve = (total_degree(f1) < total_degree(f2)); - + int i, n = cpa_2.number_of_status_lines_with_event(); - for(i = 0; i < n; i++) { + for(i = 0; i < n; i++) { _m_kernel->solve_at_x_2_object()(cpa_2,i,res); } return res; } - template OutputIterator - operator() - (const Polynomial_2& f, const Polynomial_2& g, - Bound xl, Bound xu, Bound yl, Bound yu, - OutputIterator res) const { - // Note: This could be improved by not computing all solutions - // but only those in [xl,xu] (lazy evaluation) - std::vector > roots; - this->operator() (f,g,std::back_inserter(roots)); - // Find the x-values using binary search: - typename Algebraic_kernel_d_1::template Pair_first - pair_first; - typedef typename - std::vector > - ::iterator Iterator; - Iterator roots_start = std::lower_bound - (::boost::make_transform_iterator - (roots.begin(), - _m_kernel->unary_compose(pair_first, - _m_kernel->compute_x_2_object())), - ::boost::make_transform_iterator - (roots.end(), - _m_kernel->unary_compose(pair_first, - _m_kernel->compute_x_2_object())), - _m_kernel->construct_algebraic_real_1_object()(xl)).base(); - Iterator roots_end = std::upper_bound - (::boost::make_transform_iterator - (roots_start, - _m_kernel->unary_compose(pair_first, - _m_kernel->compute_x_2_object())), - ::boost::make_transform_iterator - (roots.end(), - _m_kernel->unary_compose(pair_first, - _m_kernel->compute_x_2_object())), - _m_kernel->construct_algebraic_real_1_object()(xu)).base(); - // Now check y-coordinate. Binary search is not possible here! - // Note that compare_y is not too expensive here because we - // only compare with rationals - for(Iterator it=roots_start;it!=roots_end;it++) { - if(_m_kernel->compare_y_2_object()(yl,it->first)==CGAL::LARGER) { - continue; - } - if(_m_kernel->compare_y_2_object()(it->first,yu)==CGAL::LARGER) { - continue; - } - *res++ = *it; - } - return res; - } - + template OutputIterator + operator() + (const Polynomial_2& f, const Polynomial_2& g, + Bound xl, Bound xu, Bound yl, Bound yu, + OutputIterator res) const { + // Note: This could be improved by not computing all solutions + // but only those in [xl,xu] (lazy evaluation) + std::vector > roots; + this->operator() (f,g,std::back_inserter(roots)); + // Find the x-values using binary search: + typename Algebraic_kernel_d_1::template Pair_first + pair_first; + typedef typename + std::vector > + ::iterator Iterator; + Iterator roots_start = std::lower_bound + (::boost::make_transform_iterator + (roots.begin(), + _m_kernel->unary_compose(pair_first, + _m_kernel->compute_x_2_object())), + ::boost::make_transform_iterator + (roots.end(), + _m_kernel->unary_compose(pair_first, + _m_kernel->compute_x_2_object())), + _m_kernel->construct_algebraic_real_1_object()(xl)).base(); + Iterator roots_end = std::upper_bound + (::boost::make_transform_iterator + (roots_start, + _m_kernel->unary_compose(pair_first, + _m_kernel->compute_x_2_object())), + ::boost::make_transform_iterator + (roots.end(), + _m_kernel->unary_compose(pair_first, + _m_kernel->compute_x_2_object())), + _m_kernel->construct_algebraic_real_1_object()(xu)).base(); + // Now check y-coordinate. Binary search is not possible here! + // Note that compare_y is not too expensive here because we + // only compare with rationals + for(Iterator it=roots_start;it!=roots_end;it++) { + if(_m_kernel->compare_y_2_object()(yl,it->first)==CGAL::LARGER) { + continue; + } + if(_m_kernel->compare_y_2_object()(it->first,yu)==CGAL::LARGER) { + continue; + } + *res++ = *it; + } + return res; + } + protected: const Algebraic_kernel_d_2* _m_kernel; @@ -2500,20 +2500,20 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_cons(Solve_2, solve_2_object); - class Number_of_solutions_2 + class Number_of_solutions_2 : public CGAL::cpp98::binary_function { - + public: - - Number_of_solutions_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - - size_type operator() - (const Polynomial_2& f, const Polynomial_2& g) const { - - std::vector > roots; - _m_kernel->solve_2_object()(f,g,std::back_inserter(roots)); - return static_cast(roots.size()); + + Number_of_solutions_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + + size_type operator() + (const Polynomial_2& f, const Polynomial_2& g) const { + + std::vector > roots; + _m_kernel->solve_2_object()(f,g,std::back_inserter(roots)); + return static_cast(roots.size()); } protected: @@ -2521,45 +2521,45 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Number_of_solutions_2, - number_of_solutions_2_object); + CGAL_Algebraic_Kernel_cons(Number_of_solutions_2, + number_of_solutions_2_object); // Functor used to evaluate a Polynomial_2 in a Bound, up to a // constant factor - class Evaluate_utcf_2 + class Evaluate_utcf_2 : public CGAL::cpp98::binary_function { - + public: - - Evaluate_utcf_2(const Algebraic_kernel_d_2* kernel) - : _m_kernel(kernel) {} - + + Evaluate_utcf_2(const Algebraic_kernel_d_2* kernel) + : _m_kernel(kernel) {} + Polynomial_1 operator() (const Polynomial_2& f, Bound b) const { - typedef CGAL::Fraction_traits FT; - // We rely on the fact that the Bound is a fraction - CGAL_static_assertion((::boost::is_same::value)); - typedef typename FT::Numerator_type Numerator; - typedef typename FT::Denominator_type Denominator; - typedef CGAL::Coercion_traits Num_coercion; - CGAL_static_assertion((::boost::is_same - ::value)); - typedef CGAL::Coercion_traits Denom_coercion; - CGAL_static_assertion((::boost::is_same - ::value)); - typename Num_coercion::Cast num_cast; - typename Denom_coercion::Cast denom_cast; - typename FT::Decompose decompose; - - Numerator num_uncasted; - Denominator denom_uncasted; - decompose(b,num_uncasted,denom_uncasted); - - Coefficient num = num_cast(num_uncasted); - Coefficient denom = denom_cast(denom_uncasted); - return CGAL::evaluate_homogeneous(f,num,denom); + typedef CGAL::Fraction_traits FT; + // We rely on the fact that the Bound is a fraction + CGAL_static_assertion((::boost::is_same::value)); + typedef typename FT::Numerator_type Numerator; + typedef typename FT::Denominator_type Denominator; + typedef CGAL::Coercion_traits Num_coercion; + CGAL_static_assertion((::boost::is_same + ::value)); + typedef CGAL::Coercion_traits Denom_coercion; + CGAL_static_assertion((::boost::is_same + ::value)); + typename Num_coercion::Cast num_cast; + typename Denom_coercion::Cast denom_cast; + typename FT::Decompose decompose; + + Numerator num_uncasted; + Denominator denom_uncasted; + decompose(b,num_uncasted,denom_uncasted); + + Coefficient num = num_cast(num_uncasted); + Coefficient denom = denom_cast(denom_uncasted); + return CGAL::evaluate_homogeneous(f,num,denom); } protected: @@ -2567,8 +2567,8 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Algebraic_kernel_d_2* _m_kernel; }; - CGAL_Algebraic_Kernel_cons(Evaluate_utcf_2, - evaluate_utcf_2_object); + CGAL_Algebraic_Kernel_cons(Evaluate_utcf_2, + evaluate_utcf_2_object); #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE /*! @@ -2578,9 +2578,9 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public: - Swap_x_and_y_2(const Algebraic_kernel_d_2* kernel) + Swap_x_and_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + typedef Polynomial_2 argument_type; typedef Curve_analysis_2 result_type; @@ -2593,7 +2593,7 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ = typename Polynomial_traits_2::Swap() (f,0,1); return _m_kernel->construct_curve_2_object() (f_yx); } - + protected: const Algebraic_kernel_d_2* _m_kernel; @@ -2606,86 +2606,86 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ public CGAL::cpp98::unary_function { public: - - Refine_x_2(const Algebraic_kernel_d_2* kernel) + + Refine_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + void operator()(const Algebraic_real_2& r) const { - r.refine_x(); + r.refine_x(); } - /* TODO: if needed, include - void operator()(Algebraic_real_2& r, int rel_prec) const { + /* TODO: if needed, include + void operator()(Algebraic_real_2& r, int rel_prec) const { r.refine_x(rel_prec); } - */ - + */ + protected: const Algebraic_kernel_d_2* _m_kernel; }; CGAL_Algebraic_Kernel_pred(Refine_x_2, refine_x_2_object); - + class Refine_y_2 : public CGAL::cpp98::unary_function { public: - Refine_y_2(const Algebraic_kernel_d_2* kernel) + Refine_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + void operator()(const Algebraic_real_2& r) const { - return r.refine_y(); + return r.refine_y(); } - - /* TODO: if needed, include - void operator()(Algebraic_real_2& r, int rel_prec) const { + + /* TODO: if needed, include + void operator()(Algebraic_real_2& r, int rel_prec) const { return r.refine_y(rel_prec); } - */ - + */ + protected: const Algebraic_kernel_d_2* _m_kernel; }; CGAL_Algebraic_Kernel_pred(Refine_y_2, refine_y_2_object); - + class Lower_bound_x_2 { - + public: - Lower_bound_x_2(const Algebraic_kernel_d_2* kernel) + Lower_bound_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} typedef Algebraic_real_2 argument_type; typedef Bound result_type; - + result_type operator()(const Algebraic_real_2& r) { - return r.lower_bound_x(); - } - + return r.lower_bound_x(); + } + protected: const Algebraic_kernel_d_2* _m_kernel; }; CGAL_Algebraic_Kernel_cons(Lower_bound_x_2, lower_bound_x_2_object); - + class Upper_bound_x_2 { - + public: - Upper_bound_x_2(const Algebraic_kernel_d_2* kernel) + Upper_bound_x_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} typedef Algebraic_real_2 argument_type; typedef Bound result_type; - + result_type operator()(const Algebraic_real_2& r) { return r.upper_bound_x(); } - + protected: const Algebraic_kernel_d_2* _m_kernel; @@ -2694,18 +2694,18 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ CGAL_Algebraic_Kernel_cons(Upper_bound_x_2, upper_bound_x_2_object); class Lower_bound_y_2 { - + public: - Lower_bound_y_2(const Algebraic_kernel_d_2* kernel) + Lower_bound_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + typedef Algebraic_real_2 argument_type; typedef Bound result_type; - + result_type operator()(const Algebraic_real_2& r) { - return r.lower_bound_y(); - } + return r.lower_bound_y(); + } protected: @@ -2713,21 +2713,21 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_cons(Lower_bound_y_2, lower_bound_y_2_object); - + //! an upper bound of the y-coordinate of \c r class Upper_bound_y_2 { - + public: - Upper_bound_y_2(const Algebraic_kernel_d_2* kernel) + Upper_bound_y_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} - + typedef Algebraic_real_2 argument_type; typedef Bound result_type; - + result_type operator()(const Algebraic_real_2& r) { - return r.upper_bound_y(); - } + return r.upper_bound_y(); + } protected: @@ -2735,10 +2735,10 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ }; CGAL_Algebraic_Kernel_cons(Upper_bound_y_2, upper_bound_y_2_object); - - typedef Bound Boundary; + + typedef Bound Boundary; typedef Lower_bound_x_2 Lower_boundary_x_2; typedef Lower_bound_y_2 Lower_boundary_y_2; typedef Upper_bound_x_2 Upper_boundary_x_2; @@ -2755,9 +2755,9 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ #endif -#undef CGAL_Algebraic_Kernel_pred -#undef CGAL_Algebraic_Kernel_cons - +#undef CGAL_Algebraic_Kernel_pred +#undef CGAL_Algebraic_Kernel_cons + //!@} protected: @@ -2766,7 +2766,7 @@ mutable boost::shared_ptr _m_curve_cache_2; mutable boost::shared_ptr _m_curve_pair_cache_2; mutable boost::shared_ptr _m_gcd_cache_2; - + }; // class Algebraic_curve_kernel_2 } // namespace CGAL diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h index 657d1fc28abd..eecc13aad015 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h @@ -6,9 +6,9 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Michael Hemmer +// +// Author(s) : Michael Hemmer // // ============================================================================ @@ -63,18 +63,18 @@ namespace internal { THIS CLASS IS CONSIDERED AS EXPERIMENTAL ! */ -template < class Coefficient_, +template < class Coefficient_, class Rational_, class HandlePolicy = ::CGAL::Handle_policy_no_union, class AlgebraicRealRep_d_1 = internal::Algebraic_real_rep< Coefficient_, Rational_ > > class Algebraic_real_d_1 : public ::CGAL::Handle_with_policy< AlgebraicRealRep_d_1, HandlePolicy > { - // currently Rational is the only supported Bound type. + // currently Rational is the only supported Bound type. CGAL_static_assertion( - ( ::boost::is_same ::Arithmetic_kernel::Rational>::value)); - + public : @@ -82,26 +82,26 @@ public : typedef Algebraic_real_d_1 Self; typedef Coefficient_ Coefficient; - typedef Rational_ Bound; + typedef Rational_ Bound; typedef HandlePolicy Handle_policy; - typedef AlgebraicRealRep_d_1 Algebraic_real_rep_d_1; - typedef typename Algebraic_real_rep_d_1::Polynomial_1 Polynomial_1; + typedef AlgebraicRealRep_d_1 Algebraic_real_rep_d_1; + typedef typename Algebraic_real_rep_d_1::Polynomial_1 Polynomial_1; // These public typedefs should be removed in the long run - // typedef typename Algebraic_real_rep_d_1::Polynomial_1 Polynomial; + // typedef typename Algebraic_real_rep_d_1::Polynomial_1 Polynomial; typedef Rational_ Rational; - + private: typedef CGAL::Fraction_traits FT_rational; typedef typename FT_rational::Numerator_type Integer; - -private: + +private: static inline Self& get_default_instance(){ - CGAL_STATIC_THREAD_LOCAL_VARIABLE(Self, x,0); - return x; + CGAL_STATIC_THREAD_LOCAL_VARIABLE(Self, x,0); + return x; } public: - + //! Default constructor Algebraic_real_d_1() : Base(static_cast(get_default_instance())) {} @@ -130,7 +130,7 @@ public : int degree() const { return CGAL::degree(this->ptr()->polynomial()); } - + //! returns the lower endpoint of the isolating interval Rational low() const { return this->ptr()->low(); } Rational lower() const { return this->ptr()->low(); } @@ -435,8 +435,8 @@ template std::ostream& operator << (std::ostream& os, const CGAL::internal::Algebraic_real_d_1& x){ - os << "[" << x.polynomial() - << ",[" << oformat(x.low()) + os << "[" << x.polynomial() + << ",[" << oformat(x.low()) << " , " << oformat(x.high()) << " ]]"; return os; } @@ -448,12 +448,12 @@ template std::istream& operator >> (std::istream& is, CGAL::internal::Algebraic_real_d_1& x){ - + typedef CGAL::internal::Algebraic_real_d_1 ALGNUM; - + Rational low, high; typename CGAL::Polynomial_type_generator::Type poly; - + swallow(is, '[');// read the "[" is >> poly; swallow(is, ',');// read the "," diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h index 25a27529bba9..19f447c08f23 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // Michael Kerber @@ -39,27 +39,27 @@ namespace CGAL { namespace internal { // definition of the Algebraic_real_rep x: - + //For details about the method, see /* * @Unpublished{abbott-quadratic, - * author = {John Abbott}, - * title = {Quadratic Interval Refinement for Real Roots}, + * author = {John Abbott}, + * title = {Quadratic Interval Refinement for Real Roots}, * url = {http://www.dima.unige.it/~abbott/}, * note = {Poster presented at the 2006 Internat. Sympos. on Symbolic and Algebraic Computation (ISSAC 2006)} * } */ -template< class Coefficient_, class Field_> +template< class Coefficient_, class Field_> class Algebraic_real_quadratic_refinement_rep_bfi : public Algebraic_real_rep { typedef Coefficient_ Coefficient; typedef Field_ Field; - typedef typename - CGAL::Get_arithmetic_kernel::Arithmetic_kernel:: + typedef typename + CGAL::Get_arithmetic_kernel::Arithmetic_kernel:: Bigfloat_interval BFI; typedef typename CGAL::Bigfloat_interval_traits::Bound BF; @@ -67,51 +67,51 @@ class Algebraic_real_quadratic_refinement_rep_bfi // This is a implicit restriction - Field must be some type // modelling rational numbers to get an integer type typedef typename CGAL::Fraction_traits::Numerator_type Integer; - + typedef typename CGAL::Polynomial_type_generator::Type Poly; typedef Algebraic_real_rep Base; - typedef Algebraic_real_quadratic_refinement_rep_bfi + typedef Algebraic_real_quadratic_refinement_rep_bfi Self; - typedef typename CGAL::Coercion_traits::Type + typedef typename CGAL::Coercion_traits::Type Eval_result_type; private: mutable long prec_; - typedef typename + typedef typename CGAL::Polynomial_traits_d::template Rebind ::Other::Type BFI_polynomial; mutable boost::optional < BFI_polynomial > f_bfi_; - - mutable boost::optional low_bfi_, f_low_bfi_, - high_bfi_, f_high_bfi_; + + mutable boost::optional low_bfi_, f_low_bfi_, + high_bfi_, f_high_bfi_; mutable long N; - // TODO: replace by call of Coercion_traits::Cast() + // TODO: replace by call of Coercion_traits::Cast() BFI_polynomial _convert_polynomial_to_bfi(const Poly& f) const { std::vector coeffs; for(int i = 0; i <= CGAL::degree(f); i++) { coeffs.push_back(CGAL::convert_to_bfi(f[i])); } - return BFI_polynomial(coeffs.begin(), coeffs.end()); + return BFI_polynomial(coeffs.begin(), coeffs.end()); } void _set_prec(long new_prec) const { - + prec_ = new_prec; CGAL::set_precision(BFI(), prec_); f_bfi_ = _convert_polynomial_to_bfi(this->polynomial()); low_bfi_ = CGAL::convert_to_bfi(this->low()); - + high_bfi_ = CGAL::convert_to_bfi(this->high()); f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); @@ -126,15 +126,15 @@ class Algebraic_real_quadratic_refinement_rep_bfi m_bfi = CGAL::convert_to_bfi(m); f_m_bfi = f_bfi_.get().evaluate(m_bfi); - + if(CGAL::zero_in(f_m_bfi)) { - + // Okay, compute exactly return CGAL::sign(this->polynomial().evaluate(m)); } - + // If we are here, then the interval is away from zero - + return CGAL::sign(CGAL::upper(f_m_bfi)); } @@ -148,26 +148,26 @@ class Algebraic_real_quadratic_refinement_rep_bfi //! creates the algebraic real from int \a i. explicit Algebraic_real_quadratic_refinement_rep_bfi(int i = 0) : Base(i),N(2){ - } + } //! creates the algebraic real from Field \a m. explicit Algebraic_real_quadratic_refinement_rep_bfi(const Field& m) : Base(m),N(2) { - } + } /*! \brief creates the algebraic real as the unique root of \a P in the open interval ]low,high[. - \pre the polynomial \a P is square free + \pre the polynomial \a P is square free \pre P(low)!=0 \pre P(high)<0 \pre x is the one and only root in the open interval of \a P. */ - Algebraic_real_quadratic_refinement_rep_bfi(const Poly& P, - Field LOW, - Field HIGH) - : Base(P,LOW,HIGH), + Algebraic_real_quadratic_refinement_rep_bfi(const Poly& P, + Field LOW, + Field HIGH) + : Base(P,LOW,HIGH), N(2) - { + { _set_prec(16); - + } //! copy constructor @@ -178,15 +178,15 @@ class Algebraic_real_quadratic_refinement_rep_bfi { } - // assignment + // assignment Algebraic_real_quadratic_refinement_rep_bfi& operator=(const Self& y) { Base::operator=(y); - f_low_bfi_=y.f_low_bfi_; - f_high_bfi_=y.f_high_bfi_; + f_low_bfi_=y.f_low_bfi_; + f_high_bfi_=y.f_high_bfi_; low_bfi_=y.low_bfi_; - high_bfi_=y.high_bfi_; + high_bfi_=y.high_bfi_; f_bfi_=y.f_bfi_; - N=y.N; + N=y.N; return *this; } @@ -195,7 +195,7 @@ class Algebraic_real_quadratic_refinement_rep_bfi virtual void bisect() const{ if(this->is_rational()) return; - + Field m = (this->low_+this->high_)/Field(2); CGAL::simplify(m); @@ -204,7 +204,7 @@ class Algebraic_real_quadratic_refinement_rep_bfi if (s == ::CGAL::ZERO ) { this->learn_from(m); - } + } else { if ( s == this->sign_at_low() ) { this->low_ = m; @@ -212,7 +212,7 @@ class Algebraic_real_quadratic_refinement_rep_bfi f_low_bfi_ = f_m_bfi; last_bisect_lower=false; } else { - this->high_ = m; + this->high_ = m; high_bfi_ = m_bfi; f_high_bfi_ = f_m_bfi; last_bisect_lower=true; @@ -222,9 +222,9 @@ class Algebraic_real_quadratic_refinement_rep_bfi } protected: - virtual void set_implicit_rep(const Poly & P, - const Field& LOW, - const Field& HIGH, + virtual void set_implicit_rep(const Poly & P, + const Field& LOW, + const Field& HIGH, bool dummy_bool=false) const { bool poly_changed = (P!=this->polynomial()); @@ -247,8 +247,8 @@ class Algebraic_real_quadratic_refinement_rep_bfi Base::set_explicit_rep(m); } - -public: + +public: virtual void refine_at(const Field& m) const{ Field old_low_=this->low_, old_high_=this->high_; Poly old_pol = this->polynomial(); @@ -265,7 +265,7 @@ class Algebraic_real_quadratic_refinement_rep_bfi f_bfi_ = boost::none; } } - + // Abbott's refinement method virtual void refine() const { @@ -282,13 +282,13 @@ class Algebraic_real_quadratic_refinement_rep_bfi CGAL_assertion(CGAL::sign(this->polynomial().evaluate(this->low())) ==this->sign_at_low_); - CGAL_assertion( this->sign_at_low_ != + CGAL_assertion( this->sign_at_low_ != CGAL::sign(this->polynomial().evaluate(this->high())) ); - + CGAL_assertion(this->low() != this->high()); - + Integer i = find_interval(); - + while(N!=1 && !refine_by_factor(i)) { N/=2; i = find_interval(); @@ -358,12 +358,12 @@ class Algebraic_real_quadratic_refinement_rep_bfi break; } _set_prec(2*prec_); - + } - CGAL_postcondition(i>=0 && + CGAL_postcondition(i>=0 && i <= CGAL::ipower(Integer(2),N)); - + return i; } @@ -410,7 +410,7 @@ class Algebraic_real_quadratic_refinement_rep_bfi new_left_bfi = m_bfi; f_new_left_bfi = f_m_bfi; s_new_left = s_m; - + new_right = m+step; CGAL::simplify(new_right); s_new_right = _sign_at(new_right,new_right_bfi,f_new_right_bfi); @@ -459,19 +459,19 @@ class Algebraic_real_quadratic_refinement_rep_bfi } BFI eval = f_bfi_.get().evaluate(convert_to_bfi(m)); - + CGAL::Sign s = CGAL::sign(CGAL::lower(eval)); - + // correct sign if needed if( s*CGAL::sign(CGAL::upper(eval) ) != CGAL::POSITIVE ){ - + //std::cout << "APPROX FAILED-------------------------------"<polynomial().sign_at(m); if ( s != CGAL::ZERO ) { _set_prec(2*prec_); } } - + CGAL_postcondition(s == this->polynomial_.sign_at(m)); @@ -479,19 +479,19 @@ class Algebraic_real_quadratic_refinement_rep_bfi this->learn_from(m); }else{ if ( s == this->sign_at_low() ) this->low_ = m; - else this->high_ = m; + else this->high_ = m; } return s; - } + } -public: +public: virtual void simplify() const { Poly f_old = this->polynomial(); Base::simplify(); if(f_old != this->polynomial()) { f_bfi_ = boost::none; - } + } } }; } // namepace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h index f436a5d93a29..97544ae29856 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -30,18 +30,18 @@ namespace CGAL { namespace internal { // definition of the Algebraic_real_rep x: - -//IS_GENERAL: -// low_ lower bound of x -// high_ upper bound of x -// polynomial_ a square free polynomial + +//IS_GENERAL: +// low_ lower bound of x +// high_ upper bound of x +// polynomial_ a square free polynomial // sign_at_low_ = polynomial_.evaluate(low_) -// x is the only root of polynomial_ in the open interval ]low_,high_[ +// x is the only root of polynomial_ in the open interval ]low_,high_[ // low_ != x != high // ******************* EXEPTION ******************* // x is rational: in this case low=high=x - -template< class Coefficient_, class Rational_> + +template< class Coefficient_, class Rational_> class Algebraic_real_rep{ public: @@ -49,24 +49,24 @@ class Algebraic_real_rep{ typedef Rational_ Bound; typedef typename CGAL::Polynomial_type_generator::Type Polynomial_1; -private: +private: typedef Rational_ Rational; typedef typename CGAL::Polynomial_type_generator::Type Poly; typedef CGAL::Sign TRI_BOOL; - typedef Algebraic_real_rep Self; + typedef Algebraic_real_rep Self; public: - typedef boost::optional< std::pair > Interval_option; + typedef boost::optional< std::pair > Interval_option; - mutable Poly polynomial_; //!< square free polynomial + mutable Poly polynomial_; //!< square free polynomial mutable Rational low_; //!< lower endpoint of interval mutable Rational high_; //!< upper endpoint of interval mutable CGAL::Sign sign_at_low_; //!< sign of polynomial a \a low_ - mutable Interval_option interval_option; + mutable Interval_option interval_option; mutable bool is_rational_; mutable const Self *next; - mutable const Self *prev; + mutable const Self *prev; private: void copy_all_members(const Algebraic_real_rep& y) const { polynomial_ = y.polynomial_; @@ -76,15 +76,15 @@ class Algebraic_real_rep{ interval_option = y.interval_option; is_rational_ = y.is_rational_; } - - + + protected: virtual CGAL::Sign sign_of_polynomial_at( const Rational& f ) const { return polynomial().sign_at( f ); } - + protected: - // joins the two lists of related algebraic reals + // joins the two lists of related algebraic reals void introduce(const Algebraic_real_rep& y) const{ y.prev->next=next; next->prev=y.prev; @@ -92,7 +92,7 @@ class Algebraic_real_rep{ y.prev=this; } protected: - + // x leaves the list of related algebraic reals void erase_from_list() const { next->prev=prev; @@ -100,14 +100,14 @@ class Algebraic_real_rep{ next=prev=this; } protected: - virtual void set_explicit_rep(const Rational& m) const { + virtual void set_explicit_rep(const Rational& m) const { typename Fraction_traits::Decompose decomp; typename Fraction_traits::Numerator_type num; typename Fraction_traits::Denominator_type den; decomp(m, num, den); - - polynomial_ = Poly(-Coefficient(num),Coefficient(den)); + + polynomial_ = Poly(-Coefficient(num),Coefficient(den)); is_rational_ = true; low_ = m; high_ = m; @@ -115,17 +115,17 @@ class Algebraic_real_rep{ interval_option = Interval_option(CGAL::to_interval(m)); } protected: - virtual void set_implicit_rep(const Poly & P, - const Rational& LOW, + virtual void set_implicit_rep(const Poly & P, + const Rational& LOW, const Rational& HIGH, bool use_expensive_sign = false ) const { - - CGAL_precondition(LOW < HIGH); - CGAL_precondition(P.sign_at(LOW) != CGAL::ZERO); - CGAL_precondition(P.sign_at(HIGH) != CGAL::ZERO); + + CGAL_precondition(LOW < HIGH); + CGAL_precondition(P.sign_at(LOW) != CGAL::ZERO); + CGAL_precondition(P.sign_at(HIGH) != CGAL::ZERO); CGAL_precondition(P.sign_at(HIGH) != P.sign_at(LOW)); CGAL_precondition_msg(typename CGAL::Polynomial_traits_d< Poly >::Is_square_free()(P), "Polynomial not square-free."); - + polynomial_ = P; low_=LOW; high_=HIGH; @@ -135,15 +135,15 @@ class Algebraic_real_rep{ // interval_option left out - // trys to set rational if degree is 1 + // trys to set rational if degree is 1 typedef typename CGAL::Coercion_traits< Coefficient, Rational >::Type RET; set_rational(RET()); } -private: +private: template < class NTX > void set_rational(NTX) const { } - + void set_rational(Rational) const { if (CGAL::degree(polynomial()) == 1) { low_ = high_ = -Rational(polynomial()[0])/Rational(polynomial()[1]); @@ -151,34 +151,34 @@ class Algebraic_real_rep{ interval_option = Interval_option(CGAL::to_interval(rational())); } } - + public: //! creates the algebraic real from int \a i. explicit Algebraic_real_rep(int i = 0){ next=prev=this; set_explicit_rep(i); - } + } //! creates the algebraic real from Rational \a m. explicit Algebraic_real_rep(const Rational& m){ next=prev=this; - set_explicit_rep(m); - } + set_explicit_rep(m); + } /*! \brief creates the algebraic real as the unique root of \a P in the open interval ]low,high[. - \pre the polynomial \a P is square free + \pre the polynomial \a P is square free \pre P(low)!=0 \pre P(high)<0 \pre x is the one and only root in the open interval of \a P. */ - Algebraic_real_rep(const Poly& P, Rational LOW, Rational HIGH) { + Algebraic_real_rep(const Poly& P, Rational LOW, Rational HIGH) { if (LOW == HIGH) { CGAL_precondition(P.sign_at(LOW) == CGAL::ZERO); - set_explicit_rep(LOW); + set_explicit_rep(LOW); } else { - CGAL_precondition(LOW < HIGH); - CGAL_precondition(P.sign_at(LOW) != CGAL::ZERO); - CGAL_precondition(P.sign_at(HIGH) != CGAL::ZERO); + CGAL_precondition(LOW < HIGH); + CGAL_precondition(P.sign_at(LOW) != CGAL::ZERO); + CGAL_precondition(P.sign_at(HIGH) != CGAL::ZERO); CGAL_precondition(P.sign_at(HIGH) != P.sign_at(LOW)); CGAL_precondition_msg(typename CGAL::Polynomial_traits_d::Is_square_free()(P), "Polynomial not square-free."); set_implicit_rep(P,LOW,HIGH); @@ -187,17 +187,17 @@ class Algebraic_real_rep{ } //! copy constructor - Algebraic_real_rep(const Self& y){ + Algebraic_real_rep(const Self& y){ next=prev=this; copy_all_members(y); - introduce(y); + introduce(y); } //! destructor virtual ~Algebraic_real_rep(){ erase_from_list(); } - // assignment + // assignment Algebraic_real_rep& operator=(const Self& y) { if ( this != & y) { erase_from_list(); @@ -212,9 +212,9 @@ class Algebraic_real_rep{ const Rational& low() const {return low_;} const Rational& high() const {return high_;} const Poly& polynomial() const {return polynomial_;} - + const TRI_BOOL& sign_at_low() const {return sign_at_low_;} - + /*const std::pair< double, double>& interval() const { if( interval_option ) { return *interval_option; @@ -225,7 +225,7 @@ class Algebraic_real_rep{ set_precision( BF(), 53 ); interval_option = Interval_option( internal::to_interval( convert_to_bfi( (*this) ) ) ); set_precision( BF(), old_precision ); - return *interval_option; + return *interval_option; } }*/ /*const std::pair& interval() const { @@ -249,53 +249,53 @@ class Algebraic_real_rep{ /*double to_double() const { return (to_interval().first +to_interval().second)/2; }*/ - + /*! \brief convert algebraic real to type Interval */ - /*std::pair to_interval() const { - + /*std::pair to_interval() const { + CGAL_precondition(compare(Rational(interval().first)) != CGAL::SMALLER); CGAL_precondition(compare(Rational(interval().second)) != CGAL::LARGER); - return interval(); + return interval(); }*/ - + private: bool self_test() const{ if(!is_rational()){ CGAL_precondition(low() void strong_refine(const NTX& m) const{ - + if(is_rational()) return; if( NTX(low()) <= m && m <= NTX(high()) ){ @@ -304,31 +304,31 @@ class Algebraic_real_rep{ while( NTX(low()) <= m && m <= NTX(high())) refine(); } } -public: +public: virtual void refine_at(const Rational& m) const{ if(is_rational()) return; if( m <= low() || high() <= m ) return; - - // now: low < m < high + + // now: low < m < high CGAL::Sign s = sign_of_polynomial_at(m); if(s == CGAL::ZERO) learn_from(m); else (s == sign_at_low())? low_ = m : high_=m; } - -public: + +public: CGAL::Comparison_result - compare(const Rational& y, bool are_distinct = false) const { + compare(const Rational& y, bool are_distinct = false) const { if(is_rational()) return CGAL::compare(rational(),y); if(y <= low()) { strong_refine(y); return CGAL::LARGER; } - if(high() <= y) { + if(high() <= y) { strong_refine(y); return CGAL::SMALLER; } - - // now: low < y < high + + // now: low < y < high if(!are_distinct){ if(sign_of_polynomial_at(y)==CGAL::ZERO){ learn_from(y); @@ -342,12 +342,12 @@ class Algebraic_real_rep{ if(y < low()) return CGAL::LARGER; else return CGAL::SMALLER; } - + CGAL::Comparison_result compare (const Algebraic_real_rep& y, bool are_distinct = false) const{ if( is_rational()) return -y.compare( rational()); if(y.is_rational()) return compare(y.rational()); - + // type of both x and y IS_GENERAL if ( high() <= y.low() ) return CGAL::SMALLER; if ( low() >= y.high()) return CGAL::LARGER; @@ -369,7 +369,7 @@ class Algebraic_real_rep{ // type of both x and y still IS_GENERAL if ( high() <= y.low() ) return CGAL::SMALLER; if ( y.high() <= low() ) return CGAL::LARGER; - + // filter 2: probabilistically check coprimality if (!are_distinct) { are_distinct = !(may_have_common_factor(polynomial(), @@ -382,21 +382,21 @@ class Algebraic_real_rep{ // we have ]low(), high()[ == ]y.low(),y.high()[ == ]L,R[ // and let both numbers decide for the gcd or its complement Poly F1,F2,G; - G = CGAL::gcd_up_to_constant_factor(polynomial(),y.polynomial()); + G = CGAL::gcd_up_to_constant_factor(polynomial(),y.polynomial()); F1 = integral_division_up_to_constant_factor(polynomial(),G); CGAL_postcondition(CGAL::degree(F1)== CGAL::degree(polynomial())-CGAL::degree(G)); F2 = integral_division_up_to_constant_factor(y.polynomial(),G); CGAL_postcondition(CGAL::degree(F2)== CGAL::degree(y.polynomial())-CGAL::degree(G)); - + learn_from(G,F1); y.learn_from(G,F2); // this may simplify them due to degree loss if (y.is_rational()) return compare(y.rational()); if ( is_rational()) return -y.compare( rational()); - + // type of x and y is still IS_GENERAL // check for equality if (G.sign_at(L)!=G.sign_at(R)){ @@ -404,7 +404,7 @@ class Algebraic_real_rep{ return CGAL::EQUAL; } } - + // if we are here, we know the numbers to be distinct // refine to disjointness for (;;) { @@ -428,37 +428,37 @@ class Algebraic_real_rep{ typename Fraction_traits::Numerator_type num; typename Fraction_traits::Denominator_type den; decomp(m, num, den); - Poly G = Poly(-Coefficient(num),Coefficient(den)); + Poly G = Poly(-Coefficient(num),Coefficient(den)); Poly F1= integral_division_up_to_constant_factor(polynomial(),G); CGAL_postcondition(CGAL::degree(F1)== CGAL::degree(polynomial())-CGAL::degree(G)); - + learn_from(G,F1); - + if(!is_rational()) set_explicit_rep(m); - } - + } + // splits the list of related algebraic reals according to the two // factors of the polynomial void learn_from(const Poly& pfactor1, const Poly& pfactor2) const { if(CGAL::degree(pfactor1)==0) return; if(CGAL::degree(pfactor2)==0) return; - + CGAL_precondition(may_have_common_factor(polynomial(),pfactor1)); CGAL_precondition(may_have_common_factor(polynomial(),pfactor2)); CGAL_precondition(CGAL::degree(pfactor1)+CGAL::degree(pfactor2) == CGAL::degree(polynomial())); - + Self dummy1, dummy2; Self const *last=prev; Self const *current=this; Self const *next; while(true){ next=current->next; - + if(pfactor1.sign_at(current->low())!= pfactor1.sign_at(current->high())){ current->next=&dummy1; @@ -472,22 +472,22 @@ class Algebraic_real_rep{ current->next=&dummy2; current->prev=dummy2.prev; dummy2.prev->next=current; - dummy2.prev=current; + dummy2.prev=current; current->set_implicit_rep(pfactor2, current->low(), current->high(), true ); } - + if(current==last) break; current=next; } } - + public: bool is_root_of(const Poly& Q) const { if (CGAL::degree(Q) == 0) return Q.is_zero(); if (is_rational() ) return CGAL::ZERO == Q.sign_at(rational()); - + if ( may_have_common_factor(polynomial(), Q) ) { Poly G = CGAL::gcd_up_to_constant_factor(polynomial(),Q); if(CGAL::degree(G)!=0){ @@ -499,13 +499,13 @@ class Algebraic_real_rep{ learn_from(G,F1); return (G.sign_at(low()) != G.sign_at(high())); } - } - return false; + } + return false; } -public: +public: virtual void simplify() const{ if(is_rational()){ - + }else{ CGAL::simplify(low_); CGAL::simplify(high_); diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h index 84cc3d1316c7..f9aaa350e87a 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -15,10 +15,10 @@ // TODO: The comments are all original EXACUS comments and aren't adapted. So // they may be wrong now. -// This is code is expreimental ! +// This is code is expreimental ! /*! \file NiX/Algebraic_real_rep_bfi.h - \brief Algebraic_real_rep with refinement via interval rep + \brief Algebraic_real_rep with refinement via interval rep */ #ifndef CGAL_ALGEBRAIC_KERNEL_D_ALGEBRAIC_REAL_REP_BFI_H @@ -36,51 +36,51 @@ namespace CGAL { -// it would be nice to remove the explicit use of Sqrt_extension -// in this file. However, it is much more efficient to convert the root -// only once. see convert_to_bfi +// it would be nice to remove the explicit use of Sqrt_extension +// in this file. However, it is much more efficient to convert the root +// only once. see convert_to_bfi //template class Sqrt_extension; //use forward declaration instead namespace internal { // definition of the Algebraic_real_rep_bfi x: - -//IS_GENERAL: -// low_ lower bound of x -// high_ upper bound of x -// polynomial_ a square free polynomial + +//IS_GENERAL: +// low_ lower bound of x +// high_ upper bound of x +// polynomial_ a square free polynomial // sign_at_low_ = polynomial_.evaluate(low_) -// x is the only root of polynomial_ in the open interval ]low_,high_[ +// x is the only root of polynomial_ in the open interval ]low_,high_[ // low_ != x != high // ******************* EXEPTION ******************* // x is rational: in this case low=high=x - -template< class Coefficient_, class Field_> + +template< class Coefficient_, class Field_> class Algebraic_real_rep_bfi : public Algebraic_real_rep { - - typedef Algebraic_real_rep Base; + + typedef Algebraic_real_rep Base; typedef Coefficient_ Coefficient; typedef Field_ Field; - + typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT; typedef typename AT::Bigfloat BF; typedef typename AT::Bigfloat_interval BFI; - typedef typename AT::Field_with_sqrt FWS; - + typedef typename AT::Field_with_sqrt FWS; + typedef typename CGAL::Polynomial_type_generator::Type Poly; - typedef typename Poly::const_iterator PIterator; - - typedef Algebraic_real_rep_bfi Self; + typedef typename Poly::const_iterator PIterator; - mutable std::vector polynomial_approx; + typedef Algebraic_real_rep_bfi Self; + + mutable std::vector polynomial_approx; mutable long current_prec; - + private: - template - inline + template + inline void convert_coeffs(const Polynomial_1& poly, OI it) const { typename CGAL::Polynomial_traits_d::Get_coefficient coeff; @@ -89,32 +89,32 @@ class Algebraic_real_rep_bfi } } - template - inline + template + inline void convert_coeffs( const CGAL::Polynomial< CGAL::Sqrt_extension >& poly, OI it ) const { - + BFI root(0); for(int i = 0; i <= CGAL::degree(poly); i++){ if(poly[i].is_extended()){ -// typename Coercion_traits::Cast cast_root; +// typename Coercion_traits::Cast cast_root; // root = convert_to_bfi(NiX::sqrt(cast_root(poly[i].root()))); root = CGAL::sqrt(convert_to_bfi(poly[i].root())); - break; + break; } } - + for(int i = 0; i <= CGAL::degree(poly); i++){ if(poly[i].is_extended()){ - *it++ = - convert_to_bfi(poly[i].a0()) + + *it++ = + convert_to_bfi(poly[i].a0()) + convert_to_bfi(poly[i].a1()) * root ; }else{ *it++ = convert_to_bfi(poly[i].a0()); } - } + } } typedef CGAL::Sign TRI_BOOL; @@ -124,7 +124,7 @@ class Algebraic_real_rep_bfi const Field& high() const {return this->high_;} const Poly& polynomial() const {return this->polynomial_;} const TRI_BOOL& sign_at_low() const {return this->sign_at_low_;} - + template void strong_refine(const NTX& m) const{ if(is_rational()) return; @@ -145,18 +145,18 @@ class Algebraic_real_rep_bfi } CGAL::Comparison_result - compare(const Field& y, bool are_distinct = false) const { + compare(const Field& y, bool are_distinct = false) const { if(is_rational()) return CGAL::compare(rational(),y); if(y <= low()) { strong_refine(y); return CGAL::LARGER; } - if(high() <= y) { + if(high() <= y) { strong_refine(y); return CGAL::SMALLER; } - - // now: low < y < high + + // now: low < y < high if(!are_distinct){ if(sign_of_polynomial_at(y)==CGAL::ZERO){ this->learn_from(y); @@ -170,12 +170,12 @@ class Algebraic_real_rep_bfi if(y < low()) return CGAL::LARGER; else return CGAL::SMALLER; } - + CGAL::Comparison_result compare (const Algebraic_real_rep_bfi& y, bool are_distinct = false) const{ if( is_rational()) return -y.compare( rational()); if(y.is_rational()) return compare(y.rational()); - + // type of both x and y IS_GENERAL if ( high() <= y.low() ) return CGAL::SMALLER; if ( low() >= y.high()) return CGAL::LARGER; @@ -197,7 +197,7 @@ class Algebraic_real_rep_bfi // type of both x and y still IS_GENERAL if ( high() <= y.low() ) return CGAL::SMALLER; if ( y.high() <= low() ) return CGAL::LARGER; - + // filter 1 (optional): determine distinctness by refining intervals #if NiX_REFINEMENTS_BEFORE_GCD > 0 if (!are_distinct) { @@ -225,21 +225,21 @@ class Algebraic_real_rep_bfi // we have ]low(), high()[ == ]y.low(),y.high()[ == ]L,R[ // and let both numbers decide for the gcd or its complement Poly F1,F2,G; - G = CGAL::gcd_up_to_constant_factor(polynomial(),y.polynomial()); + G = CGAL::gcd_up_to_constant_factor(polynomial(),y.polynomial()); F1 = CGAL::integral_division_up_to_constant_factor(polynomial(),G); CGAL_postcondition(CGAL::degree(F1)== CGAL::degree(polynomial())-CGAL::degree(G)); F2 = CGAL::integral_division_up_to_constant_factor(y.polynomial(),G); CGAL_postcondition(CGAL::degree(F2)== CGAL::degree(y.polynomial())-CGAL::degree(G)); - + this->learn_from(G,F1); y.learn_from(G,F2); // this may simplify them due to degree loss if (y.is_rational()) return compare(y.rational()); if ( is_rational()) return -y.compare( rational()); - + // type of x and y is still IS_GENERAL // check for equality if (G.sign_at(L)!=G.sign_at(R)){ @@ -247,7 +247,7 @@ class Algebraic_real_rep_bfi return CGAL::EQUAL; } } - + // if we are here, we know the numbers to be distinct // refine to disjointness for (;;) { @@ -264,14 +264,14 @@ class Algebraic_real_rep_bfi //! creates the algebraic real from int \a i. explicit Algebraic_real_rep_bfi(int i = 0) :Base(i){} - + //! creates the algebraic real from Field \a m. explicit Algebraic_real_rep_bfi(const Field& m) :Base(m), current_prec(53) {} - + /*! \brief creates the algebraic real as the unique root of \a P in the open interval ]low,high[. - \pre the polynomial \a P is square free + \pre the polynomial \a P is square free \pre P(low)!=0 \pre P(high)<0 \pre x is the one and only root in the open interval of \a P. @@ -283,8 +283,8 @@ class Algebraic_real_rep_bfi //! copy constructor Algebraic_real_rep_bfi(const Self& y) : Base(y), current_prec(53){} - - // assignment + + // assignment Algebraic_real_rep_bfi& operator=(const Self& y) { if ( this != & y) { this->erase_from_list(); @@ -295,23 +295,23 @@ class Algebraic_real_rep_bfi NiX_expensive_postcond(this->self_test()); return *this; } - - + + BFI evaluate_polynomial_approx(const BFI& x) const { // std::cout << "eval approx begin"<< std::endl; typedef std::vector BFI_VEC; - typedef typename BFI_VEC::reverse_iterator RIT; - + typedef typename BFI_VEC::reverse_iterator RIT; + BFI result(0); for(RIT rit = polynomial_approx.rbegin(); rit != polynomial_approx.rend(); rit++){ - result = result * x + (*rit); + result = result * x + (*rit); } // std::cout << "eval approx end"<< std::endl; - return result; + return result; } - + void refine_poly_approximation() const { CGAL_precondition(current_prec > 1); current_prec *= 2; @@ -321,44 +321,44 @@ class Algebraic_real_rep_bfi convert_coeffs( this->polynomial(), std::back_inserter(polynomial_approx)); - + Self const *next = static_cast(this->next); while(this != next){ // std::cout << this << " " << next << std::endl; - next->polynomial_approx = polynomial_approx; - next->current_prec = current_prec; + next->polynomial_approx = polynomial_approx; + next->current_prec = current_prec; next = static_cast(next->next); } }; - + void update_poly_approximation() const { long old_prec = set_precision( BFI(), current_prec ); - + polynomial_approx.clear(); convert_coeffs( this->polynomial(), std::back_inserter( polynomial_approx ) ); - + set_precision( BFI(), old_prec ); - + // TODO: Problems if the next block gets executed // Self const *next = static_cast(this->next); // while(this != next){ // // std::cout << this << " " << next << std::endl; -// next->polynomial_approx = polynomial_approx; -// next->current_prec = current_prec; +// next->polynomial_approx = polynomial_approx; +// next->current_prec = current_prec; // next = static_cast(next->next); // } } - - void refine() const{ + + void refine() const{ if(this->is_rational()) return; - + // std::cout << "refine begin ------- "<< std::endl; Field m = (this->low()+this->high())/Field(2); // Currently, sign_of_polynomial_at performs exactly the needed - // refinement. - // TODO: But what if this changes? + // refinement. + // TODO: But what if this changes? sign_of_polynomial_at( m ); //std::cout << "refine end ----------------- "<polynomial_)+1) { update_poly_approximation(); - } - + } + CGAL_postcondition(polynomial_approx.size() > 0); - + BFI eval = evaluate_polynomial_approx(convert_to_bfi(m)); - + CGAL::Sign s = CGAL::sign(CGAL::lower(eval)); - + // correct sign if needed if( s*CGAL::sign(CGAL::upper(eval) ) != CGAL::POSITIVE ){ - + //std::cout << "APPROX FAILED-------------------------------"<polynomial().sign_at(m); if ( s != CGAL::ZERO ) { - refine_poly_approximation(); + refine_poly_approximation(); } } - + CGAL_postcondition(s == this->polynomial_.sign_at(m)); if ( s == CGAL::ZERO ) { this->learn_from(m); }else{ if ( s == this->sign_at_low() ) this->low_ = m; - else this->high_ = m; + else this->high_ = m; } set_precision(BFI(),old_prec); - + return s; - } - + } + }; }//namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel.h index eb93a279ef46..bd69486d86cf 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -24,11 +24,11 @@ namespace internal { template struct Bitstream_coefficient_kernel { typedef Coefficient_ Coefficient; - - typedef typename - CGAL::Get_arithmetic_kernel::Arithmetic_kernel + + typedef typename + CGAL::Get_arithmetic_kernel::Arithmetic_kernel Arithmetic_kernel; - + typedef typename Arithmetic_kernel::Bigfloat_interval Bigfloat_interval; typedef typename Arithmetic_kernel::Integer Integer; typedef typename Arithmetic_kernel::Rational Bound; @@ -36,24 +36,24 @@ template struct Bitstream_coefficient_kernel { typedef typename CGAL::Algebraic_structure_traits ::Is_zero Is_zero; - + Is_zero is_zero_object() const { return Is_zero(); } struct Convert_to_bfi : public CGAL::cpp98::unary_function { - + Bigfloat_interval operator() (Coefficient c) const { return CGAL::convert_to_bfi(c); } }; - + Convert_to_bfi convert_to_bfi_object() const { return Convert_to_bfi(); } - - + + }; // of class Bitstream_coefficient_kernel } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel_at_alpha.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel_at_alpha.h index fd207777dd57..6d72346f3330 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel_at_alpha.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_coefficient_kernel_at_alpha.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -17,7 +17,7 @@ namespace CGAL { #include - + #include #include @@ -52,14 +52,14 @@ class Bitstream_coefficient_kernel_at_alpha_rep { Algebraic_kernel_d_1* _m_kernel; Algebraic_real_1 _m_alpha; - + }; template < typename AlgebraicKernel_1 > class Bitstream_coefficient_kernel_at_alpha : public CGAL::Handle_with_policy < CGAL::internal::Bitstream_coefficient_kernel_at_alpha_rep - + > { @@ -71,19 +71,19 @@ class Bitstream_coefficient_kernel_at_alpha typedef AlgebraicKernel_1 Algebraic_kernel_d_1; typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real_1; - + typedef typename Algebraic_kernel_d_1::Polynomial_1 Polynomial_1; typedef Polynomial_1 Coefficient; - typedef typename + typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel - Arithmetic_kernel; + Arithmetic_kernel; typedef typename Arithmetic_kernel::Integer Integer; typedef typename Algebraic_kernel_d_1::Bound Bound; - + typedef typename Arithmetic_kernel::Bigfloat_interval Bigfloat_interval; typedef CGAL::internal::Bitstream_coefficient_kernel_at_alpha_rep @@ -99,13 +99,13 @@ class Bitstream_coefficient_kernel_at_alpha Bitstream_coefficient_kernel_at_alpha() : Base(Rep()) {} -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Bitstream_coefficient_kernel_at_alpha(const Self& traits) : Base(static_cast(traits)) {} #endif - + Bitstream_coefficient_kernel_at_alpha(Algebraic_kernel_d_1* kernel, - Algebraic_real_1 alpha) + Algebraic_real_1 alpha) : Base(kernel,alpha) {} //@} @@ -114,8 +114,8 @@ class Bitstream_coefficient_kernel_at_alpha //! @{ struct Is_zero : public CGAL::cpp98::unary_function { - - Is_zero(Algebraic_kernel_d_1* kernel,Algebraic_real_1 alpha) + + Is_zero(Algebraic_kernel_d_1* kernel,Algebraic_real_1 alpha) : _m_kernel(kernel),_m_alpha(alpha) {} bool operator() (Coefficient f) const { @@ -132,51 +132,51 @@ class Bitstream_coefficient_kernel_at_alpha return Is_zero(this->ptr()->_m_kernel,this->ptr()->_m_alpha); } - struct Convert_to_bfi + struct Convert_to_bfi : public CGAL::cpp98::unary_function { - + Convert_to_bfi(Algebraic_kernel_d_1* kernel, - Algebraic_real_1 alpha) - : _m_kernel(kernel), _m_alpha(alpha) {} + Algebraic_real_1 alpha) + : _m_kernel(kernel), _m_alpha(alpha) {} Bigfloat_interval operator() (Coefficient f) const { typename CGAL::Polynomial_traits_d ::template Rebind::Other::Type f_bfi; - - typename Algebraic_kernel_d_1::Approximate_relative_1 approx_alpha - =_m_kernel->approximate_relative_1_object(); - - typedef typename Algebraic_kernel_d_1::Bound Bound; - - Bigfloat_interval alpha_bfi, f_alpha_bfi; - + + typename Algebraic_kernel_d_1::Approximate_relative_1 approx_alpha + =_m_kernel->approximate_relative_1_object(); + + typedef typename Algebraic_kernel_d_1::Bound Bound; + + Bigfloat_interval alpha_bfi, f_alpha_bfi; + long p = CGAL::get_precision(Bigfloat_interval()); - + long prec = 16; - + long wbit = 0; - - while(true) { + + while(true) { CGAL::set_precision(Bigfloat_interval(),prec); - + f_bfi = this->_convert_polynomial_to_bfi(f); - - std::pair alpha_bounds - = approx_alpha(_m_alpha,prec); - - alpha_bfi = CGAL::hull - (CGAL::convert_to_bfi(alpha_bounds.first), - CGAL::convert_to_bfi(alpha_bounds.second)); - - f_alpha_bfi = f_bfi.evaluate(alpha_bfi); - + + std::pair alpha_bounds + = approx_alpha(_m_alpha,prec); + + alpha_bfi = CGAL::hull + (CGAL::convert_to_bfi(alpha_bounds.first), + CGAL::convert_to_bfi(alpha_bounds.second)); + + f_alpha_bfi = f_bfi.evaluate(alpha_bfi); + if(!CGAL::singleton(f_alpha_bfi)) { long ceil = CGAL::internal::ceil_log2_abs(f_alpha_bfi); long signi = CGAL::get_significant_bits(f_alpha_bfi); wbit = ceil - signi + p; - - } - + + } + if(wbit<-5 || CGAL::singleton(f_alpha_bfi)) { break; } else { @@ -186,9 +186,9 @@ class Bitstream_coefficient_kernel_at_alpha CGAL::set_precision(Bigfloat_interval(),p); return f_alpha_bfi; } - + private: - + typename CGAL::Polynomial_traits_d ::template Rebind::Other::Type _convert_polynomial_to_bfi(Coefficient f) const { @@ -201,11 +201,11 @@ class Bitstream_coefficient_kernel_at_alpha } return typename CGAL::Polynomial_traits_d ::template Rebind::Other - ::Construct_polynomial()(coeffs.begin(),coeffs.end()); + ::Construct_polynomial()(coeffs.begin(),coeffs.end()); } Algebraic_kernel_d_1* _m_kernel; - + Algebraic_real_1 _m_alpha; }; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h index 8932935122e0..7f4d0f29ade9 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -30,13 +30,13 @@ #include -namespace CGAL { +namespace CGAL { namespace internal { //! enum to distinguish between different descartes instances enum Bitstream_descartes_type { - GENERIC_DESCARTES = 0, + GENERIC_DESCARTES = 0, SQUARE_FREE_DESCARTES = 1, //!< uses Square_free_descartes_tag constructor M_K_DESCARTES = 2, //!< uses M_k_descartes_tag constructor BACKSHEAR_DESCARTES = 3, //!< uses Backshear_descartes_tag constructor @@ -76,74 +76,74 @@ class Virtual_method_exception {}; */ template -class Generic_descartes_rep +class Generic_descartes_rep : public Policy::template Hierarchy_base::Type { - + public: - + //! The traits class for approximations - typedef BitstreamDescartesRndlTreeTraits + typedef BitstreamDescartesRndlTreeTraits Bitstream_descartes_rndl_tree_traits; - + //! The Handle class typedef Bitstream_descartes Handle; - + //! The Coeeficient type of the input polynomial typedef typename Bitstream_descartes_rndl_tree_traits::Coefficient Coefficient; - + //! The polynomial type typedef typename Bitstream_descartes_rndl_tree_traits::POLY Polynomial; - + typedef Generic_descartes_rep Self; - + //! The type of the used Bitstream Descartes tree #if CGAL_ACK_BITSTREAM_USES_E08_TREE typedef CGAL::internal::Bitstream_descartes_E08_tree - + Bitstream_tree; #else typedef CGAL::internal::Bitstream_descartes_rndl_tree - + Bitstream_tree; #endif - - + + //! The used integer type typedef typename Bitstream_descartes_rndl_tree_traits::Integer Integer; - + //! The type for the iterator of the nodes of the bitstream tree typedef typename Bitstream_tree::Node_iterator Node_iterator; - + //! The same as constant iterator typedef typename Bitstream_tree::Node_const_iterator Node_const_iterator; - + //! How the boundaries of the isolating intervals are represented typedef typename Bitstream_descartes_rndl_tree_traits::Bound Bound; - + //! Default constructor (does nothing) Generic_descartes_rep(Bitstream_descartes_type type = GENERIC_DESCARTES) : type_(type) { }; - - /*! + + /*! * Constructor computing an interval containing all real roots of \c f, * and initialising the Bitstream Descartes tree */ - Generic_descartes_rep(Bitstream_descartes_type type, + Generic_descartes_rep(Bitstream_descartes_type type, Polynomial f, - Bitstream_descartes_rndl_tree_traits traits) : - type_(type), - f_(f), - traits_(traits), + Bitstream_descartes_rndl_tree_traits traits) : + type_(type), + f_(f), + traits_(traits), is_isolated_(false) { - + Integer lower,upper; long log_div; this->get_interval(f,lower,upper,log_div,traits); //AcX_DSTREAM("f: " << f << std::endl); if (CGAL::degree(f) > 0) { - bitstream_tree + bitstream_tree #if CGAL_ACK_BITSTREAM_USES_E08_TREE = Bitstream_tree(-log_div, f.begin(), @@ -157,7 +157,7 @@ class Generic_descartes_rep typename Bitstream_tree::Monomial_basis_tag(), traits); #endif - + if (bitstream_tree.begin() == bitstream_tree.end()) { number_of_intervals = 0; } else { @@ -167,50 +167,50 @@ class Generic_descartes_rep number_of_intervals=0; } } - - /*! + + /*! * Constructor that copies the Bitstream tree given from outside * and initialising the Bitstream Descartes tree * The tree must "fit" to the polynomial */ - Generic_descartes_rep(Bitstream_descartes_type type, + Generic_descartes_rep(Bitstream_descartes_type type, Polynomial f, Bitstream_tree tree, - Bitstream_descartes_rndl_tree_traits traits) : - type_(type), - f_(f), - traits_(traits), + Bitstream_descartes_rndl_tree_traits traits) : + type_(type), + f_(f), + traits_(traits), bitstream_tree(tree), is_isolated_(false) { - + tree.set_traits(traits); - + number_of_intervals = 0; - + for(Node_iterator curr = bitstream_tree.begin(); curr != bitstream_tree.end(); curr++) { number_of_intervals++; } } - + //! Destructor (does nothing) virtual ~Generic_descartes_rep() { } - + //! Needed for the referencing counting mechanism virtual CGAL::Reference_counted_hierarchy<>* clone() { return new Generic_descartes_rep(*this); } - - /*! + + /*! * \brief Computes a better approximation of the \c i th root of the * polynomial */ virtual void refine_interval(int i) const { CGAL_assertion(i >= 0); CGAL_assertion(i < number_of_intervals); - Node_iterator curr = bitstream_tree.begin(), begin, end, + Node_iterator curr = bitstream_tree.begin(), begin, end, new_begin, helper; std::advance(curr,i); int intervals = 1; @@ -224,7 +224,7 @@ class Generic_descartes_rep intervals += new_intervals-1; begin = new_begin; curr = helper; - + // Fixes the bug when a interval splits, and the leftmost subintervals // has no children with sign variation >=1 if (intervals == 1) { @@ -233,63 +233,63 @@ class Generic_descartes_rep if (new_intervals == 0) { continue; } - + while(curr != end) { intervals += bitstream_tree.subdivide(curr,new_begin,helper)-1; curr = helper; } - + } while (intervals != 1); - //std::cout << "Refined " << left_bound(i) << " " << right_bound(i) << std::endl; - + //std::cout << "Refined " << left_bound(i) << " " << right_bound(i) << std::endl; + } - - /*! + + /*! * \brief isolates the root of \c f * * The mechanism is the following: The \c bitstream_tree member of the - * object is transformed via subdivision until the + * object is transformed via subdivision until the * \c termination_condition routine of the object returns true. When this * happens, the \c process_nodes routine of the object is called. */ virtual void isolate() { - + //AcX_DSTREAM("Starting isolation" << std::endl); - + Node_iterator curr = bitstream_tree.begin(),dummy,new_curr; - + if(curr == bitstream_tree.end()) { is_isolated_ = true; return; } - + int newly_created; - + while (!this->termination_condition()) { - + if (curr == bitstream_tree.end()) { curr = bitstream_tree.begin(); } - + if (bitstream_tree.max_var(curr) == 1) { ++curr; } else { - //AcX_DSTREAM("Subdivision at " - //<< CGAL::to_double(bitstream_tree.lower(curr)) << " " + //AcX_DSTREAM("Subdivision at " + //<< CGAL::to_double(bitstream_tree.lower(curr)) << " " //<< CGAL::to_double(bitstream_tree.upper(curr)) << std::flush); newly_created = bitstream_tree.subdivide(curr,dummy,new_curr); number_of_intervals += newly_created-1; curr = new_curr; //AcX_DSTREAM("done" << std::endl); } - + } this->process_nodes(); is_isolated_ = true; } - + /*! * \brief Computes an interval containing all real roots of \c p, * using the Fujiwara root bound. @@ -297,16 +297,16 @@ class Generic_descartes_rep * So far, the \c log_div variable is always set to zero, this means * that [lower,upper] is the interval containing all real roots */ - virtual void get_interval(const Polynomial& p, Integer& lower, + virtual void get_interval(const Polynomial& p, Integer& lower, Integer& upper, long& log_div, Bitstream_descartes_rndl_tree_traits traits) { - - + + typename Bitstream_descartes_rndl_tree_traits::Lower_bound_log2_abs lower_bound_log2_abs = traits.lower_bound_log2_abs_object(); - typename + typename Bitstream_descartes_rndl_tree_traits::Upper_bound_log2_abs_approximator - upper_bound_log2_abs_approximator + upper_bound_log2_abs_approximator = traits.upper_bound_log2_abs_approximator_object(); //AcX_DSTREAM("Fujiwara bound.." << p << std::endl); #if CGAL_ACK_BITSTREAM_USES_E08_TREE @@ -317,7 +317,7 @@ class Generic_descartes_rep upper_bound_log2_abs_approximator ); #else - + log_div = -CGAL::internal ::Fujiwara_root_bound_log (p.begin(), @@ -326,21 +326,21 @@ class Generic_descartes_rep upper_bound_log2_abs_approximator ); #endif - + //AcX_DSTREAM("Fujiwara returns " << log_div << std::endl); // To be sure log_div--; lower=Integer(-1); upper=Integer(1); return; - + } - + //! returns the number of detected isolating intervals virtual int number_of_real_roots() const { return number_of_intervals; } - + //! The lower bound of the \c i th root virtual Bound left_bound(int i) const { CGAL_assertion(i >= 0); @@ -348,8 +348,8 @@ class Generic_descartes_rep Node_const_iterator curr = bitstream_tree.begin(); std::advance(curr,i); return bitstream_tree.lower(curr); - } - + } + //! The upper bound of the \c i th root virtual Bound right_bound(int i) const { CGAL_assertion(i >= 0); @@ -357,35 +357,35 @@ class Generic_descartes_rep Node_const_iterator curr = bitstream_tree.begin(); std::advance(curr,i); return bitstream_tree.upper(curr); - } - + } + //! Returns the polynomial which is isolated Polynomial polynomial() const { return f_; } - - /*! + + /*! * \brief When does the isolation algorithm terminate? * * This method must be specialised by derived classes - */ + */ virtual bool termination_condition() { throw Virtual_method_exception(); return false; } - + /*! * \brief Gives an opportunity to process the nodes after * the subdivision steps are finished * * This method must be specialised by derived classes, but can * remain empty in many cases. - */ + */ virtual void process_nodes() { throw Virtual_method_exception(); return; } - + /*! \brief Returns whether the \c i th root is definitely a simple root * of the isolated polynomial * @@ -395,7 +395,7 @@ class Generic_descartes_rep throw Virtual_method_exception(); return false; } - + /*! \brief Returns whether the \c i th root is definitely a multiple root * of the isolated polynomial * @@ -405,74 +405,74 @@ class Generic_descartes_rep throw Virtual_method_exception(); return false; } - - + + virtual int multiplicity_of_root(int CGAL_assertion_code(i)) const { CGAL_assertion(i >= 0); CGAL_assertion(i < number_of_intervals); return -1; } - + virtual int get_upper_bound_for_multiplicity(int i) const { CGAL_assertion(i >= 0); CGAL_assertion(i < number_of_intervals); Node_const_iterator curr = bitstream_tree.begin(); std::advance(curr,i); return bitstream_tree.min_var(curr); - } - + } + //! Must be specialized by the derived class virtual int degree_of_gcd() const { throw Virtual_method_exception(); return -1; } - + //! Must be specialized by the derived class virtual Polynomial square_free_part() const { throw Virtual_method_exception(); return Polynomial(); } - + //! Must be specialized by the derived class virtual Handle inverse_transform_isolator() const { throw Virtual_method_exception(); return Handle(); } - + bool is_isolated() const { return is_isolated_; } - + Bitstream_descartes_rndl_tree_traits traits() const { return traits_; } - + Bitstream_tree get_tree() const { - + return bitstream_tree; - + } - + //! type to distinguish used constructor Bitstream_descartes_type type_; - + protected: - + //! Polynomial which is isolated Polynomial f_; - + //! The traits class Bitstream_descartes_rndl_tree_traits traits_; - + //! The tree of the Bitstream Descartes method mutable Bitstream_tree bitstream_tree; - + //! The number of detected isolating intervals int number_of_intervals; - + //! Has isolation already taken place mutable bool is_isolated_; - + }; /* @@ -480,30 +480,30 @@ class Generic_descartes_rep */ template -class Square_free_descartes_rep +class Square_free_descartes_rep : public Generic_descartes_rep { - - + + public: - + //! Traits type - typedef BitstreamDescartesRndlTreeTraits + typedef BitstreamDescartesRndlTreeTraits Bitstream_descartes_rndl_tree_traits; - + //! The generic representation typedef Generic_descartes_rep Base; - + Policy> Base; + //! Polynomial type typedef typename Base::Polynomial Polynomial; - + //! Iterator for the leaves in the bitstream tree typedef typename Base::Node_iterator Node_iterator; - + //! The type of the tree that controls the Bitstream instance typedef typename Base::Bitstream_tree Bitstream_tree; - - /*! + + /*! * \brief Constructor with the square free polynomial f. */ Square_free_descartes_rep( @@ -512,7 +512,7 @@ class Square_free_descartes_rep Base(SQUARE_FREE_DESCARTES, f,traits) { } - /*! + /*! * \brief Constructor with the square free polynomial f. */ Square_free_descartes_rep( @@ -526,7 +526,7 @@ class Square_free_descartes_rep virtual CGAL::Reference_counted_hierarchy<>* clone() { return new Square_free_descartes_rep(*this); } - + /*! * \brief Terminates when all detected roots are simple */ @@ -539,17 +539,17 @@ class Square_free_descartes_rep } return true; } - - //! nothing to do here + + //! nothing to do here virtual void process_nodes() { return; } - + //! Polynomial is square free, so gcd is 1 virtual int degree_of_gcd() const { return 0; } - + //! Polynomial is square free virtual Polynomial square_free_part() const { return this->f_; @@ -559,12 +559,12 @@ class Square_free_descartes_rep virtual bool is_certainly_simple_root(int ) const { return true; } - + //! Always false virtual bool is_certainly_multiple_root(int ) const { return false; } - + }; /* @@ -572,16 +572,16 @@ class Square_free_descartes_rep */ template -class M_k_descartes_rep +class M_k_descartes_rep : public Generic_descartes_rep { - - + + public: - + //! Traits class - typedef BitstreamDescartesRndlTreeTraits + typedef BitstreamDescartesRndlTreeTraits Bitstream_descartes_rndl_tree_traits; - + //! Generic representation typedef Generic_descartes_rep Base; @@ -610,7 +610,7 @@ class M_k_descartes_rep * and k need to be the exact number of real roots of f * counted without multiplicity and the degree of the greatest common * divisor of f with its partial derivative, respectively. - */ + */ M_k_descartes_rep(Polynomial f,int m, int k, Bitstream_descartes_rndl_tree_traits traits) : Base(M_K_DESCARTES, f,traits), @@ -629,7 +629,7 @@ class M_k_descartes_rep } //! Default constructor - M_k_descartes_rep() { + M_k_descartes_rep() { } //! Needed for reference counting @@ -647,7 +647,7 @@ class M_k_descartes_rep */ virtual bool termination_condition() { int counted_simple_roots=0; - int max_max_var = 0; + int max_max_var = 0; for(Node_iterator curr=Base::bitstream_tree.begin(); curr != Base::bitstream_tree.end(); curr++) { int max_var = Base::bitstream_tree.max_var(curr); @@ -657,16 +657,16 @@ class M_k_descartes_rep if(max_var == 1) { // && Base::bitstream_tree.max_var(curr)==1) { ++counted_simple_roots; } - } + } //AcX_DSTREAM("Situation: " << this->number_of_intervals << " intervals " << this->number_of_roots << " are expected" << std::endl); - if (this->number_of_intervals == this->number_of_roots + if (this->number_of_intervals == this->number_of_roots && counted_simple_roots >= number_of_roots-1) { return true; } if (max_max_var <= gcd_degree) { throw CGAL::internal::Non_generic_position_exception(); } - + return false; } @@ -690,20 +690,20 @@ class M_k_descartes_rep virtual int degree_of_gcd() const { return gcd_degree; } - + //! True for all roots except for the candidate virtual bool is_certainly_simple_root(int i) const { return (i!=index_of_multiple); } - + //! Always false virtual bool is_certainly_multiple_root(int) const { return false; } - + protected: - + //! The "m" int number_of_roots; @@ -715,21 +715,21 @@ class M_k_descartes_rep }; - + template -class Backshear_descartes_rep +class Backshear_descartes_rep : public Generic_descartes_rep { - + public: typedef EventRefinement Event_refinement; - - typedef BitstreamDescartesRndlTreeTraits + + typedef BitstreamDescartesRndlTreeTraits Bitstream_descartes_rndl_tree_traits; - + typedef Generic_descartes_rep Base; @@ -751,12 +751,12 @@ class Backshear_descartes_rep int number_of_events, Event_refinement event_refinement, Bitstream_descartes_rndl_tree_traits traits) : - Base(BACKSHEAR_DESCARTES,f,traits), + Base(BACKSHEAR_DESCARTES,f,traits), number_of_non_event_points(number_of_non_event_points), number_of_events(number_of_events), event_refinement(event_refinement) { } - + Backshear_descartes_rep() { } @@ -765,7 +765,7 @@ class Backshear_descartes_rep } virtual void isolate() { - + Node_iterator curr = Base::bitstream_tree.begin(),sub_begin,new_curr; if(curr == Base::bitstream_tree.end()) { @@ -792,7 +792,7 @@ class Backshear_descartes_rep //AcX_DSTREAM("nothing happend" << std::endl); } else { - newly_created = + newly_created = Base::bitstream_tree.subdivide(curr,sub_begin,new_curr); mark_helper = markings.erase(curr_mark); curr_mark = mark_helper; @@ -804,7 +804,7 @@ class Backshear_descartes_rep Base::number_of_intervals += newly_created-1; curr = new_curr; //AcX_DSTREAM(newly_created << " new intervals, marking size: " << markings.size() << std::endl); - + } } this->process_nodes(); @@ -830,7 +830,7 @@ class Backshear_descartes_rep ++curr_mark; } CGAL_assertion(curr_mark == markings.end()); - return ((marked_intervals == number_of_events) + return ((marked_intervals == number_of_events) && (unmarked_odd_intervals == number_of_non_event_points)); } @@ -838,7 +838,7 @@ class Backshear_descartes_rep Node_iterator curr=Base::bitstream_tree.begin(),curr_helper; Marking_iterator curr_mark = markings.begin(); while(curr!=Base::bitstream_tree.end()) { - if(((*curr_mark) == -1) && + if(((*curr_mark) == -1) && (Base::bitstream_tree.min_var(curr) % 2 == 0)) { ++curr; curr_helper = curr; @@ -866,7 +866,7 @@ class Backshear_descartes_rep std::advance(curr,i); return (Base::bitstream_tree.max_var(curr) == 1); } - + virtual bool is_certainly_multiple_root(int i) const { CGAL_assertion(i >= 0); CGAL_assertion(i < Base::number_of_intervals); @@ -874,7 +874,7 @@ class Backshear_descartes_rep std::advance(curr,i); return (*curr>=0); } - + protected: @@ -895,7 +895,7 @@ class Backshear_descartes_rep while(true) { if(CGAL::compare(event_refinement.lower_bound(i),lower) !=CGAL::NEGATIVE - && + && CGAL::compare(event_refinement.upper_bound(i),upper) !=CGAL::POSITIVE) { //Event inside the interval @@ -910,31 +910,31 @@ class Backshear_descartes_rep break; } event_refinement.refine(i); - + } } return -1; } - + }; /* - * \brief Adaptor for roots of a vert line + * \brief Adaptor for roots of a vert line * (needed as dummy in surface analysis) * */ template -class Vert_line_adapter_descartes_rep +class Vert_line_adapter_descartes_rep : public Generic_descartes_rep { - + public: - + //! The traits class for approximations - typedef BitstreamDescartesRndlTreeTraits + typedef BitstreamDescartesRndlTreeTraits Bitstream_descartes_rndl_tree_traits; - + //! type of vert line typedef VertLine Vert_line; @@ -942,55 +942,55 @@ class Vert_line_adapter_descartes_rep typedef typename Vert_line::Curve_analysis_2 Curve_analysis_2; //! type of Curve_kernel_2; - typedef typename Curve_analysis_2::Algebraic_kernel_with_analysis_2 + typedef typename Curve_analysis_2::Algebraic_kernel_with_analysis_2 Curve_kernel_2; //! The Coeeficient type of the input polynomial - typedef typename Bitstream_descartes_rndl_tree_traits::Coefficient + typedef typename Bitstream_descartes_rndl_tree_traits::Coefficient Coefficient; - + //! The polynomial type - typedef typename CGAL::Polynomial_type_generator::Type + typedef typename CGAL::Polynomial_type_generator::Type Polynomial; - + typedef Vert_line_adapter_descartes_rep Self; - + //! The used integer type typedef typename Bitstream_descartes_rndl_tree_traits::Integer Integer; - + //! How the boundaries of the isolating intervals are represented typedef typename Bitstream_descartes_rndl_tree_traits::Bound Bound; - + typedef Generic_descartes_rep Base; - + //! The type for the inverse isolator typedef typename Base::Handle Handle; - - /*! + + /*! * \brief Constructor */ template Vert_line_adapter_descartes_rep(InputIterator begin, InputIterator end, Bitstream_descartes_rndl_tree_traits traits) - : Base(VERT_LINE_ADAPTER_DESCARTES) + : Base(VERT_LINE_ADAPTER_DESCARTES) { for (InputIterator it = begin; it != end; it++) { root_vec.push_back(std::make_pair(*it, 4)); } - + this->is_isolated_ = true; this->traits_ = traits; this->f_ = Polynomial(0); - this->number_of_intervals + this->number_of_intervals = static_cast(root_vec.size()); // Isolate all real roots until intervals are disjoint: for (int i = 1; i < this->number_of_real_roots(); i++ ){ while(left_bound(i) < right_bound(i-1) ) { - if (right_bound(i)-left_bound(i) < + if (right_bound(i)-left_bound(i) < right_bound(i-1) - left_bound(i-1) ) { refine_interval(i-1); } else { @@ -1000,8 +1000,8 @@ class Vert_line_adapter_descartes_rep } } - - + + //! Destructor (does nothing) virtual ~Vert_line_adapter_descartes_rep() { } @@ -1010,15 +1010,15 @@ class Vert_line_adapter_descartes_rep virtual CGAL::Reference_counted_hierarchy<>* clone() { return new Vert_line_adapter_descartes_rep(*this); } - + virtual void refine_interval(int i) const { root_vec[i] = std::make_pair(root_vec[i].first, root_vec[i].second * 2); } - + virtual void isolate() const { } - + //! The lower bound of the \c i th root virtual Bound left_bound(int i) const { typename Curve_kernel_2::Approximate_absolute_y_2 @@ -1028,7 +1028,7 @@ class Vert_line_adapter_descartes_rep (root_vec[i].first.second), root_vec[i].second).first; } - + //! The upper bound of the \c i th root virtual Bound right_bound(int i) const { typename Curve_kernel_2::Approximate_absolute_y_2 @@ -1047,8 +1047,8 @@ class Vert_line_adapter_descartes_rep virtual bool is_certainly_simple_root(int /* i */) const { return false; } - - /*! \brief Returns whether the \c i th root is definitely + + /*! \brief Returns whether the \c i th root is definitely * a multiple root * of the isolated polynomial * @@ -1070,61 +1070,61 @@ class Vert_line_adapter_descartes_rep * \brief Class for the Bitstream Descartes method * * Class for the real root isolation of polynomials, using the Bitstream - * Descartes method. The polynomials coefficient type is arbitrary, the - * approximations of the coefficient type are obtained with the + * Descartes method. The polynomials coefficient type is arbitrary, the + * approximations of the coefficient type are obtained with the * \c BitstreamDescartesRndlTreeTraits parameter. For the requirements - * of this traits class, see the documentation of - * CGAL::Bitstream_descartes_rndl_tree. + * of this traits class, see the documentation of + * CGAL::Bitstream_descartes_rndl_tree. * * Internally, an instance of CGAL::Bitstream_descartes_rndl_tree is explored * in a specific way. That exploration strategy depends on the constructor * that is used to create the object. A tag is passed that defines the * variant of the Bitstream Descartes method: The Square_free_descartes_tag * starts the usual Bitstream method for square free integer polynomials. - * With the M_k_descartes tag, it is able to handle one multiple root in + * With the M_k_descartes tag, it is able to handle one multiple root in * favourable situations, the Backshear_descartes_tag allows to isolate * even more complicated polynomials, if the multiple roots with even * multiplicity can be refined from outside. See the corresponding * constructors for more information. - * + * */ template -class Bitstream_descartes +class Bitstream_descartes : ::CGAL::Handle_with_policy< CGAL::internal::Generic_descartes_rep > { - + public: - + //! Traits class - typedef BitstreamDescartesRndlTreeTraits + typedef BitstreamDescartesRndlTreeTraits Bitstream_descartes_rndl_tree_traits; - + // The generic representation class - typedef + typedef CGAL::internal::Generic_descartes_rep Rep; // The Handle type typedef ::CGAL::Handle_with_policy Base; - + //! The coefficients of the polynomial typedef typename Bitstream_descartes_rndl_tree_traits::Coefficient Coefficient; - + //! The polynomial's type - typedef typename CGAL::Polynomial_type_generator::Type + typedef typename CGAL::Polynomial_type_generator::Type Polynomial; - - typedef Bitstream_descartes + + typedef Bitstream_descartes Self; - + // Type for the Bitstream Descartes tree #if CGAL_ACK_BITSTREAM_USES_E08_TREE typedef CGAL::internal::Bitstream_descartes_E08_tree - + Bitstream_tree; #else typedef CGAL::internal::Bitstream_descartes_rndl_tree - + Bitstream_tree; #endif @@ -1132,11 +1132,11 @@ class Bitstream_descartes typedef typename Bitstream_descartes_rndl_tree_traits::Integer Integer; //! Iterator type for the leaves of the Descartes tree - typedef typename Bitstream_tree::Node_iterator + typedef typename Bitstream_tree::Node_iterator Node_iterator; //! Const iterator for the leaves - typedef typename Bitstream_tree::Node_const_iterator + typedef typename Bitstream_tree::Node_const_iterator Node_const_iterator; //! Type for the interval boundaries of the isolating intervals @@ -1149,11 +1149,11 @@ class Bitstream_descartes //! Copy constructor Bitstream_descartes(const Self& other) : Base(static_cast(other)) {} - - /*! + + /*! * \brief Constructor for a polynomial \c f * - * See the documentation of the constrctor + * See the documentation of the constrctor * with \c Square_free_descartes_tag */ Bitstream_descartes(Polynomial f, @@ -1168,10 +1168,10 @@ class Bitstream_descartes } } - /*! + /*! * \brief Constructor for the square free Descartes method * - * The polynomial \c f must not have multiple real roots. The + * The polynomial \c f must not have multiple real roots. The * Bitstream Descartes tree is traversed in a bfs manner until * all leaves have sign variation zero or one. */ @@ -1188,14 +1188,14 @@ class Bitstream_descartes } } - /*! + /*! * \brief Constructor for the square free Descartes method, * using a precomputed tree * - * The polynomial \c f must not have multiple real roots. The + * The polynomial \c f must not have multiple real roots. The * Bitstream Descartes tree is traversed in a bfs manner until * all leaves have sign variation zero or one. - * The tree must be adequate for the polynomial. + * The tree must be adequate for the polynomial. * Use that constructor only if you know what you're doing! */ Bitstream_descartes(Square_free_descartes_tag , @@ -1212,7 +1212,7 @@ class Bitstream_descartes } } - /*! + /*! * \brief Constructor for the m-k-Descartes method * * The polynomial \c f must have exactly \c m real roots, counted without @@ -1250,11 +1250,11 @@ class Bitstream_descartes this->isolate(); } } - - /*! + + /*! * \brief Constructor for the Backshear-Decartes method - * + * * The polynomial \c f must have exactly \c number_of_real_roots * many real roots, counted without multiplicity. Additionally, a set of * \c number_of_events root can be refined to arbitrary precision with the @@ -1275,7 +1275,7 @@ class Bitstream_descartes Bitstream_descartes_rndl_tree_traits traits = Bitstream_descartes_rndl_tree_traits(), bool isolate = true) - : Base(new + : Base(new CGAL::internal::Backshear_descartes_rep (f,number_of_real_roots-number_of_events, @@ -1287,7 +1287,7 @@ class Bitstream_descartes } - /*! + /*! * \brief Constructor for the Vert-line-adapter-Descartes method * */ @@ -1318,7 +1318,7 @@ class Bitstream_descartes //! Returns the traits class Bitstream_descartes_rndl_tree_traits traits() const { return this->ptr()->traits(); - } + } //! Number of real roots of the polynomial int number_of_real_roots() const { @@ -1339,10 +1339,10 @@ class Bitstream_descartes } //! The left bound of the ith isolating interval - void left_bound(int i, - Integer& numerator, + void left_bound(int i, + Integer& numerator, Integer& denominator) const { - typedef CGAL::Fraction_traits Fraction_traits; + typedef CGAL::Fraction_traits Fraction_traits; typename Fraction_traits::Decompose decompose; decompose(left_bound(i),numerator,denominator); } @@ -1354,10 +1354,10 @@ class Bitstream_descartes } //! The right bound of the ith isolating interval - void right_bound(int i, - Integer& numerator, + void right_bound(int i, + Integer& numerator, Integer& denominator) const { - typedef CGAL::Fraction_traits Fraction_traits; + typedef CGAL::Fraction_traits Fraction_traits; typename Fraction_traits::Decompose decompose; decompose(right_bound(i),numerator,denominator); } @@ -1365,23 +1365,23 @@ class Bitstream_descartes //! The length of the ith isolating interval Bound length(int i) const { CGAL_assertion(is_isolated()); - return (this->ptr()->right_bound(i) - + return (this->ptr()->right_bound(i) - this->ptr()->left_bound(i)); } bool is_exact_root(int) const { return false; } - /*! - * \brief Returns true if the ith root is known to be a simple + /*! + * \brief Returns true if the ith root is known to be a simple * root of the curve. */ bool is_certainly_simple_root(int i) const { CGAL_assertion(is_isolated()); return this->ptr()->is_certainly_simple_root(i); } - - /*! - * \brief Returns true if the ith root is known to be a multiple + + /*! + * \brief Returns true if the ith root is known to be a multiple * root of the curve. */ bool is_certainly_multiple_root(int i) const { @@ -1389,8 +1389,8 @@ class Bitstream_descartes return this->ptr()->is_certainly_multiple_root(i); } - - /*! + + /*! * \brief Returns the multiplicity of the root if know, otherwise -1 */ int multiplicity_of_root(int i) const { @@ -1415,31 +1415,31 @@ class Bitstream_descartes public: - + //! Starts the isolation of the real roots. void isolate() { CGAL_assertion(!is_isolated()); this->ptr()->isolate(); } - + bool is_isolated() const { return this->ptr()->is_isolated(); } - + Bitstream_tree get_tree() const { return this->ptr()->get_tree(); } - + //! returns the degree of the gcd of f and its derivative, if known int degree_of_gcd() const { return this->ptr()->degree_of_gcd(); } - + //! returns the square free part of f, if known Polynomial square_free_part() const { return this->ptr()->square_free_part(); } - + }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h index 60e716f624a0..a4031073c049 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Arno Eigenwillig // @@ -126,7 +126,7 @@ void Power_to_Bernstein_pm1_nofrac_matrix::init_m() { else { sum += term; } } m_[ij_to_idx(i,j)] = - sum + sum * CGAL::internal::caching_factorial(i) * CGAL::internal::caching_factorial(degree - i); } @@ -204,7 +204,7 @@ Bitstream_bernstein_from_power::Bitstream_bernstein_from_power( log_radius_(log_radius), approximator_(traits.approximator_object()), lower_bound_log2_abs_(traits.lower_bound_log2_abs_object()) -{ +{ CGAL_assertion(degree_ >= 0); lbd_log_lcoeff_ = lower_bound_log2_abs_(input_power_coeff_[degree_]); if (degree_ == 2) { @@ -407,7 +407,7 @@ template typedef CGAL::internal::Sign_eps_log2 \ \ Sign_eps_log2 \ - + // end #define // typedefs for Bitstream_descartes_E08_tree{,_rep} @@ -415,7 +415,7 @@ template CGAL_BITSTREAM_DESCARTES_E08_TREE_COMMON_TYPEDEFS; \ typedef CGAL::internal::Bitstream_descartes_E08_node Node; \ typedef std::list Node_list \ - + // end #define @@ -432,7 +432,7 @@ struct Bitstream_descartes_E08_node { public: typedef Bitstream_descartes_E08_node Self; CGAL_BITSTREAM_DESCARTES_E08_TREE_COMMON_TYPEDEFS; - + friend class CGAL::internal::Bitstream_descartes_E08_tree; friend class CGAL::internal::Bitstream_descartes_E08_tree_rep; @@ -566,11 +566,11 @@ class Bitstream_descartes_E08_tree Bitstream_descartes_E08_tree() : Base(Rep()) { } //! copy constructor -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Bitstream_descartes_E08_tree(const Self& p) : Base(static_cast(p)) { } -#endif +#endif /*! \brief construct from initial interval and coefficients * @@ -888,7 +888,7 @@ ::replace_by_tmp( int l_min_var, l_max_var, r_min_var, r_max_var; internal::var_eps(this->ptr()->tmp1_coeff_.begin(), this->ptr()->tmp1_coeff_.end(), - l_min_var, l_max_var, + l_min_var, l_max_var, Sign_eps_log2(n->log_eps_) ); internal::var_eps(this->ptr()->tmp2_coeff_.begin(), @@ -905,7 +905,7 @@ ::replace_by_tmp( int children = 1; if (r_min_var > 0) { // create new node for right child - Node_iterator r = + Node_iterator r = this->ptr()->node_list_.insert(beyond, Node(degree(), this->ptr()->splitpoint_num_, // lower n->upper_num_ << delta_log_bdry_den, // upper diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h index dbf66a11024d..eac9950abc6f 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Arno Eigenwillig // @@ -227,7 +227,7 @@ polynomial_power_to_bernstein_approx( // min/max number of variations in epsilon-sign template -void var_eps( +void var_eps( InputIterator first, InputIterator beyond, int& min_var, int& max_var, const UnaryFunction& sign_eps @@ -393,7 +393,7 @@ de_casteljau_generic( while (rit2 != right_end) { ++rit1; ++rit2; combine.into_first(*rit1, *rit2); - } + } right_end = rit1; } @@ -498,7 +498,7 @@ namespace internal { typedef internal::Abs_le_pow2 Abs_le_pow2; \ typedef internal::Sign_eps_log2 \ Sign_eps_log2 \ - + // end #define // typedefs for Bitstream_descartes_rndl_tree{,_rep} @@ -557,7 +557,7 @@ struct Bitstream_descartes_rndl_node { log_eps_ = n.log_eps_; log_C_eps_ = n.log_C_eps_; } - + Self& operator= (const Self&)=delete; }; // struct Bitstream_descartes_rndl_node @@ -724,7 +724,7 @@ class Bitstream_descartes_rndl_tree_rep { Node_iterator chld_first, chld_beyond; while (it != T.end()) { if (T.max_var(it) == 1) { - cout << "found [" << T.lower(it) << ", " << T.upper(it) << "]\n"; + cout << "found [" << T.lower(it) << ", " << T.upper(it) << "]\n"; ++it; } else { T.subdivide(it, chld_first, chld_beyond); @@ -939,7 +939,7 @@ class Bitstream_descartes_rndl_tree this->ptr()->node_list_.erase(n); } } - + /*! \brief construct from initial interval and coefficients * @@ -964,10 +964,10 @@ class Bitstream_descartes_rndl_tree { CGAL_precondition(lower_num < upper_num); init_tree(); - + } - /*! + /*! * This is needed for compatibility with other tree implementations * The initial interval is * [-1, 1] / 2^(\c -log_bdry_den ). @@ -980,7 +980,7 @@ class Bitstream_descartes_rndl_tree const BitstreamDescartesRndlTreeTraits& traits = BitstreamDescartesRndlTreeTraits() ) - : Base(Rep(Integer(-1), Integer(1), -log_bdry_den, + : Base(Rep(Integer(-1), Integer(1), -log_bdry_den, first, beyond, tag, traits)) { init_tree(); @@ -1083,9 +1083,9 @@ class Bitstream_descartes_rndl_tree */ void set_traits(TRAITS& traits) { - this->ptr()->approximator_ + this->ptr()->approximator_ = traits.approximator_object(); - this->ptr()->lower_bound_log2_abs_ + this->ptr()->lower_bound_log2_abs_ = traits.lower_bound_log2_abs_object(); } @@ -1267,7 +1267,7 @@ ::replace_by_tmp( int children = 1; if (r_min_var > 0) { // create new node for right child - Node_iterator r = + Node_iterator r = this->ptr()->node_list_.insert(beyond, Node(degree(), this->ptr()->splitpoint_num_, // lower n->upper_num_ << delta_log_bdry_den, // upper diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree_traits.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree_traits.h index 15b65b38fd39..155cfbffc68d 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree_traits.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -28,7 +28,7 @@ #include #if CGAL_USE_CORE -namespace CORE { class BigInt; } +namespace CORE { class BigInt; } #endif namespace CGAL { @@ -36,20 +36,20 @@ namespace CGAL { namespace internal { #if CGAL_USE_CORE -// bugfix for CORE by Michael Kerber +// bugfix for CORE by Michael Kerber // why is there a specialized function for CORE? inline CORE::BigInt shift_integer_by(CORE::BigInt x, long shift){ if( shift > 0 ){ while(shift>63) { x = (x >> 63); shift-=63; - } + } x = (x >> shift); }else{ - // add 0 bits - x = (x << -shift); - } - return x; + // add 0 bits + x = (x << -shift); + } + return x; } #endif @@ -58,17 +58,17 @@ Shiftable shift_integer_by(Shiftable x, long shift){ if( shift > 0 ){ x >>= shift; }else{ - x <<= -shift; // adds 0 bits - } - return x; + x <<= -shift; // adds 0 bits + } + return x; } // forward -template +template class Bitstream_descartes_rndl_tree_traits; -template +template class Bitstream_descartes_rndl_tree_traits_rep { public: @@ -77,14 +77,14 @@ class Bitstream_descartes_rndl_tree_traits_rep { Bitstream_descartes_rndl_tree_traits_rep (Bitstream_coefficient_kernel kernel) - : _m_kernel(kernel) - { - } + : _m_kernel(kernel) + { + } - Bitstream_descartes_rndl_tree_traits_rep() {} + Bitstream_descartes_rndl_tree_traits_rep() {} private: - + Bitstream_coefficient_kernel _m_kernel; friend class Bitstream_descartes_rndl_tree_traits @@ -103,16 +103,16 @@ class Bitstream_descartes_rndl_tree_traits public: //! typedefs //! @{ - + typedef BitstreamCoefficientKernel Bitstream_coefficient_kernel; typedef typename Bitstream_coefficient_kernel::Coefficient Coefficient; typedef typename Bitstream_coefficient_kernel::Bigfloat_interval BFI; - typedef typename CGAL::Bigfloat_interval_traits::Bound BF; - - typedef typename - CGAL::Polynomial_type_generator::Type POLY; + typedef typename CGAL::Bigfloat_interval_traits::Bound BF; + + typedef typename + CGAL::Polynomial_type_generator::Type POLY; typedef Bitstream_descartes_rndl_tree_traits < Bitstream_coefficient_kernel > Self; @@ -121,7 +121,7 @@ class Bitstream_descartes_rndl_tree_traits > Base; - typedef typename Bitstream_coefficient_kernel::Integer Integer; + typedef typename Bitstream_coefficient_kernel::Integer Integer; typedef typename Bitstream_coefficient_kernel::Bound Bound; //! @} @@ -139,8 +139,8 @@ class Bitstream_descartes_rndl_tree_traits //! @{ Bitstream_descartes_rndl_tree_traits(const Bitstream_coefficient_kernel& kernel) - : Base(kernel){} - + : Base(kernel){} + Bitstream_descartes_rndl_tree_traits() : Base(static_cast(get_default_instance())){} @@ -148,27 +148,27 @@ class Bitstream_descartes_rndl_tree_traits #ifdef DOXYGEN_RUNNING Bitstream_descartes_rndl_tree_traits(const Self& traits) : Base(static_cast(traits)){} -#endif +#endif //! @} class Approximator { - + private: - - Bitstream_coefficient_kernel _m_kernel; + + Bitstream_coefficient_kernel _m_kernel; public: - Approximator - (const Bitstream_coefficient_kernel& kernel) + Approximator + (const Bitstream_coefficient_kernel& kernel) : _m_kernel(kernel) {}; - Approximator() {}; + Approximator() {}; Integer operator() (Coefficient f, long p) { //std::cout << "Called approximator with f=" << f // << " and p=" << p << std::endl; - + typename CGAL::internal::Float_traits::Get_exponent get_exp; typename CGAL::internal::Float_traits::Get_mantissa get_m; @@ -176,11 +176,11 @@ class Bitstream_descartes_rndl_tree_traits long prec = 4; BFI f_alpha_bfi; - + while(true) { - + CGAL::set_precision(BFI(),prec); - + f_alpha_bfi = _m_kernel.convert_to_bfi_object()(f); if(CGAL::singleton(f_alpha_bfi)) { break; @@ -191,27 +191,27 @@ class Bitstream_descartes_rndl_tree_traits } else { prec*=2; } - + } BF lower = CGAL::lower(f_alpha_bfi); - - long shift = - (p + get_exp(lower)); - Integer bfi_m(get_m(lower)); + + long shift = - (p + get_exp(lower)); + Integer bfi_m(get_m(lower)); bfi_m = shift_integer_by(bfi_m,shift); - -// if( shift > 0 ){ + +// if( shift > 0 ){ // while(shift>63) { // this is a bug fix HACK for CORE::BigInt // bfi_m = (bfi_m >> 63); // shift-=63; // } // bfi_m = (bfi_m >> shift); // }else{ -// // add 0 bits -// bfi_m = (bfi_m << -shift); -// } +// // add 0 bits +// bfi_m = (bfi_m << -shift); +// } CGAL::set_precision(BFI(),old_prec); - + //std::cout << "returns " << bfi_m << std::endl; return bfi_m; @@ -226,19 +226,19 @@ class Bitstream_descartes_rndl_tree_traits class Lower_bound_log2_abs { private: - Bitstream_coefficient_kernel _m_kernel; + Bitstream_coefficient_kernel _m_kernel; public: - Lower_bound_log2_abs - (const Bitstream_coefficient_kernel& kernel) + Lower_bound_log2_abs + (const Bitstream_coefficient_kernel& kernel) : _m_kernel(kernel) {} - + Lower_bound_log2_abs() {}; - long operator() (Coefficient f) { - //std::cout << "Called lower_bound_log2_abs with " + long operator() (Coefficient f) { + //std::cout << "Called lower_bound_log2_abs with " // << f << std::flush; - + CGAL_assertion(! _m_kernel.is_zero_object()(f)); long old_prec = CGAL::get_precision(BFI()); @@ -280,20 +280,20 @@ class Bitstream_descartes_rndl_tree_traits } }; - + Lower_bound_log2_abs lower_bound_log2_abs_object() const { - return Lower_bound_log2_abs(this->ptr()->_m_kernel); + return Lower_bound_log2_abs(this->ptr()->_m_kernel); } class Upper_bound_log2_abs_approximator { private: - Bitstream_coefficient_kernel _m_kernel; + Bitstream_coefficient_kernel _m_kernel; - // Stores id of polynomials which are known to vanish (or not to - // vanish) at alpha - std::vector zeroes,non_zeroes; + // Stores id of polynomials which are known to vanish (or not to + // vanish) at alpha + std::vector zeroes,non_zeroes; std::vector coeffs_for_alpha; @@ -301,21 +301,21 @@ class Bitstream_descartes_rndl_tree_traits long prec; public: - Upper_bound_log2_abs_approximator - (const Bitstream_coefficient_kernel& kernel) + Upper_bound_log2_abs_approximator + (const Bitstream_coefficient_kernel& kernel) : _m_kernel(kernel), prec(4) {} Upper_bound_log2_abs_approximator() : prec(4) {}; - bool initial_upper_bound + bool initial_upper_bound (Coefficient f, long& ub_log2_abs,bool& is_certainly_zero) { return improve_upper_bound(f,ub_log2_abs,is_certainly_zero); - } + } - bool improve_upper_bound + bool improve_upper_bound (const Coefficient f, long& ub_log2_abs,bool& is_certainly_zero) { - //std::cout << "improve upper bound.." + //std::cout << "improve upper bound.." // << f << std::endl; long old_prec = CGAL::get_precision(BFI()); @@ -354,12 +354,12 @@ class Bitstream_descartes_rndl_tree_traits coeffs_for_alpha.clear(); } coeffs_for_alpha.push_back(f); - + BFI f_alpha_iv = _m_kernel.convert_to_bfi_object()(f); - + BF abs_upper = (std::max)(CGAL::abs(CGAL::lower(f_alpha_iv)), CGAL::abs(CGAL::upper(f_alpha_iv))); - + if(CGAL::sign(abs_upper)==CGAL::ZERO) { is_certainly_zero=true; CGAL::set_precision(BFI(),old_prec); @@ -369,10 +369,10 @@ class Bitstream_descartes_rndl_tree_traits ub_log2_abs = CGAL::internal::ceil_log2_abs(abs_upper); if(! CGAL::zero_in(f_alpha_iv) ) { - + BF abs_lower = (std::min)(CGAL::abs(CGAL::lower(f_alpha_iv)), CGAL::abs(CGAL::upper(f_alpha_iv))); - long lb_log2_abs + long lb_log2_abs = CGAL::internal::floor_log2_abs (CGAL::convert_to_bfi(abs_lower)); CGAL_assertion(ub_log2_abs >= lb_log2_abs); @@ -386,21 +386,21 @@ class Bitstream_descartes_rndl_tree_traits } } }; - - Upper_bound_log2_abs_approximator + + Upper_bound_log2_abs_approximator upper_bound_log2_abs_approximator_object() const { - return Upper_bound_log2_abs_approximator(this->ptr()->_m_kernel); + return Upper_bound_log2_abs_approximator(this->ptr()->_m_kernel); } // TODO: Look whether this is best possible class Bound_creator { - + public: - - Bound_creator() {} - - Bound operator() (Integer x,long p) { + + Bound_creator() {} + + Bound operator() (Integer x,long p) { Integer num=x, denom,two(2),q,r; if(p < 0) { CGAL::div_mod(num,two,q,r); @@ -416,12 +416,12 @@ class Bitstream_descartes_rndl_tree_traits denom=1; } Bound b(num); - b /= Bound(denom); + b /= Bound(denom); CGAL::simplify(b); return b; - } + } }; - + typedef typename CGAL::Real_embeddable_traits::Sgn Sign; typedef typename CGAL::internal::Real_embeddable_extension ::Ceil_log2_abs Ceil_log2_abs_Integer; @@ -429,7 +429,7 @@ class Bitstream_descartes_rndl_tree_traits ::Ceil_log2_abs Ceil_log2_abs_long; }; // end of class Bitstream_descartes_rndl_tree_traits - + } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index 2cbb256328f0..a0747b89dd28 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -59,35 +59,35 @@ namespace CGAL { -template class Curve_analysis_2; namespace internal { -template +template struct Is_derived_from_Handle_with_policy { typedef boost::false_type Tag; }; - -template + +template struct Is_derived_from_Handle_with_policy { typedef typename boost::is_base_of< CGAL::Handle_with_policy < typename Comparable::T, - typename Comparable::Handle_policy, + typename Comparable::Handle_policy, typename Comparable::Allocator >, - Comparable + Comparable >::type Tag; }; -template struct Compare_for_vert_line_map_ +template struct Compare_for_vert_line_map_ { bool operator() (const Comparable& a, const Comparable& b) const { - return a @@ -100,7 +100,7 @@ template template struct Compare_for_vert_line_map : public CGAL::cpp98::binary_function { - + BOOST_MPL_HAS_XXX_TRAIT_DEF(T) BOOST_MPL_HAS_XXX_TRAIT_DEF(Handle_policy) BOOST_MPL_HAS_XXX_TRAIT_DEF(Allocator) @@ -110,7 +110,7 @@ template struct Compare_for_vert_line_map has_T::value && has_Handle_policy::value && has_Allocator::value>::Tag Tag; - + public: bool operator() (const Comparable& a, const Comparable& b) const { @@ -119,9 +119,9 @@ template struct Compare_for_vert_line_map } private: - + Compare_for_vert_line_map_ eval; - + }; @@ -136,27 +136,27 @@ class Curve_analysis_2_rep { //! the class itself typedef Curve_analysis_2_rep Self; - + //! The handle class typedef CGAL::Curve_analysis_2 Handle; - + //protected: public: typedef int size_type; - + CGAL_ACK_SNAP_ALGEBRAIC_CURVE_KERNEL_2_TYPEDEFS(Handle); - typedef std::map< Bound, Status_line_1 > + typedef std::map< Bound, Status_line_1 > Vert_line_at_rational_map; - - typedef - std::map< Algebraic_real_1, - Status_line_1, + + typedef + std::map< Algebraic_real_1, + Status_line_1, internal::Compare_for_vert_line_map > Vert_line_map; - + //!\name Constructors //!@{ @@ -164,17 +164,17 @@ class Curve_analysis_2_rep { Curve_analysis_2_rep() { } - + //! Constructor with polynomial Curve_analysis_2_rep(Algebraic_kernel_with_analysis_2 *kernel, - Polynomial_2 poly, - CGAL::Degeneracy_strategy strategy) : + Polynomial_2 poly, + CGAL::Degeneracy_strategy strategy) : _m_kernel(kernel), f(poly), degeneracy_strategy(strategy) { } - + //!@} - + private: typedef internal::LRU_hashed_map< @@ -184,9 +184,9 @@ class Curve_analysis_2_rep { Intermediate_cache intermediate_cache; - typedef internal::Event_line_builder + typedef internal::Event_line_builder Event_line_builder; - + // Internal information struct about x-coordinates struct Event_coordinate_1 { @@ -200,7 +200,7 @@ class Curve_analysis_2_rep { size_type index_of_prim_lcoeff_root; boost::optional stack; }; - + // Functor to get the X_coordinate of an Event_coordinate struct Val_functor { typedef Event_coordinate_1 argument_type; @@ -212,7 +212,7 @@ class Curve_analysis_2_rep { //! The object holding the information about events, as an optional - mutable boost::optional > + mutable boost::optional > event_coordinates; //! The algebraic kernel to use @@ -233,19 +233,19 @@ class Curve_analysis_2_rep { * only without vertical line components. */ mutable boost::optional f_primitive; - + //! the polynomial containing all roots of the resultant of the primitive //! part of f and its y-derivative - mutable boost::optional + mutable boost::optional resultant_of_primitive_and_derivative_y; //! the polynomial containing all roots of the resultant of the primitive //! part of f and its x-derivative - mutable boost::optional + mutable boost::optional resultant_of_primitive_and_derivative_x; //! The Sturm-Habicht polynomials of f - mutable boost::optional > + mutable boost::optional > sturm_habicht_of_primitive; //! The content of f @@ -261,16 +261,16 @@ class Curve_analysis_2_rep { mutable boost::optional has_vertical_component; //! The intermediate values - mutable boost::optional > > + mutable boost::optional > > intermediate_values; //! stores Y_values at rational coordinate mutable Vert_line_at_rational_map vert_line_at_rational_map; - + //! stores vert_lines mutable Vert_line_map vert_line_map; - /**! \brief Information about whether arcs at +/- infty + /**! \brief Information about whether arcs at +/- infty * are asymptotic to y=beta, * or go to +/- infty also in y-direction */ @@ -286,54 +286,54 @@ class Curve_analysis_2_rep { /*! - * \brief Analysis for algebraic curves of arbitrary degree. + * \brief Analysis for algebraic curves of arbitrary degree. * * This class constitutes a model for the concept * AlgebraicKernelWithAnalysis_d_2::CurveAnalysis_2. * For a square-free bivariate polynomial \c f, a topologic-geometrical * analysis of the algebraic curve defined by the vanishing set of \c f * is provided. This means, one can ask for the total number, and the position - * of the critical x-coordinates of the curve, and for each x-coordinate, + * of the critical x-coordinates of the curve, and for each x-coordinate, * geometric information about the curve can be obtained. This data * is capsuled into an object of type \c Curve_analysis_2::Status_line_1, * which is in fact a \c Status_line_CA_1 object. * * The restriction to square-free curves is a weak one, since the curves - * can be made square-free before passed to the analysis. + * can be made square-free before passed to the analysis. * The \c Construct_curve_2 functor of \c Algebraic_curve_kernel_2 is * doing so, thus it accepts arbitrary bivariate polynomials. * * The analysis is implemented in a "lazy" fashion. This means, when * created, the analysis delays all computations until the information * is queried for the first time. This means, if only parts of the curves - * are of interest, only a partial analysis is performed. + * are of interest, only a partial analysis is performed. * We remark that nevertheless, the global \e projection \e step * (i.e., computing the (sub)resultants) must be done once a \c Status_line_1 * is queried. Often, this step forms the bottleneck in the whole computation. * * For more details of the algorithm, consult the reference: - * A.Eigenwillig, M.Kerber, N.Wolpert: Fast and Exact Geometric Analysis of - * Real Algebraic Plane Curves. Proceedings of the International Symposium + * A.Eigenwillig, M.Kerber, N.Wolpert: Fast and Exact Geometric Analysis of + * Real Algebraic Plane Curves. Proceedings of the International Symposium * on Symbolic and Algebraic Computation (ISSAC 2007), pp. 151-158 */ -template +template > class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { - + //! \name typedefs //! @{ public: //! this instance' first template parameter typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2; - + //! this instance' second template parameter typedef Rep_ Rep; private: - + //! The internal type for event coordinates typedef typename Rep::Event_coordinate_1 Event_coordinate_1; @@ -342,15 +342,15 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { // Base class typedef ::CGAL::Handle_with_policy Base; - + // This type typedef CGAL::Curve_analysis_2 Self; - + public: //! Indexing type typedef typename Rep::size_type size_type; - + CGAL_ACK_SNAP_ALGEBRAIC_CURVE_KERNEL_2_TYPEDEFS(Self); //! Required by the CurveKernel_2 concept @@ -382,7 +382,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: //! Type to represent points on curves - typedef typename Algebraic_kernel_with_analysis_2::Algebraic_real_2 + typedef typename Algebraic_kernel_with_analysis_2::Algebraic_real_2 Algebraic_real_2; //! Required by the CurveKernel_2 concept @@ -397,7 +397,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { //! \name Helping structs // @{ - + struct Event_functor { Event_functor(const Self* curve) : curve(curve) {} const Self* curve; @@ -436,18 +436,18 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { //! @{ //! Iterator type for status lines at events - typedef boost::transform_iterator > + typedef boost::transform_iterator > Event_line_iterator; //! Iterator type for status lines of intervals - typedef boost::transform_iterator > + typedef boost::transform_iterator > Intermediate_line_iterator; //! Iterator type for the principal sturm habicht coefficients of the curve - typedef boost::transform_iterator > + typedef boost::transform_iterator > Principal_sturm_habicht_iterator; //! @} @@ -455,31 +455,31 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: //!\name Constructors - //!@{ - + //!@{ + //! Default constructor, constructs an empty and invalid curve analysis Curve_analysis_2() :Base(Rep()) { } - /*! + /*! * \brief Constructs the curve analysis for the given polynomial * * Analyses the curve that is defined by the vanishing set of the - * polynomial \c f. + * polynomial \c f. * \pre \c f is square free. - * \param strategy The default strategy + * \param strategy The default strategy * (\c SHEAR_ONLY_AT_IRRATIONAL_STRATEGY) * is to \c shear the curve * if a degenerate situation is detected during the analysis, * except at rational x-coordinates where the curve can be analysed * more directly. The analysis * is then performed in the sheared system, and finally translated back - * into the original system. + * into the original system. * Using \c SHEAR_STRATEGY, a shear is triggered also for degeneracies * at rational x-coordinate. With both strategies, it is guaranteed that * the analysis works successfully for any square free input curve. * On the other hand, the EXCEPTION_STRATEGY throws an exception of type - * \c internal::Zero_resultant_exception, + * \c internal::Zero_resultant_exception, * instead of performing a shear. * * \Todo Currently the defualt strategy has been changed to SHEAR_STRATEGY @@ -489,7 +489,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { explicit Curve_analysis_2(Algebraic_kernel_with_analysis_2 *kernel, const Polynomial_2& f, CGAL::Degeneracy_strategy strategy - = CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY) + = CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY) : Base(Rep(kernel,f,strategy)) { @@ -498,7 +498,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { //! \brief Copy constructor #ifdef DOXYGEN_RUNNING Curve_analysis_2(const Self& alg_curve) - : Base(static_cast(alg_curve)) + : Base(static_cast(alg_curve)) { } #endif @@ -523,11 +523,11 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { InputIterator1 event_end, InputIterator2 intermediate_begin, InputIterator2 CGAL_precondition_code(intermediate_end)) const { - + if(! this->ptr()->event_coordinates) { - + std::vector event_coordinate_vector; - + for(InputIterator1 it = event_begin; it != event_end; it++) { Event_coordinate_1 curr_event; curr_event.val = it->x(); @@ -539,7 +539,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { InputIterator1 it1 = event_begin; for(size_type i = 0; i < number_of_status_lines_with_event() ; i++ ) { - this->ptr()->vert_line_map[event_coordinates()[i].val] = *it1; + this->ptr()->vert_line_map[event_coordinates()[i].val] = *it1; event_coordinates()[i].stack = *it1; it1++; @@ -547,26 +547,26 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { CGAL_assertion(it1 == event_end); if(! this->ptr()->intermediate_values) { - this->ptr()->intermediate_values + this->ptr()->intermediate_values = std::vector > (number_of_status_lines_with_event()+1); } InputIterator2 it2 = intermediate_begin; - for(size_type i = 0; - i < static_cast(intermediate_values().size()); + for(size_type i = 0; + i < static_cast(intermediate_values().size()); i++,it2++) { - + CGAL_assertion(it2->x().is_rational()); Bound q = it2->x().rational(); - + intermediate_values()[i] = q; this->ptr()->vert_line_map[it2->x()] = *it2; this->ptr()->vert_line_at_rational_map[q] = *it2; - + } CGAL_assertion(it2 == intermediate_end); - + } public: @@ -576,9 +576,9 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { bool has_defining_polynomial() const { return bool(this->ptr()->f); } - + public: - + /*! \brief Sets the defining polynomial. * * \pre The object has no defining polynomial yet. @@ -594,9 +594,9 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * \brief Returns whether the curve is y-regular - * + * * A curve is called y-regular if the leading coefficient of its defining * polynomial wrt y is a constant, i.e., contains no x */ @@ -608,7 +608,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { #endif return CGAL::degree(CGAL::leading_coefficient(polynomial_2())) == 0; } - + public: /*! @@ -624,10 +624,10 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } #endif if(is_y_regular()) { - this->ptr()->has_vertical_component = false; + this->ptr()->has_vertical_component = false; } if(! this->ptr()->has_vertical_component) { - // This is computed as side effect + // This is computed as side effect // when the event coordinates are computed event_coordinates(); CGAL_assertion(this->ptr()->has_vertical_component); @@ -645,7 +645,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * \brief Returns the number of event lines of the curve * * Algebraically, the number of real roots of the discriminant of @@ -660,13 +660,13 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { #endif return static_cast(event_coordinates().size()); } - + public: - /*! + /*! * \brief Returns whether the given x-coordinate is critical for the curve * and which event or interval index the x-coordinate belongs to. - * + * * \param is_event is set to \c true if the curve has an event * at this x-coordinate, or in other words, if the discriminant of its * defining polynomial vanishes at \c x @@ -682,14 +682,14 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { CGAL_precondition(has_defining_polynomial()); typename Rep::Val_functor xval; i = static_cast(std::lower_bound( - ::boost::make_transform_iterator(event_coordinates().begin(), + ::boost::make_transform_iterator(event_coordinates().begin(), xval), ::boost::make_transform_iterator(event_coordinates().end(), xval), x - ) - ::boost::make_transform_iterator(event_coordinates().begin(), + ) - ::boost::make_transform_iterator(event_coordinates().begin(), xval)); - is_event = (i < static_cast(event_coordinates().size()) && + is_event = (i < static_cast(event_coordinates().size()) && (event_coordinates()[i].val == x) ); } @@ -705,21 +705,21 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } #endif CGAL_precondition_code( - size_type n = + size_type n = static_cast(event_coordinates().size()); ); CGAL_precondition(i>=0 && iptr()->vert_line_map[event_coordinates()[i].val] - = event_line; + this->ptr()->vert_line_map[event_coordinates()[i].val] + = event_line; event_coordinates()[i].stack = event_line; } CGAL_postcondition(event_coordinates()[i].stack.get().is_event()); return event_coordinates()[i].stack.get(); } - -public: + +public: //! Returns a status line at the rational x-coordinate \c b Status_line_1& status_line_at_exact_x(Bound b) const { @@ -738,38 +738,38 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { * is not an event of the curve * * This function controls the internal cache that stores already created - * status line at non-events. + * status line at non-events. */ - Status_line_1& status_line_at_exact_non_event_x(Algebraic_real_1 alpha) + Status_line_1& status_line_at_exact_non_event_x(Algebraic_real_1 alpha) const { if(alpha.is_rational()) { - + typename Rep::Vert_line_at_rational_map::iterator it = this->ptr()->vert_line_at_rational_map.find (alpha.rational()); - + if (it != this->ptr()->vert_line_at_rational_map.end()) { CGAL_assertion(!it->second.is_event()); return it->second; } } - + typename Rep::Vert_line_map::iterator it = this->ptr()->vert_line_map.find(alpha); - + if (it != this->ptr()->vert_line_map.end()) { CGAL_assertion(!it->second.is_event()); return it->second; } - - + + // Not stored yet, so create it and store it - Status_line_1 cvl + Status_line_1 cvl = create_status_line_at_non_event(alpha); CGAL_assertion(!cvl.is_event()); this->ptr()->vert_line_map[alpha] = cvl; - + if(alpha.is_rational()) { this->ptr()->vert_line_at_rational_map[alpha.rational()] = cvl; } @@ -797,21 +797,21 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } private: - + // Creates a status line for the curve's indexth critical point - Status_line_1 create_status_line_at_event(size_type index) const + Status_line_1 create_status_line_at_event(size_type index) const { Event_coordinate_1& event = event_coordinates()[index]; - + Algebraic_real_1 x = event.val; - + try { - + Event_coordinate_1& event = event_coordinates()[index]; - + Algebraic_real_1 x = event.val; - + #if CGAL_ACK_SHEAR_ALL_NOT_Y_REGULAR_CURVES if(event.mult_of_prim_lcoeff_root > 0) { throw CGAL::internal::Non_generic_position_exception(); @@ -823,9 +823,9 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { throw CGAL::internal::Non_generic_position_exception(); } } - + #endif - + #if CGAL_ACK_DEBUG_FLAG double ev_approx = CGAL::to_double(x); CGAL_ACK_DEBUG_PRINT << (index+1) << "th line: " @@ -833,29 +833,29 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { << ev_approx << ".." << std::flush; -#endif - size_type left_arcs +#endif + size_type left_arcs = status_line_for_x(x,CGAL::NEGATIVE).number_of_events(); - size_type right_arcs + size_type right_arcs = status_line_for_x(x,CGAL::POSITIVE).number_of_events(); - + bool root_of_resultant=(event.mult_of_prim_res_root>0); bool root_of_content=(event.mult_of_content_root>0); - + size_type mult_of_resultant = event.mult_of_prim_res_root; /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Event line for " << index << " " - << root_of_resultant << " " - << root_of_content << " " - << mult_of_resultant << " " - << left_arcs << " " << right_arcs + CGAL_ACK_DEBUG_PRINT << "Event line for " << index << " " + << root_of_resultant << " " + << root_of_content << " " + << mult_of_resultant << " " + << left_arcs << " " << right_arcs << std::endl; #endif */ - Status_line_1 ev_line + Status_line_1 ev_line = event_line_builder().create_event_line(index, x, left_arcs, @@ -863,7 +863,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { root_of_resultant, root_of_content, mult_of_resultant); - + event.stack = ev_line; #if CGAL_ACK_DEBUG_FLAG @@ -877,17 +877,17 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { throw CGAL::internal::Non_generic_position_exception(); break; } - // Feature does not working atm + // Feature does not working atm case(CGAL::SHEAR_ONLY_AT_IRRATIONAL_STRATEGY): { - CGAL_error_msg("Currently not supported"); - /* - if(x.is_rational()) { + CGAL_error_msg("Currently not supported"); + /* + if(x.is_rational()) { return create_non_generic_event_at_rational(x,index); } - // FALL INTO NEXT CASE - */ + // FALL INTO NEXT CASE + */ } - case(CGAL::SHEAR_STRATEGY): { + case(CGAL::SHEAR_STRATEGY): { return create_non_generic_event_with_shear(index); break; } @@ -902,8 +902,8 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { private: - /* - * \brief Method to create a status line using shear and backshear + /* + * \brief Method to create a status line using shear and backshear * * Note that this methods creates all event lines of the object * at once, and stores them in the object. @@ -919,7 +919,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { try { s = shear_controller.get_shear_factor(); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Trying shear factor " + CGAL_ACK_DEBUG_PRINT << "Trying shear factor " << s << std::endl; #endif // TODO: Move shear somewhere else @@ -927,7 +927,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { CGAL::internal::shear (primitive_polynomial_2(),Coefficient(s)), CGAL::EXCEPTION_STRATEGY); - Shear_transformation< Algebraic_kernel_with_analysis_2 > + Shear_transformation< Algebraic_kernel_with_analysis_2 > shear_transformation(kernel()); shear_transformation.report_sheared_disc_roots (boost::make_transform_iterator( @@ -935,26 +935,26 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { typename Rep::Val_functor()), boost::make_transform_iterator( event_coordinates().end(), - typename Rep::Val_functor()) + typename Rep::Val_functor()) ); - + // Store the sheared curve for later use this->ptr()->sheared_curves.insert(std::make_pair(s,D)); shear_transformation(D,-s,(Self&)*this,false); set_vertical_line_components(); - + break; } catch(CGAL::internal::Non_generic_position_exception /* err */) { shear_controller.report_failure(s); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Bad shear factor, retrying..." + CGAL_ACK_DEBUG_PRINT << "Bad shear factor, retrying..." << std::endl; #endif } } - + return status_line_at_event(index); } @@ -968,26 +968,26 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { * the square free part of the defining polynomial at this position. * * COMMENTED OUT - + Status_line_1 create_non_generic_event_at_rational(Algebraic_real_1 x, size_type index) const { - + #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Non-generic, rational position x = " + CGAL_ACK_DEBUG_PRINT << "Non-generic, rational position x = " << CGAL::to_double(x) << std::flush; #endif - + CGAL_precondition(x.is_rational()); Bound r = x.rational(); - Polynomial_1 f_at_x = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() - (primitive_polynomial_2(),0, 1), - r); - - f_at_x_sq_free + Polynomial_1 f_at_x = kernel()->evaluate_utcf_2_object() + (typename Polynomial_traits_2::Swap() + (primitive_polynomial_2(),0, 1), + r); + + f_at_x_sq_free = typename CGAL::Polynomial_traits_d ::Make_square_free() (f_at_x); @@ -995,9 +995,9 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { Bitstream_traits traits(coeff_kernel); // We need to make an artificial bivariate polynomial - typedef typename + typedef typename CGAL::Polynomial_traits_d - ::template Rebind::Other::Type + ::template Rebind::Other::Type Poly_coer_num_2; std::vector coeffs; @@ -1009,7 +1009,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { Bitstream_descartes isolator(CGAL::internal::Square_free_descartes_tag(), f_at_x_ext, traits); - + // Now adjacencies std::vector bucket_borders; @@ -1033,73 +1033,73 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { Algebraic_real_1(isolator.left_bound(i))) ); } - + bucket_borders.push_back( CGAL::internal::bound_right_of (kernel(), - Algebraic_real_1(isolator.right_bound(n-1)))); + Algebraic_real_1(isolator.right_bound(n-1)))); } Bound left = bound_value_in_interval(index); Bound right = bound_value_in_interval(index+1); - + typedef boost::numeric::interval Coercion_interval; typename Coercion::Cast cast; for(int i = 0; i < static_cast(bucket_borders.size()); i++) { - - Poly_coer_1 curr_pol + + Poly_coer_1 curr_pol = primitive_polynomial_2().evaluate(bucket_borders[i]); - - CGAL::internal::Interval_evaluate_1 - - interval_evaluate_1; + + CGAL::internal::Interval_evaluate_1 + + interval_evaluate_1; while(true) { - std::pair curr_interval_pair + std::pair curr_interval_pair = interval_evaluate_1(curr_pol,std::make_pair(left,right)); - Coercion_interval curr_interval(curr_interval_pair.first, - curr_interval_pair.second); - - if(boost::numeric::in_zero(curr_interval)) { - // "refine" - Bound middle = (left+right)/2; - if(middle==r) { - left=(left+middle)/2; - right = (right+middle)/2; - } else if(middle>r) { - right=middle; - } else { - left=middle; - } - } else { - break; - } + Coercion_interval curr_interval(curr_interval_pair.first, + curr_interval_pair.second); + + if(boost::numeric::in_zero(curr_interval)) { + // "refine" + Bound middle = (left+right)/2; + if(middle==r) { + left=(left+middle)/2; + right = (right+middle)/2; + } else if(middle>r) { + right=middle; + } else { + left=middle; + } + } else { + break; + } } } - Status_line_1 left_line + Status_line_1 left_line = status_line_at_exact_non_event_x(Algebraic_real_1(left)), - right_line + right_line = status_line_at_exact_non_event_x(Algebraic_real_1(right)); - + int n_left = left_line.number_of_events(); int n_right = right_line.number_of_events(); - + std::vector left_arcs(bucket_borders.size()+1), right_arcs(bucket_borders.size()+1); - + for(unsigned int i=0;i(bucket_borders.size())) { left_arcs[curr_index]++; @@ -1118,7 +1118,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } curr_index=0; for(int i=0; i < n_right; i++) { - + while(true) { if(curr_index==static_cast(bucket_borders.size())) { right_arcs[curr_index]++; @@ -1136,14 +1136,14 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } } - + typename Status_line_1::Arc_container arc_container; - + for(int i = 0; i < n; i++) { arc_container.push_back(std::make_pair(left_arcs[i+1], right_arcs[i+1])); } - + Status_line_1 status_line(x,index,*this,n_left,n_right,arc_container); status_line._set_number_of_branches_approaching_infinity @@ -1166,8 +1166,8 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! - * \brief Returns the status line for the interval + /*! + * \brief Returns the status line for the interval * preceeding the ith event * * Returns a status line for a reference x-coordinate of the ith @@ -1177,23 +1177,23 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { Status_line_1 status_line_of_interval(size_type i) const { CGAL_precondition(i >= 0 && i <= number_of_status_lines_with_event()); - + #if CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX if(CGAL::degree(polynomial_2(),1)==2) { return this->conic_status_line_of_interval(i); } #endif - + Bound b = bound_value_in_interval(i); - - Status_line_1 intermediate_line + + Status_line_1 intermediate_line = status_line_at_exact_non_event_x(Algebraic_real_1(b)); CGAL_postcondition(! intermediate_line.is_event()); return intermediate_line; } - + public: @@ -1208,8 +1208,8 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { * the status line for the event is returned. Otherwise, the status line * for the left or right neighboring interval is returned, depending * on whether \c perturb is set to \c CGAL::NEGATIVE or \c CGAL::POSITIVE. - * If \c x is not an event, \c perturb has no effect. - */ + * If \c x is not an event, \c perturb has no effect. + */ Status_line_1 status_line_for_x(Algebraic_real_1 x, CGAL::Sign perturb = CGAL::ZERO) const { @@ -1227,7 +1227,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { return status_line_at_event(i); if(perturb == CGAL::POSITIVE) i++; - } + } return status_line_of_interval(i); } @@ -1239,13 +1239,13 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { * * It is required that none of the following situations occurs at position * ar: singularity, vertical tangent line, vertical asymptote.\n - * Otherwise, the method might run into an infinite loop. - * + * Otherwise, the method might run into an infinite loop. + * * \param index if set to -1, the interval containing \c ar is computed * within the method, and the index of the status line is set accordingly. */ Status_line_1 - create_status_line_at_non_event(Algebraic_real_1 ar, int index = -1) + create_status_line_at_non_event(Algebraic_real_1 ar, int index = -1) const { if(index==-1) { @@ -1255,13 +1255,13 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } CGAL_assertion(index>=0); - // TODO .. delay creation of refinement object + // TODO .. delay creation of refinement object // especially when ar is rational - + Bitstream_coefficient_kernel coeff_kernel(kernel(),ar); Bitstream_traits traits(coeff_kernel); - Bitstream_descartes + Bitstream_descartes bitstream_descartes(CGAL::internal::Square_free_descartes_tag(), primitive_polynomial_2(), traits); @@ -1270,7 +1270,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { Status_line_1 status_line(ar, index, *this, root_number); status_line.set_isolator(bitstream_descartes); - + CGAL_assertion(! status_line.is_event()); return status_line; @@ -1284,13 +1284,13 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { * Note: So far, a new instance is created each time the function is called */ Event_line_builder event_line_builder() const { - + return Event_line_builder(kernel(), *this, primitive_polynomial_2()); } public: - /*! + /*! * \brief Number of arcs over the given interval * * Shortcut for status_line_of_interval(i).number_of_events() @@ -1303,7 +1303,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } #endif CGAL_assertion_code( - size_type n + size_type n = static_cast(intermediate_values().size()); ); CGAL_precondition(i>=0 && i<=n); @@ -1312,7 +1312,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * \brief Rational number in the ith interval between events * * The result of this method is taken as the reference x-coordinate @@ -1324,7 +1324,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { return this->conic_bound_value_in_interval(i); } #endif - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (intermediate_values().size())); if(! intermediate_values()[i]) { @@ -1334,19 +1334,19 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { intermediate_values()[0]=Bound(0); } else { if(i==0) { - intermediate_values()[i] - = bound_left_of(kernel(),event_coordinates()[i].val); + intermediate_values()[i] + = bound_left_of(kernel(),event_coordinates()[i].val); } else if(i == static_cast (event_coordinates().size())) { - intermediate_values()[i] + intermediate_values()[i] = bound_right_of - (kernel(),event_coordinates()[i-1].val); - + (kernel(),event_coordinates()[i-1].val); + } else { intermediate_values()[i] - = kernel()->bound_between_1_object() - (event_coordinates()[i-1].val, - event_coordinates()[i].val); + = kernel()->bound_between_1_object() + (event_coordinates()[i-1].val, + event_coordinates()[i].val); } } } @@ -1356,7 +1356,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * Returns the content of the defining polynomial * * The content is the gcd of its coefficients (the polynomial is considered @@ -1376,9 +1376,9 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * Returns the primitive part of the defining polynomial - * + * * The primitive part of \c f is the \c f divided by its content. */ Polynomial_2 primitive_polynomial_2() const { @@ -1407,12 +1407,12 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Computing the content..." << std::flush; #endif - this->ptr()->content + this->ptr()->content = typename CGAL::Polynomial_traits_d< Polynomial_2 >:: Univariate_content_up_to_constant_factor()( polynomial_2() ); if(CGAL::degree(content())==0) { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "no vertical lines as components" + CGAL_ACK_DEBUG_PRINT << "no vertical lines as components" << std::endl; #endif this->ptr()->f_primitive=polynomial_2(); @@ -1425,7 +1425,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { CGAL_assertion( typename CGAL::Polynomial_traits_d< Polynomial_1 > ::Is_square_free()(content())); this->ptr()->f_primitive=polynomial_2() / content(); - + } } @@ -1433,23 +1433,23 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { private: //! Returns the Sturm-Habicht sequence of the primitive part of f - std::vector& sturm_habicht_of_primitive() const + std::vector& sturm_habicht_of_primitive() const { if(! this->ptr()->sturm_habicht_of_primitive) { compute_sturm_habicht_of_primitive(); - } + } return this->ptr()->sturm_habicht_of_primitive.get(); } -public: +public: - /*! - * \brief Returns the ith Sturm-Habicht polynomial + /*! + * \brief Returns the ith Sturm-Habicht polynomial * of the primitive part of the defining polynomial */ - Polynomial_2 sturm_habicht_of_primitive(size_type i) const + Polynomial_2 sturm_habicht_of_primitive(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (sturm_habicht_of_primitive().size())); return sturm_habicht_of_primitive()[i]; @@ -1457,13 +1457,13 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * \brief Returns the ith principal Sturm-Habicht coefficient * of the primitive part of the defining polynomial */ Polynomial_1 principal_sturm_habicht_of_primitive(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (sturm_habicht_of_primitive().size())); @@ -1476,7 +1476,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * \brief Returns the ith coprincipal Sturm-Habicht coefficient * of the primitive part of the defining polynomial * @@ -1485,7 +1485,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { */ Polynomial_1 coprincipal_sturm_habicht_of_primitive(size_type i) const { - CGAL_assertion(i>=1 && + CGAL_assertion(i>=1 && i < static_cast (sturm_habicht_of_primitive().size())); CGAL_assertion(CGAL::degree(sturm_habicht_of_primitive()[i])<=i); @@ -1497,7 +1497,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: - /*! + /*! * \brief Returns an iterator to the principal Sturm-Habicht coefficients, * starting with the 0th one (the resultant) */ @@ -1520,19 +1520,19 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { // Internal method to compute the Sturm-Habicht sequence void compute_sturm_habicht_of_primitive() const { - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Compute Sturm-Habicht.." << std::flush; #endif std::vector stha; - + // Fix a problem for constant primitive part. // In this case, the St.-Ha. sequence is never needed if(CGAL::degree(primitive_polynomial_2()) == 0) { // Set the resultant stha.push_back(primitive_polynomial_2()); } else { - + #if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS #warning USES BEZOUT MATRIX FOR SUBRESULTANTS CGAL::internal::bezout_polynomial_subresultants @@ -1549,7 +1549,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { stha[i] = -stha[i]; } } - + #else typename Polynomial_traits_2::Sturm_habicht_sequence() (primitive_polynomial_2(),std::back_inserter(stha)); @@ -1564,12 +1564,12 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { (polynomial_2()); } } - + this->ptr()->sturm_habicht_of_primitive = stha; CGAL_assertion(CGAL::canonicalize - (resultant_of_primitive_and_derivative_y()) == + (resultant_of_primitive_and_derivative_y()) == CGAL::canonicalize - (principal_sturm_habicht_of_primitive(0))); + (principal_sturm_habicht_of_primitive(0))); #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif @@ -1601,7 +1601,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { // Computes res_y(f,f_y), where \c f is the defining polynomial void compute_resultant_of_primitive_and_derivative_y() const { - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Compute resultant.." << std::flush; #endif @@ -1612,24 +1612,24 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { #ifndef CGAL_ACK_RESULTANT_FIRST_STRATEGY_DEGREE_THRESHOLD bool speed_up = true; #else - bool speed_up=CGAL::degree(polynomial_2()) >= + bool speed_up=CGAL::degree(polynomial_2()) >= CGAL_ACK_RESULTANT_FIRST_STRATEGY_DEGREE_THRESHOLD; #endif #else bool speed_up=false; #endif - + if(CGAL::degree(polynomial_2()) == 0) { - this->ptr()->resultant_of_primitive_and_derivative_y + this->ptr()->resultant_of_primitive_and_derivative_y = Polynomial_1(1); } else { - + if(! speed_up) { - + // Compute resultant using the Sturm-Habicht sequence - this->ptr()->resultant_of_primitive_and_derivative_y + this->ptr()->resultant_of_primitive_and_derivative_y = principal_sturm_habicht_of_primitive(0); - + } else { typename Polynomial_traits_2::Differentiate diff; this->ptr()->resultant_of_primitive_and_derivative_y @@ -1649,11 +1649,11 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { (polynomial_2()); } } - + // Computes res_y(f,f_x), where \c f is the defining polynomial void compute_resultant_of_primitive_and_derivative_x() const { - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Compute x-resultant.." << std::flush; #endif @@ -1661,19 +1661,19 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { CGAL_assertion(has_defining_polynomial()); // Transpose the polynomial - Polynomial_2 f_yx = typename Polynomial_traits_2::Swap() + Polynomial_2 f_yx = typename Polynomial_traits_2::Swap() (polynomial_2(),0,1); if( CGAL::degree(f_yx) == 0 ) { // Polynomial only consists of horizontal lines // primitive resultant is set to 1 - this->ptr()->resultant_of_primitive_and_derivative_x + this->ptr()->resultant_of_primitive_and_derivative_x = Polynomial_1(1); } else { - + Polynomial_2 f_yx_primitive; - - Polynomial_1 content_yx + + Polynomial_1 content_yx = typename CGAL::Polynomial_traits_d< Polynomial_2 >:: Univariate_content_up_to_constant_factor()( f_yx ); if(CGAL::degree(content_yx)==0) { @@ -1684,16 +1684,16 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { (typename CGAL::Polynomial_traits_d< Polynomial_1 >:: Is_square_free()(content_yx)); f_yx_primitive=f_yx / content_yx; - + } - + this->ptr()->resultant_of_primitive_and_derivative_x = CGAL::resultant (typename Polynomial_traits_2::Swap() (f_yx_primitive,0,1), - typename Polynomial_traits_2::Swap() + typename Polynomial_traits_2::Swap() (CGAL::differentiate(f_yx_primitive),0,1) ); } - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif @@ -1721,7 +1721,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { private: // Returns the intermediate values for intervals between events - std::vector >& intermediate_values() const + std::vector >& intermediate_values() const { if(! this->ptr()->intermediate_values) { // This is created during event_coordiantes() @@ -1743,13 +1743,13 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { */ void compute_event_coordinates() const { - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "compute events..." << std::flush; #endif - + Solve_1 solve_1; - + std::vector > content_pairs; std::vector content_roots; std::vector content_mults; @@ -1760,7 +1760,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { content_roots.push_back(content_pairs[i].first); content_mults.push_back(content_pairs[i].second); } - + // Set the vertical_line_components flag as side effect this->ptr()->has_vertical_component = (content_roots.size() > 0); @@ -1769,7 +1769,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { std::vector res_mults; Polynomial_1 R = resultant_of_primitive_and_derivative_y(); solve_1(R,std::back_inserter(res_pairs)); - + for(int i=0; i < static_cast(res_pairs.size()); i++ ) { res_roots.push_back(res_pairs[i].first); res_mults.push_back(res_pairs[i].second); @@ -1785,10 +1785,10 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { lcoeff_roots.push_back(lcoeff_pairs[i].first); lcoeff_mults.push_back(lcoeff_pairs[i].second); } - + //Now, merge the vertical line positions with the resultant roots - typename + typename CGAL::Real_embeddable_traits::Compare compare; std::vector event_values; @@ -1803,50 +1803,50 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { std::back_inserter(event_values_info), compare); - // Now, build the Event_coordinate_1 entries + // Now, build the Event_coordinate_1 entries // for each element of event_values - size_type curr_res_index = 0, curr_content_index = 0, + size_type curr_res_index = 0, curr_content_index = 0, curr_lcoeff_index = 0; std::vector event_coordinate_vector; - for(size_type i = 0; - i < static_cast(event_values.size()); + for(size_type i = 0; + i < static_cast(event_values.size()); i++ ) { - + Event_coordinate_1 curr_event; curr_event.val = event_values[i]; switch(event_values_info[i]) { - + case(CGAL::internal::ROOT_OF_FIRST_SET): { curr_event.index_of_prim_res_root = curr_res_index; - CGAL_expensive_assertion(res_roots[curr_res_index] == + CGAL_expensive_assertion(res_roots[curr_res_index] == event_values[i]); - curr_event.mult_of_prim_res_root + curr_event.mult_of_prim_res_root = res_mults[curr_res_index]; curr_res_index++; - if(curr_lcoeff_index < + if(curr_lcoeff_index < static_cast(lcoeff_roots.size()) && event_values[i]==lcoeff_roots[curr_lcoeff_index]) { // We have a root of the leading coefficient // of the primitve polynomial curr_event.index_of_prim_lcoeff_root = curr_lcoeff_index; - curr_event.mult_of_prim_lcoeff_root + curr_event.mult_of_prim_lcoeff_root = lcoeff_mults[curr_lcoeff_index]; curr_lcoeff_index++; } else { curr_event.index_of_prim_lcoeff_root = -1; curr_event.mult_of_prim_lcoeff_root = 0; } - + curr_event.index_of_content_root = -1; curr_event.mult_of_content_root = 0; break; } case(CGAL::internal::ROOT_OF_SECOND_SET): { curr_event.index_of_content_root = curr_content_index; - CGAL_expensive_assertion(content_roots[curr_content_index] == + CGAL_expensive_assertion(content_roots[curr_content_index] == event_values[i]); - curr_event.mult_of_content_root + curr_event.mult_of_content_root = content_mults[curr_content_index]; curr_content_index++; curr_event.index_of_prim_res_root = -1; @@ -1859,18 +1859,18 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } case(CGAL::internal::ROOT_OF_BOTH_SETS): { curr_event.index_of_prim_res_root = curr_res_index; - CGAL_expensive_assertion(res_roots[curr_res_index] == + CGAL_expensive_assertion(res_roots[curr_res_index] == event_values[i]); - curr_event.mult_of_prim_res_root + curr_event.mult_of_prim_res_root = res_mults[curr_res_index]; curr_res_index++; - if(curr_lcoeff_index < + if(curr_lcoeff_index < static_cast(lcoeff_roots.size()) && event_values[i]==lcoeff_roots[curr_lcoeff_index]) { // We have a root of the leading coefficient // of the primitve polynomial curr_event.index_of_prim_lcoeff_root = curr_lcoeff_index; - curr_event.mult_of_prim_lcoeff_root + curr_event.mult_of_prim_lcoeff_root = lcoeff_mults[curr_lcoeff_index]; curr_lcoeff_index++; } else { @@ -1878,18 +1878,18 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { curr_event.mult_of_prim_lcoeff_root = 0; } curr_event.index_of_content_root = curr_content_index; - CGAL_expensive_assertion(content_roots[curr_content_index] == + CGAL_expensive_assertion(content_roots[curr_content_index] == event_values[i]); - curr_event.mult_of_content_root + curr_event.mult_of_content_root = content_mults[curr_content_index]; curr_content_index++; break; } } // of switch - /* + /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Constructed event_coordinate: " - << CGAL::to_double(curr_event.val) << " " + CGAL_ACK_DEBUG_PRINT << "Constructed event_coordinate: " + << CGAL::to_double(curr_event.val) << " " << "\nmult_of_prim_res_root : " << curr_event.mult_of_prim_res_root << "\nindex_of_prim_res_root : " @@ -1907,36 +1907,36 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { */ event_coordinate_vector.push_back(curr_event); } - - CGAL_assertion(curr_lcoeff_index == + + CGAL_assertion(curr_lcoeff_index == static_cast(lcoeff_roots.size())); - CGAL_assertion(curr_res_index == + CGAL_assertion(curr_res_index == static_cast(res_roots.size())); - CGAL_assertion(curr_content_index == + CGAL_assertion(curr_content_index == static_cast(content_roots.size())); - this->ptr()->intermediate_values + this->ptr()->intermediate_values = std::vector > (event_coordinate_vector.size()+1); this->ptr()->event_coordinates = event_coordinate_vector; - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif } -public: +public: - /*! + /*! * \brief Returns a \c Curve_analysis_2 object for a sheared curve. * * The shear factor is given by the integer \c s. * This functions only shears the primitive part of the defining equation. * Internal caching is used to avoid repeated shears. * - * \todo The sheared curves are not inserted into the curve_cache + * \todo The sheared curves are not inserted into the curve_cache * of the Algebraic_curve_kernel_2 yet. */ Self& shear_primitive_part(Integer s) const @@ -1951,14 +1951,14 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { this->ptr()->bad_shears.end()) { throw CGAL::internal::Non_generic_position_exception(); } - typedef typename std::map::iterator + typedef typename std::map::iterator Map_iterator; Map_iterator it = this->ptr()->sheared_curves.find(s); if(it != this->ptr()->sheared_curves.end()) { return it->second; } try { - Shear_transformation + Shear_transformation shear_transformation(kernel()); Self D=shear_transformation((Self&)*this, s); std::pair insertion = @@ -1971,7 +1971,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { throw CGAL::internal::Non_generic_position_exception(); } } - + public: //! Iterator for sheared curves @@ -1984,21 +1984,21 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { return this->ptr()->sheared_curves.end(); } -private: - +private: + // Sets the flag for vertical lines in all status lines that need it void set_vertical_line_components() const { - for(size_type i = 0; - i < static_cast(event_coordinates().size()); + for(size_type i = 0; + i < static_cast(event_coordinates().size()); i++ ) { - + if(event_coordinates()[i].mult_of_content_root > 0) { status_line_at_event(i)._set_v_line(); } } - + } - + public: @@ -2064,7 +2064,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { } public: - + //! \brief Iterator for the status lines for intervals Intermediate_line_iterator intermediate_begin() const { return boost::make_transform_iterator @@ -2084,19 +2084,19 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { /*! * \brief Returns the limit an infinite arc converges to * - * \pre loc==CGAL::LEFT_BOUNDARY || + * \pre loc==CGAL::LEFT_BOUNDARY || * loc==CGAL::RIGHT_BOUNDARY * * This method returns for the arcnoth arc that goes to -infinity * or +infinity (depending on \c loc) the y-coordinate it converges to. * Possible values are either a \c Algebraic_real_1 object, or one of the * values \c CGAL::TOP_BOUNDARY, \c CGAL::BOTTOM_BOUNDARY - * that denote that the arc is unbounded in y-direction. + * that denote that the arc is unbounded in y-direction. * The result is wrapped into a \c CGAL::Object object. */ Asymptote_y asymptotic_value_of_arc(CGAL::Box_parameter_space_2 loc, size_type arcno) const { - + CGAL_precondition(loc == CGAL::LEFT_BOUNDARY || loc == CGAL::RIGHT_BOUNDARY); @@ -2105,15 +2105,15 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { return this->conic_asymptotic_value_of_arc(loc,arcno); } #endif - + if(loc == CGAL::LEFT_BOUNDARY) { - + if(! this->ptr()->horizontal_asymptotes_left) { compute_horizontal_asymptotes(); } - std::vector& asym_info + std::vector& asym_info = this->ptr()->horizontal_asymptotes_left.get(); - CGAL_precondition(arcno>=0 && + CGAL_precondition(arcno>=0 && arcno(asym_info.size())); return asym_info[arcno]; } // else loc == CGAL::RIGHT_BOUNDARY @@ -2121,12 +2121,12 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { if(! this->ptr()->horizontal_asymptotes_right) { compute_horizontal_asymptotes(); } - std::vector& asym_info + std::vector& asym_info = this->ptr()->horizontal_asymptotes_right.get(); - CGAL_precondition(arcno>=0 && + CGAL_precondition(arcno>=0 && arcno(asym_info.size())); return asym_info[arcno]; - + } @@ -2134,24 +2134,24 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { // Internal method to compute horizontal asymptotes void compute_horizontal_asymptotes() const { - + // TODO: Filter out curves with no arc to +/- infty Solve_1 solve_1 = kernel()->solve_1_object(); - Polynomial_1 leading_coefficient_in_x - = CGAL::leading_coefficient(typename Polynomial_traits_2::Swap() + Polynomial_1 leading_coefficient_in_x + = CGAL::leading_coefficient(typename Polynomial_traits_2::Swap() (polynomial_2(),0,1)); std::vector roots_of_lcoeff; - + solve_1(leading_coefficient_in_x, std::back_inserter(roots_of_lcoeff), false); - + std::vector stripe_bounds; find_intermediate_values(kernel(), - roots_of_lcoeff.begin(), + roots_of_lcoeff.begin(), roots_of_lcoeff.end(), std::back_inserter(stripe_bounds)); Bound leftmost_bound = bound_value_in_interval(0), @@ -2159,36 +2159,36 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { (this->number_of_status_lines_with_event()); for(size_type i=0;i(stripe_bounds.size());i++) { Bound& beta = stripe_bounds[i]; - Polynomial_1 poly_at_beta - = kernel()->evaluate_utcf_2_object()(this->polynomial_2(),beta); + Polynomial_1 poly_at_beta + = kernel()->evaluate_utcf_2_object()(this->polynomial_2(),beta); std::vector x_coordinates_at_beta; solve_1(poly_at_beta,std::back_inserter(x_coordinates_at_beta), false); - size_type number_of_roots + size_type number_of_roots = static_cast(x_coordinates_at_beta.size()); if(number_of_roots>0) { if(leftmost_bound > x_coordinates_at_beta[0].low()) { leftmost_bound = x_coordinates_at_beta[0].low(); } - if(rightmost_bound + if(rightmost_bound < x_coordinates_at_beta[number_of_roots-1].high()) { - rightmost_bound + rightmost_bound = x_coordinates_at_beta[number_of_roots-1].high(); } - } + } } - + // Just to be sure... leftmost_bound = leftmost_bound - 1; rightmost_bound = rightmost_bound + 1; - Polynomial_1 curve_at_left_end - = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (this->polynomial_2(),0,1), - leftmost_bound); + Polynomial_1 curve_at_left_end + = kernel()->evaluate_utcf_2_object() + (typename Polynomial_traits_2::Swap() (this->polynomial_2(),0,1), + leftmost_bound); std::vector roots_at_left_end; solve_1(curve_at_left_end,std::back_inserter(roots_at_left_end),false); - size_type number_of_roots_at_left_end + size_type number_of_roots_at_left_end = static_cast(roots_at_left_end.size()); std::vector asym_left_info; size_type current_stripe=0,i=0; @@ -2202,7 +2202,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { if(roots_at_left_end[i].low() > stripe_bounds[current_stripe]) { current_stripe++; continue; - } + } if(roots_at_left_end[i].high() < stripe_bounds[current_stripe]) { if(current_stripe==0) { asym_left_info.push_back(CGAL::make_object @@ -2219,14 +2219,14 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { roots_at_left_end[i].refine(); } this->ptr()->horizontal_asymptotes_left = asym_left_info; - - Polynomial_1 curve_at_right_end - = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (this->polynomial_2(),0,1), + + Polynomial_1 curve_at_right_end + = kernel()->evaluate_utcf_2_object() + (typename Polynomial_traits_2::Swap() (this->polynomial_2(),0,1), rightmost_bound); std::vector roots_at_right_end; solve_1(curve_at_right_end,std::back_inserter(roots_at_right_end),false); - size_type number_of_roots_at_right_end + size_type number_of_roots_at_right_end = static_cast(roots_at_right_end.size()); std::vector asym_right_info; current_stripe=0; @@ -2241,7 +2241,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { if(roots_at_right_end[i].low() > stripe_bounds[current_stripe]) { current_stripe++; continue; - } + } if(roots_at_right_end[i].high() < stripe_bounds[current_stripe]) { if(current_stripe==0) { asym_right_info.push_back(CGAL::make_object @@ -2258,7 +2258,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { roots_at_right_end[i].refine(); } this->ptr()->horizontal_asymptotes_right = asym_right_info; - + } //! @} @@ -2267,22 +2267,22 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { template void get_roots_at_rational (Bound r, OutputIterator it) const { - + typename Rep::Intermediate_cache::Find_result find_result = this->ptr()->intermediate_cache.find(r); - std::vector p_roots; + std::vector p_roots; if(find_result.second) { p_roots = find_result.first->second; } else { - Polynomial_2 swapped = typename Polynomial_traits_2::Swap() - (this->polynomial_2(), 0, 1); - Polynomial_1 p = kernel()->evaluate_utcf_2_object()(swapped,r); - kernel()->solve_1_object()(p,std::back_inserter(p_roots),false); + Polynomial_2 swapped = typename Polynomial_traits_2::Swap() + (this->polynomial_2(), 0, 1); + Polynomial_1 p = kernel()->evaluate_utcf_2_object()(swapped,r); + kernel()->solve_1_object()(p,std::back_inserter(p_roots),false); this->ptr()->intermediate_cache.insert(std::make_pair(r,p_roots)); - + } std::copy(p_roots.begin(),p_roots.end(),it); } @@ -2294,7 +2294,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { #if CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX private: - + bool conic_is_y_regular() const { CGAL_error_msg("Implement me"); return false; @@ -2393,41 +2393,41 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { // another friend friend class Shear_transformation; - + //! @} }; // class Algebraic_curve_2_2 //! \brief Prints the objects. -template std::ostream& operator<< ( - std::ostream& out, - const Curve_analysis_2< AlgebraicKernelWithAnalysis_2, + std::ostream& out, + const Curve_analysis_2< AlgebraicKernelWithAnalysis_2, Rep_ >& curve) { typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2; - + typedef Rep_ Rep; - + typedef Curve_analysis_2< Algebraic_kernel_with_analysis_2, Rep > Curve; - + typedef typename Curve::size_type size_type; typedef typename Curve::Asymptote_y Asymptote_y; - - + + switch (::CGAL::get_mode(out)) { case ::CGAL::IO::PRETTY: { - + out << "--------------- Analysis results ---------------" << std::endl; - out << "Number of constructed event lines: " - << curve.number_of_status_lines_with_event() + out << "Number of constructed event lines: " + << curve.number_of_status_lines_with_event() << std::endl; out << "(Horizontal) asymptotes at -infty: " << std::flush; for (size_type i = 0; i < curve.arcs_over_interval(0); i++) { - - const Asymptote_y& curr_asym_info_obj + + const Asymptote_y& curr_asym_info_obj = curve.asymptotic_value_of_arc(CGAL::LEFT_BOUNDARY,i); typename Curve::Algebraic_real_1 curr_asym_info; bool is_finite = CGAL::assign(curr_asym_info,curr_asym_info_obj); @@ -2444,32 +2444,32 @@ std::ostream& operator<< ( out << "-infty " << std::flush; } } else { // is_finite - out << CGAL::to_double(curr_asym_info) + out << CGAL::to_double(curr_asym_info) << " " << std::flush; } } - + out << std::endl; - - out << "Intermediate line at " + + out << "Intermediate line at " << CGAL::to_double(curve.bound_value_in_interval(0)) - << ": " << curve.arcs_over_interval(0) << " passing arcs" - << std::endl + << ": " << curve.arcs_over_interval(0) << " passing arcs" + << std::endl << std::endl; - for (size_type i = 0; i < curve.number_of_status_lines_with_event(); + for (size_type i = 0; i < curve.number_of_status_lines_with_event(); i++) { out << curve.status_line_at_event(i) << std::endl; - out << "Intermediate line at " + out << "Intermediate line at " << CGAL::to_double(curve.bound_value_in_interval(i+1)) - << ": " << curve.arcs_over_interval(i+1) + << ": " << curve.arcs_over_interval(i+1) << " passing arcs" << std::endl << std::endl; } out << "(Horizontal) asymptotes at +infty: " << std::flush; size_type no_events = curve.number_of_status_lines_with_event(); for (size_type i = 0; i < curve.arcs_over_interval(no_events); i++) { - - const Asymptote_y& curr_asym_info_obj + + const Asymptote_y& curr_asym_info_obj = curve.asymptotic_value_of_arc(CGAL::RIGHT_BOUNDARY,i); typename Curve::Algebraic_real_1 curr_asym_info; bool is_finite = CGAL::assign(curr_asym_info,curr_asym_info_obj); @@ -2486,13 +2486,13 @@ std::ostream& operator<< ( out << "-infty " << std::flush; } } else { // is_finite - out << CGAL::to_double(curr_asym_info) + out << CGAL::to_double(curr_asym_info) << " " << std::flush; } } - + out << std::endl; - + out << "------------------------------------------------" << std::endl; break; } @@ -2503,23 +2503,23 @@ std::ostream& operator<< ( // ASCII out << curve.polynomial_2(); } - + return out; } //! \brief Reads the objects from stream -template std::istream& operator>> ( - std::istream& is, + std::istream& is, Curve_analysis_2< AlgebraicKernelWithAnalysis_2, Rep_ >& curve) { - + CGAL_precondition(CGAL::is_ascii(is)); - + typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2; typedef Rep_ Rep; - + typename Curve_analysis_2< Algebraic_kernel_with_analysis_2, Rep >:: Polynomial_2 f; @@ -2528,10 +2528,10 @@ std::istream& operator>> ( // TODO is get_static_instance the right way? curve = Algebraic_kernel_with_analysis_2::get_static_instance(). construct_curve_2_object()(f); - + return is; } - + } //namespace CGAL diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index 643de6dbd5d9..b20f8d7ea7ff 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Eric Berberich // Michael Kerber @@ -41,7 +41,7 @@ namespace CGAL { namespace internal { - + template class Distinct_compare { @@ -53,7 +53,7 @@ class Distinct_compare { typedef Algebraic_real_1 first_argument_type; typedef Algebraic_real_1 second_argument_type; - ::CGAL::Comparison_result operator() + ::CGAL::Comparison_result operator() (Algebraic_real_1 a,Algebraic_real_1 b) { return a.compare_distinct(b); } @@ -70,7 +70,7 @@ template < typename AlgebraicKernelWithAnalysis_2 > class Curve_pair_analysis_2; template -std::ostream& operator<< +std::ostream& operator<< (std::ostream&,const Curve_pair_analysis_2 &); @@ -90,7 +90,7 @@ enum Slice_type { * An x-event of the curve pair is either a root of a dicriminant of a single * curve, or a root of the resultant of both curves, or both. * The \c Event_indices vector stores a triple (fg,ffy,ggy) denoting - * that some event is the fg root of res(f,g,y), + * that some event is the fg root of res(f,g,y), * the ffyth root of disc(f,y) and * the ggyth root of disc(g,y). */ @@ -100,7 +100,7 @@ struct Event_indices { size_type fg; size_type ffy; size_type ggy; - Event_indices(size_type fg,size_type ffy, size_type ggy) + Event_indices(size_type fg,size_type ffy, size_type ggy) : fg(fg), ffy(ffy), ggy(ggy) {} }; @@ -117,15 +117,15 @@ class Curve_pair_analysis_2_rep { typedef Curve_pair_analysis_2 Handle; - typedef typename Algebraic_kernel_with_analysis_2::Curve_analysis_2 + typedef typename Algebraic_kernel_with_analysis_2::Curve_analysis_2 Curve_analysis_2; typedef typename Curve_analysis_2::size_type size_type; typedef typename Curve_analysis_2::Polynomial_2 Polynomial_2; - + typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; - + typedef typename Polynomial_2::NT Polynomial_1; typedef typename Curve_analysis_2::Bound Bound; @@ -148,10 +148,10 @@ class Curve_pair_analysis_2_rep { size_type mult; }; - typedef std::vector > + typedef std::vector > Intersection_info_container; - - typedef boost::optional + + typedef boost::optional Lazy_intersection_info_container; // For lazy evaluation of Status_line_CPA_1s. @@ -161,7 +161,7 @@ class Curve_pair_analysis_2_rep { //! \name Constructors //! @{ - + // DefaultConstructible Curve_pair_analysis_2_rep() : c1_(), c2_() { @@ -183,31 +183,31 @@ class Curve_pair_analysis_2_rep { //! @{ Algebraic_kernel_with_analysis_2* _m_kernel; - + Curve_analysis_2 c1_; Curve_analysis_2 c2_; Polynomial_2 f; Polynomial_2 g; - + mutable boost::optional > subresultants; - mutable boost::optional > + mutable boost::optional > principal_subresultants; - mutable boost::optional > + mutable boost::optional > coprincipal_subresultants; - + mutable boost::optional resultant; mutable boost::optional > resultant_roots; - mutable boost::optional > + mutable boost::optional > event_x_coordinates; - mutable boost::optional > + mutable boost::optional > multiplicities_of_resultant_roots; mutable boost::optional > stripe_values; - + mutable std::vector< Lazy_status_line_CPA_1 > event_slices; mutable boost::optional > intermediate_values; @@ -229,7 +229,7 @@ class Curve_pair_analysis_2_rep { //! \name friends //! @{ - + friend class Curve_pair_analysis_2; //!@} @@ -256,16 +256,16 @@ class Curve_pair_analysis_2_rep { * expensive symbolic computations in some cases. * * For all algorithmic details of the curve pair analysis, we refer to - * Arno Eigenwillig, Michael Kerber: Exact and Efficient 2D-Arrangements - * of Arbitrary Algebraic Curves. Proceedings of the Nineteenth Annual + * Arno Eigenwillig, Michael Kerber: Exact and Efficient 2D-Arrangements + * of Arbitrary Algebraic Curves. Proceedings of the Nineteenth Annual * ACM-SIAM Symposium on Discrete Algorithms (SODA 2008), pp. 122-131 */ template < typename AlgebraicKernelWithAnalysis_2 > -class Curve_pair_analysis_2 : +class Curve_pair_analysis_2 : public ::CGAL::Handle_with_policy < CGAL::internal::Curve_pair_analysis_2_rep < AlgebraicKernelWithAnalysis_2 > > { - + public: @@ -276,18 +276,18 @@ class Curve_pair_analysis_2 : typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2; private: - + //! Representation class typedef CGAL::internal::Curve_pair_analysis_2_rep < Algebraic_kernel_with_analysis_2 > Rep; - + //! Base class typedef ::CGAL::Handle_with_policy< Rep > Base; public: //! The Curve_pair_analysis_2 itself typedef Curve_pair_analysis_2 Self; - + //! The corresponding Curve_analysis_2 class typedef typename Rep::Curve_analysis_2 Curve_analysis_2; @@ -304,7 +304,7 @@ class Curve_pair_analysis_2 : typedef typename Rep::Algebraic_real_1 Algebraic_real_1; //! Type for points with algebraic coordinates - typedef typename Algebraic_kernel_with_analysis_2::Algebraic_real_2 + typedef typename Algebraic_kernel_with_analysis_2::Algebraic_real_2 Algebraic_real_2; //! Bound type (for rational numbers) @@ -314,12 +314,12 @@ class Curve_pair_analysis_2 : // Optional for boundaries typedef typename Rep::Lazy_bound Lazy_bound; - // Object to store information about intersection points - typedef typename Rep::Intersection_info_container + // Object to store information about intersection points + typedef typename Rep::Intersection_info_container Intersection_info_container; // Its lazy version - typedef typename Rep::Lazy_intersection_info_container + typedef typename Rep::Lazy_intersection_info_container Lazy_intersection_info_container; // Type for indices of events. @@ -333,20 +333,20 @@ class Curve_pair_analysis_2 : // Coefficient type typedef typename Curve_analysis_2::Coefficient Coefficient; - + // Polynomial traits class typedef CGAL::Polynomial_traits_d Polynomial_traits_2; // Polynomial traits class typedef CGAL::Polynomial_traits_d Polynomial_traits_1; - + public: - + //! The event slice object type typedef typename Rep::Status_line_CPA_1 Status_line_CPA_1; - + /*! - * Required by the concept. The name is not used internally + * Required by the concept. The name is not used internally * to distinguish from one curve status_lines syntactically */ typedef Status_line_CPA_1 Status_line_1; @@ -358,7 +358,7 @@ class Curve_pair_analysis_2 : // Coercion between Bound and Coefficient type typedef CGAL::Coercion_traits Coercion; - + // The common supertype typedef typename Coercion::Type Coercion_type; @@ -383,16 +383,16 @@ class Curve_pair_analysis_2 : //! @{ struct Curves_at_event_functor { - + typedef size_type argument_type; typedef CGAL::internal::Slice_type result_type; - Curves_at_event_functor(const Status_line_CPA_1& status_line) + Curves_at_event_functor(const Status_line_CPA_1& status_line) : status_line(status_line) {} CGAL::internal::Slice_type operator() (size_type i) const { - typedef typename Status_line_CPA_1::size_type + typedef typename Status_line_CPA_1::size_type Status_line_size_type; std::pair pair = status_line.curves_at_event(i); @@ -406,19 +406,19 @@ class Curve_pair_analysis_2 : return CGAL::internal::INTERSECTION; } private: - + const Status_line_CPA_1& status_line; - + }; - typedef boost::transform_iterator > + typedef boost::transform_iterator > Status_line_CPA_iterator; struct Xval_of_status_line_CA_1 { typedef Status_line_CA_1 argument_type; typedef Algebraic_real_1 result_type; - Algebraic_real_1 operator() (const Status_line_CA_1& status_line) + Algebraic_real_1 operator() (const Status_line_CA_1& status_line) const { return status_line.x(); } @@ -428,7 +428,7 @@ class Curve_pair_analysis_2 : //! \name Constructors //! @{ - + public: //! DefaultConstructible @@ -437,61 +437,61 @@ class Curve_pair_analysis_2 : }; //! \brief Copy constructor -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Curve_pair_analysis_2(const Self& alg_curve_pair) - : Base(static_cast(alg_curve_pair)) + : Base(static_cast(alg_curve_pair)) { } #endif // Assignable - + /*! * \brief Constructable from two curves * - * Create a curve pair object for the two curves \c c1 and \c c2, + * Create a curve pair object for the two curves \c c1 and \c c2, * given by their curve analysis object. The two curves are checked * to have no common vertical line component (if they have, an * exception of type \c CGAL::internal::Non_generic_position_exception * is thrown), no further computation is performed. * - * \param strategy If a degenerate situation (e.g., two covertical - * intersection at the same x-coordinate) occurs during the analysis, + * \param strategy If a degenerate situation (e.g., two covertical + * intersection at the same x-coordinate) occurs during the analysis, * this value controls the strategy to handle it. If set to * CGAL::EXCEPTION_STRATEGY, an exception of type * \c CGAL::internal::Non_generic_position_exception is thrown whenever * such a degeneracy occurs. If set to \c CGAL::SHEAR_STRATEGY, a shear * transformation is performed, and the sheared curve pair is used - * to handle degenerate situations. Finally, if set to + * to handle degenerate situations. Finally, if set to * CGAL::SHEAR_ONLY_AT_IRRATIONAL_STRATEGY, degeneracies at rational * x-ccordinates are handled directly, and a shear is only applied * in other situations. The default argument for \c strategy is * \c CGAL::SHEAR_ONLY_AT_IRRATIONAL_STRATEGY. */ Curve_pair_analysis_2(Algebraic_kernel_with_analysis_2* kernel, - Curve_analysis_2 c1, + Curve_analysis_2 c1, Curve_analysis_2 c2, CGAL::Degeneracy_strategy strategy - = CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY) - : Base(Rep(kernel,c1, c2, strategy)) + = CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY) + : Base(Rep(kernel,c1, c2, strategy)) { - + #if CGAL_ACK_DEBUG_FLAG CGAL::set_pretty_mode(CGAL_ACK_DEBUG_PRINT); #endif - + #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Check content for squarefreeness.." + CGAL_ACK_DEBUG_PRINT << "Check content for squarefreeness.." << std::flush; #endif if(CGAL::degree(this->ptr()->c1_.content())>0 && CGAL::degree(this->ptr()->c2_.content())>0) { typename Polynomial_traits_1::Gcd_up_to_constant_factor gcd_utcf; if(CGAL::degree(gcd_utcf - (this->ptr()->c1_.content(), + (this->ptr()->c1_.content(), this->ptr()->c2_.content())) >= 1) { - + #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Common vertical line discovered" + CGAL_ACK_DEBUG_PRINT << "Common vertical line discovered" << std::endl; #endif throw CGAL::internal::Non_generic_position_exception(); @@ -501,9 +501,9 @@ class Curve_pair_analysis_2 : #endif } } - + } - + //! @} @@ -515,15 +515,15 @@ class Curve_pair_analysis_2 : // Computes the subresultant coefficients of the defining polynomials void compute_subresultants() const; - /* + /* * Computes the roots of the resultants (via isolation) and their * multiplicities */ void compute_resultant_roots_with_multiplicities() const; - + /* - * Computes all x-events of the curve pair, - * together with their event indices + * Computes all x-events of the curve pair, + * together with their event indices */ void compute_event_x_coordinates_with_event_indices() const; @@ -559,7 +559,7 @@ class Curve_pair_analysis_2 : } Algebraic_real_1& resultant_roots(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast(resultant_roots().size())); return resultant_roots()[i]; } @@ -570,10 +570,10 @@ class Curve_pair_analysis_2 : } CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots)); return this->ptr()->multiplicities_of_resultant_roots.get(); - } - + } + size_type multiplicities_of_resultant_roots(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (multiplicities_of_resultant_roots().size())); return multiplicities_of_resultant_roots()[i]; @@ -583,10 +583,10 @@ class Curve_pair_analysis_2 : if(! this->ptr()->stripe_values) { this->ptr()->stripe_values = std::vector(); find_intermediate_values - (kernel(), - resultant_roots().begin(), - resultant_roots().end(), - std::back_inserter(this->ptr()->stripe_values.get())); + (kernel(), + resultant_roots().begin(), + resultant_roots().end(), + std::back_inserter(this->ptr()->stripe_values.get())); } CGAL_assertion(bool(this->ptr()->stripe_values)); return this->ptr()->stripe_values.get(); @@ -606,7 +606,7 @@ class Curve_pair_analysis_2 : } CGAL_assertion(bool(this->ptr()->event_indices)); return this->ptr()->event_indices.get(); - } + } public: @@ -614,17 +614,17 @@ class Curve_pair_analysis_2 : * \brief Returns the indices of the ith event value * * Returns a Event_indices (fg,ffy,ggy) such that - * the ith event root is the fgth root of the - * resultant of \c f and \c g, the ffyth root of the - * discriminant of \c f, and the ggyth root of the + * the ith event root is the fgth root of the + * resultant of \c f and \c g, the ffyth root of the + * discriminant of \c f, and the ggyth root of the * discriminant of \c g. */ Event_indices event_indices(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (event_indices().size())); return event_indices()[i]; - } + } private: @@ -656,7 +656,7 @@ class Curve_pair_analysis_2 : } Polynomial_2& subresultants(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast(subresultants().size())); return subresultants()[i]; } @@ -670,7 +670,7 @@ class Curve_pair_analysis_2 : } Polynomial_1& principal_subresultants(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (principal_subresultants().size())); return principal_subresultants()[i]; @@ -685,17 +685,17 @@ class Curve_pair_analysis_2 : } Polynomial_1& coprincipal_subresultants(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i < static_cast (coprincipal_subresultants().size())); return coprincipal_subresultants()[i]; } - + private: - /* + /* * Refines the isolating intervals until they are disjoint * Returns CGAL::SMALLER, if the y-coordinate defined by (e1,i1) * is smaller than the y-coordinate (e2,i2), @@ -711,9 +711,9 @@ class Curve_pair_analysis_2 : } else { e1.refine(i1); - } + } } - return (e1.lower_bound(i1) < e2.lower_bound(i2)) + return (e1.lower_bound(i1) < e2.lower_bound(i2)) ? CGAL::SMALLER : CGAL::LARGER; } @@ -723,14 +723,14 @@ class Curve_pair_analysis_2 : /*! * TODO doc */ - Status_line_CPA_1 create_event_slice(size_type i) + Status_line_CPA_1 create_event_slice(size_type i) const { #if !CGAL_ACK_NO_ARC_FLIP size_type index_in_fg = event_indices(i).fg; if(index_in_fg == -1 ) { return create_slice_with_multiplicity_zero_or_one(i); } else { - size_type mult_of_alpha + size_type mult_of_alpha = multiplicities_of_resultant_roots(index_in_fg); if(mult_of_alpha == 1) { return create_slice_with_multiplicity_zero_or_one(i); @@ -743,7 +743,7 @@ class Curve_pair_analysis_2 : #endif } - Status_line_CPA_1 create_slice_of_higher_multiplicity(size_type i) + Status_line_CPA_1 create_slice_of_higher_multiplicity(size_type i) const { bool is_resultant_root = event_indices(i).fg >=0; if(is_resultant_root && @@ -771,17 +771,17 @@ class Curve_pair_analysis_2 : return create_event_slice_with_shear(i); } } - - + + // NEVER HAPPENS return Status_line_CPA_1(); - + } } private: Status_line_CPA_1 create_event_slice_at_rational(size_type i) const { - + Algebraic_real_1& x = event_x(i); CGAL_precondition(x.is_rational()); @@ -789,9 +789,9 @@ class Curve_pair_analysis_2 : int k = degree_of_local_gcd(event_indices(i).fg,x); Polynomial_2 sres = subresultants(k); - - Polynomial_1 gcd = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (sres,0,1),r); + + Polynomial_1 gcd = kernel()->evaluate_utcf_2_object() + (typename Polynomial_traits_2::Swap() (sres,0,1),r); std::vector gcd_roots; kernel()->solve_1_object()(gcd,std::back_inserter(gcd_roots),false); size_type m = static_cast(gcd_roots.size()); @@ -810,23 +810,23 @@ class Curve_pair_analysis_2 : it->first=CGAL::internal::INTERSECTION; } } - + return create_slice_from_slice_info(i,slice_info,true); } private: - + /*! * TODO doc */ - Status_line_CPA_1 create_slice_with_multiplicity_zero_or_one(size_type i) + Status_line_CPA_1 create_slice_with_multiplicity_zero_or_one(size_type i) const; - + private: // Creates an intermediate slice at a rational value Status_line_CPA_1 create_intermediate_slice_at(int i) const; - + private: // Create a slice with id \c id from the Slice_info object @@ -838,13 +838,13 @@ class Curve_pair_analysis_2 : // Computes a slice_info object at Algebraic_real_1 \c alpha Slice_info construct_slice_info(Algebraic_real_1 alpha) const; - + private: - - Status_line_CPA_1 construct_generic_case(size_type i) const; + + Status_line_CPA_1 construct_generic_case(size_type i) const; private: - + bool check_candidate_by_arc_pattern(size_type index, Status_line_CA_1& e1, size_type i1, @@ -856,9 +856,9 @@ class Curve_pair_analysis_2 : * TODO update doc * Checks the point on e1 with index i1, and * the point on e2 with index i2 really intersect. The \c slice_info - * is updated accordingly: If not intersecting, the corresponding + * is updated accordingly: If not intersecting, the corresponding * points are refined until they can be arranged in the correct order. - * If intersecting, the corresponding Slice_info element is set to + * If intersecting, the corresponding Slice_info element is set to * INTERSECTION. */ template @@ -882,11 +882,11 @@ class Curve_pair_analysis_2 : Algebraic_real_1 alpha = e1.x(); CGAL_assertion(alpha==e2.x()); if(CGAL::internal::zero_test_bivariate - - (kernel(),alpha,this->ptr()->f,p,q) && + + (kernel(),alpha,this->ptr()->f,p,q) && CGAL::internal::zero_test_bivariate - - (kernel(),alpha,this->ptr()->g,p,q)) { + + (kernel(),alpha,this->ptr()->g,p,q)) { return true; } else { @@ -902,9 +902,9 @@ class Curve_pair_analysis_2 : * index \c index1, and for the point on \c e2 with index \c index2 * overlap */ - bool overlap(Status_line_CA_1& e1, + bool overlap(Status_line_CA_1& e1, size_type index1, - Status_line_CA_1& e2, + Status_line_CA_1& e2, size_type index2) const { if(e1.lower_bound(index1) > e2.upper_bound(index2)) { return false; @@ -918,18 +918,18 @@ class Curve_pair_analysis_2 : } /* - * For the point \c p on \c e1 with index \c index1, find the + * For the point \c p on \c e1 with index \c index1, find the * unique point on \c e2 which might be equal to \c p. If no point * can be equal, -1 is returned. */ - size_type find_possible_matching(Status_line_CA_1& e1, + size_type find_possible_matching(Status_line_CA_1& e1, size_type index1, Status_line_CA_1& e2) const; size_type degree_of_local_gcd(size_type index_of_fg, Algebraic_real_1 alpha) const { - + if(multiplicities_of_resultant_roots(index_of_fg) == 1) { return 1; } else { @@ -954,7 +954,7 @@ class Curve_pair_analysis_2 : return c ? ev_ind.ggy : ev_ind.ffy; } - size_type event_of_curve_analysis(size_type i, + size_type event_of_curve_analysis(size_type i, const Curve_analysis_2& c) const { CGAL_assertion(c.id()==curve_analysis(false).id() || c.id()==curve_analysis(true).id()); @@ -962,7 +962,7 @@ class Curve_pair_analysis_2 : return (c.id()==curve_analysis(false).id()) ? ev_ind.ffy : ev_ind.ggy; } - /*! + /*! * \brief Returns the number of event slices * * Precisely, this is the number of points which are either root of @@ -975,7 +975,7 @@ class Curve_pair_analysis_2 : //! Returns the x-coordinate of the ith event Algebraic_real_1& event_x(size_type i) const { - CGAL_assertion(i>=0 && + CGAL_assertion(i>=0 && i(event_x_coordinates().size())); return event_x_coordinates()[i]; } @@ -987,7 +987,7 @@ class Curve_pair_analysis_2 : * event value, the \c event flag is set to true, otherwise to false * and the slice of the interval to which \c x belongs is returned */ - void x_to_index(Algebraic_real_1 x, + void x_to_index(Algebraic_real_1 x, size_type& idx, bool& event) const { const std::vector& sl = event_x_coordinates(); idx = static_cast(std::lower_bound(sl.begin(), @@ -998,8 +998,8 @@ class Curve_pair_analysis_2 : } - Status_line_CPA_1 status_line_for_x(Algebraic_real_1 x, - CGAL::Sign perturb = CGAL::ZERO) + Status_line_CPA_1 status_line_for_x(Algebraic_real_1 x, + CGAL::Sign perturb = CGAL::ZERO) const { size_type index; bool evt; @@ -1010,12 +1010,12 @@ class Curve_pair_analysis_2 : case(CGAL::NEGATIVE): return status_line_of_interval(index); case(CGAL::POSITIVE): return status_line_of_interval(index+1); } - } // else: + } // else: return status_line_of_interval(index); - - + + } - + Status_line_CPA_1 status_line_at_exact_x(Algebraic_real_1 x) { return status_line_for_x(x); @@ -1023,7 +1023,7 @@ class Curve_pair_analysis_2 : public: - + //! Returns the Status_line_CPA_1 at the ith event const Status_line_CPA_1& status_line_at_event(size_type i) const { if(! this->ptr()->event_slices[i]) { @@ -1032,7 +1032,7 @@ class Curve_pair_analysis_2 : CGAL_assertion(bool(this->ptr()->event_slices[i])); return this->ptr()->event_slices[i].get(); } - + //! Returns the Status_line_CPA_1 at the ith interval @@ -1040,18 +1040,18 @@ class Curve_pair_analysis_2 : if(! intermediate_slices()[i]) { - intermediate_slices()[i] + intermediate_slices()[i] = create_intermediate_slice_at(i); - + } return intermediate_slices()[i].get(); } - + //! Returns bound representative value at the ith interval const Bound bound_value_in_interval(size_type i) const { - const std::vector& events = event_x_coordinates(); + const std::vector& events = event_x_coordinates(); if(! intermediate_values()[i]) { // Create the intermediate x-coordinate first @@ -1060,16 +1060,16 @@ class Curve_pair_analysis_2 : intermediate_values()[0]=Bound(0); } else { if(i==0) { - intermediate_values()[i] - = bound_left_of(kernel(),events[i]); + intermediate_values()[i] + = bound_left_of(kernel(),events[i]); } else if(i == static_cast(events.size())) { intermediate_values()[i] - = bound_right_of(kernel(),events[i-1]); + = bound_right_of(kernel(),events[i-1]); } else { intermediate_values()[i] - = kernel()->bound_between_1_object() - (events[i-1],events[i]); + = kernel()->bound_between_1_object() + (events[i-1],events[i]); } } } @@ -1077,11 +1077,11 @@ class Curve_pair_analysis_2 : return intermediate_values()[i].get(); } - + private: - + struct Bound_to_coercion_functor { - + typedef Bound argument_type; typedef Coercion_type result_type; @@ -1092,7 +1092,7 @@ class Curve_pair_analysis_2 : }; struct Coefficient_to_coercion_functor { - + typedef Coefficient argument_type; typedef Coercion_type result_type; @@ -1116,7 +1116,7 @@ class Curve_pair_analysis_2 : = *(this->ptr()->intersection_info_container); std::size_t n = old_info_container.size(); CGAL_assertion(n == new_info_container.size()); - //iterate through the vector and update + //iterate through the vector and update // (-1 stands for "multiplicity unknown") for(std::size_t i=0;i - (std::ostream& out, + (std::ostream& out, const Self& curve_pair); }; // end of Curve_pair_analysis_2 //! \brief Prints the objects. template -std::ostream& operator<< - (std::ostream& out, +std::ostream& operator<< + (std::ostream& out, const Curve_pair_analysis_2& curve_pair) { - typedef Curve_pair_analysis_2 + typedef Curve_pair_analysis_2 Curve_pair_analysis_2; typedef typename Curve_pair_analysis_2::size_type size_type; typedef typename Curve_pair_analysis_2::Event_indices Event_indices; typedef typename Curve_pair_analysis_2::Status_line_CPA_1 Slice; out << "--------------- Analysis results ---------------" << std::endl; - out << "Number of constructed event lines: " - << curve_pair.number_of_status_lines_with_event() + out << "Number of constructed event lines: " + << curve_pair.number_of_status_lines_with_event() << std::endl; - + out << "Intermediate line: " << std::flush; Slice slice=curve_pair.status_line_of_interval(0); - + out << slice.number_of_events() << " passing arcs" << std::endl ; out << "in order: " << std::flush; for(size_type i=0;i void Curve_pair_analysis_2::compute_resultant() const { - + #if CGAL_ACK_RESULTANT_FIRST_STRATEGY #ifndef CGAL_ACK_RESULTANT_FIRST_STRATEGY_DEGREE_THRESHOLD bool speed_up = true; #else bool speed_up = (std::min) (CGAL::degree(curve_analysis(false).polynomial_2(),1), - CGAL::degree(curve_analysis(true).polynomial_2(),1)) >= + CGAL::degree(curve_analysis(true).polynomial_2(),1)) >= CGAL_ACK_RESULTANT_FIRST_STRATEGY_DEGREE_THRESHOLD; #endif #else @@ -1299,23 +1299,23 @@ void Curve_pair_analysis_2::compute_resultant() #endif if(speed_up) { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Compute the resultant of f and g..." + CGAL_ACK_DEBUG_PRINT << "Compute the resultant of f and g..." << std::flush; #endif - this->ptr()->resultant + this->ptr()->resultant = CGAL::resultant(this->ptr()->f,this->ptr()->g); } else { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Compute the subres-seq of f and g..." + CGAL_ACK_DEBUG_PRINT << "Compute the subres-seq of f and g..." << std::flush; #endif compute_subresultants(); - - this->ptr()->resultant + + this->ptr()->resultant = this->ptr()->principal_subresultants.get()[0]; } - - + + if(this->ptr()->resultant.get().is_zero()) { throw CGAL::internal::Zero_resultant_exception (this->ptr()->f, @@ -1324,7 +1324,7 @@ void Curve_pair_analysis_2::compute_resultant() #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif - + } //////////////////// compute_resultant_roots_with_multiplicities() @@ -1332,9 +1332,9 @@ void Curve_pair_analysis_2::compute_resultant() template void Curve_pair_analysis_2:: compute_resultant_roots_with_multiplicities() const { - + #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Isolate the real roots of resultant..." + CGAL_ACK_DEBUG_PRINT << "Isolate the real roots of resultant..." << std::flush; #endif Solve_1 solve_1; @@ -1349,25 +1349,25 @@ compute_resultant_roots_with_multiplicities() const { this->ptr()->multiplicities_of_resultant_roots.get() .push_back(res_pairs[i].second); } - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif - + #if CGAL_ACK_DEBUG_FLAG for(size_type i = 0; i (this->ptr()->resultant_roots.get().size()); i++) { - CGAL_ACK_DEBUG_PRINT - << "Root at " + CGAL_ACK_DEBUG_PRINT + << "Root at " << CGAL::to_double(this->ptr()->resultant_roots.get()[i]) << " with multiplicity " << this->ptr()->multiplicities_of_resultant_roots.get()[i] << std::endl; } #endif - + } //////////////////// compute_event_x_coordinates_with_event_indices @@ -1375,16 +1375,16 @@ compute_resultant_roots_with_multiplicities() const { template void Curve_pair_analysis_2:: compute_event_x_coordinates_with_event_indices() const { - + Xval_of_status_line_CA_1 xval; const Curve_analysis_2& c1=this->ptr()->c1_, c2=this->ptr()->c2_; - + std::vector one_curve_events; - + std::vector one_curve_events_type; - + typename CGAL::Real_embeddable_traits::Compare compare; - + CGAL::internal::set_union_with_source (::boost::make_transform_iterator(c1.event_begin(),xval), ::boost::make_transform_iterator(c1.event_end(),xval), @@ -1393,7 +1393,7 @@ compute_event_x_coordinates_with_event_indices() const { std::back_inserter(one_curve_events), std::back_inserter(one_curve_events_type), compare); - + this->ptr()->event_x_coordinates = std::vector(); std::vector events_type; CGAL::internal::set_union_with_source @@ -1404,9 +1404,9 @@ compute_event_x_coordinates_with_event_indices() const { std::back_inserter(this->ptr()->event_x_coordinates.get()), std::back_inserter(events_type), compare); - std::vector& events + std::vector& events = this->ptr()->event_x_coordinates.get(); - + typename std::vector::iterator one_curve_it =one_curve_events_type.begin(); size_type inter_count=0, f_count=0,g_count=0; @@ -1456,7 +1456,7 @@ compute_event_x_coordinates_with_event_indices() const { #endif */ this->ptr()->event_slices.emplace_back(); - + event_indices.push_back (Event_indices(inter_count,-1,-1)); inter_count++; @@ -1465,12 +1465,12 @@ compute_event_x_coordinates_with_event_indices() const { case(CGAL::internal::ROOT_OF_BOTH_SETS): { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << " one and two curve event" + CGAL_ACK_DEBUG_PRINT << " one and two curve event" << std::endl; #endif */ this->ptr()->event_slices.emplace_back(); - + switch(*(one_curve_it++)) { case(CGAL::internal::ROOT_OF_FIRST_SET): { event_indices.push_back @@ -1497,14 +1497,14 @@ compute_event_x_coordinates_with_event_indices() const { } } } - CGAL_assertion(inter_count + CGAL_assertion(inter_count == static_cast (resultant_roots().size())); CGAL_assertion(one_curve_it==one_curve_events_type.end()); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "done" << std::endl; + CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif - + } //////////////////// compute_intermediate_values_and_slices() @@ -1512,7 +1512,7 @@ compute_event_x_coordinates_with_event_indices() const { template void Curve_pair_analysis_2:: compute_intermediate_values_and_slices() const { - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Prepare intermediate slices.." << std::flush; #endif @@ -1537,7 +1537,7 @@ compute_subresultants() const { const Polynomial_2& f = this->ptr()->f, g=this->ptr()->g; this->ptr()->subresultants = std::vector(); if(CGAL::degree(f,1)ptr()->subresultants.get())); #else @@ -1546,7 +1546,7 @@ compute_subresultants() const { (g,f,std::back_inserter(this->ptr()->subresultants.get())); #endif } else { -#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS +#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS CGAL::internal::bezout_polynomial_subresultants (f,g,std::back_inserter(this->ptr()->subresultants.get())); #else @@ -1555,12 +1555,12 @@ compute_subresultants() const { (f,g,std::back_inserter(this->ptr()->subresultants.get())); #endif } - - std::vector& subresultants + + std::vector& subresultants = this->ptr()->subresultants.get(); - + size_type n = static_cast(subresultants.size()); - + for(size_type i=0;iptr()->principal_subresultants-> @@ -1584,26 +1584,26 @@ compute_subresultants() const { // This must be corrected, if f and g have same degree: if(CGAL::degree(f,1) == CGAL::degree(g,1)) { if(n>=1) { - this->ptr()->principal_subresultants.get()[n-1] + this->ptr()->principal_subresultants.get()[n-1] = Polynomial_1(CGAL::leading_coefficient(g)); } if(n>=2) { - this->ptr()->coprincipal_subresultants.get()[n-2] + this->ptr()->coprincipal_subresultants.get()[n-2] = Polynomial_1(g[CGAL::degree(g,1)-1]); } } - + } //////////////////// create_slice_with_multiplicity_zero_or_one template typename Curve_pair_analysis_2 - ::Status_line_CPA_1 + ::Status_line_CPA_1 Curve_pair_analysis_2:: create_slice_with_multiplicity_zero_or_one(size_type i) const { - - const std::vector& events + + const std::vector& events = event_x_coordinates(); Algebraic_real_1 alpha = events[i]; const Curve_analysis_2& c1=curve_analysis(false), c2=curve_analysis(true); @@ -1611,54 +1611,54 @@ create_slice_with_multiplicity_zero_or_one(size_type i) const { bool flag1,flag2; c1.x_to_index(alpha,i1,flag1); c2.x_to_index(alpha,i2,flag2); - + bool exactly_at_alpha_1 = flag1, exactly_at_alpha_2 = flag2; Status_line_CA_1 e1=flag1 ? c1.status_line_at_event(i1) : c1.status_line_of_interval(i1); Status_line_CA_1 e2=flag2 ? c2.status_line_at_event(i2) : c2.status_line_of_interval(i2); - + Status_line_CPA_1 left_slice = this->status_line_of_interval(i), right_slice = this->status_line_of_interval(i+1); - - Status_line_CPA_iterator left_it + + Status_line_CPA_iterator left_it = ::boost::make_transform_iterator (::boost::counting_iterator(0), Curves_at_event_functor(left_slice)); - Status_line_CPA_iterator right_it + Status_line_CPA_iterator right_it = ::boost::make_transform_iterator (::boost::counting_iterator(0), Curves_at_event_functor(right_slice)); - Status_line_CPA_iterator left_end + Status_line_CPA_iterator left_end = ::boost::make_transform_iterator (::boost::counting_iterator (left_slice.number_of_events()), Curves_at_event_functor(left_slice)); - Status_line_CPA_iterator right_end + Status_line_CPA_iterator right_end = ::boost::make_transform_iterator (::boost::counting_iterator (right_slice.number_of_events()), Curves_at_event_functor(right_slice)); // Take out asymptotes - size_type asym_lm_1 + size_type asym_lm_1 = e1.number_of_branches_approaching_minus_infinity().first; - size_type asym_rm_1 + size_type asym_rm_1 = e1.number_of_branches_approaching_minus_infinity().second; - size_type asym_lp_1 + size_type asym_lp_1 = e1.number_of_branches_approaching_plus_infinity().first; - size_type asym_rp_1 + size_type asym_rp_1 = e1.number_of_branches_approaching_plus_infinity().second; - size_type asym_lm_2 + size_type asym_lm_2 = e2.number_of_branches_approaching_minus_infinity().first; - size_type asym_rm_2 + size_type asym_rm_2 = e2.number_of_branches_approaching_minus_infinity().second; - size_type asym_lp_2 + size_type asym_lp_2 = e2.number_of_branches_approaching_plus_infinity().first; - size_type asym_rp_2 + size_type asym_rp_2 = e2.number_of_branches_approaching_plus_infinity().second; - + while(asym_lm_1 != 0 || asym_lm_2 != 0) { CGAL_assertion(*left_it != CGAL::internal::INTERSECTION); if(*left_it == CGAL::internal::FIRST_CURVE) { @@ -1714,27 +1714,27 @@ create_slice_with_multiplicity_zero_or_one(size_type i) const { size_type event_index_1=0, event_index_2=0; - while(event_index_1 != e1.number_of_events() || + while(event_index_1 != e1.number_of_events() || event_index_2 != e2.number_of_events()) { - CGAL_assertion(event_index_1 != e1.number_of_events() || + CGAL_assertion(event_index_1 != e1.number_of_events() || event_index_2 != e2.number_of_events()); if(event_index_1==e1.number_of_events()) { curr_lowest_arc=CGAL::internal::SECOND_CURVE; - } + } else if(event_index_2==e2.number_of_events()) { curr_lowest_arc=CGAL::internal::FIRST_CURVE; - } - else if((e1.number_of_incident_branches(event_index_1).first>0 && + } + else if((e1.number_of_incident_branches(event_index_1).first>0 && e2.number_of_incident_branches(event_index_2).first>0)) { // The next arc on the left must come as next: curr_lowest_arc=*left_it; - } - else if((e1.number_of_incident_branches(event_index_1).second>0 && + } + else if((e1.number_of_incident_branches(event_index_1).second>0 && e2.number_of_incident_branches(event_index_2).second>0)) { // The next arc on the right must come as next: curr_lowest_arc=*right_it; - } + } else { // We cannot decide it from the arcs, so we have to compare // isolating intervals @@ -1746,10 +1746,10 @@ create_slice_with_multiplicity_zero_or_one(size_type i) const { e2 = c2.status_line_at_exact_x(alpha); CGAL_assertion(e2.number_of_events()>event_index_2); } - CGAL::Sign e1_smaller + CGAL::Sign e1_smaller = split_compare(e1,event_index_1,e2,event_index_2); - curr_lowest_arc - = (e1_smaller==CGAL::SMALLER) + curr_lowest_arc + = (e1_smaller==CGAL::SMALLER) ? CGAL::internal::FIRST_CURVE : CGAL::internal::SECOND_CURVE; } @@ -1810,7 +1810,7 @@ create_slice_with_multiplicity_zero_or_one(size_type i) const { } left_it++; } - + j=0; while(j typename Curve_pair_analysis_2 - ::Status_line_CPA_1 + ::Status_line_CPA_1 Curve_pair_analysis_2:: create_intermediate_slice_at(int i) const { - + Bound r = bound_value_in_interval(i); std::vector p1_roots,p2_roots; @@ -1867,13 +1867,13 @@ create_intermediate_slice_at(int i) const { this->ptr()->c1_.get_roots_at_rational(r,std::back_inserter(p1_roots)); this->ptr()->c2_.get_roots_at_rational(r,std::back_inserter(p2_roots)); - size_type number_of_roots + size_type number_of_roots = static_cast(p1_roots.size() + p2_roots.size()); std::vector p12_roots; p12_roots.reserve(number_of_roots); std::vector p12_order; p12_order.reserve(number_of_roots); - + CGAL::internal::Distinct_compare distinct_compare; set_union_with_source(p1_roots.begin(), p1_roots.end(), @@ -1882,10 +1882,10 @@ create_intermediate_slice_at(int i) const { std::back_inserter(p12_roots), std::back_inserter(p12_order), distinct_compare); - + Slice_info slice_info; - - for(typename std::vector::const_iterator + + for(typename std::vector::const_iterator it = p12_order.begin(); it!=p12_order.end(); it++) { @@ -1900,24 +1900,24 @@ create_intermediate_slice_at(int i) const { (std::make_pair(CGAL::internal::SECOND_CURVE,-1)); break; } - case(CGAL::internal::ROOT_OF_BOTH_SETS): { + case(CGAL::internal::ROOT_OF_BOTH_SETS): { CGAL_assertion(false); break; } } } - - Status_line_CPA_1 new_slice + + Status_line_CPA_1 new_slice = create_slice_from_slice_info(i,slice_info,false); - - return new_slice; + + return new_slice; } //////////////////// create_slice_from_slice_info template typename Curve_pair_analysis_2 - ::Status_line_CPA_1 + ::Status_line_CPA_1 Curve_pair_analysis_2:: create_slice_from_slice_info(size_type id, const Slice_info& slice, @@ -1927,7 +1927,7 @@ create_slice_from_slice_info(size_type id, typedef typename Status_line_CPA_1::Int_container Int_container; Arc_container arc_container; Int_container int_container; - + for(typename Slice_info::const_iterator it = slice.begin(); it!=slice.end(); it++) { @@ -1960,30 +1960,30 @@ create_slice_from_slice_info(size_type id, } } } - - return event_flag + + return event_flag ? Status_line_CPA_1(id,arc_container,*this) - : Status_line_CPA_1(id,int_container,*this); + : Status_line_CPA_1(id,int_container,*this); } //////////////////// construct_slice_info template -typename Curve_pair_analysis_2::Slice_info +typename Curve_pair_analysis_2::Slice_info Curve_pair_analysis_2:: construct_slice_info(Algebraic_real_1 alpha) const { - + /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Consider alpha=" << CGAL::to_double(alpha) + CGAL_ACK_DEBUG_PRINT << "Consider alpha=" << CGAL::to_double(alpha) << std::endl; #endif -*/ - +*/ + Status_line_CA_1 e1 = this->ptr()->c1_.status_line_at_exact_x(alpha); - + Status_line_CA_1 e2 = this->ptr()->c2_.status_line_at_exact_x(alpha); - + std::vector > matchings; for(size_type i=0;i >::const_iterator + + typename std::vector >::const_iterator match = matchings.begin(); Slice_info slice_info; while(i1first && + if(match!=matchings.end() && + i1==match->first && i2==match->second) { slice_info.push_back(std::make_pair(CGAL::internal::CANDIDATE,1)); i1++; @@ -2050,23 +2050,23 @@ construct_slice_info(Algebraic_real_1 alpha) const { template typename Curve_pair_analysis_2 - ::Status_line_CPA_1 + ::Status_line_CPA_1 Curve_pair_analysis_2:: construct_generic_case(size_type i) const { - + Algebraic_real_1 alpha = event_x(i); - + Slice_info slice_info; - + size_type index_of_fg = event_indices(i).fg; size_type index_of_ffy =event_indices(i).ffy; size_type index_of_ggy =event_indices(i).ggy; if(index_of_fg>=0) { - if(kernel()->is_zero_at_1_object() + if(kernel()->is_zero_at_1_object() (CGAL::leading_coefficient (this->ptr()->c1_.polynomial_2()),alpha) || - kernel()->is_zero_at_1_object() + kernel()->is_zero_at_1_object() (CGAL::leading_coefficient (this->ptr()->c2_.polynomial_2()),alpha)) { throw CGAL::internal::Non_generic_position_exception(); @@ -2074,7 +2074,7 @@ construct_generic_case(size_type i) const { size_type k = -1; // not yet computed if(index_of_ffy==-1 && index_of_ggy==-1) { // this means, we need the multiplicity of the intersections - if(kernel()->is_zero_at_1_object() + if(kernel()->is_zero_at_1_object() (principal_subresultants(1),alpha)) { // multiplicity cannot be determined, throw exception throw CGAL::internal::Non_generic_position_exception(); @@ -2084,9 +2084,9 @@ construct_generic_case(size_type i) const { } else { k = degree_of_local_gcd(index_of_fg,alpha); } - Status_line_CA_1 e1 + Status_line_CA_1 e1 = this->ptr()->c1_.status_line_at_exact_x(alpha); - Status_line_CA_1 e2 + Status_line_CA_1 e2 = this->ptr()->c2_.status_line_at_exact_x(alpha); slice_info = construct_slice_info(alpha); size_type no_candidates= @@ -2115,9 +2115,9 @@ construct_generic_case(size_type i) const { slice_it,i); } } else { - Status_line_CA_1 e1 + Status_line_CA_1 e1 = this->ptr()->c1_.status_line_at_exact_x(alpha); - Status_line_CA_1 e2 + Status_line_CA_1 e2 = this->ptr()->c2_.status_line_at_exact_x(alpha); slice_info = construct_slice_info(alpha); reduce_number_of_candidates_and_intersections_to @@ -2136,7 +2136,7 @@ check_candidate_by_arc_pattern(size_type index, size_type i1, Status_line_CA_1& e2, size_type i2) const { - + Status_line_CPA_1 left_slice = status_line_of_interval(index), right_slice = status_line_of_interval(index+1); size_type left_index=0,right_index=0; @@ -2151,16 +2151,16 @@ check_candidate_by_arc_pattern(size_type index, // left_index and right_index now point at the position // of the first arc into the candidate size_type num_of_arcs_to_candidate_left - = e1.number_of_incident_branches(i1).first + = e1.number_of_incident_branches(i1).first + e2.number_of_incident_branches(i2).first, num_of_arcs_to_candidate_right - = e1.number_of_incident_branches(i1).second + = e1.number_of_incident_branches(i1).second + e2.number_of_incident_branches(i2).second; - CGAL_assertion(left_index + num_of_arcs_to_candidate_left <= + CGAL_assertion(left_index + num_of_arcs_to_candidate_left <= left_slice.number_of_events()); CGAL_assertion(right_index + num_of_arcs_to_candidate_right <= right_slice.number_of_events()); - + CGAL::internal::Slice_type curr; Curves_at_event_functor left_functor(left_slice); size_type number_of_changes; @@ -2169,11 +2169,11 @@ check_candidate_by_arc_pattern(size_type index, number_of_changes=0; /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << num_of_arcs_to_candidate_left - << num_of_arcs_to_candidate_right + CGAL_ACK_DEBUG_PRINT << num_of_arcs_to_candidate_left + << num_of_arcs_to_candidate_right << left_index << right_index << std::endl; #endif -*/ +*/ for(size_type i=1;i typename Curve_pair_analysis_2::size_type Curve_pair_analysis_2:: -find_possible_matching(Status_line_CA_1& e1, +find_possible_matching(Status_line_CA_1& e1, size_type index1, Status_line_CA_1& e2) const { - + std::vector possible_overlaps; for(size_type i=0;i::iterator it = possible_overlaps.begin(); while(it!=possible_overlaps.end()) { @@ -2314,43 +2314,43 @@ find_possible_matching(Status_line_CA_1& e1, template void Curve_pair_analysis_2:: -new_shear_for_intersection_info(Intersection_info_container& info_container) +new_shear_for_intersection_info(Intersection_info_container& info_container) const { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Use shear for intersections.." << std::endl; #endif bool good_direction_found=false; Integer s; - + while(! good_direction_found) { try { info_container.clear(); - info_container.resize(resultant_roots().size()); + info_container.resize(resultant_roots().size()); s = this->ptr()->shear_controller.get_shear_factor(); #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Try shear factor " << s << std::endl; - CGAL_ACK_DEBUG_PRINT + CGAL_ACK_DEBUG_PRINT << ">>>>>>>>>>> Transform first curve" << std::endl; #endif - - Curve_analysis_2 sh1 + + Curve_analysis_2 sh1 = this->ptr()->c1_.shear_primitive_part(s); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT + CGAL_ACK_DEBUG_PRINT << "<<<<<<<<<<< End of transform first curve" << std::endl; - CGAL_ACK_DEBUG_PRINT << ">>>>>>>>>>> Transform second curve" + CGAL_ACK_DEBUG_PRINT << ">>>>>>>>>>> Transform second curve" << std::endl; #endif Curve_analysis_2 sh2 = this->ptr()->c2_.shear_primitive_part(s); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT - << "<<<<<<<<<<< End of transform second curve" + CGAL_ACK_DEBUG_PRINT + << "<<<<<<<<<<< End of transform second curve" << std::endl; #endif Self sh_pair(kernel(),sh1,sh2,CGAL::EXCEPTION_STRATEGY); - -#if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Shear back intersection points..." + +#if CGAL_ACK_DEBUG_FLAG + CGAL_ACK_DEBUG_PRINT << "Shear back intersection points..." << std::flush; #endif for(size_type i=0; @@ -2360,7 +2360,7 @@ new_shear_for_intersection_info(Intersection_info_container& info_container) if(sh_pair.event_indices(i).fg==-1) { continue; } - Status_line_CPA_1 slice + Status_line_CPA_1 slice = sh_pair.status_line_at_event(i); Curves_at_event_functor functor(slice); for(size_type j=0;jptr()->shear_controller.report_failure(s); } } - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif @@ -2389,7 +2389,7 @@ new_shear_for_intersection_info(Intersection_info_container& info_container) template typename Curve_pair_analysis_2 - ::Status_line_CPA_1 + ::Status_line_CPA_1 Curve_pair_analysis_2:: create_event_slice_from_current_intersection_info (size_type i) const{ #if CGAL_ACK_DEBUG_FLAG @@ -2404,7 +2404,7 @@ create_event_slice_from_current_intersection_info (size_type i) const{ static_cast (intersection_info_container.size())); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << i << "th slice has " + CGAL_ACK_DEBUG_PRINT << i << "th slice has " << intersection_info_container[index_of_fg].size() << " intersections" << std::endl; #endif @@ -2423,8 +2423,8 @@ create_event_slice_from_current_intersection_info (size_type i) const{ -1); CGAL_assertion(no_intersections==static_cast (intersection_info_container[index_of_fg].size())); - typename std::vector::iterator - inter_info_it + typename std::vector::iterator + inter_info_it = intersection_info_container[index_of_fg].begin(); for(size_type j=0;j(slice.size());j++) { if(slice[j].first==CGAL::internal::INTERSECTION) { @@ -2436,23 +2436,23 @@ create_event_slice_from_current_intersection_info (size_type i) const{ // Multiplicity unknown for case where we need it throw CGAL::internal::Non_generic_position_exception(); } - slice[j].second=inter_info_it->mult; + slice[j].second=inter_info_it->mult; inter_info_it++; } } - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif return create_slice_from_slice_info(i,slice,true); - + } //////////////////// update_intersection_info template void Curve_pair_analysis_2:: -update_intersection_info(Intersection_info_container& +update_intersection_info(Intersection_info_container& info_container, Self& sh_pair, Status_line_CPA_1 slice, @@ -2473,7 +2473,7 @@ update_intersection_info(Intersection_info_container& intersection_info.mult=slice.multiplicity_of_intersection(j); // Find the right position to insert the object // first the "x-coordiante" - size_type left_index = -1, + size_type left_index = -1, right_index = static_cast(stripe_values().size()-1); Algebraic_real_1 xv = ev.x(); Bound lx = xv.low(), rx=xv.high(), @@ -2494,26 +2494,26 @@ update_intersection_info(Intersection_info_container& Bound left=(s<0) ? x_sheared(lx,ry,-s): x_sheared(lx,ly,-s); Bound right = (s<0) ? x_sheared(rx,ly,-s) : x_sheared(rx,ry,-s); CGAL_assertion(left Intersection_info_vector; - Intersection_info_vector& info_vec + Intersection_info_vector& info_vec = info_container[left_index]; typename Intersection_info_vector::iterator info_it=info_vec.begin(); while(info_it!=info_vec.end()) { Status_line_CA_1& comp_ev=info_it->ev; size_type comp_index = info_it->index; - CGAL::Sign index_smaller + CGAL::Sign index_smaller = split_compare(ev,index,comp_ev,comp_index); if(index_smaller==CGAL::LARGER) { info_it++; @@ -2521,7 +2521,7 @@ update_intersection_info(Intersection_info_container& break; } } - info_vec.insert(info_it,intersection_info); + info_vec.insert(info_it,intersection_info); } //////////////////// reduce_number_of_candidates_and_intersections_to @@ -2536,8 +2536,8 @@ reduce_number_of_candidates_and_intersections_to(size_type n, size_type k) const { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Reduce: " << n << " " - << CGAL::to_double(e1.x()) << " " << k + CGAL_ACK_DEBUG_PRINT << "Reduce: " << n << " " + << CGAL::to_double(e1.x()) << " " << k << std::endl; #endif */ @@ -2552,13 +2552,13 @@ reduce_number_of_candidates_and_intersections_to(size_type n, } } CGAL_assertion(number_of_intersections<=n); - + typename Slice_info::iterator slice_it=slice.begin(); size_type i1=0,i2=0; size_type max_candidate_mult=0; while(nmin_m + max_candidate_mult = max_candidate_mult>min_m ? max_candidate_mult : min_m; } i1++; @@ -2623,7 +2623,7 @@ reduce_number_of_candidates_and_intersections_to(size_type n, slice_it++; } return number_of_intersections+number_of_candidates; -} +} } //namespace CGAL diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h index 1082debd10f8..705aa022d830 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -16,8 +16,8 @@ // they may be wrong now. /*! \file NiX/Descartes.h - \brief Defines class NiX::Descartes. - + \brief Defines class NiX::Descartes. + Isolate real roots of polynomials. This file provides a class to isolate real roots of polynomials, @@ -32,7 +32,7 @@ #define CGAL_ALGEBRAIC_KERNEL_D_DESCARTES_H #include -#include +#include #include #include @@ -47,9 +47,9 @@ namespace CGAL { namespace internal { /*! \ingroup NiX_Algebraic_real - * \brief A model of concept RealRootIsolator. + * \brief A model of concept RealRootIsolator. */ -template +template class Descartes { typedef CGAL::Fraction_traits FT_poly; typedef Fraction_traits FT_rat; @@ -65,63 +65,63 @@ class Descartes { private: typedef typename Polynomial::NT Coeff; typedef Integer IT; - + Polynomial poly_; - int number_of_real_roots_; - IT* numerator; - IT* denominator_exponent; + int number_of_real_roots_; + IT* numerator; + IT* denominator_exponent; bool* is_exact; IT LEFT,SCALE,DENOM; bool is_strong_; int k; bool interval_given; - + public: /*! \brief Constructor from univariate square free polynomial. - - The RealRootIsolator provides isolating intervals for the real + + The RealRootIsolator provides isolating intervals for the real roots of the polynomial. - \pre the polynomial is square free + \pre the polynomial is square free */ - Descartes(const Polynomial& P = Polynomial(Coeff(0)), + Descartes(const Polynomial& P = Polynomial(Coeff(0)), bool is_strong = false, - int kk = 2) - : poly_(P) , - is_strong_(is_strong), + int kk = 2) + : poly_(P) , + is_strong_(is_strong), k(kk), interval_given(false) { - - numerator = new IT[CGAL::degree(P)]; + + numerator = new IT[CGAL::degree(P)]; denominator_exponent = new IT[CGAL::degree(P)]; - is_exact = new bool[CGAL::degree(P)]; + is_exact = new bool[CGAL::degree(P)]; number_of_real_roots_ = 0; - if(CGAL::degree(P) == 0) - { + if(CGAL::degree(P) == 0) + { if(P.is_zero()) number_of_real_roots_ = -1; return; } - + intern_decompose(poly_,typename FT_poly::Is_fraction()); } - - // constructor for coefficient types \c Coeff with given interval + + // constructor for coefficient types \c Coeff with given interval // (experimental) Descartes(const Polynomial& P, const Rational& left, const Rational& right, bool is_strong = false, - int kk = 2) - : poly_(P) , - is_strong_(is_strong), + int kk = 2) + : poly_(P) , + is_strong_(is_strong), k(kk), interval_given(true) { - - numerator = new IT[CGAL::degree(P)]; + + numerator = new IT[CGAL::degree(P)]; denominator_exponent = new IT[CGAL::degree(P)]; is_exact = new bool[CGAL::degree(P)]; number_of_real_roots_ = 0; - if(CGAL::degree(P) == 0) - { + if(CGAL::degree(P) == 0) + { if(P.is_zero()) number_of_real_roots_ = -1; return; } @@ -130,7 +130,7 @@ class Descartes { typedef typename FT_rat::Denominator Denominator; Numerator numleft, numright; Denominator denleft, denright; - + decompose(left,numleft,denleft); decompose(right,numright,denright); @@ -144,18 +144,18 @@ class Descartes { //! copy constructor Descartes(const Descartes& D) - : poly_(D.poly_), + : poly_(D.poly_), number_of_real_roots_(D.number_of_real_roots_), - LEFT(D.LEFT), + LEFT(D.LEFT), SCALE(D.SCALE), DENOM(D.DENOM), - is_strong_(D.is_strong_), + is_strong_(D.is_strong_), k(D.k), interval_given(D.interval_given) { - - numerator = new IT[CGAL::degree(poly_)]; + + numerator = new IT[CGAL::degree(poly_)]; denominator_exponent = new IT[CGAL::degree(poly_)]; - is_exact = new bool[CGAL::degree(poly_)]; + is_exact = new bool[CGAL::degree(poly_)]; for(int i=0; i= 0 && i < number_of_real_roots_); construct_binary(denominator_exponent[i], denominator_); numerator_= SCALE * numerator[i] + LEFT * denominator_; denominator_ = denominator_ * DENOM; } - - + + void right_bound(int i,IT& numerator_, IT& denominator_) const { CGAL_assertion(i >= 0 && i < number_of_real_roots_); if(is_exact[i]){ @@ -214,61 +214,61 @@ class Descartes { } } public: - - /*! \brief returns \f${l_i}\f$ the left bound of the isolating interval + + /*! \brief returns \f${l_i}\f$ the left bound of the isolating interval for root \f$root_{i}\f$. - + In case is_exact_root(i) is true, \f$l_i = root_{i}\f$,\n - otherwise: \f$l_i < root_{i}\f$. - + otherwise: \f$l_i < root_{i}\f$. + If \f$i-1>=0\f$, then \f$l_i > root_{i-1}\f$. \n - If \f$i-1>=0\f$, then \f$l_i >= r_{i-1}\f$, + If \f$i-1>=0\f$, then \f$l_i >= r_{i-1}\f$, the right bound of \f$root_{i-1}\f$\n \pre 0 <= i < number_of_real_roots() */ - Rational left_bound(int i) const { + Rational left_bound(int i) const { IT numerator_, denominator_; left_bound(i,numerator_,denominator_); return Rational(numerator_) / Rational(denominator_); } - - /*! \brief returns \f${r_i}\f$ the right bound of the isolating interval + + /*! \brief returns \f${r_i}\f$ the right bound of the isolating interval for root \f$root_{i}\f$. - + In case is_exact_root(i) is true, \f$r_i = root_{i}\f$,\n - otherwise: \f$r_i > root_{i}\f$. - + otherwise: \f$r_i > root_{i}\f$. + If \f$i+1< n \f$, then \f$r_i < root_{i+1}\f$, where \f$n\f$ is number of real roots.\n - If \f$i+1< n \f$, then \f$r_i <= l_{i+1}\f$, + If \f$i+1< n \f$, then \f$r_i <= l_{i+1}\f$, the left bound of \f$root_{i+1}\f$\n - + \pre 0 <= i < number_of_real_roots() */ - Rational right_bound(int i) const { + Rational right_bound(int i) const { IT numerator_, denominator_; right_bound(i,numerator_,denominator_); return Rational(numerator_) / Rational(denominator_); - } - + } + private: void intern_decompose( Polynomial P_, ::CGAL::Tag_true){ typename FT_poly::Decompose decompose; typename FT_poly::Numerator_type NumP; typename FT_poly::Denominator_type dummy; - + decompose(P_,NumP,dummy); init_with(NumP); } - void intern_decompose( Polynomial P, ::CGAL::Tag_false){ + void intern_decompose( Polynomial P, ::CGAL::Tag_false){ init_with(P); } - - template + + template void init_with(const Polynomial__& P){ typedef typename Polynomial__::NT Coeff; if(!interval_given) @@ -281,28 +281,28 @@ class Descartes { Polynomial__ Q = ::CGAL::scale_up(R,Coeff(SCALE)); zero_one_descartes(Q,0,0); } - - + + //! returns the polynomial $(1 + x)^n P(1/(1 + x))$. template /* - typename - CGAL::Polynomial_traits_d + typename + CGAL::Polynomial_traits_d ::template Rebind::Other::Type */ - POLYNOMIAL_REBIND(Coeff__) - variation_transformation(const POLYNOMIAL_REBIND(Coeff__)& P) { + POLYNOMIAL_REBIND(Coeff__) + variation_transformation(const POLYNOMIAL_REBIND(Coeff__)& P) { POLYNOMIAL_REBIND(Coeff__) R = reversal(P); - return translate_by_one(R); + return translate_by_one(R); } //! Returns an upper bound on the absolute value of all roots of $P$. /*! The upper bound is a power of two. Only works for univariate - * polynomials. + * polynomials. */ template - IT weak_upper_root_bound(const POLYNOMIAL_REBIND(Coeff__)& P) { - + IT weak_upper_root_bound(const POLYNOMIAL_REBIND(Coeff__)& P) { + typename Real_embeddable_traits::Abs abs; const int n = CGAL::degree(P); IT r(1); // return value @@ -328,29 +328,29 @@ class Descartes { return false; return (P[0] != Coeff__(0) && P.evaluate(Coeff__(1)) != Coeff__(0)); } - //! Descartes algoritm to determine isolating intervals for the roots + //! Descartes algoritm to determine isolating intervals for the roots //! lying in the interval (0,1). // The parameters $(i,D)$ describe the interval $(i/2^D, (i+1)/2^D)$. // Here $0\leq i < 2^D$. template void zero_one_descartes(const POLYNOMIAL_REBIND(Coeff__)& P, - IT i, IT D) { - // Determine the number of sign variations of the transformed - // polynomial $(1+x)^nP(1/(1+x))$. This gives the number of + IT i, IT D) { + // Determine the number of sign variations of the transformed + // polynomial $(1+x)^nP(1/(1+x))$. This gives the number of // roots of $P$ in $(0,1)$. POLYNOMIAL_REBIND(Coeff__) R = variation_transformation(P); int descarte = sign_variations(R); - + // no root if ( descarte == 0 ) return; // exactly one root // Note the termination criterion $P(0)\neq 0$ and $P(1)\neq 0$. // This ensures that the given interval is an isolating interval. - if ( descarte == 1 - && P[0] != Coeff__(0) - && P.evaluate(Coeff__(1)) != Coeff__(0) ) { + if ( descarte == 1 + && P[0] != Coeff__(0) + && P.evaluate(Coeff__(1)) != Coeff__(0) ) { if(is_strong_) { strong_zero_one_descartes(P,i,D); return; @@ -360,8 +360,8 @@ class Descartes { denominator_exponent[number_of_real_roots_] = D; is_exact[number_of_real_roots_] = false; number_of_real_roots_++; - return; - } + return; + } } // more than one root @@ -371,33 +371,33 @@ class Descartes { // Transform the polynomial such that the first half of the interval // is mapped to the unit interval. POLYNOMIAL_REBIND(Coeff__) Q = scale_down(P,Coeff__(2)); - + // Consider the first half of the interval. zero_one_descartes(Q,i,D); - - // Test if the polynomial is zero at the midpoint of the interval + + // Test if the polynomial is zero at the midpoint of the interval POLYNOMIAL_REBIND(Coeff__) S = translate_by_one(Q); - if ( S[0] == Coeff__(0) ) { + if ( S[0] == Coeff__(0) ) { numerator[number_of_real_roots_] = i + 1; denominator_exponent[number_of_real_roots_] = D; is_exact[number_of_real_roots_] = true; number_of_real_roots_++; } - - // Consider the second half of the interval. - zero_one_descartes(S,i+1,D); + + // Consider the second half of the interval. + zero_one_descartes(S,i+1,D); } - //! Strong Descartes algoritm to determine isolating intervals for the + //! Strong Descartes algoritm to determine isolating intervals for the //! roots lying in the interval (0,1), where the first - //! derivative have no sign change. \pre $P$ has only one root in the + //! derivative have no sign change. \pre $P$ has only one root in the //! interval given by $(i,D)$. // The parameters $(i,D)$ describe the interval $(i/2^D, (i+1)/2^D)$. // Here $0\leq i < D$. template void strong_zero_one_descartes(const POLYNOMIAL_REBIND(Coeff__)& P, - IT i, IT D) { + IT i, IT D) { // Test if the polynomial P' has no roots in the // interval. For further use in Newton, the interval should be not @@ -422,11 +422,11 @@ class Descartes { denominator_exponent[number_of_real_roots_] = D; is_exact[number_of_real_roots_] = false; number_of_real_roots_++; - return; + return; } } - // either $P'$ fails the test, + // either $P'$ fails the test, // or the interval is too large // Refine the interval. i = 2*i; D = D+1; @@ -434,10 +434,10 @@ class Descartes { // Transform the polynomial such that the first half of the interval // is mapped to the unit interval. POLYNOMIAL_REBIND(Coeff__) Q = scale_down(P,Coeff__(2)); - - // Test if the polynomial is zero at the midpoint of the interval + + // Test if the polynomial is zero at the midpoint of the interval POLYNOMIAL_REBIND(Coeff__) S = translate_by_one(Q); - if ( S[0] == Coeff__(0) ) { + if ( S[0] == Coeff__(0) ) { numerator[number_of_real_roots_] = i + 1; denominator_exponent[number_of_real_roots_] = D; is_exact[number_of_real_roots_] = true; @@ -450,11 +450,11 @@ class Descartes { strong_zero_one_descartes(Q,i,D); return; } - - // Consider the second half of the interval. - strong_zero_one_descartes(S,i+1,D); + + // Consider the second half of the interval. + strong_zero_one_descartes(S,i+1,D); return; - } + } }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h index 0db0d15701e7..67188cecd748 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -44,9 +44,9 @@ namespace internal { /*! * \brief Constructs Vert_line-objects for an algebraic curve. * - * + * * The method \ref create_event_line builds such a vert-line - * for critical x-values. See the + * for critical x-values. See the * documentation of this routines for further information. * */ @@ -68,11 +68,11 @@ class Event_line_builder { typedef typename Algebraic_kernel_with_analysis_2::Bound Bound; // \brief Univariate polynomials - typedef typename Algebraic_kernel_with_analysis_2::Polynomial_1 + typedef typename Algebraic_kernel_with_analysis_2::Polynomial_1 Polynomial_1; // \brief Bivariate polynomials - typedef typename Algebraic_kernel_with_analysis_2::Polynomial_2 + typedef typename Algebraic_kernel_with_analysis_2::Polynomial_2 Polynomial_2; // \brief Rational polynomials @@ -83,7 +83,7 @@ class Event_line_builder { // \brief Type for x-values typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; - //! \brief \c Vert_line specification for critical x-values + //! \brief \c Vert_line specification for critical x-values typedef typename Curve_analysis_2::Status_line_1 Status_line_1; // \brief Type for Polynomial traits @@ -97,13 +97,13 @@ class Event_line_builder { * * Apart from the curve itself a polynomial is passed which is expected * to be the primitive part of the curve. - * If the flag \c compute_sturm_habicht is set, the principal and + * If the flag \c compute_sturm_habicht is set, the principal and * coprincipal Sturm-Habicht coefficients of \c polynomial are computed. * These coefficients provide information about properties of the curve * at certain x-coordinates. Some methods of this class are only * possible if they are computed. * - * See \c NiX_resultant_matrix for + * See \c NiX_resultant_matrix for * more details about Sturm-Habicht sequences. */ Event_line_builder(Algebraic_kernel_with_analysis_2* kernel, @@ -113,8 +113,8 @@ class Event_line_builder { {} - /*! - * \brief Creates an event line at position \c alpha for the specified + /*! + * \brief Creates an event line at position \c alpha for the specified * curve. * * Additionally, the \c id of the event line to be created has to be @@ -131,34 +131,34 @@ class Event_line_builder { * coefficients. It is necessary that they were computed beforehand. * However, such symbolic computations need not be done if alpha is a * simple root of the resultant, so if \c mult equals 1. - * + * * The method will succeed, if the curve has only one multiple root * at \c alpha over the complex numbers. It will never succeed, if there is * more than one real root at \c alpha. In other cases, the outcome is not - * clear. In cases where the functions fails, a - * CGAL::internal::Non_generic_position_exception is thrown, otherwise, a + * clear. In cases where the functions fails, a + * CGAL::internal::Non_generic_position_exception is thrown, otherwise, a * fixed AcX::Vert_line object is returned. */ Status_line_1 create_event_line(int id,Algebraic_real_1 alpha,int arcs_left,int arcs_right, - bool root_of_resultant, bool root_of_content,int mult) + bool root_of_resultant, bool root_of_content,int mult) { try { - + int k; - Bitstream_descartes bit_des + Bitstream_descartes bit_des = construct_bitstream_descartes(alpha,k,root_of_resultant,mult, arcs_left,arcs_right); /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "bitstream descartes constructed" + CGAL_ACK_DEBUG_PRINT << "bitstream descartes constructed" << std::endl; #endif */ - + int n = bit_des.number_of_real_roots(); int c = this->get_index_of_multiple_root(bit_des); @@ -170,9 +170,9 @@ class Event_line_builder { */ int arcs_to_candidate_left=arcs_left-n+1; int arcs_to_candidate_right=arcs_right-n+1; - - //flag seems to be not used for now, but caused warnings (M.Hemmer) - //bool event_flag; + + //flag seems to be not used for now, but caused warnings (M.Hemmer) + //bool event_flag; //if(false) { if(arcs_to_candidate_left!=1 || arcs_to_candidate_right!= 1) { @@ -180,7 +180,7 @@ class Event_line_builder { } else { -// Need this flag to decide the event flag correctly, +// Need this flag to decide the event flag correctly, // we don't care about it for now! #if !CGAL_ACK_CHECK_CANDIDATE_FOR_SINGULARITY //event_flag=false; @@ -194,7 +194,7 @@ class Event_line_builder { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Ev check..." << std::flush; #endif - + typename Polynomial_traits_2::Differentiate diff; Polynomial_2 fx diff(f,0); Polynomial_2 fy diff(f,1); @@ -204,9 +204,9 @@ class Event_line_builder { } #endif } - + int root_number=bit_des.number_of_real_roots(); - + typename Status_line_1::Arc_container arc_container; for(int i=0;iis_zero_at_1_object() + if(kernel()->is_zero_at_1_object() (CGAL::leading_coefficient(polynomial),alpha)) { int n = CGAL::degree(polynomial,1); CGAL_assertion(! kernel()->is_zero_at_1_object() (CGAL::get_coefficient(polynomial,n-1), alpha)); - CGAL::Sign asym_sign + CGAL::Sign asym_sign = kernel()->sign_at_1_object() (CGAL::get_coefficient(polynomial,n-1),alpha) * kernel()->sign_at_1_object() @@ -250,8 +250,8 @@ class Event_line_builder { } } #endif - - + + if(root_of_content) { vl._set_v_line(); } @@ -259,12 +259,12 @@ class Event_line_builder { } catch(CGAL::internal::Non_generic_position_exception /* err */) { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Detected non-generic position for alpha=" + CGAL_ACK_DEBUG_PRINT << "Detected non-generic position for alpha=" << CGAL::to_double(alpha) << std::endl; #endif throw CGAL::internal::Non_generic_position_exception(); } - + } protected: @@ -279,13 +279,13 @@ class Event_line_builder { typedef boost::numeric::interval Interval; // \brief Refinement type from the curve class. - typedef typename Curve_analysis_2::Bitstream_descartes + typedef typename Curve_analysis_2::Bitstream_descartes Bitstream_descartes; - typedef typename Curve_analysis_2::Bitstream_coefficient_kernel - Bitstream_coefficient_kernel; + typedef typename Curve_analysis_2::Bitstream_coefficient_kernel + Bitstream_coefficient_kernel; - typedef typename Curve_analysis_2::Bitstream_traits + typedef typename Curve_analysis_2::Bitstream_traits Bitstream_traits; Algebraic_kernel_with_analysis_2* _m_kernel; @@ -297,10 +297,10 @@ class Event_line_builder { Polynomial_2 polynomial; - /*! + /*! * \brief Exact information about fx=alpha. * - * Returns a pair (m,k) with the following meaning. Let + * Returns a pair (m,k) with the following meaning. Let * \c seq be a sequence g0,...,gn. * Then, \c k is the first index for which gi(alpha) * is not zero. The number m is the result of the function @@ -308,8 +308,8 @@ class Event_line_builder { * C is defined as in L.Gonzalez-Vega, I.Necula: Efficient * topology determination of implicitly defined algebraic plane curves. * Computer Aided Geometric Design 19 (2002) 719-743. - * If \c seq is the sequence of principal Sturm-Habicht coefficients, - * \c m is the number of real roots of fx=alpha, + * If \c seq is the sequence of principal Sturm-Habicht coefficients, + * \c m is the number of real roots of fx=alpha, * counted without multiplicity. * * If the first elements in the sequence are known to be zero, @@ -318,19 +318,19 @@ class Event_line_builder { */ template std::pair compute_mk(Algebraic_real_1 alpha, - InputIterator seq_begin, + InputIterator seq_begin, InputIterator seq_end, - int first_elements_zero=0) { - + int first_elements_zero=0) { + typedef InputIterator Input_iterator; Algebraic_real_1& alpha_ref=alpha; int m,k=-1; // Initialize to prevent compiler warning - + bool k_fixed=false; - + std::ptrdiff_t seq_size = static_cast(std::distance(seq_begin,seq_end)); typedef int VT; @@ -348,7 +348,7 @@ class Event_line_builder { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << seq_size << " elements to consider" + CGAL_ACK_DEBUG_PRINT << seq_size << " elements to consider" << std::endl; #endif */ @@ -374,10 +374,10 @@ class Event_line_builder { */ CGAL::Sign ia_try - =kernel()->sign_at_1_object()(*seq_it, - alpha_ref, - CGAL_ACK_COMPUTE_MK_PRECISION); - + =kernel()->sign_at_1_object()(*seq_it, + alpha_ref, + CGAL_ACK_COMPUTE_MK_PRECISION); + //CGAL::Sign ia_try=CGAL::ZERO; if(ia_try!=CGAL::ZERO) { @@ -393,11 +393,11 @@ class Event_line_builder { /* #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "successful" << std::endl; -#endif +#endif */ continue; } - /* + /* #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "no success" << std::endl; CGAL_ACK_DEBUG_PRINT << "Is root of..." << std::flush; @@ -405,13 +405,13 @@ class Event_line_builder { CGAL_ACK_DEBUG_PRINT << "pol=" << *seq_it << std::endl; CGAL_ACK_DEBUG_PRINT << "alpha=" << alpha.polynomial() << std::endl; #endif - */ + */ bool root_of = kernel()->is_zero_at_1_object()(*seq_it,alpha); /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "done " - << ((root_of) ? "true" : "false") + CGAL_ACK_DEBUG_PRINT << "done " + << ((root_of) ? "true" : "false") << std::endl; #endif */ @@ -423,9 +423,9 @@ class Event_line_builder { #endif */ spec_stha.push_back(VT(0)); - } + } else { -/* +/* #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "is nonzero.." << std::flush; #endif @@ -440,15 +440,15 @@ class Event_line_builder { */ } /* -#if CGAL_ACK_DEBUG_FLAG +#if CGAL_ACK_DEBUG_FLAG ::CGAL::set_ascii_mode(CGAL_ACK_DEBUG_PRINT); CGAL_ACK_DEBUG_PRINT << "Stha: " << (*seq_it) << std::endl; #endif */ VT beta =kernel()->sign_at_1_object() (*seq_it,alpha_ref); - -/* + +/* #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Value: " << beta << std::endl; #endif @@ -470,11 +470,11 @@ class Event_line_builder { } CGAL_ACK_DEBUG_PRINT << "--------" << std::endl; #endif -*/ +*/ typename A_vector::iterator it=spec_stha.begin() + k; /* -#if CGAL_ACK_DEBUG_FLAG +#if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "k=" << k << ", Compute m..." << std::flush; #endif */ @@ -497,45 +497,45 @@ class Event_line_builder { return ret; } - /*! - * \brief Constructs a Bitstream Descartes object for + /*! + * \brief Constructs a Bitstream Descartes object for * fx=alpha * - * Tries to isolate the roots of fx=alpha with the + * Tries to isolate the roots of fx=alpha with the * Bitstream m-k-Descartes method. As additional information, the value * \c k is returned which is the greatest common divisor of \c f with its * derivative. The flag \c root_of_resultant denotes whether alpha is * a root of the resultant of \c f with its derivative. * Also, the multiplicity of \c alpha as root of the resultant is given - * It his multiplcity is 1, one can avoid the computations with the + * It his multiplcity is 1, one can avoid the computations with the * Sturm-Habicht coefficient by looking at \c arcs_left and \c arcs_right. * * This method requires the Sturm-Habicht coefficients of \c f to be * computed beforehand. - * On failure, the error CGAL::internal::Non_generic_position_exception + * On failure, the error CGAL::internal::Non_generic_position_exception * is thrown. */ - Bitstream_descartes construct_bitstream_descartes(const Algebraic_real_1& - alpha, - int& k, - bool root_of_resultant, - int mult, - int arcs_left, - int arcs_right) + Bitstream_descartes construct_bitstream_descartes(const Algebraic_real_1& + alpha, + int& k, + bool root_of_resultant, + int mult, + int arcs_left, + int arcs_right) { - - + + Bitstream_traits traits(Bitstream_coefficient_kernel(kernel(),alpha)); if(root_of_resultant) { #if !CGAL_ACK_SHEAR_ALL_NOT_Y_REGULAR_CURVES - if(kernel()->is_zero_at_1_object() + if(kernel()->is_zero_at_1_object() (CGAL::leading_coefficient(polynomial),alpha)) { - Polynomial_2 trunc_pol = + Polynomial_2 trunc_pol = CGAL::internal::poly_non_vanish_leading_term (kernel(),polynomial,alpha); - CGAL_assertion(CGAL::degree(trunc_pol,1)+1 == + CGAL_assertion(CGAL::degree(trunc_pol,1)+1 == CGAL::degree(polynomial,1)); CGAL::internal::Square_free_descartes_tag t; @@ -552,7 +552,7 @@ class Event_line_builder { k=1; } else { - std::pair mk + std::pair mk = compute_mk(alpha, curve.principal_sturm_habicht_begin(), curve.principal_sturm_habicht_end(), @@ -561,11 +561,11 @@ class Event_line_builder { m = mk.first; k = mk.second; } - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Bit Des..." << std::flush; #endif - + CGAL::internal::M_k_descartes_tag t; Bitstream_descartes bit_des(t,polynomial,m,k,traits); @@ -583,10 +583,10 @@ class Event_line_builder { /*! - * \brief Checks whether a point is a singularity or not. + * \brief Checks whether a point is a singularity or not. * * This routine is applied in situations where a potential event point - * has one incident arc to the left and to the right. To distinguish + * has one incident arc to the left and to the right. To distinguish * singularities from other points, this method checks whether the two * linearly independent partial derivatives \c der_1 and \c der_2 vansh * at the point \c (alpha,beta). Here, \c beta is implicitly defined as @@ -599,50 +599,50 @@ class Event_line_builder { * there is a singularity at (alpha,beta). */ bool event_point_checker(Bitstream_descartes& bit_des, - const Polynomial_2& polynomial, - const Algebraic_real_1& alpha, - int k, - const Polynomial_2& der_1, - const Polynomial_2& der_2) + const Polynomial_2& polynomial, + const Algebraic_real_1& alpha, + int k, + const Polynomial_2& der_1, + const Polynomial_2& der_2) { - + //Guess the right expression for y /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << costha.size() << " " + CGAL_ACK_DEBUG_PRINT << costha.size() << " " << stha.size() << std::endl; CGAL_ACK_DEBUG_PRINT << k << std::endl; - CGAL_ACK_DEBUG_PRINT << "Costha: " << costha[k-1] + CGAL_ACK_DEBUG_PRINT << "Costha: " << costha[k-1] << " Stha: " << stha[k] << std::endl; #endif */ - + Polynomial_1 p = -curve.coprincipal_sturm_habicht_of_primitive(k); - Polynomial_1 q + Polynomial_1 q = Coefficient(k)*curve.principal_sturm_habicht_of_primitive(k); /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << k << " " << CGAL::to_double(alpha) + CGAL_ACK_DEBUG_PRINT << k << " " << CGAL::to_double(alpha) << std::endl); - CGAL_ACK_DEBUG_PRINT << p << " " << q << std::endl + CGAL_ACK_DEBUG_PRINT << p << " " << q << std::endl << polynomial << std::endl; Bound a_d = alpha.low(); CGAL_ACK_DEBUG_PRINT << CGAL::to_double(p.evaluate(a_d)/ - q.evaluate(a_d)) + q.evaluate(a_d)) << std::endl; #endif */ // Check whether it lies in the candidates interval - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "iv-test..." << std::flush; #endif typedef typename CGAL::Get_arithmetic_kernel ::Arithmetic_kernel::Bigfloat_interval BFI; - + CGAL::internal::Bitstream_coefficient_kernel_at_alpha - + alpha_kernel(kernel(),alpha); int c = this->get_index_of_multiple_root(bit_des); @@ -657,7 +657,7 @@ class Event_line_builder { while(true) { CGAL::set_precision(BFI(),prec); //std::cout << "Increased to " << prec << std::endl; - BFI isol_iv + BFI isol_iv = CGAL::hull(CGAL::convert_to_bfi(bit_des.left_bound(c)), CGAL::convert_to_bfi(bit_des.right_bound(c))); BFI q_iv = alpha_kernel.convert_to_bfi_object()(q); @@ -684,10 +684,10 @@ class Event_line_builder { CGAL_ACK_DEBUG_PRINT << "on f..." << std::flush; #endif if(! CGAL::internal::zero_test_bivariate - - (kernel(),alpha,polynomial,p,q)) { + + (kernel(),alpha,polynomial,p,q)) { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Detected non-generic position for alpha=" + CGAL_ACK_DEBUG_PRINT << "Detected non-generic position for alpha=" << CGAL::to_double(alpha) << std::endl; #endif throw CGAL::internal::Non_generic_position_exception(); @@ -696,17 +696,17 @@ class Event_line_builder { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "on fx..." << std::flush; #endif - bool is_singularity - = CGAL::internal::zero_test_bivariate - - (kernel(),alpha,der_1,p,q); + bool is_singularity + = CGAL::internal::zero_test_bivariate + + (kernel(),alpha,der_1,p,q); if(is_singularity) { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "on fy..." << std::flush; #endif return CGAL::internal::zero_test_bivariate - - (kernel(),alpha,der_2,p,q); + + (kernel(),alpha,der_2,p,q); } else { return false; } @@ -723,7 +723,7 @@ class Event_line_builder { } return -1; } - + }; //class Event_line_builder diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Float_traits.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Float_traits.h index a544087dba91..0c4510582026 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Float_traits.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Float_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -15,7 +15,7 @@ // TODO: Some comments are original EXACUS comments and aren't adapted. So // they may be wrong now. -// TODO: should exponent type be long or Integer ? +// TODO: should exponent type be long or Integer ? #ifndef CGAL_ALGEBRAIC_KERNEL_D_FLOAT_TRAITS_H #define CGAL_ALGEBRAIC_KERNEL_D_FLOAT_TRAITS_H @@ -24,11 +24,11 @@ #if CGAL_USE_LEDA #include -#endif +#endif #if CGAL_USE_CORE #include -#endif +#endif #if CGAL_USE_MPFR #include @@ -40,16 +40,16 @@ namespace CGAL { namespace internal { - -// Don't define default, results in more convinient compiler messages + +// Don't define default, results in more convinient compiler messages template< class Type > class Float_traits; // { -// public: +// public: // typedef Null_functor Get_mantissa; -// typedef Null_functor Get_exponent; +// typedef Null_functor Get_exponent; // typedef Null_functor Mul_by_pow_of_2; // }; - + #ifdef CGAL_USE_LEDA // Specialization for leda_bigfloat @@ -60,14 +60,14 @@ class Float_traits< leda_bigfloat > { : public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > { leda_integer operator()( const leda_bigfloat& x ) const { //std::cout << x.get_significant() << std::endl; - return x.get_significant(); + return x.get_significant(); } }; - + struct Get_exponent : public CGAL::cpp98::unary_function< leda_bigfloat, long > { long operator()( const leda_bigfloat& x ) const { - return x.get_exponent().to_long(); + return x.get_exponent().to_long(); } }; @@ -79,22 +79,22 @@ class Float_traits< leda_bigfloat > { }; }; -#endif - +#endif + #ifdef CGAL_USE_CORE // Specialization for CORE::BigFloat template<> class Float_traits< CORE::BigFloat > { public: - + struct Get_mantissa : public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > { - CORE::BigInt operator()( const CORE::BigFloat& x ) const { + CORE::BigInt operator()( const CORE::BigFloat& x ) const { return x.m(); } }; - + struct Get_exponent : public CGAL::cpp98::unary_function< CORE::BigFloat, long > { long operator()( const CORE::BigFloat& x ) const { @@ -111,38 +111,38 @@ class Float_traits< CORE::BigFloat > { }; }; -#endif +#endif #if CGAL_USE_MPFR template<> class Float_traits< Gmpfr > { - + struct Get_mantissa_exponent : public CGAL::cpp98::unary_function< Gmpfr, std::pair > { - + std::pair operator()( const Gmpfr& x ) const { - return x.to_integer_exp(); + return x.to_integer_exp(); } }; -public: +public: struct Get_mantissa : public CGAL::cpp98::unary_function< Gmpfr, Gmpz > { Gmpz operator()( const Gmpfr& x ) const { - return Get_mantissa_exponent()(x).first; + return Get_mantissa_exponent()(x).first; } }; - + struct Get_exponent : public CGAL::cpp98::unary_function< Gmpfr, long > { - long operator()( const Gmpfr& x ) const { - return Get_mantissa_exponent()(x).second; + long operator()( const Gmpfr& x ) const { + return Get_mantissa_exponent()(x).second; } }; - + struct Mul_by_pow_of_2 : public CGAL::cpp98::binary_function< Gmpfr, Gmpz, Gmpfr> { Gmpfr operator()( const Gmpfr& a, long e ) const { - Gmpfr result(0,a.get_precision()); // just to get the prec of a + Gmpfr result(0,a.get_precision()); // just to get the prec of a if (e >= 0 ){ mpfr_mul_2si (result.fr(), a.fr(), e, mpfr_get_default_rounding_mode()); //std::cout << "INPUT : "<< a <<"+" << e << std::endl; @@ -158,7 +158,7 @@ struct Mul_by_pow_of_2 } }; }; -#endif +#endif } //namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h index cd38e6a64f11..1a28b93f83f8 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -32,48 +32,48 @@ namespace internal { template struct Interval_evaluate_1 : public CGAL::cpp98::binary_function , - std::pair::Coefficient_type,Bound>::Type, - typename CGAL::Coercion_traits::Coefficient_type,Bound>::Type> > { - + typedef CGAL::Polynomial_traits_d< Polynomial_1 > PT_1; - + typedef typename PT_1::Innermost_coefficient_type Innermost_coefficient_type; - + typedef CGAL::Coercion_traits< Innermost_coefficient_type, Bound > CT; - + typedef typename CT::Type Coercion_type; - + typedef std::pair< Coercion_type, Coercion_type > result_type; result_type operator()(const Polynomial_1& p, const std::pair< Bound, Bound >& b) const { return this->operator()(p, CGAL::make_array(b.first, b.second)); } - + result_type operator()(const Polynomial_1& p, const std::array< Bound, 2 >& b) const { - + typename CT::Cast cast; - + typedef ::boost::numeric::interval< Coercion_type > Coercion_interval; - - typedef typename PT_1::Coefficient_const_iterator + + typedef typename PT_1::Coefficient_const_iterator Coefficient_const_iterator; - + Coercion_interval ix(cast(b[0]), cast(b[1])); - - typedef typename PT_1::Coefficient_const_iterator_range + + typedef typename PT_1::Coefficient_const_iterator_range Coefficient_const_iterator_range; - - Coefficient_const_iterator_range range = + + Coefficient_const_iterator_range range = typename PT_1::Construct_coefficient_const_iterator_range()(p); - + Coefficient_const_iterator it = std::prev(range.second); - + Coercion_interval res(cast(*it)); - + Coefficient_const_iterator p_begin = range.first; while(it != p_begin) { it--; @@ -81,7 +81,7 @@ struct Interval_evaluate_1 : public CGAL::cpp98::binary_function } return std::make_pair(res.lower(),res.upper()); } - + }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h index 6cf466a5db71..136e4db05ff7 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -35,56 +35,56 @@ struct Interval_evaluate_2 : public CGAL::cpp98::binary_function , std::pair::Innermost_coefficient_type,Bound>::Type, typename CGAL::Coercion_traits::Innermost_coefficient_type,Bound>::Type> > { - + public: - + typedef CGAL::Polynomial_traits_d< Polynomial_2 > PT_2; - + typedef typename PT_2::Innermost_coefficient_type Innermost_coefficient_type; - + typedef CGAL::Coercion_traits< Innermost_coefficient_type, Bound > CT; typedef typename CT::Type Coercion_type; typedef std::pair< Coercion_type, Coercion_type > result_type; - + result_type operator()(const Polynomial_2& p, const std::array< Bound, 4 >& b) const { - + typename CT::Cast cast; - + typedef ::boost::numeric::interval< Coercion_type > Coercion_interval; - + typedef typename PT_2::Coefficient_const_iterator Coefficient_const_iterator; - - typedef typename PT_2::Coefficient_const_iterator_range + + typedef typename PT_2::Coefficient_const_iterator_range Coefficient_const_iterator_range; - + typedef typename PT_2::Coefficient_type Polynomial_1; - CGAL::internal::Interval_evaluate_1< Polynomial_1,Bound > + CGAL::internal::Interval_evaluate_1< Polynomial_1,Bound > interval_evaluate_1; - + typedef typename CGAL::internal::Interval_evaluate_1< Polynomial_1,Bound >:: result_type Interval_result_type; - + std::pair< Bound, Bound > x_pair = std::make_pair(b[0],b[1]); - + Coercion_interval iy(cast(b[2]),cast(b[3])); - + // CGAL::Polynomial does not provide Coercion_traits for number // types => therefore evaluate manually Coefficient_const_iterator_range range = typename PT_2::Construct_coefficient_const_iterator_range()(p); - + Coefficient_const_iterator it = std::prev(range.second); - + Interval_result_type initial_pair = interval_evaluate_1(*it,x_pair); Coercion_interval res(initial_pair.first,initial_pair.second); - + Coefficient_const_iterator p_begin = range.first; - + while((it) != p_begin) { it--; Interval_result_type curr_iv = interval_evaluate_1(*it,x_pair); @@ -92,7 +92,7 @@ struct Interval_evaluate_2 : public CGAL::cpp98::binary_function } return std::make_pair(res.lower(),res.upper()); } - + }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h index 6aac6a36101a..e53c9100aec4 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Pavel Emeliyanenko // @@ -38,12 +38,12 @@ namespace internal { //! \brief this class defines hashed map container with LRU capabilities, //! -//! stores pair of \c KeyType_ and \c ValueType_. Before adding to +//! stores pair of \c KeyType_ and \c ValueType_. Before adding to //! the map the input is normialized using \c Canonicalizer_ -//! \c Pred_ is binary predicate acting as an equivalence relation on +//! \c Pred_ is binary predicate acting as an equivalence relation on //! values of \c KeyType_, \c Creator_ is a mapping from \c KeyType_ to //! \c ValueType_, \c Hash_ is function object which returns hash values -//! for the keys +//! for the keys template < class KeyType_, class ValueType_, class Hash_ = boost::hash, @@ -54,8 +54,8 @@ class LRU_hashed_map { public: //!\name public typedefs - //!@{ - + //!@{ + //! this instance's first argument typedef KeyType_ Key_type; //! this instance's second argument @@ -68,7 +68,7 @@ class LRU_hashed_map typedef Canonicalizer_ Canonicalizer; //! mapping \c KeyType_ -> \c ValueType_ typedef Creator_ Creator; - + //! hashed map data type typedef std::pair Data_type; @@ -86,9 +86,9 @@ class LRU_hashed_map boost::multi_index::hashed_unique< ::boost::multi_index::member_offset, Hash, Pred > > > Hashed_map; - - + + //!@} protected: //!\name private members @@ -97,26 +97,26 @@ class LRU_hashed_map //! hashed map instance mutable Hashed_map _m_hashed_map; - + //! maximal size allowed unsigned _m_max_size; - + //!@} public: //!\name iterator types //!@{ - - //! hashed index iterator + + //! hashed index iterator typedef typename boost::multi_index::nth_index_iterator::type Hashed_iterator; - - //! sequenced index iterator + + //! sequenced index iterator typedef typename boost::multi_index::nth_index_iterator::type Sequenced_iterator; - - //! sequenced index const iterator + + //! sequenced index const iterator typedef typename boost::multi_index::nth_index_const_iterator::type Sequenced_const_iterator; @@ -125,31 +125,31 @@ class LRU_hashed_map //! \c Data_type and a boolean indicating whether an element with //! specified key was found typedef std::pair Find_result; - + //!@} public: //!\name constructors and access functions //!@{ - + //! \brief default constructor - LRU_hashed_map(unsigned max_size = + LRU_hashed_map(unsigned max_size = (std::numeric_limits< unsigned >::max)()) : - _m_hashed_map(),_m_max_size(max_size) + _m_hashed_map(),_m_max_size(max_size) { } - + virtual ~LRU_hashed_map() { } - + /*! \brief implements cache-like behaviour of the map * * If the object is not in the map, it is constructed using \c Creator * and added to the map */ - Value_type operator()(const Key_type& key_) const + Value_type operator()(const Key_type& key_) const { Canonicalizer canonicalize; Key_type key = canonicalize(key_); - + Find_result p = find(key); if(!p.second) { Creator create; @@ -159,14 +159,14 @@ class LRU_hashed_map } return (p.first)->second; } - + //! \brief looks for an entry with a specified key in the map //! //! returns a pair of iterator pointing to \c Data_type and a boolean //! indicating whether an element with specified key was found - Find_result find(const Key_type& key) const + Find_result find(const Key_type& key) const { - typename boost::multi_index::nth_index::type& + typename boost::multi_index::nth_index::type& idx = _m_hashed_map.template get<1>(); Hashed_iterator it = idx.find(key); if(it == idx.end()) { @@ -175,16 +175,16 @@ class LRU_hashed_map // otherwise put the accessed element on the top // Comment out because of compiler problems with 3.4 - /* - _m_hashed_map.relocate(_m_hashed_map.begin(), + /* + _m_hashed_map.relocate(_m_hashed_map.begin(), _m_hashed_map.project<0>(it)); - */ + */ return Find_result(it, true); } - + //! \brief inserts an entry to the map //! - //! on successful insertion, \c p.first points to the element + //! on successful insertion, \c p.first points to the element //! inserted; otherwise \c p.first points to an element that caused //! the insertion to be banned. If the map's size exceeds \c max_size //! the least recently used entry is dropped @@ -194,7 +194,7 @@ class LRU_hashed_map _m_hashed_map.pop_back(); return _m_hashed_map.push_front(data); } - + //! clears the map contents void clear() { _m_hashed_map.clear(); } @@ -216,25 +216,25 @@ class LRU_hashed_map Sequenced_iterator end() { return _m_hashed_map.end(); } //! returns a const_iterator pointing to the beginning of the map - Sequenced_const_iterator begin() const + Sequenced_const_iterator begin() const { return _m_hashed_map.begin(); } //! Returns a const_iterator pointing to the end of the map - Sequenced_const_iterator end() const + Sequenced_const_iterator end() const { return _m_hashed_map.end(); } - + //!@} }; // class LRU_hashed_map_with_kernel //! \brief this class defines hashed map container with LRU capabilities, //! -//! stores pair of \c KeyType_ and \c ValueType_. Before adding to +//! stores pair of \c KeyType_ and \c ValueType_. Before adding to //! the map the input is normialized using \c Canonicalizer_ -//! \c Pred_ is binary predicate acting as an equivalence relation on +//! \c Pred_ is binary predicate acting as an equivalence relation on //! values of \c KeyType_, \c Creator_ is a mapping from \c KeyType_ to //! \c ValueType_, \c Hash_ is function object which returns hash values -//! for the keys +//! for the keys template < class AlgebraicKernelWithAnalysis_2, class KeyType_, class ValueType_, @@ -242,7 +242,7 @@ template < class Pred_ = std::equal_to, class Canonicalizer_ = CGAL::Identity, class Creator_ = CGAL::Creator_1 > -class LRU_hashed_map_with_kernel +class LRU_hashed_map_with_kernel : public LRU_hashed_map { @@ -253,7 +253,7 @@ class LRU_hashed_map_with_kernel typedef LRU_hashed_map Base; - + //! this instance's first argument typedef typename Base::Key_type Key_type; //! this instance's second argument @@ -266,7 +266,7 @@ class LRU_hashed_map_with_kernel typedef typename Base::Canonicalizer Canonicalizer; //! mapping \c KeyType_ -> \c ValueType_ typedef typename Base::Creator Creator; - + //! hashed map data type typedef typename Base::Data_type Data_type; @@ -274,7 +274,7 @@ class LRU_hashed_map_with_kernel protected: - + Algebraic_kernel_with_analysis_2* _m_kernel; @@ -282,46 +282,46 @@ class LRU_hashed_map_with_kernel //!\name iterator types //!@{ - - //! hashed index iterator + + //! hashed index iterator typedef typename Base::Hashed_iterator Hashed_iterator; - - //! sequenced index iterator + + //! sequenced index iterator typedef typename Base::Sequenced_iterator Sequenced_iterator; - - //! sequenced index const iterator + + //! sequenced index const iterator typedef typename Base::Sequenced_const_iterator Sequenced_const_iterator; //! result type of \c find operation: a pair of iterator pointing to //! \c Data_type and a boolean indicating whether an element with //! specified key was found typedef typename Base::Find_result Find_result; - + //!@} //!\name constructors and access functions //!@{ - + //! \brief default constructor LRU_hashed_map_with_kernel(Algebraic_kernel_with_analysis_2* kernel, - unsigned max_size = (std::numeric_limits::max)()) : + unsigned max_size = (std::numeric_limits::max)()) : Base(max_size), _m_kernel(kernel) { } - + ~LRU_hashed_map_with_kernel() { } - + /*! \brief implements cache-like behaviour of the map * * If the object is not in the map, it is constructed using \c Creator * and added to the map */ - Value_type operator()(const Key_type& key_) const + Value_type operator()(const Key_type& key_) const { Canonicalizer canonicalize; Key_type key = canonicalize(key_); - + Find_result p = this->find(key); if(!p.second) { Creator create(_m_kernel); @@ -331,7 +331,7 @@ class LRU_hashed_map_with_kernel } return (p.first)->second; } - + //!@} }; // class LRU_hashed_map_with_kernel @@ -375,7 +375,7 @@ struct Poly_hasher { typedef typename Poly_2::NT Poly_1; typedef typename Poly_1::NT NT; - + const Poly_1& v = p[0]; typename Poly_1::const_iterator cit; NT res(0); @@ -390,23 +390,23 @@ struct Poly_hasher { return static_cast(CGAL::to_double(res)); } }; - + struct Pair_id_hasher { typedef size_t result_type; template size_t operator()(const std::pair& p) const { - + std::size_t seed = p.first.id() + 0x9e3779b9; seed ^= p.second.id() + 0x9e3779b9 + (seed << 6) + (seed >> 2); return seed; - } + } }; struct Pair_hasher { typedef size_t result_type; - + template size_t operator()(const std::pair& p) const { diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_embeddable_extension.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_embeddable_extension.h index 0cfec717b1c8..880b4e827202 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_embeddable_extension.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_embeddable_extension.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -36,15 +36,15 @@ #ifdef CGAL_USE_GMP #include #include -#endif +#endif #ifdef CGAL_USE_MPFR #include -#endif +#endif #ifdef CGAL_USE_MPFI #include -#endif +#endif namespace CGAL { @@ -53,8 +53,8 @@ namespace internal { // TODO: Implement array in source code file // extern const signed char floor_log2_4bit[16]; // see src/floor_log2_4bit.C - -// Don't define default, results in more convinient compiler messages + +// Don't define default, results in more convinient compiler messages template< class Type > class Real_embeddable_extension; // { // public: @@ -65,13 +65,13 @@ template< class Type > class Real_embeddable_extension; // }; - + // Functor adapting functions template< class NT > long floor_log2_abs( const NT& x ) { return typename Real_embeddable_extension< NT >::Floor_log2_abs()( x ); } - + template< class NT > long ceil_log2_abs( const NT& x ) { return typename Real_embeddable_extension< NT >::Ceil_log2_abs()( x ); @@ -91,8 +91,8 @@ ceil (const NT& x) { // Specialization for long template<> -class Real_embeddable_extension< long > { -public: +class Real_embeddable_extension< long > { +public: struct Ceil_log2_abs : public CGAL::cpp98::unary_function< long, long > { long operator()( long x ) { @@ -105,7 +105,7 @@ class Real_embeddable_extension< long > { struct Floor_log2_abs : public CGAL::cpp98::unary_function< long, long > { - private: + private: signed char floor_log2_4bit[16]; public: Floor_log2_abs() { @@ -124,9 +124,9 @@ class Real_embeddable_extension< long > { floor_log2_4bit[12] = 3; floor_log2_4bit[13] = 3; floor_log2_4bit[14] = 3; - floor_log2_4bit[15] = 3; + floor_log2_4bit[15] = 3; } - + long operator()( long x ) { if (x < 0) x = -x; CGAL_precondition(x > 0); @@ -152,7 +152,7 @@ class Real_embeddable_extension< long > { #ifdef CGAL_USE_LEDA // Specialization for leda_integer - + template<> class Real_embeddable_extension< leda_integer > { public: @@ -174,7 +174,7 @@ class Real_embeddable_extension< leda_integer > { while (--i >= 0) { if (x.contents(i) != 0) return l+1; } - return l; + return l; } }; @@ -182,7 +182,7 @@ class Real_embeddable_extension< leda_integer > { : public CGAL::cpp98::unary_function< leda_integer, long > { long operator()( const leda_integer& x ) const { CGAL_precondition(x != leda_integer(0)); - ::leda::digit_sz ldgzeros + ::leda::digit_sz ldgzeros = ::leda::digLeadingZeros(x.highword()); result_type l = x.used_words() * ::leda::DIGIT_LENGTH - 1 - ldgzeros; @@ -199,7 +199,7 @@ class Real_embeddable_extension< leda_integer > { leda_integer operator() (const leda_integer& x) const { return x;} }; }; - + template<> class Real_embeddable_extension< leda_bigfloat > { public: @@ -212,34 +212,34 @@ class Real_embeddable_extension< leda_bigfloat > { CGAL_precondition(CGAL::sign(x) != CGAL::ZERO); ::leda::integer abs_sign = abs(x.get_significant()); return (x.get_exponent() + ::leda::log(abs_sign)).to_long(); - + } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< leda_bigfloat, long > { long operator()( const leda_bigfloat& x ) const { CGAL_precondition(CGAL::sign(x) != CGAL::ZERO); - return ::leda::ilog2(x).to_long(); + return ::leda::ilog2(x).to_long(); } }; struct Floor : public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > { - leda_integer operator() ( const leda_bigfloat& x ) const { + leda_integer operator() ( const leda_bigfloat& x ) const { return leda::to_integer( x, leda::TO_N_INF ); } }; - + struct Ceil : public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > { - leda_integer operator() ( const leda_bigfloat& x ) const { + leda_integer operator() ( const leda_bigfloat& x ) const { return leda::to_integer( x, leda::TO_P_INF ); } }; }; - + template<> class Real_embeddable_extension< leda_bigfloat_interval > { public: @@ -247,41 +247,41 @@ class Real_embeddable_extension< leda_bigfloat_interval > { struct Floor_log2_abs : public CGAL::cpp98::unary_function< leda_bigfloat_interval, long > { - + result_type operator() (const argument_type& x) const { CGAL_precondition(! ::boost::numeric::in_zero(x)); return internal::floor_log2_abs(::boost::numeric::abs(x).lower()); - } + } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< leda_bigfloat_interval, long > { long operator()( const leda_bigfloat_interval& x ) const { - CGAL_precondition(!(::boost::numeric::in_zero(x) && + CGAL_precondition(!(::boost::numeric::in_zero(x) && ::boost::numeric::singleton(x))); - return internal::ceil_log2_abs(::boost::numeric::abs(x).upper()); + return internal::ceil_log2_abs(::boost::numeric::abs(x).upper()); } }; struct Floor : public CGAL::cpp98::unary_function< leda_bigfloat_interval, leda_integer > { - leda_integer operator() ( const leda_bigfloat_interval& x ) - const { + leda_integer operator() ( const leda_bigfloat_interval& x ) + const { return internal::floor( x.lower() ); } }; - + struct Ceil : public CGAL::cpp98::unary_function< leda_bigfloat_interval, leda_integer > { - leda_integer operator() ( const leda_bigfloat_interval& x ) - const { + leda_integer operator() ( const leda_bigfloat_interval& x ) + const { return internal::ceil( x.upper() ); } }; }; - + #endif - + #ifdef CGAL_USE_CORE // Specialization for CORE::BigInt @@ -293,9 +293,9 @@ class Real_embeddable_extension< CORE::BigInt > { : public CGAL::cpp98::unary_function< CORE::BigInt, long > { long operator()( const CORE::BigInt& x ) const { return CORE::floorLg(x); - } + } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< CORE::BigInt, long > { long operator()( const CORE::BigInt& x ) const { @@ -305,13 +305,13 @@ class Real_embeddable_extension< CORE::BigInt > { struct Floor : public CGAL::cpp98::unary_function< CORE::BigInt, CORE::BigInt > { - CORE::BigInt operator() (const CORE::BigInt& x) const { + CORE::BigInt operator() (const CORE::BigInt& x) const { return x; } }; struct Ceil : public CGAL::cpp98::unary_function< CORE::BigInt, CORE::BigInt > { - CORE::BigInt operator() (const CORE::BigInt& x) const { + CORE::BigInt operator() (const CORE::BigInt& x) const { return x; } }; @@ -328,9 +328,9 @@ class Real_embeddable_extension< CORE::BigFloat > { CGAL_precondition(!CGAL::zero_in(x)); x = CGAL::abs(x); return CORE::floorLg(x.m()-x.err())+x.exp()*CORE::CHUNK_BIT; - } + } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< CORE::BigFloat, long > { long operator()( CORE::BigFloat x ) const { @@ -343,7 +343,7 @@ class Real_embeddable_extension< CORE::BigFloat > { struct Floor : public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > { - CORE::BigInt operator() ( const CORE::BigFloat& x ) const { + CORE::BigInt operator() ( const CORE::BigFloat& x ) const { CORE::BigInt xi = x.BigIntValue(); if(x.sign() < 0 && x.cmp(xi)!=0) { xi--; @@ -351,10 +351,10 @@ class Real_embeddable_extension< CORE::BigFloat > { return xi; } }; - + struct Ceil : public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > { - CORE::BigInt operator() ( const CORE::BigFloat& x ) const { + CORE::BigInt operator() ( const CORE::BigFloat& x ) const { CORE::BigInt xi = x.BigIntValue(); if(x.sign() >0 && x.cmp(xi)!=0) { xi++; @@ -380,38 +380,38 @@ class Real_embeddable_extension< Gmpz > { long operator()( const Gmpz& x ) const { CGAL_precondition(!CGAL::is_zero(x)); return static_cast(mpz_sizeinbase(x.mpz(),2)-1); - } + } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< Gmpz, long > { long operator()( const Gmpz& x ) const { long pos = mpz_scan1(x.mpz(),0); long size = static_cast(mpz_sizeinbase(x.mpz(),2)); - if (pos == size-1) + if (pos == size-1) return size-1; - else + else return size; } }; struct Floor : public CGAL::cpp98::unary_function< Gmpz, Gmpz > { - Gmpz operator() (const Gmpz& x) const { + Gmpz operator() (const Gmpz& x) const { return x; } }; struct Ceil : public CGAL::cpp98::unary_function< Gmpz, Gmpz > { - Gmpz operator() (const Gmpz& x) const { + Gmpz operator() (const Gmpz& x) const { return x; } }; }; -#endif +#endif -#ifdef CGAL_USE_MPFR +#ifdef CGAL_USE_MPFR template<> class Real_embeddable_extension< Gmpfr > { public: @@ -420,19 +420,19 @@ class Real_embeddable_extension< Gmpfr > { struct Floor_log2_abs : public CGAL::cpp98::unary_function< Gmpfr, long > { long operator()( const Gmpfr& x ) const { - Float_traits::Get_mantissa get_mantissa; - Float_traits::Get_exponent get_exponent; + Float_traits::Get_mantissa get_mantissa; + Float_traits::Get_exponent get_exponent; CGAL_precondition(!CGAL::is_zero(x)); Real_embeddable_extension::Floor_log2_abs floor_log2_abs; return floor_log2_abs(get_mantissa(x))+get_exponent(x); } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< Gmpfr, long > { long operator()( const Gmpfr& x ) const { - Float_traits::Get_mantissa get_mantissa; - Float_traits::Get_exponent get_exponent; + Float_traits::Get_mantissa get_mantissa; + Float_traits::Get_exponent get_exponent; CGAL_precondition(!CGAL::is_zero(x)); Real_embeddable_extension::Ceil_log2_abs ceil_log2_abs; return ceil_log2_abs(get_mantissa(x))+get_exponent(x); @@ -441,24 +441,24 @@ class Real_embeddable_extension< Gmpfr > { struct Floor : public CGAL::cpp98::unary_function< Gmpfr, Gmpz > { - Gmpz operator() ( const Gmpfr& x ) const { - Gmpz result; + Gmpz operator() ( const Gmpfr& x ) const { + Gmpz result; mpfr_get_z (result.mpz(),x.fr(),GMP_RNDD); - return result; + return result; } }; - + struct Ceil : public CGAL::cpp98::unary_function< Gmpfr, Gmpz > { - Gmpz operator() ( const Gmpfr& x ) const { - Gmpz result; + Gmpz operator() ( const Gmpfr& x ) const { + Gmpz result; mpfr_get_z (result.mpz(),x.fr(),GMP_RNDU); - return result; + return result; } }; }; -#endif +#endif #ifdef CGAL_USE_MPFI template<> @@ -471,36 +471,36 @@ class Real_embeddable_extension< Gmpfi > { result_type operator() (const argument_type& x) const { CGAL_precondition(!x.is_zero()); return internal::floor_log2_abs(x.abs().inf()); - } + } }; - + struct Ceil_log2_abs : public CGAL::cpp98::unary_function< Gmpfi, long > { long operator()( const Gmpfi& x ) const { CGAL_precondition(!x.inf().is_zero() || !x.sup().is_zero()); - return internal::ceil_log2_abs(x.abs().sup()); + return internal::ceil_log2_abs(x.abs().sup()); } }; struct Floor : public CGAL::cpp98::unary_function< Gmpfi, Gmpz > { - Gmpz operator() ( const Gmpfi& x ) - const { + Gmpz operator() ( const Gmpfi& x ) + const { return internal::floor( x.inf() ); } }; - + struct Ceil : public CGAL::cpp98::unary_function< Gmpfi, Gmpz > { - Gmpz operator() ( const Gmpfi& x ) - const { + Gmpz operator() ( const Gmpfi& x ) + const { return internal::ceil( x.sup() ); } }; }; - + #endif - + } //namespace internal } //namespace CGAL diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h index 359c92c4bba2..f4a346b4f604 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -17,7 +17,7 @@ /*! \file NiX/Real_roots.h - \brief This file defines the class NiX::Real_roots. + \brief This file defines the class NiX::Real_roots. */ #ifndef CGAL_ALGEBRAIC_KERNEL_D_REAL_ROOTS_H @@ -31,17 +31,17 @@ #include -namespace CGAL { +namespace CGAL { namespace internal { - + /*! \ingroup NiX_Real_roots * \brief This class provides operators for a comfortable construction of - * AlgebraicReal from Polynomials using a specific RealRootIsolator. + * AlgebraicReal from Polynomials using a specific RealRootIsolator. * - * A valid template argument for AlgebraicReal is NiX::Algebraic_real. + * A valid template argument for AlgebraicReal is NiX::Algebraic_real. */ -template < class AlgebraicReal , +template < class AlgebraicReal , class RealRootIsolator > class Real_roots{ public: @@ -49,29 +49,29 @@ class Real_roots{ typedef Real_roots Self; //! First template argument. typedef AlgebraicReal Algebraic_real; - //! Second template argument. + //! Second template argument. typedef RealRootIsolator Real_root_isolator; //! The Polnomial type used by Algebraic_real and the Real_root_isolator. typedef typename Algebraic_real::Polynomial_1 Polynomial; private: - typedef typename AlgebraicReal::Coefficient Coefficient; - typedef typename AlgebraicReal::Rational Rational; -private: + typedef typename AlgebraicReal::Coefficient Coefficient; + typedef typename AlgebraicReal::Rational Rational; +private: template < class PolynomialIterator, class IntIterator, - class AlgebraicRealOutputIterator, + class AlgebraicRealOutputIterator, class IntOutputIterator> int gen_agebraic_reals_with_mults( PolynomialIterator fac, PolynomialIterator fac_end, IntIterator mul, IntIterator CGAL_precondition_code(mul_end), AlgebraicRealOutputIterator oi_root, - IntOutputIterator oi_mult){ - + IntOutputIterator oi_mult){ + Self real_roots; typedef std::pair PAIR; - + // find zeroes of each factor and sort them in ascending order std::priority_queue< PAIR,std::vector,std::greater > pqueue; std::vector tmp; @@ -86,7 +86,7 @@ int gen_agebraic_reals_with_mults( PolynomialIterator fac, fac++; mul++; } - + // output factors and multiplicities int n = 0; while (!pqueue.empty()) { @@ -123,45 +123,45 @@ void write_factors_by_multiplicity(PolynomialConstIterator fac, public: /*! \brief computes all roots of the square free polynomial P in * ascending order and returns the number of real roots. - */ + */ template -int operator()(const Polynomial& poly , - AlgebraicRealOutputIterator it){ - +int operator()(const Polynomial& poly , + AlgebraicRealOutputIterator it){ + CGAL_precondition_msg( typename CGAL::Polynomial_traits_d< Polynomial >::Is_square_free()(poly), "P not square free."); return (*this)(Real_root_isolator(poly),it); } - + public: /*! \brief computes all roots of the polynomial P in ascending order * and their multiplicity and returns the number of real roots. * * This operator returns the number \e n of distinct real roots of \c poly. - * Each root is represented as an object of an instance AlgebraicReal. + * Each root is represented as an object of an instance AlgebraicReal. * The operator writes these \e n real zeroes in ascending order to \c - * oi_root. + * oi_root. * It writes the multiplicities of the zeroes in the same order to - * \c oi_mult . + * \c oi_mult . */ -template int operator()(const Polynomial& poly, AlgebraicRealOutputIterator oi_root, - IntOutputIterator oi_mult){ + IntOutputIterator oi_mult){ CGAL_precondition(CGAL::degree(poly) >= 0); - // fast exit - if (CGAL::degree(poly) == 0) + // fast exit + if (CGAL::degree(poly) == 0) return (poly.is_zero())?-1:0; - + std::list sqffac; std::list facmul; - + filtered_square_free_factorize_utcf(poly, - std::back_inserter(sqffac), - std::back_inserter(facmul)); - - + std::back_inserter(sqffac), + std::back_inserter(facmul)); + + int number_of_real_roots= gen_agebraic_reals_with_mults(sqffac.begin(),sqffac.end(), facmul.begin(),facmul.end(), @@ -169,15 +169,15 @@ int operator()(const Polynomial& poly, oi_mult); return number_of_real_roots; } - -public: + +public: /*! \brief computes all roots defined by the Real_root_isolator object in - * ascending order + * ascending order */ template -int operator()(const Real_root_isolator& isolator, - AlgebraicRealOutputIterator it){ - +int operator()(const Real_root_isolator& isolator, + AlgebraicRealOutputIterator it){ + Polynomial poly = isolator.polynomial(); //cout << "P: "< conjugated_roots; - std::back_insert_iterator > con_it + std::back_insert_iterator > con_it = std::back_inserter(conjugated_roots); // construct AlgebraicReal for(int j = 0 ; j < isolator.number_of_real_roots(); j++){ @@ -207,7 +207,7 @@ int operator()(const Real_root_isolator& isolator, CGAL::simplify(root); *it++=AlgebraicReal(root); }else{ - // other roots + // other roots Rational left = isolator.left_bound(j); Rational right= isolator.right_bound(j); CGAL::simplify(left); @@ -215,8 +215,8 @@ int operator()(const Real_root_isolator& isolator, AlgebraicReal tmp(poly,left,right); *it++=tmp; *con_it++=tmp; - } - } + } + } AlgebraicReal::conjugate(conjugated_roots.begin(), conjugated_roots.end()); return isolator.number_of_real_roots(); @@ -230,11 +230,11 @@ int operator()(const Real_root_isolator& isolator, * their respective multiplicities. * * This operator returns the number \e n of distinct real roots of \c poly . - * Each root is represented as an object of an instance AlgebraicReal. + * Each root is represented as an object of an instance AlgebraicReal. * The operator writes these \e n real zeroes in ascending order to \c - * oi_root. + * oi_root. * It writes the multiplicities of the roots in the same order to - * \c oi_mult . + * \c oi_mult . * Finally, it writes the square-free factors of \c p * to \c oi_poly such that the factor #k written is the factor * with exponent \e k in the square-free factorization of \c p , or @@ -244,45 +244,45 @@ int operator()(const Real_root_isolator& isolator, * * The data types involved are determined the \c AlgebraicReal * template argument. In particular, \c p must be of type - * \c NiX::Polynomial, as are its factors; - * the roots are of type \c AlgebraicReal ; and the multiplicities are + * \c NiX::Polynomial, as are its factors; + * the roots are of type \c AlgebraicReal ; and the multiplicities are * of type \c int . * */ template -int operator()( const Polynomial& poly, +int operator()( const Polynomial& poly, AlgebraicRealOutputIterator oi_root, - IntOutputIterator oi_mult, + IntOutputIterator oi_mult, PolynomialOutputIterator oi_poly) { - + CGAL_precondition(CGAL::degree(poly) >= 0); - - // fast exit - if (CGAL::degree(poly) == 0) + + // fast exit + if (CGAL::degree(poly) == 0) return (poly.is_zero())?-1:0; - - + + std::list sqffac; std::list facmul; - + filtered_square_free_factorize_utcf(poly, - std::back_inserter(sqffac), - std::back_inserter(facmul)); - + std::back_inserter(sqffac), + std::back_inserter(facmul)); + write_factors_by_multiplicity(sqffac.begin(),sqffac.end(), facmul.begin(),facmul.end(), oi_poly); - + int numer_of_real_roots = gen_agebraic_reals_with_mults(sqffac.begin(),sqffac.end(), - facmul.begin(),facmul.end(), - oi_root, - oi_mult); + facmul.begin(),facmul.end(), + oi_root, + oi_mult); return numer_of_real_roots; - } - }; + } + }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_controller.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_controller.h index bd3e08f4b7fd..66cf83685966 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_controller.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_controller.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -31,7 +31,7 @@ namespace CGAL { * \brief A class that controls the used shear factors * * The objects returns positive integers that are used as shear factors. - * It choses integers from the range \c 1..max at random , + * It choses integers from the range \c 1..max at random , * where \c c is a positive integer * initially set in the constructor (8 by default). No integer is given * twice by \c get_shear_factor(), at least if the failed ones are reported @@ -41,14 +41,14 @@ namespace CGAL { */ template class Shear_controller { - + public: - + //! Constructor, getting the maximal absolute value of the shear factor Shear_controller() - : + : #if CGAL_ACK_STATIC_SEED - #warning Warning, uses static seed! + #warning Warning, uses static seed! rng(CGAL_ACK_STATIC_SEED) #else rng() @@ -56,17 +56,17 @@ namespace CGAL { , m_max(InitialMax) , pos_next_factor(0) { CGAL_assertion(m_max>=1); - } - + } + //! Reports that the shear factor \c factor was bad. - void report_failure(Int factor) { + void report_failure(Int factor) { this->bad_shears.insert(factor); - long failures=static_cast(this->bad_shears.size())+1; - if(2*failures>this->m_max) { - this->m_max*=2; - } - - } + long failures=static_cast(this->bad_shears.size())+1; + if(2*failures>this->m_max) { + this->m_max*=2; + } + + } //! Gets a shear factor Int get_shear_factor() { @@ -79,20 +79,20 @@ namespace CGAL { private: //! Gets a new shear factor - Int get_new_shear_factor() { - CGAL_assertion(int(this->bad_shears.size())::max)())%m_max )+1); - if(bad_shears.find(s)==bad_shears.end()) { - return s; - } - } - } + Int get_new_shear_factor() { + CGAL_assertion(int(this->bad_shears.size())::max)())%m_max )+1); + if(bad_shears.find(s)==bad_shears.end()) { + return s; + } + } + } Random rng; - - // Maximal absolute value - Int m_max; + + // Maximal absolute value + Int m_max; static std::vector& value_order() { CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(std::vector, value_order_); @@ -100,10 +100,10 @@ namespace CGAL { } int pos_next_factor; - + // Unsuccessful shear factors - std::set bad_shears; - + std::set bad_shears; + }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h index f96babf8931f..c2a38d23e292 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -34,13 +34,13 @@ namespace CGAL { template class Shear_transformation { public: - + typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2; - typedef typename Algebraic_kernel_with_analysis_2::Curve_analysis_2 + typedef typename Algebraic_kernel_with_analysis_2::Curve_analysis_2 Curve_analysis_2; - typedef typename AlgebraicKernelWithAnalysis_2::Polynomial_traits_2 + typedef typename AlgebraicKernelWithAnalysis_2::Polynomial_traits_2 Polynomial_traits_2; CGAL_ACK_SNAP_ALGEBRAIC_CURVE_KERNEL_2_TYPEDEFS(Curve_analysis_2); @@ -50,8 +50,8 @@ template class Shear_transformation { typedef std::vector< Algebraic_real_1 > Root_container; typedef typename Root_container::iterator Root_iterator; - - typedef typename Curve_analysis_2::Event_line_iterator + + typedef typename Curve_analysis_2::Event_line_iterator Status_line_1_iterator; private: @@ -72,7 +72,7 @@ template class Shear_transformation { sh_disc_roots_computed(false) {} - template + template void report_sheared_disc_roots(InputIterator begin, InputIterator end) { std::copy(begin,end,std::back_inserter(sh_disc_roots)); @@ -86,17 +86,17 @@ template class Shear_transformation { return D; } - void operator() (const Curve_analysis_2& C, Integer s, Curve_analysis_2& D, + void operator() (const Curve_analysis_2& C, Integer s, Curve_analysis_2& D, bool use_primitive_curve=true) { this->C=C; this->s=s; this->use_primitive_curve = use_primitive_curve; /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Curve_analysis_2: " + CGAL_ACK_DEBUG_PRINT << "Curve_analysis_2: " << C.polynomial_2() << std::endl; - CGAL_ACK_DEBUG_PRINT << "num events: " - << C.number_of_status_lines_with_event() + CGAL_ACK_DEBUG_PRINT << "num events: " + << C.number_of_status_lines_with_event() << std::endl; CGAL_ACK_DEBUG_PRINT << "s: " << s << std::endl; #endif @@ -135,18 +135,18 @@ template class Shear_transformation { CGAL_ACK_DEBUG_PRINT << "done.." << std::flush; #endif } - + der_sh_pol = typename Polynomial_traits_2::Differentiate() (sh_pol,1); sh_der_sh_pol = CGAL::internal::shear(der_sh_pol,Coefficient(-s)); - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif Solve_1 solve_1; - + #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Store the discriminant roots.." + CGAL_ACK_DEBUG_PRINT << "Store the discriminant roots.." << std::flush; #endif @@ -162,23 +162,23 @@ template class Shear_transformation { if(! sh_disc_roots_computed) { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Compute the sheared discriminant.." + CGAL_ACK_DEBUG_PRINT << "Compute the sheared discriminant.." << std::flush; #endif if(typename Polynomial_traits_2::Degree() (sh_pol) > 0) { - - Polynomial_1 sh_disc + + Polynomial_1 sh_disc = CGAL::resultant(sh_pol,der_sh_pol); - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "root isolation.." << std::flush; #endif solve_1(sh_disc,std::back_inserter(sh_disc_roots),false); - + } - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif @@ -191,23 +191,23 @@ template class Shear_transformation { Root_container ev_res_roots; if(typename Polynomial_traits_2::Degree() (sh_pol) > 0) { Polynomial_1 ev_res = CGAL::resultant(pol,sh_der_sh_pol); - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "root isolation.." << std::flush; #endif solve_1(ev_res,std::back_inserter(ev_res_roots),false); - + } - + #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "done, " << ev_res_roots.size() + CGAL_ACK_DEBUG_PRINT << "done, " << ev_res_roots.size() << " roots found" << std::endl; #endif #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Merge both root sets..." << std::flush; #endif - typename CGAL::Real_embeddable_traits::Compare + typename CGAL::Real_embeddable_traits::Compare x_compare; CGAL::internal::set_union_with_source @@ -218,17 +218,17 @@ template class Shear_transformation { std::back_inserter(x_structure), std::back_inserter(x_structure_info), x_compare); - + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; CGAL_ACK_DEBUG_PRINT << "Take the stripe values..." << std::flush; #endif CGAL::internal::find_intermediate_values - (kernel(), - sh_disc_roots.begin(), - sh_disc_roots.end(), - std::back_inserter(stripe_values)); + (kernel(), + sh_disc_roots.begin(), + sh_disc_roots.end(), + std::back_inserter(stripe_values)); #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; CGAL_ACK_DEBUG_PRINT << "Search sheared event points..." << std::flush; @@ -237,7 +237,7 @@ template class Shear_transformation { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; - CGAL_ACK_DEBUG_PRINT << "Find start- and endpoints for sweep.." + CGAL_ACK_DEBUG_PRINT << "Find start- and endpoints for sweep.." << std::flush; #endif find_far_points(D); @@ -246,20 +246,20 @@ template class Shear_transformation { CGAL_ACK_DEBUG_PRINT << "done" << std::endl; CGAL_ACK_DEBUG_PRINT << "Start sweep..." << std::flush; #endif - + sweep(); #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; CGAL_ACK_DEBUG_PRINT << "vert lines info:" << std::endl; for(int i=0;i(pre_vert_lines.size());i++) { - - CGAL_ACK_DEBUG_PRINT << "At: " + + CGAL_ACK_DEBUG_PRINT << "At: " << CGAL::to_double(sh_disc_roots[i]) << ", " << pre_vert_lines[i].number_of_non_event_roots - << " non-event-roots, and " + << " non-event-roots, and " << pre_vert_lines[i].event_points.size() - << std::endl; + << std::endl; } CGAL_ACK_DEBUG_PRINT << "Vert_lines.." << std::flush; #endif @@ -279,7 +279,7 @@ template class Shear_transformation { } private: - + // X-coordinate of the shear of p Bound x_sheared(Point p,Integer sh) { return p.first-sh*p.second; @@ -289,7 +289,7 @@ template class Shear_transformation { } int compute_stripe(Status_line_1& ev, int index) { - int left_index = -1, + int left_index = -1, right_index = static_cast(stripe_values.size()-1); Algebraic_real_1 xv = ev.x(); Bound lx = xv.low(), rx=xv.high(), @@ -340,7 +340,7 @@ template class Shear_transformation { if(descartes.left_bound(0) upper_bound) { upper_bound = descartes.right_bound(m-1); } @@ -358,7 +358,7 @@ template class Shear_transformation { if(C.number_of_status_lines_with_event()>0) { if(far_left>C.status_line_at_event(0).x().low()) { far_left = C.status_line_at_event(0).x().low(); - } + } if(far_right class Shear_transformation { y_in_box = (upper_bound + lower_bound)/2; /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "far_left: " << far_left << "\nfar_right: " - << far_right << "\ny_in_box: " << y_in_box + CGAL_ACK_DEBUG_PRINT << "far_left: " << far_left << "\nfar_right: " + << far_right << "\ny_in_box: " << y_in_box << std::endl; #endif */ @@ -399,34 +399,34 @@ template class Shear_transformation { } // left side - + CGAL_assertion(left.x().is_rational()); Bound left_x = left.x().rational(); - - Polynomial_1 left_pol = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (pol, 0, 1), - left_x); + + Polynomial_1 left_pol = kernel()->evaluate_utcf_2_object() + (typename Polynomial_traits_2::Swap() (pol, 0, 1), + left_x); Polynomial_1 left_sh_der_sh_pol = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (sh_der_sh_pol, 0, 1), - left_x); + (typename Polynomial_traits_2::Swap() (sh_der_sh_pol, 0, 1), + left_x); // right side - + CGAL_assertion(right.x().is_rational()); Bound right_x = right.x().rational(); - Polynomial_1 right_pol = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (pol, 0, 1), - right_x); + Polynomial_1 right_pol = kernel()->evaluate_utcf_2_object() + (typename Polynomial_traits_2::Swap() (pol, 0, 1), + right_x); Polynomial_1 right_sh_der_sh_pol = kernel()->evaluate_utcf_2_object() - (typename Polynomial_traits_2::Swap() (sh_der_sh_pol, 0, 1), - right_x); + (typename Polynomial_traits_2::Swap() (sh_der_sh_pol, 0, 1), + right_x); int asym_left_minus,asym_left_plus,asym_right_minus,asym_right_plus; - + typedef typename Status_line_1::Arc_pair Arc_pair; - + Arc_pair apair1 = ev.number_of_branches_approaching_minus_infinity(); Arc_pair apair2 = ev.number_of_branches_approaching_plus_infinity(); @@ -439,8 +439,8 @@ template class Shear_transformation { left_id += asym_left_minus; right_id += asym_right_minus; while(ev_id != ev_n) { - - typename Status_line_1::Arc_pair arc_pair = + + typename Status_line_1::Arc_pair arc_pair = ev.number_of_incident_branches(ev_id); int arcs_left = arc_pair.first; @@ -448,8 +448,8 @@ template class Shear_transformation { if(arcs_left+arcs_right!=2) { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Sheared event point found at " - << ev.x().to_double() << ", index " + CGAL_ACK_DEBUG_PRINT << "Sheared event point found at " + << ev.x().to_double() << ", index " << ev_id << std::endl; #endif */ @@ -465,24 +465,24 @@ template class Shear_transformation { left.lower_bound(left_id), left.upper_bound(left_id)); - CGAL::Sign left_sign - = kernel()->sign_at_1_object() - (left_sh_der_sh_pol,left_y,true); + CGAL::Sign left_sign + = kernel()->sign_at_1_object() + (left_sh_der_sh_pol,left_y,true); Algebraic_real_1 right_y(right_pol, right.lower_bound(right_id), right.upper_bound(right_id)); - CGAL::Sign right_sign - = kernel()->sign_at_1_object() - (right_sh_der_sh_pol,right_y,true); + CGAL::Sign right_sign + = kernel()->sign_at_1_object() + (right_sh_der_sh_pol,right_y,true); if(left_sign!=right_sign) { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Sheared ev point found at " - << ev.x().to_double() - << ", index " << ev_id + CGAL_ACK_DEBUG_PRINT << "Sheared ev point found at " + << ev.x().to_double() + << ", index " << ev_id << std::endl; #endif */ @@ -497,23 +497,23 @@ template class Shear_transformation { left.lower_bound(left_id), left.upper_bound(left_id)); - CGAL::Sign left_sign_1 - = kernel()->sign_at_1_object() - (left_sh_der_sh_pol,left_y_1,true); + CGAL::Sign left_sign_1 + = kernel()->sign_at_1_object() + (left_sh_der_sh_pol,left_y_1,true); left_id++; Algebraic_real_1 left_y_2(left_pol, left.lower_bound(left_id), left.upper_bound(left_id)); - CGAL::Sign left_sign_2 - = kernel()->sign_at_1_object() - (left_sh_der_sh_pol,left_y_2,true); + CGAL::Sign left_sign_2 + = kernel()->sign_at_1_object() + (left_sh_der_sh_pol,left_y_2,true); if(left_sign_1!=left_sign_2) { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Sheared ev point found at " - << ev.x().to_double() - << ", index " << ev_id + CGAL_ACK_DEBUG_PRINT << "Sheared ev point found at " + << ev.x().to_double() + << ", index " << ev_id << std::endl; #endif */ @@ -527,22 +527,22 @@ template class Shear_transformation { right.lower_bound(right_id), right.upper_bound(right_id)); - CGAL::Sign right_sign_1 - = kernel()->sign_at_1_object() - (right_sh_der_sh_pol,right_y_1,true); + CGAL::Sign right_sign_1 + = kernel()->sign_at_1_object() + (right_sh_der_sh_pol,right_y_1,true); right_id++; Algebraic_real_1 right_y_2(right_pol, right.lower_bound(right_id), right.upper_bound(right_id)); - CGAL::Sign right_sign_2 - = kernel()->sign_at_1_object() - (right_sh_der_sh_pol,right_y_2,true); + CGAL::Sign right_sign_2 + = kernel()->sign_at_1_object() + (right_sh_der_sh_pol,right_y_2,true); if(right_sign_1!=right_sign_2) { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Sheared ev point found at " - << ev.x().to_double() - << ", index " << ev_id + CGAL_ACK_DEBUG_PRINT << "Sheared ev point found at " + << ev.x().to_double() + << ", index " << ev_id << std::endl; #endif */ @@ -565,7 +565,7 @@ template class Shear_transformation { sh_ev_indices.resize(x_structure.size()); std::vector intermediate_values; find_intermediate_values(kernel(), - x_structure.begin(), + x_structure.begin(), x_structure.end(), std::back_inserter(intermediate_values)); /* @@ -576,7 +576,7 @@ template class Shear_transformation { std::vector intermediate_lines(intermediate_values.size()); int i=0; - for(typename std::vector::iterator it + for(typename std::vector::iterator it = intermediate_values.begin(); it!=intermediate_values.end();it++) { intermediate_lines[i]=C.status_line_at_exact_x(*it); @@ -584,7 +584,7 @@ template class Shear_transformation { } int event_count=0; /* -#if CGAL_ACK_DEBUG_FLAG +#if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "at some x.." << std::flush; #endif */ @@ -592,18 +592,18 @@ template class Shear_transformation { CGAL::internal::Three_valued info = x_structure_info[i]; /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << i << "th of " << x_structure.size() + CGAL_ACK_DEBUG_PRINT << i << "th of " << x_structure.size() << std::endl; CGAL_ACK_DEBUG_PRINT << "To_double approx" << std::endl; - CGAL_ACK_DEBUG_PRINT << "x_struct: " - << CGAL::to_double(x_structure[i]) + CGAL_ACK_DEBUG_PRINT << "x_struct: " + << CGAL::to_double(x_structure[i]) << std::endl; CGAL_ACK_DEBUG_PRINT << "Info: " << info << std::endl; #endif */ - if(info==CGAL::internal::ROOT_OF_SECOND_SET || + if(info==CGAL::internal::ROOT_OF_SECOND_SET || info==CGAL::internal::ROOT_OF_BOTH_SETS) { - const Status_line_1& event_line_at_x = + const Status_line_1& event_line_at_x = (info==CGAL::internal::ROOT_OF_BOTH_SETS) ? C.status_line_at_event(event_count) : C.status_line_at_exact_x(x_structure[i]); /* @@ -623,7 +623,7 @@ template class Shear_transformation { #endif */ } - if(info==CGAL::internal::ROOT_OF_FIRST_SET || + if(info==CGAL::internal::ROOT_OF_FIRST_SET || info==CGAL::internal::ROOT_OF_BOTH_SETS) { event_count++; } @@ -631,10 +631,10 @@ template class Shear_transformation { CGAL_assertion(event_count==C.number_of_status_lines_with_event()); } - + struct Sh_ev_point_info { - Sh_ev_point_info(Status_line_1 ev,int index) + Sh_ev_point_info(Status_line_1 ev,int index) : ev(ev),index(index), incident_left(0), incident_right(0) @@ -650,7 +650,7 @@ template class Shear_transformation { int asym_left_plus,asym_left_minus,asym_right_plus,asym_right_minus; int number_of_non_event_roots; std::vector event_points; - + Bound lower_bound(int i) { Sh_ev_point_info p= event_points[i]; return p.ev.lower_bound(p.index); @@ -748,15 +748,15 @@ template class Shear_transformation { } /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "X-coordinate (far left) " + CGAL_ACK_DEBUG_PRINT << "X-coordinate (far left) " << CGAL::to_double(far_left) << std::endl; #endif */ - Status_line_1 far_left_line + Status_line_1 far_left_line = C.status_line_at_exact_x(Algebraic_real_1(far_left)); /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "No. arcs " + CGAL_ACK_DEBUG_PRINT << "No. arcs " << far_left_line.number_of_events() << std::endl; #endif */ @@ -765,22 +765,22 @@ template class Shear_transformation { } } - + void end_sweep() { - Status_line_1 far_right_line + Status_line_1 far_right_line = C.status_line_at_exact_x(Algebraic_real_1(far_right)); /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "X-coordinate (far right) " + CGAL_ACK_DEBUG_PRINT << "X-coordinate (far right) " << CGAL::to_double(far_right) << std::endl; #endif */ CGAL_assertion(far_right_line.number_of_events() ==static_cast(y_structure.size())); - + typename Y_structure::iterator y_it=y_structure.begin(); for(int i=0;i class Shear_transformation { void sweep_at_x_coordinate(int index) { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "X-coordinate " - << CGAL::to_double(x_structure[index]) + CGAL_ACK_DEBUG_PRINT << "X-coordinate " + << CGAL::to_double(x_structure[index]) << std::endl; #endif */ @@ -806,12 +806,12 @@ template class Shear_transformation { typename Y_structure::iterator y_it=y_structure.begin(); /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Y-structure has " << y_structure.size() + CGAL_ACK_DEBUG_PRINT << "Y-structure has " << y_structure.size() << " elements" << std::endl; #endif */ // needed for vertical components - std::vector events_at_x; + std::vector events_at_x; bool vert=ev.covers_line() && ! this->use_primitive_curve; Y_structure_element below,above; Y_structure_element minus_x_inf,plus_x_inf; @@ -822,9 +822,9 @@ template class Shear_transformation { above = (s>0) ? minus_x_inf: plus_x_inf; events_at_x.push_back(below); int minus_left,minus_right,plus_left,plus_right; - + typedef typename Status_line_1::Arc_pair Arc_pair; - + Arc_pair apair1 = ev.number_of_branches_approaching_minus_infinity(); Arc_pair apair2 = ev.number_of_branches_approaching_plus_infinity(); @@ -843,7 +843,7 @@ template class Shear_transformation { y_it++; } while(ev_id class Shear_transformation { Y_structure_element new_y; new_y.one_event_known=false; new_y.x_index=x_extreme_index_counter; - + // Prevent compiler warnings: new_y.y_index=-1; new_y.y_type=FINITE; new_y.x_type=FINITE; - + y_it=y_structure.insert(y_it,new_y); y_it++; y_it=y_structure.insert(y_it,new_y); y_it++; x_extreme_index_counter++; - } + } } ev_id++; } @@ -934,7 +934,7 @@ template class Shear_transformation { } } } - + void handle_edge(Y_structure_element& e1, Y_structure_element& e2) { /* @@ -945,7 +945,7 @@ template class Shear_transformation { y_struct_info(*it,CGAL_ACK_DEBUG_PRINT); } CGAL_ACK_DEBUG_PRINT << "Y-STRUCT done" << std::endl; - + CGAL_ACK_DEBUG_PRINT << "handle edge..." << std::flush; CGAL_ACK_DEBUG_PRINT << "info for e1: "; y_struct_info(e1,CGAL_ACK_DEBUG_PRINT); @@ -976,8 +976,8 @@ template class Shear_transformation { it++; } } else { - CGAL_assertion(e1.x_type!=e2.x_type || - e1.x_type==FINITE || + CGAL_assertion(e1.x_type!=e2.x_type || + e1.x_type==FINITE || e2.x_type==FINITE); if(e2.x_type==MINUS_INFTY || e1.x_type==PLUS_INFTY) { handle_edge(e2,e1); @@ -990,7 +990,7 @@ template class Shear_transformation { } } int left_stripe = (e1.x_type==MINUS_INFTY) ? -1 : e1.x_index; - int right_stripe = (e2.x_type==PLUS_INFTY) + int right_stripe = (e2.x_type==PLUS_INFTY) ? static_cast(stripe_values.size()-1) : e2.x_index; for(int i=left_stripe+1;i class Shear_transformation { break; } } - } + } } /* #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "handle edge done" << std::endl; #endif */ - + } void sweep() { @@ -1045,7 +1045,7 @@ template class Shear_transformation { #endif */ start_sweep(); - + /* #if CGAL_ACK_DEBUG_FLAG for(typename Y_structure::iterator it=y_structure.begin(); @@ -1061,8 +1061,8 @@ template class Shear_transformation { for(int i=0;i(x_structure.size());i++) { /* #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "Coordinate.." - << CGAL::to_double(x_structure[i]) + CGAL_ACK_DEBUG_PRINT << "Coordinate.." + << CGAL::to_double(x_structure[i]) << ", index " << i << std::endl; CGAL_ACK_DEBUG_PRINT << << "Y-struct before x" << std::endl; for(typename Y_structure::iterator it=y_structure.begin(); @@ -1070,7 +1070,7 @@ template class Shear_transformation { it++) { y_struct_info(*it,CGAL_ACK_DEBUG_PRINT); } - + CGAL_ACK_DEBUG_PRINT << "End of y-struct" << std::endl; #endif */ @@ -1088,11 +1088,11 @@ template class Shear_transformation { Status_line_1 create_event_line(Curve_analysis_2& D,int i) { Algebraic_real_1 xval = sh_disc_roots[i]; Bitstream_traits traits(Bitstream_coefficient_kernel(kernel(),xval)); - int number_of_events + int number_of_events = static_cast(pre_vert_lines[i].event_points.size()); - int number_of_roots - = pre_vert_lines[i].number_of_non_event_roots+number_of_events; - Polynomial_2 sh_pol_with_correct_degree + int number_of_roots + = pre_vert_lines[i].number_of_non_event_roots+number_of_events; + Polynomial_2 sh_pol_with_correct_degree = CGAL::internal::poly_non_vanish_leading_term(kernel(),sh_pol,xval); Bitstream_descartes descartes(CGAL::internal::Backshear_descartes_tag(), sh_pol_with_correct_degree, @@ -1142,7 +1142,7 @@ template class Shear_transformation { } Algebraic_kernel_with_analysis_2* _m_kernel; - + Curve_analysis_2 C; Integer s; @@ -1151,10 +1151,10 @@ template class Shear_transformation { Root_container sh_disc_roots,x_structure; std::vector x_structure_info; - + std::vector > sh_ev_indices; - std::vector stripe_values; + std::vector stripe_values; Bound far_left, far_right, y_in_box; @@ -1171,7 +1171,7 @@ template class Shear_transformation { bool disc_roots_computed,sh_disc_roots_computed; }; - + } //namespace CGAL #endif diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h index ae097d223bf6..eebf8f4bd26e 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Pavel Emeliyanenko // @@ -26,18 +26,18 @@ namespace CGAL { namespace internal { -template < class CurveAnalysis_2, class Rep_ > +template < class CurveAnalysis_2, class Rep_ > class Status_line_CA_1; template -std::ostream& operator<< (std::ostream&, +std::ostream& operator<< (std::ostream&, const Status_line_CA_1&); #if !CGAL_ACK_USE_EXACUS -template < typename AlgebraicCurveKernel_2 > +template < typename AlgebraicCurveKernel_2 > class Event_line_builder; -template < typename AlgebraicCurveKernel_2 > +template < typename AlgebraicCurveKernel_2 > class Shear_transformation; #endif @@ -49,8 +49,8 @@ class Status_line_CA_1_rep { // this template argument typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2; - - typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 + + typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 Curve_analysis_2; // myself @@ -58,7 +58,7 @@ class Status_line_CA_1_rep { // type of x-coordinate typedef typename Curve_analysis_2::Algebraic_real_1 - Algebraic_real_1; + Algebraic_real_1; // type of a curve point typedef typename Curve_analysis_2::Algebraic_real_2 @@ -83,7 +83,7 @@ class Status_line_CA_1_rep { // constructors // default constructor () - Status_line_CA_1_rep() + Status_line_CA_1_rep() { } // constructs status line over interval @@ -100,7 +100,7 @@ class Status_line_CA_1_rep { // constructs status line at events Status_line_CA_1_rep( Algebraic_real_1 x, size_type i, - const Curve_analysis_2& ca, + const Curve_analysis_2& ca, size_type , size_type ) : _m_kernel(ca.kernel()), _m_x(x), _m_index(i), _m_ca(ca), @@ -112,7 +112,7 @@ class Status_line_CA_1_rep { //! kernel instance // TODO remove kernel? const Algebraic_curve_kernel_2 *_m_kernel; - + //! x-coordinate of event info mutable Algebraic_real_1 _m_x; @@ -121,8 +121,8 @@ class Status_line_CA_1_rep { size_type _m_index; //! underlying curve analysis - Curve_analysis_2 _m_ca; - + Curve_analysis_2 _m_ca; + //! number of incident arcs to the left and to the right //Arc_pair _m_num_arcs; @@ -134,22 +134,22 @@ class Status_line_CA_1_rep { //! curve has vertical line at this x-coordinate mutable bool _m_vertical_line; - + //! decsribes an event mutable bool _m_event; //! number of arcs running down the pole Arc_pair _m_num_arcs_minus_inf; - + //! number of arcs running up the pole Arc_pair _m_num_arcs_plus_inf; /*// matchings valid? mutable bool matching_valid_; - + // match side arcs to event arcs mutable std::vector< int > matching_[2]; - + // total number of arcs int numarcs_at_; @@ -158,13 +158,13 @@ class Status_line_CA_1_rep { // stores multiplicities std::vector< int > multiplicities_;*/ - + // stores algebraic real over the vertical line mutable std::vector >_m_xy_coords; // stores the isolator instance mutable boost::optional isolator; - + // befriending the handle friend class Status_line_CA_1; //friend class Curve_analysis_2; @@ -173,21 +173,21 @@ class Status_line_CA_1_rep { }; -//! \brief The class provides information about the intersections of a curve -//! with a vertical line at a given finite x-coordinate. +//! \brief The class provides information about the intersections of a curve +//! with a vertical line at a given finite x-coordinate. //! //! Note that a curve can have a vertical line component at this coordinate -//! and non-vertical components may intersect the vertical line respectively. -//! With the help of this class' methods one is able to compute the local -//! topology of the curve at the given vertical line. Note that vertical lines -//! at x = +/-oo are not allowed, since different events (curve ends going to -//! infinity with different non-horizontal asymptotes) would have equal -//! y-coordinate (+/-oo), which confuses more than it helps. Note in addition -//! that curve ends approaching the vertical asymptote introduce an event -//! (depending on whether approaching +oo or -oo - but the event with -//! coordinates (x,?oo), resp. (x,+oo), occur only once, if they occur, and +//! and non-vertical components may intersect the vertical line respectively. +//! With the help of this class' methods one is able to compute the local +//! topology of the curve at the given vertical line. Note that vertical lines +//! at x = +/-oo are not allowed, since different events (curve ends going to +//! infinity with different non-horizontal asymptotes) would have equal +//! y-coordinate (+/-oo), which confuses more than it helps. Note in addition +//! that curve ends approaching the vertical asymptote introduce an event +//! (depending on whether approaching +oo or -oo - but the event with +//! coordinates (x,?oo), resp. (x,+oo), occur only once, if they occur, and //! they imply not to be associated with a instance of \c Algebraic_real_2. -template > class Status_line_CA_1 : public ::CGAL::Handle_with_policy< Rep_ > { @@ -200,7 +200,7 @@ class Status_line_CA_1 typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2; typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! this instance's second template parameter typedef Rep_ Rep; @@ -208,7 +208,7 @@ class Status_line_CA_1 typedef Status_line_CA_1 Self; //! type of x-coordinate - typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; + typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; //! type of a curve point typedef typename Curve_analysis_2::Algebraic_real_2 Algebraic_real_2; @@ -224,10 +224,10 @@ class Status_line_CA_1 //! Local isolator type typedef typename Rep::Bitstream_descartes Bitstream_descartes; - + //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //!@} public: //!\name constructors @@ -236,16 +236,16 @@ class Status_line_CA_1 /*!\brief * Default constructor */ - Status_line_CA_1() : - Base(Rep()) { + Status_line_CA_1() : + Base(Rep()) { } /*!\brief * copy constructor */ -#ifdef DOXYGEN_RUNNING - Status_line_CA_1(const Self& p) : - Base(static_cast(p)) { +#ifdef DOXYGEN_RUNNING + Status_line_CA_1(const Self& p) : + Base(static_cast(p)) { } #endif @@ -261,7 +261,7 @@ class Status_line_CA_1 Algebraic_real_1 x, size_type i, const Curve_analysis_2& ca, size_type n_arcs) : Base(Rep(x, i, ca, n_arcs)) { - + CGAL_precondition(n_arcs >= 0); CGAL_precondition_code( bool is_event; @@ -270,10 +270,10 @@ class Status_line_CA_1 CGAL_precondition(!is_event && idx == i); ); } - + /*!\brief - * constructs a status line at the event with x-coorinate \c x + * constructs a status line at the event with x-coorinate \c x * * \c arcs container defines # of incident arcs to the left and to the * right of each intersection point of the curve \c ca with this status @@ -285,9 +285,9 @@ class Status_line_CA_1 * * \pre there is a curve event at specified x-coordinate */ - Status_line_CA_1(Algebraic_real_1 x, + Status_line_CA_1(Algebraic_real_1 x, size_type i, const Curve_analysis_2& ca, - size_type n_arcs_left, size_type n_arcs_right, + size_type n_arcs_left, size_type n_arcs_right, Arc_container arcs, bool has_v_line = false) : Base(Rep(x, i, ca, n_arcs_left, n_arcs_right)) { @@ -308,7 +308,7 @@ class Status_line_CA_1 * * arcs and vertical line flag can be set later */ - Status_line_CA_1(Algebraic_real_1 x, + Status_line_CA_1(Algebraic_real_1 x, size_type i, const Curve_analysis_2& ca, size_type n_arcs_left, size_type n_arcs_right) : Base(Rep(x, i, ca, n_arcs_left, n_arcs_right)) { @@ -321,40 +321,40 @@ class Status_line_CA_1 CGAL_precondition(idx == i); ); } - + /*!\brief * constructs from a given represenation */ - Status_line_CA_1(Rep rep) : - Base(rep) { + Status_line_CA_1(Rep rep) : + Base(rep) { } - + //!@} public: //!\name access functions //!@{ - + /*! \brief * returns the x-coordinate of the status line (always a finite value) */ Algebraic_real_1 x() const { return this->ptr()->_m_x; } - + /*! \brief * returns this status line CurveAnalysis_2 object */ Curve_analysis_2 curve_analysis_2() const { return this->ptr()->_m_ca; } - + /*! \brief * returns this status line index (event or interval index) */ size_type index() const { return this->ptr()->_m_index; } - + /*! \brief * returns \c true in case the given curve contains the status line * as a component @@ -378,15 +378,15 @@ class Status_line_CA_1 return this->ptr()->_m_event; } - /*! \brief + /*! \brief * returns \c true if the ith point is an event point */ bool is_event(size_type i) const { // TODO: Make it possible to detect singularities as well Arc_pair branches = number_of_incident_branches(i); return branches.first!=1 || branches.second!=1; - } - + } + /*! \brief * returns number of distinct and finite intersections of a curve with a @@ -406,11 +406,11 @@ class Status_line_CA_1 { CGAL_precondition(0 <= j&&j < number_of_events()); if(!this->ptr()->_m_xy_coords[j]) - this->ptr()->_m_xy_coords[j] = Algebraic_real_2(x(), + this->ptr()->_m_xy_coords[j] = Algebraic_real_2(x(), this->ptr()->_m_ca, j); return *(this->ptr()->_m_xy_coords[j]); } - + /*!\brief * alias for \c get_algebraic_real_2() */ @@ -427,11 +427,11 @@ class Status_line_CA_1 * \pre 0 <= j < num_of_events() */ Arc_pair number_of_incident_branches(int j) const { - + CGAL_precondition(0 <= j&&j < number_of_events()); if(!is_event()) return Arc_pair(1, 1); - + return (*(this->ptr()->_m_arcs))[j]; } @@ -462,7 +462,7 @@ class Status_line_CA_1 public: //!@{ - /*!\brief + /*!\brief * sets # of arcs running from left and right to -inf and +inf at vertical * asymptote */ @@ -503,17 +503,17 @@ class Status_line_CA_1 os << "; x = " << x() << "; #events: " << number_of_events() << "; " << std::flush; #else - os << "; x = " << CGAL::to_double(x()) << "; #events: " + os << "; x = " << CGAL::to_double(x()) << "; #events: " << number_of_events() << "; " << std::flush; #endif - + if(is_event()) { os << "incident branches: {" << std::flush; // typename Arc_container::const_iterator ait = // (*this->ptr()->_m_arcs).begin(); for(int i = 0; i < number_of_events(); i++) { - + Arc_pair arc_pair = number_of_incident_branches(i); if(i!=0) { @@ -522,9 +522,9 @@ class Status_line_CA_1 Algebraic_real_2 xy = algebraic_real_2(i); typedef typename Bitstream_descartes::Bound Bound; Bound th = CGAL::ipower(Bound(1,2),53); - std::pair d_pair - = xy.to_double(); - os << "y=" << d_pair.second << ", " << std::flush; + std::pair d_pair + = xy.to_double(); + os << "y=" << d_pair.second << ", " << std::flush; os << "(" << arc_pair.first << ", " << arc_pair.second << ")" << std::flush; } @@ -539,7 +539,7 @@ class Status_line_CA_1 p.second << ")" << std::flush; if(covers_line()) os << "; covers line" << std::flush; - } else + } else os << "interval line" << std::flush; os << "]" << std::flush; @@ -593,14 +593,14 @@ class Status_line_CA_1 //! these are our friends //friend class Curve_analysis_2; - + }; // class Status_line_CA_1 template std::ostream& operator<< ( - std::ostream& os, + std::ostream& os, const internal::Status_line_CA_1& line) { - + line.write(os); return os; } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h index 70c211d4c470..ba9ac1e30f9a 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Pavel Emeliyanenko // @@ -23,11 +23,11 @@ namespace CGAL { namespace internal { -template < class CurvePairAnalysis_2, class Rep_ > +template < class CurvePairAnalysis_2, class Rep_ > class Status_line_CPA_1; template -std::ostream& operator<< (std::ostream&, +std::ostream& operator<< (std::ostream&, const Status_line_CPA_1&); template < class CurvePairAnalysis_2 > @@ -41,7 +41,7 @@ class Status_line_CPA_1_rep { // type of x-coordinate typedef typename Curve_pair_analysis_2::Algebraic_real_1 - Algebraic_real_1; + Algebraic_real_1; // type of a curve point typedef typename Curve_pair_analysis_2::Algebraic_real_2 @@ -62,7 +62,7 @@ class Status_line_CPA_1_rep { // constructors public: // default constructor () - Status_line_CPA_1_rep() + Status_line_CPA_1_rep() { } // constructs an empty status line object @@ -72,7 +72,7 @@ class Status_line_CPA_1_rep { // stores this status line interval or event index of a curve pair size_type _m_index; - + // represents x-coordinate of event of rational value over interval // computed only by demand mutable boost::optional _m_x; @@ -82,7 +82,7 @@ class Status_line_CPA_1_rep { mutable Arc_container _m_arcs; // inverse mapping from arcnos of the 1st and 2nd curve to respective - // y-position + // y-position mutable Int_container _m_arcno_to_pos[2]; // stores multiplicities of intersection points (-1 if there is no 2-curve @@ -102,19 +102,19 @@ class Status_line_CPA_1_rep { friend class Status_line_CPA_1; }; -//! \brief The class provides information about the intersections of a pair of -//! curves with a (intended) vertical line (ignoring vertical lines of the -//! curves themselves). -//! +//! \brief The class provides information about the intersections of a pair of +//! curves with a (intended) vertical line (ignoring vertical lines of the +//! curves themselves). +//! //! Each intersection of a curve with the vertical line defined by some given x -//! induces an event. An event can be asked for its coordinates -//! (\c Algebraic_real_2) and the involved curve(s). Note that the involvement -//! also holds for curve ends approaching the vertical asymptote. +//! induces an event. An event can be asked for its coordinates +//! (\c Algebraic_real_2) and the involved curve(s). Note that the involvement +//! also holds for curve ends approaching the vertical asymptote. //! Curve_pair_vertical_line_1 at x = +/-oo are not allowed. -template > -class Status_line_CPA_1 : - public ::CGAL::Handle_with_policy< Rep_ > +class Status_line_CPA_1 : + public ::CGAL::Handle_with_policy< Rep_ > { public: //!@{ @@ -122,7 +122,7 @@ class Status_line_CPA_1 : //! this instance's first template parameter typedef CurvePairAnalysis_2 Curve_pair_analysis_2; - + //! this instance's second template parameter typedef Rep_ Rep; @@ -130,7 +130,7 @@ class Status_line_CPA_1 : typedef Status_line_CPA_1 Self; //! type of x-coordinate - typedef typename Curve_pair_analysis_2::Algebraic_real_1 Algebraic_real_1; + typedef typename Curve_pair_analysis_2::Algebraic_real_1 Algebraic_real_1; //! type of a curve point typedef typename Curve_pair_analysis_2::Algebraic_real_2 Algebraic_real_2; @@ -149,7 +149,7 @@ class Status_line_CPA_1 : //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //!@} public: //!\name constructors @@ -158,19 +158,19 @@ class Status_line_CPA_1 : /*!\brief * Default constructor */ - Status_line_CPA_1() : - Base(Rep()) { + Status_line_CPA_1() : + Base(Rep()) { } /*!\brief * copy constructor */ #ifdef DOXYGEN_RUNNING - Status_line_CPA_1(const Self& p) : - Base(static_cast(p)) { + Status_line_CPA_1(const Self& p) : + Base(static_cast(p)) { } #endif - + /*!\brief * constructs undefined status line */ @@ -206,19 +206,19 @@ class Status_line_CPA_1 : _set_interval_arcs(arcs); } -protected: +protected: /*!\brief * constructs from a given represenation */ - Status_line_CPA_1(Rep rep) : - Base(rep) { + Status_line_CPA_1(Rep rep) : + Base(rep) { } - + //!@} public: //!\name access functions //!@{ - + /*! \brief * returns the x-coordinate of the vertical line (always a finite value). */ @@ -230,7 +230,7 @@ class Status_line_CPA_1 : this->ptr()->_m_cpa._internal_curve_pair().event_x(index()) : Algebraic_real_1(this->ptr()->_m_cpa._internal_curve_pair(). bound_value_in_interval(index()))); -#else +#else this->ptr()->_m_cpa.event_x(index()) : Algebraic_real_1(this->ptr()->_m_cpa. bound_value_in_interval(index()))); @@ -238,13 +238,13 @@ class Status_line_CPA_1 : } return *(this->ptr()->_m_x); } - + //! returns this vertical line's index (event or interval index) size_type index() const { CGAL_precondition(this->ptr()->_m_index>=0); return this->ptr()->_m_index; } - + /*! \brief * returns number of distinct and finite intersections of a pair * of curves with a (intended) vertical line ignoring a real vertical @@ -256,14 +256,14 @@ class Status_line_CPA_1 : /*! \brief - * returns the y-position of the k-th event of + * returns the y-position of the k-th event of * the curve in the sequence of events. * * Note that each event is formed by the 1st, 2nd, or both curves * * \pre 0 <= k < "number of arcs defined for curve c at x()" */ - size_type event_of_curve(size_type k, + size_type event_of_curve(size_type k, const typename Curve_pair_analysis_2 ::Curve_analysis_2& c) const { CGAL_assertion(c.id()==this->ptr()->_m_cpa.curve_analysis(false).id()|| @@ -284,7 +284,7 @@ class Status_line_CPA_1 : * \pre 0 <= k < "number of arcs defined for curve[c] at x()" */ size_type event_of_curve(size_type k, bool c) const { - + CGAL_precondition_msg(0 <= k && k < static_cast(this->ptr()->_m_arcno_to_pos[c].size()), "Invalid arc number of the c-th curve specified"); @@ -304,7 +304,7 @@ class Status_line_CPA_1 : CGAL_precondition(is_intersection()); CGAL_precondition(this->ptr()->_m_arcs[j].first != -1 && this->ptr()->_m_arcs[j].second != -1); - + return this->ptr()->_m_mults[j]; } @@ -327,11 +327,11 @@ class Status_line_CPA_1 : * by which arc numbers of the curve \c ca, or -1, if the * corresponding curve is not involved. */ - Arc_pair curves_at_event(size_type j, + Arc_pair curves_at_event(size_type j, const typename Curve_pair_analysis_2 ::Curve_analysis_2& c1, const typename Curve_pair_analysis_2 - ::Curve_analysis_2& CGAL_precondition_code(c2)) const + ::Curve_analysis_2& CGAL_precondition_code(c2)) const { CGAL_precondition(0 <= j && j < number_of_events()); @@ -377,32 +377,32 @@ class Status_line_CPA_1 : * sets arcs at event (use at your own risk!) */ void _set_event_arcs(const Arc_container& arcs) const { - + size_type k = 0, arcf = 0, arcg = 0; this->ptr()->_m_arcs.resize(arcs.size()); this->ptr()->_m_mults.resize(arcs.size()); this->ptr()->_m_event = true; - + for(typename Arc_container::const_iterator ait = arcs.begin(); ait != arcs.end(); ait++, k++) { - + if(ait->first == 0) { // 1st curve this->ptr()->_m_arcs[k].first = arcf++; this->ptr()->_m_arcs[k].second = -1; this->ptr()->_m_arcno_to_pos[0].push_back(k); - + } else if(ait->first == 1) { // 2nd curve this->ptr()->_m_arcs[k].first = -1; this->ptr()->_m_arcs[k].second = arcg++; this->ptr()->_m_arcno_to_pos[1].push_back(k); - + } else if(ait->first == 2) { // intersection this->ptr()->_m_arcs[k].first = arcf++; this->ptr()->_m_arcs[k].second = arcg++; this->ptr()->_m_arcno_to_pos[0].push_back(k); this->ptr()->_m_arcno_to_pos[1].push_back(k); this->ptr()->_m_intersection = true; - + } else CGAL_error_msg("Bogus curve index.."); this->ptr()->_m_mults[k] = ait->second; @@ -425,12 +425,12 @@ class Status_line_CPA_1 : this->ptr()->_m_arcs[k].first = arcf++; this->ptr()->_m_arcs[k].second = -1; this->ptr()->_m_arcno_to_pos[0].push_back(k); - + } else if(*ait == 1) { // 2nd curve this->ptr()->_m_arcs[k].first = -1; this->ptr()->_m_arcs[k].second = arcg++; this->ptr()->_m_arcno_to_pos[1].push_back(k); - + } else CGAL_error_msg("Bogus curve index.."); } @@ -442,25 +442,25 @@ class Status_line_CPA_1 : //!@{ void write(std::ostream& os) const { - + os << "status_line [CPA@" << this->ptr()->_m_cpa.id(); - + os << "; x = " << (index()==-1 ? 999.999 : CGAL::to_double(x())) << "; #events: " << number_of_events() << "; "; - + typename Arc_container::const_iterator ait = this->ptr()->_m_arcs.begin(); - if(is_event()) + if(is_event()) os << "arcs at event: {"; else os << "arcs of interval: {"; - + for(; ait != this->ptr()->_m_arcs.end(); ait++) { if(ait != this->ptr()->_m_arcs.begin()) os << ", "; os << "(" << ait->first << "; " << ait->second << ")"; } os << "}, arcno2pos: ("; - + CGAL::output_range(os, this->ptr()->_m_arcno_to_pos[0].begin(), this->ptr()->_m_arcno_to_pos[0].end(), ","); os << "), ("; @@ -475,7 +475,7 @@ class Status_line_CPA_1 : template std::ostream& operator<< (std::ostream& os, const internal::Status_line_CPA_1& sline) { - + sline.write(os); return os; } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h index f99413b96125..5172dcf80e68 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Eric Berberich // Pavel Emeliyanenko @@ -27,7 +27,7 @@ namespace CGAL { namespace internal { -template < class AlgebraicCurveKernel_2, class Rep_, +template < class AlgebraicCurveKernel_2, class Rep_, class HandlePolicy_ , class Allocator_> //::boost::fast_pool_allocator > @@ -47,7 +47,7 @@ class Xy_coordinate_2_rep { typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 + typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 Algebraic_real_1; typedef CGAL::Bbox_2 Bbox_2; @@ -60,10 +60,10 @@ class Xy_coordinate_2_rep { // default constructor () Xy_coordinate_2_rep() : _m_arcno(-1) { } - + // standard constructor Xy_coordinate_2_rep(const Algebraic_real_1& x, - const Curve_analysis_2& curve, int arcno) + const Curve_analysis_2& curve, int arcno) : _m_kernel(curve.kernel()),_m_x(x), _m_curve(curve), _m_arcno(arcno) { } @@ -73,10 +73,10 @@ class Xy_coordinate_2_rep { // x-coordinate Algebraic_real_1 _m_x; - + // supporting curve mutable Curve_analysis_2 _m_curve; - + // arc number on curve mutable int _m_arcno; @@ -88,44 +88,44 @@ class Xy_coordinate_2_rep { }; -//! \brief class \c Xy_coordinate_2 represents a single root of a system of -//! two polynomial equations in two variables that are models +//! \brief class \c Xy_coordinate_2 represents a single root of a system of +//! two polynomial equations in two variables that are models //! \c AlgebraicCurveKernel_2::Polynomial_2 //! //! \c Xy_coordinate_2 coordinate is represented by an \c Algebraic_real_1, //! a supporting curve and an arcno and is valid only for finite solutions, -//! i.e., it cannot represent points at infinity -template , - class HandlePolicy_= CGAL::Handle_policy_union, + class HandlePolicy_= CGAL::Handle_policy_union, class Allocator_ = CGAL_ALLOCATOR(Rep_) > -class Xy_coordinate_2 : - public ::CGAL::Handle_with_policy +class Xy_coordinate_2 : + public ::CGAL::Handle_with_policy { public: //! \name public typedefs //!@{ - + //! this instance's first template parameter typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2; - + //! this instance's second template parameter typedef Rep_ Rep; - + //! this instance's third template parameter typedef HandlePolicy_ Handle_policy; - + //! this instance's fourth template parameter typedef Allocator_ Allocator; //! this instance itself typedef Xy_coordinate_2 Self; - + //! an instance of AlgebraicKernel_1 - typedef typename Algebraic_curve_kernel_2::Algebraic_kernel_d_1 + typedef typename Algebraic_curve_kernel_2::Algebraic_kernel_d_1 Algebraic_kernel_d_1; - + typedef typename Algebraic_curve_kernel_2::Polynomial_1 Polynomial_1; typedef CGAL::Polynomial_traits_d Polynomial_traits_1; @@ -133,7 +133,7 @@ class Xy_coordinate_2 : typedef CGAL::Polynomial_traits_d Polynomial_traits_2; //! type of (explicit) x- and y-coordinates - typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 + typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 Algebraic_real_1; //! Coefficient type @@ -142,11 +142,11 @@ class Xy_coordinate_2 : //! type of curve pair analysis typedef typename Algebraic_curve_kernel_2::Curve_pair_analysis_2 Curve_pair_analysis_2; - + //! type of curve analysis typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! the handle superclass typedef ::CGAL::Handle_with_policy Base; @@ -158,7 +158,7 @@ class Xy_coordinate_2 : //! Type for the bounding box typedef typename Rep::Bbox_2 Bbox_2; - + //!@} private: //! \name private methods @@ -172,7 +172,7 @@ class Xy_coordinate_2 : { std::vector parts_of_f, parts_of_g, common; - if(kernel()->decompose_2_object()(p.curve(), q.curve(), + if(kernel()->decompose_2_object()(p.curve(), q.curve(), std::back_inserter(parts_of_f), std::back_inserter(parts_of_g), std::back_inserter(common))) { @@ -181,40 +181,40 @@ class Xy_coordinate_2 : if(parts_of_f.size() == 1) { p.simplify_by(kernel()->construct_curve_pair_2_object()( parts_of_f[0], common[0])); - } - + } + if(parts_of_g.size() == 1) { q.simplify_by(kernel()->construct_curve_pair_2_object()( parts_of_g[0], common[0])); - } + } return true; } return false; } - + //!@} public: //!\name Constructors //!@{ - /*!\brief + /*!\brief * default constructor * * A default-constructed point supports no operation other than - * having \c CGAL::degree(curve()) return \c -1. + * having \c CGAL::degree(curve()) return \c -1. */ - Xy_coordinate_2() : - Base(Rep()) { + Xy_coordinate_2() : + Base(Rep()) { } /*!\brief * copy constructor */ -#ifdef DOXYGEN_RUNNING - Xy_coordinate_2(const Self& p) : - Base(static_cast(p)) { +#ifdef DOXYGEN_RUNNING + Xy_coordinate_2(const Self& p) : + Base(static_cast(p)) { } -#endif +#endif /*!\brief * Point at \c x, on \c curve with \c arcno. Finite points on vertical arcs @@ -223,7 +223,7 @@ class Xy_coordinate_2 : Xy_coordinate_2(const Algebraic_real_1& x, const Curve_analysis_2& curve, int arcno) : Base(Rep(x, curve, arcno)) { - + CGAL_precondition(arcno >= 0); CGAL_precondition_code( typename Curve_analysis_2::Status_line_1 v = @@ -231,24 +231,24 @@ class Xy_coordinate_2 : ); CGAL_precondition(arcno >= 0 && arcno < v.number_of_events()); } - + /*!\brief * constructs a point from a given represenation */ - Xy_coordinate_2(Rep rep) : - Base(rep) { + Xy_coordinate_2(Rep rep) : + Base(rep) { } - + //!@} public: //!\name Access functions //!@{ - - /*!\brief + + /*!\brief * x-coordinate of the point */ - const Algebraic_real_1& x() const { - return this->ptr()->_m_x; + const Algebraic_real_1& x() const { + return this->ptr()->_m_x; } /*! @@ -266,14 +266,14 @@ class Xy_coordinate_2 : // EBEB 2012-07-05 deactivated map for y-roots for not being used // typedef Roots Data; // EBEB 2012-07-05 deactivated map for y-roots for not being used - // typedef std::map< Key, Data, CGAL::Handle_id_less_than< Key > > + // typedef std::map< Key, Data, CGAL::Handle_id_less_than< Key > > // Y_root_map; - + // EBEB 2012-07-05 deactivated map for y-roots for not being used //static Y_root_map y_root_map; if (!this->ptr()->_m_y) { - + Polynomial_2 f = curve().primitive_polynomial_2(); // This will be the defining polynomial of y Polynomial_1 y_pol; @@ -283,9 +283,9 @@ class Xy_coordinate_2 : bool point_is_certainly_critical = false; typename Curve_analysis_2::Status_line_1 line = curve().status_line_at_exact_x(x()); - + // EBEB 2012-07-05 deactivated map for y-roots for not being used - //typename Y_root_map::iterator yit = + //typename Y_root_map::iterator yit = // y_root_map.find(line); // TODO: Cache resultant computation @@ -296,53 +296,53 @@ class Xy_coordinate_2 : // curve().event_info(i); typename Curve_analysis_2::Status_line_1::Arc_pair ipair = line.number_of_incident_branches(arcno()); - + if (ipair.first != 1 || ipair.second != 1) { point_is_certainly_critical = true; y_pol = CGAL::make_square_free( CGAL::resultant (typename Polynomial_traits_2::Swap() (f,0,1), - typename Polynomial_traits_2::Swap() + typename Polynomial_traits_2::Swap() (CGAL::differentiate(f),0,1)) ); // BUGFIX: y_pol might be zero: if(y_pol.is_zero()) { // force re-computation with bigger resultant point_is_certainly_critical=false; - } - + } + } } - + if (!point_is_certainly_critical) { - + Polynomial_2 r(x().polynomial()); y_pol = CGAL::make_square_free( - CGAL::resultant + CGAL::resultant (typename Polynomial_traits_2::Swap() (f,0,1), typename Polynomial_traits_2::Swap() (r,0,1)) ); - + } typename Algebraic_kernel_d_1::Solve_1 real_roots; - + Roots y_roots; - real_roots(y_pol, std::back_inserter(y_roots), false ); - + real_roots(y_pol, std::back_inserter(y_roots), false ); + long prec = 16; - - typename Algebraic_curve_kernel_2::Approximate_absolute_y_2 - approx_y=kernel()->approximate_absolute_y_2_object(); - - std::pair y_pair = approx_y(*this,prec); - - Bound_interval y_iv(y_pair.first,y_pair.second); - + + typename Algebraic_curve_kernel_2::Approximate_absolute_y_2 + approx_y=kernel()->approximate_absolute_y_2_object(); + + std::pair y_pair = approx_y(*this,prec); + + Bound_interval y_iv(y_pair.first,y_pair.second); + typedef typename std::vector::const_iterator Iterator; - + std::list< Iterator > candidates; - + for (Iterator it = y_roots.begin(); it != y_roots.end(); it++) { Bound_interval it_interval(it->low(), it->high()); if (boost::numeric::overlap(it_interval, y_iv)) { @@ -352,15 +352,15 @@ class Xy_coordinate_2 : CGAL_assertion(!candidates.empty()); while (candidates.size() > 1) { - prec*=2; - y_pair = approx_y(*this,prec); - + prec*=2; + y_pair = approx_y(*this,prec); + y_iv = Bound_interval(y_pair.first,y_pair.second); for (typename std::list< Iterator >::iterator dit, cit = candidates.begin(); cit != candidates.end(); ) { bool remove = false; - Bound_interval + Bound_interval cit_interval((*cit)->low(), (*cit)->high()); if (!boost::numeric::overlap(cit_interval, y_iv)) { dit = cit; @@ -373,30 +373,30 @@ class Xy_coordinate_2 : } } CGAL_assertion(static_cast< int >(candidates.size()) == 1); - this->ptr()->_m_y = + this->ptr()->_m_y = Algebraic_real_1( - (*candidates.begin())->polynomial(), - (*candidates.begin())->low(), + (*candidates.begin())->polynomial(), + (*candidates.begin())->low(), (*candidates.begin())->high() ); } CGAL_postcondition(bool(this->ptr()->_m_y)); return *this->ptr()->_m_y; } - + /*!\brief * supporting curve of the point */ Curve_analysis_2 curve() const { - return this->ptr()->_m_curve; + return this->ptr()->_m_curve; } - + /*!\brief * arc number of point * */ - int arcno() const { - return this->ptr()->_m_arcno; + int arcno() const { + return this->ptr()->_m_arcno; } //!@} @@ -406,12 +406,12 @@ class Xy_coordinate_2 : /*!\brief * compares x-coordinates of \c *this with \c q - * + * * do we need this method or one should use Algebraic_curve_kernel_2 * directly ? */ CGAL::Comparison_result compare_x(const Self& q) const { - + if(this->is_identical(q)) { return CGAL::EQUAL; } @@ -421,22 +421,22 @@ class Xy_coordinate_2 : /*!\brief * compares \c *this with \c q lexicographically */ - CGAL::Comparison_result compare_xy(const Self& q, + CGAL::Comparison_result compare_xy(const Self& q, bool equal_x = false) const { - - if(this->is_identical(q)) + + if(this->is_identical(q)) return CGAL::EQUAL; - CGAL::Comparison_result res = (equal_x ? CGAL::EQUAL : compare_x(q)); + CGAL::Comparison_result res = (equal_x ? CGAL::EQUAL : compare_x(q)); if(res == CGAL::EQUAL) { res = _compare_y_at_x(q); } return res; } - + //! equality bool operator == (const Self& q) const {return q.compare_xy(*this)== 0;} - + //! inequality bool operator != (const Self& q) const {return q.compare_xy(*this)!= 0;} @@ -451,11 +451,11 @@ class Xy_coordinate_2 : //! greater-equal in (x,y) lexicographic order bool operator >= (const Self& q) const {return q.compare_xy(*this)<= 0;} - + //!@} //!@{ - //! \name + //! \name const Algebraic_curve_kernel_2* kernel() const { return this->ptr()->_m_kernel; @@ -468,56 +468,56 @@ class Xy_coordinate_2 : * * \pre x() == q.x() */ - CGAL::Comparison_result _compare_y_at_x(const Self& q) const + CGAL::Comparison_result _compare_y_at_x(const Self& q) const { CGAL_precondition(this->compare_x(q) == CGAL::EQUAL); - + Curve_analysis_2 f = curve(), g = q.curve(); - if(f.is_identical(g)) + if(f.is_identical(g)) return CGAL::sign(arcno() - q.arcno()); - if(Self::_simplify(*this, q)) + if(Self::_simplify(*this, q)) // restart since supporting curves might be equal now return _compare_y_at_x(q); - + Curve_pair_analysis_2 cpa_2 = kernel()->construct_curve_pair_2_object()(f, g); - - + + typename Curve_pair_analysis_2::Status_line_1 vline = cpa_2.status_line_for_x(x()); return CGAL::sign(vline.event_of_curve(arcno(), f) - vline.event_of_curve(q.arcno(), g)); } - + //!@} public: //!\name Reconstructing functions //!@{ - + /*!\brief * Simplifies the representation of a point. - * - * Given a decomposition of the point's supporting \c curve() into + * + * Given a decomposition of the point's supporting \c curve() into * a pair of two curves \c pair, this function searches this point * in the curve pair and resets the curve and the arcno to this - * found arc. It can happen, that both curves of the pair fit this + * found arc. It can happen, that both curves of the pair fit this * condition (intersection of the two curves at this point), then it * chooses the simpler one (less total degree). * * \pre pair must be a decomposition of curve() */ void simplify_by(const Curve_pair_analysis_2& cpa_2) const { - + CGAL_precondition_code( Polynomial_2 mult = cpa_2.curve_analysis(0).polynomial_2() * cpa_2.curve_analysis(1).polynomial_2(); ); // common parts - CGAL_precondition(CGAL::resultant(mult, + CGAL_precondition(CGAL::resultant(mult, curve().polynomial_2()).is_zero()); // full parts - CGAL_precondition(CGAL::degree(mult) == + CGAL_precondition(CGAL::degree(mult) == CGAL::degree(curve().polynomial_2())); CGAL_precondition(CGAL::total_degree(mult) == CGAL::total_degree(curve().polynomial_2())); @@ -529,7 +529,7 @@ class Xy_coordinate_2 : typename Curve_analysis_2::Status_line_1 cv_line = curve().status_line_for_x(x()); ); - CGAL_precondition(cpv_line.number_of_events() == + CGAL_precondition(cpv_line.number_of_events() == cv_line.number_of_events()); bool cid = false; @@ -542,22 +542,22 @@ class Xy_coordinate_2 : // line). Therefore, the old arc number is also valid in the curve // pair. Polynomial_2 ff = cpa_2.curve_analysis(0).polynomial_2(), - gg = cpa_2.curve_analysis(1).polynomial_2(); - if(total_degree(ff) > total_degree(gg)) + gg = cpa_2.curve_analysis(1).polynomial_2(); + if(total_degree(ff) > total_degree(gg)) cid = true; - } else + } else cid = (p.first == -1); // overwrite data this->ptr()->_m_curve = cpa_2.curve_analysis(cid); this->ptr()->_m_arcno = (cid == 0 ? p.first : p.second); } - + //! befriending output iterator // friend std::ostream& operator << <>(std::ostream& os, const Self& pt); //!@} public: - + //! Returns whether the x-coordinate equals zero bool is_x_zero() const { return CGAL::is_zero(this->ptr()->_m_x); @@ -568,18 +568,18 @@ class Xy_coordinate_2 : CGAL::Sign lower_sign = CGAL::sign(this->lower_bound_y()), upper_sign = CGAL::sign(this->upper_bound_y()); if( lower_sign == CGAL::ZERO ||upper_sign == CGAL::ZERO) { - if(lower_sign==upper_sign) { //both zero - return true; - } else { // one zero, one not...isol interval is OPEN - return false; - } + if(lower_sign==upper_sign) { //both zero + return true; + } else { // one zero, one not...isol interval is OPEN + return false; + } } else if( lower_sign==upper_sign) { // zero not in isol interval - return false; + return false; } else { // zero in interval, need to check - Polynomial_1 constant_pol = - CGAL::get_coefficient(curve().primitive_polynomial_2(),0); - bool zero_is_root_of_local_pol - = kernel()->is_zero_at_1_object()(constant_pol,this->ptr()->_m_x); + Polynomial_1 constant_pol = + CGAL::get_coefficient(curve().primitive_polynomial_2(),0); + bool zero_is_root_of_local_pol + = kernel()->is_zero_at_1_object()(constant_pol,this->ptr()->_m_x); // Since we know that y_iv is an _isolating_ interval, // we can immediately return return zero_is_root_of_local_pol; @@ -589,15 +589,15 @@ class Xy_coordinate_2 : // returns a double approximation of the point std::pair to_double() const { - typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel + typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT; - typedef typename AT::Bigfloat_interval BFI; + typedef typename AT::Bigfloat_interval BFI; long old_prec = get_precision(BFI()); - + set_precision (BFI(), 53); - // rely on double conversion of the x-type + // rely on double conversion of the x-type double double_x = CGAL::to_double(this->ptr()->_m_x); double double_y; @@ -607,32 +607,32 @@ class Xy_coordinate_2 : } else if(is_y_zero()) { double_y = 0.; } else { - while(CGAL::sign(this->lower_bound_y()) != + while(CGAL::sign(this->lower_bound_y()) != CGAL::sign(this->upper_bound_y()) ) { this->refine_y(); } long final_prec = set_precision(BFI(),get_precision(BFI())+4); - - BFI bfi = CGAL::hull(convert_to_bfi(this->lower_bound_y()), - convert_to_bfi(this->upper_bound_y())); - - while( !singleton(bfi) && + + BFI bfi = CGAL::hull(convert_to_bfi(this->lower_bound_y()), + convert_to_bfi(this->upper_bound_y())); + + while( !singleton(bfi) && get_significant_bits(bfi) < final_prec ){ this->refine_y(); bfi = CGAL::hull( - convert_to_bfi(this->lower_bound_y()), + convert_to_bfi(this->lower_bound_y()), convert_to_bfi(this->upper_bound_y())); } - double_y + double_y = CGAL::to_double((CGAL::lower(bfi)+ CGAL::upper(bfi)) / 2); } set_precision(BFI(),old_prec); - return std::make_pair(double_x, double_y); + return std::make_pair(double_x, double_y); } public: - + void refine_y() const { this->curve().status_line_at_exact_x(this->x()).refine(this->arcno()); } @@ -671,17 +671,17 @@ class Xy_coordinate_2 : }; // class Xy_coordinate_2 -template < class AlgebraicCurveKernel_2, class Rep> -std::ostream& operator<< (std::ostream& os, +template < class AlgebraicCurveKernel_2, class Rep> +std::ostream& operator<< (std::ostream& os, const Xy_coordinate_2& pt) { switch (::CGAL::get_mode(os)) { case ::CGAL::IO::PRETTY: { os << "[x-coord: " << CGAL::to_double(pt.x()) << "; curve: " << - pt.curve().polynomial_2() << + pt.curve().polynomial_2() << "; arcno: " << pt.arcno() << "]\n"; break; - } + } case ::CGAL::IO::BINARY: std::cerr << "BINARY format not yet implemented" << std::endl; break; @@ -695,40 +695,40 @@ std::ostream& operator<< (std::ostream& os, os << pt.arcno(); os << ")"; } - return os; + return os; } -template < class AlgebraicCurveKernel_2, class Rep_ > +template < class AlgebraicCurveKernel_2, class Rep_ > std::istream& operator >> ( std::istream& is, Xy_coordinate_2< AlgebraicCurveKernel_2, Rep_>& pt) { CGAL_precondition(CGAL::is_ascii(is)); - + // this instance's first template argument typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2; - + // this instance's second template argument typedef Rep_ Rep; // myself typedef Xy_coordinate_2< Algebraic_curve_kernel_2, Rep > Xy_coordinate_2; - - typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 + + typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 Algebraic_real_1; typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + // x-coordinate Algebraic_real_1 x; - + // supporting curve Curve_analysis_2 curve; - + // arc number on curve int arcno; - + // read "Algebraic_real_xca_2(" swallow(is, 'A'); swallow(is, 'l'); @@ -751,22 +751,22 @@ std::istream& operator >> ( swallow(is, '_'); swallow(is, '2'); swallow(is, '('); - - + + // read values is >> x; swallow(is, ','); - + is >> curve; swallow(is, ','); - + is >> arcno; - + // read the ") - swallow(is, ')'); - + swallow(is, ')'); + pt = Xy_coordinate_2(x, curve, arcno); - + return is; } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h index b9d96c16e0b3..58a80d975a1c 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -34,7 +34,7 @@ namespace CGAL { namespace internal { -/* +/* * \brief Function for merging two sets * * This function is similar to the \c std::union_set operation. @@ -55,41 +55,41 @@ set_union_with_source(InputIterator1 first_begin, OutputIterator1 merged_values, OutputIterator2 merged_values_info, BinaryFunction compare) { - + InputIterator1 first_it=first_begin; InputIterator2 second_it=second_begin; while((first_it != first_end) || (second_it!=second_end)) { - if(first_it == first_end) { + if(first_it == first_end) { *merged_values=*second_it++; ++merged_values; *merged_values_info++ = CGAL::internal::ROOT_OF_SECOND_SET; continue; - } - if(second_it == second_end) { + } + if(second_it == second_end) { *merged_values++=*first_it++; *merged_values_info++ = CGAL::internal::ROOT_OF_FIRST_SET; continue; - } + } - CGAL::Comparison_result c = compare(*first_it,*second_it); + CGAL::Comparison_result c = compare(*first_it,*second_it); - if(c==CGAL::EQUAL) { + if(c==CGAL::EQUAL) { *merged_values++=*first_it++; ++second_it; *merged_values_info++ = CGAL::internal::ROOT_OF_BOTH_SETS; continue; - } - if(c==CGAL::SMALLER) { + } + if(c==CGAL::SMALLER) { *merged_values++=*first_it++; *merged_values_info++ = CGAL::internal::ROOT_OF_FIRST_SET; continue; - } - if(c==CGAL::LARGER) { + } + if(c==CGAL::LARGER) { *merged_values++=*second_it++; *merged_values_info++ = CGAL::internal::ROOT_OF_SECOND_SET; continue; - } + } } return std::make_pair(merged_values,merged_values_info); } @@ -105,7 +105,7 @@ Poly_2 poly_non_vanish_leading_term(Algebraic_kernel_d_1* kernel, Algebraic_real alpha) { Poly_2 f(pol); while(true) { - if(kernel->is_zero_at_1_object() + if(kernel->is_zero_at_1_object() (CGAL::leading_coefficient(f),alpha)) { typename Poly_2::const_iterator poly_end = f.end(); if(f.begin()==poly_end) { @@ -113,10 +113,10 @@ Poly_2 poly_non_vanish_leading_term(Algebraic_kernel_d_1* kernel, } poly_end--; f=Poly_2(f.begin(),poly_end); - } - else { + } + else { break; - } + } } return f; } @@ -124,9 +124,9 @@ Poly_2 poly_non_vanish_leading_term(Algebraic_kernel_d_1* kernel, /*! * \brief finds a Rational value left of an Algebraic real alpha */ -template typename AlgebraicKernel_1::Bound - bound_left_of(const AlgebraicKernel_1* kernel, - typename AlgebraicKernel_1::Algebraic_real_1 ar) { +template typename AlgebraicKernel_1::Bound + bound_left_of(const AlgebraicKernel_1* kernel, + typename AlgebraicKernel_1::Algebraic_real_1 ar) { typedef AlgebraicKernel_1 Algebraic_kernel_d_1; @@ -143,10 +143,10 @@ template typename AlgebraicKernel_1::Bound break; } case(CGAL::NEGATIVE): { - Algebraic_real_1 small_value - = kernel->construct_algebraic_real_1_object() - (Bound(2)*kernel->approximate_absolute_1_object()(ar,1).first); - + Algebraic_real_1 small_value + = kernel->construct_algebraic_real_1_object() + (Bound(2)*kernel->approximate_absolute_1_object()(ar,1).first); + return kernel->bound_between_1_object()(small_value,ar); // = small_value.rational_between(ar); //= ar.low()-1; @@ -159,79 +159,79 @@ template typename AlgebraicKernel_1::Bound /*! * \brief finds a Rational value rightt of an Algebraic real alpha */ -template typename AlgebraicKernel_1::Bound - bound_right_of(const AlgebraicKernel_1* kernel, - typename AlgebraicKernel_1::Algebraic_real_1 ar) { - +template typename AlgebraicKernel_1::Bound + bound_right_of(const AlgebraicKernel_1* kernel, + typename AlgebraicKernel_1::Algebraic_real_1 ar) { + return -bound_left_of(kernel,-ar); } /*! - * \brief Produces intermediate rational values for a list of + * \brief Produces intermediate rational values for a list of * algebraic reals. * - * For a list of Algebraic real values with \c n elements, a list with - * n+1 elements of rational values is given such that the + * For a list of Algebraic real values with \c n elements, a list with + * n+1 elements of rational values is given such that the * ith element is * between the ith and the (i+1)th element of the input list * * The input list must be in increasing order */ template + typename InputIterator, + typename OutputIterator> OutputIterator find_intermediate_values(const AlgebraicKernel_1* kernel, - InputIterator start, - InputIterator end, - OutputIterator output) { + InputIterator start, + InputIterator end, + OutputIterator output) { CGAL_static_assertion ((::boost::is_same - ::value_type >::value)); - + ::value_type >::value)); + typedef typename AlgebraicKernel_1::Bound Bound; if(start==end) { - // Empty vector, create one element - *output++=Bound(0); - return output; + // Empty vector, create one element + *output++=Bound(0); + return output; } *output++=bound_left_of(kernel,*start); - + InputIterator it_1(start),it_2(start); ++it_2; while(it_2 != end) { - CGAL_assertion(it_1->compare(*it_2)==CGAL::SMALLER); - Bound beta - = kernel->bound_between_1_object()(*it_1,*it_2); - *output++=beta; - ++it_1; - ++it_2; + CGAL_assertion(it_1->compare(*it_2)==CGAL::SMALLER); + Bound beta + = kernel->bound_between_1_object()(*it_1,*it_2); + *output++=beta; + ++it_1; + ++it_2; } *output++=bound_right_of(kernel,*it_1); return output; } - + // Used internally for zero_test_bivariate namespace for_zero_test_bivariate { -template +template void cast_back_utcf(const Poly_coer_1& p,Polynomial_1& q) { // We can assume that both template arguments are polynomial types typedef CGAL::Fraction_traits FT; CGAL_static_assertion((::boost::is_same::value)); + CGAL::Tag_true>::value)); typedef typename FT::Numerator_type Numerator; typedef typename FT::Denominator_type Denominator; typedef CGAL::Coercion_traits Num_coercion; CGAL_static_assertion((::boost::is_same - ::value)); + ::value)); Numerator p_num; Denominator p_denom; typename FT::Decompose()(p,p_num,p_denom); @@ -244,11 +244,11 @@ template void cast_back_utcf(const A& p, A& q) { } // of namespace for_zero_test_bivariate -/* +/* * \brief Symbolic zero test. * - * Checks whether h(x,y(x))=0, where y(x) is a rational - * expression in terms of \c x, i.e. y=p/q with p,q + * Checks whether h(x,y(x))=0, where y(x) is a rational + * expression in terms of \c x, i.e. y=p/q with p,q * univariate polynomials */ template @@ -262,12 +262,12 @@ template bool result; typedef typename AlgebraicCurveKernel_2::Polynomial_1 Polynomial_1; #if !CGAL_ACK_USE_NO_REDUCTION_MODULO_RESULTANT - + //typedef typename AlgebraicCurveKernel_2::Algebraic_real_1 Algebraic_real_1; typedef typename AlgebraicCurveKernel_2::Bound Bound; typedef typename AlgebraicCurveKernel_2::Coefficient Coefficient; typedef typename AlgebraicCurveKernel_2::Polynomial_2 Polynomial_2; - + typedef CGAL::Coercion_traits Coercion; typedef typename Coercion::Type Coercion_type; typedef typename CGAL::Polynomial_traits_d @@ -289,25 +289,25 @@ template (q.begin(),cast), boost::make_transform_iterator (q.end(),cast)); - + if(general) { - + Poly_coer_1 modulus = typename CGAL::Polynomial_traits_d - ::Construct_polynomial() + ::Construct_polynomial() (boost::make_transform_iterator (alpha.polynomial().begin(),cast), boost::make_transform_iterator (alpha.polynomial().end(),cast)); - + /* #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Mod: " << modulus << std::endl; - #endif + #endif */ p_rat=CGAL::mod(p_rat,modulus); q_rat=CGAL::mod(q_rat,modulus); - + int n = CGAL::degree(h,1); // Create the powers of p and q mod modulus /* @@ -362,12 +362,12 @@ template CGAL_ACK_DEBUG_PRINT << "done\ncomp rat pol.." << std::flush; #endif */ - + Poly_coer_1 curr_coeff,curr_fac; Poly_coer_1 h_0_rat(Coercion_type(0)); for(int i=0;i<=n;i++) { - Poly_coer_1 tmp_pol = typename CGAL::Polynomial_traits_d - ::Construct_polynomial() + Poly_coer_1 tmp_pol = typename CGAL::Polynomial_traits_d + ::Construct_polynomial() (boost::make_transform_iterator (h[i].begin(),cast), boost::make_transform_iterator @@ -377,25 +377,25 @@ template h_0_rat+=curr_fac; } - Polynomial_1 h_0_utcf; - for_zero_test_bivariate::cast_back_utcf(h_0_rat,h_0_utcf); - + Polynomial_1 h_0_utcf; + for_zero_test_bivariate::cast_back_utcf(h_0_rat,h_0_utcf); + return kernel->is_zero_at_1_object() (h_0_utcf,alpha); } else { Coercion_type b = cast(alpha.rational()), - p_b=CGAL::evaluate(p_rat,b),q_b=CGAL::evaluate(q_rat,b); + p_b=CGAL::evaluate(p_rat,b),q_b=CGAL::evaluate(q_rat,b); int n = CGAL::degree(h,1); Coercion_type eval(0); for(int i=0;i<=n;i++) { - Poly_coer_1 h_i_rat = typename CGAL::Polynomial_traits_d - ::Construct_polynomial() - (boost::make_transform_iterator - (CGAL::get_coefficient(h,i).begin(),cast), - boost::make_transform_iterator - (CGAL::get_coefficient(h,i).end(),cast)); - eval+=CGAL::evaluate(h_i_rat,b) - *CGAL::ipower(p_b,i)*CGAL::ipower(q_b,n-i); + Poly_coer_1 h_i_rat = typename CGAL::Polynomial_traits_d + ::Construct_polynomial() + (boost::make_transform_iterator + (CGAL::get_coefficient(h,i).begin(),cast), + boost::make_transform_iterator + (CGAL::get_coefficient(h,i).end(),cast)); + eval+=CGAL::evaluate(h_i_rat,b) + *CGAL::ipower(p_b,i)*CGAL::ipower(q_b,n-i); } result=(CGAL::sign(eval)==CGAL::ZERO); } @@ -403,14 +403,14 @@ template #warning Uses no reduction modulo resultant! Polynomial_1 h_0=CGAL::evaluate_homogeneous(h,p,q); result= kernel->is_zero_at_1_object() (h_0,alpha); -#endif - +#endif + return result; - + } - + } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/bound_between_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/bound_between_1.h index 750a61a8c116..67dd1a3ea3fa 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/bound_between_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/bound_between_1.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // // Author(s) : Michael Kerber @@ -51,7 +51,7 @@ simple_bound_between(const Algebraic_real& a, //srb.start(); typedef typename Algebraic_real::Rational Rational; typename CGAL::Fraction_traits::Compose compose; - typedef typename + typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK; typedef typename AK::Bigfloat_interval Bigfloat_interval; typedef typename CGAL::Bigfloat_interval_traits @@ -64,7 +64,7 @@ simple_bound_between(const Algebraic_real& a, if(a>b) { return simple_bound_between(b,a); } - + //std::cout << "Intermediate1: " << CGAL::to_double(a) << " " << CGAL::to_double(b) << std::endl; /* * First, refine a and b until their isolating intervals are disjoint @@ -89,7 +89,7 @@ simple_bound_between(const Algebraic_real& a, //srb_b.start(); Bigfloat x=CGAL::upper(CGAL::convert_to_bfi(a.high())); Bigfloat y=CGAL::lower(CGAL::convert_to_bfi(b.low())); - + if(x>=y) { Rational size_a=a.high() - a.low(), size_b=b.high() - b.low(), @@ -110,7 +110,7 @@ simple_bound_between(const Algebraic_real& a, y=CGAL::lower(CGAL::convert_to_bfi(b.low())); } else { a.refine(); - size_a=a.high()-a.low(); + size_a=a.high()-a.low(); x=CGAL::upper(CGAL::convert_to_bfi(a.high())); } size_max = size_a>size_b ? size_a : size_b; @@ -118,7 +118,7 @@ simple_bound_between(const Algebraic_real& a, } } } - CGAL_assertion(x 0) && (y_m < 0)) || ((x_m < 0) && (y_m > 0))) { //srb.stop(); return Rational(0); @@ -173,7 +173,7 @@ simple_bound_between(const Algebraic_real& a, } //srb_d.stop(); CGAL_assertion(y_e==x_e && x_e==min_e); - CGAL_assertion(x_m < y_m); + CGAL_assertion(x_m < y_m); //std::cout << "Floats4: " << x_m << " " << x_e << " and " << y_m << " " << y_e << std::endl; // Avoid mantissas to have difference one @@ -190,7 +190,7 @@ simple_bound_between(const Algebraic_real& a, long x_log = x_m==Integer(0) ? -1 : CGAL::internal::floor_log2_abs(x_m), y_log = y_m==Integer(0) ? -1 : CGAL::internal::floor_log2_abs(y_m), old_log = y_log; - //std::cout << x_log << " < " << y_log << std::endl; + //std::cout << x_log << " < " << y_log << std::endl; while(x_log==y_log) { //std::cout << "here" << std::endl; while(old_log > y_log) { @@ -250,7 +250,7 @@ simple_bound_between(const Algebraic_real& a, return rat_between; } - + } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/construct_binary.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/construct_binary.h index f1871e5217af..7c9006383688 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/construct_binary.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/construct_binary.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -33,23 +33,23 @@ namespace CGAL { namespace internal { -// Generic construct_binary function, using ipower +// Generic construct_binary function, using ipower template< class Integer > inline void construct_binary( const Integer& e, Integer& x ) { CGAL_precondition( e >= 0 ); Integer exponent(e); x = Integer(1); - + const Integer max_ipower = (exponent > Integer((std::numeric_limits::max)())) ? - CGAL::ipower( Integer(2), (std::numeric_limits::max)() ) : + CGAL::ipower( Integer(2), (std::numeric_limits::max)() ) : Integer(0); - + while( exponent > Integer((std::numeric_limits::max)()) ) { x *= max_ipower; - exponent -= Integer((std::numeric_limits::max)()); + exponent -= Integer((std::numeric_limits::max)()); } - - x *= CGAL::ipower( Integer(2), (int)CGAL::to_double(exponent) ); + + x *= CGAL::ipower( Integer(2), (int)CGAL::to_double(exponent) ); } template< class Integer, class Rational > @@ -57,7 +57,7 @@ inline void construct_binary( const Integer& m, const Integer& e, Rational& x ) Integer den(1), num; if(e>0) { construct_binary( e, num ); - num *= m; + num *= m; } else { num = m; @@ -67,22 +67,22 @@ inline void construct_binary( const Integer& m, const Integer& e, Rational& x ) } // Specialization for LEDA - + #ifdef CGAL_USE_LEDA - + // Constructs 2^e from an integer e. Needed in Descartes inline void construct_binary(const ::leda::integer& e, ::leda::integer& x) { typedef ::leda::integer Integer; x = Integer(1) << e.to_long(); } - + // Constructs m*2^e from two integers m,e. Needed in Descartes inline void construct_binary(const ::leda::integer& m, const ::leda::integer& e, ::leda::rational& x) { - + typedef ::leda::integer Integer; typedef ::leda::rational Rational; - + Integer den(1); Integer num(m); if(e>0) { @@ -99,19 +99,19 @@ inline void construct_binary( const Integer& m, const Integer& e, Rational& x ) // Specialization for CORE #ifdef CGAL_USE_CORE - + // Constructs 2^e from an integer e. Needed in Descartes inline void construct_binary(const ::CORE::BigInt& e, ::CORE::BigInt& x) { typedef ::CORE::BigInt Integer; x = Integer(1) << ::CORE::ulongValue(e); } - + // Constructs m*2^e from two integers m,e. Needed in Descardes - inline void construct_binary(const ::CORE::BigInt& m, const ::CORE::BigInt& e, + inline void construct_binary(const ::CORE::BigInt& m, const ::CORE::BigInt& e, ::CORE::BigRat& x) { typedef ::CORE::BigInt Integer; typedef ::CORE::BigRat Rational; - + Integer den(1); Integer num(m); if(e>0) { @@ -122,7 +122,7 @@ inline void construct_binary( const Integer& m, const Integer& e, Rational& x ) } x = Rational(num, den); } - + #endif // CGAL_USE_CORE } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/enums.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/enums.h index 257f2555ae51..692242406373 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/enums.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/enums.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -31,14 +31,14 @@ namespace internal { } // namespace internal /*! - * \brief Represents different strategies how to handle + * \brief Represents different strategies how to handle * degenerate cases during the analysis * - * Currently, there are two possible strategies implemented. See the + * Currently, there are two possible strategies implemented. See the * constructor of \c Curve_analysis_2 for more details. */ enum Degeneracy_strategy { - + SHEAR_STRATEGY = 0, EXCEPTION_STRATEGY = 1, SHEAR_ONLY_AT_IRRATIONAL_STRATEGY = 2 diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h index 915bdf49c842..4dd9c4b51225 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -22,22 +22,22 @@ namespace CGAL { namespace internal { - /*! + /*! * \brief Exception class for not sufficiently generic positions. * * Must be thrown whenever a curve cannot be analysed because its position * is not "good enough". */ class Non_generic_position_exception { - + public: //! Default constructible Non_generic_position_exception() {} - + }; - /*! + /*! * \brief Exception class for not sufficiently generic positions. * * Must be thrown whenever a curve cannot be analysed because its position @@ -45,7 +45,7 @@ namespace CGAL { */ template class Zero_resultant_exception { - + Polynomial curve1,curve2; bool one_curve_failure; @@ -54,11 +54,11 @@ namespace CGAL { Zero_resultant_exception(Polynomial c) : curve1(c), curve2(c),one_curve_failure(true) {} - + Zero_resultant_exception(Polynomial c1,Polynomial c2) : curve1(c1),curve2(c2),one_curve_failure(false) {} - + }; } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h index 9e596c866be5..4b3629b29ec0 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -17,10 +17,10 @@ #ifndef CGAL_ACK_FLAGS_H #define CGAL_ACK_FLAGS_H 1 -// TODO: use new interface and remove this flag -#ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE +// TODO: use new interface and remove this flag +#ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE #define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 0 -#endif +#endif // Is debug-information printed? #ifndef CGAL_ACK_DEBUG_FLAG @@ -50,7 +50,7 @@ #endif /** - * For random choices in the algorithm, this seed is used + * For random choices in the algorithm, this seed is used * If set to zero, a random seed is used */ #ifndef CGAL_ACK_STATIC_SEED @@ -66,7 +66,7 @@ /** - * If set, the program uses the AlciX-code + * If set, the program uses the AlciX-code * for the curve- and curve-pair-analysis. * This flag is only for debugging purposes. */ @@ -90,7 +90,7 @@ * compuation time * * WARNING: Currently, the status line does not store the additional - * information whether a point is singluar or not. + * information whether a point is singluar or not. * Therefore, there is currently no reasons to set this flag. It is still * contained for possible further extension of the status line. */ @@ -110,7 +110,7 @@ * The "resultant first" strategy means: instead of computing the full * subresultant sequence (or Sturm-Habicht sequence), the algorithm * only computed the resultant in a first step. This suffices already for - * many curves (i.e., regular ones). The full subresultant is computed + * many curves (i.e., regular ones). The full subresultant is computed * if it is needed for the first time. * * This strategy only makes sense if computing resultants is faster than @@ -147,7 +147,7 @@ /** * Allows to switch off the specialized method for Status_line_CPA_1 * if multiplicity is zero or one. - * Since this methods improves the performance, + * Since this methods improves the performance, * it is not recommended to set this flag unless for testing */ #ifndef ACK_CGAL_NO_ARC_FLIP @@ -160,7 +160,7 @@ * SHEAR_STRATEGY performs a shear whenever a degenerate situation occurs. * SHEAR_ONLY_AT_IRRATIONAL_STRATEGY handles rational coordinates with * a more direct method, but performs a shear for irrational x-coordinates - * that have a degeneracy. Finally, EXCEPTION_STRATEGY throws an exception + * that have a degeneracy. Finally, EXCEPTION_STRATEGY throws an exception * whenever a degeneracy occurs. */ #ifndef CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY @@ -182,7 +182,7 @@ * At some points in the algorithm, it is checked whether a polynomial * H(x):=h(p(x),q(x)) vanishes for an algebraic number x_0 with polynomial r. * For that check, the computation of H is done modulo r for efficiency. - * This can be switched off by this flag, though it is recommended not to + * This can be switched off by this flag, though it is recommended not to * do so. */ #ifndef CGAL_ACK_USE_NO_REDUCTION_MODULO_RESULTANT diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/macros.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/macros.h index cba21e50b910..89fd9c79c8cf 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/macros.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/macros.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Eric Berberich // Michael Kerber diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h index f5ca20406378..a3f719d8ada7 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -35,33 +35,33 @@ int descartes(Polynomial& p, const Field& low,const Field& high){ typedef typename Polynomial::NT Coefficient; typedef typename Fraction_traits::Numerator_type Numerator; typedef typename Fraction_traits::Denominator_type Denominator; - + typename Fraction_traits::Decompose decomp; - //typename Algebraic_structure_traits::Simplify simplify; + //typename Algebraic_structure_traits::Simplify simplify; //simplify(low); //simplify(high); Numerator num_high, num_low_sub_high; Denominator den_high, den_low_sub_high; - + decomp(high, num_high, den_high); decomp(low - high, num_low_sub_high, den_low_sub_high); - + Coefficient tmp(num_high); // apply Descartes' rule to count zeros of q in ]low,high[ Polynomial transf = // q(high + (low-high)/(1+x)) CGAL::translate_by_one( CGAL::reversal( CGAL::scale_homogeneous( - CGAL::translate_homogeneous(p - ,Coefficient(num_high) + CGAL::translate_homogeneous(p + ,Coefficient(num_high) ,Coefficient(den_high)) - ,Coefficient(num_low_sub_high) + ,Coefficient(num_low_sub_high) ,Coefficient(den_low_sub_high) ) ) - ); + ); return sign_variations(transf); } @@ -122,8 +122,8 @@ bool refine_zero_against(Field& low, Field& high, Polynomial p, Polynomial q) { gcd_pq = Polynomial(1); } } - std::cout << CGAL::to_double(low) << " " - << CGAL::to_double(high) << " " + std::cout << CGAL::to_double(low) << " " + << CGAL::to_double(high) << " " << CGAL::degree(gcd_pq) << " " << gcd_pq << std::endl; @@ -162,7 +162,7 @@ template < class Polynomial, class Field > static bool strong_refine_zero_against(Field& low, Field& high, Polynomial p, Polynomial q){ std::cout << "comp has_common_root" << std::endl; - + bool has_common_root = refine_zero_against(low,high,p,q); std::cout << "done, " << has_common_root << std::endl; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/shear.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/shear.h index 118abc85633d..9798499490b3 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/shear.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/shear.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -32,9 +32,9 @@ namespace internal { /*! \ingroup NiX_bivariate_polynomial_hacks * \brief Computes the polynomial f(x+sy,y) - */ + */ template -CGAL::Polynomial > +CGAL::Polynomial > shear(const CGAL::Polynomial >& f,NT s) { typedef CGAL::Polynomial Poly_1; typedef CGAL::Polynomial Poly_2; @@ -51,7 +51,7 @@ shear(const CGAL::Polynomial >& f,NT s) { return typename CGAL::Polynomial_traits_d::Substitute() (f,coeffs.begin(), coeffs.end()); - + } } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/univariate_polynomial_utils.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/univariate_polynomial_utils.h index a8a3f99d9bc8..9f245fbfb438 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/univariate_polynomial_utils.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/univariate_polynomial_utils.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Hemmer // @@ -29,13 +29,13 @@ namespace internal { * \relates CGAL::Polynomial */ template - NT weak_upper_root_bound(const Polynomial& P) { + NT weak_upper_root_bound(const Polynomial& P) { // code comes from Kurt Mehlhorn // see [Mignotte, 1992], p.144 for a proof CGAL_precondition(Polynomial_traits_d::d == 0); typename Real_embeddable_traits::Abs abs; const int n = CGAL::degree(P); - NT x(1); + NT x(1); NT val; for (;;) { val = -abs(P[n]); @@ -46,7 +46,7 @@ namespace internal { x *= NT(2); } } - + //! return the number of sign variations in the coefficient sequence of \c P. /*! This is the number of sign changes (+ to - or - to +) in the * coefficient sequence of the polynomial, ignoring zeroes. @@ -55,7 +55,7 @@ namespace internal { * \relates CGAL::Polynomial */ template - int sign_variations(const Polynomial& P) { + int sign_variations(const Polynomial& P) { const int n = CGAL::degree(P); int variations = 0; int old_sign = CGAL::sign(P[n]); // never zero unless P is zero @@ -72,8 +72,8 @@ namespace internal { /*! \ingroup CGAL_polynomial_utils * \brief checks whether a univariate polynomial is square-free - */ - + */ + /*template < class NT > bool is_square_free(const Polynomial& p) { if( may_have_multiple_factor(p) ) { @@ -83,13 +83,13 @@ namespace internal { return true; } } - + template< class NT > - bool is_square_free( const Polynomail< Polynomial< NT > >& ) { - - + bool is_square_free( const Polynomail< Polynomial< NT > >& ) { + + return true; - } */ + } */ } // namespace internal diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_1.h index 25a226d935fb..8b5f1e321ce3 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_1.h @@ -6,9 +6,9 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Michael Hemmer +// +// Author(s) : Michael Hemmer // Sebastian Limbach // Michael Kerber // @@ -19,9 +19,9 @@ #include -#ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE +#ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE #define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 0 -#endif +#endif #include #include @@ -41,11 +41,11 @@ namespace CGAL { namespace internal { template< class AlgebraicReal1, class Isolator_ > class Algebraic_kernel_d_1_base { - + public: typedef AlgebraicReal1 Algebraic_real_1; typedef Isolator_ Isolator; - + typedef typename Algebraic_real_1::Coefficient Coefficient; typedef typename Algebraic_real_1::Bound Bound; typedef typename Algebraic_real_1::Polynomial_1 Polynomial_1; @@ -70,63 +70,63 @@ class Algebraic_kernel_d_1_base { struct Pair_second : public CGAL::cpp98::unary_function,B> { B operator() (std::pair pair) const { return pair.second; } }; - -public: + +public: class Algebraic_real_traits { public: typedef Algebraic_real_1 Type; - - struct Bound_between + + struct Bound_between : public CGAL::cpp98::binary_function< Type, Type, Bound > { - Bound operator()( const Type& t1, + Bound operator()( const Type& t1, const Type& t2 ) const { #if CGAL_AK_DONT_USE_SIMPLE_BOUND_BETWEEN #warning uses deprecated bound_between_1 functor return t1.rational_between( t2 ); #else - return internal::simple_bound_between(t1,t2); + return internal::simple_bound_between(t1,t2); #endif } }; - + struct Lower_bound : public CGAL::cpp98::unary_function< Type, Bound > { Bound operator()( const Type& t ) const { return t.low(); } }; - + struct Upper_bound : public CGAL::cpp98::unary_function< Type, Bound > { Bound operator()( const Type& t ) const { return t.high(); } }; - + struct Refine : public CGAL::cpp98::unary_function< Type, void > { void operator()( const Type& t ) const { t.refine(); } - + void operator()( Type& t, int rel_prec ) const { // If t is zero, we can refine the interval to // infinite precission if( CGAL::is_zero( t ) ) { - t = Type(0); + t = Type(0); } else { // Refine until both boundaries have the same sign - while( CGAL::sign( t.high() ) != + while( CGAL::sign( t.high() ) != CGAL::sign( t.low() ) ) t.refine(); - + CGAL_assertion( CGAL::sign( t.high() ) != CGAL::ZERO && CGAL::sign( t.low() ) != CGAL::ZERO ); - + // Calculate the needed precision - Bound prec = Bound(1) / + Bound prec = Bound(1) / CGAL::ipower( Bound(2), rel_prec ); - + // Refine until precision is reached while( CGAL::abs( t.high() - t.low() ) / (CGAL::max)( CGAL::abs( t.high() ), @@ -135,20 +135,20 @@ class Algebraic_kernel_d_1_base { CGAL_assertion( CGAL::sign( t.high() ) != CGAL::ZERO && CGAL::sign( t.low() ) != CGAL::ZERO ); - - } - } + + } + } } - }; - + }; + struct Approximate_absolute_1: public CGAL::cpp98::binary_function >{ - std::pair + std::pair operator()(const Algebraic_real_1& x, int prec) const { - Lower_bound lower; - Upper_bound upper; - Refine refine; - Bound l = lower(x); + Lower_bound lower; + Upper_bound upper; + Refine refine; + Bound l = lower(x); Bound u = upper(x); Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec)); while((prec>0)?((u-l)*error>Bound(1)):((u-l)>error)){ @@ -158,19 +158,19 @@ class Algebraic_kernel_d_1_base { } return std::make_pair(l,u); } - }; - + }; + struct Approximate_relative_1: public CGAL::cpp98::binary_function >{ - std::pair + std::pair operator()(const Algebraic_real_1& x, int prec) const { - + if(CGAL::is_zero(x)) return std::make_pair(Bound(0),Bound(0)); - - Lower_bound lower; - Upper_bound upper; - Refine refine; - Bound l = lower(x); + + Lower_bound lower; + Upper_bound upper; + Refine refine; + Bound l = lower(x); Bound u = upper(x); Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec)); Bound min_b = (CGAL::min)(CGAL::abs(u),CGAL::abs(l)); @@ -187,27 +187,27 @@ class Algebraic_kernel_d_1_base { #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE typedef Lower_bound Lower_boundary; typedef Upper_bound Upper_boundary; - typedef Bound_between Boundary_between; -#endif + typedef Bound_between Boundary_between; +#endif }; // class Algebraic_real_traits struct Construct_algebraic_real_1; - + // Functors of Algebraic_kernel_d_1 struct Solve_1 { public: template - OutputIterator - operator()(const Polynomial_1& p, OutputIterator oi) const { + OutputIterator + operator()(const Polynomial_1& p, OutputIterator oi) const { #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE #else CGAL_precondition(!CGAL::is_zero(p)); #endif - internal::Real_roots< Algebraic_real_1, Isolator > real_roots; + internal::Real_roots< Algebraic_real_1, Isolator > real_roots; std::list< int > mults; - std::list< Algebraic_real_1 > roots; + std::list< Algebraic_real_1 > roots; real_roots( p, std::back_inserter(roots), std::back_inserter( mults ) ); CGAL_assertion(roots.size()==mults.size()); std::list::iterator mit =mults.begin(); @@ -220,29 +220,29 @@ class Algebraic_kernel_d_1_base { } return oi; } - + #if 1 || CGAL_AK_ENABLE_DEPRECATED_INTERFACE template< class OutputIterator > - OutputIterator operator()( - const Polynomial_1& p, - OutputIterator oi , + OutputIterator operator()( + const Polynomial_1& p, + OutputIterator oi , bool known_to_be_square_free) const { return this->operator()(p,known_to_be_square_free,oi); } #endif template< class OutputIterator > - OutputIterator operator()( - const Polynomial_1& p, + OutputIterator operator()( + const Polynomial_1& p, bool known_to_be_square_free, OutputIterator oi) const { - internal::Real_roots< Algebraic_real_1, Isolator > real_roots; + internal::Real_roots< Algebraic_real_1, Isolator > real_roots; #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE #else CGAL_precondition(!CGAL::is_zero(p)); #endif - std::list roots; + std::list roots; if( known_to_be_square_free ){ real_roots(p,std::back_inserter(roots)); }else{ @@ -254,30 +254,30 @@ class Algebraic_kernel_d_1_base { #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE template< class OutputIteratorRoots , class OutputIteratorMults > - std::pair - operator()( - const Polynomial_1& p, + std::pair + operator()( + const Polynomial_1& p, OutputIteratorRoots roi, OutputIteratorMults moi) const { - internal::Real_roots< Algebraic_real_1, Isolator > real_roots; + internal::Real_roots< Algebraic_real_1, Isolator > real_roots; real_roots(p,roi,moi); return std::make_pair(roi,moi); } #endif protected: - + /* // TODO: Can we avoid to use this? - struct Greater_compare : + struct Greater_compare : public CGAL::cpp98::binary_function { - + bool operator() (const Algebraic_real_1& a, const Algebraic_real_1& b) - const { - return a>b; + const { + return a>b; } - + }; */ @@ -285,41 +285,41 @@ class Algebraic_kernel_d_1_base { template< class OutputIterator > OutputIterator operator()(const Polynomial_1& p, Bound l, Bound u, - OutputIterator res) const { - + OutputIterator res) const { + std::vector > roots; this->operator() (p,std::back_inserter(roots)); Algebraic_real_1 alg_l=Construct_algebraic_real_1()(l); Algebraic_real_1 alg_u=Construct_algebraic_real_1()(u); typedef typename - std::vector >::iterator - Iterator; + std::vector >::iterator + Iterator; Pair_first pair_first; Iterator it_start=std::lower_bound - (::boost::make_transform_iterator(roots.begin(),pair_first), - ::boost::make_transform_iterator(roots.end(),pair_first), - alg_l).base(); + (::boost::make_transform_iterator(roots.begin(),pair_first), + ::boost::make_transform_iterator(roots.end(),pair_first), + alg_l).base(); Iterator it_end=std::upper_bound - (::boost::make_transform_iterator(it_start,pair_first), - ::boost::make_transform_iterator(roots.end(),pair_first), - alg_u).base(); + (::boost::make_transform_iterator(it_start,pair_first), + ::boost::make_transform_iterator(roots.end(),pair_first), + alg_u).base(); std::copy(it_start,it_end,res); return res; } template< class OutputIterator > - OutputIterator operator()(const Polynomial_1& p, - bool known_to_be_square_free, - Bound l, Bound u, - OutputIterator res) const { - + OutputIterator operator()(const Polynomial_1& p, + bool known_to_be_square_free, + Bound l, Bound u, + OutputIterator res) const { + std::vector roots; this->operator() (p,known_to_be_square_free,std::back_inserter(roots)); Algebraic_real_1 alg_l=Construct_algebraic_real_1()(l); Algebraic_real_1 alg_u=Construct_algebraic_real_1()(u); typedef typename - std::vector::iterator - Iterator; + std::vector::iterator + Iterator; Iterator it_start=std::lower_bound(roots.begin(),roots.end(),alg_l); Iterator it_end=std::upper_bound(it_start,roots.end(),alg_u); std::copy(it_start,it_end,res); @@ -328,26 +328,26 @@ class Algebraic_kernel_d_1_base { }; - class Number_of_solutions_1 + class Number_of_solutions_1 : public CGAL::cpp98::unary_function { - + public: - - size_type operator() - (const Polynomial_1& p) const { - std::vector > roots; - Solve_1()(p,std::back_inserter(roots)); - return static_cast(roots.size()); + size_type operator() + (const Polynomial_1& p) const { + + std::vector > roots; + Solve_1()(p,std::back_inserter(roots)); + return static_cast(roots.size()); } }; - - struct Sign_at_1 + + struct Sign_at_1 : public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > { CGAL::Sign operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const { - if(CGAL::is_zero(p)) return ZERO; + if(CGAL::is_zero(p)) return ZERO; if(CGAL::degree(p)==0) return p.sign_at(0); if( ar.low() == ar.high() ) return p.sign_at( ar.low() ); @@ -356,52 +356,52 @@ class Algebraic_kernel_d_1_base { } Polynomial_1 g = gcd_utcf(p,ar.polynomial()); - if (g.sign_at(ar.low()) != g.sign_at(ar.high())) return ZERO; - + if (g.sign_at(ar.low()) != g.sign_at(ar.high())) return ZERO; + while(internal::descartes(p,ar.low(),ar.high()) > 0) ar.refine(); while( p.sign_at(ar.low()) == ZERO ) ar.refine(); while( p.sign_at(ar.high()) == ZERO ) ar.refine(); CGAL::Sign result = p.sign_at(ar.low()); CGAL_assertion(result == p.sign_at(ar.high())); - return result; + return result; } - }; - struct Is_zero_at_1 + }; + struct Is_zero_at_1 : public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, bool > { bool operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const { - if(CGAL::is_zero(p)) return true; + if(CGAL::is_zero(p)) return true; if( ar.low() == ar.high() ) return p.sign_at( ar.low() ) == ZERO; Polynomial_1 g = gcd_utcf(p,ar.polynomial()); return g.sign_at(ar.low()) != g.sign_at(ar.high()); } - }; - - struct Is_square_free_1 + }; + + struct Is_square_free_1 : public CGAL::cpp98::unary_function< Polynomial_1, bool > { bool operator()( const Polynomial_1& p ) const { typename CGAL::Polynomial_traits_d< Polynomial_1 >::Is_square_free isf; return isf(p); } }; - + struct Is_coprime_1 : public CGAL::cpp98::binary_function< Polynomial_1, Polynomial_1, bool > { bool operator()( const Polynomial_1& p1, const Polynomial_1& p2 ) const { typename CGAL::Polynomial_traits_d< Polynomial_1 >::Total_degree total_degree; - - // TODO: Is GCD already filtered? - return( total_degree( gcd_utcf( p1, p2 ) ) == 0 ); - } - }; - + + // TODO: Is GCD already filtered? + return( total_degree( gcd_utcf( p1, p2 ) ) == 0 ); + } + }; + struct Make_square_free_1 : public CGAL::cpp98::unary_function< Polynomial_1, Polynomial_1 > { Polynomial_1 operator()( const Polynomial_1& p ) const { return typename CGAL::Polynomial_traits_d< Polynomial_1 >::Make_square_free()( p ); } }; - + struct Make_coprime_1 { typedef bool result_type; typedef Polynomial_1 first_argument_type; @@ -409,26 +409,26 @@ class Algebraic_kernel_d_1_base { typedef Polynomial_1 third_argument_type; typedef Polynomial_1 fourth_argument_type; typedef Polynomial_1 fifth_argument_type; - + bool operator()( const Polynomial_1& p1, const Polynomial_1& p2, - Polynomial_1& g, // ggT utcf + Polynomial_1& g, // ggT utcf Polynomial_1& q1, // Rest utcf Polynomial_1& q2 ) const { g = typename CGAL::Polynomial_traits_d< Polynomial_1 >::Gcd_up_to_constant_factor()( p1, p2 ); q1 = p1 / g; q2 = p2 / g; return CGAL::is_one(g); - } + } }; - + struct Square_free_factorize_1 { template< class OutputIterator> OutputIterator operator()( const Polynomial_1& p, OutputIterator it) const { typename PT_1::Square_free_factorize_up_to_constant_factor sqff; return sqff(p,it); - } + } }; struct Compute_polynomial_1 : public CGAL::cpp98::unary_function::Type a) const { - Coefficient coeffs[2] = {a,Coefficient(-1)}; - Polynomial_1 p = typename PT_1::Construct_polynomial() - (coeffs,coeffs+2); - std::vector roots; - Solve_1()(p,true,std::back_inserter(roots)); - CGAL_assertion(roots.size() == size_type(1)); - return roots[0]; + Coefficient coeffs[2] = {a,Coefficient(-1)}; + Polynomial_1 p = typename PT_1::Construct_polynomial() + (coeffs,coeffs+2); + std::vector roots; + Solve_1()(p,true,std::back_inserter(roots)); + CGAL_assertion(roots.size() == size_type(1)); + return roots[0]; } - - - result_type operator() (Polynomial_1 p,size_type i) - const { - std::vector roots; - Solve_1()(p,true,std::back_inserter(roots)); - CGAL_assertion( size_type(roots.size()) > i); - return roots[i]; + + + result_type operator() (Polynomial_1 p,size_type i) + const { + std::vector roots; + Solve_1()(p,true,std::back_inserter(roots)); + CGAL_assertion( size_type(roots.size()) > i); + return roots[i]; } result_type operator() (Polynomial_1 p, - Bound l, Bound u) const { - CGAL_precondition(l{ - + typedef CGAL::Comparison_result result_type; result_type operator() (Algebraic_real_1 a,Algebraic_real_1 b) const { return typename Real_embeddable_traits - ::Compare() (a,b); + ::Compare() (a,b); } result_type operator() (Algebraic_real_1 a,int b) const { @@ -500,8 +500,8 @@ class Algebraic_kernel_d_1_base { return this->operator()(a,Construct_algebraic_real_1()(b)); } - - result_type operator() + + result_type operator() (Algebraic_real_1 a, typename CGAL::First_if_different::Type b) const { return this->operator()(a,Construct_algebraic_real_1()(b)); @@ -515,8 +515,8 @@ class Algebraic_kernel_d_1_base { return this->operator()(Construct_algebraic_real_1()(a),b); } - - result_type operator() + + result_type operator() (typename CGAL::First_if_different::Type a, Algebraic_real_1 b) const { return this->operator()(Construct_algebraic_real_1()(a),b); @@ -528,49 +528,49 @@ class Algebraic_kernel_d_1_base { struct Isolate_1 : public CGAL::cpp98::binary_function < Algebraic_real_1,Polynomial_1,std::pair > { - + public: std::pair operator() (const Algebraic_real_1 a, - const Polynomial_1 p) const { + const Polynomial_1 p) const { + + if(p == a.polynomial()) return std::make_pair(a.low(),a.high()); - if(p == a.polynomial()) return std::make_pair(a.low(),a.high()); - std::vector roots; // First isolate p... Solve_1()(p,false,std::back_inserter(roots)); typedef typename std::vector::iterator Iterator; // Binary search on the root to find a place where a could be inserted std::pair it_pair - = equal_range(roots.begin(),roots.end(),a); + = equal_range(roots.begin(),roots.end(),a); CGAL_assertion(std::distance(it_pair.first,it_pair.second)==0 || - std::distance(it_pair.first,it_pair.second)==1); + std::distance(it_pair.first,it_pair.second)==1); // If we can insert a in two places, it must have been in roots already bool a_in_roots = std::distance(it_pair.first,it_pair.second)==1; if(a_in_roots) { - // TODO: can we rely on the property that the isolating intervals - // of the roots in p are isolating from each other. What - // if p was factorized during isolation? Is that still - // guaranteed? To be sure, we do it this way: - if(it_pair.first!=roots.begin()) { - it_pair.first->strong_refine(*(it_pair.first-1)); - } - if(it_pair.second!=roots.end()) { - it_pair.first->strong_refine(*(it_pair.second)); - } - return std::make_pair(it_pair.first->low(),it_pair.first->high()); + // TODO: can we rely on the property that the isolating intervals + // of the roots in p are isolating from each other. What + // if p was factorized during isolation? Is that still + // guaranteed? To be sure, we do it this way: + if(it_pair.first!=roots.begin()) { + it_pair.first->strong_refine(*(it_pair.first-1)); + } + if(it_pair.second!=roots.end()) { + it_pair.first->strong_refine(*(it_pair.second)); + } + return std::make_pair(it_pair.first->low(),it_pair.first->high()); } else { - // Refine a until disjoint from neighbors - // This is probably not even necessary since the isolating - // interval of a isolates against all roots of p thanks to the - // comparisons. But to be sure... - if(it_pair.first!=roots.begin()) { - a.strong_refine(*(it_pair.first-1)); - } - if(it_pair.first!=roots.end()) { - a.strong_refine(*(it_pair.first)); - } - return std::make_pair(a.low(),a.high()); + // Refine a until disjoint from neighbors + // This is probably not even necessary since the isolating + // interval of a isolates against all roots of p thanks to the + // comparisons. But to be sure... + if(it_pair.first!=roots.begin()) { + a.strong_refine(*(it_pair.first-1)); + } + if(it_pair.first!=roots.end()) { + a.strong_refine(*(it_pair.first)); + } + return std::make_pair(a.low(),a.high()); } } @@ -581,8 +581,8 @@ class Algebraic_kernel_d_1_base { typedef typename Algebraic_real_traits::Approximate_relative_1 Approximate_relative_1; - - + + #define CGAL_ALGEBRAIC_KERNEL_1_PRED(Y,Z) Y Z() const { return Y(); } #define CGAL_ALGEBRAIC_KERNEL_1_PRED_WITH_KERNEL \ Y Z() const { return Y((const Algebraic_kernel_d_1*)this); } @@ -620,9 +620,9 @@ class Algebraic_kernel_d_1_base { CGAL_ALGEBRAIC_KERNEL_1_PRED(Isolate_1, isolate_1_object); - // Deprecated + // Deprecated #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE - typedef Bound Boundary; + typedef Bound Boundary; typedef typename Algebraic_real_traits::Refine Refine_1; typedef typename Algebraic_real_traits::Lower_bound Lower_bound_1; typedef typename Algebraic_real_traits::Upper_bound Upper_bound_1; @@ -637,9 +637,9 @@ class Algebraic_kernel_d_1_base { CGAL_ALGEBRAIC_KERNEL_1_PRED(Upper_boundary_1, upper_boundary_1_object); CGAL_ALGEBRAIC_KERNEL_1_PRED(Boundary_between_1, boundary_between_1_object); #endif - -#undef CGAL_ALGEBRAIC_KERNEL_1_PRED - + +#undef CGAL_ALGEBRAIC_KERNEL_1_PRED + }; } // namespace internal @@ -648,19 +648,19 @@ template< class Coefficient, class Bound = typename CGAL::Get_arithmetic_kernel< Coefficient >::Arithmetic_kernel::Rational, class RepClass = internal::Algebraic_real_rep< Coefficient, Bound >, class Isolator = internal::Descartes< typename CGAL::Polynomial_type_generator::Type, Bound > > -class Algebraic_kernel_d_1 - : public internal::Algebraic_kernel_d_1_base< +class Algebraic_kernel_d_1 + : public internal::Algebraic_kernel_d_1_base< - // Template argument #1 (AlgebraicReal1) - internal::Algebraic_real_d_1< - Coefficient, + // Template argument #1 (AlgebraicReal1) + internal::Algebraic_real_d_1< + Coefficient, Bound, - ::CGAL::Handle_policy_no_union, + ::CGAL::Handle_policy_no_union, RepClass >, - + // Template argument #2 (Isolator_) Isolator > - + {}; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_2.h index 33a4ff81c215..209e08ed5748 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -28,7 +28,7 @@ template class Algebraic_kernel_d_2 : public CGAL::Algebraic_curve_kernel_2 < CGAL::Algebraic_kernel_d_1 > {}; - + } //namespace CGAL #include diff --git a/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h b/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h index ba54080a22d4..ecc3ec4d903d 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h @@ -95,7 +95,7 @@ boost::totally_ordered Algebraic_1(const T &t){ typedef typename Ptraits::Shift shift; diff --git a/Algebraic_kernel_d/include/CGAL/RS/functors_1.h b/Algebraic_kernel_d/include/CGAL/RS/functors_1.h index 2d0a307cb212..41e5e3a00d12 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/functors_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/functors_1.h @@ -371,7 +371,7 @@ public CGAL::cpp98::binary_function{ typedef typename Ptraits::Substitute Subst; std::vector substitutions; substitutions.push_back(CGAL::Gmpfi(l,r)); - CGAL::Gmpfi eval=Subst()(p, + CGAL::Gmpfi eval=Subst()(p, substitutions.begin(), substitutions.end()); return eval.sign(); diff --git a/Algebraic_kernel_d/include/CGAL/RS/functors_z_1.h b/Algebraic_kernel_d/include/CGAL/RS/functors_z_1.h index cee23ab8e51e..56961c92e4f0 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/functors_z_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/functors_z_1.h @@ -408,7 +408,7 @@ public CGAL::cpp98::binary_function{ typedef typename Ptraits::Substitute Subst; std::vector substitutions; substitutions.push_back(CGAL::Gmpfi(l,r)); - CGAL::Gmpfi eval=Subst()(p, + CGAL::Gmpfi eval=Subst()(p, substitutions.begin(), substitutions.end()); return eval.sign(); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp index b44ed8943996..8fb4ed8c5a82 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp @@ -5,7 +5,7 @@ // // $URL:$ // $Id: $ -// +// // // Author(s) : Pavel Emeliyanenko // @@ -45,37 +45,37 @@ void test_algebraic_curve_kernel_2() { typedef ArithmeticTraits AT; typedef typename AT::Integer Coefficient; typedef typename AT::Rational Rational; - + typedef CGAL::internal::Algebraic_real_quadratic_refinement_rep_bfi < Coefficient, Rational > Rep_class; - typedef CGAL::internal::Bitstream_descartes< + typedef CGAL::internal::Bitstream_descartes< CGAL::internal::Bitstream_descartes_rndl_tree_traits< - CGAL::internal::Bitstream_coefficient_kernel > > + CGAL::internal::Bitstream_coefficient_kernel > > Isolator; - - typedef CGAL::Algebraic_kernel_d_1 + + typedef CGAL::Algebraic_kernel_d_1 Algebraic_kernel_d_1; #if CGAL_ACK_USE_EXACUS typedef AcX::Algebraic_curve_2 Algebraic_curve_2; - typedef AcX::Algebraic_curve_pair_2 + typedef AcX::Algebraic_curve_pair_2 Algebraic_curve_pair_2; typedef CGAL::Algebraic_curve_kernel_2 + Algebraic_kernel_d_1> Algebraic_kernel_d_2; -#else - typedef CGAL::Algebraic_curve_kernel_2 +#else + typedef CGAL::Algebraic_curve_kernel_2 Algebraic_kernel_d_2; #endif - + //std::cout << "Non-filtered kernel..." << std::endl; CGAL::internal::test_algebraic_curve_kernel_2(); #if CGAL_ACK_WITH_FILTERED_KERNEL //std::cout << "Filtered kernel..." << std::endl; #if CGAL_ACK_USE_EXACUS - - typedef CGAL::Filtered_algebraic_curve_kernel_2 Filtered_kernel_2; #else @@ -84,7 +84,7 @@ void test_algebraic_curve_kernel_2() { #endif CGAL::internal::test_algebraic_curve_kernel_2(); - + #endif } @@ -95,7 +95,7 @@ int main() { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "TESTING LEDA" << std::endl; -#endif +#endif test_algebraic_curve_kernel_2(); #else std::cerr << "LEDA tests skipped" << std::endl; @@ -105,7 +105,7 @@ int main() { #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "TESTING CORE" << std::endl; -#endif +#endif test_algebraic_curve_kernel_2(); #else @@ -116,7 +116,7 @@ int main() { #ifdef CGAL_HAS_GMP_ARITHMETIC_KERNEL #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "TESTING GMP" << std::endl; -#endif +#endif test_algebraic_curve_kernel_2(); #else std::cerr << "GMP tests skipped" << std::endl; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp index 7d02897ce9c2..73ce6b16fb87 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp @@ -25,7 +25,7 @@ int main() { typedef CGAL::CORE_arithmetic_kernel AK; typedef AK::Rational Rational; -#if CGAL_TEST_ALL_AK_VARIANTS +#if CGAL_TEST_ALL_AK_VARIANTS test_algebraic_kernel_coeff_bound , Rational>(); #endif diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_2.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_2.cpp index 4421850d42a2..0450e8b459b6 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_2.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_kernel_d_2.cpp @@ -5,7 +5,7 @@ // // $URL:$ // $Id: $ -// +// // // Author(s) : Michael Kerber // @@ -42,17 +42,17 @@ int main() { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "TESTING LEDA" << std::endl; -#endif +#endif { - + typedef CGAL::LEDA_arithmetic_kernel AK; test_algebraic_kernel(); /* test_algebraic_kernel(); test_algebraic_kernel >(); - + test_algebraic_kernel - >(); + >(); */ } #else @@ -63,16 +63,16 @@ int main() { #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "TESTING CORE" << std::endl; -#endif +#endif { typedef CGAL::CORE_arithmetic_kernel AK; test_algebraic_kernel(); /* test_algebraic_kernel(); test_algebraic_kernel >(); - + test_algebraic_kernel - >(); + >(); */ } #else @@ -83,16 +83,16 @@ int main() { #ifdef CGAL_HAS_GMP_ARITHMETIC_KERNEL #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "TESTING GMP" << std::endl; -#endif +#endif { typedef CGAL::GMP_arithmetic_kernel AK; test_algebraic_kernel(); /* test_algebraic_kernel(); test_algebraic_kernel >(); - + test_algebraic_kernel - >(); + >(); */ } #else diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_real_d_1.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_real_d_1.cpp index 226d06d85270..2ef8cf0b088c 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_real_d_1.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_real_d_1.cpp @@ -5,9 +5,9 @@ // // $URL:$ // $Id: $ -// // -// Author(s) : +// +// Author(s) : // // ============================================================================ @@ -15,7 +15,7 @@ // they may be wrong now. /*! \file NiX/Algebraic_real_d_1.C - This is the test file for the class NiX::Algebraic_real_d_1. + This is the test file for the class NiX::Algebraic_real_d_1. */ #include @@ -44,11 +44,11 @@ void algebraic_number_test() { typedef Coefficient_ Coefficient; typedef Rational_ Rational; - - typedef CGAL::internal::Algebraic_real_d_1 Algebraic_real_d_1; + + typedef CGAL::internal::Algebraic_real_d_1 Algebraic_real_d_1; typedef typename CGAL::Polynomial_type_generator::Type Poly; CGAL::test_real_embeddable(); - // general test of comparable functionality + // general test of comparable functionality // TODO generates a precondition error in Algebraic_real_rep //NiX::test_real_comparable(); @@ -64,23 +64,23 @@ void algebraic_number_test() Poly P_123=P_1*P_2*P_3; //(x-1)(x-2)(x-3) Poly P_s2(Coefficient(-2),Coefficient(0),Coefficient(1)); //(x^2-2) Poly P_s3(Coefficient(-3),Coefficient(0),Coefficient(1)); //(x^2-3) - Poly P_s5(-Coefficient(5),Coefficient(0),Coefficient(1)); + Poly P_s5(-Coefficient(5),Coefficient(0),Coefficient(1)); Poly P_s10(-Coefficient(10),Coefficient(0),Coefficient(1)); Poly P_s30(-Coefficient(30),Coefficient(0),Coefficient(1)); Poly P_s2510= P_s2*P_s5*P_s10; Poly P_s530= P_s5 * P_s30; - + Algebraic_real_d_1 tmp; - Algebraic_real_d_1 tmp1,tmp2; + Algebraic_real_d_1 tmp1,tmp2; Rational m; // general constructors; - // default + // default // tmp = IS_Rational_ = 0 tmp = Algebraic_real_d_1(); assert(tmp.is_rational()); - assert(tmp.rational()==0); - // from int + assert(tmp.rational()==0); + // from int tmp = Algebraic_real_d_1(1); assert(tmp.is_rational()); assert(tmp.rational()==1); @@ -88,21 +88,21 @@ void algebraic_number_test() tmp = Algebraic_real_d_1(5); assert(tmp.is_rational()); assert(tmp.rational()==5); - + // from Field tmp = Algebraic_real_d_1(Rational(0)); assert(tmp.is_rational()); - assert(tmp.rational()==0); - + assert(tmp.rational()==0); + tmp = Algebraic_real_d_1(Rational(1)); assert(tmp.is_rational()); assert(tmp.rational()==1); tmp = Algebraic_real_d_1(Rational(5)/ Rational(2)); assert(tmp.is_rational()); - assert(tmp.rational()== Rational(5)/ Rational(2)); + assert(tmp.rational()== Rational(5)/ Rational(2)); - // general constructor + // general constructor // tmp = 1 #if 0 tmp = Algebraic_real_d_1(P_1,-2,+2); @@ -113,26 +113,26 @@ void algebraic_number_test() assert(tmp.rational()==1); #endif - // special constructors + // special constructors // from int tmp = Algebraic_real_d_1(2); assert(tmp.is_rational()); - assert(tmp.rational()==Rational(2)); + assert(tmp.rational()==Rational(2)); //from Rational tmp = Algebraic_real_d_1(Rational(2)); assert(tmp.is_rational()); - assert(tmp.rational()==Rational(2)); + assert(tmp.rational()==Rational(2)); // member functions - // tmp IS_GENERAL == 2; + // tmp IS_GENERAL == 2; tmp = Algebraic_real_d_1(P_123,Rational(3)/2,Rational(5)/2); assert(!tmp.is_rational()); assert(tmp.polynomial()==P_123); assert(tmp.low()==Rational(3)/2); assert(tmp.high()==Rational(5)/2); - assert(tmp.sign_at_low()==P_123.sign_at(Rational(3)/2)); - + assert(tmp.sign_at_low()==P_123.sign_at(Rational(3)/2)); + // refine tmp = Algebraic_real_d_1(P_123,Rational(3)/2,Rational(5)/2); tmp.refine(); @@ -141,12 +141,12 @@ void algebraic_number_test() // tmp IS_GENERAL = sqrt 2 tmp = Algebraic_real_d_1(P_s2*P_3,Rational(1),Rational(2)); tmp.refine(); - assert(tmp.low() >= Rational(1)); - assert(tmp.high() <= Rational(3)/2); - + assert(tmp.low() >= Rational(1)); + assert(tmp.high() <= Rational(3)/2); + // strong_refine - // tmp IS_GENERAL == 2; - + // tmp IS_GENERAL == 2; + tmp = Algebraic_real_d_1(P_123,Rational(3)/2,Rational(5)/2); m = Rational(2); tmp.strong_refine(m); @@ -156,9 +156,9 @@ void algebraic_number_test() tmp = Algebraic_real_d_1(P_s2*P_3,Rational(1),Rational(2)); m = Rational(3)/2; tmp.strong_refine(m); - assert(tmp.low()!=m); - assert(tmp.high()!=m); - + assert(tmp.low()!=m); + assert(tmp.high()!=m); + // refine_to(a,b) // tmp IS_GENERAL = sqrt 2 tmp = Algebraic_real_d_1(P_s2*P_4,Rational(0),Rational(3)); @@ -189,9 +189,9 @@ void algebraic_number_test() assert(tmp.rational()==Rational(3)); assert(CGAL::degree(tmp.polynomial()) == 1); assert(tmp.polynomial().evaluate(Coefficient(3)) == Coefficient(0)); - + // compare_distinct() - + tmp1 = Algebraic_real_d_1(P_s530, Rational(2), Rational(3)); // sqrt(5) = 2.236... tmp2 = Algebraic_real_d_1(P_s530, Rational(5), Rational(6)); // sqrt(30) = 5.477... assert(tmp1.compare_distinct(tmp2) == CGAL::SMALLER); @@ -199,9 +199,9 @@ void algebraic_number_test() //member functions // is_root_of - tmp1 = Algebraic_real_d_1(P_s2510,Rational(1)/2,Rational(3)/2); + tmp1 = Algebraic_real_d_1(P_s2510,Rational(1)/2,Rational(3)/2); assert(tmp1.is_root_of(P_s530*P_s2)); - tmp1 = Algebraic_real_d_1(P_s2510,Rational(1)/2,Rational(3)/2); + tmp1 = Algebraic_real_d_1(P_s2510,Rational(1)/2,Rational(3)/2); assert(!tmp1.is_root_of(P_s530)); //rational_between @@ -212,7 +212,7 @@ void algebraic_number_test() r = tmp1.rational_between(tmp2); assert(tmp1.compare(r)==CGAL::SMALLER); assert(tmp2.compare(r)==CGAL::LARGER); - + r = tmp2.rational_between(tmp1); assert(tmp1.compare(r)==CGAL::SMALLER); assert(tmp2.compare(r)==CGAL::LARGER); @@ -226,11 +226,11 @@ void algebraic_number_test() tmp = Algebraic_real_d_1(P_1, Rational(0), Rational(2)); assert(fabs(tmp.to_double() - 1.0) < 1e-10); - //IO tested in _test_algebraic_kernel_1.h + //IO tested in _test_algebraic_kernel_1.h - // test for Handle with union + // test for Handle with union { - typedef + typedef CGAL::internal::Algebraic_real_d_1 Int; Int i(5); @@ -244,12 +244,12 @@ void algebraic_number_test() assert( i.identical( j)); assert( ! i.identical( k)); assert( ! j.identical( k)); - // code coverage + // code coverage assert( i == j); } - // test for Handle without union + // test for Handle without union { - typedef + typedef CGAL::internal::Algebraic_real_d_1 Int; Int i(5); @@ -265,10 +265,10 @@ void algebraic_number_test() assert( ! j.identical( k)); } - + // to_interval // { -// Algebraic_real_d_1 TMP; +// Algebraic_real_d_1 TMP; // assert(CGAL::in(25.0,CGAL::to_interval(Algebraic_real_d_1(25)))); // assert(CGAL::in(sqrt(2),CGAL::to_interval(Algebraic_real_d_1(P_s2,1,2)))); // assert(CGAL::in(sqrt(2),CGAL::to_interval(Algebraic_real_d_1(P_s2510,1,2)))); @@ -277,7 +277,7 @@ void algebraic_number_test() // assert(CGAL::in(-sqrt(5),CGAL::to_interval(Algebraic_real_d_1(P_s2510,-3,-2)))); // assert(CGAL::in(sqrt(10),CGAL::to_interval(Algebraic_real_d_1(P_s2510,3,4)))); // assert(CGAL::in(-sqrt(10),CGAL::to_interval(Algebraic_real_d_1(P_s2510,-4,-3)))); -// } +// } //simplify { @@ -286,7 +286,7 @@ void algebraic_number_test() } } -template +template void algebraic_number_test_at(){ typedef typename AT::Integer Integer; typedef typename AT::Rational Rational; @@ -300,7 +300,7 @@ void algebraic_number_test_at(){ typedef CGAL::internal::Algebraic_real_rep< Ext_int_int, Rational > Rep_ext_int_int; typedef CGAL::internal::Algebraic_real_rep< Ext_rat_int, Rational > Rep_ext_rat_int; typedef CGAL::internal::Algebraic_real_rep< Ext_rat_rat, Rational > Rep_ext_rat_rat; - + algebraic_number_test(); algebraic_number_test(); @@ -338,9 +338,9 @@ void algebraic_number_test_at(){ } int main() -{ +{ #ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL - typedef CGAL::LEDA_arithmetic_kernel LEDA_AK; + typedef CGAL::LEDA_arithmetic_kernel LEDA_AK; algebraic_number_test_at(); std::cerr << " LEDA test .. " << std::flush; std::cerr << " done " << std::endl; @@ -350,7 +350,7 @@ int main() #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL std::cerr << " CORE test .. " << std::flush; - typedef CGAL::CORE_arithmetic_kernel CORE_AK; + typedef CGAL::CORE_arithmetic_kernel CORE_AK; algebraic_number_test_at(); std::cerr << " done " << std::endl; #else @@ -359,8 +359,8 @@ int main() #ifdef CGAL_HAS_GMP_ARITHMETIC_KERNEL std::cerr << " GMP test .. " << std::flush; - typedef CGAL::GMP_arithmetic_kernel GMP_AK; - algebraic_number_test_at(); + typedef CGAL::GMP_arithmetic_kernel GMP_AK; + algebraic_number_test_at(); std::cerr << " done " << std::endl; #else std::cerr << " GMP test skipped " << std::endl; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Bitstream_descartes.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Bitstream_descartes.cpp index 09a572c18cb8..d9536e04f56d 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Bitstream_descartes.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Bitstream_descartes.cpp @@ -5,9 +5,9 @@ // // $URL:$ // $Id: $ -// // -// Author(s) : +// +// Author(s) : // // ============================================================================ @@ -37,7 +37,7 @@ #include #include -#include // used in this file +#include // used in this file template void test_descartes(){ @@ -48,7 +48,7 @@ void test_descartes(){ typedef CGAL::internal::Bitstream_descartes< CGAL::internal::Bitstream_descartes_rndl_tree_traits > > Isolator; - + // general test of concept RealRootIsolator CGAL::internal::test_real_root_isolator(); }{ @@ -59,21 +59,21 @@ void test_descartes(){ CGAL::internal::test_real_root_isolator(); }{ typedef CGAL::Sqrt_extension EXT; - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Polynomial; typedef CGAL::internal::Bitstream_descartes< CGAL::internal::Bitstream_descartes_rndl_tree_traits > > Isolator; // general test of concept RealRootIsolator CGAL::internal::test_real_root_isolator(); - + std::istringstream is("P[8(0,EXT[1263296571491275162619395552058539312049753537208652637440,42968358109221573436642744060744334362576495937343892480,859])(1,EXT[2207556620237983039471566299950573667219187771717363990528,76852322515373647784745416857429135583058957867416403456,859])(2,EXT[1309275777321138279335848837056750819020098551750287419392,39195296448043974486512553808164864989806318662622537728,859])(3,EXT[86302507833822837152267458208050616275030717971310571520,10003400461933730535898849196215973480541410956350136320,859])(4,EXT[491437197926570070047913809040994179733862944058588160,-823318654055010400576035967724449228967294601081409536,859])(5,EXT[65617171248843379260568930361980285279772972904474353664,-2321236429038088490878641998530459657094667195101177856,859])(6,EXT[-31388640426864731218854617935763549592108582309411053568,1147925677098540153039869220704807888848997763457081344,859])(7,EXT[-9044080753104082029116583549917596926203452476780478464,319259245952387286523925425244746929470795371494383616,859])(8,EXT[7527302869236151900084946597004902733830052515530309632,-256375273905623226297550301204997314964265060295540736,859])]"); - + Polynomial P; is >> P ; Isolator isolator(P); assert(isolator.number_of_real_roots() == 2 ); - + typedef CGAL::internal::Algebraic_real_d_1 Alg_real; Alg_real r0(P,isolator.left_bound(0),isolator.right_bound(0)); Alg_real r1(P,isolator.left_bound(1),isolator.right_bound(1)); @@ -82,14 +82,14 @@ void test_descartes(){ assert(r0 < isolator.right_bound(0)); assert(r1 > isolator.left_bound(1)); assert(r1 < isolator.right_bound(1)); - + } CGAL::internal::test_bitstream_descartes(); - + } - + int main(){ -#ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL +#ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL test_descartes(); #endif diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt index 35f3eb4d27ac..73b7294442bd 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt @@ -9,7 +9,7 @@ find_package( CGAL QUIET COMPONENTS Core) if ( NOT CGAL_FOUND ) message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() @@ -29,7 +29,7 @@ if ( NOT Boost_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp index ba50266aba50..0f1667d105e4 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp @@ -5,7 +5,7 @@ // // $URL:$ // $Id: $ -// +// // // Author(s) : Michael Kerber // @@ -45,17 +45,17 @@ template Poly_ from_string(const char* s) { return f; } -template +template int number_of_objects(typename AlgebraicKernel_2::Curve_analysis_2 c) { - typedef typename AlgebraicKernel_2::Curve_analysis_2::Status_line_1 + typedef typename AlgebraicKernel_2::Curve_analysis_2::Status_line_1 Status_line_1; int vertical_arcs=0, non_vertical_arcs=0, isolated_vertices=0; int n = c.number_of_status_lines_with_event(); - - for( int i = 0; i < n; i++ ) { + + for( int i = 0; i < n; i++ ) { const Status_line_1& status_line = c.status_line_at_event(i); if(status_line.covers_line()) { // vertical @@ -79,26 +79,26 @@ int number_of_objects(typename AlgebraicKernel_2::Curve_analysis_2 c) { template void test_routine() { - + typedef typename Arithmetic_kernel::Rational Rational; typedef typename Arithmetic_kernel::Integer Integer; - + typedef Integer Coefficient; - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Poly_int1; - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Poly_int2; - + typedef CGAL::internal::Algebraic_real_quadratic_refinement_rep_bfi < Coefficient, Rational > Rep_class; typedef CGAL::internal::Bitstream_descartes < CGAL::internal::Bitstream_descartes_rndl_tree_traits - < CGAL::internal::Bitstream_coefficient_kernel - > - > + < CGAL::internal::Bitstream_coefficient_kernel + > + > Isolator; - - typedef CGAL::Algebraic_kernel_d_1 + + typedef CGAL::Algebraic_kernel_d_1 Algebraic_kernel_d_1; typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real; @@ -107,19 +107,19 @@ template void test_routine() { #if CGAL_ACK_USE_EXACUS typedef AcX::Algebraic_curve_2 Algebraic_curve_2; - typedef AcX::Algebraic_curve_pair_2 + typedef AcX::Algebraic_curve_pair_2 Algebraic_curve_pair_2; typedef CGAL::Algebraic_curve_kernel_2 + Algebraic_kernel_d_1> Algebraic_kernel_d_2; -#else - typedef CGAL::Algebraic_curve_kernel_2 +#else + typedef CGAL::Algebraic_curve_kernel_2 Algebraic_kernel_d_2; #endif Algebraic_kernel_d_2 kernel; - typename Algebraic_kernel_d_2::Construct_curve_2 construct_curve_2 + typename Algebraic_kernel_d_2::Construct_curve_2 construct_curve_2 = kernel.construct_curve_2_object(); typedef typename Algebraic_kernel_d_2::Curve_analysis_2 Curve_analysis_2; @@ -136,7 +136,7 @@ template void test_routine() { { #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]" + CGAL_ACK_DEBUG_PRINT << "P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]" << std::endl; #endif f=from_string("P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]"); @@ -155,7 +155,7 @@ template void test_routine() { (loc, curve.asymptotic_value_of_arc(CGAL::RIGHT_BOUNDARY,0))); assert( loc == CGAL::TOP_BOUNDARY); - + } { #if CGAL_ACK_DEBUG_FLAG @@ -168,7 +168,7 @@ template void test_routine() { assert(number_of_objects(curve)==2); event=curve.status_line_at_event(0); assert(event.number_of_events()==0); - + assert(event.number_of_branches_approaching_minus_infinity().first==0); assert(event.number_of_branches_approaching_minus_infinity().second ==1); @@ -193,7 +193,7 @@ template void test_routine() { f=from_string("P[10(1,P[9(4,18)(9,18)])(2,P[9(4,-9)(9,-9)])(3,P[7(2,-12)(7,-12)])(4,P[7(2,6)(3,-18)(7,6)])(5,P[5(3,9)(5,36)])(6,P[5(1,12)(5,-18)])(7,P[3(1,-6)(3,-42)])(8,P[3(3,21)])(9,P[1(1,12)])(10,P[1(1,-6)])]"); curve=construct_curve_2(f); assert(curve.number_of_status_lines_with_event()==10); - // assert(curve.may_be_singular()); + // assert(curve.may_be_singular()); event=curve.status_line_at_exact_x(Algebraic_real(1)); assert(event.number_of_events()==6); @@ -205,7 +205,7 @@ template void test_routine() { assert(event.lower_bound(3) > Rational(122,100)); assert(event.upper_bound(3) < Rational(123,100)); assert(! event.is_event(0)); - + event=curve.status_line_at_exact_x(Algebraic_real(0)); assert(event.covers_line()); assert(event.number_of_events()==3); @@ -223,7 +223,7 @@ template void test_routine() { assert(event.lower_bound(2) > Rational(199,100)); assert(event.upper_bound(2) < Rational(201,100)); assert(! event.is_event(0)); - + event=curve.status_line_at_exact_x(Algebraic_real(Poly_int1(-3,0,1),0,2)); assert(event.number_of_events()==6); event.refine_to(1,eps); @@ -264,8 +264,8 @@ template void test_routine() { assert(CGAL::assign (loc,curve.asymptotic_value_of_arc(CGAL::LEFT_BOUNDARY,5))); assert( loc == CGAL::TOP_BOUNDARY); - - + + assert(CGAL::assign (loc,curve.asymptotic_value_of_arc(CGAL::RIGHT_BOUNDARY,0))); assert( loc == CGAL::BOTTOM_BOUNDARY); @@ -301,7 +301,7 @@ template void test_routine() { #endif } { - Poly_int2 f1 + Poly_int2 f1 = from_string("P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]"); Poly_int2 f2 = from_string("P[1(0,P[1(0,3)(1,2)])(1,P[0(0,-3)])]"); @@ -313,11 +313,11 @@ template void test_routine() { assert(curve1.polynomial_2()!=curve2.polynomial_2()); } { - Poly_int2 f1 + Poly_int2 f1 = from_string("P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]"); Curve_analysis_2 curve1 = construct_curve_2(f1); #if CGAL_ACK_DEBUG_FLAG - CGAL_ACK_DEBUG_PRINT << "P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]" + CGAL_ACK_DEBUG_PRINT << "P[1(0,P[1(0,2)(1,2)])(1,P[0(0,-3)])]" << std::endl; #endif Curve_analysis_2 curve2(curve1); @@ -379,21 +379,21 @@ template void test_routine() { typedef CGAL::Sqrt_extension Sqrt_extension; typedef Sqrt_extension Coefficient; - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Poly_sqrt1; - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Poly_sqrt2; - + typedef CGAL::internal::Algebraic_real_quadratic_refinement_rep_bfi < Coefficient, Rational > Rep_class; typedef CGAL::internal::Bitstream_descartes < CGAL::internal::Bitstream_descartes_rndl_tree_traits - < CGAL::internal::Bitstream_coefficient_kernel - > - > + < CGAL::internal::Bitstream_coefficient_kernel + > + > Isolator; - - typedef CGAL::Algebraic_kernel_d_1 + + typedef CGAL::Algebraic_kernel_d_1 Algebraic_kernel_d_1_with_sqrt; typedef CGAL::Algebraic_curve_kernel_2 @@ -402,22 +402,22 @@ template void test_routine() { Algebraic_kernel_d_2_with_sqrt kernel; typename Algebraic_kernel_d_2_with_sqrt::Construct_curve_2 - sqrt_construct_curve_2 + sqrt_construct_curve_2 = kernel.construct_curve_2_object(); typedef typename Algebraic_kernel_d_2_with_sqrt::Curve_analysis_2 Sqrt_curve_analysis_2; - - typedef typename Sqrt_curve_analysis_2::Algebraic_real_1 + + typedef typename Sqrt_curve_analysis_2::Algebraic_real_1 Sqrt_algebraic_real; - typedef typename Sqrt_curve_analysis_2::Status_line_1 + typedef typename Sqrt_curve_analysis_2::Status_line_1 Sqrt_status_line_1; - + Sqrt_status_line_1 event; - + Poly_sqrt2 sqrt_f=from_string("P[10(1,P[9(4,EXT[0,54,5])(9,EXT[0,54,5])])(2,P[9(4,EXT[0,-27,5])(9,EXT[0,-27,5])])(3,P[7(2,EXT[0,-36,5])(7,EXT[0,-36,5])])(4,P[7(2,EXT[0,18,5])(3,EXT[0,-54,5])(7,EXT[0,18,5])])(5,P[5(3,EXT[0,27,5])(5,EXT[0,108,5])])(6,P[5(1,EXT[0,36,5])(5,EXT[0,-54,5])])(7,P[3(1,EXT[0,-18,5])(3,EXT[0,-126,5])])(8,P[3(3,EXT[0,63,5])])(9,P[1(1,EXT[0,36,5])])(10,P[1(1,EXT[0,-18,5])])]"); @@ -426,7 +426,7 @@ template void test_routine() { #endif Sqrt_curve_analysis_2 sqrt_curve= sqrt_construct_curve_2(sqrt_f); assert(sqrt_curve.number_of_status_lines_with_event()==10); - // assert(sqrt_curve.may_be_singular()); + // assert(sqrt_curve.may_be_singular()); event=sqrt_curve.status_line_at_exact_x(Sqrt_algebraic_real(1)); assert(event.number_of_events()==6); @@ -438,7 +438,7 @@ template void test_routine() { assert(event.lower_bound(3) > Rational(122,100)); assert(event.upper_bound(3) < Rational(123,100)); assert(! event.is_event(0)); - + event=sqrt_curve.status_line_at_exact_x(Sqrt_algebraic_real(0)); assert(event.covers_line()); assert(event.number_of_events()==3); @@ -456,7 +456,7 @@ template void test_routine() { assert(event.lower_bound(2) > Rational(199,100)); assert(event.upper_bound(2) < Rational(201,100)); assert(! event.is_event(0)); - + event=sqrt_curve.status_line_at_exact_x(Sqrt_algebraic_real(Poly_sqrt1(-3,0,1),0,2)); assert(event.number_of_events()==6); event.refine_to(1,eps); @@ -498,8 +498,8 @@ template void test_routine() { assert(CGAL::assign (loc,sqrt_curve.asymptotic_value_of_arc(CGAL::LEFT_BOUNDARY,5))); assert( loc == CGAL::TOP_BOUNDARY); - - + + assert(CGAL::assign (loc,sqrt_curve.asymptotic_value_of_arc(CGAL::RIGHT_BOUNDARY,0))); assert( loc == CGAL::BOTTOM_BOUNDARY); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_pair_analysis_2.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_pair_analysis_2.cpp index 7b13743ffbd5..3841a32bc556 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_pair_analysis_2.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_pair_analysis_2.cpp @@ -5,7 +5,7 @@ // // $URL:$ // $Id: $ -// +// // // Author(s) : Michael Kerber // @@ -49,30 +49,30 @@ template Poly_ from_string(const char* s) { return f; } -template +template void test_routine() { - + typedef typename Arithmetic_kernel::Rational Rational; typedef typename Arithmetic_kernel::Integer Integer; - + typedef Integer Coefficient; - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Poly_1; CGAL_USE_TYPE(Poly_1); - typedef typename + typedef typename CGAL::Polynomial_type_generator::Type Poly_2; - + typedef CGAL::internal::Algebraic_real_quadratic_refinement_rep_bfi < Coefficient, Rational > Rep_class; typedef CGAL::internal::Bitstream_descartes < CGAL::internal::Bitstream_descartes_rndl_tree_traits - < CGAL::internal::Bitstream_coefficient_kernel - > - > + < CGAL::internal::Bitstream_coefficient_kernel + > + > Isolator; - - typedef CGAL::Algebraic_kernel_d_1 + + typedef CGAL::Algebraic_kernel_d_1 Algebraic_kernel_d_1; typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real; @@ -80,29 +80,29 @@ void test_routine() { #if CGAL_ACK_USE_EXACUS typedef AcX::Algebraic_curve_2 Algebraic_curve_2; - typedef AcX::Algebraic_curve_pair_2 + typedef AcX::Algebraic_curve_pair_2 Algebraic_curve_pair_2; typedef CGAL::Algebraic_curve_kernel_2 - Algebraic_kernel_d_2; + Algebraic_kernel_d_1> + Algebraic_kernel_d_2; #else - typedef CGAL::Algebraic_curve_kernel_2 + typedef CGAL::Algebraic_curve_kernel_2 Algebraic_kernel_d_2; #endif Algebraic_kernel_d_2 kernel; - + typedef typename Algebraic_kernel_d_2::Curve_analysis_2 Curve_analysis_2; - typedef typename Algebraic_kernel_d_2::Curve_pair_analysis_2 + typedef typename Algebraic_kernel_d_2::Curve_pair_analysis_2 Curve_pair_analysis_2; typename Algebraic_kernel_d_2::Construct_curve_2 - construct_curve_2 + construct_curve_2 = kernel.construct_curve_2_object(); typename Algebraic_kernel_d_2::Construct_curve_pair_2 - construct_curve_pair_2 + construct_curve_pair_2 = kernel.construct_curve_pair_2_object(); @@ -126,7 +126,7 @@ void test_routine() { assert(! slice.is_event()); assert(! slice.is_intersection()); assert(slice.number_of_events()==0); - } + } { i=0; const Status_line_1& slice=curve_pair.status_line_at_event(i); @@ -304,7 +304,7 @@ void test_routine() { assert(slice.curves_at_event(0).second==0); assert(slice.curves_at_event(1).first==-1); assert(slice.curves_at_event(1).second==1); - } + } { i=5; const Status_line_1& slice=curve_pair.status_line_of_interval(i); @@ -468,12 +468,12 @@ void test_routine() { assert(! slice.is_event()); assert(slice.number_of_events()==0); } - + } { Poly_2 f=from_string("P[4(0,P[1(0,1)(1,1)])(4,P[0(0,-1)])]"); Poly_2 g=from_string("P[2(0,P[2(0,-5)(2,6)])(2,P[0(0,4)])]"); - Curve_analysis_2 ca1=construct_curve_2(f), + Curve_analysis_2 ca1=construct_curve_2(f), ca2=construct_curve_2(g); Curve_pair_analysis_2 curve_pair=construct_curve_pair_2(ca1,ca2); @@ -490,7 +490,7 @@ void test_routine() { const Status_line_1& slice=curve_pair.status_line_of_interval(i); assert(! slice.is_event()); assert(slice.number_of_events()==0); - } + } { i=0; const Status_line_1& slice=curve_pair.status_line_at_event(i); @@ -564,7 +564,7 @@ void test_routine() { assert(slice.curves_at_event(1).second==0); assert(slice.curves_at_event(2).first==1); assert(slice.curves_at_event(2).second==-1); - + } { i=3; @@ -633,7 +633,7 @@ void test_routine() { assert(slice.curves_at_event(1).second==1); assert(slice.multiplicity_of_intersection(0)==1); assert(slice.multiplicity_of_intersection(1)==1); - } + } { i=5; const Status_line_1& slice=curve_pair.status_line_of_interval(i); @@ -710,12 +710,12 @@ void test_routine() { { Poly_2 f=from_string("P[4(0,P[4(3,-1)(4,2)])(2,P[1(1,1)])(4,P[0(0,1)])]"); Poly_2 g=from_string("P[4(0,P[4(0,12)(1,-380)(2,4200)(3,-18000)(4,20000)])(2,P[1(0,-4000)(1,40000)])(4,P[0(0,160000)])]"); - Curve_analysis_2 ca1=construct_curve_2(f), + Curve_analysis_2 ca1=construct_curve_2(f), ca2=construct_curve_2(g); Curve_pair_analysis_2 curve_pair=construct_curve_pair_2(ca1,ca2); //assert(curve_pair.number_of_status_lines_with_event()==11); - - + + } #if CGAL_ACK_WITH_ROTATIONS #if DO_SQRT_EXTENSION_TESTS @@ -729,43 +729,43 @@ void test_routine() { typedef typename CGAL::Polynomial_type_generator::Type Poly_sqrt2; - + typedef CGAL::internal::Algebraic_real_quadratic_refinement_rep_bfi < Coefficient, Rational > Rep_class; typedef CGAL::internal::Bitstream_descartes < CGAL::internal::Bitstream_descartes_rndl_tree_traits - < CGAL::internal::Bitstream_coefficient_kernel - > - > + < CGAL::internal::Bitstream_coefficient_kernel + > + > Isolator; typedef CGAL::Algebraic_kernel_d_1< Coefficient,Rational, - Rep_class, Isolator > + Rep_class, Isolator > Algebraic_kernel_d_1_with_sqrt; Poly_sqrt2 f,g; f=from_string("P[4(0,P[4(3,EXT[0,-2,7])(4,EXT[0,4,7])])(2,P[1(1,EXT[0,2,7])])(4,P[0(0,EXT[0,2,7])])]"); g=from_string("P[4(0,P[4(4,EXT[0,2,7])])(1,P[2(2,EXT[0,2,7])])(3,P[0(0,EXT[0,-2,7])])(4,P[0(0,EXT[0,4,7])])]"); - + typedef CGAL::Algebraic_curve_kernel_2 Algebraic_kernel_d_2; typedef typename Algebraic_kernel_d_2::Curve_analysis_2 Curve_analysis_2; - typedef typename Algebraic_kernel_d_2::Curve_pair_analysis_2 + typedef typename Algebraic_kernel_d_2::Curve_pair_analysis_2 Curve_pair_analysis_2; - + Algebraic_kernel_d_2 kernel; typename Algebraic_kernel_d_2::Construct_curve_2 - construct_curve_2 + construct_curve_2 = kernel.construct_curve_2_object(); - + typename Algebraic_kernel_d_2::Construct_curve_pair_2 - construct_curve_pair_2 + construct_curve_pair_2 = kernel.construct_curve_pair_2_object(); - - - Curve_analysis_2 c1=construct_curve_2(f), + + + Curve_analysis_2 c1=construct_curve_2(f), c2=construct_curve_2(g); Curve_pair_analysis_2 curve_pair=construct_curve_pair_2(c1,c2); @@ -773,14 +773,14 @@ void test_routine() { typedef typename Curve_pair_analysis_2::Status_line_1 Status_line_1; typedef CGAL::internal::Event_indices Triple; int i; - + { i=0; const Status_line_1& slice=curve_pair.status_line_of_interval(i); assert(! slice.is_event()); assert(! slice.is_intersection()); assert(slice.number_of_events()==0); - } + } { i=0; const Status_line_1& slice=curve_pair.status_line_at_event(i); @@ -958,7 +958,7 @@ void test_routine() { assert(slice.curves_at_event(0).second==0); assert(slice.curves_at_event(1).first==-1); assert(slice.curves_at_event(1).second==1); - } + } { i=5; const Status_line_1& slice=curve_pair.status_line_of_interval(i); @@ -1122,7 +1122,7 @@ void test_routine() { assert(! slice.is_event()); assert(slice.number_of_events()==0); } - + } #endif #endif diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Descartes.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Descartes.cpp index 96d42c984b8b..80261d569262 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Descartes.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Descartes.cpp @@ -5,9 +5,9 @@ // // $URL:$ // $Id: $ -// // -// Author(s) : +// +// Author(s) : // // ============================================================================ @@ -34,21 +34,21 @@ void test_descartes(){ typedef typename AT::Integer Integer; typedef typename AT::Rational Rational; { - typedef typename CGAL::Polynomial_type_generator::Type + typedef typename CGAL::Polynomial_type_generator::Type Polynomial; typedef ::CGAL::internal::Descartes Isolator; - + // general test of concept RealRootIsolator CGAL::internal::test_real_root_isolator(); }{ - typedef typename CGAL::Polynomial_type_generator::Type + typedef typename CGAL::Polynomial_type_generator::Type Polynomial; typedef ::CGAL::internal::Descartes Isolator; // general test of concept RealRootIsolator CGAL::internal::test_real_root_isolator(); - } + } } - + int main(){ #ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL std::cout << " TEST AK1 USING LEDA " << std::endl; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp index 5693edc40fbd..14da0a7d79c2 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp @@ -6,7 +6,7 @@ // $URL:$ // $Id:$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Michael Hemmer // // ============================================================================ @@ -34,20 +34,20 @@ void test_real_embeddable_extension(const NT_&){ typedef CGAL::internal::Real_embeddable_extension RETE; - typedef typename RETE::Type NT; - + typedef typename RETE::Type NT; + typedef typename RETE::Floor Floor; - typedef typename RETE::Ceil Ceil; + typedef typename RETE::Ceil Ceil; typedef typename RETE::Floor_log2_abs Floor_log2_abs; typedef typename RETE::Ceil_log2_abs Ceil_log2_abs; - + { const Floor floor = Floor(); typedef typename Floor::argument_type Argument_type; typedef typename Floor::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::boost::is_same::value)); + CGAL_static_assertion(( ::boost::is_same::value)); CGAL_static_assertion(( ::boost::is_same::value)); assert(Integer(42) == floor(NT(42))); assert(Integer(-42) == floor(NT(-42))); @@ -59,18 +59,18 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Floor_log2_abs::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::boost::is_same::value)); + CGAL_static_assertion(( ::boost::is_same::value)); CGAL_static_assertion(( ::boost::is_same::value)); - + assert(long(0) == floor_log2_abs(NT(1))); assert(long(0) == floor_log2_abs(NT(-1))); assert(long(1) == floor_log2_abs(NT(2))); - + assert(long(1) == floor_log2_abs(NT(3))); assert(long(2) == floor_log2_abs(NT(4))); assert(long(2) == floor_log2_abs(NT(5))); - + assert(long(2) == floor_log2_abs(NT(7))); assert(long(3) == floor_log2_abs(NT(8))); assert(long(3) == floor_log2_abs(NT(9))); @@ -86,7 +86,7 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Ceil::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::boost::is_same::value)); + CGAL_static_assertion(( ::boost::is_same::value)); CGAL_static_assertion(( ::boost::is_same::value)); assert(Integer(42) == ceil(NT(42))); assert(Integer(-42) == ceil(NT(-42))); @@ -98,18 +98,18 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Ceil_log2_abs::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::boost::is_same::value)); + CGAL_static_assertion(( ::boost::is_same::value)); CGAL_static_assertion(( ::boost::is_same::value)); - + assert(long(0) == ceil_log2_abs(NT(1))); assert(long(0) == ceil_log2_abs(NT(-1))); assert(long(1) == ceil_log2_abs(NT(2))); - + assert(long(2) == ceil_log2_abs(NT(3))); assert(long(2) == ceil_log2_abs(NT(4))); assert(long(3) == ceil_log2_abs(NT(5))); - + assert(long(3) == ceil_log2_abs(NT(7))); assert(long(3) == ceil_log2_abs(NT(8))); assert(long(4) == ceil_log2_abs(NT(9))); @@ -118,7 +118,7 @@ void test_real_embeddable_extension(const NT_&){ assert(long(3) == ceil_log2_abs(NT(-8))); assert(long(4) == ceil_log2_abs(NT(-9))); } - + } @@ -126,8 +126,8 @@ void test_real_embeddable_extension(const NT_&){ template void test_real_embeddable_extension_ak(){ typedef typename AK::Integer Integer; - typedef typename AK::Bigfloat Bigfloat; - typedef typename AK::Bigfloat Bigfloat_interval; + typedef typename AK::Bigfloat Bigfloat; + typedef typename AK::Bigfloat Bigfloat_interval; test_real_embeddable_extension(Integer()); //typedef typename AK::Rational Rational; @@ -147,6 +147,6 @@ int main() { #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL test_real_embeddable_extension_ak< CGAL::CORE_arithmetic_kernel >(); #endif - + return 0; } diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.cpp index a25ea7705263..a5d3855a6b61 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.cpp @@ -5,7 +5,7 @@ // // $URL:$ // $Id: $ -// +// // // Author(s) : Michael Kerber // @@ -25,35 +25,35 @@ void test_routine() { typedef ArithmeticKernel Arithmetic_kernel; typedef typename Arithmetic_kernel::Integer Integer; typedef typename Arithmetic_kernel::Rational Rational; - + typedef typename CGAL::Polynomial_type_generator::Type Poly_int1; typedef CGAL::Algebraic_kernel_d_1 Algebraic_kernel_d_1; Algebraic_kernel_d_1 ak_1; - + typedef typename Algebraic_kernel_d_1::Solve_1 Real_roots; typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real; - - + + { Poly_int1 p(1,-3,1,0,-1,0,0,1); Real_roots rr; std::vector v1; - + rr(p,std::back_inserter(v1),true); - + std::ptrdiff_t n = std::distance(v1.begin(),v1.end()); assert(n==3); - + std::vector inter; CGAL::internal::find_intermediate_values (&ak_1,v1.begin(),v1.end(),std::back_inserter(inter)); int m = (int)inter.size(); assert(m==n+1); - + for(int i=0;i v2; - + rr2(p,std::back_inserter(v2),false); - + std::ptrdiff_t n = std::distance(v2.begin(), v2.end()); assert(n==4); - + std::vector inter; CGAL::internal::find_intermediate_values (&ak_1,v2.begin(),v2.end(),std::back_inserter(inter)); int m = (int)inter.size(); assert(m==n+1); - + for(int i=0;i v1; - + rr1(p,std::back_inserter(v1),false); - + std::ptrdiff_t n = std::distance(v1.begin(), v1.end()); assert(n==0); - + std::vector inter; CGAL::internal::find_intermediate_values (&ak_1,v1.begin(),v1.end(),std::back_inserter(inter)); int m = (int)inter.size(); assert(m==n+1); - + for(int i=0;i v2; - + rr2(p,std::back_inserter(v2),false); - + std::ptrdiff_t n = std::distance(v2.begin(), v2.end()); assert(n==1); - + std::vector inter; CGAL::internal::find_intermediate_values (&ak_1,v2.begin(),v2.end(),std::back_inserter(inter)); int m = (int)inter.size(); assert(m==n+1); - + for(int i=0;i> f; - + ss >> f; + ::CGAL::set_pretty_mode(std::cout); //std::cout << f << " " << a << std::endl; - + assert(CGAL::internal::is_root_of(a,f)); - + } */ return; } int main() { - + #ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL std::cerr << "test LEDA " << std::endl; test_routine (); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/cyclic.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/cyclic.cpp index 4d9bdbdf8063..0219dc6722dc 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/cyclic.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/cyclic.cpp @@ -10,10 +10,10 @@ static const char *ACK_2_ascii_polys[] = { - - "P[2(0,P[2(2,1)])(2,P[0(0,-1)])]", // x^2-y^2 - "P[1(0,P[2(2,1)])(1,P[0(0,1)])]", // x^2+y7 + "P[2(0,P[2(2,1)])(2,P[0(0,-1)])]", // x^2-y^2 + + "P[1(0,P[2(2,1)])(1,P[0(0,1)])]", // x^2+y7 }; static const int ACK_2_n_polys = 2; @@ -31,36 +31,36 @@ int main() typedef CGAL::CORE_arithmetic_kernel AT; typedef AT::Integer Coefficient; typedef AT::Rational Rational; - + typedef CGAL::internal::Algebraic_real_quadratic_refinement_rep_bfi < Coefficient, Rational > Rep_class; - typedef CGAL::internal::Bitstream_descartes< + typedef CGAL::internal::Bitstream_descartes< CGAL::internal::Bitstream_descartes_rndl_tree_traits< - CGAL::internal::Bitstream_coefficient_kernel > > + CGAL::internal::Bitstream_coefficient_kernel > > Isolator; - - typedef CGAL::Algebraic_kernel_d_1 + + typedef CGAL::Algebraic_kernel_d_1 Algebraic_kernel_d_1; - + typedef CGAL::Algebraic_curve_kernel_2 AK_2; - + typedef AK_2::Polynomial_2 Poly_2; typedef AK_2::Curve_analysis_2 Curve_analysis_2; typedef Curve_analysis_2::Status_line_1 Status_line_1; Poly_2 polys[ACK_2_n_polys]; - + for(int i = 0; i < ACK_2_n_polys; i++) { std::istringstream in(ACK_2_ascii_polys[i]); - in >> polys[i]; + in >> polys[i]; } - + AK_2 kernel_2; - + Curve_analysis_2 c7_c6 = - kernel_2.construct_curve_2_object()(polys[0]*polys[1]); - + kernel_2.construct_curve_2_object()(polys[0]*polys[1]); + Status_line_1 line = c7_c6.status_line_at_event(0); return 0; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h index f69d007d019b..d9fb58b9663a 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h @@ -29,27 +29,27 @@ namespace internal { static const char *ACK_2_ascii_polys[] = { "P[12(0,P[12(0,-403)(1,445)(2,-244)(3,-261)(4,182)(5,-284)(6,321)(7,-150)(8,-312)(9,-395)(10,451)(11,166)(12,-268)])(1,P[11(0,-149)(1,-194)(2,190)(3,397)(4,-423)(5,507)(6,-321)(7,215)(8,-459)(9,-112)(10,35)(11,-296)])(2,P[10(0,326)(1,296)(2,-461)(3,-175)(4,-123)(5,432)(6,195)(7,447)(8,-135)(9,-87)(10,8)])(3,P[9(0,299)(1,10)(2,-494)(3,192)(4,269)(5,-177)(6,-418)(7,461)(8,352)(9,23)])(4,P[8(0,193)(1,-357)(2,-187)(3,-140)(4,-126)(5,195)(6,-178)(7,-156)(8,-118)])(5,P[7(0,-11)(1,-205)(2,-357)(3,-157)(4,-321)(5,295)(6,-120)(7,-72)])(6,P[6(0,322)(1,443)(2,-26)(3,-29)(4,196)(5,-188)(6,132)])(7,P[5(0,372)(1,-15)(2,-184)(3,-4)(4,453)(5,-134)])(8,P[4(0,26)(1,131)(2,-170)(3,256)(4,282)])(9,P[3(0,198)(1,-424)(2,134)(3,350)])(10,P[2(0,-49)(1,-445)(2,343)])(11,P[1(0,86)(1,417)])(12,P[0(0,-295)])]", // 0 - + "P[6(0,P[6(0,132371318621897968)(1,62063386199148599600)(2,-151639931559080760922)(3,93583844480566235832)(4,-83154766543076124512)(5,-35432091262507130904)(6,227271934222282896800)])(1,P[5(0,-71827641993430936816)(1,368348281512476672028)(2,-286334917753887437776)(3,204520624662741644980)(4,-153426196026247710960)(5,-806483254283204758968)])(2,P[4(0,-207823824331267897258)(1,407437416975079236352)(2,-109980596108783730996)(3,560473260289176309328)(4,707425975812414448406)])(3,P[3(0,-229793885496425988888)(1,-16258161769731113484)(2,-225314637374518033384)(3,390228626765477166248)])(4,P[2(0,30511269636646463220)(1,-323492766503557473768)(2,-917252466360862051372)])(5,P[1(0,159815596286749757976)(1,567591812420861278704)])(6,P[0(0,-148967343686356735666)])]", // 1 - + "P[2(0,P[2(0,35204645504740)(1,18690431343280)(2,-33659097374560)])(1,P[1(0,-5878113292740)(1,25167512604160)])(2,P[0(0,41597705375085)])]", // 2 "P[6(0,P[6(0,-4041376884475638882353)(1,7050387367979191249572)(2,13657295334099123447165)(3,25540501499116672333266)(4,35818873525049083535243)(5,5246125427237612693902)(6,14604340604186011880149)])(1,P[5(0,6901581474556480012157)(1,-7529175981573515299061)(2,-11055581988553126878879)(3,12006542139536462689689)(4,14452481220936855448204)(5,13877670792372320318222)])(2,P[4(0,-11020699216485230516718)(1,-17311543433158205744767)(2,-31286655398777064659338)(3,-31056714506153479404652)(4,4356717231425141453473)])(3,P[3(0,3592444310543685259781)(1,6258214164280712933460)(2,-21871202396326925470570)(3,-7534603152074886821296)])(4,P[2(0,9063109123142130614750)(1,7920859532025064873268)(2,-6296939225750115900496)])(5,P[1(0,5169051546475000208976)(1,893576149924111317664)])(6,P[0(0,973644041162690858383)])]", // 3 - + "P[3(0,P[3(0,1)(1,3)(2,3)(3,1)])(1,P[2(0,-3)(1,-6)(2,-3)])(2,P[1(0,3)(1,3)])(3,P[0(0,-1)])]", // (x-y+1)^3 // 4 - + "P[1(0,P[1(1,1)])(1,P[0(0,-1)])]", // (x-y) // 5 - + "P[2(0,P[2(2,1)])(2,P[0(0,-1)])]", // x^2-y^2 // 6 - "P[1(0,P[2(2,1)])(1,P[0(0,1)])]", // x^2+y // 7 + "P[1(0,P[2(2,1)])(1,P[0(0,1)])]", // x^2+y // 7 "P[2(0,P[2(0,1)(2,2)])(2,P[0(0,-1)])]", // 2x^2-y^2+1 // 8 "P[7(1,P[7(1,-500)(3,300)(5,-60)(7,4)])(3,P[5(1,300)(3,-147)(5,12)])(5,P[3(1,-60)(3,12)])(7,P[1(1,4)])]", // (4*x)*y^7 + (12*x^3 + (-60)*x)*y^5 + (12*x^5 + (-147)*x^3 + 300*x)*y^3 + (4*x^7 + (-60)*x^5 + 300*x^3 + (-500)*x)*y // 9 "P[2(0,P[2(0,148)(1,20)(2,1)])(1,P[0(0,16)])(2,P[0(0,1)])]", // y^2 + 16*y + (x^2 + 20*x + 148) //10 - + "P[0(0,P[1(0,10)(1,1)])]", // x+10 // 11 }; @@ -61,18 +61,18 @@ template< class AlgebraicCurveKernel_2 > void test_algebraic_curve_kernel_2() { typedef AlgebraicCurveKernel_2 AK_2; - - /* CGAL_static_assertion( (::boost::is_same< + + /* CGAL_static_assertion( (::boost::is_same< Algebraic_real_1, typename AK::Algebraic_real_1 >::value) ); CGAL_static_assertion((::boost::is_same< Isolator, typename AK::Isolator >::value) ); - - CGAL_static_assertion((::boost::is_same< - Coefficient, + + CGAL_static_assertion((::boost::is_same< + Coefficient, typename AK::Coefficient >::value)); - + CGAL_static_assertion((::boost::is_same< Polynomial_1, typename AK::Polynomial_1 >::value));*/ @@ -93,20 +93,20 @@ void test_algebraic_curve_kernel_2() { Poly_2 polys[ACK_2_n_polys]; ::CGAL::set_mode(std::cerr, ::CGAL::IO::PRETTY); - + //std::cerr << "constructing curves..\n"; for(int i = 0; i < ACK_2_n_polys; i++) { std::istringstream in(ACK_2_ascii_polys[i]); - in >> polys[i]; + in >> polys[i]; } - + ///////// testing curve construction ////////// - + AK_2 kernel_2; Curve_analysis_2 c0 = kernel_2.construct_curve_2_object()(polys[0]), // make it decomposable @@ -116,13 +116,13 @@ void test_algebraic_curve_kernel_2() { c5 = kernel_2.construct_curve_2_object()(polys[5]), c6 = kernel_2.construct_curve_2_object()(polys[6]); //std::cerr << "done..\n"; - + Status_line_1 line1, line2; Algebraic_real_2 xy1, xy2, xy3, xy4; ///////////// testing sign_at_2 for non-coprime case ///////////// - { + { Curve_analysis_2 c7_c6 = kernel_2.construct_curve_2_object()(polys[7]*polys[6]); assert(c7_c6.number_of_status_lines_with_event() > 0); @@ -133,11 +133,11 @@ void test_algebraic_curve_kernel_2() { //std::cerr << "done..1.5\n"; assert(kernel_2.sign_at_2_object()(c7_c6, xy) == CGAL::ZERO); } - { + { Curve_analysis_2 c7_c6 = kernel_2.construct_curve_2_object()(polys[7]*polys[6]), c8_c6 = kernel_2.construct_curve_2_object()(polys[8]*polys[6]); - + assert(c7_c6.number_of_status_lines_with_event() > 0); Status_line_1 line = c7_c6.status_line_at_event(0); assert(line.number_of_events() > 0); @@ -148,19 +148,19 @@ void test_algebraic_curve_kernel_2() { } //std::cerr << "done..2\n"; - + ///////// test buggy y() ////////////// - { + { Curve_analysis_2 c9 = kernel_2.construct_curve_2_object()(polys[9]); typename Algebraic_real_1::Polynomial_1 f(25,0,-11,0,1); - + typedef typename Algebraic_real_1::Rational Rational; - + Rational left(-3), right(-2); - + Algebraic_real_1 x(f,left,right); Algebraic_real_2 xy(x,c9,0); @@ -169,7 +169,7 @@ void test_algebraic_curve_kernel_2() { } ///////// testing comparison predicates ////////// - + line1 = c0.status_line_of_interval(0); xy1 = line1.algebraic_real_2(1); line2 = c1.status_line_at_event(1); @@ -208,21 +208,21 @@ void test_algebraic_curve_kernel_2() { assert( !kernel_2.has_finite_number_of_self_intersections_2_object() (polys[4])); // non-squarefree*/ - + assert( kernel_2.has_finite_number_of_intersections_2_object() (c2.polynomial_2(), c3.polynomial_2())); // coprime - + assert( !kernel_2.has_finite_number_of_intersections_2_object() (c1.polynomial_2(), c2.polynomial_2())); // non-coprime - + assert( !kernel_2.has_finite_number_of_intersections_2_object() (c5.polynomial_2(), c6.polynomial_2())); // non-coprime //////// testing decompose /////////// - + assert((kernel_2.decompose_2_object()(polys[4])) != polys[4]); // non-squarefree @@ -238,7 +238,7 @@ void test_algebraic_curve_kernel_2() { //std::cerr << "n_factors: " << kernel_2.decompose_2_object()(c1, // std::back_inserter(parts), std::back_inserter(mults)); - + for(cit = parts.begin(), iit = mults.begin(); cit != parts.end(); cit++, iit++) { //std::cerr << "part: " << cit->f() << "; mult: " << *iit << "\n"; @@ -265,7 +265,7 @@ void test_algebraic_curve_kernel_2() { assert(fgs.size() == 1); assert(fs.size() == 0); assert(gs.size() == 1); - + /*std::cerr << "common: " << fgs.size() << "; " << fs.size() << "; " << gs.size() << "\n";*/ @@ -279,12 +279,12 @@ void test_algebraic_curve_kernel_2() { assert(fgs.size() == 0); assert(fs.size() == 1); assert(gs.size() == 1); - + /*std::cerr << "coprime: " << fgs.size() << "; " << fs.size() << "; " << gs.size() << "\n";*/ - + //////// testing x/y-critical points //////// - + typedef std::vector Xy_coords; Xy_coords points; @@ -303,11 +303,11 @@ void test_algebraic_curve_kernel_2() { Status_line_1 line; Algebraic_real_2 xy; - + int n_lines = c0.number_of_status_lines_with_event(), ii, jj, n_events; for(ii = 0; ii < n_lines; ii++) { - + line = c0.status_line_at_event(ii); n_events = line.number_of_events(); //std::cout << ii << "pts at event: \n"; @@ -316,7 +316,7 @@ void test_algebraic_curve_kernel_2() { //std::cout << "sign 2: " << // kernel_2.sign_at_2_object()(c1, xy) << "\n\n"; } - + //std::cout << ii << "pts over interval: \n"; line = c0.status_line_of_interval(ii); n_events = line.number_of_events(); @@ -326,8 +326,8 @@ void test_algebraic_curve_kernel_2() { // kernel_2.sign_at_2_object()(c1, xy) << "\n\n"; } } - - + + ///////////// testing solve_2 ///////////// points.clear(); @@ -359,7 +359,7 @@ void test_algebraic_curve_kernel_2() { { Curve_analysis_2 c7_c6 = kernel_2.construct_curve_2_object()(polys[7]*polys[6]); - + Curve_analysis_2 swapped = kernel_2.swap_x_and_y_2_object()(c7_c6); (void) swapped; @@ -378,7 +378,7 @@ void test_algebraic_curve_kernel_2() { Algebraic_real_1 ar3(r,-5,5); assert(kernel_2.sign_at_1_object()(p,ar3)==CGAL::NEGATIVE); } - + } } //namespace internal diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h index 1df31d2c7b50..d087b945a6b9 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h @@ -8,7 +8,7 @@ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Sebastian Limbach -// Michael Hemmer +// Michael Hemmer // // ============================================================================ @@ -214,7 +214,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ Polynomial_1 p2 = compute_polynomial_1(ar); assert(!is_coprime_1(p1,p2)); assert(is_zero_at_1(p2,ar)); - + } { // solve_1 for OI::value_type == std::pair @@ -325,9 +325,9 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ //precs.push_back(64); //precs.push_back(106); //precs.push_back(424); - for (typename std::vector< int >::const_iterator c0i = coeffs.begin(); + for (typename std::vector< int >::const_iterator c0i = coeffs.begin(); c0i != coeffs.end(); c0i++) { - for (typename std::vector< int >::const_iterator c2i = coeffs.begin(); + for (typename std::vector< int >::const_iterator c2i = coeffs.begin(); c2i != coeffs.end(); c2i++) { // we basically test a quadratic polynomial (with chosen small and large // quadratic and constant coefficient, which is disturbed by a root close to zero). @@ -335,7 +335,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ Polynomial_1 poly((*c2i*x*x - *c0i) * (c*x-1)); std::list roots; solve_1(poly,true,std::back_inserter(roots)); - for (typename std::vector< int >::const_iterator pi = precs.begin(); + for (typename std::vector< int >::const_iterator pi = precs.begin(); pi != precs.end(); pi++) { // all three roots are approximated with various precisions long p = *pi; @@ -346,10 +346,10 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ assert(compare_1(bi.first ,*rit) != LARGER ); assert(compare_1(bi.second,*rit) != SMALLER); assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - if (!((bi.second - bi.first) * (p == 0 ? Bound(1) : ipower(Bound(2),p-1)) + if (!((bi.second - bi.first) * (p == 0 ? Bound(1) : ipower(Bound(2),p-1)) <= (p == 0 ? Bound(2) : Bound(1)) )) { all_right = false; - std::cerr << "ERROR: Approximate_absolute_1 fails for prec = " << p + std::cerr << "ERROR: Approximate_absolute_1 fails for prec = " << p << " of this root: " << *rit << std::endl; } } @@ -363,7 +363,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); if (!((bi.second - bi.first) <= ipower(Bound(2),1-(-p)) )) { all_right = false; - std::cerr << "ERROR: Approximate_absolute_1 fails for prec = " << -p + std::cerr << "ERROR: Approximate_absolute_1 fails for prec = " << -p << " of this root: " << *rit << std::endl; } } @@ -378,7 +378,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ if (!((bi.second - bi.first) * (p == 0 ? Bound(1) : ipower(Bound(2),p-1)) <= (p == 0 ? Bound(2) : Bound(1)) * (CGAL::max)(abs(bi.first),abs(bi.second)))) { all_right = false; - std::cerr << "ERROR: Approximate_relative_1 fails for prec = " << p + std::cerr << "ERROR: Approximate_relative_1 fails for prec = " << p << " of this root: " << *rit << std::endl; } @@ -391,26 +391,26 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ assert(compare_1(bi.first ,*rit) != LARGER ); assert(compare_1(bi.second,*rit) != SMALLER); assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - if (!((bi.second - bi.first) <= + if (!((bi.second - bi.first) <= ipower(Bound(2),1-(-p)) * (CGAL::max)(abs(bi.first),abs(bi.second)))) { all_right = false; - std::cerr << "ERROR: Approximate_relative_1 fails for prec = " << -p + std::cerr << "ERROR: Approximate_relative_1 fails for prec = " << -p << " of this root: " << *rit << std::endl; } } } } - } + } } assert(all_right); // some approximation was not good enough std::cout << " ok" << std::endl; - { - + { + #define CGAL_TEST_ALGEBRAIC_REAL_IO(_f) \ alg1=_f; \ - ss<>CGAL::iformat(alg2); \ + ss>>CGAL::iformat(alg2); \ CGAL_assertion(!ss.fail()); \ ss.clear(); \ assert(alg1==alg2) @@ -419,20 +419,20 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ // with eofbit, then the failbit will be set. That is why one must // clear the iostate with ss.clear(). - + Algebraic_real_1 alg1,alg2; std::stringstream ss; - CGAL::set_ascii_mode(ss); - + CGAL::set_ascii_mode(ss); + // test construction from int, Coefficient and Bound CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(int(2))); CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(Coefficient(2))); CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(Bound(2))); - + // construction by index Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); // the monom x CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(x*x-2,1)); - + // construction by isolating interval CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(x*x-2,Bound(0),Bound(2))); #undef CGAL_TEST_ALGEBRAIC_REAL_IO diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h index c7f67d038af0..335fd1ddb097 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h @@ -39,12 +39,12 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { typedef typename AK_2::Bound Bound; typedef std::pair BInterval; typedef std::array BArray; - typedef typename AK_2::Polynomial_1 Polynomial_1; - typedef typename AK_2::Polynomial_2 Polynomial_2; - typedef typename AK_2::Algebraic_real_1 Algebraic_real_1; - typedef typename AK_2::Algebraic_real_2 Algebraic_real_2; - typedef typename AK_2::size_type size_type; - typedef typename AK_2::Multiplicity_type Multiplicity_type; + typedef typename AK_2::Polynomial_1 Polynomial_1; + typedef typename AK_2::Polynomial_2 Polynomial_2; + typedef typename AK_2::Algebraic_real_1 Algebraic_real_1; + typedef typename AK_2::Algebraic_real_2 Algebraic_real_2; + typedef typename AK_2::size_type size_type; + typedef typename AK_2::Multiplicity_type Multiplicity_type; typedef CGAL::Polynomial_traits_d Polynomial_traits_1; typedef CGAL::Polynomial_traits_d Polynomial_traits_2; @@ -111,17 +111,17 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { CGAL_static_assertion(( ::boost::is_same - - ::value)); + + ::value)); CGAL_CHECK_UFUNCTION(Is_square_free_2,Polynomial_2,bool); CGAL_CHECK_UFUNCTION(Make_square_free_2,Polynomial_2,Polynomial_2); // TODO: missing check for Square_free_factorize_2 CGAL_CHECK_BFUNCTION(Is_coprime_2,Polynomial_2,Polynomial_2,bool); CGAL_static_assertion(( ::boost::is_same - ::value)); + ::value)); CGAL_CHECK_BFUNCTION(Number_of_solutions_2,Polynomial_2,Polynomial_2, - size_type); + size_type); CGAL_CHECK_UFUNCTION(Compute_x_2,Algebraic_real_2,Algebraic_real_1); CGAL_CHECK_UFUNCTION(Compute_y_2,Algebraic_real_2,Algebraic_real_1); CGAL_CHECK_UFUNCTION(Compute_polynomial_x_2,Algebraic_real_2,Polynomial_1); @@ -129,24 +129,24 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { CGAL_CHECK_BFUNCTION(Isolate_x_2,Algebraic_real_2,Polynomial_1,BInterval); CGAL_CHECK_BFUNCTION(Isolate_y_2,Algebraic_real_2,Polynomial_1,BInterval); CGAL_static_assertion(( ::boost::is_same - < BArray,typename Isolate_2::result_type>::value)); + < BArray,typename Isolate_2::result_type>::value)); CGAL_CHECK_BFUNCTION(Sign_at_2,Polynomial_2,Algebraic_real_2,Sign); CGAL_CHECK_BFUNCTION(Is_zero_at_2,Polynomial_2,Algebraic_real_2,bool); CGAL_CHECK_BFUNCTION(Compare_x_2,Algebraic_real_2,Algebraic_real_2,Sign); CGAL_CHECK_BFUNCTION(Compare_y_2,Algebraic_real_2,Algebraic_real_2,Sign); CGAL_CHECK_BFUNCTION(Compare_xy_2,Algebraic_real_2,Algebraic_real_2,Sign); CGAL_CHECK_BFUNCTION(Bound_between_x_2,Algebraic_real_2, - Algebraic_real_2,Bound); + Algebraic_real_2,Bound); CGAL_CHECK_BFUNCTION(Bound_between_y_2,Algebraic_real_2, - Algebraic_real_2,Bound); + Algebraic_real_2,Bound); CGAL_CHECK_BFUNCTION(Approximate_absolute_x_2,Algebraic_real_2, - int,BInterval); + int,BInterval); CGAL_CHECK_BFUNCTION(Approximate_absolute_y_2,Algebraic_real_2, - int,BInterval); + int,BInterval); CGAL_CHECK_BFUNCTION(Approximate_relative_x_2,Algebraic_real_2, - int,BInterval); + int,BInterval); CGAL_CHECK_BFUNCTION(Approximate_relative_y_2,Algebraic_real_2, - int,BInterval); + int,BInterval); #undef CGAL_CHECK_BFUNCTION #undef CGAL_CHECK_UFUNCTION @@ -154,7 +154,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { std::pair coeffs_t[1] = {std::make_pair(CGAL::Exponent_vector(1),Coefficient(1))}; Polynomial_1 t=construct_polynomial_1(coeffs_t,coeffs_t+1); - + typename Polynomial_traits_2::Construct_polynomial construct_polynomial_2; std::pair coeffs_x[1] = {std::make_pair(CGAL::Exponent_vector(1,0),Coefficient(1))}; @@ -163,31 +163,31 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { = {std::make_pair(CGAL::Exponent_vector(0,1),Coefficient(1))}; Polynomial_2 y=construct_polynomial_2(coeffs_y,coeffs_y+1); Polynomial_2 one=construct_polynomial_2(Coefficient(1)); - + { // Construct_algebraic_real_2 Algebraic_real_2 ar1 = construct_algebraic_real_2(1,1); Algebraic_real_2 ar2 = construct_algebraic_real_2(Bound(1),Bound(1)); - Algebraic_real_2 ar3 + Algebraic_real_2 ar3 = construct_algebraic_real_2(Coefficient(2),Coefficient(-2)); - Algebraic_real_2 ar4 + Algebraic_real_2 ar4 = construct_algebraic_real_2(construct_algebraic_real_1(Coefficient(2)), - construct_algebraic_real_1(Bound(-5))); + construct_algebraic_real_1(Bound(-5))); // 3y+2x+2 Polynomial_2 pol1_2 = y*3+x*2+2; // x^2+xy Polynomial_2 pol2_2 = pow(x,2)+x*y; - Algebraic_real_2 ar5 + Algebraic_real_2 ar5 = construct_algebraic_real_2(pol1_2,pol2_2,0); // (0,-2/3) - Algebraic_real_2 ar6 + Algebraic_real_2 ar6 = construct_algebraic_real_2(pol1_2,pol2_2,1); // (2,-2) - + Algebraic_real_2 ar7 = construct_algebraic_real_2(pol1_2,pol2_2, - Bound(-3),Bound(3),Bound(-1),Bound(100)); + Bound(-3),Bound(3),Bound(-1),Bound(100)); - // Comparisons + // Comparisons assert(compare_xy_2(ar1,ar2)==CGAL::EQUAL); assert(compare_xy_2(ar1,ar3)==CGAL::SMALLER); assert(compare_xy_2(ar2,ar3)==CGAL::SMALLER); @@ -209,7 +209,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { assert(compare_y_2(ar5,Bound(0))==CGAL::SMALLER); assert(compare_y_2(ar5,Coefficient(0))==CGAL::SMALLER); assert(compare_y_2(ar5,construct_algebraic_real_1(0)) - ==CGAL::SMALLER); + ==CGAL::SMALLER); assert(compare_y_2(0,ar5)==CGAL::LARGER); assert(compare_y_2(Bound(0),ar5)==CGAL::LARGER); assert(compare_y_2(Coefficient(0),ar5)==CGAL::LARGER); @@ -217,16 +217,16 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { assert(compare_xy_2(ar5,0,0)==CGAL::SMALLER); assert(compare_xy_2(ar5,Bound(0),Bound(0))==CGAL::SMALLER); assert(compare_xy_2(ar5,Coefficient(0),Coefficient(0)) - ==CGAL::SMALLER); + ==CGAL::SMALLER); assert(compare_xy_2(ar5,construct_algebraic_real_1(0), - construct_algebraic_real_1(0))==CGAL::SMALLER); + construct_algebraic_real_1(0))==CGAL::SMALLER); assert(compare_xy_2(0,0,ar5)==CGAL::LARGER); assert(compare_xy_2(Bound(0),Bound(0),ar5)==CGAL::LARGER); assert(compare_xy_2(Coefficient(0),Coefficient(0),ar5) - ==CGAL::LARGER); + ==CGAL::LARGER); assert(compare_xy_2(construct_algebraic_real_1(0), - construct_algebraic_real_1(0), - ar5)==CGAL::LARGER); + construct_algebraic_real_1(0), + ar5)==CGAL::LARGER); assert(compare_y_2(0,ar5)==CGAL::LARGER); assert(compare_y_2(-1,ar5)==CGAL::SMALLER); assert(compare_xy_2(ar5,-1,1000)==CGAL::LARGER); @@ -259,7 +259,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { assert(! is_square_free_2(pol1_2*pol1_2)); Polynomial_2 pol1_2_prime = make_square_free_2(pol1_2*pol1_2); assert(CGAL::canonicalize(pol1_2) - ==CGAL::canonicalize(pol1_2_prime)); + ==CGAL::canonicalize(pol1_2_prime)); // Is_coprime, Make_coprime assert(is_coprime_2(pol1_2,pol2_2)); assert(is_coprime_2(pol1_2*Coefficient(3),pol2_2*Coefficient(3))); @@ -268,7 +268,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { bool check = make_coprime_2(pol1_2,pol1_2*pol2_2,g,q1,q2); assert(! check); assert(CGAL::canonicalize(q1) - ==CGAL::canonicalize(one)); + ==CGAL::canonicalize(one)); assert(CGAL::canonicalize(q2)==CGAL::canonicalize(pol2_2)); assert(CGAL::canonicalize(g)==CGAL::canonicalize(pol1_2)); check = make_coprime_2(pol2_2,pol1_2,g,q1,q2); @@ -289,16 +289,16 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { Polynomial_2 sqfr_fac_test_pol = pol1_2*CGAL::ipower(pol2_2,3)*CGAL::ipower(pol3_2,7); square_free_factorize_2(sqfr_fac_test_pol, - std::back_inserter(sqfr_factors)); + std::back_inserter(sqfr_factors)); Polynomial_2 sqfr_fac_checksum=one; for(unsigned int i=0;i-1); assert(box[3]<1); assert(sign_at_2(circle,construct_algebraic_real_2(box[0],box[2])) - == CGAL::NEGATIVE); + == CGAL::NEGATIVE); assert(sign_at_2(circle,construct_algebraic_real_2(box[1],box[2])) - == CGAL::NEGATIVE); + == CGAL::NEGATIVE); assert(sign_at_2(circle,construct_algebraic_real_2(box[0],box[3])) - == CGAL::NEGATIVE); + == CGAL::NEGATIVE); assert(sign_at_2(circle,construct_algebraic_real_2(box[1],box[3])) - == CGAL::NEGATIVE); + == CGAL::NEGATIVE); isolate_2(ar1,one); box = isolate_2(ar1,pol1,pol2*pol3); roots2.clear(); solve_2(pol1,pol2*pol3,box[0],box[1],box[2],box[3], - std::back_inserter(roots2)); + std::back_inserter(roots2)); assert(roots2.size()==0); roots.clear(); roots2.clear(); @@ -383,9 +383,9 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { for(size_type i = 0; i < 7; i++) { box=isolate_2(roots[i].first,pol1,pol2*pol3); solve_2(pol1,pol2*pol3,box[0],box[1],box[2],box[3], - std::back_inserter(roots2)); + std::back_inserter(roots2)); assert(roots2.size()==static_cast(i+1)); - } + } std::sort(roots.begin(),roots.end()); std::sort(roots2.begin(),roots2.end()); assert(std::equal(roots.begin(),roots.end(),roots2.begin())); @@ -403,8 +403,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { solve_1(q,false,std::back_inserter(roots_1)); assert(roots_1.size()==4); for(size_type i=0;i<4;i++) { - Algebraic_real_2 c_ar - = construct_algebraic_real_2(roots_1[i],roots_1[3-i]); + Algebraic_real_2 c_ar + = construct_algebraic_real_2(roots_1[i],roots_1[3-i]); bounds=isolate_x_2(c_ar,q); solve_1(q,false,bounds.first,bounds.second,std::back_inserter(roots2_1)); bounds=isolate_y_2(c_ar,q); @@ -414,15 +414,15 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { assert(roots_1.size()==roots3_1.size()); assert(std::equal(roots_1.begin(),roots_1.end(),roots2_1.begin())); assert(std::equal(roots_1.begin(),roots_1.end(), - roots3_1.rbegin())); - + roots3_1.rbegin())); + // Approximate_absolute_2, Approximate_relative_2 Polynomial_2 pol4 = pow(x,5)+pow(y,2)-y+y*x-1; Polynomial_2 pol5 = pow(y,2)-pow(x,3); // absolute - Algebraic_real_2 ar2 + Algebraic_real_2 ar2 = construct_algebraic_real_2(pol4,pol5, - Bound(0),Bound(2),Bound(0),Bound(3)); + Bound(0),Bound(2),Bound(0),Bound(3)); for(int i=1;i<1024;i*=2) { Bound dist = CGAL::ipower(Bound(2),i); bounds = approximate_absolute_x_2(ar2,i); @@ -450,10 +450,10 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { // kernels might not satisfy this property assert(dist*(bounds.second-bounds.first)<=Bound(1)); } - + // relative ar2 = construct_algebraic_real_2(pol4,pol5, - Bound(0),Bound(2),Bound(-3),Bound(0)); + Bound(0),Bound(2),Bound(-3),Bound(0)); for(int i=1;i<1024;i*=2) { Bound dist = CGAL::ipower(Bound(2),i); bounds = approximate_relative_x_2(ar2,i); @@ -484,11 +484,11 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { // kernels might not satisfy this property assert(dist*(bounds.second-bounds.first)<=Bound(1)*min); } - - } + + } + - } diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_bitstream_descartes.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_bitstream_descartes.h index 0fe595bbe1d3..bb87f5a01cc6 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_bitstream_descartes.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_bitstream_descartes.h @@ -5,7 +5,7 @@ // // $URL: svn+ssh://hemmer@scm.gforge.inria.fr/svn/cgal/trunk/Polynomial/include/CGAL/Polynomial.h $ // $Id: Polynomial.h 47254 2008-12-06 21:18:27Z afabri $ -// +// // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Michael Kerber @@ -35,7 +35,7 @@ namespace CGAL { namespace internal { -// A simple model of the EventRefinement concept: +// A simple model of the EventRefinement concept: // Uses a vector of Algebraic reals template class Event_refinement { @@ -57,11 +57,11 @@ class Event_refinement { template void test_bitstream_descartes() { - + typedef ArithmeticKernel Arithmetic_kernel; typedef typename Arithmetic_kernel::Integer Integer; typedef typename Arithmetic_kernel::Rational Rational; - + typedef typename CGAL::Polynomial_type_generator::Type Poly_int1; typedef typename CGAL::Polynomial_type_generator::Type Poly_int2; typedef CGAL::internal::Algebraic_real_d_1 @@ -69,12 +69,12 @@ void test_bitstream_descartes() { typedef CGAL::internal::Bitstream_descartes_rndl_tree_traits > Traits; - + typedef CGAL::internal::Bitstream_descartes Bitstream_descartes; Traits traits; - + { // Test for the classical Descartes method std::stringstream ss("P[15(0,59738427711)(1,300038251861)(2,-471253844514)(3,538575935875)(4,22286946912)(5,548111721525)(6,-379185895352)(7,296681325489)(8,-464256140044)(9,410194800463)(10,232977578849)(11,-376080509486)(12,521721411895)(13,-100316773723)(14,-171187873598)(15,-189253202432)]"); @@ -84,16 +84,16 @@ void test_bitstream_descartes() { // In Maple: f := 59738427711-189253202432*x^15-171187873598*x^14-100316773723*x^13+521721411895*x^12-376080509486*x^11+232977578849*x^10+410194800463*x^9-464256140044*x^8+296681325489*x^7-379185895352*x^6+548111721525*x^5+22286946912*x^4+538575935875*x^3-471253844514*x^2+300038251861*x // We expect 3 roots, at -1.176, -.154 and 1.168 - + CGAL::internal::Square_free_descartes_tag t; Bitstream_descartes descartes(t, f); assert(descartes.degree_of_gcd() == 0); assert(descartes.square_free_part() == f); - + int n = descartes.number_of_real_roots(); - + assert(n==3); for(int i = 0; i Rational(1,10000)) - { - descartes.refine_interval(i); - } + > Rational(1,10000)) + { + descartes.refine_interval(i); + } } assert(Rational(-118,100)descartes.right_bound(0)); @@ -134,11 +134,11 @@ void test_bitstream_descartes() { #endif // We expect 3 roots, at -1.597, -.388 and 0 - + CGAL::internal::Square_free_descartes_tag t; Bitstream_descartes descartes(t, f, tree); - + assert(descartes.degree_of_gcd() == 0); assert(descartes.square_free_part() == f); @@ -153,10 +153,10 @@ void test_bitstream_descartes() { for(int i =0; i Rational(1,10000)) - { - descartes.refine_interval(i); - } + > Rational(1,10000)) + { + descartes.refine_interval(i); + } } assert(Rational(-160,100)descartes.right_bound(0)); @@ -165,24 +165,24 @@ void test_bitstream_descartes() { assert(Rational(-1,100)descartes.right_bound(2)); } - + { // Test for the m-k-Descartes method // Polnomial with one multiple root: - + std::stringstream ss("P[11(0,-51960)(1,158454)(2,3015726)(3,-22833405)(4,64277882)(5,-86502719)(6,58622397)(7,-260172)(8,-77833332)(9,85923423)(10,-37885401)(11,1874259)]"); // This is a polynomial with a 4-fold root at 1/3, and 3 more roots at // approximate positions -1.036, -0.104, 17.764 - // In Maple:g := -51960-86502719*x^5+158454*x-22833405*x^3+3015726*x^2+64277882*x^4+1874259*x^11-77833332*x^8+85923423*x^9-37885401*x^10+58622397*x^6-260172*x^7 + // In Maple:g := -51960-86502719*x^5+158454*x-22833405*x^3+3015726*x^2+64277882*x^4+1874259*x^11-77833332*x^8+85923423*x^9-37885401*x^10+58622397*x^6-260172*x^7 Poly_int1 f; ss >> f; - + CGAL::internal::M_k_descartes_tag t; - + // We expect 4 real roots (m), and the gcd of g and g' is 3 (k) Bitstream_descartes descartes(t, f, 4, 3); @@ -195,24 +195,24 @@ void test_bitstream_descartes() { } int n = descartes.number_of_real_roots(); - + assert(n==4); for(int i = 0; iRational(1,10000)) - { - descartes.refine_interval(i); - } + >Rational(1,10000)) + { + descartes.refine_interval(i); + } } assert(Rational(-104,100)descartes.right_bound(0)); @@ -222,7 +222,7 @@ void test_bitstream_descartes() { assert(Rational(34,100)>descartes.right_bound(2)); assert(Rational(1776,100)descartes.right_bound(3)); - + } { // Another test for the m-k-method @@ -230,12 +230,12 @@ void test_bitstream_descartes() { // Test for the m-k-Descartes method // Polnomial with one multiple root: - - // In Maple:f := y^3 - y^2 -2*y + + // In Maple:f := y^3 - y^2 -2*y Poly_int1 f(0,-2,-1,1); - + CGAL::internal::M_k_descartes_tag t; - + // We expect 3 real roots (m), and the degree of gcd of g and g' is 0 (k) Bitstream_descartes descartes(t, f, 3, 0); @@ -248,7 +248,7 @@ void test_bitstream_descartes() { } int n = descartes.number_of_real_roots(); - + assert(n==3); for(int i = 0; iRational(1,10000)) - { - descartes.refine_interval(i); - } + >Rational(1,10000)) + { + descartes.refine_interval(i); + } } assert(Rational(-101,100)descartes.right_bound(0)); @@ -267,9 +267,9 @@ void test_bitstream_descartes() { assert(Rational(1,1000)>descartes.right_bound(1)); assert(Rational(199,100)descartes.right_bound(2)); - + } - + { // Test for the backshear method typedef Event_refinement Ev_refinement; Ev_refinement event_refinement; @@ -278,13 +278,13 @@ void test_bitstream_descartes() { event_refinement.add(Algebraic_real(f,Rational(-2),Rational(-1))); event_refinement.add(Algebraic_real(f,Rational(-8,10),Rational(-5,10))); event_refinement.add(Algebraic_real(f,Rational(0),Rational(1))); - + std::stringstream ss("P[14(0,75449)(1,359917)(2,299972)(3,-1003302)(4,-1857360)(5,42392)(6,2091751)(7,1825115)(8,840268)(9,-840578)(10,-2327140)(11,-1130116)(12,705936)(13,746328)(14,170368)]"); Poly_int1 g; ss >> g; - // g = f^3*h, where h is a polynomial with 3 simple roots + // g = f^3*h, where h is a polynomial with 3 simple roots // g := 75449+42392*x^5+359917*x-1003302*x^3+299972*x^2-1857360*x^4-1130116*x^11+840268*x^8-840578*x^9-2327140*x^10+705936*x^12+2091751*x^6+1825115*x^7+746328*x^13+170368*x^14 - + CGAL::internal::Backshear_descartes_tag t; // We expect 3 event roots, and 3 non-event roots @@ -310,10 +310,10 @@ void test_bitstream_descartes() { for(int i =0; iRational(1,10000)) - { - descartes.refine_interval(i); - } + >Rational(1,10000)) + { + descartes.refine_interval(i); + } } // The non-event roots are expected at -0.953, -0.685, 1.009. The events at @@ -331,7 +331,7 @@ void test_bitstream_descartes() { assert(! descartes.is_certainly_multiple_root(2)); assert(Rational(-686,1000)descartes.right_bound(2)); - + assert(! descartes.is_certainly_simple_root(3)); assert(descartes.is_certainly_multiple_root(3)); assert(Rational(-636,1000) Traits_2; - + typedef CGAL::internal::Bitstream_descartes Bitstream_descartes; typedef typename Bitstream_descartes::Bitstream_tree Bitstream_tree; @@ -370,7 +370,7 @@ void test_bitstream_descartes() { AK_1 ak_1; Poly_int2 f; - + ss >> f; Poly_int1 r = CGAL::internal::resultant(f,CGAL::differentiate(f)); @@ -390,10 +390,10 @@ void test_bitstream_descartes() { // The root is an "opening" x-extreme point // Refine the y-coordinate (just to make it harder...) - while(m_k_descartes.right_bound(0) - m_k_descartes.left_bound(0) + while(m_k_descartes.right_bound(0) - m_k_descartes.left_bound(0) > Rational(1,100000)) { m_k_descartes.refine_interval(0); - } + } // Get copy of the tree Bitstream_tree tree = m_k_descartes.get_tree().make_unique(); @@ -402,7 +402,7 @@ void test_bitstream_descartes() { // Now, find a value inside the isolating interval of alpha, on the right // of alpha Rational right_bound = alpha.high(); - + while(alpha.high()==right_bound) { alpha.refine(); } @@ -427,7 +427,7 @@ void test_bitstream_descartes() { assert(sq_free_descartes.right_bound(i) < m_k_descartes.right_bound(0)); } - + } } diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h index 2ade751fe35e..51ee9b90e000 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Michael Hemmer +// Author(s) : Michael Hemmer // // ============================================================================ @@ -52,7 +52,7 @@ namespace internal { CGAL_error_msg("To_double functor not implemented"); } }; - + template class Test_to_Interval { public: @@ -67,21 +67,21 @@ namespace internal { assert(to_Interval(NT(42)).lower() > 41.99); assert(to_Interval(NT(42)).upper() < 42.01); - /* - NT notdouble = ipower(2,60); + /* + NT notdouble = ipower(2,60); notdouble = notdouble + NT(1); Interval test = to_Interval(notdouble); double lower = ipower(2.0,60); double upper = ipower(2.0,53); upper++; upper *= ipower(2.0,7); - std::cout << lower << "," << upper << std::endl; - std::cout << test.lower() << "," << test.upper() << std::endl; + std::cout << lower << "," << upper << std::endl; + std::cout << test.lower() << "," << test.upper() << std::endl; assert( (in(lower,test) == true) && (in(upper,test) == true) ); */ } }; - + template class Test_to_Interval { public: @@ -95,14 +95,14 @@ namespace internal { //! tests if \c NT is a model for the \c RealComparable concept //! and terminates the program with an error message if not. template -void test_real_comparable() { +void test_real_comparable() { typedef CGAL::Real_embeddable_traits Traits; typedef typename Traits::Is_real_embeddable Is_real_comparable; using ::CGAL::Tag_true; CGAL_static_assertion((::boost::is_same< Is_real_comparable, Tag_true>::value)); typename Traits::Compare compare; typename Traits::Sign sign; - typename Traits::Abs abs; + typename Traits::Abs abs; NT a(-2); NT b(1); @@ -128,7 +128,7 @@ void test_real_comparable() { assert( sign(c) < sign(b)); assert( sign(b) > sign(c)); assert( sign(c) <= sign(b)); - assert( sign(b) >= sign(c)); + assert( sign(b) >= sign(c)); assert( sign(c) <= sign(c)); assert( sign(c) >= sign(c)); assert( sign(a) < sign(c)); @@ -137,21 +137,21 @@ void test_real_comparable() { assert( sign(c) >= sign(a)); assert( abs(a) == NT(2)); assert( abs(b) == NT(1)); - assert( abs(c) == NT(0)); - + assert( abs(c) == NT(0)); + // To_double -------------------------------------------------------------- typename Traits::To_double to_double; (void)to_double; typename internal::Test_to_double ttd; ttd(to_double); - + // To_Interval ------------------------------------------------------------ typename Traits::To_Interval to_Interval; (void)to_Interval; typename internal::Test_to_Interval tti; tti(to_Interval); - - // additional functions + + // additional functions assert(CGAL::sign(NT(-5))==CGAL::NEGATIVE); assert(CGAL::abs(NT(-5))==NT(5)); // TODO: NiX::in not available!? @@ -160,8 +160,8 @@ void test_real_comparable() { } -//! tests if \c NT says it is not a model for the \c RealComparable -//! concept and terminates the program with an error message if it +//! tests if \c NT says it is not a model for the \c RealComparable +//! concept and terminates the program with an error message if it //! actually is. template void test_not_real_comparable() { diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h index 8954c4e5d6a6..b79e47262b31 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Michael Hemmer +// Author(s) : Michael Hemmer // // ============================================================================ @@ -25,19 +25,19 @@ #define CGAL_TEST_REAL_ROOT_ISOLATOR_H namespace CGAL { - + namespace internal { - + template -int check_intervals_real_root_isolator( +int check_intervals_real_root_isolator( const typename RealRootIsolator::Polynomial& P) { typedef RealRootIsolator Isolator; typedef typename Isolator::Bound Bound; - + typedef typename CGAL::Get_arithmetic_kernel< Bound >::Arithmetic_kernel AK; typedef typename AK::Rational Rational; - + Isolator Isol(P); int n = Isol.number_of_real_roots(); for(int i=0; i(P); - assert( n == number_of_roots); + assert( n == number_of_roots); }{ //std::cout << "Kameny 3\n"; // from http://www-sop.inria.fr/saga/POL/BASE/1.unipol - + NT c = CGAL::ipower(NT(10),12); Polynomial P(NT(-3),NT(0),c); P = P*P; // (c^2x^2-3)^2 @@ -198,42 +198,42 @@ void test_real_root_isolator() { Q = Q*Q; // x^8 Q = Q*Polynomial(NT(0),c);//c^2x^9 P = P+Q; - + assert(3 == internal::check_intervals_real_root_isolator(P)); }{ //std::cout << "Kameny 4\n"; // from http://www-sop.inria.fr/saga/POL/BASE/1.unipol - + NT z(0); NT a = CGAL::ipower(NT(10),24); // a = 10^{24} - - Polynomial P(z,NT(4),CGAL::ipower(a,2),z,z,2*a,z,z,NT(1)); - // x^8+2*10^{24}*x^5+10^{48}*x^2+4*x + + Polynomial P(z,NT(4),CGAL::ipower(a,2),z,z,2*a,z,z,NT(1)); + // x^8+2*10^{24}*x^5+10^{48}*x^2+4*x P = P * Polynomial(z,z,z,z,z,z,NT(1)); // x^{14}+2*10^{24}*x^{11}+10^{48}*x^8+4*x^7 P = P + Polynomial(NT(4),z,z,z,-4*a); // x^{14}+2*10^{24}*x^{11}+10^{48}*x^8+4*x^7-4*10^{24}*X^4+4 - + Isolator isol(P); assert( 4 == internal::check_intervals_real_root_isolator(P)); }{ //std::cout << "Polynomial with large and small clustered roots\n"; // from http://www-sop.inria.fr/saga/POL/BASE/1.unipol // there seems to be some error or misunderstanding - + NT z(0); NT a = CGAL::ipower(NT(10),20); // a = 10^{20} - + Polynomial P(z,z,z,z,z,z,z,z,NT(1)); //x^8 P = P*Polynomial(z,z,z,z,NT(1)); // x^{12} Polynomial R(NT(-1),a); // ax-1 R = R*R; R = R*R; // (ax-1)^4 P = P-R; // x^{12} - (ax-1)^4 - + assert( 4 == internal::check_intervals_real_root_isolator(P)); } - + } } //namespace internal diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_converter.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_converter.h index 02a5c9f73701..4f4578b8c669 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_converter.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_converter.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion, Constantinos Tsirogiannis // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_CONVERTER_H @@ -29,32 +29,32 @@ namespace CGAL { // - FT converter ? template < class Al_K1, class Al_K2, - class RT_converter = NT_converter, - class Root_of_converter = NT_converter > + class Root_of_converter = NT_converter > class Algebraic_kernel_converter { public: - typedef typename Al_K1::RT RT_1; - typedef typename Al_K2::RT RT_2; - typedef RT_converter RT_type_converter; - typedef Root_of_converter Root_of_type_converter; + typedef typename Al_K1::RT RT_1; + typedef typename Al_K2::RT RT_2; + typedef RT_converter RT_type_converter; + typedef Root_of_converter Root_of_type_converter; - typename Al_K2::Polynomial_1_2 operator () (const typename Al_K1::Polynomial_1_2 &p) const - { - return typename Al_K2::Polynomial_1_2(RT_converter()(p.a()), + typename Al_K2::Polynomial_1_2 operator () (const typename Al_K1::Polynomial_1_2 &p) const + { + return typename Al_K2::Polynomial_1_2(RT_converter()(p.a()), RT_converter()(p.b()), - RT_converter()(p.c())); - } + RT_converter()(p.c())); + } - typename Al_K2::Polynomial_for_circles_2_2 operator () - (const typename Al_K1::Polynomial_for_circles_2_2 &p) const - { - return typename Al_K2::Polynomial_for_circles_2_2(RT_converter()(p.a()), + typename Al_K2::Polynomial_for_circles_2_2 operator () + (const typename Al_K1::Polynomial_for_circles_2_2 &p) const + { + return typename Al_K2::Polynomial_for_circles_2_2(RT_converter()(p.a()), RT_converter()(p.b()), - RT_converter()(p.r_sq())); - } + RT_converter()(p.r_sq())); + } }; } //namespace CGAL diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/function_objects_on_roots_and_polynomials_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/function_objects_on_roots_and_polynomials_2_2.h index 16944f78e179..489803e770e2 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/function_objects_on_roots_and_polynomials_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/function_objects_on_roots_and_polynomials_2_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTION_OBJECTS_ON_ROOTS_AND_POLYNOMIALS_2_H @@ -28,7 +28,7 @@ namespace CGAL { namespace AlgebraicFunctors { - + template < class AK > class Solve { @@ -36,35 +36,35 @@ namespace AlgebraicFunctors { typedef typename AK::Polynomial_1_2 Equation_Line; public: - typedef void result_type; + typedef void result_type; template < class OutputIterator > OutputIterator - operator()(const Equation_Circle & e1, - const Equation_Circle & e2, - OutputIterator res) const + operator()(const Equation_Circle & e1, + const Equation_Circle & e2, + OutputIterator res) const { return AlgebraicFunctors::solve ( e1, e2, res); } - + template < class OutputIterator > OutputIterator - operator()(const Equation_Line & e1, - const Equation_Circle & e2, - OutputIterator res) const + operator()(const Equation_Line & e1, + const Equation_Circle & e2, + OutputIterator res) const { return AlgebraicFunctors::solve ( e1, e2, res); } - + template < class OutputIterator > OutputIterator - operator()(const Equation_Circle & e1, - const Equation_Line & e2, - OutputIterator res) const + operator()(const Equation_Circle & e1, + const Equation_Line & e2, + OutputIterator res) const { return AlgebraicFunctors::solve ( e1, e2, res); } template < class OutputIterator > OutputIterator - operator()(const Equation_Line & e1, - const Equation_Line & e2, - OutputIterator res) const + operator()(const Equation_Line & e1, + const Equation_Line & e2, + OutputIterator res) const { return AlgebraicFunctors::solve ( e1, e2, res); } }; @@ -74,9 +74,9 @@ namespace AlgebraicFunctors { { typedef typename AK::RT RT; typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; - + public: - + typedef Polynomial_for_circles_2_2 result_type; result_type @@ -90,9 +90,9 @@ namespace AlgebraicFunctors { { typedef typename AK::RT RT; typedef typename AK::Polynomial_1_2 Polynomial_1_2; - + public: - + typedef Polynomial_1_2 result_type; result_type @@ -103,7 +103,7 @@ namespace AlgebraicFunctors { template < class AK > class Sign_at - { + { typedef typename AK::Polynomial_1_2 Polynomial_1_2; typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; @@ -113,19 +113,19 @@ namespace AlgebraicFunctors { result_type operator()( const Polynomial_for_circles_2_2 & equation, - const Root_for_circles_2_2 & r ) const + const Root_for_circles_2_2 & r ) const { return AlgebraicFunctors::sign_at(equation, r); } result_type operator()( const Polynomial_1_2 & equation, - const Root_for_circles_2_2 & r ) const + const Root_for_circles_2_2 & r ) const { return AlgebraicFunctors::sign_at(equation, r); } }; - + template < class AK > class X_critical_points - { + { typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; @@ -133,21 +133,21 @@ namespace AlgebraicFunctors { typedef void result_type; Root_for_circles_2_2 - operator()(const Polynomial_for_circles_2_2 & c, - bool i) const + operator()(const Polynomial_for_circles_2_2 & c, + bool i) const { return AlgebraicFunctors::x_critical_point(c,i); } template OutputIterator - operator()(const Polynomial_for_circles_2_2 & c, - OutputIterator res) const + operator()(const Polynomial_for_circles_2_2 & c, + OutputIterator res) const { return AlgebraicFunctors::x_critical_points(c,res); } }; template < class AK > class Y_critical_points - { + { typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; @@ -155,14 +155,14 @@ namespace AlgebraicFunctors { typedef void result_type; Root_for_circles_2_2 - operator()(const Polynomial_for_circles_2_2 & c, - bool i) const + operator()(const Polynomial_for_circles_2_2 & c, + bool i) const { return AlgebraicFunctors::y_critical_point(c,i); } template OutputIterator - operator()(const Polynomial_for_circles_2_2 & c, - OutputIterator res) const + operator()(const Polynomial_for_circles_2_2 & c, + OutputIterator res) const { return AlgebraicFunctors::y_critical_points(c,res); } }; @@ -177,8 +177,8 @@ namespace AlgebraicFunctors { typedef CGAL::Comparison_result result_type; result_type - operator()(const Root_for_circles_2_2& r1, - const Root_for_circles_2_2& r2) const + operator()(const Root_for_circles_2_2& r1, + const Root_for_circles_2_2& r2) const { return AlgebraicFunctors::compare_x(r1, r2); } }; @@ -188,13 +188,13 @@ namespace AlgebraicFunctors { { typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; typedef typename AK::RT RT; - + public: typedef CGAL::Comparison_result result_type; result_type - operator()(const Root_for_circles_2_2& r1, - const Root_for_circles_2_2& r2) const + operator()(const Root_for_circles_2_2& r1, + const Root_for_circles_2_2& r2) const { return AlgebraicFunctors::compare_y(r1, r2); } }; @@ -209,8 +209,8 @@ namespace AlgebraicFunctors { typedef CGAL::Comparison_result result_type; result_type - operator()(const Root_for_circles_2_2& r1, - const Root_for_circles_2_2& r2) const + operator()(const Root_for_circles_2_2& r1, + const Root_for_circles_2_2& r2) const { return AlgebraicFunctors::compare_xy(r1, r2); } }; diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_comparison_root_for_circles_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_comparison_root_for_circles_2_2.h index 99c3bb669f1d..f33f0b3ad76b 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_comparison_root_for_circles_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_comparison_root_for_circles_2_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion, Julien Hazebrouck // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_COMPARISON_ROOT_FOR_CIRCLES_2_2_H @@ -24,25 +24,25 @@ namespace CGAL { namespace AlgebraicFunctors{ - + template - Comparison_result + Comparison_result compare_x(const CGAL::Root_for_circles_2_2& r1, const CGAL::Root_for_circles_2_2& r2){ return compare(r1.x(), r2.x()); } - + template - Comparison_result + Comparison_result compare_y(const CGAL::Root_for_circles_2_2& r1, const CGAL::Root_for_circles_2_2& r2){ return compare(r1.y(), r2.y()); } - + template Comparison_result compare_xy(const CGAL::Root_for_circles_2_2& r1, const CGAL::Root_for_circles_2_2& r2){ Comparison_result compx = compare_x(r1, r2); if(compx != 0) - return compx; + return compx; return compare_y(r1, r2); } diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomial_1_2_and_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomial_1_2_and_2_2.h index b07592c6e5be..7adb42528674 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomial_1_2_and_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomial_1_2_and_2_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion, Julien Hazebrouck // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTIONS_ON_ROOTS_AND_POLYNOMIAL_1_2_AND_2_2_H @@ -27,63 +27,63 @@ namespace CGAL { template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomial_1_2 & e1, - const typename AK::Polynomial_for_circles_2_2 & e2, - OutputIterator res ) + const typename AK::Polynomial_for_circles_2_2 & e2, + OutputIterator res ) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; if (is_zero(e1.a())){//horizontal line - + const FT hy = -e1.c()/e1.b(); const FT hdisc = e2.r_sq() - CGAL::square(hy - e2.b()); CGAL::Sign sign_hdisc = CGAL::sign(hdisc); - + if(sign_hdisc == NEGATIVE) return res; - if(sign_hdisc == ZERO) { - *res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(e2.a()), + if(sign_hdisc == ZERO) { + *res++ = std::make_pair + ( Root_for_circles_2_2(Root_of_2(e2.a()), Root_of_2(hy)), 2u); - return res; + return res; } const Root_of_2 x_res1 = make_root_of_2(e2.a(),FT(-1),hdisc); const Root_of_2 x_res2 = make_root_of_2(e2.a(),FT(1),hdisc); - const Root_of_2 y_res = Root_of_2(hy); + const Root_of_2 y_res = Root_of_2(hy); *res++ = std::make_pair - ( Root_for_circles_2_2(x_res1, y_res), 1u); + ( Root_for_circles_2_2(x_res1, y_res), 1u); *res++ = std::make_pair - ( Root_for_circles_2_2(x_res2, y_res), 1u); + ( Root_for_circles_2_2(x_res2, y_res), 1u); return res; } else if(is_zero(e1.b())){//vertical line - + const FT vx = -e1.c()/e1.a(); const FT vdisc = e2.r_sq() - CGAL::square(vx - e2.a()); CGAL::Sign sign_vdisc = CGAL::sign(vdisc); if(sign_vdisc == NEGATIVE) return res; if(sign_vdisc == ZERO) { - *res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(vx), + *res++ = std::make_pair + ( Root_for_circles_2_2(Root_of_2(vx), Root_of_2(e2.b())), 2u); - return res; + return res; } - - const Root_of_2 x_res = Root_of_2(vx); + + const Root_of_2 x_res = Root_of_2(vx); const Root_of_2 y_res1 = make_root_of_2(e2.b(),FT(-1),vdisc); const Root_of_2 y_res2 = make_root_of_2(e2.b(),FT(1),vdisc); *res++ = std::make_pair - ( Root_for_circles_2_2(x_res, y_res1), 1u); + ( Root_for_circles_2_2(x_res, y_res1), 1u); *res++ = std::make_pair - ( Root_for_circles_2_2(x_res, y_res2), 1u); + ( Root_for_circles_2_2(x_res, y_res2), 1u); return res; } else { - + const FT line_factor = CGAL::square(e1.a()) + CGAL::square(e1.b()); const FT disc = line_factor*e2.r_sq() - CGAL::square(e1.a()*e2.a() + e1.b()*e2.b() + e1.c()); @@ -97,28 +97,28 @@ namespace CGAL { if (sign_disc == ZERO) { *res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + ( Root_for_circles_2_2(Root_of_2(x_base), Root_of_2(y_base)), 2u); - return res; + return res; } - // We have two intersection points, whose coordinates are one-root numbers. + // We have two intersection points, whose coordinates are one-root numbers. const FT x_root_coeff = e1.b() / line_factor; const FT y_root_coeff = e1.a() / line_factor; if (CGAL::sign(e1.b()) == POSITIVE) { *res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), make_root_of_2(y_base, y_root_coeff, disc)), 1u); *res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), make_root_of_2(y_base, -y_root_coeff, disc)), 1u); } else { *res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), make_root_of_2(y_base, -y_root_coeff, disc)), 1u); *res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), make_root_of_2(y_base, y_root_coeff, disc)), 1u); } return res; @@ -126,21 +126,21 @@ namespace CGAL { } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomial_for_circles_2_2 & e1, - const typename AK::Polynomial_1_2 & e2, - OutputIterator res ) + const typename AK::Polynomial_1_2 & e2, + OutputIterator res ) { return solve (e2, e1, res); } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomial_1_2 & e1, - const typename AK::Polynomial_1_2 & e2, - OutputIterator res ) + const typename AK::Polynomial_1_2 & e2, + OutputIterator res ) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; @@ -152,24 +152,24 @@ namespace CGAL { if(is_zero(e2.a())){ const FT sol = -e2.c()/e2.b(); *res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(-(e1.b()*sol + e1.c())/e1.a()), + ( Root_for_circles_2_2(Root_of_2(-(e1.b()*sol + e1.c())/e1.a()), Root_of_2(sol)), 1u); return res; } //general case - const FT sol = (e2.a()*e1.c() - e2.c()*e1.a()) / delta; + const FT sol = (e2.a()*e1.c() - e2.c()*e1.a()) / delta; *res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(-(e2.b()*sol + e2.c())/e2.a()), + ( Root_for_circles_2_2(Root_of_2(-(e2.b()*sol + e2.c())/e2.a()), Root_of_2(sol)), 1u); return res; } template < class AK > - inline + inline Sign sign_at( const typename AK::Polynomial_1_2 & equation, - const typename AK::Root_for_circles_2_2 & r) + const typename AK::Root_for_circles_2_2 & r) { - Comparison_result c = compare(r.x()*equation.a(), + Comparison_result c = compare(r.x()*equation.a(), -equation.c() - r.y()*equation.b()); if(c == EQUAL) return ZERO; if(c == LARGER) return POSITIVE; @@ -177,7 +177,7 @@ namespace CGAL { } - + } // namespace AlgebraicFunctors } // namespace CGAL diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h index cf4ab274731b..8068dc01bb25 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h @@ -30,8 +30,8 @@ namespace CGAL { inline OutputIterator solve( const typename AK::Polynomial_for_circles_2_2 & e1, - const typename AK::Polynomial_for_circles_2_2 & e2, - OutputIterator res ) + const typename AK::Polynomial_for_circles_2_2 & e2, + OutputIterator res ) { CGAL_precondition( ! (e1 == e2) ); // polynomials of this type cannot be multiple // of one another if they are not equal @@ -59,9 +59,9 @@ namespace CGAL { // one double root, // no need to care about the boolean of the Root_of *res++ = std::make_pair - ( Root_for_circles_2_2 - (Root_of_2(x_base), Root_of_2(y_base)), - static_cast(2) ); // multiplicity = 2 + ( Root_for_circles_2_2 + (Root_of_2(x_base), Root_of_2(y_base)), + static_cast(2) ); // multiplicity = 2 return res; } @@ -73,24 +73,24 @@ namespace CGAL { const FT y_root_coeff = dx / (2 * dist2); if(sign_dx == NEGATIVE) { * res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); * res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, -y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); } else { * res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, -y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); * res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); } return res; } @@ -99,24 +99,24 @@ namespace CGAL { const FT x_root_coeff = dy / (2 * dist2); if(sign_dy == POSITIVE) { * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), Root_of_2(y_base)), - static_cast(1) ); + static_cast(1) ); * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), Root_of_2(y_base)), - static_cast(1) ); + static_cast(1) ); } else { * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), Root_of_2(y_base)), - static_cast(1) ); + static_cast(1) ); * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), Root_of_2(y_base)), - static_cast(1) ); + static_cast(1) ); } return res; } @@ -128,21 +128,21 @@ namespace CGAL { * res++ = std::make_pair ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), make_root_of_2(y_base, y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); * res++ = std::make_pair ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), make_root_of_2(y_base, -y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); } else { * res++ = std::make_pair ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), make_root_of_2(y_base, -y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); * res++ = std::make_pair ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), make_root_of_2(y_base, y_root_coeff, disc)), - static_cast(1) ); + static_cast(1) ); } return res; @@ -151,7 +151,7 @@ namespace CGAL { template < class AK > inline Sign sign_at( const typename AK::Polynomial_for_circles_2_2 & equation, - const typename AK::Root_for_circles_2_2 & r) + const typename AK::Root_for_circles_2_2 & r) { Comparison_result c = compare(square(r.x() - equation.a()), equation.r_sq() - @@ -165,7 +165,7 @@ namespace CGAL { template typename AK::Root_for_circles_2_2 x_critical_point(const typename AK::Polynomial_for_circles_2_2 & c, - bool i) + bool i) { typedef typename AK::Root_of_2 Root_of_2; typedef typename AK::FT FT; @@ -178,7 +178,7 @@ namespace CGAL { template OutputIterator x_critical_points(const typename AK::Polynomial_for_circles_2_2 & c, - OutputIterator res) + OutputIterator res) { typedef typename AK::FT FT; typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; @@ -194,7 +194,7 @@ namespace CGAL { template typename AK::Root_for_circles_2_2 y_critical_point(const typename AK::Polynomial_for_circles_2_2 &c, - bool i) + bool i) { typedef typename AK::Root_of_2 Root_of_2; typedef typename AK::FT FT; @@ -207,7 +207,7 @@ namespace CGAL { template OutputIterator y_critical_points(const typename AK::Polynomial_for_circles_2_2 & c, - OutputIterator res) + OutputIterator res) { typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h index a0fcdd53d3c7..08a55cbbed27 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_2_2_H @@ -39,8 +39,8 @@ namespace CGAL { typedef RT_ RT; typedef typename Root_of_traits< RT >::RootOf_1 FT; - typedef CGAL::Polynomial_1_2 Polynomial_1_2; - typedef CGAL::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; + typedef CGAL::Polynomial_1_2 Polynomial_1_2; + typedef CGAL::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; // problem RT / FT ? typedef typename Root_of_traits< RT >::RootOf_2 Root_of_2; @@ -81,10 +81,10 @@ namespace CGAL { Compare_x compare_x_object() const { return Compare_x(); } - + Compare_y compare_y_object() const { return Compare_y(); } - + Compare_xy compare_xy_object() const { return Compare_xy(); } diff --git a/Algebraic_kernel_for_circles/include/CGAL/Polynomials_1_2.h b/Algebraic_kernel_for_circles/include/CGAL/Polynomials_1_2.h index 2f30bedae4d3..5aa5884aac63 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Polynomials_1_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Polynomials_1_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_POLYNOMIALS_1_2_H @@ -29,15 +29,15 @@ template < typename RT_ > class Polynomial_1_2 { RT_ rep[3]; // stores a, b, c for line ax+by+c=0 - + public: - + typedef RT_ RT; - + Polynomial_1_2(){} - + Polynomial_1_2(const RT & a, const RT & b, const RT & c) - { + { rep[0]=a; rep[1]=b; rep[2]=c; @@ -54,15 +54,15 @@ class Polynomial_1_2 }; template < typename RT > -bool +bool operator == ( const Polynomial_1_2 & p1, - const Polynomial_1_2 & p2 ) + const Polynomial_1_2 & p2 ) { - return( (p1.a() == p2.a()) && + return( (p1.a() == p2.a()) && (p1.b() == p2.b()) && (p1.c() == p2.c()) ); } - + } //namespace CGAL #endif //CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_POLYNOMIALS_1_2_H diff --git a/Algebraic_kernel_for_circles/include/CGAL/Polynomials_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Polynomials_2_2.h index 05cd319249e6..80e646560626 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Polynomials_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Polynomials_2_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_POLYNOMIALS_2_2_H @@ -32,15 +32,15 @@ template < typename FT_ > class Polynomial_for_circles_2_2 { FT_ rep[3]; // stores a, b, R^2 - + public: - + typedef FT_ FT; - + Polynomial_for_circles_2_2(){} - + Polynomial_for_circles_2_2(const FT & a, const FT & b, const FT & rsq) - { + { rep[0]=a; rep[1]=b; rep[2]=rsq; @@ -51,17 +51,17 @@ class Polynomial_for_circles_2_2 const FT & b() const { return rep[1]; } - + const FT & r_sq() const { return rep[2]; } }; template < typename FT > -bool +bool operator == ( const Polynomial_for_circles_2_2 & p1, - const Polynomial_for_circles_2_2 & p2 ) + const Polynomial_for_circles_2_2 & p2 ) { - return( (p1.a() == p2.a()) && + return( (p1.a() == p2.a()) && (p1.b() == p2.b()) && (p1.r_sq() == p2.r_sq()) ); } diff --git a/Algebraic_kernel_for_circles/include/CGAL/Root_for_circles_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Root_for_circles_2_2.h index 82829222c5f1..bb2b92d350d1 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Root_for_circles_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Root_for_circles_2_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_ROOT_FOR_CIRCLES_2_2_H @@ -39,46 +39,46 @@ class Root_for_circles_2_2 { private: Handle_for x_; Handle_for y_; - + public: Root_for_circles_2_2(){} - + Root_for_circles_2_2(const Root_of_2& r1, const Root_of_2& r2) : x_(r1), y_(r2) { // When it is an interval this assertion dont compile - //CGAL_assertion((r1.is_rational() || r2.is_rational()) || + //CGAL_assertion((r1.is_rational() || r2.is_rational()) || // (r1.gamma() == r2.gamma())); } - const Root_of_2& x() const + const Root_of_2& x() const { return get_pointee_or_identity(x_); } - - const Root_of_2& y() const + + const Root_of_2& y() const { return get_pointee_or_identity(y_); } CGAL::Bbox_2 bbox() const { - CGAL::Interval_nt<> + CGAL::Interval_nt<> ix=to_interval(x()), iy=to_interval(y()); return CGAL::Bbox_2(ix.inf(),iy.inf(), - ix.sup(),iy.sup()); + ix.sup(),iy.sup()); /* const Root_of_2 &ox = x(); const Root_of_2 &oy = y(); if(ox.is_rational() || oy.is_rational()) { - CGAL::Interval_nt<> + CGAL::Interval_nt<> ix=to_interval(ox), iy=to_interval(oy); return CGAL::Bbox_2(ix.inf(),iy.inf(), - ix.sup(),iy.sup()); + ix.sup(),iy.sup()); } // delta must be the same // WE HAVE TO TEST THE EXECUTION TIME - // IT STILL NOT POSSIBLE BECAUSE OF THE + // IT STILL NOT POSSIBLE BECAUSE OF THE // PROBLEM ON THE ARRANGEMENT // (it is very likely to make it better with this changing) const CGAL::Interval_nt alpha1 = to_interval(ox.alpha()); @@ -90,23 +90,23 @@ class Root_for_circles_2_2 { const CGAL::Interval_nt ix = alpha1 + beta1 * sqrtg; const CGAL::Interval_nt iy = alpha2 + beta2 * sqrtg; return CGAL::Bbox_2(ix.inf(),iy.inf(), - ix.sup(),iy.sup()); + ix.sup(),iy.sup()); */ } template < typename RT > friend bool operator == ( const Root_for_circles_2_2& r1, - const Root_for_circles_2_2& r2 ); + const Root_for_circles_2_2& r2 ); }; - + template < typename RT > -bool +bool operator == ( const Root_for_circles_2_2& r1, - const Root_for_circles_2_2& r2 ) + const Root_for_circles_2_2& r2 ) { if (CGAL::identical(r1.x_, r2.x_) && CGAL::identical(r1.y_, r2.y_)) - return true; - return (r1.x() == r2.x()) && (r1.y() == r2.y()); + return true; + return (r1.x() == r2.x()) && (r1.y() == r2.y()); } template < typename RT > @@ -120,7 +120,7 @@ operator>>(std::istream & is, Root_for_circles_2_2 &r) { typedef typename Root_of_traits< RT >::RootOf_2 Root_of_2; Root_of_2 x,y; - + is >> x >> y; if(is) r = Root_for_circles_2_2(x,y); diff --git a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt index f3b3894ae76e..c02ce4ff14d9 100644 --- a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt +++ b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_constructor.h b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_constructor.h index 6de9d7b58de5..8510d3fb6963 100644 --- a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_constructor.h +++ b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_constructor.h @@ -14,7 +14,7 @@ void _test_constuctor(AK ak) ak.construct_polynomial_for_circles_2_2_object(); typename AK::Construct_polynomial_1_2 theConstruct_1_2 = ak.construct_polynomial_1_2_object(); - + for(int i = 0; i < 20 ; i++){ int x = theRandom.get_int(random_min,random_max); int y = theRandom.get_int(random_min,random_max); @@ -22,7 +22,7 @@ void _test_constuctor(AK ak) int a = theRandom.get_int(random_min,random_max); int b = theRandom.get_int(random_min,random_max); int c = theRandom.get_int(random_min,random_max); - + typename AK::Polynomial_for_circles_2_2 p_2_2 = theConstruct_2_2(x, y, r_sq); typename AK::Polynomial_1_2 p_1_2 = theConstruct_1_2(a, b, c); assert(p_2_2.a() == x); @@ -32,5 +32,5 @@ void _test_constuctor(AK ak) assert(p_1_2.b() == b); assert(p_1_2.c() == c); } - + } diff --git a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_predicates.h b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_predicates.h index 319f01accff7..211882addc93 100644 --- a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_predicates.h +++ b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/include/CGAL/_test_predicates.h @@ -14,46 +14,46 @@ void _test_solve(AK ak) std::vector< std::pair > res1; theSolve(theConstruct_2_2(5, 5, 25), - theConstruct_2_2(0, 5, 100), - std::back_inserter(res1)); + theConstruct_2_2(0, 5, 100), + std::back_inserter(res1)); assert(res1.size() == 1); assert(res1[0].second == 2u); assert(res1[0].first == Root_for_circles_2_2(10, 5)); std::vector< std::pair > res2; theSolve(theConstruct_2_2(-5, 5, 25), - theConstruct_2_2(0, 5, 100), - std::back_inserter(res2)); + theConstruct_2_2(0, 5, 100), + std::back_inserter(res2)); assert(res2.size() == 1); assert(res2[0].second == 2u); assert(res2[0].first == Root_for_circles_2_2(-10, 5)); std::vector< std::pair > res3; theSolve(theConstruct_2_2(0, 5, 25), - theConstruct_2_2(0, 0, 100), - std::back_inserter(res3)); + theConstruct_2_2(0, 0, 100), + std::back_inserter(res3)); assert(res3.size() == 1); assert(res3[0].second == 2u); assert(res3[0].first == Root_for_circles_2_2(0, 10)); - + std::vector< std::pair > res4; theSolve(theConstruct_2_2(0, -5, 25), - theConstruct_2_2(0, 0, 100), - std::back_inserter(res4)); + theConstruct_2_2(0, 0, 100), + std::back_inserter(res4)); assert(res4.size() == 1); assert(res4[0].second == 2u); assert(res4[0].first == Root_for_circles_2_2(0, -10)); - + std::vector< std::pair > res5; theSolve(theConstruct_2_2(-5, 5, 25), - theConstruct_2_2(0, 0, 25), - std::back_inserter(res5)); + theConstruct_2_2(0, 0, 25), + std::back_inserter(res5)); assert(res5.size() == 2); assert(res5[0].second == 1u); assert(res5[0].first == Root_for_circles_2_2(-5, 0)); assert(res5[1].second == 1u); assert(res5[1].first == Root_for_circles_2_2(0, 5)); - + //Polynomial_1_2 Polynomial_for_circles_2_2 typename AK::Construct_polynomial_1_2 theConstruct_1_2 = ak.construct_polynomial_1_2_object(); @@ -61,8 +61,8 @@ void _test_solve(AK ak) //line horizontal in circle's center std::vector< std::pair > res6; theSolve(theConstruct_1_2(0, 1, -5), - theConstruct_2_2(0, 5, 100), - std::back_inserter(res6)); + theConstruct_2_2(0, 5, 100), + std::back_inserter(res6)); assert(res6.size() == 2); assert(res6[0].second == 1u); assert(res6[0].first == Root_for_circles_2_2(-10, 5)); @@ -72,8 +72,8 @@ void _test_solve(AK ak) //line vertical in circle's center std::vector< std::pair > res7; theSolve(theConstruct_1_2(1, 0, -5), - theConstruct_2_2(5, 5, 100), - std::back_inserter(res7)); + theConstruct_2_2(5, 5, 100), + std::back_inserter(res7)); assert(res7.size() == 2); assert(res7[0].second == 1u); assert(res7[0].first == Root_for_circles_2_2(5, -5)); @@ -83,8 +83,8 @@ void _test_solve(AK ak) //line vertical tangent left std::vector< std::pair > res8; theSolve(theConstruct_1_2(1, 0, 5), - theConstruct_2_2(5, 5, 100), - std::back_inserter(res8)); + theConstruct_2_2(5, 5, 100), + std::back_inserter(res8)); assert(res8.size() == 1); assert(res8[0].second == 2u); assert(res8[0].first == Root_for_circles_2_2(-5, 5)); @@ -92,8 +92,8 @@ void _test_solve(AK ak) //line vertical tangent right std::vector< std::pair > res9; theSolve(theConstruct_1_2(1, 0, -15), - theConstruct_2_2(5, 5, 100), - std::back_inserter(res9)); + theConstruct_2_2(5, 5, 100), + std::back_inserter(res9)); assert(res9.size() == 1); assert(res9[0].second == 2u); assert(res9[0].first == Root_for_circles_2_2(15, 5)); @@ -101,17 +101,17 @@ void _test_solve(AK ak) //line horizontal tangent on top std::vector< std::pair > res10; theSolve(theConstruct_1_2(0, 1, -15), - theConstruct_2_2(5, 5, 100), - std::back_inserter(res10)); + theConstruct_2_2(5, 5, 100), + std::back_inserter(res10)); assert(res10.size() == 1); assert(res10[0].second == 2u); assert(res10[0].first == Root_for_circles_2_2(5, 15)); - + //line horizontal tangent down std::vector< std::pair > res11; theSolve(theConstruct_1_2(0, 1, 5), - theConstruct_2_2(5, 5, 100), - std::back_inserter(res11)); + theConstruct_2_2(5, 5, 100), + std::back_inserter(res11)); assert(res11.size() == 1); assert(res11[0].second == 2u); assert(res11[0].first == Root_for_circles_2_2(5, -5)); @@ -120,95 +120,95 @@ void _test_solve(AK ak) // only Polynomial_1_2 std::vector< std::pair > res12; theSolve(theConstruct_1_2(1, 1, -5), - theConstruct_1_2(1, -1, 5), - std::back_inserter(res12)); + theConstruct_1_2(1, -1, 5), + std::back_inserter(res12)); assert(res12.size() == 1); assert(res12[0].second == 1u); assert(res12[0].first == Root_for_circles_2_2(0, 5)); - + std::vector< std::pair > res13; theSolve(theConstruct_1_2(0, 1, -5), - theConstruct_1_2(1, -1, 5), - std::back_inserter(res13)); + theConstruct_1_2(1, -1, 5), + std::back_inserter(res13)); assert(res13.size() == 1); assert(res13[0].second == 1u); assert(res13[0].first == Root_for_circles_2_2(0, 5)); std::vector< std::pair > res14; theSolve(theConstruct_1_2(1, -1, 5), - theConstruct_1_2(0, 1, -5), - std::back_inserter(res14)); + theConstruct_1_2(0, 1, -5), + std::back_inserter(res14)); assert(res14.size() == 1); assert(res14[0].second == 1u); assert(res14[0].first == Root_for_circles_2_2(0, 5)); std::vector< std::pair > res15; theSolve(theConstruct_1_2(1, 0, 0), - theConstruct_1_2(1, -1, 5), - std::back_inserter(res15)); + theConstruct_1_2(1, -1, 5), + std::back_inserter(res15)); assert(res15.size() == 1); assert(res15[0].second == 1u); assert(res15[0].first == Root_for_circles_2_2(0, 5)); std::vector< std::pair > res16; theSolve(theConstruct_1_2(1, -1, 5), - theConstruct_1_2(1, 0, 0), - std::back_inserter(res16)); + theConstruct_1_2(1, 0, 0), + std::back_inserter(res16)); assert(res16.size() == 1); assert(res16[0].second == 1u); assert(res16[0].first == Root_for_circles_2_2(0, 5)); std::vector< std::pair > res17; theSolve(theConstruct_1_2(0, 1, -5), - theConstruct_1_2(1, 0, 0), - std::back_inserter(res17)); + theConstruct_1_2(1, 0, 0), + std::back_inserter(res17)); assert(res17.size() == 1); assert(res17[0].second == 1u); assert(res17[0].first == Root_for_circles_2_2(0, 5)); std::vector< std::pair > res18; theSolve(theConstruct_1_2(1, 0, 0), - theConstruct_1_2(0, 1, -5), - std::back_inserter(res18)); + theConstruct_1_2(0, 1, -5), + std::back_inserter(res18)); assert(res18.size() == 1); assert(res18[0].second == 1u); assert(res18[0].first == Root_for_circles_2_2(0, 5)); std::vector< std::pair > res19; theSolve(theConstruct_1_2(1, 0, 0), - theConstruct_1_2(1, 0, 0), - std::back_inserter(res19)); + theConstruct_1_2(1, 0, 0), + std::back_inserter(res19)); assert(res19.size() == 0); std::vector< std::pair > res20; theSolve(theConstruct_1_2(1, 0, 0), - theConstruct_1_2(1, 0, 5), - std::back_inserter(res20)); + theConstruct_1_2(1, 0, 5), + std::back_inserter(res20)); assert(res20.size() == 0); - - + + std::vector< std::pair > res21; theSolve(theConstruct_1_2(0, 1, -5), - theConstruct_1_2(0, 1, -5), - std::back_inserter(res21)); + theConstruct_1_2(0, 1, -5), + std::back_inserter(res21)); assert(res21.size() == 0); std::vector< std::pair > res22; theSolve(theConstruct_1_2(0, 1, -5), - theConstruct_1_2(0, 1, 0), - std::back_inserter(res22)); + theConstruct_1_2(0, 1, 0), + std::back_inserter(res22)); assert(res22.size() == 0); - + std::vector< std::pair > res23; theSolve(theConstruct_1_2(1, -1, 5), - theConstruct_1_2(1, -1, 5), - std::back_inserter(res23)); + theConstruct_1_2(1, -1, 5), + std::back_inserter(res23)); assert(res23.size() == 0); std::vector< std::pair > res24; theSolve(theConstruct_1_2(1, -1, 5), - theConstruct_1_2(2, -2, 15), - std::back_inserter(res24)); + theConstruct_1_2(2, -2, 15), + std::back_inserter(res24)); assert(res24.size() == 0); CGAL::Random generatorOfgenerator; @@ -220,7 +220,7 @@ void _test_solve(AK ak) typename AK::Sign_at theSigh_at = ak.sign_at_object(); - + for(std::size_t i = 0; i < 500; i++){ int a1, b1, c1, a2, b2, c2, a3, b3, r_sq = 0; do{ @@ -236,45 +236,45 @@ void _test_solve(AK ak) a3 = theRandom.get_int(random_min,random_max); b3 = theRandom.get_int(random_min,random_max); r_sq = theRandom.get_int(1,random_max); - + std::vector< std::pair > res; theSolve(theConstruct_1_2(a1, b1, c1), - theConstruct_1_2(a2, b2, c2), - std::back_inserter(res)); + theConstruct_1_2(a2, b2, c2), + std::back_inserter(res)); std::vector< std::pair > res2; theSolve(theConstruct_1_2(a2, b2, c2), - theConstruct_2_2(a3, b3, r_sq), - std::back_inserter(res2)); + theConstruct_2_2(a3, b3, r_sq), + std::back_inserter(res2)); std::vector< std::pair > res3; theSolve(theConstruct_1_2(a1, b1, c1), - theConstruct_2_2(a3, b3, r_sq), - std::back_inserter(res3)); + theConstruct_2_2(a3, b3, r_sq), + std::back_inserter(res3)); for (std::size_t j = 0 ; j < res.size() ; j++){ assert(res[j].second == 1u); assert(theSigh_at(theConstruct_1_2(a1, b1, c1), - res[j].first) == CGAL::ZERO); + res[j].first) == CGAL::ZERO); assert(theSigh_at(theConstruct_1_2(a2, b2, c2), - res[j].first) == CGAL::ZERO); + res[j].first) == CGAL::ZERO); } for (std::size_t j = 0 ; j < res2.size() ; j++){ if(res2.size() == 1) assert(res2[j].second == 2u); if(res2.size() == 2) assert(res2[j].second == 1u); assert(theSigh_at(theConstruct_2_2(a3, b3, r_sq), - res2[j].first) == CGAL::ZERO); + res2[j].first) == CGAL::ZERO); assert(theSigh_at(theConstruct_1_2(a2, b2, c2), - res2[j].first) == CGAL::ZERO); + res2[j].first) == CGAL::ZERO); } for (std::size_t j = 0 ; j < res3.size() ; j++){ if(res3.size() == 1) assert(res3[j].second == 2u); if(res3.size() == 2) assert(res3[j].second == 1u); assert(theSigh_at(theConstruct_2_2(a3, b3, r_sq), - res3[j].first) == CGAL::ZERO); + res3[j].first) == CGAL::ZERO); assert(theSigh_at(theConstruct_1_2(a1, b1, c1), - res3[j].first) == CGAL::ZERO); + res3[j].first) == CGAL::ZERO); } - + } - + } template @@ -283,40 +283,40 @@ void _test_sign_at(AK ak) typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; typename AK::Sign_at theSigh_at = ak.sign_at_object(); - + //Polynomial_for_circles_2_2 typename AK::Construct_polynomial_for_circles_2_2 theConstruct_2_2 = ak.construct_polynomial_for_circles_2_2_object(); assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(-5,5)) == CGAL::ZERO); + Root_for_circles_2_2(-5,5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(15,5)) == CGAL::ZERO); + Root_for_circles_2_2(15,5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(5,15)) == CGAL::ZERO); + Root_for_circles_2_2(5,15)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(5,-5)) == CGAL::ZERO); - + Root_for_circles_2_2(5,-5)) == CGAL::ZERO); + assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(5,5)) != CGAL::ZERO); + Root_for_circles_2_2(5,5)) != CGAL::ZERO); assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(5,16)) != CGAL::ZERO); + Root_for_circles_2_2(5,16)) != CGAL::ZERO); assert(theSigh_at(theConstruct_2_2(5, 5, 100), - Root_for_circles_2_2(5,-6)) != CGAL::ZERO); + Root_for_circles_2_2(5,-6)) != CGAL::ZERO); //Polynomial_1_2 typename AK::Construct_polynomial_1_2 theConstruct_1_2 = ak.construct_polynomial_1_2_object(); assert(theSigh_at(theConstruct_1_2(1, 0, -5), - Root_for_circles_2_2(5,-6)) == CGAL::ZERO); + Root_for_circles_2_2(5,-6)) == CGAL::ZERO); assert(theSigh_at(theConstruct_1_2(1, 0, -5), - Root_for_circles_2_2(6,-6)) != CGAL::ZERO); + Root_for_circles_2_2(6,-6)) != CGAL::ZERO); assert(theSigh_at(theConstruct_1_2(0, 1, -5), - Root_for_circles_2_2(5,-6)) != CGAL::ZERO); + Root_for_circles_2_2(5,-6)) != CGAL::ZERO); assert(theSigh_at(theConstruct_1_2(0, 1, -5), - Root_for_circles_2_2(5, 5)) == CGAL::ZERO); - + Root_for_circles_2_2(5, 5)) == CGAL::ZERO); + } template @@ -334,25 +334,25 @@ void _test_critical_points(AK ak) ak.construct_polynomial_for_circles_2_2_object(); typename AK::X_critical_points theX_critical_points = ak.x_critical_points_object(); - + typename AK::Y_critical_points theY_critical_points = ak.y_critical_points_object(); - + for(int i = 0; i < 20; i++){ int x = theRandom.get_int(random_min,random_max); int y = theRandom.get_int(random_min,random_max); int r = theRandom.get_int(1,random_max); - + assert(theX_critical_points(theConstruct_2_2(x,y,r*r),true) - == Root_for_circles_2_2(x - r, y)); + == Root_for_circles_2_2(x - r, y)); assert(theX_critical_points(theConstruct_2_2(x,y,r*r),false) - == Root_for_circles_2_2(x + r, y)); + == Root_for_circles_2_2(x + r, y)); assert(theY_critical_points(theConstruct_2_2(x,y,r*r),true) - == Root_for_circles_2_2(x, y - r)); + == Root_for_circles_2_2(x, y - r)); assert(theY_critical_points(theConstruct_2_2(x,y,r*r),false) - == Root_for_circles_2_2(x, y + r)); + == Root_for_circles_2_2(x, y + r)); } - + } template @@ -369,18 +369,18 @@ void _test_compare_Root_for_circles(AK ak) typename AK::Compare_x theCompare_x = ak.compare_x_object(); - + typename AK::Compare_y theCompare_y = ak.compare_y_object(); - + typename AK::Compare_xy theCompare_xy = ak.compare_xy_object(); for (int i = 0; i < 20; i++){ Root_for_circles_2_2 r1(theRandom.get_int(random_min,random_max), - theRandom.get_int(random_min,random_max)); + theRandom.get_int(random_min,random_max)); Root_for_circles_2_2 r2(theRandom.get_int(random_min,random_max), - theRandom.get_int(random_min,random_max)); + theRandom.get_int(random_min,random_max)); if(r1.x() > r2.x()){ assert(theCompare_x(r1, r2) == CGAL::LARGER); assert(theCompare_xy(r1, r2) == CGAL::LARGER); @@ -388,16 +388,16 @@ void _test_compare_Root_for_circles(AK ak) else if(r1.x() == r2.x()){ assert(theCompare_x(r1, r2) == CGAL::EQUAL); if(r1.y() < r2.y()){ - assert(theCompare_y(r1, r2) == CGAL::SMALLER); - assert(theCompare_xy(r1, r2) == CGAL::SMALLER); + assert(theCompare_y(r1, r2) == CGAL::SMALLER); + assert(theCompare_xy(r1, r2) == CGAL::SMALLER); } else if(r1.y() > r2.y()){ - assert(theCompare_y(r1, r2) == CGAL::LARGER); - assert(theCompare_xy(r1, r2) == CGAL::LARGER); + assert(theCompare_y(r1, r2) == CGAL::LARGER); + assert(theCompare_xy(r1, r2) == CGAL::LARGER); } else { - assert(theCompare_y(r1, r2) == CGAL::EQUAL); - assert(theCompare_xy(r1, r2) == CGAL::EQUAL); + assert(theCompare_y(r1, r2) == CGAL::EQUAL); + assert(theCompare_xy(r1, r2) == CGAL::EQUAL); } } else { diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/function_objects_on_roots_and_polynomials_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/function_objects_on_roots_and_polynomials_2_3.h index 3ca3dc41bfe8..6cb9d71b60e3 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/function_objects_on_roots_and_polynomials_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/function_objects_on_roots_and_polynomials_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -30,7 +30,7 @@ namespace CGAL { namespace AlgebraicSphereFunctors { - + template < class AK > class Solve { @@ -43,7 +43,7 @@ namespace AlgebraicSphereFunctors { Polynomial_for_spheres_2_3, Polynomial_1_3> Equation_Circle; typedef typename AK::Polynomials_for_line_3 Polynomials_for_line_3; - + public: template < class OutputIterator > OutputIterator @@ -171,8 +171,8 @@ namespace AlgebraicSphereFunctors { OutputIterator res) const { return AlgebraicSphereFunctors::solve ( e1, e2, e3, res); } - - + + }; @@ -181,7 +181,7 @@ namespace AlgebraicSphereFunctors { { typedef typename AK::RT RT; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; - + public: Polynomial_for_spheres_2_3 operator()(const RT& xc, const RT& yc,const RT& zc, const RT& r_sq) const @@ -194,7 +194,7 @@ namespace AlgebraicSphereFunctors { { typedef typename AK::RT RT; typedef typename AK::Polynomial_1_3 Polynomial_1_3; - + public: Polynomial_1_3 operator()(const RT& a, const RT& b,const RT& c, const RT& d) const @@ -206,7 +206,7 @@ namespace AlgebraicSphereFunctors { { typedef typename AK::FT FT; typedef typename AK::Polynomials_for_line_3 Polynomials_for_line_3; - + public: Polynomials_for_line_3 operator()(const FT& a1, const FT& b1, @@ -227,16 +227,16 @@ namespace AlgebraicSphereFunctors { result_type operator()( const Polynomial_for_spheres_2_3 & equation, - const Root_for_spheres_2_3 & r ) const + const Root_for_spheres_2_3 & r ) const { return AlgebraicSphereFunctors::sign_at(equation, r); } result_type operator()( const Polynomial_1_3 & equation, - const Root_for_spheres_2_3 & r ) const + const Root_for_spheres_2_3 & r ) const { return AlgebraicSphereFunctors::sign_at(equation, r); } }; - + template < class AK > class X_critical_points @@ -250,25 +250,25 @@ namespace AlgebraicSphereFunctors { typedef void result_type; Root_for_spheres_2_3 - operator()(const Polynomial_for_spheres_2_3 & c, - bool i) const + operator()(const Polynomial_for_spheres_2_3 & c, + bool i) const { return AlgebraicSphereFunctors::x_critical_point(c,i); } template OutputIterator - operator()(const Polynomial_for_spheres_2_3 & c, - OutputIterator res) const + operator()(const Polynomial_for_spheres_2_3 & c, + OutputIterator res) const { return AlgebraicSphereFunctors::x_critical_points(c,res); } Root_for_spheres_2_3 - operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, - bool i) const + operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, + bool i) const { return AlgebraicSphereFunctors::x_critical_point(c,i); } template OutputIterator - operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, - OutputIterator res) const + operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, + OutputIterator res) const { return AlgebraicSphereFunctors::x_critical_points(c,res); } }; @@ -284,25 +284,25 @@ namespace AlgebraicSphereFunctors { typedef void result_type; Root_for_spheres_2_3 - operator()(const Polynomial_for_spheres_2_3 & c, - bool i) const + operator()(const Polynomial_for_spheres_2_3 & c, + bool i) const { return AlgebraicSphereFunctors::y_critical_point(c,i); } template OutputIterator - operator()(const Polynomial_for_spheres_2_3 & c, - OutputIterator res) const + operator()(const Polynomial_for_spheres_2_3 & c, + OutputIterator res) const { return AlgebraicSphereFunctors::y_critical_points(c,res); } Root_for_spheres_2_3 - operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, - bool i) const + operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, + bool i) const { return AlgebraicSphereFunctors::y_critical_point(c,i); } template OutputIterator - operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, - OutputIterator res) const + operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, + OutputIterator res) const { return AlgebraicSphereFunctors::y_critical_points(c,res); } }; @@ -318,36 +318,36 @@ namespace AlgebraicSphereFunctors { typedef void result_type; Root_for_spheres_2_3 - operator()(const Polynomial_for_spheres_2_3 & c, - bool i) const + operator()(const Polynomial_for_spheres_2_3 & c, + bool i) const { return AlgebraicSphereFunctors::z_critical_point(c,i); } template OutputIterator - operator()(const Polynomial_for_spheres_2_3 & c, - OutputIterator res) const + operator()(const Polynomial_for_spheres_2_3 & c, + OutputIterator res) const { return AlgebraicSphereFunctors::z_critical_points(c,res); } Root_for_spheres_2_3 - operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, - bool i) const + operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, + bool i) const { return AlgebraicSphereFunctors::z_critical_point(c,i); } template OutputIterator - operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, - OutputIterator res) const + operator()(const std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > & c, + OutputIterator res) const { return AlgebraicSphereFunctors::z_critical_points(c,res); } }; - + template class Compare_x { public: - Comparison_result - operator()(const Root_for_spheres_2_3& r1, - const Root_for_spheres_2_3& r2) const + Comparison_result + operator()(const Root_for_spheres_2_3& r1, + const Root_for_spheres_2_3& r2) const { return AlgebraicSphereFunctors::compare_x(r1, r2); } }; @@ -356,9 +356,9 @@ namespace AlgebraicSphereFunctors { class Compare_y { public: - Comparison_result - operator()(const Root_for_spheres_2_3& r1, - const Root_for_spheres_2_3& r2) const + Comparison_result + operator()(const Root_for_spheres_2_3& r1, + const Root_for_spheres_2_3& r2) const { return AlgebraicSphereFunctors::compare_y(r1, r2); } }; @@ -366,9 +366,9 @@ namespace AlgebraicSphereFunctors { class Compare_z { public: - Comparison_result - operator()(const Root_for_spheres_2_3& r1, - const Root_for_spheres_2_3& r2) const + Comparison_result + operator()(const Root_for_spheres_2_3& r1, + const Root_for_spheres_2_3& r2) const { return AlgebraicSphereFunctors::compare_z(r1, r2); } }; @@ -376,9 +376,9 @@ namespace AlgebraicSphereFunctors { class Compare_xy { public: - Comparison_result - operator()(const Root_for_spheres_2_3& r1, - const Root_for_spheres_2_3& r2) const + Comparison_result + operator()(const Root_for_spheres_2_3& r1, + const Root_for_spheres_2_3& r2) const { return AlgebraicSphereFunctors::compare_xy(r1, r2); } }; @@ -386,9 +386,9 @@ namespace AlgebraicSphereFunctors { class Compare_xyz { public: - Comparison_result - operator()(const Root_for_spheres_2_3& r1, - const Root_for_spheres_2_3& r2) const + Comparison_result + operator()(const Root_for_spheres_2_3& r1, + const Root_for_spheres_2_3& r2) const { return AlgebraicSphereFunctors::compare_xyz(r1, r2); } }; diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_comparison_root_for_spheres_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_comparison_root_for_spheres_2_3.h index b47e38b1f662..1bfca81e065f 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_comparison_root_for_spheres_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_comparison_root_for_spheres_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -26,31 +26,31 @@ namespace CGAL { namespace AlgebraicSphereFunctors{ - + template - Comparison_result + Comparison_result compare_x(const CGAL::Root_for_spheres_2_3& r1, const CGAL::Root_for_spheres_2_3& r2){ return compare(r1.x(), r2.x()); } - + template - Comparison_result + Comparison_result compare_y(const CGAL::Root_for_spheres_2_3& r1, const CGAL::Root_for_spheres_2_3& r2){ return compare(r1.y(), r2.y()); } template - Comparison_result + Comparison_result compare_z(const CGAL::Root_for_spheres_2_3& r1, const CGAL::Root_for_spheres_2_3& r2){ return compare(r1.z(), r2.z()); } - + template Comparison_result compare_xy(const CGAL::Root_for_spheres_2_3& r1, const CGAL::Root_for_spheres_2_3& r2){ Comparison_result compx = compare_x(r1, r2); if(compx != 0) - return compx; + return compx; return compare_y(r1, r2); } @@ -59,7 +59,7 @@ namespace CGAL { compare_xyz(const CGAL::Root_for_spheres_2_3& r1, const CGAL::Root_for_spheres_2_3& r2){ Comparison_result compxy = compare_xy(r1, r2); if(compxy != 0) - return compxy; + return compxy; return compare_z(r1, r2); } diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomial_1_3_and_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomial_1_3_and_2_3.h index ea172bbde080..c147be589ecd 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomial_1_3_and_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomial_1_3_and_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -33,28 +33,28 @@ namespace CGAL { namespace AlgebraicSphereFunctors { template < class AK > - inline + inline Sign sign_at( const typename AK::Polynomial_for_spheres_2_3 & equation, - const typename AK::Root_for_spheres_2_3 &r){ + const typename AK::Root_for_spheres_2_3 &r){ return CGAL_NTS sign(r.evaluate(equation)); } template < class AK > - inline + inline Sign sign_at(const typename AK::Polynomial_1_3 & equation, - const typename AK::Root_for_spheres_2_3 &r){ + const typename AK::Root_for_spheres_2_3 &r){ return CGAL_NTS sign(r.evaluate(equation)); } template < class AK > - inline + inline bool contains(const typename AK::Polynomials_for_line_3 & equation, - const typename AK::Root_for_spheres_2_3 &r){ - return r.is_on_line(equation); + const typename AK::Root_for_spheres_2_3 &r){ + return r.is_on_line(equation); } template - bool intersect(const typename AK::Polynomial_1_3 & p1, + bool intersect(const typename AK::Polynomial_1_3 & p1, const typename AK::Polynomial_1_3 & p2) { typedef typename AK::RT RT; @@ -72,8 +72,8 @@ namespace CGAL { template inline typename AK::Polynomials_for_line_3 - line_from_2_planes(const typename AK::Polynomial_1_3 & p1, - const typename AK::Polynomial_1_3 & p2) + line_from_2_planes(const typename AK::Polynomial_1_3 & p1, + const typename AK::Polynomial_1_3 & p2) { typedef typename AK::Polynomials_for_line_3 Polynomials_for_line_3; typedef typename AK::FT FT; @@ -88,7 +88,7 @@ namespace CGAL { const FT b2 = (p2.d() * p1.c() - p2.c() * p1.d()) / a1; const FT b3 = (p2.b() * p1.d() - p2.d() * p1.b()) / a1; return Polynomials_for_line_3(a1, b1, a2, b2, a3, b3); - } + } if(!is_zero(a2)) { const FT b1 = (p1.d() * p2.c() - p1.c() * p2.d()) / a2; @@ -103,16 +103,16 @@ namespace CGAL { const FT b2 = (p2.a() * p1.d() - p2.d() * p1.a()) / a3; const FT b3 = 0; return Polynomials_for_line_3(a1, b1, a2, b2, a3, b3); - + } template inline - bool intersect(const typename AK::Polynomial_for_spheres_2_3 & s1, + bool intersect(const typename AK::Polynomial_for_spheres_2_3 & s1, const typename AK::Polynomial_for_spheres_2_3 & s2) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - + const FT dx = s2.a() - s1.a(); const FT dy = s2.b() - s1.b(); const FT dz = s2.c() - s1.c(); @@ -121,7 +121,7 @@ namespace CGAL { CGAL::square(dz); const FT sq_r1r2 = s1.r_sq()*s2.r_sq(); const FT sq_r1_p_sq_r2 = s1.r_sq() + s2.r_sq(); - + Root_of_2 left_1 = make_root_of_2(d2,FT(-2),sq_r1r2); if(left_1 > sq_r1_p_sq_r2) return false; Root_of_2 left_2 = make_root_of_2(d2,FT(2),sq_r1r2); @@ -131,20 +131,20 @@ namespace CGAL { template inline - bool intersect(const typename AK::Polynomial_1_3 & p, + bool intersect(const typename AK::Polynomial_1_3 & p, const typename AK::Polynomial_for_spheres_2_3 & s) { - return CGAL::square(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) <= - ((CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())) * + return CGAL::square(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) <= + ((CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())) * s.r_sq()); } template inline - bool tangent(const typename AK::Polynomial_for_spheres_2_3 & s1, + bool tangent(const typename AK::Polynomial_for_spheres_2_3 & s1, const typename AK::Polynomial_for_spheres_2_3 & s2) { typedef typename AK::RT RT; typedef typename AK::Root_of_2 Root_of_2; - + const RT dx = s2.a() - s1.a(); const RT dy = s2.b() - s1.b(); const RT dz = s2.c() - s1.c(); @@ -153,7 +153,7 @@ namespace CGAL { CGAL::square(dz); const RT sq_r1r2 = s1.r_sq()*s2.r_sq(); const RT sq_r1_p_sq_r2 = s1.r_sq() + s2.r_sq(); - + Root_of_2 left_1 = make_root_of_2(d2,RT(-2),sq_r1r2); if(left_1 == sq_r1_p_sq_r2) return true; Root_of_2 left_2 = make_root_of_2(d2,RT(2),sq_r1r2); @@ -163,17 +163,17 @@ namespace CGAL { template inline - bool tangent(const typename AK::Polynomial_1_3 & p, + bool tangent(const typename AK::Polynomial_1_3 & p, const typename AK::Polynomial_for_spheres_2_3 & s) { - return CGAL::square(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) == - ((CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())) * + return CGAL::square(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) == + ((CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())) * s.r_sq()); } template typename AK::Polynomial_1_3 - plane_from_2_spheres(const typename AK::Polynomial_for_spheres_2_3 & s1, - const typename AK::Polynomial_for_spheres_2_3 & s2) + plane_from_2_spheres(const typename AK::Polynomial_for_spheres_2_3 & s1, + const typename AK::Polynomial_for_spheres_2_3 & s2) { typedef typename AK::Polynomial_1_3 Polynomial_1_3; typedef typename AK::RT RT; @@ -185,28 +185,28 @@ namespace CGAL { const RT a = 2*(s2.a() - s1.a()); const RT b = 2*(s2.b() - s1.b()); const RT c = 2*(s2.c() - s1.c()); - const RT d = CGAL::square(s1.a()) + + const RT d = CGAL::square(s1.a()) + CGAL::square(s1.b()) + - CGAL::square(s1.c()) - s1.r_sq() - - CGAL::square(s2.a()) - + CGAL::square(s1.c()) - s1.r_sq() - + CGAL::square(s2.a()) - CGAL::square(s2.b()) - CGAL::square(s2.c()) + s2.r_sq(); return Polynomial_1_3(a, b, c, d); } template < class AK, class OutputIterator > - inline + inline OutputIterator solve(const typename AK::Polynomials_for_line_3 &p, const typename AK::Polynomial_for_spheres_2_3& s, - OutputIterator res ) + OutputIterator res ) { typedef typename AK::FT FT; typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Root_of_2 Root_of_2; // we must have a line - CGAL_kernel_precondition(!p.degenerated()); + CGAL_kernel_precondition(!p.degenerated()); const FT sq_a1 = CGAL::square(p.a1()); const FT sq_a2 = CGAL::square(p.a2()); @@ -219,11 +219,11 @@ namespace CGAL { const FT b = p.a1() * (p.b1() - s.a()) + p.a2() * (p.b2() - s.b()) + p.a3() * (p.b3() - s.c()); - const FT c = CGAL::square(p.b1()) + - CGAL::square(p.b2()) + - CGAL::square(p.b3()) + - sq_a + sq_b + sq_c - - 2*(s.a() * p.b1() + + const FT c = CGAL::square(p.b1()) + + CGAL::square(p.b2()) + + CGAL::square(p.b3()) + + sq_a + sq_b + sq_c - + 2*(s.a() * p.b1() + s.b() * p.b2() + s.c() * p.b3()) - s.r_sq(); const FT alpha = -b/a; @@ -235,8 +235,8 @@ namespace CGAL { *res++ = std::make_pair( Root_for_spheres_2_3(Root_of_2(p.a1() * alpha + p.b1()), Root_of_2(p.a2() * alpha + p.b2()), - Root_of_2(p.a3() * alpha + p.b3())), - 2); + Root_of_2(p.a3() * alpha + p.b3())), + 2); return res; } @@ -257,35 +257,35 @@ namespace CGAL { *res++ = std::make_pair( Root_for_spheres_2_3(p.a1() * t1 + p.b1(), p.a2() * t1 + p.b2(), - p.a3() * t1 + p.b3()), - 1); + p.a3() * t1 + p.b3()), + 1); *res++ = std::make_pair( Root_for_spheres_2_3(p.a1() * t2 + p.b1(), p.a2() * t2 + p.b2(), - p.a3() * t2 + p.b3()), + p.a3() * t2 + p.b3()), 1); } else { *res++ = std::make_pair( Root_for_spheres_2_3(p.a1() * t2 + p.b1(), p.a2() * t2 + p.b2(), - p.a3() * t2 + p.b3()), - 1); + p.a3() * t2 + p.b3()), + 1); *res++ = std::make_pair( Root_for_spheres_2_3(p.a1() * t1 + p.b1(), p.a2() * t1 + p.b2(), - p.a3() * t1 + p.b3()), + p.a3() * t1 + p.b3()), 1); - } + } return res; } template < class AK, class OutputIterator > - inline + inline OutputIterator solve(const typename AK::Polynomial_for_spheres_2_3& s, const typename AK::Polynomials_for_line_3 &p, - OutputIterator res ) + OutputIterator res ) { return solve(p,s,res); } @@ -293,11 +293,11 @@ namespace CGAL { namespace internal { template < class AK, class OutputIterator > - inline + inline OutputIterator - solve_tangent(const typename AK::Polynomial_1_3 & p, + solve_tangent(const typename AK::Polynomial_1_3 & p, const typename AK::Polynomial_for_spheres_2_3& s, - OutputIterator res ) + OutputIterator res ) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; @@ -305,36 +305,36 @@ namespace CGAL { // It returns no solution when there is infinitely solution // For now, this solve is only for internal computations purpose CGAL_kernel_precondition( - CGAL::square(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) == - ((CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())) * + CGAL::square(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) == + ((CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())) * s.r_sq())); - const FT t = -(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) / - (CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())); + const FT t = -(p.a()*s.a() + p.b()*s.b() + p.c()*s.c() + p.d()) / + (CGAL::square(p.a()) + CGAL::square(p.b()) + CGAL::square(p.c())); *res++ = std::make_pair( Root_for_spheres_2_3(Root_of_2(p.a() * t + s.a()), Root_of_2(p.b() * t + s.b()), - Root_of_2(p.c() * t + s.c())), - 2); + Root_of_2(p.c() * t + s.c())), + 2); return res; } } template < class AK, class OutputIterator > - inline + inline OutputIterator solve(const typename AK::Polynomial_1_3 & e1, - const typename AK::Polynomial_1_3 & e2, + const typename AK::Polynomial_1_3 & e2, const typename AK::Polynomial_for_spheres_2_3& e3, - OutputIterator res ) + OutputIterator res ) { typedef typename AK::RT RT; typedef typename AK::Polynomials_for_line_3 Polynomials_for_line_3; // we put as a precondition that the polynomial for spheres represents // a sphere and not an isolated point or an empty_space - CGAL_kernel_precondition(!(e3.empty_space() || e3.isolated_point())); + CGAL_kernel_precondition(!(e3.empty_space() || e3.isolated_point())); // if the planes are the same // since the solution can only be points or nothing // the only case that remains is a plane tangent to a sphere @@ -348,29 +348,29 @@ namespace CGAL { } template < class AK, class OutputIterator > - inline + inline OutputIterator solve(const typename AK::Polynomial_for_spheres_2_3& e1, - const typename AK::Polynomial_1_3 & e2, - const typename AK::Polynomial_1_3 & e3, - OutputIterator res ) + const typename AK::Polynomial_1_3 & e2, + const typename AK::Polynomial_1_3 & e3, + OutputIterator res ) { return solve(e2,e3,e1,res); } template < class AK, class OutputIterator > - inline + inline OutputIterator solve(const typename AK::Polynomial_for_spheres_2_3& e1, - const typename AK::Polynomial_for_spheres_2_3& e2, - const typename AK::Polynomial_1_3 & e3, - OutputIterator res ) + const typename AK::Polynomial_for_spheres_2_3& e2, + const typename AK::Polynomial_1_3 & e3, + OutputIterator res ) { typedef typename AK::Polynomial_1_3 Polynomial_1_3; // we put as a precondition that the polynomial for spheres represents // a sphere and not an isolated point or an empty_space - CGAL_kernel_precondition(!(e1.empty_space() || e1.isolated_point())); - CGAL_kernel_precondition(!(e2.empty_space() || e2.isolated_point())); + CGAL_kernel_precondition(!(e1.empty_space() || e1.isolated_point())); + CGAL_kernel_precondition(!(e2.empty_space() || e2.isolated_point())); // The solve can only be points or nothing if(e1 == e2) { if(tangent(e3,e1)) { @@ -386,62 +386,62 @@ namespace CGAL { } template < class AK, class OutputIterator > - inline + inline OutputIterator solve(const typename AK::Polynomial_1_3 & e1, const typename AK::Polynomial_for_spheres_2_3& e2, - const typename AK::Polynomial_for_spheres_2_3& e3, - OutputIterator res ) + const typename AK::Polynomial_for_spheres_2_3& e3, + OutputIterator res ) { return solve(e2,e3,e1,res); } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const std::pair & e1, - const typename AK::Polynomial_1_3 & e2, - OutputIterator res ) + const typename AK::Polynomial_1_3 & e2, + OutputIterator res ) { return solve(e1.first,e1.second,e2,res); } template < class AK, class OutputIterator > - inline + inline OutputIterator - solve(const typename AK::Polynomial_1_3 & e1, + solve(const typename AK::Polynomial_1_3 & e1, const std::pair & e2, - OutputIterator res ) + OutputIterator res ) { return solve(e2,e1,res); } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const std::pair & e1, - const typename AK::Polynomial_for_spheres_2_3 & e2, - OutputIterator res ) + const typename AK::Polynomial_for_spheres_2_3 & e2, + OutputIterator res ) { return solve(e1.first, e2, e1.second,res); } template < class AK, class OutputIterator > - inline + inline OutputIterator - solve(const typename AK::Polynomial_for_spheres_2_3 & e1, + solve(const typename AK::Polynomial_for_spheres_2_3 & e1, const std::pair & e2, - OutputIterator res ) + OutputIterator res ) { return solve(e2,e1, res); } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const std::pair & e1, - const std::pair & e2, - OutputIterator res ) + const std::pair & e2, + OutputIterator res ) { typedef typename AK::RT RT; typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; @@ -472,7 +472,7 @@ namespace CGAL { if(p2.undefined()) { return solve(s1, s2, p1, res); } - if(same_solutions(p1, p2)) { + if(same_solutions(p1, p2)) { return solve(s1, s2, p1, res); } @@ -482,7 +482,7 @@ namespace CGAL { if(solutions.size() == 0) return res; if(solutions.size() == 1) { if(sign_at(s2, solutions[0].first) == ZERO) { - *res++ = solutions[0]; + *res++ = solutions[0]; } return res; } @@ -508,11 +508,11 @@ namespace CGAL { } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const std::pair & e1, - const typename AK::Polynomials_for_line_3 & l, - OutputIterator res ) + const typename AK::Polynomials_for_line_3 & l, + OutputIterator res ) { typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; @@ -536,7 +536,7 @@ template < class AK, class OutputIterator > if(solutions.size() == 0) return res; if(solutions.size() == 1) { if(sign_at(p1, solutions[0].first) == ZERO) { - *res++ = solutions[0]; + *res++ = solutions[0]; } return res; } @@ -562,11 +562,11 @@ template < class AK, class OutputIterator > } template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomials_for_line_3 & l, - const std::pair & e1, - OutputIterator res ) { + const std::pair & e1, + OutputIterator res ) { return solve(e1, l, res); } diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_1_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_1_3.h index c9a0e7e55806..381b589fa1e1 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_1_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_1_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -27,12 +27,12 @@ namespace CGAL { namespace AlgebraicSphereFunctors { template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomial_1_3 & e1, - const typename AK::Polynomial_1_3 & e2, - const typename AK::Polynomial_1_3 & e3, - OutputIterator res ) + const typename AK::Polynomial_1_3 & e2, + const typename AK::Polynomial_1_3 & e3, + OutputIterator res ) { typedef typename AK::FT FT; typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; @@ -56,7 +56,7 @@ namespace CGAL { FT z = -(a2*b3*d1-a1*b3*d2+a1*b2*d3-a3*b2*d1-a2*b1*d3+a3*b1*d2)/denominateur; FT y = (-a1*d2*c3+a1*c2*d3-a2*c1*d3-a3*c2*d1+a3*c1*d2+a2*c3*d1)/denominateur; FT x = -(-b1*d2*c3+b1*c2*d3+b3*c1*d2-b2*c1*d3+b2*d1*c3-b3*c2*d1)/denominateur; - *res++ = std::make_pair(Root_for_spheres_2_3(x,y,z), + *res++ = std::make_pair(Root_for_spheres_2_3(x,y,z), static_cast(1)); return res; } diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_2_3.h index 49a5f097a67d..65fb8edce6d2 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres/internal_functions_on_roots_and_polynomials_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -29,20 +29,20 @@ namespace CGAL { namespace AlgebraicSphereFunctors { template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomial_for_spheres_2_3 &e1, const typename AK::Polynomial_for_spheres_2_3 &e2, - const typename AK::Polynomial_for_spheres_2_3 &e3, - OutputIterator res ) + const typename AK::Polynomial_for_spheres_2_3 &e3, + OutputIterator res ) { - typedef typename AK::FT FT; + typedef typename AK::FT FT; CGAL_kernel_precondition(!((e1 == e2) && (e2 == e3))); // we put as a precondition that the polynomial for spheres represents // a sphere and not an isolated point or an empty_space - CGAL_kernel_precondition(!(e1.empty_space() || e1.isolated_point())); - CGAL_kernel_precondition(!(e2.empty_space() || e2.isolated_point())); - CGAL_kernel_precondition(!(e3.empty_space() || e3.isolated_point())); + CGAL_kernel_precondition(!(e1.empty_space() || e1.isolated_point())); + CGAL_kernel_precondition(!(e2.empty_space() || e2.isolated_point())); + CGAL_kernel_precondition(!(e3.empty_space() || e3.isolated_point())); typedef typename AK::Polynomial_1_3 Polynomial_1_3; // The degenerated cases are 2 tangent spheres // os 2 non-intersecting spheres @@ -63,29 +63,29 @@ namespace CGAL { CGAL_kernel_precondition(!(intersect(e1,e2))); return res; } - + // non degenerated case if(intersect(e1,e2)) { Polynomial_1_3 p1 = plane_from_2_spheres(e1,e2); if(intersect(e2,e3)) { - Polynomial_1_3 p2 = plane_from_2_spheres(e2,e3); + Polynomial_1_3 p2 = plane_from_2_spheres(e2,e3); if(same_solutions(p1,p2)) { - const FT sq_d1 = CGAL::square(p1.a()*e1.a() + p1.b()*e1.b() + - p1.c()*e1.c() + p1.d()) / - (square(p1.a()) + square(p1.b()) + square(p1.c())); - const FT r1_sqr = e1.r_sq() - sq_d1; - - const FT sq_d2 = CGAL::square(p2.a()*e2.a() + p2.b()*e2.b() + - p2.c()*e2.c() + p2.d()) / - (square(p2.a()) + square(p2.b()) + square(p2.c())); - const FT r2_sqr = e2.r_sq() - sq_d2; - if(r1_sqr != r2_sqr) return res; - // otherwise there are an infinite number of points - // this is not allowed - CGAL_kernel_precondition(r1_sqr == 0); - return internal::solve_tangent(p1,e1,res); - } - return solve(p1,p2,e2,res); + const FT sq_d1 = CGAL::square(p1.a()*e1.a() + p1.b()*e1.b() + + p1.c()*e1.c() + p1.d()) / + (square(p1.a()) + square(p1.b()) + square(p1.c())); + const FT r1_sqr = e1.r_sq() - sq_d1; + + const FT sq_d2 = CGAL::square(p2.a()*e2.a() + p2.b()*e2.b() + + p2.c()*e2.c() + p2.d()) / + (square(p2.a()) + square(p2.b()) + square(p2.c())); + const FT r2_sqr = e2.r_sq() - sq_d2; + if(r1_sqr != r2_sqr) return res; + // otherwise there are an infinite number of points + // this is not allowed + CGAL_kernel_precondition(r1_sqr == 0); + return internal::solve_tangent(p1,e1,res); + } + return solve(p1,p2,e2,res); } return res; } return res; } @@ -95,7 +95,7 @@ namespace CGAL { x_critical_point(const typename AK::Polynomial_for_spheres_2_3 & s, bool i) { typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; return Root_for_spheres_2_3( make_root_of_2(s.a(),typename AK::FT(i?-1:1),s.r_sq()), @@ -108,9 +108,9 @@ namespace CGAL { x_critical_points(const typename AK::Polynomial_for_spheres_2_3 & s, OutputIterator res) { typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::FT FT; - + *res++ = Root_for_spheres_2_3(make_root_of_2(s.a(),FT(-1),s.r_sq()), Root_of_2(s.b()), Root_of_2(s.c())); @@ -125,14 +125,14 @@ namespace CGAL { y_critical_point(const typename AK::Polynomial_for_spheres_2_3 &s, bool i) { typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; return Root_for_spheres_2_3( Root_of_2(s.a()), make_root_of_2(s.b(),typename AK::FT(i?-1:1),s.r_sq()), Root_of_2(s.c())); } - + template OutputIterator y_critical_points(const typename AK::Polynomial_for_spheres_2_3 & s, OutputIterator res) @@ -155,13 +155,13 @@ namespace CGAL { z_critical_point(const typename AK::Polynomial_for_spheres_2_3 &s, bool i) { typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; return Root_for_spheres_2_3(Root_of_2(s.a()), Root_of_2(s.b()), make_root_of_2(s.c(),typename AK::FT(i?-1:1),s.r_sq())); } - + template OutputIterator z_critical_points(const typename AK::Polynomial_for_spheres_2_3 & s, OutputIterator res) @@ -181,12 +181,12 @@ namespace CGAL { template typename AK::Root_for_spheres_2_3 - x_critical_point( const std::pair &c, bool i) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef typename AK::Polynomial_1_3 Polynomial_1_3; @@ -195,7 +195,7 @@ namespace CGAL { // It has to be the equation of a diametral circle CGAL_kernel_precondition((intersect(p,s))); - CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + + CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + p.c() * s.c() + p.d()) == ZERO); CGAL_kernel_precondition(!(is_zero(p.b()) && is_zero(p.c()))); @@ -215,13 +215,13 @@ namespace CGAL { template OutputIterator - x_critical_points( const std::pair &c, + x_critical_points( const std::pair &c, OutputIterator res) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef typename AK::Polynomial_1_3 Polynomial_1_3; @@ -230,7 +230,7 @@ namespace CGAL { // It has to be the equation of a diametral circle CGAL_kernel_precondition((intersect(p,s))); - CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + + CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + p.c() * s.c() + p.d()) == ZERO); CGAL_kernel_precondition(!(is_zero(p.b()) && is_zero(p.c()))); @@ -255,12 +255,12 @@ namespace CGAL { template typename AK::Root_for_spheres_2_3 - y_critical_point( const std::pair &c, bool i) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef typename AK::Polynomial_1_3 Polynomial_1_3; @@ -269,7 +269,7 @@ namespace CGAL { // It has to be the equation of a diametral circle CGAL_kernel_precondition((intersect(p,s))); - CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + + CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + p.c() * s.c() + p.d()) == ZERO); CGAL_kernel_precondition(!(is_zero(p.a()) && is_zero(p.c()))); @@ -290,18 +290,18 @@ namespace CGAL { const Root_of_2 y = make_root_of_2(s.b(),FT(i?1:-1),delta); const Root_of_2 z = make_root_of_2(s.c(),FT(i?FT(-cz):(cz)),delta); return Root_for_spheres_2_3(x,y,z); - } + } } template OutputIterator - y_critical_points( const std::pair &c, + y_critical_points( const std::pair &c, OutputIterator res) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef typename AK::Polynomial_1_3 Polynomial_1_3; @@ -310,7 +310,7 @@ namespace CGAL { // It has to be the equation of a diametral circle CGAL_kernel_precondition((intersect(p,s))); - CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + + CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + p.c() * s.c() + p.d()) == ZERO); CGAL_kernel_precondition(!(is_zero(p.a()) && is_zero(p.c()))); @@ -334,18 +334,18 @@ namespace CGAL { } else { *res++ = Root_for_spheres_2_3(x2,y2,z2); *res++ = Root_for_spheres_2_3(x1,y1,z1); - } + } return res; } template typename AK::Root_for_spheres_2_3 - z_critical_point( const std::pair &c, bool i) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef typename AK::Polynomial_1_3 Polynomial_1_3; @@ -354,7 +354,7 @@ namespace CGAL { // It has to be the equation of a diametral circle CGAL_kernel_precondition((intersect(p,s))); - CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + + CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + p.c() * s.c() + p.d()) == ZERO); CGAL_kernel_precondition(!(is_zero(p.a()) && is_zero(p.b()))); @@ -387,18 +387,18 @@ namespace CGAL { const Root_of_2 y = make_root_of_2(s.b(),FT(i?FT(-cy):(cy)),delta); const Root_of_2 z = make_root_of_2(s.c(),FT(i?1:-1),delta); return Root_for_spheres_2_3(x,y,z); - } + } } template OutputIterator - z_critical_points( const std::pair &c, + z_critical_points( const std::pair &c, OutputIterator res) { typedef typename AK::FT FT; typedef typename AK::Root_of_2 Root_of_2; - typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; + typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef typename AK::Polynomial_1_3 Polynomial_1_3; @@ -407,7 +407,7 @@ namespace CGAL { // It has to be the equation of a diametral circle CGAL_kernel_precondition((intersect(p,s))); - CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + + CGAL_kernel_precondition(CGAL_NTS sign(p.a() * s.a() + p.b() * s.b() + p.c() * s.c() + p.d()) == ZERO); CGAL_kernel_precondition(!(is_zero(p.a()) && is_zero(p.b()))); diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h index 35771fe2fd47..ba87a8b27121 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -45,7 +45,7 @@ namespace CGAL { typedef RT_ RT; typedef typename Root_of_traits< RT >::RootOf_1 FT; - + typedef CGAL::Polynomials_for_line_3 Polynomials_for_line_3; typedef CGAL::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; typedef CGAL::Polynomial_1_3 Polynomial_1_3; @@ -101,16 +101,16 @@ namespace CGAL { Compare_x compare_x_object() const { return Compare_x(); } - + Compare_y compare_y_object() const { return Compare_y(); } Compare_z compare_z_object() const { return Compare_z(); } - + Compare_xy compare_xy_object() const { return Compare_xy(); } - + Compare_xyz compare_xyz_object() const { return Compare_xyz(); } diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_1_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_1_3.h index f893089e203d..d3dbab4cc0a5 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_1_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_1_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -34,15 +34,15 @@ template < typename FT_ > class Polynomial_1_3 { FT_ rep[4]; // stores a, b, c, d - + public: - + typedef FT_ FT; - + Polynomial_1_3(){} - + Polynomial_1_3(const FT & a, const FT & b, const FT & c, const FT & d) - { + { rep[0]=a; rep[1]=b; rep[2]=c; @@ -54,10 +54,10 @@ class Polynomial_1_3 const FT & b() const { return rep[1]; } - + const FT & c() const { return rep[2]; } - + const FT & d() const { return rep[3]; } @@ -78,21 +78,21 @@ class Polynomial_1_3 template < typename FT > inline -bool +bool operator == ( const Polynomial_1_3 & p1, - const Polynomial_1_3 & p2 ) + const Polynomial_1_3 & p2 ) { - return( (p1.a() == p2.a()) && - (p1.b() == p2.b()) && - (p1.c() == p2.c()) && - (p1.d() == p2.d()) ); + return( (p1.a() == p2.a()) && + (p1.b() == p2.b()) && + (p1.c() == p2.c()) && + (p1.d() == p2.d()) ); } template < typename FT > inline -bool +bool same_solutions ( const Polynomial_1_3 & p1, - const Polynomial_1_3 & p2 ) + const Polynomial_1_3 & p2 ) { if(p1.undefined()) return p2.undefined(); if(p1.empty_space()) return p2.empty_space(); diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_2_3.h index a6f3cece1752..20e727b2e4ef 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -34,15 +34,15 @@ template < typename FT_ > class Polynomial_for_spheres_2_3 { FT_ rep[4]; // stores a, b, c, R^2 - + public: - + typedef FT_ FT; - + Polynomial_for_spheres_2_3(){} - + Polynomial_for_spheres_2_3(const FT & a, const FT & b, const FT & c, const FT & rsq) - { + { rep[0]=a; rep[1]=b; rep[2]=c; @@ -54,10 +54,10 @@ class Polynomial_for_spheres_2_3 const FT & b() const { return rep[1]; } - + const FT & c() const { return rep[2]; } - + const FT & r_sq() const { return rep[3]; } @@ -73,14 +73,14 @@ class Polynomial_for_spheres_2_3 template < typename FT > inline -bool +bool operator == ( const Polynomial_for_spheres_2_3 & p1, - const Polynomial_for_spheres_2_3 & p2 ) + const Polynomial_for_spheres_2_3 & p2 ) { - return( (p1.a() == p2.a()) && - (p1.b() == p2.b()) && - (p1.c() == p2.c()) && - (p1.r_sq() == p2.r_sq()) ); + return( (p1.a() == p2.a()) && + (p1.b() == p2.b()) && + (p1.c() == p2.c()) && + (p1.r_sq() == p2.r_sq()) ); } } //namespace CGAL diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_for_line_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_for_line_3.h index 160378f8408f..ffbfc9d5be2c 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_for_line_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_for_line_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -35,15 +35,15 @@ class Polynomials_for_line_3 // y = a2 t + b2 // z = a3 t + b3 public: - + typedef FT_ FT; - + Polynomials_for_line_3(){} - - Polynomials_for_line_3(const FT & a1, const FT & b1, + + Polynomials_for_line_3(const FT & a1, const FT & b1, const FT & a2, const FT & b2, const FT & a3, const FT & b3) - { + { rep[0] = a1; rep[1] = b1; rep[2] = a2; @@ -57,16 +57,16 @@ class Polynomials_for_line_3 const FT & b1() const { return rep[1]; } - + const FT & a2() const { return rep[2]; } - + const FT & b2() const { return rep[3]; } const FT & a3() const { return rep[4]; } - + const FT & b3() const { return rep[5]; } @@ -80,16 +80,16 @@ class Polynomials_for_line_3 template < typename FT > inline -bool +bool operator == ( const Polynomials_for_line_3 & p1, - const Polynomials_for_line_3 & p2 ) + const Polynomials_for_line_3 & p2 ) { - return( (p1.a1() == p2.a1()) && - (p1.b1() == p2.b1()) && - (p1.a2() == p2.a2()) && - (p1.b2() == p2.b2()) && + return( (p1.a1() == p2.a1()) && + (p1.b1() == p2.b1()) && + (p1.a2() == p2.a2()) && + (p1.b2() == p2.b2()) && (p1.a3() == p2.a3()) && - (p1.b3() == p2.b3())); + (p1.b3() == p2.b3())); } } //namespace CGAL diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Root_for_spheres_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Root_for_spheres_2_3.h index 68e760abd205..a12eebfad255 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Root_for_spheres_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Root_for_spheres_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -48,17 +48,17 @@ class Root_for_spheres_2_3 { Root_of_2 x_; Root_of_2 y_; Root_of_2 z_; - + public: Root_for_spheres_2_3(){} - - + + Root_for_spheres_2_3(const Root_of_2& r1, - const Root_of_2& r2, - const Root_of_2& r3) + const Root_of_2& r2, + const Root_of_2& r3) : x_(r1), y_(r2), z_(r3) { - // This assertion sont work if Root_of_2 is + // This assertion sont work if Root_of_2 is // Interval_nt (and dont have is_rational, gamma, etc..) /*CGAL_assertion( ((r1.is_rational() && r2.is_rational()) || @@ -71,22 +71,22 @@ class Root_for_spheres_2_3 { );*/ } - const Root_of_2& x() const + const Root_of_2& x() const { return x_; } - - const Root_of_2& y() const + + const Root_of_2& y() const { return y_; } - const Root_of_2& z() const + const Root_of_2& z() const { return z_; } - // On fait l'evaluation de (x,y,z) pour le plan + // On fait l'evaluation de (x,y,z) pour le plan // aX + bY + cZ + d, donne const Root_of_2 evaluate(const Polynomial_1_3 &p) const { return (p.a() * x()) + (p.b() * y()) + (p.c() * z()) + p.d(); } - // On fait l'evaluation de (x,y,z) pour le plan + // On fait l'evaluation de (x,y,z) pour le plan // (X-a)^2 + (Y-b)^2 + (Z-c)^2 - r_sq, donne const Root_of_2 evaluate(const Polynomial_for_spheres_2_3 &p) const { return square(x() - p.a()) + @@ -100,12 +100,12 @@ class Root_for_spheres_2_3 { Root_of_2 t; bool already = false; if(!is_zero(p.a1())) { - t = (x() - p.b1())/p.a1(); + t = (x() - p.b1())/p.a1(); already = true; } else if(p.b1() != x()) return false; if(!is_zero(p.a2())) { if(!already) { - t = (y() - p.b2())/p.a2(); + t = (y() - p.b2())/p.a2(); already = true; } else if((p.a2() * t + p.b2()) != y()) return false; @@ -123,18 +123,18 @@ class Root_for_spheres_2_3 { const Root_of_2 &oy = y(); const Root_of_2 &oz = z(); - CGAL::Interval_nt<> + CGAL::Interval_nt<> ix=to_interval(ox), iy=to_interval(oy), iz=to_interval(oz); return CGAL::Bbox_3(ix.inf(),iy.inf(),iz.inf(), - ix.sup(),iy.sup(),iz.sup()); - /* + ix.sup(),iy.sup(),iz.sup()); + /* // Note: This is a more efficient version - // but it won't work (in the future) + // but it won't work (in the future) // with some Lazy_Curved_kernel_3 // because is_rational(), gamma(), etc.. is not defined - // for Interval_nt data type + // for Interval_nt data type const Root_of_2 &ox = x(); const Root_of_2 &oy = y(); const Root_of_2 &oz = z(); @@ -144,12 +144,12 @@ class Root_for_spheres_2_3 { const bool z_rat = oz.is_rational(); if(((x_rat?1:0) + (y_rat?1:0) +(z_rat?1:0)) > 1) { - CGAL::Interval_nt<> + CGAL::Interval_nt<> ix=to_interval(ox), iy=to_interval(oy), iz=to_interval(oz); return CGAL::Bbox_3(ix.inf(),iy.inf(),iz.inf(), - ix.sup(),iy.sup(),iz.sup()); + ix.sup(),iy.sup(),iz.sup()); } if(z_rat) { @@ -163,7 +163,7 @@ class Root_for_spheres_2_3 { const CGAL::Interval_nt iy = alpha2 + beta2 * sqrtg; const CGAL::Interval_nt iz = to_interval(oz); return CGAL::Bbox_3(ix.inf(),iy.inf(),iz.inf(), - ix.sup(),iy.sup(),iz.sup()); + ix.sup(),iy.sup(),iz.sup()); } if(y_rat) { @@ -177,7 +177,7 @@ class Root_for_spheres_2_3 { const CGAL::Interval_nt iz = alpha2 + beta2 * sqrtg; const CGAL::Interval_nt iy = to_interval(oy); return CGAL::Bbox_3(ix.inf(),iy.inf(),iz.inf(), - ix.sup(),iy.sup(),iz.sup()); + ix.sup(),iy.sup(),iz.sup()); } if(x_rat) { @@ -191,7 +191,7 @@ class Root_for_spheres_2_3 { const CGAL::Interval_nt iz = alpha2 + beta2 * sqrtg; const CGAL::Interval_nt ix = to_interval(ox); return CGAL::Bbox_3(ix.inf(),iy.inf(),iz.inf(), - ix.sup(),iy.sup(),iz.sup()); + ix.sup(),iy.sup(),iz.sup()); } const CGAL::Interval_nt alpha1 = to_interval(ox.alpha()); @@ -204,18 +204,18 @@ class Root_for_spheres_2_3 { const CGAL::Interval_nt sqrtg = CGAL::sqrt(g); const CGAL::Interval_nt ix = alpha1 + beta1 * sqrtg; const CGAL::Interval_nt iy = alpha2 + beta2 * sqrtg; - const CGAL::Interval_nt iz = alpha3 + beta3 * sqrtg; + const CGAL::Interval_nt iz = alpha3 + beta3 * sqrtg; return CGAL::Bbox_3(ix.inf(),iy.inf(),iz.inf(), - ix.sup(),iy.sup(),iz.sup()); + ix.sup(),iy.sup(),iz.sup()); */ } }; template < typename RT > -bool +bool operator == ( const Root_for_spheres_2_3& r1, - const Root_for_spheres_2_3& r2 ) + const Root_for_spheres_2_3& r2 ) { return (r1.x() == r2.x()) && (r1.y() == r2.y()) && (r1.z() == r2.z()); } template < typename RT > @@ -229,7 +229,7 @@ operator>>(std::istream & is, Root_for_spheres_2_3 &r) { typedef typename Root_of_traits< RT >::RootOf_2 Root_of_2; Root_of_2 x,y,z; - + is >> x >> y >> z; if(is) r = Root_for_spheres_2_3(x,y,z); diff --git a/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_root_for_sphere_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_root_for_sphere_2_3.h index dd88eebea870..4197bb0de58c 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_root_for_sphere_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_root_for_sphere_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -30,38 +30,38 @@ namespace CGAL { template < class AK > -inline -Comparison_result +inline +Comparison_result compare_x(const typename AK::Root_for_spheres_2_3& r1, - const typename AK::Root_for_spheres_2_3& r2) + const typename AK::Root_for_spheres_2_3& r2) { return AK().compare_x_object()(r1, r2); } template < class AK > -inline -Comparison_result +inline +Comparison_result compare_y(const typename AK::Root_for_spheres_2_3& r1, - const typename AK::Root_for_spheres_2_3& r2) + const typename AK::Root_for_spheres_2_3& r2) { return AK().compare_y_object()(r1, r2); } template < class AK > -inline -Comparison_result +inline +Comparison_result compare_z(const typename AK::Root_for_spheres_2_3& r1, - const typename AK::Root_for_spheres_2_3& r2) + const typename AK::Root_for_spheres_2_3& r2) { return AK().compare_z_object()(r1, r2); } template < class AK > -inline -Comparison_result +inline +Comparison_result compare_xy(const typename AK::Root_for_spheres_2_3& r1, - const typename AK::Root_for_spheres_2_3& r2) + const typename AK::Root_for_spheres_2_3& r2) { return AK().compare_xy_object()(r1, r2); } template < class AK > -inline -Comparison_result +inline +Comparison_result compare_xyz(const typename AK::Root_for_spheres_2_3& r1, - const typename AK::Root_for_spheres_2_3& r2) + const typename AK::Root_for_spheres_2_3& r2) { return AK().compare_xyz_object()(r1, r2); } } //namespace CGAL diff --git a/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_1_3.h b/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_1_3.h index 2174a5c8d42d..9c3e71d143bd 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_1_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_1_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -28,23 +28,23 @@ namespace CGAL { template < class AK > -inline +inline typename AK::Polynomial_1_3 construct_polynomial_1_3(const typename AK::FT& a, - const typename AK::FT& b, - const typename AK::FT& c, - const typename AK::FT& d) + const typename AK::FT& b, + const typename AK::FT& c, + const typename AK::FT& d) { return AK().construct_polynomial_1_3_object()(a, b, c, d); } template < class AK > -inline +inline typename AK::Polynomials_for_line_3 construct_polynomials_for_line_3(const typename AK::FT& a1, - const typename AK::FT& b1, - const typename AK::FT& a2, - const typename AK::FT& b2, + const typename AK::FT& b1, + const typename AK::FT& a2, + const typename AK::FT& b2, const typename AK::FT& a3, - const typename AK::FT& b3) + const typename AK::FT& b3) { return AK().construct_polynomials_for_line_3_object()(a1, b1, a2, b2, a3, b3); } } //namespace CGAL diff --git a/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_2_3.h index e848ae98f15e..fe92dd922582 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/global_functions_on_roots_and_polynomials_2_3.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -28,12 +28,12 @@ namespace CGAL { template < class AK > -inline +inline typename AK::Polynomial_for_spheres_2_3 construct_polynomial_sphere_2_3(const typename AK::FT& xc, - const typename AK::FT& yc, - const typename AK::FT& zc, - const typename AK::FT& r_sq) + const typename AK::FT& yc, + const typename AK::FT& zc, + const typename AK::FT& r_sq) { return AK().construct_polynomial_sphere_2_3_object()(xc, yc, zc, r_sq); } } //namespace CGAL diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt index f6ef2f9d9438..284554d7787d 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_constructor.h b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_constructor.h index 1fdecb07e7bb..8fc04dd19840 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_constructor.h +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_constructor.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -35,11 +35,11 @@ void _test_constuctor(AK ak) ak.construct_polynomial_1_3_object(); typename AK::Construct_polynomials_for_line_3 theConstruct_line_3 = ak.construct_polynomials_for_line_3_object(); - + for(int i = 0; i < 20 ; i++){ int x = theRandom.get_int(random_min,random_max); int y = theRandom.get_int(random_min,random_max); - int z = theRandom.get_int(random_min,random_max); + int z = theRandom.get_int(random_min,random_max); int r_sq = theRandom.get_int(random_min,random_max); int a = theRandom.get_int(random_min,random_max); int b = theRandom.get_int(random_min,random_max); @@ -69,5 +69,5 @@ void _test_constuctor(AK ak) assert(p_line_3.a3() == a3); assert(p_line_3.b3() == b3); } - + } diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_predicates.h b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_predicates.h index 14d139beedeb..3a35c0b728b5 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_predicates.h +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/include/CGAL/_test_predicates.h @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ @@ -36,12 +36,12 @@ void _test_solve(AK ak) ak.sign_at_object(); //Polynomial_for_spheres_2_3 - + std::vector< std::pair > res_sss1; theSolve(theConstruct_2_3(5, 5, 0, 25), - theConstruct_2_3(0, 5, 0, 100), + theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(7, 5, 0, 9), - std::back_inserter(res_sss1)); + std::back_inserter(res_sss1)); assert(res_sss1.size() == 1); assert(res_sss1[0].second == 2u); assert(res_sss1[0].first == Root_for_spheres_2_3(10, 5, 0)); @@ -50,14 +50,14 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_2_3(10, 5, 0, 25), - std::back_inserter(res_sss2)); + std::back_inserter(res_sss2)); assert(res_sss2.size() == 0); std::vector< std::pair > res_sss3; theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_2_3(10, 10, 0, 25), - std::back_inserter(res_sss3)); + std::back_inserter(res_sss3)); assert(res_sss3.size() == 1); assert(res_sss3[0].second == 2u); assert(res_sss3[0].first == Root_for_spheres_2_3(10, 5, 0)); @@ -66,7 +66,7 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_2_3(10, 5, 5, 25), - std::back_inserter(res_sss4)); + std::back_inserter(res_sss4)); assert(res_sss4.size() == 1); assert(res_sss4[0].second == 2u); assert(res_sss4[0].first == Root_for_spheres_2_3(10, 5, 0)); @@ -75,14 +75,14 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_2_3(10, 0, 5, 25), - std::back_inserter(res_sss5)); + std::back_inserter(res_sss5)); assert(res_sss5.size() == 0); std::vector< std::pair > res_sss6; theSolve(theConstruct_2_3(5, 0, 0, 100), theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(0, 0, 5, 100), - std::back_inserter(res_sss6)); + std::back_inserter(res_sss6)); assert(res_sss6.size() == 2); Root_of_2 res_sss6_r1 = make_root_of_2(FT(5,3),-FT(5,3),FT(10)); Root_of_2 res_sss6_r2 = make_root_of_2(FT(5,3),FT(5,3),FT(10)); @@ -95,20 +95,20 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(5, 0, 0, 25), theConstruct_2_3(0, 5, 0, 25), theConstruct_2_3(0, 0, 5, 25), - std::back_inserter(res_sss_7)); + std::back_inserter(res_sss_7)); assert(res_sss_7.size() == 2); assert(res_sss_7[0].second == 1u); assert(res_sss_7[0].first == Root_for_spheres_2_3(0, 0, 0)); assert(res_sss_7[1].second == 1u); - assert(res_sss_7[1].first == Root_for_spheres_2_3(Root_of_2(FT(10,3)), - Root_of_2(FT(10,3)), + assert(res_sss_7[1].first == Root_for_spheres_2_3(Root_of_2(FT(10,3)), + Root_of_2(FT(10,3)), Root_of_2(FT(10,3)))); std::vector< std::pair > res_sss_8; theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), - std::back_inserter(res_sss_8)); + std::back_inserter(res_sss_8)); assert(res_sss_8.size() == 1); assert(res_sss_8[0].second == 2u); assert(res_sss_8[0].first == Root_for_spheres_2_3(10, 5, 0)); @@ -117,17 +117,17 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_2_3(0, 5, 0, 125), - std::back_inserter(res_sss9)); + std::back_inserter(res_sss9)); assert(res_sss9.size() == 0); //Polynomial_1_3 Polynomial_for_spheres_2_3 - + // 2 spheres and a plane std::vector< std::pair > res_ssp_1; theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_ssp_1)); + std::back_inserter(res_ssp_1)); assert(res_ssp_1.size() == 1); assert(res_ssp_1[0].second == 2u); assert(res_ssp_1[0].first == Root_for_spheres_2_3(10, 5, 0)); @@ -136,7 +136,7 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 100), theConstruct_2_3(20, 5, 0, 100), theConstruct_1_3(1, -3, 3, 5), - std::back_inserter(res_ssp_2)); + std::back_inserter(res_ssp_2)); assert(res_ssp_2.size() == 1); assert(res_ssp_2[0].second == 2u); assert(res_ssp_2[0].first == Root_for_spheres_2_3(10, 5, 0)); @@ -145,14 +145,14 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 29), theConstruct_2_3(5, 0, 0, 29), theConstruct_1_3(0, 0, 1, 5), - std::back_inserter(res_ssp_3)); + std::back_inserter(res_ssp_3)); assert(res_ssp_3.size() == 0); std::vector< std::pair > res_ssp_4; theSolve(theConstruct_2_3(0, 5, 0, FT(75,2)), theConstruct_2_3(5, 0, 0, FT(75,2)), theConstruct_1_3(0, 0, 1, -5), - std::back_inserter(res_ssp_4)); + std::back_inserter(res_ssp_4)); assert(res_ssp_4.size() == 1); assert(res_ssp_4[0].second == 2u); assert(res_ssp_4[0].first == Root_for_spheres_2_3(FT(5,2), FT(5,2), 5)); @@ -161,7 +161,7 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 5, 0, 50), theConstruct_2_3(5, 0, 0, 50), theConstruct_1_3(0, 0, 1, -5), - std::back_inserter(res_ssp_5)); + std::back_inserter(res_ssp_5)); assert(res_ssp_5.size() == 2); assert(res_ssp_5[0].second == 1u); assert(res_ssp_5[0].first == Root_for_spheres_2_3(0,0,5)); @@ -172,7 +172,7 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(5, 5, 5, 25), theConstruct_2_3(5, 5, 5, 25), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_ssp_6)); + std::back_inserter(res_ssp_6)); assert(res_ssp_6.size() == 1); assert(res_ssp_6[0].second == 2u); assert(res_ssp_6[0].first == Root_for_spheres_2_3(5, 5, 0)); @@ -181,28 +181,28 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(5, 5, 5, 25), theConstruct_2_3(3, 5, 7, 100), theConstruct_1_3(1, 1, 1, 10), - std::back_inserter(res_ssp_7)); + std::back_inserter(res_ssp_7)); assert(res_ssp_7.size() == 0); - + std::vector< std::pair > res_ssp_8; theSolve(theConstruct_2_3(5, 5, 5, 25), theConstruct_2_3(3, 5, 7, 40), theConstruct_1_3(1, 1, 1, -10), - std::back_inserter(res_ssp_8)); + std::back_inserter(res_ssp_8)); assert(res_ssp_8.size() == 2); assert(res_ssp_8[0].second == 1u); assert(res_ssp_8[1].second == 1u); Root_of_2 res_ssp_8_x1 = make_root_of_2(FT(101,24),FT(1,24),FT(1453)); Root_of_2 res_ssp_8_x2 = make_root_of_2(FT(101,24),-FT(1,24),FT(1453)); Root_of_2 res_ssp_8_y1 = make_root_of_2(FT(10,3),-FT(1,12),FT(1453)); - Root_of_2 res_ssp_8_y2 = make_root_of_2(FT(10,3),FT(1,12),FT(1453)); + Root_of_2 res_ssp_8_y2 = make_root_of_2(FT(10,3),FT(1,12),FT(1453)); Root_of_2 res_ssp_8_z1 = make_root_of_2(FT(59,24),FT(1,24),FT(1453)); Root_of_2 res_ssp_8_z2 = make_root_of_2(FT(59,24),-FT(1,24),FT(1453)); - Root_for_spheres_2_3 res_ssp_8_sol2 = Root_for_spheres_2_3(res_ssp_8_x1, - res_ssp_8_y1, + Root_for_spheres_2_3 res_ssp_8_sol2 = Root_for_spheres_2_3(res_ssp_8_x1, + res_ssp_8_y1, res_ssp_8_z1); - Root_for_spheres_2_3 res_ssp_8_sol1 = Root_for_spheres_2_3(res_ssp_8_x2, - res_ssp_8_y2, + Root_for_spheres_2_3 res_ssp_8_sol1 = Root_for_spheres_2_3(res_ssp_8_x2, + res_ssp_8_y2, res_ssp_8_z2); assert(res_ssp_8[0].first == res_ssp_8_sol1); assert(res_ssp_8[1].first == res_ssp_8_sol2); @@ -211,14 +211,14 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(5, 5, 5, 25), theConstruct_2_3(3, 5, 7, 100), theConstruct_1_3(1, 1, 1, -10), - std::back_inserter(res_ssp_9)); + std::back_inserter(res_ssp_9)); assert(res_ssp_9.size() == 0); std::vector< std::pair > res_ssp_10; theSolve(theConstruct_2_3(5, 0, 0, 100), theConstruct_2_3(0, 0, 0, 100), theConstruct_1_3(1, 2, 3, 100), - std::back_inserter(res_ssp_10)); + std::back_inserter(res_ssp_10)); assert(res_ssp_10.size() == 0); // 1 sphere and 2 plane @@ -226,14 +226,14 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(5, 10, 10, 5000), theConstruct_1_3(2, 4, 6, 50), theConstruct_1_3(1, 2, 3, 100), - std::back_inserter(res_spp_1)); + std::back_inserter(res_spp_1)); assert(res_spp_1.size() == 0); std::vector< std::pair > res_spp_2; theSolve(theConstruct_2_3(0, 0, 0, 9), theConstruct_1_3(1, 0, 0, -3), theConstruct_1_3(2, 0, 0, -6), - std::back_inserter(res_spp_2)); + std::back_inserter(res_spp_2)); assert(res_spp_2.size() == 1); assert(res_spp_2[0].second == 2u); assert(res_spp_2[0].first == Root_for_spheres_2_3(3, 0, 0)); @@ -242,18 +242,18 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(0, 0, 0, 1), theConstruct_1_3(1, 0, 0, 0), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_spp_3)); + std::back_inserter(res_spp_3)); assert(res_spp_3.size() == 2); assert(res_spp_3[0].second == 1u); assert(res_spp_3[0].first == Root_for_spheres_2_3(0,-1,0)); assert(res_spp_3[1].second == 1u); - assert(res_spp_3[1].first == Root_for_spheres_2_3(0,1,0)); + assert(res_spp_3[1].first == Root_for_spheres_2_3(0,1,0)); std::vector< std::pair > res_spp_4; theSolve(theConstruct_2_3(0, 0, 0, 1), theConstruct_1_3(1, 1, 0, -1), theConstruct_1_3(1, -1, 0, 0), - std::back_inserter(res_spp_4)); + std::back_inserter(res_spp_4)); assert(res_spp_4.size() == 2); assert(res_spp_4[0].second == 1u); assert(res_spp_4[0].first == Root_for_spheres_2_3(FT(1,2),FT(1,2), @@ -266,7 +266,7 @@ void _test_solve(AK ak) theSolve(theConstruct_2_3(10, 10, 10, 25), theConstruct_1_3(1, 0, 0, 0), theConstruct_1_3(0, 1, 0, 0), - std::back_inserter(res_spp_5)); + std::back_inserter(res_spp_5)); assert(res_spp_5.size() == 0); // 1 circle and 1 plane && 1 plane and 1 circle @@ -274,46 +274,46 @@ void _test_solve(AK ak) // circle - plane std::vector< std::pair > res_cp_1; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - theConstruct_1_3(0,1,0,10), - std::back_inserter(res_cp_1)); + theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,10), + std::back_inserter(res_cp_1)); assert(res_cp_1.size() == 0); std::vector< std::pair > res_cp_2; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - theConstruct_1_3(1,0,0,1), - std::back_inserter(res_cp_2)); + theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(1,0,0,1), + std::back_inserter(res_cp_2)); assert(res_cp_2.size() == 1); assert(res_cp_2[0].second == 2u); assert(res_cp_2[0].first == Root_for_spheres_2_3(-1, 0, 0)); std::vector< std::pair > res_cp_3; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - theConstruct_1_3(1,0,0,0), - std::back_inserter(res_cp_3)); + theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(1,0,0,0), + std::back_inserter(res_cp_3)); assert(res_cp_3.size() == 2); assert(res_cp_3[0].second == 1u); - assert(res_cp_3[0].first == + assert(res_cp_3[0].first == Root_for_spheres_2_3(0, 0, -1)); assert(res_cp_3[1].second == 1u); - assert(res_cp_3[1].first == + assert(res_cp_3[1].first == Root_for_spheres_2_3(0, 0, 1)); // plane - circle std::vector< std::pair > res_pc_1; theSolve(theConstruct_1_3(0,1,0,10), - std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_pc_1)); + std::make_pair(theConstruct_2_3(0,0,0,1), + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_pc_1)); assert(res_pc_1.size() == 0); std::vector< std::pair > res_pc_2; theSolve(theConstruct_1_3(1,0,0,1), std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_pc_2)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_pc_2)); assert(res_pc_2.size() == 1); assert(res_pc_2[0].second == 2u); assert(res_pc_2[0].first == Root_for_spheres_2_3(-1, 0, 0)); @@ -321,61 +321,61 @@ void _test_solve(AK ak) std::vector< std::pair > res_pc_3; theSolve(theConstruct_1_3(1,0,0,0), std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_pc_3)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_pc_3)); assert(res_pc_3.size() == 2); assert(res_pc_3[0].second == 1u); - assert(res_pc_3[0].first == - Root_for_spheres_2_3(0, 0, -1)); + assert(res_pc_3[0].first == + Root_for_spheres_2_3(0, 0, -1)); assert(res_pc_3[1].second == 1u); - assert(res_pc_3[1].first == - Root_for_spheres_2_3(0, 0, 1)); - - // 1 circle and 1 sphere && 1 sphere and 1 circle + assert(res_pc_3[1].first == + Root_for_spheres_2_3(0, 0, 1)); + + // 1 circle and 1 sphere && 1 sphere and 1 circle // circle - sphere std::vector< std::pair > res_cs_1; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - theConstruct_2_3(2,2,2,1), - std::back_inserter(res_cs_1)); + theConstruct_1_3(0,1,0,0)), + theConstruct_2_3(2,2,2,1), + std::back_inserter(res_cs_1)); assert(res_cs_1.size() == 0); std::vector< std::pair > res_cs_2; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - theConstruct_2_3(2,0,0,1), - std::back_inserter(res_cs_2)); + theConstruct_1_3(0,1,0,0)), + theConstruct_2_3(2,0,0,1), + std::back_inserter(res_cs_2)); assert(res_cs_2.size() == 1); assert(res_cs_2[0].second == 2u); assert(res_cs_2[0].first == Root_for_spheres_2_3(1, 0, 0)); std::vector< std::pair > res_cs_3; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - theConstruct_2_3(1,0,0,1), - std::back_inserter(res_cs_3)); + theConstruct_1_3(0,1,0,0)), + theConstruct_2_3(1,0,0,1), + std::back_inserter(res_cs_3)); assert(res_cs_3.size() == 2); assert(res_cs_3[0].second == 1u); - assert(res_cs_3[0].first == + assert(res_cs_3[0].first == Root_for_spheres_2_3(FT(1,2), 0, make_root_of_2(FT(0),-FT(1,2),FT(3)))); assert(res_cs_3[1].second == 1u); - assert(res_cs_3[1].first == + assert(res_cs_3[1].first == Root_for_spheres_2_3(FT(1,2), 0, make_root_of_2(FT(0),FT(1,2),FT(3)))); // sphere - circle std::vector< std::pair > res_sc_1; theSolve(theConstruct_2_3(2,2,2,1), - std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_sc_1)); + std::make_pair(theConstruct_2_3(0,0,0,1), + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_sc_1)); assert(res_sc_1.size() == 0); std::vector< std::pair > res_sc_2; theSolve(theConstruct_2_3(2,0,0,1), std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_sc_2)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_sc_2)); assert(res_sc_2.size() == 1); assert(res_sc_2[0].second == 2u); assert(res_sc_2[0].first == Root_for_spheres_2_3(1, 0, 0)); @@ -383,72 +383,72 @@ void _test_solve(AK ak) std::vector< std::pair > res_sc_3; theSolve(theConstruct_2_3(1,0,0,1), std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_sc_3)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_sc_3)); assert(res_sc_3.size() == 2); assert(res_sc_3[0].second == 1u); - assert(res_sc_3[0].first == - Root_for_spheres_2_3(FT(1,2), 0, make_root_of_2(FT(0),-FT(1,2),FT(3)))); + assert(res_sc_3[0].first == + Root_for_spheres_2_3(FT(1,2), 0, make_root_of_2(FT(0),-FT(1,2),FT(3)))); assert(res_sc_3[1].second == 1u); - assert(res_sc_3[1].first == - Root_for_spheres_2_3(FT(1,2), 0, make_root_of_2(FT(0),FT(1,2),FT(3)))); - + assert(res_sc_3[1].first == + Root_for_spheres_2_3(FT(1,2), 0, make_root_of_2(FT(0),FT(1,2),FT(3)))); + // 2 circles std::vector< std::pair > res_cc_1; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,0)), std::make_pair(theConstruct_2_3(3,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_cc_1)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_cc_1)); assert(res_cc_1.size() == 0); std::vector< std::pair > res_cc_2; theSolve(std::make_pair(theConstruct_2_3(0,0,0,1), - theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,0)), std::make_pair(theConstruct_2_3(2,0,0,1), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_cc_2)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_cc_2)); assert(res_cc_2.size() == 1); assert(res_cc_2[0].second == 2u); assert(res_cc_2[0].first == Root_for_spheres_2_3(1, 0, 0)); std::vector< std::pair > res_cc_3; theSolve(std::make_pair(theConstruct_2_3(0,0,0,4), - theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,0)), std::make_pair(theConstruct_2_3(2,0,0,4), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_cc_3)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_cc_3)); assert(res_cc_3.size() == 2); assert(res_cc_3[0].second == 1u); - assert(res_cc_3[0].first == + assert(res_cc_3[0].first == Root_for_spheres_2_3(1, 0, make_root_of_2(FT(0),FT(-1),FT(3)))); assert(res_cc_3[1].second == 1u); - assert(res_cc_3[1].first == + assert(res_cc_3[1].first == Root_for_spheres_2_3(1, 0, make_root_of_2(FT(0),FT(1),FT(3)))); - + // A QUESTION: WHAT IS THE MULTIPLICITY OF A CIRCLE vs CIRCLE SOLUTION? // FOR NOW, IF THE NUMBER OF SOLUTION IS 1, THE MULTIPLICITY IS 2 // IF THE NUMBER OF SOLUTION IS 2, THE MULTIPLICITY IS 1 std::vector< std::pair > res_cc_4; theSolve(std::make_pair(theConstruct_2_3(0,0,0,4), - theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,0)), std::make_pair(theConstruct_2_3(2,0,0,4), - theConstruct_1_3(3,5,0,-3)), - std::back_inserter(res_cc_4)); + theConstruct_1_3(3,5,0,-3)), + std::back_inserter(res_cc_4)); assert(res_cc_4.size() == 2); assert(res_cc_4[0].second == 1u); - assert(res_cc_4[0].first == + assert(res_cc_4[0].first == Root_for_spheres_2_3(1, 0, make_root_of_2(FT(0),FT(-1),FT(3)))); assert(res_cc_4[1].second == 1u); - assert(res_cc_4[1].first == + assert(res_cc_4[1].first == Root_for_spheres_2_3(1, 0, make_root_of_2(FT(0),FT(1),FT(3)))); std::vector< std::pair > res_cc_5; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,0)), std::make_pair(theConstruct_2_3(24,0,0,169), - theConstruct_1_3(0,1,0,0)), - std::back_inserter(res_cc_5)); + theConstruct_1_3(0,1,0,0)), + std::back_inserter(res_cc_5)); assert(res_cc_5.size() == 2); assert(res_cc_5[0].second == 1u); assert(res_cc_5[0].first == Root_for_spheres_2_3(12, 0, -5)); @@ -457,28 +457,28 @@ void _test_solve(AK ak) std::vector< std::pair > res_cc_6; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(0,1,0,0)), + theConstruct_1_3(0,1,0,0)), std::make_pair(theConstruct_2_3(24,0,0,169), - theConstruct_1_3(1,3,1,-17)), - std::back_inserter(res_cc_6)); + theConstruct_1_3(1,3,1,-17)), + std::back_inserter(res_cc_6)); assert(res_cc_6.size() == 1); assert(res_cc_6[0].second == 2u); assert(res_cc_6[0].first == Root_for_spheres_2_3(12, 0, 5)); std::vector< std::pair > res_cc_7; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(0,0,1,-1)), + theConstruct_1_3(0,0,1,-1)), std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(0,0,1,1)), - std::back_inserter(res_cc_7)); + theConstruct_1_3(0,0,1,1)), + std::back_inserter(res_cc_7)); assert(res_cc_7.size() == 0); std::vector< std::pair > res_cc_8; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(1,1,0,-5)), + theConstruct_1_3(1,1,0,-5)), std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(1,-1,0,5)), - std::back_inserter(res_cc_8)); + theConstruct_1_3(1,-1,0,5)), + std::back_inserter(res_cc_8)); assert(res_cc_8.size() == 2); assert(res_cc_8[0].second == 1u); assert(res_cc_8[0].first == Root_for_spheres_2_3(0, 5, -12)); @@ -487,20 +487,20 @@ void _test_solve(AK ak) std::vector< std::pair > res_cc_9; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(0,1,0,-13)), + theConstruct_1_3(0,1,0,-13)), std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(1,0,0,0)), - std::back_inserter(res_cc_9)); + theConstruct_1_3(1,0,0,0)), + std::back_inserter(res_cc_9)); assert(res_cc_9.size() == 1); assert(res_cc_9[0].second == 2u); assert(res_cc_9[0].first == Root_for_spheres_2_3(0, 13, 0)); std::vector< std::pair > res_cc_10; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(2,1,-1,-13)), + theConstruct_1_3(2,1,-1,-13)), std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(1,0,0,0)), - std::back_inserter(res_cc_10)); + theConstruct_1_3(1,0,0,0)), + std::back_inserter(res_cc_10)); assert(res_cc_10.size() == 2); assert(res_cc_10[0].second == 1u); assert(res_cc_10[0].first == Root_for_spheres_2_3(0, 0, -13)); @@ -509,113 +509,113 @@ void _test_solve(AK ak) std::vector< std::pair > res_cc_11; theSolve(std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(2,1,0,-13)), + theConstruct_1_3(2,1,0,-13)), std::make_pair(theConstruct_2_3(0,0,0,169), - theConstruct_1_3(1,0,0,0)), - std::back_inserter(res_cc_11)); + theConstruct_1_3(1,0,0,0)), + std::back_inserter(res_cc_11)); assert(res_cc_11.size() == 1); assert(res_cc_11[0].second == 2u); assert(res_cc_11[0].first == Root_for_spheres_2_3(0, 13, 0)); - + // only Polynomial_1_3 std::vector< std::pair > res_p12; theSolve(theConstruct_1_3(1, 1, 0, -5), - theConstruct_1_3(1, -1, 0, 5), + theConstruct_1_3(1, -1, 0, 5), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p12)); + std::back_inserter(res_p12)); assert(res_p12.size() == 1); assert(res_p12[0].second == 1u); assert(res_p12[0].first == Root_for_spheres_2_3(0, 5, 0)); - + std::vector< std::pair > res_p13; theSolve(theConstruct_1_3(0, 1, 0, -5), - theConstruct_1_3(1, -1, 0, 5), + theConstruct_1_3(1, -1, 0, 5), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p13)); + std::back_inserter(res_p13)); assert(res_p13.size() == 1); assert(res_p13[0].second == 1u); assert(res_p13[0].first == Root_for_spheres_2_3(0, 5, 0)); std::vector< std::pair > res_p14; theSolve(theConstruct_1_3(1, -1, 0, 5), - theConstruct_1_3(0, 1, 0, -5), + theConstruct_1_3(0, 1, 0, -5), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p14)); + std::back_inserter(res_p14)); assert(res_p14.size() == 1); assert(res_p14[0].second == 1u); assert(res_p14[0].first == Root_for_spheres_2_3(0, 5, 0)); std::vector< std::pair > res_p15; theSolve(theConstruct_1_3(1, 0, 0, 0), - theConstruct_1_3(1, -1, 0, 5), + theConstruct_1_3(1, -1, 0, 5), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p15)); + std::back_inserter(res_p15)); assert(res_p15.size() == 1); assert(res_p15[0].second == 1u); assert(res_p15[0].first == Root_for_spheres_2_3(0, 5, 0)); std::vector< std::pair > res_p16; theSolve(theConstruct_1_3(1, -1, 0, 5), - theConstruct_1_3(1, 0, 0, 0), + theConstruct_1_3(1, 0, 0, 0), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p16)); + std::back_inserter(res_p16)); assert(res_p16.size() == 1); assert(res_p16[0].second == 1u); assert(res_p16[0].first == Root_for_spheres_2_3(0, 5, 0)); std::vector< std::pair > res_p17; theSolve(theConstruct_1_3(0, 1, 0, -5), - theConstruct_1_3(1, 0, 0, 0), + theConstruct_1_3(1, 0, 0, 0), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p17)); + std::back_inserter(res_p17)); assert(res_p17.size() == 1); assert(res_p17[0].second == 1u); assert(res_p17[0].first == Root_for_spheres_2_3(0, 5, 0)); std::vector< std::pair > res_p18; theSolve(theConstruct_1_3(1, 0, 0, 0), - theConstruct_1_3(0, 1, 0, -5), + theConstruct_1_3(0, 1, 0, -5), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p18)); + std::back_inserter(res_p18)); assert(res_p18.size() == 1); assert(res_p18[0].second == 1u); assert(res_p18[0].first == Root_for_spheres_2_3(0, 5, 0)); std::vector< std::pair > res_p20; theSolve(theConstruct_1_3(1, 0, 0, 0), - theConstruct_1_3(1, 0, 0, 5), + theConstruct_1_3(1, 0, 0, 5), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p20)); + std::back_inserter(res_p20)); assert(res_p20.size() == 0); - + std::vector< std::pair > res_p22; theSolve(theConstruct_1_3(0, 1, 0, -5), - theConstruct_1_3(0, 1, 0, 0), + theConstruct_1_3(0, 1, 0, 0), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p22)); + std::back_inserter(res_p22)); assert(res_p22.size() == 0); - + std::vector< std::pair > res_p24; theSolve(theConstruct_1_3(1, -1, 0, 5), - theConstruct_1_3(2, -2, 0, 15), + theConstruct_1_3(2, -2, 0, 15), theConstruct_1_3(0, 0, 1, 0), - std::back_inserter(res_p24)); + std::back_inserter(res_p24)); assert(res_p24.size() == 0); std::vector< std::pair > res_p25; theSolve(theConstruct_1_3(1, 0, 0, -5), - theConstruct_1_3(0, 1, 0, -3), + theConstruct_1_3(0, 1, 0, -3), theConstruct_1_3(0, 0, 1, -2), - std::back_inserter(res_p25)); + std::back_inserter(res_p25)); assert(res_p25.size() == 1); assert(res_p25[0].second == 1u); assert(res_p25[0].first == Root_for_spheres_2_3(5, 3, 2)); std::vector< std::pair > res_p26; theSolve(theConstruct_1_3(3, 1, 1, -18), - theConstruct_1_3(1, 2, 1, -16), + theConstruct_1_3(1, 2, 1, -16), theConstruct_1_3(1, 1, 1, -12), - std::back_inserter(res_p26)); + std::back_inserter(res_p26)); assert(res_p26.size() == 1); assert(res_p26[0].second == 1u); assert(res_p26[0].first == Root_for_spheres_2_3(3, 4, 5)); @@ -625,7 +625,7 @@ void _test_solve(AK ak) std::cout << "random_seed = " << random_seed << std::endl; CGAL::Random theRandom(random_seed); int random_max = 5; - int random_min = -5; + int random_min = -5; typedef typename AK::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; @@ -660,11 +660,11 @@ void _test_solve(AK ak) p2 = Polynomial_1_3(b1,b2,b3,b4); p3 = Polynomial_1_3(c1,c2,c3,c4); } while(CGAL::same_solutions(p1,p2) || - CGAL::same_solutions(p1,p3) || + CGAL::same_solutions(p1,p3) || CGAL::same_solutions(p2,p3)); - std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; - std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; - std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; + std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; + std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; + std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; std::vector< std::pair > res_ppp; theSolve(p1,p2,p3,std::back_inserter(res_ppp)); if(res_ppp.size() != 0) { @@ -697,27 +697,27 @@ void _test_solve(AK ak) } while((a4 <= 0) || (b4 <= 0) || (c4 <= 0) || (s1 == s2) || (s2 == s3) || (s1 == s3)); - if(CGAL::AlgebraicSphereFunctors::intersect(s1,s2)) { + if(CGAL::AlgebraicSphereFunctors::intersect(s1,s2)) { Polynomial_1_3 p1 = CGAL::AlgebraicSphereFunctors::plane_from_2_spheres(s1,s2); - if(CGAL::AlgebraicSphereFunctors::intersect(s2,s3)) { - Polynomial_1_3 p2 = CGAL::AlgebraicSphereFunctors::plane_from_2_spheres(s2,s3); - if(CGAL::same_solutions(p1,p2)) { - const FT sq_d1 = CGAL::square(p1.a()*s1.a() + p1.b()*s1.b() + - p1.c()*s1.c() + p1.d()) / - (CGAL::square(p1.a()) + CGAL::square(p1.b()) + CGAL::square(p1.c())); - const FT r1_sqr = s1.r_sq() - sq_d1; - const FT sq_d2 = CGAL::square(p2.a()*s2.a() + p2.b()*s2.b() + - p2.c()*s2.c() + p2.d()) / - (CGAL::square(p2.a()) + CGAL::square(p2.b()) + CGAL::square(p2.c())); - const FT r2_sqr = s2.r_sq() - sq_d2; - if(r1_sqr == r2_sqr) if(r1_sqr != 0) { --i; continue; } + if(CGAL::AlgebraicSphereFunctors::intersect(s2,s3)) { + Polynomial_1_3 p2 = CGAL::AlgebraicSphereFunctors::plane_from_2_spheres(s2,s3); + if(CGAL::same_solutions(p1,p2)) { + const FT sq_d1 = CGAL::square(p1.a()*s1.a() + p1.b()*s1.b() + + p1.c()*s1.c() + p1.d()) / + (CGAL::square(p1.a()) + CGAL::square(p1.b()) + CGAL::square(p1.c())); + const FT r1_sqr = s1.r_sq() - sq_d1; + const FT sq_d2 = CGAL::square(p2.a()*s2.a() + p2.b()*s2.b() + + p2.c()*s2.c() + p2.d()) / + (CGAL::square(p2.a()) + CGAL::square(p2.b()) + CGAL::square(p2.c())); + const FT r2_sqr = s2.r_sq() - sq_d2; + if(r1_sqr == r2_sqr) if(r1_sqr != 0) { --i; continue; } } } } - std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; - std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; - std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; + std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; + std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; + std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; std::vector< std::pair > res_sss; theSolve(s1,s2,s3,std::back_inserter(res_sss)); if(res_sss.size() == 1) { @@ -738,7 +738,7 @@ void _test_solve(AK ak) assert(res_sss[0].first.y() < res_sss[1].first.y()); } else { assert(res_sss[0].first.z() < res_sss[1].first.z()); - } + } } } @@ -765,19 +765,19 @@ void _test_solve(AK ak) p = Polynomial_1_3(c1,c2,c3,c4); } while((a4 <= 0) || (b4 <= 0) || (s1 == s2) || (c1 == 0 && c2 == 0 && c3 == 0)); - + if(CGAL::AlgebraicSphereFunctors::intersect(s1,s2)) { Polynomial_1_3 p1 = CGAL::AlgebraicSphereFunctors::plane_from_2_spheres(s1,s2); if(CGAL::same_solutions(p1,p)) { const FT sq_d1 = CGAL::square(p1.a()*s1.a() + p1.b()*s1.b() +p1.c()*s1.c() + p1.d()) / (CGAL::square(p1.a()) + CGAL::square(p1.b()) + CGAL::square(p1.c())); const FT r1_sqr = s1.r_sq() - sq_d1; - if(r1_sqr != 0) { --i; continue; } + if(r1_sqr != 0) { --i; continue; } } } - - - std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; + + + std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; std::vector< std::pair > res_ssp; @@ -800,7 +800,7 @@ void _test_solve(AK ak) assert(res_ssp[0].first.y() < res_ssp[1].first.y()); } else { assert(res_ssp[0].first.z() < res_ssp[1].first.z()); - } + } } } @@ -828,17 +828,17 @@ void _test_solve(AK ak) } while((a1 == 0 && a2 == 0 && a3 == 0) || (b1 == 0 && b2 == 0 && b3 == 0) || (c4 <= 0) || (CGAL::same_solutions(p1,p2))); - + if(CGAL::same_solutions(p1,p2)) { const FT sq_d1 = CGAL::square(p1.a()*s.a() + p1.b()*s.b() +p1.c()*s.c() + p1.d()) / (CGAL::square(p1.a()) + CGAL::square(p1.b()) + CGAL::square(p1.c())); const FT r1_sqr = s.r_sq() - sq_d1; if(r1_sqr != 0) { --i; continue; } } - - std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; - std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; - std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; + + std::cout << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl; + std::cout << b1 << " " << b2 << " " << b3 << " " << b4 << std::endl; + std::cout << c1 << " " << c2 << " " << c3 << " " << c4 << std::endl; std::vector< std::pair > res_spp; theSolve(p1,p2,s,std::back_inserter(res_spp)); if(res_spp.size() == 1) { @@ -859,7 +859,7 @@ void _test_solve(AK ak) assert(res_spp[0].first.y() < res_spp[1].first.y()); } else { assert(res_spp[0].first.z() < res_spp[1].first.z()); - } + } } } @@ -882,9 +882,9 @@ void _test_solve(AK ak) l = Polynomials_for_line_3(a1,b1,a2,b2,a3,b3); s = Polynomial_for_spheres_2_3(c1,c2,c3,c4); } while((l.degenerated()) || (c4 <= 0)); - std::cout << a1 << " " << a2 << " " << a3 << std::endl; - std::cout << b1 << " " << b2 << " " << b3 << std::endl; - std::cout << c1 << " " << c2 << " " << c3 << std::endl; + std::cout << a1 << " " << a2 << " " << a3 << std::endl; + std::cout << b1 << " " << b2 << " " << b3 << std::endl; + std::cout << c1 << " " << c2 << " " << c3 << std::endl; std::vector< std::pair > res_ls; theSolve(l,s,std::back_inserter(res_ls)); if(res_ls.size() == 1) { @@ -902,7 +902,7 @@ void _test_solve(AK ak) assert(res_ls[0].first.y() < res_ls[1].first.y()); } else { assert(res_ls[0].first.z() < res_ls[1].first.z()); - } + } } } @@ -914,43 +914,43 @@ void _test_sign_at(AK ak) typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3; typename AK::Sign_at theSigh_at = ak.sign_at_object(); - + //Polynomial_for_spheres_2_3 typename AK::Construct_polynomial_for_spheres_2_3 theConstruct_2_3 = ak.construct_polynomial_for_spheres_2_3_object(); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(-5,5,5)) == CGAL::ZERO); + Root_for_spheres_2_3(-5,5,5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(15,5,5)) == CGAL::ZERO); + Root_for_spheres_2_3(15,5,5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,15,5)) == CGAL::ZERO); + Root_for_spheres_2_3(5,15,5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,-5,5)) == CGAL::ZERO); + Root_for_spheres_2_3(5,-5,5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,5,-5)) == CGAL::ZERO); + Root_for_spheres_2_3(5,5,-5)) == CGAL::ZERO); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,5,15)) == CGAL::ZERO); - + Root_for_spheres_2_3(5,5,15)) == CGAL::ZERO); + assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,5,5)) == CGAL::NEGATIVE); + Root_for_spheres_2_3(5,5,5)) == CGAL::NEGATIVE); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,16,5)) == CGAL::POSITIVE); + Root_for_spheres_2_3(5,16,5)) == CGAL::POSITIVE); assert(theSigh_at(theConstruct_2_3(5, 5, 5, 100), - Root_for_spheres_2_3(5,-6,5)) == CGAL::POSITIVE); + Root_for_spheres_2_3(5,-6,5)) == CGAL::POSITIVE); //Polynomial_1_3 typename AK::Construct_polynomial_1_3 theConstruct_1_3 = ak.construct_polynomial_1_3_object(); assert(theSigh_at(theConstruct_1_3(1, 2, 3, 6), - Root_for_spheres_2_3(-1,-1,-1)) == CGAL::ZERO); + Root_for_spheres_2_3(-1,-1,-1)) == CGAL::ZERO); assert(theSigh_at(theConstruct_1_3(1, 2, 3, 6), - Root_for_spheres_2_3(2,-1,-2)) == CGAL::ZERO); + Root_for_spheres_2_3(2,-1,-2)) == CGAL::ZERO); assert(theSigh_at(theConstruct_1_3(1, 2, 3, 6), - Root_for_spheres_2_3(1,1,1)) != CGAL::ZERO); + Root_for_spheres_2_3(1,1,1)) != CGAL::ZERO); assert(theSigh_at(theConstruct_1_3(1, 2, 3, 6), - Root_for_spheres_2_3(0,0,0)) != CGAL::ZERO); + Root_for_spheres_2_3(0,0,0)) != CGAL::ZERO); } template void _test_critical_points_circle( const std::pair< @@ -1018,12 +1018,12 @@ void _test_critical_points_circle( const std::pair< assert(intersection_test_x_2.size() == 0); } } - + // Y if(!(is_zero(c.second.a()) && is_zero(c.second.c()))) { ry_min = theY_critical_points(c,true); ry_max = theY_critical_points(c,false); - + assert(theSigh_at(c.first, ry_min) == CGAL::ZERO); assert(theSigh_at(c.second, ry_min) == CGAL::ZERO); assert(theSigh_at(c.first, ry_max) == CGAL::ZERO); @@ -1068,7 +1068,7 @@ void _test_critical_points_circle( const std::pair< if(!(is_zero(c.second.a()) && is_zero(c.second.b()))) { rz_min = theZ_critical_points(c,true); rz_max = theZ_critical_points(c,false); - + assert(theSigh_at(c.first, rz_min) == CGAL::ZERO); assert(theSigh_at(c.second, rz_min) == CGAL::ZERO); assert(theSigh_at(c.first, rz_max) == CGAL::ZERO); @@ -1129,25 +1129,25 @@ void _test_critical_points(AK ak) ak.y_critical_points_object(); typename AK::Z_critical_points theZ_critical_points = ak.z_critical_points_object(); - + for(int i = 0; i < 20; i++){ int x = theRandom.get_int(random_min,random_max); int y = theRandom.get_int(random_min,random_max); int z = theRandom.get_int(random_min,random_max); int r = theRandom.get_int(1,random_max); - + assert(theX_critical_points(theConstruct_2_3(x,y,z,r*r),true) - == Root_for_spheres_2_3(x - r, y, z)); + == Root_for_spheres_2_3(x - r, y, z)); assert(theX_critical_points(theConstruct_2_3(x,y,z,r*r),false) - == Root_for_spheres_2_3(x + r, y, z)); + == Root_for_spheres_2_3(x + r, y, z)); assert(theY_critical_points(theConstruct_2_3(x,y,z,r*r),true) - == Root_for_spheres_2_3(x, y - r, z)); + == Root_for_spheres_2_3(x, y - r, z)); assert(theY_critical_points(theConstruct_2_3(x,y,z,r*r),false) - == Root_for_spheres_2_3(x, y + r, z)); + == Root_for_spheres_2_3(x, y + r, z)); assert(theZ_critical_points(theConstruct_2_3(x,y,z,r*r),true) - == Root_for_spheres_2_3(x, y, z - r)); + == Root_for_spheres_2_3(x, y, z - r)); assert(theZ_critical_points(theConstruct_2_3(x,y,z,r*r),false) - == Root_for_spheres_2_3(x, y, z + r)); + == Root_for_spheres_2_3(x, y, z + r)); } typedef typename AK::Polynomial_for_spheres_2_3 @@ -1167,7 +1167,7 @@ void _test_critical_points(AK ak) Polynomial_1_3(a,b,c,0)); _test_critical_points_circle(ec); } - + } template @@ -1184,13 +1184,13 @@ void _test_compare_Root_for_spheres(AK ak) typename AK::Compare_x theCompare_x = ak.compare_x_object(); - + typename AK::Compare_y theCompare_y = ak.compare_y_object(); - + typename AK::Compare_z theCompare_z = ak.compare_z_object(); - + typename AK::Compare_xy theCompare_xy = ak.compare_xy_object(); @@ -1199,10 +1199,10 @@ void _test_compare_Root_for_spheres(AK ak) for (int i = 0; i < 100; i++){ Root_for_spheres_2_3 r1(theRandom.get_int(random_min,random_max), - theRandom.get_int(random_min,random_max), + theRandom.get_int(random_min,random_max), theRandom.get_int(random_min,random_max)); Root_for_spheres_2_3 r2(theRandom.get_int(random_min,random_max), - theRandom.get_int(random_min,random_max), + theRandom.get_int(random_min,random_max), theRandom.get_int(random_min,random_max)); if(r1.x() > r2.x()){ assert(theCompare_x(r1, r2) == CGAL::LARGER); @@ -1211,27 +1211,27 @@ void _test_compare_Root_for_spheres(AK ak) else if(r1.x() == r2.x()){ assert(theCompare_x(r1, r2) == CGAL::EQUAL); if(r1.y() < r2.y()){ - assert(theCompare_y(r1, r2) == CGAL::SMALLER); - assert(theCompare_xy(r1, r2) == CGAL::SMALLER); + assert(theCompare_y(r1, r2) == CGAL::SMALLER); + assert(theCompare_xy(r1, r2) == CGAL::SMALLER); } else if(r1.y() > r2.y()){ - assert(theCompare_y(r1, r2) == CGAL::LARGER); - assert(theCompare_xy(r1, r2) == CGAL::LARGER); + assert(theCompare_y(r1, r2) == CGAL::LARGER); + assert(theCompare_xy(r1, r2) == CGAL::LARGER); } else { - assert(theCompare_y(r1, r2) == CGAL::EQUAL); - assert(theCompare_xy(r1, r2) == CGAL::EQUAL); + assert(theCompare_y(r1, r2) == CGAL::EQUAL); + assert(theCompare_xy(r1, r2) == CGAL::EQUAL); if(r1.z() < r2.z()){ - assert(theCompare_z(r1, r2) == CGAL::SMALLER); - assert(theCompare_xyz(r1, r2) == CGAL::SMALLER); + assert(theCompare_z(r1, r2) == CGAL::SMALLER); + assert(theCompare_xyz(r1, r2) == CGAL::SMALLER); } else if(r1.z() > r2.z()){ - assert(theCompare_z(r1, r2) == CGAL::LARGER); - assert(theCompare_xyz(r1, r2) == CGAL::LARGER); + assert(theCompare_z(r1, r2) == CGAL::LARGER); + assert(theCompare_xyz(r1, r2) == CGAL::LARGER); } else { assert(theCompare_z(r1, r2) == CGAL::EQUAL); - assert(theCompare_xyz(r1, r2) == CGAL::EQUAL); - } + assert(theCompare_xyz(r1, r2) == CGAL::EQUAL); + } } } else { diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/test_Algebraic_kernel_for_spheres.cpp b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/test_Algebraic_kernel_for_spheres.cpp index 323c8ada98a3..4923a376e803 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/test_Algebraic_kernel_for_spheres.cpp +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/test_Algebraic_kernel_for_spheres.cpp @@ -4,9 +4,9 @@ // This file is part of CGAL (www.cgal.org). // // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) // // $URL$ diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Alpha_shapes_2.txt b/Alpha_shapes_2/doc/Alpha_shapes_2/Alpha_shapes_2.txt index 19452b7187bf..545d92b3924f 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Alpha_shapes_2.txt +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Alpha_shapes_2.txt @@ -2,14 +2,14 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_2D_Alpha_Shapes \anchor I1ChapterAlphashapes2D \cgalAutoToc \author Tran Kai Frank Da -\image html alphashape.png -\image latex alphashape.png +\image html alphashape.png +\image latex alphashape.png Assume we are given a set \f$ S\f$ of points in 2D or 3D and we would like to have something like "the shape formed by these points". This is @@ -81,7 +81,7 @@ easily. Furthermore, we can select an appropriate \f$ \alpha\f$-shape from a finite number of different \f$ \alpha\f$-shapes and corresponding \f$ \alpha\f$-values. -\section I1_SectAlpha_Shape_2 Functionality +\section I1_SectAlpha_Shape_2 Functionality The class `Alpha_shape_2
` represents the family of \f$ \alpha\f$-shapes of points in a plane for all positive @@ -116,7 +116,7 @@ the \f$ \alpha\f$-shape (no singular edges). The current implementation is static, that is after its construction points cannot be inserted or removed. -\section I1_SectDtClass2D Concepts and Models +\section I1_SectDtClass2D Concepts and Models We currently do not specify concepts for the underlying triangulation type. Models that work for a basic alpha shape are the classes @@ -219,6 +219,6 @@ results will suffer from round-off problems. \cgalExample{Alpha_shapes_2/ex_periodic_alpha_shapes_2.cpp} -*/ +*/ } /* namespace CGAL */ diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h index 60ff817f0597..6b74bd264917 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h @@ -1,33 +1,33 @@ - + namespace CGAL { /*! \ingroup PkgAlphaShapes2Ref -The class `Alpha_shape_2` represents the family of -\f$ \alpha\f$-shapes of points in a plane for all positive -\f$ \alpha\f$. It maintains the underlying triangulation `Dt` which -represents connectivity and order among its faces. Each -\f$ k\f$-dimensional face of the `Dt` is associated with -an interval that specifies for which values of \f$ \alpha\f$ the face -belongs to the \f$ \alpha\f$-shape. There are links between the intervals -and the \f$ k\f$-dimensional faces of the triangulation. +The class `Alpha_shape_2` represents the family of +\f$ \alpha\f$-shapes of points in a plane for all positive +\f$ \alpha\f$. It maintains the underlying triangulation `Dt` which +represents connectivity and order among its faces. Each +\f$ k\f$-dimensional face of the `Dt` is associated with +an interval that specifies for which values of \f$ \alpha\f$ the face +belongs to the \f$ \alpha\f$-shape. There are links between the intervals +and the \f$ k\f$-dimensional faces of the triangulation. -Note that this class is at the same time used for basic and -for weighted Alpha Shapes. +Note that this class is at the same time used for basic and +for weighted Alpha Shapes. The modifying functions `Alpha_shape_2::insert()` and `Alpha_shape_2::remove()` will overwrite the one inherited from the underlying triangulation class `Dt`. At the moment, only the static version is implemented. -\tparam Dt must be either `Delaunay_triangulation_2` or `Regular_triangulation_2`. +\tparam Dt must be either `Delaunay_triangulation_2` or `Regular_triangulation_2`. Note that `Dt::Geom_traits`, `Dt::Vertex`, and `Dt::Face` must be model the concepts `AlphaShapeTraits_2`, -`AlphaShapeVertex_2` and `AlphaShapeFace_2`, respectively. +`AlphaShapeVertex_2` and `AlphaShapeFace_2`, respectively. -\tparam ExactAlphaComparisonTag is a tag that, when set to -\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. This is useful -when the underlying triangulation is instantiated with an exact predicates inexact constructions -kernel. By default the `ExactAlphaComparisonTag` is set to \link Tag_false `Tag_false`\endlink as it induces a small +\tparam ExactAlphaComparisonTag is a tag that, when set to +\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. This is useful +when the underlying triangulation is instantiated with an exact predicates inexact constructions +kernel. By default the `ExactAlphaComparisonTag` is set to \link Tag_false `Tag_false`\endlink as it induces a small overhead. Note that the tag `ExactAlphaComparisonTag` is currently ignored (meaning that the code will behave as if `ExactAlphaComparisonTag` were set to \link Tag_false `Tag_false`\endlink) if `Dt::Geom_traits::FT` is not a floating point number type as this strategy @@ -61,40 +61,40 @@ along with a lazy predicate evaluation. \cgalHeading{I/O} -The I/O operators are defined for `std::iostream`. The format for the iostream -is an internal format. +The I/O operators are defined for `std::iostream`. The format for the iostream +is an internal format. \cgalHeading{Implementation} -The set of intervals associated with the -\f$ k\f$-dimensional faces of the underlying triangulation are -stored in `multimaps`. +The set of intervals associated with the +\f$ k\f$-dimensional faces of the underlying triangulation are +stored in `multimaps`. -The cross links between the intervals and the \f$ k\f$-dimensional faces of the -triangulation are realized using methods in the \f$ k\f$-dimensional faces -themselves. +The cross links between the intervals and the \f$ k\f$-dimensional faces of the +triangulation are realized using methods in the \f$ k\f$-dimensional faces +themselves. -`Alpha_shape_2::alpha_find()` uses linear search, while -`Alpha_shape_2::alpha_lower_bound()` and `Alpha_shape_2::alpha_upper_bound()` -use binary search. -`Alpha_shape_2::number_of_solid_components()` performs a graph traversal and takes time -linear in the number of faces of the underlying triangulation. -`Alpha_shape_2::find_optimal_alpha()` uses binary search and takes time -\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points. +`Alpha_shape_2::alpha_find()` uses linear search, while +`Alpha_shape_2::alpha_lower_bound()` and `Alpha_shape_2::alpha_upper_bound()` +use binary search. +`Alpha_shape_2::number_of_solid_components()` performs a graph traversal and takes time +linear in the number of faces of the underlying triangulation. +`Alpha_shape_2::find_optimal_alpha()` uses binary search and takes time +\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points. */ template< typename Dt, typename ExactAlphaComparisonTag > class Alpha_shape_2 : public Dt { public: -/// \name Types +/// \name Types /// @{ /*! -the alpha shape traits type. +the alpha shape traits type. it has to derive from a triangulation traits class. For example `Dt::Point` is a point class. -*/ -typedef unspecified_type Gt; +*/ +typedef unspecified_type Gt; /*! the number type of alpha values. @@ -116,8 +116,8 @@ It must be noted that an object of type `FT` is valid as long as the alpha shape it is valid and has not been modified. For convenience, classical comparison operators are provided for the type `FT`. -*/ -typedef Gt::FT FT; +*/ +typedef Gt::FT FT; /*! The point type. @@ -128,265 +128,265 @@ shapes, `Point` will be equal to `Gt::Weighted_point_2`. typedef Dt::Point Point; /*! -The size type. -*/ -typedef unspecified_type size_type; +The size type. +*/ +typedef unspecified_type size_type; /*! -A bidirectional and non-mutable iterator that allow to traverse -the increasing sequence of different \f$ \alpha\f$-values. -\pre Its `value_type` is `FT`. -*/ -typedef unspecified_type Alpha_iterator; +A bidirectional and non-mutable iterator that allow to traverse +the increasing sequence of different \f$ \alpha\f$-values. +\pre Its `value_type` is `FT`. +*/ +typedef unspecified_type Alpha_iterator; /*! -A bidirectional and non-mutable iterator that allow to traverse -the vertices which belongs to the \f$ \alpha\f$-shape for the current \f$ \alpha\f$. -\pre Its `value_type` is `Dt::Vertex_handle`. -*/ -typedef unspecified_type Alpha_shape_vertices_iterator; +A bidirectional and non-mutable iterator that allow to traverse +the vertices which belongs to the \f$ \alpha\f$-shape for the current \f$ \alpha\f$. +\pre Its `value_type` is `Dt::Vertex_handle`. +*/ +typedef unspecified_type Alpha_shape_vertices_iterator; /*! -A bidirectional and non-mutable iterator that allow to traverse -the edges which belongs to the \f$ \alpha\f$-shape for the current \f$ \alpha\f$. -\pre Its `value_type` is `Dt::Edge`. -*/ -typedef unspecified_type Alpha_shape_edges_iterator; +A bidirectional and non-mutable iterator that allow to traverse +the edges which belongs to the \f$ \alpha\f$-shape for the current \f$ \alpha\f$. +\pre Its `value_type` is `Dt::Edge`. +*/ +typedef unspecified_type Alpha_shape_edges_iterator; /*! -Distinguishes the different cases for classifying a \f$ k\f$-dimensional face -of the underlying triangulation of the \f$ \alpha\f$-shape. -*/ +Distinguishes the different cases for classifying a \f$ k\f$-dimensional face +of the underlying triangulation of the \f$ \alpha\f$-shape. +*/ enum Classification_type {EXTERIOR, /**< if the face does not belong to the alpha-complex. */ - SINGULAR, /**< if the face belongs to the boundary of the alpha-shape, + SINGULAR, /**< if the face belongs to the boundary of the alpha-shape, but is not incident to any 2-dimensional face of the alpha-complex */ - REGULAR, /**< if the face belongs to the boundary of the alpha-shape + REGULAR, /**< if the face belongs to the boundary of the alpha-shape and is incident to a 2-dimensional face of the alpha-complex */ - INTERIOR /**< if the face belongs to the alpha-complex, but does + INTERIOR /**< if the face belongs to the alpha-complex, but does not belong to the boundary of the alpha-shape. */ -}; +}; /*! -In general, an alpha shape can be disconnected and contain many singular edges -or vertices. Its regularized version is formed by the set of regular edges -and their vertices. -*/ +In general, an alpha shape can be disconnected and contain many singular edges +or vertices. Its regularized version is formed by the set of regular edges +and their vertices. +*/ enum Mode {GENERAL, - REGULARIZED}; + REGULARIZED}; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -Introduces an empty alpha-shape for a positive \f$ \alpha\f$-value -`alpha`. -\pre `alpha` \f$ \geq~0\f$. -*/ -Alpha_shape_2(FT alpha = 0, -Mode m = GENERAL); - -/*! -Builds an alpha shape of mode `m` from the triangulation `dt` -for a positive \f$ \alpha\f$-value `alpha`. -\attention This operation destroys the triangulation. -\pre `alpha` \f$ \geq~0\f$. -*/ -Alpha_shape_2( -Dt& dt, -FT alpha = 0, -Mode m = GENERAL); - -/*! -Initializes the family of alpha-shapes with the points in the range -`[first,last)` and -introduces an \f$ \alpha\f$-shape for a positive \f$ \alpha\f$-value -`alpha`. -\tparam InputIterator must be an input iterator with the value type `Point`. -\pre `alpha` \f$ \geq0\f$. -*/ -template < class InputIterator > -Alpha_shape_2( -InputIterator first, -InputIterator last, -const FT& alpha = 0, -Mode m = GENERAL); - -/// @} - -/// \name Operations +Introduces an empty alpha-shape for a positive \f$ \alpha\f$-value +`alpha`. +\pre `alpha` \f$ \geq~0\f$. +*/ +Alpha_shape_2(FT alpha = 0, +Mode m = GENERAL); + +/*! +Builds an alpha shape of mode `m` from the triangulation `dt` +for a positive \f$ \alpha\f$-value `alpha`. +\attention This operation destroys the triangulation. +\pre `alpha` \f$ \geq~0\f$. +*/ +Alpha_shape_2( +Dt& dt, +FT alpha = 0, +Mode m = GENERAL); + +/*! +Initializes the family of alpha-shapes with the points in the range +`[first,last)` and +introduces an \f$ \alpha\f$-shape for a positive \f$ \alpha\f$-value +`alpha`. +\tparam InputIterator must be an input iterator with the value type `Point`. +\pre `alpha` \f$ \geq0\f$. +*/ +template < class InputIterator > +Alpha_shape_2( +InputIterator first, +InputIterator last, +const FT& alpha = 0, +Mode m = GENERAL); + +/// @} + +/// \name Operations /// @{ /*! -Initialize the family of alpha-shapes with the points in the range -`[first,last)`. Returns the number of inserted points. +Initialize the family of alpha-shapes with the points in the range +`[first,last)`. Returns the number of inserted points. -If the function is applied to an non-empty family of alpha-shape, it is cleared -before initialization. -\tparam InputIterator must be an input iterator with the value type `Point`. -*/ -template < class InputIterator > -std::ptrdiff_t make_alpha_shape( -InputIterator first, -InputIterator last); +If the function is applied to an non-empty family of alpha-shape, it is cleared +before initialization. +\tparam InputIterator must be an input iterator with the value type `Point`. +*/ +template < class InputIterator > +std::ptrdiff_t make_alpha_shape( +InputIterator first, +InputIterator last); /*! -Clears the structure. -*/ -void -clear(); +Clears the structure. +*/ +void +clear(); /*! -Sets the \f$ \alpha\f$-value to `alpha`. -Returns the previous \f$ \alpha\f$-value. -\pre `alpha` \f$ \geq0\f$. -*/ -FT -set_alpha(const FT& alpha); +Sets the \f$ \alpha\f$-value to `alpha`. +Returns the previous \f$ \alpha\f$-value. +\pre `alpha` \f$ \geq0\f$. +*/ +FT +set_alpha(const FT& alpha); /*! -Returns the current \f$ \alpha\f$-value. -*/ -const FT& -get_alpha(void) const; +Returns the current \f$ \alpha\f$-value. +*/ +const FT& +get_alpha(void) const; /*! -Returns the `n`-th \f$\alpha\f$-value, sorted in an increasing order. -\pre `n` \f$ <\f$ number of alphas. -*/ -const FT& get_nth_alpha(size_type n) const; +Returns the `n`-th \f$\alpha\f$-value, sorted in an increasing order. +\pre `n` \f$ <\f$ number of alphas. +*/ +const FT& get_nth_alpha(size_type n) const; /*! -Returns the number of different alpha-values. -*/ -size_type number_of_alphas() const; +Returns the number of different alpha-values. +*/ +size_type number_of_alphas() const; /*! -Sets the mode to its general or regularized version. -Returns the previous mode. -*/ -Mode -set_mode(Mode m = GENERAL ); +Sets the mode to its general or regularized version. +Returns the previous mode. +*/ +Mode +set_mode(Mode m = GENERAL ); /*! -Returns the mode, that is either `GENERAL` or `REGULARIZED`. -*/ -Mode -get_mode(void) const; +Returns the mode, that is either `GENERAL` or `REGULARIZED`. +*/ +Mode +get_mode(void) const; /*! -Starts at -an arbitrary finite vertex which belongs to the \f$ \alpha\f$-shape for the current \f$ \alpha\f$. -*/ -Alpha_shape_vertices_iterator alpha_shape_vertices_begin(); +Starts at +an arbitrary finite vertex which belongs to the \f$ \alpha\f$-shape for the current \f$ \alpha\f$. +*/ +Alpha_shape_vertices_iterator alpha_shape_vertices_begin(); /*! -Past-the-end iterator. -*/ -Alpha_shape_vertices_iterator alpha_shape_vertices_end(); +Past-the-end iterator. +*/ +Alpha_shape_vertices_iterator alpha_shape_vertices_end(); /*! -Starts at -an arbitrary finite edge which belongs to the \f$ \alpha\f$-shape for the current -\f$ \alpha\f$. In regularized mode, edges are represented as a pair (f,i), where f is -an interior face of the \f$ \alpha\f$-shape. -*/ -Alpha_shape_edges_iterator alpha_shape_edges_begin(); +Starts at +an arbitrary finite edge which belongs to the \f$ \alpha\f$-shape for the current +\f$ \alpha\f$. In regularized mode, edges are represented as a pair (f,i), where f is +an interior face of the \f$ \alpha\f$-shape. +*/ +Alpha_shape_edges_iterator alpha_shape_edges_begin(); /*! -Past-the-end iterator. -*/ -Alpha_shape_edges_iterator alpha_shape_edges_end(); +Past-the-end iterator. +*/ +Alpha_shape_edges_iterator alpha_shape_edges_end(); -/// @} +/// @} -/// \name Predicates +/// \name Predicates /// @{ /*! -Locates a point `p` in the underlying triangulation and Classifies the -associated k-face with respect to the alpha shape. -*/ -Classification_type -classify(const Point& p, -const FT& alpha = get_alpha()) const; +Locates a point `p` in the underlying triangulation and Classifies the +associated k-face with respect to the alpha shape. +*/ +Classification_type +classify(const Point& p, +const FT& alpha = get_alpha()) const; /*! -Classifies the face `f` of the underlying triangulation with respect to the alpha shape. -*/ -Classification_type -classify(Face_handle f, const FT& alpha = get_alpha()) const; +Classifies the face `f` of the underlying triangulation with respect to the alpha shape. +*/ +Classification_type +classify(Face_handle f, const FT& alpha = get_alpha()) const; /*! Classifies the edge `e` of the underlying triangulation with respect to the alpha shape. -*/ -Classification_type -classify(Edge e, const FT& alpha = get_alpha()) const; +*/ +Classification_type +classify(Edge e, const FT& alpha = get_alpha()) const; /*! -Classifies the edge of the face `f` opposite to the vertex with index -`i` -of the underlying triangulation with respect to the alpha shape. -*/ -Classification_type -classify(Face_handle f, int i, const FT& alpha = get_alpha()) const; +Classifies the edge of the face `f` opposite to the vertex with index +`i` +of the underlying triangulation with respect to the alpha shape. +*/ +Classification_type +classify(Face_handle f, int i, const FT& alpha = get_alpha()) const; /*! -Classifies the vertex `v` of the underlying triangulation with respect to the alpha shape. -*/ -Classification_type -classify(Vertex_handle v, const FT& alpha = get_alpha()) const; +Classifies the vertex `v` of the underlying triangulation with respect to the alpha shape. +*/ +Classification_type +classify(Vertex_handle v, const FT& alpha = get_alpha()) const; -/// @} +/// @} -/// \name Traversal of the alpha-Values +/// \name Traversal of the alpha-Values /// @{ /*! -Returns an iterator that allows to traverse the -sorted sequence of \f$ \alpha\f$-values of the family of alpha shapes. -*/ -Alpha_iterator alpha_begin() const; +Returns an iterator that allows to traverse the +sorted sequence of \f$ \alpha\f$-values of the family of alpha shapes. +*/ +Alpha_iterator alpha_begin() const; /*! -Returns the corresponding past-the-end iterator. -*/ -Alpha_iterator alpha_end() const; +Returns the corresponding past-the-end iterator. +*/ +Alpha_iterator alpha_end() const; /*! -Returns an iterator pointing to an element with \f$ \alpha\f$-value -`alpha`, or the corresponding past-the-end iterator if such -an element is not found. -*/ -Alpha_iterator alpha_find(const FT& alpha) const; +Returns an iterator pointing to an element with \f$ \alpha\f$-value +`alpha`, or the corresponding past-the-end iterator if such +an element is not found. +*/ +Alpha_iterator alpha_find(const FT& alpha) const; /*! -Returns an iterator pointing to the first element with -\f$ \alpha\f$-value not less than `alpha`. -*/ -Alpha_iterator alpha_lower_bound(const FT& alpha) const; +Returns an iterator pointing to the first element with +\f$ \alpha\f$-value not less than `alpha`. +*/ +Alpha_iterator alpha_lower_bound(const FT& alpha) const; /*! -Returns an iterator pointing to the first element with \f$ \alpha\f$-value -greater than `alpha`. -*/ -Alpha_iterator alpha_upper_bound(const FT& alpha) const; +Returns an iterator pointing to the first element with \f$ \alpha\f$-value +greater than `alpha`. +*/ +Alpha_iterator alpha_upper_bound(const FT& alpha) const; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the number of solid components of the alpha shape, that is, the number of -components of its regularized version. -*/ -size_type number_of_solid_components(const FT& alpha = get_alpha()) const; +Returns the number of solid components of the alpha shape, that is, the number of +components of its regularized version. +*/ +size_type number_of_solid_components(const FT& alpha = get_alpha()) const; /*! -Returns an iterator pointing to the first element with \f$ \alpha\f$-value -such that the alpha shape satisfies the following two properties: +Returns an iterator pointing to the first element with \f$ \alpha\f$-value +such that the alpha shape satisfies the following two properties: - All data points are either on the boundary or in the interior of the regularized version of the alpha shape. @@ -394,21 +394,21 @@ of the regularized version of the alpha shape. - The number of solid component of the alpha shape is equal to or smaller than `nb_components`. -If no such value is found, the iterator points to the first element with -\f$ \alpha\f$-value such that the alpha shape satisfies the second property. -*/ -Alpha_iterator find_optimal_alpha(size_type nb_components) const; +If no such value is found, the iterator points to the first element with +\f$ \alpha\f$-value such that the alpha shape satisfies the second property. +*/ +Alpha_iterator find_optimal_alpha(size_type nb_components) const; /*! -Inserts the alpha shape for the current \f$ \alpha\f$-value into the stream `os`. +Inserts the alpha shape for the current \f$ \alpha\f$-value into the stream `os`. \pre CGAL/IO/io.h must be included. -\pre The insert operator must be defined for `Point`. -\relates Alpha_shape_2 -*/ - ostream& operator<<(std::ostream& os, -const Alpha_shape_2
& A); +\pre The insert operator must be defined for `Point`. +\relates Alpha_shape_2 +*/ + ostream& operator<<(std::ostream& os, +const Alpha_shape_2
& A); /// @} diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h index 4252ec8dd4eb..fe8988c8f712 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h @@ -4,17 +4,17 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes2Ref -The class `Alpha_shape_face_base_2` is the default model for the concept `AlphaShapeFace_2`. +The class `Alpha_shape_face_base_2` is the default model for the concept `AlphaShapeFace_2`. -\tparam Traits has to be a model of `AlphaShapeTraits_2`. +\tparam Traits has to be a model of `AlphaShapeTraits_2`. -\tparam Fb has to be a model of `TriangulationFaceBase_2` (or `RegularTriangulationFaceBase_2`) -if `Alpha_shape_face_base_2` is intended to be used with an alpha-shape class based on a -`Delaunay_triangulation_2` (or a `Regular_triangulation_2`). +\tparam Fb has to be a model of `TriangulationFaceBase_2` (or `RegularTriangulationFaceBase_2`) +if `Alpha_shape_face_base_2` is intended to be used with an alpha-shape class based on a +`Delaunay_triangulation_2` (or a `Regular_triangulation_2`). -\tparam ExactAlphaComparisonTag is a tag that, when set to -\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description -provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink. +\tparam ExactAlphaComparisonTag is a tag that, when set to +\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description +provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink. \cgalModels `AlphaShapeFace_2` diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h index 33543e472702..2c0602ce5126 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h @@ -4,18 +4,18 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes2Ref -The class `Alpha_shape_vertex_base_2` is the default model for the concept -`AlphaShapeVertex_2`. +The class `Alpha_shape_vertex_base_2` is the default model for the concept +`AlphaShapeVertex_2`. -\tparam Traits has to be a model of `AlphaShapeTraits_2`. +\tparam Traits has to be a model of `AlphaShapeTraits_2`. -\tparam Vb has to be a model of `TriangulationVertexBase_2` (or `RegularTriangulationVertexBase_2`) -if `Alpha_shape_vertex_base_2` is intended to be used with an alpha-shape class based on a -`Delaunay_triangulation_2` (or a `Regular_triangulation_2`). +\tparam Vb has to be a model of `TriangulationVertexBase_2` (or `RegularTriangulationVertexBase_2`) +if `Alpha_shape_vertex_base_2` is intended to be used with an alpha-shape class based on a +`Delaunay_triangulation_2` (or a `Regular_triangulation_2`). -\tparam ExactAlphaComparisonTag is a tag that, when set to -\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description -provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink. +\tparam ExactAlphaComparisonTag is a tag that, when set to +\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description +provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink. \cgalModels `AlphaShapeVertex_2` diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h index 330f343719b2..76d97be2dc2f 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h @@ -15,88 +15,88 @@ The concept `AlphaShapeFace_2` describes the requirements for the base face of a class AlphaShapeFace_2 { public: -/// \name Types +/// \name Types /// @{ /*! -A container type to get (and put) the three special values -(\f$ \alpha_1, \alpha_2, \alpha_3\f$) associated with an alpha shape edge. -*/ -typedef unspecified_type Interval_3; +A container type to get (and put) the three special values +(\f$ \alpha_1, \alpha_2, \alpha_3\f$) associated with an alpha shape edge. +*/ +typedef unspecified_type Interval_3; /*! A coordinate type. -The type must provide a copy constructor, assignment, comparison -operators, negation, multiplication, division and allow the -declaration and initialization with a small integer constant -(cf. requirements for number types). An obvious choice would be -coordinate type of the point class -*/ -typedef unspecified_type FT; +The type must provide a copy constructor, assignment, comparison +operators, negation, multiplication, division and allow the +declaration and initialization with a small integer constant +(cf. requirements for number types). An obvious choice would be +coordinate type of the point class +*/ +typedef unspecified_type FT; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -AlphaShapeFace_2(); +default constructor. +*/ +AlphaShapeFace_2(); /*! -constructor setting the incident vertices. -*/ -AlphaShapeFace_2(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2); +constructor setting the incident vertices. +*/ +AlphaShapeFace_2(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2); /*! -constructor setting the incident vertices and the neighboring faces. -*/ -AlphaShapeFace_2(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Face_handle& n0, const Face_handle& n1, const Face_handle& n2); +constructor setting the incident vertices and the neighboring faces. +*/ +AlphaShapeFace_2(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Face_handle& n0, const Face_handle& n1, const Face_handle& n2); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the interval associated with the edge indexed with \f$ i\f$, which contains -three alpha values -\f$ \alpha_1 \leq\alpha_2 \leq\alpha_3\f$, such as for -\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the edge indexed with \f$ i\f$ is -attached but singular, -for \f$ \alpha\f$ between \f$ \alpha_2\f$ and \f$ \alpha_3\f$, the edge is regular, and for \f$ \alpha\f$ -greater than \f$ \alpha_3\f$, the edge is interior. -*/ -Interval_3 get_ranges(const int& i); +returns the interval associated with the edge indexed with \f$ i\f$, which contains +three alpha values +\f$ \alpha_1 \leq\alpha_2 \leq\alpha_3\f$, such as for +\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the edge indexed with \f$ i\f$ is +attached but singular, +for \f$ \alpha\f$ between \f$ \alpha_2\f$ and \f$ \alpha_3\f$, the edge is regular, and for \f$ \alpha\f$ +greater than \f$ \alpha_3\f$, the edge is interior. +*/ +Interval_3 get_ranges(const int& i); /*! -return the alpha value, under which the alpha shape contains the -face. -*/ -FT get_alpha(); +return the alpha value, under which the alpha shape contains the +face. +*/ +FT get_alpha(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the interval associated with the edge indexed with \f$ i\f$, which contains three -alpha values -\f$ \alpha_1 \leq\alpha_2 \leq\alpha_3\f$, such as for -\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the edge indexed with \f$ i\f$ is -attached but singular, -for \f$ \alpha\f$ between \f$ \alpha_2\f$ and \f$ \alpha_3\f$, the edge is regular, and for \f$ \alpha\f$ -greater than \f$ \alpha_3\f$, the edge is interior. -*/ -void set_ranges(const int& i, const Interval_3& V); +sets the interval associated with the edge indexed with \f$ i\f$, which contains three +alpha values +\f$ \alpha_1 \leq\alpha_2 \leq\alpha_3\f$, such as for +\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the edge indexed with \f$ i\f$ is +attached but singular, +for \f$ \alpha\f$ between \f$ \alpha_2\f$ and \f$ \alpha_3\f$, the edge is regular, and for \f$ \alpha\f$ +greater than \f$ \alpha_3\f$, the edge is interior. +*/ +void set_ranges(const int& i, const Interval_3& V); /*! -sets the alpha value, under which the alpha shape contains the -face. -*/ -void set_alpha(FT A); +sets the alpha value, under which the alpha shape contains the +face. +*/ +void set_alpha(FT A); /// @} diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h index be6e2389a118..d613fc50e4d7 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h @@ -22,54 +22,54 @@ following. class AlphaShapeTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! A coordinate type. -The type must provide a copy constructor, assignment, comparison -operators, negation, multiplication, division and allow the -declaration and initialization with a small integer constant -(cf. requirements for number types). - An obvious choice would be coordinate type of the point class. -*/ -typedef unspecified_type FT; +The type must provide a copy constructor, assignment, comparison +operators, negation, multiplication, division and allow the +declaration and initialization with a small integer constant +(cf. requirements for number types). + An obvious choice would be coordinate type of the point class. +*/ +typedef unspecified_type FT; -/// @} +/// @} -/// \name Creation +/// \name Creation /// Only a default constructor is required. Note that further constructors can be provided. /// @{ /*! -A default constructor. -*/ - AlphaShapeTraits_2(); +A default constructor. +*/ + AlphaShapeTraits_2(); -/// @} +/// @} -/// \name Constructions by function objects +/// \name Constructions by function objects /// @{ /*! -Returns an object, which has to be able to compute the squared radius of the -circle of the points `p0, p1, p2` or the squared radius of smallest circle -of the points `p0, p1`, as `FT` associated with the metric used -by `Dt`. -*/ -Compute_squared_radius_2 compute_squared_radius_2_object(); +Returns an object, which has to be able to compute the squared radius of the +circle of the points `p0, p1, p2` or the squared radius of smallest circle +of the points `p0, p1`, as `FT` associated with the metric used +by `Dt`. +*/ +Compute_squared_radius_2 compute_squared_radius_2_object(); -/// @} +/// @} -/// \name Predicate by function object +/// \name Predicate by function object /// @{ /*! -Returns an object, which has to be able to compute the relative position of -point `test` to the smallest circle of the points `p0, p1`, using -the same metric as `Dt`. -*/ -Side_of_bounded_circle_2 side_of_bounded_circle_2_object(); +Returns an object, which has to be able to compute the relative position of +point `test` to the smallest circle of the points `p0, p1`, using +the same metric as `Dt`. +*/ +Side_of_bounded_circle_2 side_of_bounded_circle_2_object(); /// @} diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h index a9287eb5affa..7065f6e55ccf 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h @@ -14,63 +14,63 @@ The concept `AlphaShapeVertex_2` describes the requirements for the base vertex class AlphaShapeVertex_2 { public: -/// \name Types +/// \name Types /// @{ /*! -A coordinate type. -The type must provide a copy constructor, assignment, comparison -operators, negation, multiplication, division and allow the -declaration and initialization with a small integer constant -(cf. requirements for number types). An obvious choice would be -coordinate type of the point class. -*/ -typedef unspecified_type FT; - -/// @} - -/// \name Creation +A coordinate type. +The type must provide a copy constructor, assignment, comparison +operators, negation, multiplication, division and allow the +declaration and initialization with a small integer constant +(cf. requirements for number types). An obvious choice would be +coordinate type of the point class. +*/ +typedef unspecified_type FT; + +/// @} + +/// \name Creation /// @{ /*! -default constructor. -*/ -AlphaShapeVertex_2(); +default constructor. +*/ +AlphaShapeVertex_2(); /*! -constructor setting -the point. -*/ -AlphaShapeVertex_2(Point p); +constructor setting +the point. +*/ +AlphaShapeVertex_2(Point p); /*! -constructor setting the point associated to and an incident face. -*/ -AlphaShapeVertex_2(Point p, const Face_handle& ff); +constructor setting the point associated to and an incident face. +*/ +AlphaShapeVertex_2(Point p, const Face_handle& ff); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns two alpha values \f$ \alpha_1 \leq\alpha_2\f$, such as for -\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the vertex is attached but singular, and -for \f$ \alpha\f$ upper \f$ \alpha_2\f$, the vertex is regular. -*/ -std::pair< FT, FT > get_range(); +returns two alpha values \f$ \alpha_1 \leq\alpha_2\f$, such as for +\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the vertex is attached but singular, and +for \f$ \alpha\f$ upper \f$ \alpha_2\f$, the vertex is regular. +*/ +std::pair< FT, FT > get_range(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the alpha values \f$ \alpha_1 \leq\alpha_2\f$, such as for -\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the vertex is attached but singular, and -for \f$ \alpha\f$ upper \f$ \alpha_2\f$, the vertex is regular. -*/ -void set_range(std::pair< FT, FT > I); +sets the alpha values \f$ \alpha_1 \leq\alpha_2\f$, such as for +\f$ \alpha\f$ between \f$ \alpha_1\f$ and \f$ \alpha_2\f$, the vertex is attached but singular, and +for \f$ \alpha\f$ upper \f$ \alpha_2\f$, the vertex is regular. +*/ +void set_range(std::pair< FT, FT > I); /// @} diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h index 09c7597b39bd..6a7dab82f547 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h @@ -23,52 +23,52 @@ following. class WeightedAlphaShapeTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! A coordinate type. -The type must provide a copy constructor, assignment, comparison -operators, negation, multiplication, division and allow the -declaration and initialization with a small integer constant -(cf. requirements for number types). - An obvious choice would be coordinate type of the point class. -*/ -typedef unspecified_type FT; +The type must provide a copy constructor, assignment, comparison +operators, negation, multiplication, division and allow the +declaration and initialization with a small integer constant +(cf. requirements for number types). + An obvious choice would be coordinate type of the point class. +*/ +typedef unspecified_type FT; -/// @} +/// @} -/// \name Creation +/// \name Creation /// Only a default constructor is required. Note that further constructors can be provided. /// @{ /*! -A default constructor. -*/ - AlphaShapeTraits_2(); +A default constructor. +*/ + AlphaShapeTraits_2(); -/// @} +/// @} -/// \name Constructions by function objects +/// \name Constructions by function objects /// @{ /*! -Returns an object, which has to be able to compute the squared radius of the +Returns an object, which has to be able to compute the squared radius of the orthogonal circle of the points `p0, p1, p2` or the squared radius of the smallest orthogonal circle of the points `p0, p1`, as `FT`. -*/ +*/ Compute_squared_radius_smallest_orthogonal_circle_2 compute_squared_radius_smallest_orthogonal_circle_2_object(); -/// @} +/// @} -/// \name Predicate by function object +/// \name Predicate by function object /// @{ /*! Returns an object, which has to be able to compute the relative position of the point `test` to the smallest orthogonal circle of the points `p0, p1`. -*/ +*/ Power_side_of_bounded_power_circle_2 power_side_of_bounded_power_circle_2_object(); diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt b/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt index d6253461aa78..3203f1683908 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt @@ -25,8 +25,8 @@ This chapter presents a framework for alpha shapes. The description is based on the articles \cgalCite{em-tdas-94}, \cgalCite{e-was-92}. Alpha shapes are the generalization of the convex hull of a point set. Let \f$ S\f$ be a finite set of points in \f$ \mathbb{R}^d\f$, \f$ d = 2,3\f$ and \f$ \alpha\f$ a parameter with \f$ 0 \leq \alpha \leq -\infty\f$. For \f$ \alpha = \infty\f$, the \f$ \alpha\f$-shape is the convex hull of \f$ S\f$. As -\f$ \alpha\f$ decreases, the \f$ \alpha\f$-shape shrinks and develops cavities, as soon as +\infty\f$. For \f$ \alpha = \infty\f$, the \f$ \alpha\f$-shape is the convex hull of \f$ S\f$. As +\f$ \alpha\f$ decreases, the \f$ \alpha\f$-shape shrinks and develops cavities, as soon as a sphere of radius \f$ \sqrt{\alpha}\f$ can be put inside. Finally, for \f$ \alpha = 0\f$, the \f$ \alpha\f$-shape is the set \f$ S\f$ itself. @@ -34,9 +34,9 @@ We distinguish two versions of alpha shapes, one is based on the Delaunay triangulation and the other on its generalization, the regular triangulation, replacing the natural distance by the power to weighted points. The metric used determines an underlying triangulation of the alpha shape and thus, the version -computed. +computed. The basic alpha shape (cf. \ref I1_SectClassicAS2D) is associated with the Delaunay triangulation -(cf. Section \ref Section_2D_Triangulations_Delaunay "Delaunay Triangulations"). +(cf. Section \ref Section_2D_Triangulations_Delaunay "Delaunay Triangulations"). The weighted alpha shape (cf. \ref I1_SectWeightedAS2D ) is associated with the regular triangulation (cf. Section \ref Section_2D_Triangulations_Regular "Regular Triangulations"). diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt index 977ebf3923af..318bbe1dcc3e 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index 7c189a36514e..0f6fb0fed7fc 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -131,7 +131,7 @@ class Alpha_shape_2 : public Dt typedef typename Interval_face_map::value_type Interval_face; typedef typename Tds::Face::Interval_3 Interval3; - + typedef std::multimap< Interval3, Edge > Interval_edge_map; typedef typename Interval_edge_map::value_type Interval_edge; @@ -143,14 +143,14 @@ class Alpha_shape_2 : public Dt typedef std::pair const_Edge; typedef std::vector< Type_of_alpha > Alpha_spectrum; - + typedef std::vector< Segment > Vect_seg; typedef Unique_hash_map< Face_handle, bool > Marked_face_set; public: - typedef typename std::list< Vertex_handle >::iterator + typedef typename std::list< Vertex_handle >::iterator Alpha_shape_vertices_iterator; typedef typename std::list< Edge >::iterator Alpha_shape_edges_iterator; @@ -163,17 +163,17 @@ class Alpha_shape_2 : public Dt // Distinguishes the different cases for classifying a // k-dimensional face of the underlying Delaunay triangulation of // the alpha-shape. - // + // // `EXTERIOR' if the face does not belong to the alpha-complex. - // + // // `SINGULAR' if the face belongs to the boundary of the // alpha-shape, but is not incident to any higher-dimensional // face of the alpha-complex - // + // // `REGULAR' if face belongs to the boundary of the alpha-shape // and is incident to a higher-dimensional face of the // alpha-complex - // + // // `INTERIOR' if the face belongs to the alpha-complex, but does // not belong to the boundary of the alpha-shape @@ -186,19 +186,19 @@ class Alpha_shape_2 : public Dt private: - // only finite edges and faces are inserted into the maps + // only finite edges and faces are inserted into the maps Interval_face_map _interval_face_map; Interval_edge_map _interval_edge_map; Interval_vertex_map _interval_vertex_map; Alpha_spectrum _alpha_spectrum; - + Type_of_alpha _alpha; Mode _mode; // should be constants Type_of_alpha Infinity; Type_of_alpha UNDEFINED; - + mutable std::list< Vertex_handle > Alpha_shape_vertices_list; mutable std::list< Edge > Alpha_shape_edges_list; @@ -207,106 +207,106 @@ class Alpha_shape_2 : public Dt public: //------------------------- CONSTRUCTORS ------------------------------ - + // Introduces an empty alpha-shape `A' for a positive // alpha-value `alpha'. Precondition: `alpha' >= 0. - Alpha_shape_2(Type_of_alpha alpha = Type_of_alpha(0), - Mode m = GENERAL) + Alpha_shape_2(Type_of_alpha alpha = Type_of_alpha(0), + Mode m = GENERAL) : _alpha(alpha), _mode(m), Infinity(-1), UNDEFINED(-2), use_vertex_cache(false), use_edge_cache(false) {} - + // Introduces an alpha-shape `A' for a positive alpha-value // `alpha' that is initialized with the points in the range // from first to last template - Alpha_shape_2(const InputIterator& first, - const InputIterator& last, - const Type_of_alpha& alpha = Type_of_alpha(0), - Mode m = GENERAL) + Alpha_shape_2(const InputIterator& first, + const InputIterator& last, + const Type_of_alpha& alpha = Type_of_alpha(0), + Mode m = GENERAL) : _alpha(alpha), _mode(m), Infinity(-1), UNDEFINED(-2) , use_vertex_cache(false), use_edge_cache(false) { Dt::insert(first, last); if (dimension() == 2) - { - // Compute the associated _interval_face_map - initialize_interval_face_map(); - - // Compute the associated _interval_edge_map - initialize_interval_edge_map(); - - // Compute the associated _interval_vertex_map - initialize_interval_vertex_map(); - - // merge the two maps - initialize_alpha_spectrum(); - } + { + // Compute the associated _interval_face_map + initialize_interval_face_map(); + + // Compute the associated _interval_edge_map + initialize_interval_edge_map(); + + // Compute the associated _interval_vertex_map + initialize_interval_vertex_map(); + + // merge the two maps + initialize_alpha_spectrum(); + } } // Introduces an alpha-shape `A' for a positive alpha-value - // `alpha' that is initialized with the triangulation + // `alpha' that is initialized with the triangulation Alpha_shape_2(Dt& dt, - const Type_of_alpha& alpha = Type_of_alpha(0), - Mode m = GENERAL) + const Type_of_alpha& alpha = Type_of_alpha(0), + Mode m = GENERAL) : _alpha(alpha), _mode(m), Infinity(-1), UNDEFINED(-2) , use_vertex_cache(false), use_edge_cache(false) { Dt::swap(dt); if (dimension() == 2) - { - // Compute the associated _interval_face_map - initialize_interval_face_map(); - - // Compute the associated _interval_edge_map - initialize_interval_edge_map(); - - // Compute the associated _interval_vertex_map - initialize_interval_vertex_map(); - - // merge the two maps - initialize_alpha_spectrum(); - } + { + // Compute the associated _interval_face_map + initialize_interval_face_map(); + + // Compute the associated _interval_edge_map + initialize_interval_edge_map(); + + // Compute the associated _interval_vertex_map + initialize_interval_vertex_map(); + + // merge the two maps + initialize_alpha_spectrum(); + } } - + public: //----------- OUTPUT POINTS CONNECTED BY PAIRS ---------------------- std::list Output(); - + std::ostream& op_ostream(std::ostream& os) const; - + //----------------------- OPERATIONS --------------------------------- // Introduces an alpha-shape `A' for a positive alpha-value // `alpha' that is initialized with the points in the range // from first to last - template < class InputIterator > - std::ptrdiff_t make_alpha_shape(const InputIterator& first, - const InputIterator& last) + template < class InputIterator > + std::ptrdiff_t make_alpha_shape(const InputIterator& first, + const InputIterator& last) { clear(); size_type n = Dt::insert(first, last); - + if (dimension() == 2) - { - // Compute the associated _interval_face_map - initialize_interval_face_map(); - - // Compute the associated _interval_edge_map - initialize_interval_edge_map(); - - // Compute the associated _interval_vertex_map - initialize_interval_vertex_map(); - - // merge the two maps - initialize_alpha_spectrum(); - } + { + // Compute the associated _interval_face_map + initialize_interval_face_map(); + + // Compute the associated _interval_edge_map + initialize_interval_edge_map(); + + // Compute the associated _interval_vertex_map + initialize_interval_vertex_map(); + + // merge the two maps + initialize_alpha_spectrum(); + } return n; } @@ -326,7 +326,7 @@ protected : public: - void clear() + void clear() { // clears the structure Dt::clear(); @@ -334,13 +334,13 @@ protected : _interval_face_map.clear(); _interval_edge_map.clear(); _interval_vertex_map.clear(); - + _alpha_spectrum.clear(); Alpha_shape_vertices_list.clear(); Alpha_shape_edges_list.clear(); - - set_alpha(Type_of_alpha(0)); + + set_alpha(Type_of_alpha(0)); set_mode(GENERAL); } @@ -348,43 +348,43 @@ protected : //----------------------- PRIVATE MEMBERS -------------------------- private: - - struct Less + + struct Less { - bool operator()(const Interval_edge& ie, - const Type_of_alpha& alpha) + bool operator()(const Interval_edge& ie, + const Type_of_alpha& alpha) { - return ie.first.first < alpha; + return ie.first.first < alpha; } - bool operator()( const Type_of_alpha& alpha, - const Interval_edge& ie) + bool operator()( const Type_of_alpha& alpha, + const Interval_edge& ie) { - return alpha < ie.first.first; + return alpha < ie.first.first; } - // Needed for STL implementations of upper_bound which in debug mode + // Needed for STL implementations of upper_bound which in debug mode // check sortedness of range - bool operator()(const Interval_edge& ie, - const Interval_edge& ie2) const + bool operator()(const Interval_edge& ie, + const Interval_edge& ie2) const { - return ie < ie2; + return ie < ie2; } }; - + //----------------------- ACCESS TO PRIVATE MEMBERS ----------------- private: - - - Type_of_alpha find_interval(const Face_handle& f) const + + + Type_of_alpha find_interval(const Face_handle& f) const { return f->get_alpha(); // return the value Alpha f the face f } - - Interval3 find_interval(const_Edge e) const + + Interval3 find_interval(const_Edge e) const { // corriger le parametrage return (e.first)->get_ranges(e.second); // return the Interval3 for the edge n @@ -395,7 +395,7 @@ protected : public: - Type_of_alpha set_alpha(const Type_of_alpha& alpha) + Type_of_alpha set_alpha(const Type_of_alpha& alpha) { // Sets the alpha-value to `alpha'. Precondition: `alpha' >= 0. // Returns the previous alpha @@ -406,23 +406,23 @@ protected : return previous_alpha; } - const Type_of_alpha& get_alpha() const + const Type_of_alpha& get_alpha() const { // Returns the current alpha-value. return _alpha; } - - const Type_of_alpha& get_nth_alpha(size_type n) const + + const Type_of_alpha& get_nth_alpha(size_type n) const { // Returns the n-th alpha-value. // n < size() if (! _alpha_spectrum.empty()) - return _alpha_spectrum[n]; + return _alpha_spectrum[n]; else - return UNDEFINED; + return UNDEFINED; } - - size_type number_of_alphas() const + + size_type number_of_alphas() const { // Returns the number of not necessary different alpha-values return _alpha_spectrum.size(); @@ -451,7 +451,7 @@ protected : public: - Mode set_mode(Mode mode = GENERAL ) + Mode set_mode(Mode mode = GENERAL ) { // Sets `A' to its general or regularized version. Returns the // previous mode. @@ -461,7 +461,7 @@ protected : return previous_mode; } - Mode get_mode() const + Mode get_mode() const { // Returns whether `A' is general or regularized. return _mode; @@ -479,14 +479,14 @@ update_alpha_shape_vertex_list()const; void update_alpha_shape_edges_list() const; - + //--------------------------------------------------------------------- public: Alpha_shape_vertices_iterator alpha_shape_vertices_begin() const - { + { if(!use_vertex_cache){ update_alpha_shape_vertex_list(); } @@ -536,96 +536,96 @@ update_alpha_shape_vertex_list()const; { return Alpha_shape_edges_list.end(); } -public: - +public: + // Traversal of the alpha-Values - // + // // The alpha shape class defines an iterator that allows to // visit the sorted sequence of alpha-values. This iterator is // non-mutable and bidirectional. Its value type is Type_of_alpha. - Alpha_iterator alpha_begin() const + Alpha_iterator alpha_begin() const { // Returns an iterator that allows to traverse the sorted sequence // of alpha-values of `A'. - return _alpha_spectrum.begin(); + return _alpha_spectrum.begin(); } - Alpha_iterator alpha_end() const + Alpha_iterator alpha_end() const { // Returns the corresponding past-the-end iterator. - return _alpha_spectrum.end(); + return _alpha_spectrum.end(); } - - Alpha_iterator alpha_find(const Type_of_alpha& alpha) const + + Alpha_iterator alpha_find(const Type_of_alpha& alpha) const { // Returns an iterator pointing to an element with alpha-value // `alpha', or the corresponding past-the-end iterator if such an // element is not found. return std::find(_alpha_spectrum.begin(), - _alpha_spectrum.end(), - alpha); + _alpha_spectrum.end(), + alpha); } - Alpha_iterator alpha_lower_bound(const Type_of_alpha& alpha) const + Alpha_iterator alpha_lower_bound(const Type_of_alpha& alpha) const { // Returns an iterator pointing to the first element with // alpha-value not less than `alpha'. return std::lower_bound(_alpha_spectrum.begin(), - _alpha_spectrum.end(), - alpha); + _alpha_spectrum.end(), + alpha); } - Alpha_iterator alpha_upper_bound(const Type_of_alpha& alpha) const + Alpha_iterator alpha_upper_bound(const Type_of_alpha& alpha) const { // Returns an iterator pointing to the first element with // alpha-value greater than `alpha'. return std::upper_bound(_alpha_spectrum.begin(), - _alpha_spectrum.end(), - alpha); + _alpha_spectrum.end(), + alpha); } //--------------------- PREDICATES ----------------------------------- - // the classification predicates take + // the classification predicates take // amortized const time if STL_STD::HASH_TABLES // O(log #alpha_shape ) otherwise - Classification_type classify(const Point& p ) const + Classification_type classify(const Point& p ) const { return classify( p, get_alpha()); } - - Classification_type classify(const Point& p, - const Type_of_alpha& alpha) const + + Classification_type classify(const Point& p, + const Type_of_alpha& alpha) const { // Classifies a point `p' with respect to `A'. Locate_type type; int i; Face_handle pFace = locate(p, type, i); - switch (type) - { - case VERTEX : return classify(pFace->vertex(i), alpha); - case EDGE : return classify(pFace, i, alpha); - case FACE : return classify(pFace, alpha); - case OUTSIDE_CONVEX_HULL : - case OUTSIDE_AFFINE_HULL : return EXTERIOR; - default : return EXTERIOR; - } + switch (type) + { + case VERTEX : return classify(pFace->vertex(i), alpha); + case EDGE : return classify(pFace, i, alpha); + case FACE : return classify(pFace, alpha); + case OUTSIDE_CONVEX_HULL : + case OUTSIDE_AFFINE_HULL : return EXTERIOR; + default : return EXTERIOR; + } } //--------------------------------------------------------------------- - Classification_type classify(const Face_handle& f) const + Classification_type classify(const Face_handle& f) const { // Classifies the face `f' of the underlying Delaunay // triangulation with respect to `A'. return classify(f, get_alpha()); } - - Classification_type classify(const Face_handle& f, - const Type_of_alpha& alpha) const + + Classification_type classify(const Face_handle& f, + const Type_of_alpha& alpha) const { // Classifies the face `f' of the underlying Delaunay // triangulation with respect to `A'. @@ -634,49 +634,49 @@ update_alpha_shape_vertex_list()const; // problem the operator [] is non-const if (is_infinite(f)) return EXTERIOR; - - // the version that computes the squared radius seems to be + + // the version that computes the squared radius seems to be // much faster - - return (find_interval(f) <= alpha) ? - INTERIOR : - EXTERIOR; + + return (find_interval(f) <= alpha) ? + INTERIOR : + EXTERIOR; } //--------------------------------------------------------------------- - + Classification_type classify(const Edge& edge) const - { + { return classify(edge.first, edge.second, get_alpha()); } - Classification_type classify(const Face_handle& f, - int i) const - { + Classification_type classify(const Face_handle& f, + int i) const + { return classify(f, i, get_alpha()); } Classification_type classify(const Edge& edge, - const Type_of_alpha& alpha) const - { + const Type_of_alpha& alpha) const + { return classify(edge.first, edge.second, alpha); } - Classification_type classify(const Face_handle& f, - int i, - const Type_of_alpha& alpha) const; + Classification_type classify(const Face_handle& f, + int i, + const Type_of_alpha& alpha) const; + - //--------------------------------------------------------------------- - Classification_type classify(const Vertex_handle& v) const + Classification_type classify(const Vertex_handle& v) const { return classify(v, get_alpha()); } Classification_type classify(const Vertex_handle& v, - const Type_of_alpha& alpha) const; + const Type_of_alpha& alpha) const; //--------------------- NB COMPONENTS --------------------------------- size_type @@ -691,7 +691,7 @@ update_alpha_shape_vertex_list()const; return number_of_solid_components(get_alpha()); } - size_type + size_type number_solid_components(const Type_of_alpha& /* alpha */) const { return number_of_solid_components(get_alpha()); @@ -703,8 +703,8 @@ update_alpha_shape_vertex_list()const; private: void traverse(const Face_handle& pFace, - Marked_face_set& marked_face_set, - const Type_of_alpha alpha) const; + Marked_face_set& marked_face_set, + const Type_of_alpha alpha) const; // class Line_face_circulator; @@ -712,7 +712,7 @@ update_alpha_shape_vertex_list()const; public: - Alpha_iterator find_optimal_alpha(size_type nb_components); + Alpha_iterator find_optimal_alpha(size_type nb_components); Type_of_alpha find_alpha_solid() const; @@ -746,7 +746,7 @@ update_alpha_shape_vertex_list()const; private: // prevent default copy constructor and default assigment - + Alpha_shape_2(const Alpha_shape_2& A); Alpha_shape_2& operator=(const Alpha_shape_2& A); @@ -765,8 +765,8 @@ update_alpha_shape_vertex_list()const; template < class Dt, class EACT > -void -Alpha_shape_2::initialize_interval_face_map() +void +Alpha_shape_2::initialize_interval_face_map() { Type_of_alpha alpha_f; @@ -778,23 +778,23 @@ Alpha_shape_2::initialize_interval_face_map() // cross references face_it->set_alpha(alpha_f); - } + } } //------------------------------------------------------------------------- template < class Dt, class EACT > -void -Alpha_shape_2::initialize_interval_edge_map() -{ +void +Alpha_shape_2::initialize_interval_edge_map() +{ Edge_iterator edge_it; Edge edge; // only finite faces - for( edge_it = edges_begin(); - edge_it != edges_end(); - ++edge_it) - { + for( edge_it = edges_begin(); + edge_it != edges_end(); + ++edge_it) + { Interval3 interval; edge = (*edge_it); @@ -802,82 +802,82 @@ Alpha_shape_2::initialize_interval_edge_map() int i = edge.second; Face_handle pNeighbor = pFace->neighbor(i); int Neigh_i = pNeighbor->index(pFace); - + // not on the convex hull - - if(!is_infinite(pFace) && !is_infinite(pNeighbor)) - { - Type_of_alpha squared_radius_Face = - find_interval(pFace); - Type_of_alpha squared_radius_Neighbor = - find_interval(pNeighbor); - if (squared_radius_Neighbor < squared_radius_Face) - { - edge = Edge(pNeighbor, Neigh_i); - Type_of_alpha coord_tmp = squared_radius_Face; - squared_radius_Face = squared_radius_Neighbor; - squared_radius_Neighbor = coord_tmp; - } - interval = (is_attached(pFace, i) || - is_attached(pNeighbor, Neigh_i)) ? - make_triple(UNDEFINED, - squared_radius_Face, - squared_radius_Neighbor): - make_triple(squared_radius(pFace, i), - squared_radius_Face, - squared_radius_Neighbor); - } - else - { // on the convex hull - - if(is_infinite(pFace)) - { - if (!is_infinite(pNeighbor)) - { - interval = (is_attached(pNeighbor, - Neigh_i)) ? - make_triple(UNDEFINED, - find_interval(pNeighbor), - Infinity): - make_triple(squared_radius(pNeighbor, - Neigh_i), - find_interval(pNeighbor), - Infinity); - edge = Edge(pNeighbor, Neigh_i); - } - else - { - // both faces are infinite by definition unattached - // the edge is finite by construction - CGAL_triangulation_precondition((is_infinite(pNeighbor) - && is_infinite(pFace))); - interval = make_triple(squared_radius(pFace, i), - Infinity, - Infinity); - } - } - else - { // is_infinite(pNeighbor) - - CGAL_triangulation_precondition((is_infinite(pNeighbor) - && !is_infinite(pFace))); - if (is_attached(pFace, i)) - interval = make_triple(UNDEFINED, - find_interval(pFace), - Infinity); - else - interval = make_triple(squared_radius(pFace, i), - find_interval(pFace), - Infinity); - - } - } - + + if(!is_infinite(pFace) && !is_infinite(pNeighbor)) + { + Type_of_alpha squared_radius_Face = + find_interval(pFace); + Type_of_alpha squared_radius_Neighbor = + find_interval(pNeighbor); + if (squared_radius_Neighbor < squared_radius_Face) + { + edge = Edge(pNeighbor, Neigh_i); + Type_of_alpha coord_tmp = squared_radius_Face; + squared_radius_Face = squared_radius_Neighbor; + squared_radius_Neighbor = coord_tmp; + } + interval = (is_attached(pFace, i) || + is_attached(pNeighbor, Neigh_i)) ? + make_triple(UNDEFINED, + squared_radius_Face, + squared_radius_Neighbor): + make_triple(squared_radius(pFace, i), + squared_radius_Face, + squared_radius_Neighbor); + } + else + { // on the convex hull + + if(is_infinite(pFace)) + { + if (!is_infinite(pNeighbor)) + { + interval = (is_attached(pNeighbor, + Neigh_i)) ? + make_triple(UNDEFINED, + find_interval(pNeighbor), + Infinity): + make_triple(squared_radius(pNeighbor, + Neigh_i), + find_interval(pNeighbor), + Infinity); + edge = Edge(pNeighbor, Neigh_i); + } + else + { + // both faces are infinite by definition unattached + // the edge is finite by construction + CGAL_triangulation_precondition((is_infinite(pNeighbor) + && is_infinite(pFace))); + interval = make_triple(squared_radius(pFace, i), + Infinity, + Infinity); + } + } + else + { // is_infinite(pNeighbor) + + CGAL_triangulation_precondition((is_infinite(pNeighbor) + && !is_infinite(pFace))); + if (is_attached(pFace, i)) + interval = make_triple(UNDEFINED, + find_interval(pFace), + Infinity); + else + interval = make_triple(squared_radius(pFace, i), + find_interval(pFace), + Infinity); + + } + } + _interval_edge_map.insert(Interval_edge(interval, edge)); - + // cross-links (edge.first)->set_ranges(edge.second,interval); - // MY : to fix a bug I store the interval of the edge in both faces + // MY : to fix a bug I store the interval of the edge in both faces Face_handle neighbor = (edge.first)->neighbor(edge.second); int ni = neighbor->index(edge.first); neighbor->set_ranges( ni, interval); @@ -890,7 +890,7 @@ Alpha_shape_2::initialize_interval_edge_map() // second not on the convex hull // third the un-attached edges on the convex hull // finally not on the convex hull - // + // // if we are in regularized mode we should sort differently // by the second third first Key } @@ -898,8 +898,8 @@ Alpha_shape_2::initialize_interval_edge_map() //------------------------------------------------------------------------- template < class Dt, class EACT > -void -Alpha_shape_2::initialize_interval_vertex_map() +void +Alpha_shape_2::initialize_interval_vertex_map() { Type_of_alpha alpha_mid_v; Type_of_alpha alpha_max_v; @@ -907,94 +907,94 @@ Alpha_shape_2::initialize_interval_vertex_map() Finite_vertices_iterator vertex_it; - for( vertex_it = finite_vertices_begin(); - vertex_it != finite_vertices_end(); - ++vertex_it) + for( vertex_it = finite_vertices_begin(); + vertex_it != finite_vertices_end(); + ++vertex_it) { Vertex_handle v = vertex_it; Face_handle f; - alpha_max_v = Type_of_alpha(0); + alpha_max_v = Type_of_alpha(0); alpha_mid_v = (!_interval_face_map.empty() ? - (--_interval_face_map.end())->first : - Type_of_alpha(0)); + (--_interval_face_map.end())->first : + Type_of_alpha(0)); //----------------- examine incident edges -------------------------- - -// // if we used Edelsbrunner and Muecke's definition -// // singular means not incident to any higher-dimensional face -// // regular means incident to a higher-dimensional face -// Edge_circulator edge_circ = this->incident_edges(v), -// edge_done(edge_circ); - -// do - -// { -// f = (*edge_circ).first; -// int i = (*edge_circ).second; - -// if (is_infinite(f, i)) - -// { -// alpha_max_v = Infinity; -// } -// else - -// { -// Interval3 interval3 = find_interval(const_Edge(f, i)); - - -// alpha_mid_v = (interval3.first != UNDEFINED) ? -// (CGAL::min)(alpha_mid_v, interval3.first): -// (CGAL::min)(alpha_mid_v, interval3.second); - -// if (alpha_max_v != Infinity) - -// { -// alpha_max_v = (interval3.third != Infinity) ? -// (CGAL::max)(alpha_max_v, interval3.third): -// Infinity; -// } -// } -// } -// while(++edge_circ != edge_done); - + +// // if we used Edelsbrunner and Muecke's definition +// // singular means not incident to any higher-dimensional face +// // regular means incident to a higher-dimensional face +// Edge_circulator edge_circ = this->incident_edges(v), +// edge_done(edge_circ); + +// do + +// { +// f = (*edge_circ).first; +// int i = (*edge_circ).second; + +// if (is_infinite(f, i)) + +// { +// alpha_max_v = Infinity; +// } +// else + +// { +// Interval3 interval3 = find_interval(const_Edge(f, i)); + + +// alpha_mid_v = (interval3.first != UNDEFINED) ? +// (CGAL::min)(alpha_mid_v, interval3.first): +// (CGAL::min)(alpha_mid_v, interval3.second); + +// if (alpha_max_v != Infinity) + +// { +// alpha_max_v = (interval3.third != Infinity) ? +// (CGAL::max)(alpha_max_v, interval3.third): +// Infinity; +// } +// } +// } +// while(++edge_circ != edge_done); + //-------------- examine incident faces -------------------------- - + // we use a different definition than Edelsbrunner and Muecke // singular means not incident to any 2-dimensional face // regular means incident to a 2-dimensional face - + Face_circulator face_circ = this->incident_faces(v), - done = face_circ; - - if (!face_circ.is_empty()) - { - do - { - f = face_circ; - if (is_infinite(f)) - { - alpha_max_v = Infinity; - // continue; - } - else - { - alpha_f = find_interval(f); - // if we define singular as not incident to a 2-dimensional - // face - alpha_mid_v = (CGAL::min)(alpha_mid_v, alpha_f); - - if (alpha_max_v != Infinity) - alpha_max_v = (CGAL::max)(alpha_max_v, alpha_f); - - } - } - while(++face_circ != done); - } - - + done = face_circ; + + if (!face_circ.is_empty()) + { + do + { + f = face_circ; + if (is_infinite(f)) + { + alpha_max_v = Infinity; + // continue; + } + else + { + alpha_f = find_interval(f); + // if we define singular as not incident to a 2-dimensional + // face + alpha_mid_v = (CGAL::min)(alpha_mid_v, alpha_f); + + if (alpha_max_v != Infinity) + alpha_max_v = (CGAL::max)(alpha_max_v, alpha_f); + + } + } + while(++face_circ != done); + } + + Interval2 interval = std::make_pair(alpha_mid_v, alpha_max_v); _interval_vertex_map.insert(Interval_vertex(interval, vertex_it)); @@ -1006,71 +1006,71 @@ Alpha_shape_2::initialize_interval_vertex_map() //------------------------------------------------------------------------- template < class Dt, class EACT > -void -Alpha_shape_2::initialize_alpha_spectrum() +void +Alpha_shape_2::initialize_alpha_spectrum() { - // skip the attached edges + // skip the attached edges // <=> _interval_edge_map.first.first == UNDEFINED - typename Interval_edge_map::iterator + typename Interval_edge_map::iterator edge_it = std::upper_bound(_interval_edge_map.begin(), - _interval_edge_map.end(), - UNDEFINED, - Less()); + _interval_edge_map.end(), + UNDEFINED, + Less()); // merge the maps which is sorted and contains the alpha-values // of the unattached edges and the triangles. // eliminate duplicate values due to for example attached edges // merge and copy from STL since assignment should be function object - + typename Interval_face_map::iterator face_it = _interval_face_map.begin(); _alpha_spectrum.reserve(_interval_face_map.size() + - _interval_edge_map.size()/ 2 ); + _interval_edge_map.size()/ 2 ); // should be only the number of unattached edges // size_type nb_unattached_edges; // distance(edge_it, _interval_edge_map.end(), nb_unattached_edges); // however the distance function is expensive while (edge_it != _interval_edge_map.end() || - face_it != _interval_face_map.end()) + face_it != _interval_face_map.end()) { if (face_it != _interval_face_map.end() && - (edge_it == _interval_edge_map.end() || - ((*face_it).first < (*edge_it).first.first))) - { - if (((_alpha_spectrum.empty() || - _alpha_spectrum.back() < (*face_it).first)) && - ((*face_it).first > Type_of_alpha(0))) - _alpha_spectrum.push_back((*face_it).first); - face_it++; - } + (edge_it == _interval_edge_map.end() || + ((*face_it).first < (*edge_it).first.first))) + { + if (((_alpha_spectrum.empty() || + _alpha_spectrum.back() < (*face_it).first)) && + ((*face_it).first > Type_of_alpha(0))) + _alpha_spectrum.push_back((*face_it).first); + face_it++; + } else - { - if (((_alpha_spectrum.empty() || - _alpha_spectrum.back() < (*edge_it).first.first)) && - (((*edge_it).first.first) > Type_of_alpha(0))) - _alpha_spectrum.push_back((*edge_it).first.first); - edge_it++; - } + { + if (((_alpha_spectrum.empty() || + _alpha_spectrum.back() < (*edge_it).first.first)) && + (((*edge_it).first.first) > Type_of_alpha(0))) + _alpha_spectrum.push_back((*edge_it).first.first); + edge_it++; + } } - - while (edge_it != _interval_edge_map.end()) + + while (edge_it != _interval_edge_map.end()) { - if (((_alpha_spectrum.empty() || - _alpha_spectrum.back() < (*edge_it).first.first))&& - (((*edge_it).first.first) > Type_of_alpha(0))) - _alpha_spectrum.push_back((*edge_it).first.first); + if (((_alpha_spectrum.empty() || + _alpha_spectrum.back() < (*edge_it).first.first))&& + (((*edge_it).first.first) > Type_of_alpha(0))) + _alpha_spectrum.push_back((*edge_it).first.first); edge_it++; } - while (face_it != _interval_face_map.end()) - { - if (((_alpha_spectrum.empty() || - _alpha_spectrum.back() < (*face_it).first))&& - ((*face_it).first > Type_of_alpha(0))) - _alpha_spectrum.push_back((*face_it).first); + while (face_it != _interval_face_map.end()) + { + if (((_alpha_spectrum.empty() || + _alpha_spectrum.back() < (*face_it).first))&& + ((*face_it).first > Type_of_alpha(0))) + _alpha_spectrum.push_back((*face_it).first); face_it++; } @@ -1084,61 +1084,61 @@ Alpha_shape_2::initialize_alpha_spectrum() template < class Dt, class EACT > void Alpha_shape_2::update_alpha_shape_vertex_list()const { - //typedef typename Alpha_shape_2::Interval_vertex_map - // Interval_vertex_map; - typename Interval_vertex_map::const_iterator vertex_alpha_it; - - //const typename Alpha_shape_2::Interval2* pInterval2; - const Interval2* pInterval2; - Vertex_handle v; - Alpha_shape_vertices_list.clear(); - // write the regular vertices - - for (vertex_alpha_it = _interval_vertex_map.begin(); - vertex_alpha_it != _interval_vertex_map.end() && - (*vertex_alpha_it).first.first <= get_alpha(); - ++vertex_alpha_it) - { - pInterval2 = &(*vertex_alpha_it).first; - - if((pInterval2->second > get_alpha() - || pInterval2->second == Infinity)) - { - // alpha must be larger than the min boundary - // and alpha is smaller than the upper boundary - // which might be infinity - // write the vertex - v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == REGULAR)); - Alpha_shape_vertices_list.push_back(v); - } - } - - if (get_mode() == Alpha_shape_2::GENERAL) - { - // write the singular vertices - for (; - vertex_alpha_it != _interval_vertex_map.end(); - ++vertex_alpha_it) - { - v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == SINGULAR)); - - Alpha_shape_vertices_list.push_back(v); - } - } - use_vertex_cache = true; + //typedef typename Alpha_shape_2::Interval_vertex_map + // Interval_vertex_map; + typename Interval_vertex_map::const_iterator vertex_alpha_it; + + //const typename Alpha_shape_2::Interval2* pInterval2; + const Interval2* pInterval2; + Vertex_handle v; + Alpha_shape_vertices_list.clear(); + // write the regular vertices + + for (vertex_alpha_it = _interval_vertex_map.begin(); + vertex_alpha_it != _interval_vertex_map.end() && + (*vertex_alpha_it).first.first <= get_alpha(); + ++vertex_alpha_it) + { + pInterval2 = &(*vertex_alpha_it).first; + + if((pInterval2->second > get_alpha() + || pInterval2->second == Infinity)) + { + // alpha must be larger than the min boundary + // and alpha is smaller than the upper boundary + // which might be infinity + // write the vertex + v = (*vertex_alpha_it).second; + CGAL_triangulation_assertion((classify(v) == REGULAR)); + Alpha_shape_vertices_list.push_back(v); + } + } + + if (get_mode() == Alpha_shape_2::GENERAL) + { + // write the singular vertices + for (; + vertex_alpha_it != _interval_vertex_map.end(); + ++vertex_alpha_it) + { + v = (*vertex_alpha_it).second; + CGAL_triangulation_assertion((classify(v) == SINGULAR)); + + Alpha_shape_vertices_list.push_back(v); + } + } + use_vertex_cache = true; } //------------------------------------------------------------------------- template < class Dt, class EACT > void -Alpha_shape_2::update_alpha_shape_edges_list() const +Alpha_shape_2::update_alpha_shape_edges_list() const { // Writes the edges of the alpha shape `A' for the current $\alpha$-value - // to the container where 'out' refers to. Returns an output iterator + // to the container where 'out' refers to. Returns an output iterator // which is the end of the constructed range. //typedef typename Alpha_shape_2::Interval_edge_map Interval_edge_map; typename Interval_edge_map::const_iterator edge_alpha_it; @@ -1146,92 +1146,92 @@ Alpha_shape_2::update_alpha_shape_edges_list() const //const typename Alpha_shape_2::Interval3* pInterval; const Interval3* pInterval; Alpha_shape_edges_list.clear(); - if (get_mode() == REGULARIZED) + if (get_mode() == REGULARIZED) { - // it is much faster looking at the sorted intervals + // it is much faster looking at the sorted intervals // than looking at all sorted faces // alpha must be larger than the mid boundary // and alpha is smaller than the upper boundary - for (edge_alpha_it = _interval_edge_map.begin(); - edge_alpha_it != _interval_edge_map.end() && - (*edge_alpha_it).first.first <= get_alpha(); - ++edge_alpha_it) - { - pInterval = &(*edge_alpha_it).first; - - CGAL_triangulation_assertion(pInterval->second != Infinity); - // since this happens only for convex hull of dimension 2 - // thus singular - - if(pInterval->second <= get_alpha() && - (pInterval->third > get_alpha() - || pInterval->third == Infinity)) - { - // alpha must be larger than the mid boundary - // and alpha is smaller than the upper boundary - // which might be infinity - // visualize the boundary + for (edge_alpha_it = _interval_edge_map.begin(); + edge_alpha_it != _interval_edge_map.end() && + (*edge_alpha_it).first.first <= get_alpha(); + ++edge_alpha_it) + { + pInterval = &(*edge_alpha_it).first; + + CGAL_triangulation_assertion(pInterval->second != Infinity); + // since this happens only for convex hull of dimension 2 + // thus singular + + if(pInterval->second <= get_alpha() && + (pInterval->third > get_alpha() + || pInterval->third == Infinity)) + { + // alpha must be larger than the mid boundary + // and alpha is smaller than the upper boundary + // which might be infinity + // visualize the boundary CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR)); - Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second)); - } - } + (*edge_alpha_it).second.second) + == REGULAR)); + Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second)); + } + } } - else + else { // get_mode() == GENERAL ------------------------------------------- // draw the edges - for (edge_alpha_it = _interval_edge_map.begin(); - edge_alpha_it != _interval_edge_map.end() && - (*edge_alpha_it).first.first <= get_alpha(); - ++edge_alpha_it) - { - pInterval = &(*edge_alpha_it).first; - - if (pInterval->first == UNDEFINED) - { - CGAL_triangulation_assertion(pInterval->second != Infinity); - // since this happens only for convex hull of dimension 2 - // thus singular - - if(pInterval->second <= get_alpha() && - (pInterval->third > get_alpha() - || pInterval->third == Infinity)) - { - // alpha must be larger than the mid boundary - // and alpha is smaller than the upper boundary - // which might be infinity - // visualize the boundary + for (edge_alpha_it = _interval_edge_map.begin(); + edge_alpha_it != _interval_edge_map.end() && + (*edge_alpha_it).first.first <= get_alpha(); + ++edge_alpha_it) + { + pInterval = &(*edge_alpha_it).first; + + if (pInterval->first == UNDEFINED) + { + CGAL_triangulation_assertion(pInterval->second != Infinity); + // since this happens only for convex hull of dimension 2 + // thus singular + + if(pInterval->second <= get_alpha() && + (pInterval->third > get_alpha() + || pInterval->third == Infinity)) + { + // alpha must be larger than the mid boundary + // and alpha is smaller than the upper boundary + // which might be infinity + // visualize the boundary CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR)); - Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second)); - } - } - else - { - - if(pInterval->third > get_alpha() - || pInterval->third == Infinity) - { - // if alpha is smaller than the upper boundary - // which might be infinity - // visualize the boundary + (*edge_alpha_it).second.second) + == REGULAR)); + Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second)); + } + } + else + { + + if(pInterval->third > get_alpha() + || pInterval->third == Infinity) + { + // if alpha is smaller than the upper boundary + // which might be infinity + // visualize the boundary CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR) - || (classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == SINGULAR))); - Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second)); - } - } - - } - + (*edge_alpha_it).second.second) + == REGULAR) + || (classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == SINGULAR))); + Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second)); + } + } + + } + } use_edge_cache = true; } @@ -1239,9 +1239,9 @@ Alpha_shape_2::update_alpha_shape_edges_list() const //------------------------------------------------------------------------- template < class Dt, class EACT > -typename Alpha_shape_2::Classification_type -Alpha_shape_2::classify(const Face_handle& f, int i, - const Type_of_alpha& alpha) const +typename Alpha_shape_2::Classification_type +Alpha_shape_2::classify(const Face_handle& f, int i, + const Type_of_alpha& alpha) const { // Classifies the edge `e' of the underlying Delaunay // triangulation with respect to `A'. @@ -1254,52 +1254,52 @@ Alpha_shape_2::classify(const Face_handle& f, int i, // we store only finite edges in _edge_interval_map Interval3 interval = find_interval(const_Edge(f, i)); // (*(_edge_interval_map.find(const_Edge(f, i)))).second; - - if (alpha < interval.second) + + if (alpha < interval.second) { if (get_mode() == REGULARIZED || - interval.first == UNDEFINED || - alpha < interval.first) - return EXTERIOR; + interval.first == UNDEFINED || + alpha < interval.first) + return EXTERIOR; else // alpha >= interval.first - return SINGULAR; + return SINGULAR; } - else + else { // alpha >= interval.second if (interval.third == Infinity || - alpha < interval.third) - return REGULAR; + alpha < interval.third) + return REGULAR; else // alpha >= interval.third - return INTERIOR; + return INTERIOR; } - + } //------------------------------------------------------------------------- template < class Dt, class EACT > -typename Alpha_shape_2::Classification_type +typename Alpha_shape_2::Classification_type Alpha_shape_2::classify(const Vertex_handle& v, - const Type_of_alpha& alpha) const + const Type_of_alpha& alpha) const { // Classifies the vertex `v' of the underlying Delaunay // triangulation with respect to `A'. Interval2 interval = v->get_range(); - - if (alpha < interval.first) + + if (alpha < interval.first) { - if (get_mode() == REGULARIZED) - return EXTERIOR; + if (get_mode() == REGULARIZED) + return EXTERIOR; else // general => vertices are never exterior - return SINGULAR; + return SINGULAR; } - else + else { // alpha >= interval.first if (interval.second == Infinity || - alpha < interval.second) - return REGULAR; + alpha < interval.second) + return REGULAR; else // alpha >= interval.second - return INTERIOR; + return INTERIOR; } } @@ -1309,31 +1309,31 @@ template < class Dt, class EACT > typename Alpha_shape_2::size_type Alpha_shape_2::number_of_solid_components(const Type_of_alpha& alpha) const { - // Determine the number of connected solid components + // Determine the number of connected solid components typedef typename Marked_face_set::Data Data; Marked_face_set marked_face_set(false); Finite_faces_iterator face_it; size_type nb_solid_components = 0; - + if (number_of_vertices()==0) return 0; - + // only finite faces - for( face_it = faces_begin(); - face_it != faces_end(); - ++face_it) + for( face_it = faces_begin(); + face_it != faces_end(); + ++face_it) { Face_handle pFace = face_it; CGAL_triangulation_postcondition( pFace != nullptr); - + if (classify(pFace, alpha) == INTERIOR){ - Data& data = marked_face_set[pFace]; - if(data == false) - { - // we traverse only interior faces - traverse(pFace, marked_face_set, alpha); - nb_solid_components++; - } + Data& data = marked_face_set[pFace]; + if(data == false) + { + // we traverse only interior faces + traverse(pFace, marked_face_set, alpha); + nb_solid_components++; + } } } return nb_solid_components; @@ -1344,8 +1344,8 @@ Alpha_shape_2::number_of_solid_components(const Type_of_alpha& alpha) c template < class Dt, class EACT > void Alpha_shape_2::traverse(const Face_handle& pFace, - Marked_face_set& marked_face_set, - const Type_of_alpha alpha) const + Marked_face_set& marked_face_set, + const Type_of_alpha alpha) const { typedef typename Marked_face_set::Data Data; std::list faces; @@ -1357,15 +1357,15 @@ Alpha_shape_2::traverse(const Face_handle& pFace, faces.pop_front(); for (int i=0; i<3; i++) { - pNeighbor = fh->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != nullptr); - if (classify(pNeighbor, alpha) == INTERIOR){ - Data& data = marked_face_set[pNeighbor]; - if(data == false){ - data = true; - faces.push_back(pNeighbor); - } - } + pNeighbor = fh->neighbor(i); + CGAL_triangulation_assertion(pNeighbor != nullptr); + if (classify(pNeighbor, alpha) == INTERIOR){ + Data& data = marked_face_set[pNeighbor]; + if(data == false){ + data = true; + faces.push_back(pNeighbor); + } + } } } } @@ -1374,55 +1374,55 @@ Alpha_shape_2::traverse(const Face_handle& pFace, template < class Dt, class EACT > typename Alpha_shape_2::Alpha_iterator -Alpha_shape_2::find_optimal_alpha(size_type nb_components) +Alpha_shape_2::find_optimal_alpha(size_type nb_components) { // find the minimum alpha that satisfies the properties // (1) nb_components solid components // (2) all data points on the boundary or in its interior Type_of_alpha alpha = find_alpha_solid(); // from this alpha on the alpha_solid satisfies property (2) - + Alpha_iterator first = alpha_lower_bound(alpha); - if (number_of_solid_components(alpha) == nb_components) + if (number_of_solid_components(alpha) == nb_components) { if ((first+1) < alpha_end()) - return (first+1); + return (first+1); else - return first; + return first; } // do binary search on the alpha values - // number_of_solid_components() is a monotone function + // number_of_solid_components() is a monotone function // if we start with find_alpha_solid - + Alpha_iterator last = alpha_end(); Alpha_iterator middle; - + std::ptrdiff_t len = last - first - 1; std::ptrdiff_t half; - while (len > 0) + while (len > 0) { half = len / 2; middle = first + half; #ifdef CGAL_DEBUG_ALPHA_SHAPE_2 std::cout << "first : " << *first << " last : " << *(first+len) - << " mid : " << *middle - << " nb comps : " << number_of_solid_components(*middle) - << std::endl; + << " mid : " << *middle + << " nb comps : " << number_of_solid_components(*middle) + << std::endl; #endif // CGAL_DEBUG_ALPHA_SHAPE_2 - if (number_of_solid_components(*middle) > nb_components) - { - first = middle + 1; - len = len - half - 1; - } - else - { // number_of_solid_components(*middle) <= nb_components - len = half; - } + if (number_of_solid_components(*middle) > nb_components) + { + first = middle + 1; + len = len - half - 1; + } + else + { // number_of_solid_components(*middle) <= nb_components + len = half; + } } if ((first+1) < alpha_end()) return (first+1); @@ -1433,35 +1433,35 @@ Alpha_shape_2::find_optimal_alpha(size_type nb_components) //------------------------------------------------------------------------- template < class Dt, class EACT > -typename Alpha_shape_2::Type_of_alpha -Alpha_shape_2::find_alpha_solid() const +typename Alpha_shape_2::Type_of_alpha +Alpha_shape_2::find_alpha_solid() const { - // compute the minumum alpha such that all data points + // compute the minumum alpha such that all data points // are either on the boundary or in the interior // not necessarily connected - // starting point for searching + // starting point for searching // takes O(#alpha_shape) time Type_of_alpha alpha_solid = 0; - + if (number_of_vertices()<3) return alpha_solid; Finite_vertices_iterator vertex_it; // only finite vertices - for( vertex_it = finite_vertices_begin(); + for( vertex_it = finite_vertices_begin(); vertex_it != finite_vertices_end(); - ++vertex_it) + ++vertex_it) { Type_of_alpha alpha_min_v = (--_interval_face_map.end())->first; Face_circulator face_circ = this->incident_faces(vertex_it); Face_circulator done = face_circ; - do - { - Face_handle f = face_circ; - if (! is_infinite(f)) - alpha_min_v = (CGAL::min)(find_interval(f), + do + { + Face_handle f = face_circ; + if (! is_infinite(f)) + alpha_min_v = (CGAL::min)(find_interval(f), alpha_min_v); - } + } while (++face_circ != done); alpha_solid = (CGAL::max)(alpha_min_v, alpha_solid); @@ -1472,7 +1472,7 @@ Alpha_shape_2::find_alpha_solid() const //------------------------------------------------------------------------- template < class Dt, class EACT > -std::ostream& +std::ostream& Alpha_shape_2::op_ostream(std::ostream& os) const { typedef typename Alpha_shape_2::Interval_vertex_map Interval_vertex_map ; @@ -1695,7 +1695,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const //------------------------------------------------------------------- template < class Dt, class EACT > -std::ostream& +std::ostream& operator<<(std::ostream& os, const Alpha_shape_2
& A) { return A.op_ostream(os); @@ -1705,7 +1705,7 @@ operator<<(std::ostream& os, const Alpha_shape_2
& A) template < class Dt, class EACT > std::list::Point_2> -Alpha_shape_2::Output () +Alpha_shape_2::Output () { typename Interval_edge_map::const_iterator edge_alpha_it; @@ -1830,7 +1830,7 @@ void Alpha_shape_2::print_edge_map() Edge edge = (*iemapit).second; Point p1 = point(edge.first, cw(edge.second)); Point p2 = point(edge.first, ccw(edge.second)); - std::cout << "[ (" << p1 << ") - (" << p2 << ") ] : " + std::cout << "[ (" << p1 << ") - (" << p2 << ") ] : " << interval.first << " " << interval.second << " " << interval.third << std::endl; } diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_euclidean_traits_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_euclidean_traits_2.h index 429571a0168e..84399ca3ef47 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_euclidean_traits_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_euclidean_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Tran Kai Frank DA // Andreas Fabri diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_face_base_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_face_base_2.h index b39b50136382..b01d04295585 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_face_base_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_face_base_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Tran Kai Frank DA @@ -23,7 +23,7 @@ namespace CGAL { - + template @@ -58,11 +58,11 @@ class Alpha_shape_vertex_base_2 Alpha_shape_vertex_base_2() : Vb() {} - + Alpha_shape_vertex_base_2(const Point & p) : Vb(p) {} - + Alpha_shape_vertex_base_2(const Point & p, Face_handle f) : Vb(p, f) {} diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt index 0399340218cd..5b6cea7e4466 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp b/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp index 9d8aad735acb..5e4b5f1febf7 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp +++ b/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp @@ -60,18 +60,18 @@ typedef Alpha_shape_2::Alpha_iterator Alpha_iterator; template void alpha_edges(InputIterator begin, InputIterator end, - const typename Alpha_shape::FT &Alpha, - bool mode, - OutputIterator out) -{ + const typename Alpha_shape::FT &Alpha, + bool mode, + OutputIterator out) +{ typedef typename Alpha_shape::Alpha_shape_edges_iterator Alpha_shape_edges_iterator; typename Alpha_shape::Triangulation dt; dt.insert(begin,end); Alpha_shape A(dt); - - if (mode) - { A.set_mode(Alpha_shape::GENERAL); } - else + + if (mode) + { A.set_mode(Alpha_shape::GENERAL); } + else { A.set_mode(Alpha_shape::REGULARIZED); }; A.set_alpha(Alpha); @@ -101,7 +101,7 @@ file_input(OutputIterator out) return true; } - + //------------------ main ------------------------------------------- int main() @@ -110,12 +110,12 @@ int main() if(! file_input(std::back_inserter(points))){ return -1; } - + //ExactAlphaComparisonTag is False { std::vector segments; alpha_edges(points.begin(), points.end(), - 10000.,Alpha_shape_2::GENERAL, + 10000.,Alpha_shape_2::GENERAL, std::back_inserter(segments)); std::cout << segments.size() << " alpha shape edges" << std::endl; @@ -126,13 +126,13 @@ int main() { std::vector segments; alpha_edges(points.begin(), points.end(), - 10000.,Alpha_shape_2_TT::GENERAL, + 10000.,Alpha_shape_2_TT::GENERAL, std::back_inserter(segments)); std::cout << segments.size() << " alpha shape edges" << std::endl; std::cout << "Alpha Shape computed" << std::endl; } - - + + return 0; } diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp b/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp index 0423a051831a..37276af18d6e 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp +++ b/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp @@ -142,6 +142,6 @@ int main() std::back_inserter(segments)); std::cout << segments.size() << " alpha shape edges." << std::endl; } - + return 0; } diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp index 79ffcaf0a9f1..dbe053e98242 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp @@ -9,7 +9,7 @@ int main(int argc, char** argv) { QApplication application(argc,argv); - + application.setOrganizationDomain("geometryfactory.com"); application.setOrganizationName("GeometryFactory"); application.setApplicationName("Alpha Shape Reconstruction"); @@ -23,7 +23,7 @@ int main(int argc, char** argv) CGAL_QT_INIT_RESOURCES; Q_INIT_RESOURCE(Alpha_shape_3); - + MainWindow mw; mw.show(); diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp index 9de26cdd7dbb..310954e05809 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp @@ -11,37 +11,37 @@ MainWindow::MainWindow(QWidget* parent): CGAL::Qt::DemosMainWindow(parent) this->addRecentFiles(this->menuFile, this->actionQuit); connect(this, SIGNAL(openRecentFile(QString)), - this, SLOT(open(QString))); + this, SLOT(open(QString))); } void MainWindow::connectActions() { - QObject::connect(this->actionLoad_New_File, SIGNAL(triggered()), - this, SLOT(open_file())); + QObject::connect(this->actionLoad_New_File, SIGNAL(triggered()), + this, SLOT(open_file())); - QObject::connect(this->alphaSlider, SIGNAL(valueChanged(int)), - this, SLOT(alphaChanged(int))); + QObject::connect(this->alphaSlider, SIGNAL(valueChanged(int)), + this, SLOT(alphaChanged(int))); QObject::connect(this->alphaBox, SIGNAL(valueChanged(int)), - this, SLOT(alphaChanged(int))); + this, SLOT(alphaChanged(int))); - QObject::connect(this->alphaSlider, SIGNAL(valueChanged(int)), - this->alphaBox, SLOT(setValue(int))); + QObject::connect(this->alphaSlider, SIGNAL(valueChanged(int)), + this->alphaBox, SLOT(setValue(int))); - QObject::connect(this->alphaBox, SIGNAL(valueChanged(int)), - this->alphaSlider, SLOT(setValue(int))); + QObject::connect(this->alphaBox, SIGNAL(valueChanged(int)), + this->alphaSlider, SLOT(setValue(int))); - QObject::connect(this, SIGNAL(sceneChanged()), - this->viewer, SLOT(sceneChanged())); + QObject::connect(this, SIGNAL(sceneChanged()), + this->viewer, SLOT(sceneChanged())); - QObject::connect(this, SIGNAL(alphaChanged()), - this->viewer, SLOT(update())); + QObject::connect(this, SIGNAL(alphaChanged()), + this->viewer, SLOT(update())); - QObject::connect(this->actionQuit, SIGNAL(triggered()), - qApp, SLOT(quit())); + QObject::connect(this->actionQuit, SIGNAL(triggered()), + qApp, SLOT(quit())); } void @@ -49,8 +49,8 @@ MainWindow::open_file() { QString fileName = QFileDialog::getOpenFileName(this, - tr("Open Points File"), - "./data", + tr("Open Points File"), + "./data", tr("pts files (*.pts)")); if(! fileName.isEmpty()){ @@ -59,7 +59,7 @@ MainWindow::open_file() } -void +void MainWindow::alphaChanged(int i) { if (scene.alpha_shape.number_of_alphas() > 0){ @@ -74,7 +74,7 @@ MainWindow::alphaChanged(int i) } else { scene.alpha_shape.set_alpha(0); } - viewer->alphaChanged(); + viewer->alphaChanged(); Q_EMIT(alphaChanged()); } @@ -97,7 +97,7 @@ MainWindow::open(QString fileName) scene.alpha_shape.make_alpha_shape(scene.points.begin(), scene.points.end()); scene.alpha_shape.set_alpha(16); timer.stop(); - + alphaSlider->setRange(0,100); alphaSlider->setSliderPosition(50); diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp index 9069e592943d..a30e7a9a1335 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp @@ -170,7 +170,7 @@ void Viewer::initialize_buffers() buffers[0].release(); buffers[1].bind(); - buffers[1].allocate(normals.data(), + buffers[1].allocate(normals.data(), static_cast(normals.size()*sizeof(float))); normalsLocation = rendering_program.attributeLocation("normal"); rendering_program.bind(); @@ -216,18 +216,18 @@ void Viewer::attrib_buffers(CGAL::QGLViewer* viewer) mvMatrix.data()[i] = (float)mat[i]; } // define material - QVector4D ambient(0.25f, 0.20725f, 0.20725f, 0.922f); - QVector4D diffuse( 1.0f, + QVector4D ambient(0.25f, 0.20725f, 0.20725f, 0.922f); + QVector4D diffuse( 1.0f, 0.829f, 0.829f, 0.922f ); - QVector4D specular( 0.6f, + QVector4D specular( 0.6f, 0.6f, 0.6f, 1.0f ); - QVector4D position(0.0f,0.0f,1.0f,1.0f ); + QVector4D position(0.0f,0.0f,1.0f,1.0f ); GLfloat shininess = 11.264f; @@ -273,11 +273,11 @@ Viewer::sceneChanged() { Iso_cuboid_3 bb = CGAL::bounding_box(scene->points.begin(), scene->points.end()); - + this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()), - CGAL::qglviewer::Vec(bb.xmax(), - bb.ymax(), - bb.zmax())); + CGAL::qglviewer::Vec(bb.xmax(), + bb.ymax(), + bb.zmax())); this->showEntireScene(); diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt b/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt index af4ba205b192..149e60567ade 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt @@ -2,13 +2,13 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_3D_Alpha_Shapes \cgalAutoToc \authors Tran Kai Frank Da, Sébastien Loriot, and Mariette Yvinec -\image html alphashape.png -\image latex alphashape.png +\image html alphashape.png +\image latex alphashape.png Assume we are given a set \f$ S\f$ of points in 2D or 3D and we would like to have something like "the shape formed by these points". This is @@ -56,8 +56,8 @@ are based on its generalization, the regular triangulation replacing the euclidean distance by the power to weighted points. Let us consider the basic case with a Delaunay triangulation. -We first define the alpha complex of the set of points \f$ S\f$. -The alpha complex is a subcomplex +We first define the alpha complex of the set of points \f$ S\f$. +The alpha complex is a subcomplex of the Delaunay triangulation. For a given value of \f$ \alpha\f$, the alpha complex includes all the simplices in the Delaunay triangulation which have @@ -75,17 +75,17 @@ singular if it is not a facet of a \f$ (k+1)\f$-simplex of the complex. the alpha shapes correspond strictly to the above definition. The regularized mode provides a regularized version of the alpha shapes. It corresponds to the domain covered by a regularized version -of the alpha complex where singular faces are removed +of the alpha complex where singular faces are removed (See \cgalFigureRef{figgenregex} for an example). -\cgalFigureBegin{figgenregex,gen-reg-ex.png} +\cgalFigureBegin{figgenregex,gen-reg-ex.png} Comparison of general and regularized alpha-shape. Left: Some points are taken on the surface of a torus, three points being taken relatively far from the surface of the torus; Middle: The general alpha-shape (for a large enough alpha value) contains the singular triangle facet of the three isolated points; Right: The regularized version (for the same value of alpha) does not contains any singular facet. \cgalFigureEnd -The alpha shapes of a set of points +The alpha shapes of a set of points \f$ S\f$ form a discrete family, even though they are defined for all real numbers \f$ \alpha\f$. -The entire family of alpha shapes can be represented +The entire family of alpha shapes can be represented through the underlying triangulation of \f$ S\f$. In this representation each \f$ k\f$-simplex of the underlying triangulation is associated with an interval that specifies for which values of \f$ \alpha\f$ the \f$ k\f$-simplex @@ -95,23 +95,23 @@ easily. Furthermore, we can select the optimal value of \f$ \alpha\f$ to get an alpha shape including all data points and having less than a given number of connected components. Also, the alpha-values allows to define a filtration on the -faces of the triangulation of a set of points. +faces of the triangulation of a set of points. In this filtration, the faces of the triangulation are output -in increasing order of the alpha value -for which they appear +in increasing order of the alpha value +for which they appear in the alpha complex. In case of equal alpha values, lower dimensional faces are output first. The definition is analog in the case of weighted alpha shapes. The input set is now a set of weighted points (which can be regarded -as spheres) and the underlying triangulation +as spheres) and the underlying triangulation is the regular triangulation of this set. Two spheres, or two weighted points, with centers \f$ C_1, C_2\f$ -and radii \f$ r_1, r_2 \f$ are said to be orthogonal iff +and radii \f$ r_1, r_2 \f$ are said to be orthogonal iff \f$ C_1C_2 ^2 = r_1^2 + r_2^2\f$ and suborthogonal iff \f$ C_1C_2 ^2 < r_1^2 + r_2^2\f$. For a given value of \f$ \alpha\f$, -the weighted alpha complex is formed with the simplices of the +the weighted alpha complex is formed with the simplices of the regular triangulation triangulation such that there is a sphere orthogonal to the weighted points associated with the vertices of the simplex and suborthogonal to all the other @@ -127,7 +127,7 @@ The class `Alpha_shape_3` represents the whole family of alpha shapes for a given set of points. The class includes the underlying triangulation `Dt` of the set, and associates to each \f$ k\f$-face of this triangulation -an interval specifying +an interval specifying for which values of \f$ \alpha\f$ the face belongs to the alpha complex. The second template parameter, `ExactAlphaComparisonTag`, is a tag that, @@ -139,11 +139,11 @@ the \f$ \alpha\f$ values where the alpha shape changes. Additionally, the class has a filtration member function that, given an output iterator with `Object` -as value type, outputs the faces of the triangulation -according to the +as value type, outputs the faces of the triangulation +according to the order of apparition in the alpha complex when alpha increases. -Finally, it provides a function to determine +Finally, it provides a function to determine the smallest value \f$ \alpha\f$ such that the alpha shape satisfies the following two properties:
    @@ -157,7 +157,7 @@ points cannot be inserted or removed. \subsection AlphaShape_3DAlphaShapeForAFixedAlpha Alpha Shape for a Fixed Alpha -Given a value of alpha, the class `Fixed_alpha_shape_3
    ` represents one +Given a value of alpha, the class `Fixed_alpha_shape_3
    ` represents one alpha shape for a given set of points. The class includes the underlying triangulation `Dt` of the set, and associates to each \f$ k\f$-face of this triangulation @@ -168,7 +168,7 @@ points can be inserted or removed. Both classes provide member functions to classify for a (given) value of \f$ \alpha\f$ the different faces of the triangulation as -`EXTERIOR`, `SINGULAR`, `REGULAR` or +`EXTERIOR`, `SINGULAR`, `REGULAR` or `INTERIOR` with respect to the alpha shape. A \f$ k\f$-face on the boundary of the alpha complex is said to be: `REGULAR` if it is a subface of the alpha-complex which @@ -189,7 +189,7 @@ of its circumscribed circle is larger than alpha. The classes provide also output iterators to get for a given `alpha` value the vertices, edges, facets and cells of the different types -(`EXTERIOR`, `SINGULAR`, `REGULAR` or +(`EXTERIOR`, `SINGULAR`, `REGULAR` or `INTERIOR`). \section AlphaShape3D_ConceptAndModels Concepts and Models @@ -233,7 +233,7 @@ The triangulation data structure of the triangulation has to be a model of the concept `TriangulationDataStructure_3`, and it must be parameterized with vertex and cell classes, which are model of the concepts `FixedAlphaShapeVertex_3` and `FixedAlphaShapeCell_3`. -The package provides models `Fixed_alpha_shape_vertex_base_3` +The package provides models `Fixed_alpha_shape_vertex_base_3` and `Fixed_alpha_shape_cell_base_3`, respectively. \subsection AlphaShape3D_ConceptAndModelsTDS Triangulation data structure @@ -262,7 +262,7 @@ represents only one alpha shape (for a fixed alpha). When using the same kernel, `Fixed_alpha_shape_3
    ` is a lighter version. It is thus naturally much more efficient when the alpha-shape is needed for a single given value of alpha. In addition, note that the class `Alpha_shape_3` -requires constructions (squared radius of simplices) while the +requires constructions (squared radius of simplices) while the class `Fixed_alpha_shape_3
    ` uses only predicates. This implies that a certified construction of one (several) alpha-shape, using the `Alpha_shape_3` requires a kernel @@ -274,13 +274,13 @@ two that supports incremental insertion and removal of points. We give the time spent while computing the alpha shape of a protein (considered as a set of weighted points) featuring 4251 atoms (using `gcc 4.3` under Linux with `-O3` -and `-DNDEBUG` flags, on a 2.27GHz Intel(R) Xeon(R) E5520 CPU): +and `-DNDEBUG` flags, on a 2.27GHz Intel(R) Xeon(R) E5520 CPU): Using `Exact_predicates_inexact_constructions_kernel`, building the regular triangulation requires 0.09s, then the class `Fixed_alpha_shape_3
    ` required 0.05s while the class `Alpha_shape_3` requires 0.35s if `ExactAlphaComparisonTag` is `Tag_false` (and 0.70s with `Tag_true`). Using `Exact_predicates_exact_constructions_kernel`, building -the regular triangulation requires 0.19s and then the class `Alpha_shape_3` +the regular triangulation requires 0.19s and then the class `Alpha_shape_3` requires 0.90s. \section Alpha_shapes_3Examples Examples @@ -346,6 +346,6 @@ results will suffer from round-off problems. \cgalExample{Alpha_shapes_3/ex_periodic_alpha_shapes_3.cpp} -*/ +*/ } /* namespace CGAL */ diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h index b51b927b6dc3..d03f0ff0c28a 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h @@ -4,11 +4,11 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Alpha_shape_3` represents the family of -alpha shapes of points in the 3D space for all real -\f$ \alpha\f$. It maintains an underlying triangulation +The class `Alpha_shape_3` represents the family of +alpha shapes of points in the 3D space for all real +\f$ \alpha\f$. It maintains an underlying triangulation of the class `Dt`. Each k-dimensional face of Dt is associated with an -interval that specifies for which values of alpha the face belongs to the alpha shape. +interval that specifies for which values of alpha the face belongs to the alpha shape. Note that this class is used for basic, weighted, and periodic Alpha Shapes. @@ -25,7 +25,7 @@ must be model the concepts `AlphaShapeTraits_3`, \tparam The second template parameter `ExactAlphaComparisonTag` is a tag that, when set to \link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. This is useful -when the Delaunay triangulation is instantiated with an exact predicates inexact constructions +when the Delaunay triangulation is instantiated with an exact predicates inexact constructions kernel. By default the `ExactAlphaComparisonTag` is set to \link Tag_false `Tag_false`\endlink as it induces a small overhead. Note that the tag `ExactAlphaComparisonTag` is currently ignored (meaning that the code will behave as if `ExactAlphaComparisonTag` were set to \link Tag_false `Tag_false`\endlink) @@ -57,64 +57,64 @@ along with a lazy predicate evaluation. \cgalHeading{I/O} -The I/O operators are defined for `iostream`, and for -the window stream provided by \cgal. The format for the iostream -is an internal format. +The I/O operators are defined for `iostream`, and for +the window stream provided by \cgal. The format for the iostream +is an internal format. \cgalHeading{Implementation} -In `GENERAL` mode, the alpha intervals of each triangulation -face is computed and stored at initialization time. -In `REGULARIZED` mode, the alpha shape intervals of edges -are not stored nor computed at initialization. -Edges are simply classified on the fly upon request. -This allows to have much faster building of alpha shapes in -`REGULARIZED` mode. - -Function `Alpha_shape_3::alpha_find()` uses linear search, while -`Alpha_shape_3::alpha_lower_bound()` and `Alpha_shape_3::alpha_upper_bound()` -use binary search. -`Alpha_shape_3::number_of_solid_components()` performs a graph traversal and takes time -linear in the number of cells of the underlying triangulation. -`Alpha_shape_3::find_optimal_alpha()` uses binary search and takes time -\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points. +In `GENERAL` mode, the alpha intervals of each triangulation +face is computed and stored at initialization time. +In `REGULARIZED` mode, the alpha shape intervals of edges +are not stored nor computed at initialization. +Edges are simply classified on the fly upon request. +This allows to have much faster building of alpha shapes in +`REGULARIZED` mode. + +Function `Alpha_shape_3::alpha_find()` uses linear search, while +`Alpha_shape_3::alpha_lower_bound()` and `Alpha_shape_3::alpha_upper_bound()` +use binary search. +`Alpha_shape_3::number_of_solid_components()` performs a graph traversal and takes time +linear in the number of cells of the underlying triangulation. +`Alpha_shape_3::find_optimal_alpha()` uses binary search and takes time +\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points. */ template< typename Dt, typename ExactAlphaComparisonTag > class Alpha_shape_3 : public Dt { public: -/// \name Types +/// \name Types /// @{ /*! -the alpha shape traits type. +the alpha shape traits type. It has to derive from a triangulation traits class. For example `Dt::Point` is a point class. -*/ -typedef unspecified_type Gt; +*/ +typedef unspecified_type Gt; /*! -the number type of alpha values. +the number type of alpha values. -In case `ExactAlphaComparisonTag` is `CGAL::Tag_false`, it is Gt::FT. +In case `ExactAlphaComparisonTag` is `CGAL::Tag_false`, it is Gt::FT. -In case `ExactAlphaComparisonTag` is `CGAL::Tag_true`, it is a number type -allowing filtered exact comparisons (that is, interval arithmetic is first used before -resorting to exact arithmetic). Access to the interval containing the exact value is provided through the function -`FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `Interval_nt` -with `Protected=true`. Access to the exact value is provided through the function -`FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of %CGAL +In case `ExactAlphaComparisonTag` is `CGAL::Tag_true`, it is a number type +allowing filtered exact comparisons (that is, interval arithmetic is first used before +resorting to exact arithmetic). Access to the interval containing the exact value is provided through the function +`FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `Interval_nt` +with `Protected=true`. Access to the exact value is provided through the function +`FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of %CGAL (it may be `mpq_class`, `Gmpq`, `Quotient`, etc). An overload for the function `double to_double(FT)` is also available. Its precision is controlled through `FT::set_relative_precision_of_to_double()` in exactly the same way as with `Lazy_exact_nt`, so a call to `to_double` may trigger an exact evaluation. -It must be noted that an object of type `FT` is valid as long as the alpha shapes class that creates -it is valid and has not been modified. -For convenience, classical comparison operators are provided for the type `FT`. +It must be noted that an object of type `FT` is valid as long as the alpha shapes class that creates +it is valid and has not been modified. +For convenience, classical comparison operators are provided for the type `FT`. -*/ -typedef unspecified_type FT; +*/ +typedef unspecified_type FT; /*! The point type. @@ -125,196 +125,196 @@ shapes, `Point` will be equal to `Gt::Weighted_point_3`. typedef Dt::Point Point; /*! -The size type. -*/ -typedef unspecified_type size_type; +The size type. +*/ +typedef unspecified_type size_type; /*! -A bidirectional and non-mutable iterator that allow to traverse -the increasing sequence of different alpha values. -\pre Its `value_type` is `FT`. -*/ -typedef unspecified_type Alpha_iterator; +A bidirectional and non-mutable iterator that allow to traverse +the increasing sequence of different alpha values. +\pre Its `value_type` is `FT`. +*/ +typedef unspecified_type Alpha_iterator; /*! -In GENERAL mode, -In REGULARIZED mode, -*/ -enum Mode {GENERAL, /**< the alpha complex can have singular faces, - i.e., faces of dimension \f$ k\f$, for \f$ k=(0,1,2)\f$ +In GENERAL mode, +In REGULARIZED mode, +*/ +enum Mode {GENERAL, /**< the alpha complex can have singular faces, + i.e., faces of dimension \f$ k\f$, for \f$ k=(0,1,2)\f$ that are not subfaces of a \f$ k+1\f$ face of the complex.*/ - REGULARIZED /**< the complex is regularized, that is - singular faces are dropped and the alpha complex - includes only a subset of the tetrahedral cells + REGULARIZED /**< the complex is regularized, that is + singular faces are dropped and the alpha complex + includes only a subset of the tetrahedral cells of the triangulation and the subfaces of those cells. */ -}; - -/*! -Enum to classify the faces of the underlying -triangulation with respect to the alpha shape. - -In `GENERAL` mode, for \f$ k=(0,1,2)\f$, -each k-dimensional simplex of the triangulation -can be classified as `EXTERIOR`, `SINGULAR`, `REGULAR` -or `INTERIOR`. -In `GENERAL` mode a \f$ k\f$ simplex is `REGULAR` if it is on the boundary -f the alpha complex and belongs to a \f$ k+1\f$ simplex in this complex -and it is `SINGULAR` if it is a boundary simplex that is not included in a \f$ k+1\f$ simplex of the complex. - -In `REGULARIZED` mode, for \f$ k=(0,1,2)\f$ -each k-dimensional simplex of the triangulation -can be classified as `EXTERIOR`, `REGULAR` or `INTERIOR`, i.e.\ -there is no singular faces. -A \f$ k\f$ simplex is `REGULAR` if it is on the boundary of alpha complex -and belongs to a tetrahedral cell of the complex. -*/ -enum Classification_type {EXTERIOR, SINGULAR, REGULAR, INTERIOR}; +}; + +/*! +Enum to classify the faces of the underlying +triangulation with respect to the alpha shape. + +In `GENERAL` mode, for \f$ k=(0,1,2)\f$, +each k-dimensional simplex of the triangulation +can be classified as `EXTERIOR`, `SINGULAR`, `REGULAR` +or `INTERIOR`. +In `GENERAL` mode a \f$ k\f$ simplex is `REGULAR` if it is on the boundary +f the alpha complex and belongs to a \f$ k+1\f$ simplex in this complex +and it is `SINGULAR` if it is a boundary simplex that is not included in a \f$ k+1\f$ simplex of the complex. + +In `REGULARIZED` mode, for \f$ k=(0,1,2)\f$ +each k-dimensional simplex of the triangulation +can be classified as `EXTERIOR`, `REGULAR` or `INTERIOR`, i.e.\ +there is no singular faces. +A \f$ k\f$ simplex is `REGULAR` if it is on the boundary of alpha complex +and belongs to a tetrahedral cell of the complex. +*/ +enum Classification_type {EXTERIOR, SINGULAR, REGULAR, INTERIOR}; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -Introduces an empty alpha shape, sets the current alpha value to `alpha` and the mode to `m`. -*/ -Alpha_shape_3(FT alpha = 0, -Mode m = REGULARIZED); +Introduces an empty alpha shape, sets the current alpha value to `alpha` and the mode to `m`. +*/ +Alpha_shape_3(FT alpha = 0, +Mode m = REGULARIZED); /*! -Builds an alpha shape of mode `m` -from the triangulation `dt`. -\attention This operation destroys the triangulation `dt`. -*/ -Alpha_shape_3(Dt& dt, -FT alpha = 0, -Mode m = REGULARIZED); +Builds an alpha shape of mode `m` +from the triangulation `dt`. +\attention This operation destroys the triangulation `dt`. +*/ +Alpha_shape_3(Dt& dt, +FT alpha = 0, +Mode m = REGULARIZED); /*! -Builds an alpha shape of mode `m` for the points in the range -`[first,last)` and set the current alpha value to `alpha`. -\tparam InputIterator must be an input iterator with value type `Point` (the point type of the underlying triangulation.) -*/ -template < class InputIterator > -Alpha_shape_3( -InputIterator first, -InputIterator last, -const FT& alpha = 0, -Mode m = REGULARIZED); +Builds an alpha shape of mode `m` for the points in the range +`[first,last)` and set the current alpha value to `alpha`. +\tparam InputIterator must be an input iterator with value type `Point` (the point type of the underlying triangulation.) +*/ +template < class InputIterator > +Alpha_shape_3( +InputIterator first, +InputIterator last, +const FT& alpha = 0, +Mode m = REGULARIZED); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! Initialize the alpha shape data structure -for points in the range `[first,last)`. -Returns the number of data points inserted in the underlying -triangulation. +for points in the range `[first,last)`. +Returns the number of data points inserted in the underlying +triangulation. -If the function is applied to an non-empty alpha shape data structure, it is cleared -before initialization. -\tparam InputIterator must be an input iterator with value type `Point`. -*/ -template < class InputIterator > -std::ptrdiff_t make_alpha_shape( -InputIterator first, -InputIterator last); +If the function is applied to an non-empty alpha shape data structure, it is cleared +before initialization. +\tparam InputIterator must be an input iterator with value type `Point`. +*/ +template < class InputIterator > +std::ptrdiff_t make_alpha_shape( +InputIterator first, +InputIterator last); /*! -Clears the structure. -*/ -void -clear(); +Clears the structure. +*/ +void +clear(); /*! -Sets the \f$ \alpha\f$-value to `alpha`. -Returns the previous \f$ \alpha\f$-value. -\pre `alpha` \f$ \geq0\f$. -*/ -FT -set_alpha(const FT& alpha); +Sets the \f$ \alpha\f$-value to `alpha`. +Returns the previous \f$ \alpha\f$-value. +\pre `alpha` \f$ \geq0\f$. +*/ +FT +set_alpha(const FT& alpha); /*! -Sets the mode of the alpha shape to `GENERAL` or `REGULARIZED`. -Returns the previous mode. -Changing the mode of an alpha shape -entails a partial re-computation of the data structure. -*/ -Mode -set_mode(Mode m = REGULARIZED ); +Sets the mode of the alpha shape to `GENERAL` or `REGULARIZED`. +Returns the previous mode. +Changing the mode of an alpha shape +entails a partial re-computation of the data structure. +*/ +Mode +set_mode(Mode m = REGULARIZED ); -/// @} +/// @} -/// \name Query Functions +/// \name Query Functions /// @{ /*! -Returns whether the alpha shape is general or regularized. -*/ -Mode -get_mode(void) const; +Returns whether the alpha shape is general or regularized. +*/ +Mode +get_mode(void) const; /*! -Returns the current \f$ \alpha\f$-value. -*/ -const FT& -get_alpha(void) const; +Returns the current \f$ \alpha\f$-value. +*/ +const FT& +get_alpha(void) const; /*! -Returns the `n`-th `alpha`-value, sorted in an increasing order. -\pre `n` < number of alphas. -*/ -const FT& get_nth_alpha(int n) const; +Returns the `n`-th `alpha`-value, sorted in an increasing order. +\pre `n` < number of alphas. +*/ +const FT& get_nth_alpha(int n) const; /*! -Returns the number of different alpha-values. -*/ -size_type number_of_alphas() const; +Returns the number of different alpha-values. +*/ +size_type number_of_alphas() const; /*! -Locates a point `p` in the underlying triangulation and Classifies the -associated k-face with respect to `alpha`. -*/ -Classification_type -classify(const Point& p, -const FT& alpha = get_alpha()) const; +Locates a point `p` in the underlying triangulation and Classifies the +associated k-face with respect to `alpha`. +*/ +Classification_type +classify(const Point& p, +const FT& alpha = get_alpha()) const; /*! -Classifies the cell `f` of the underlying triangulation with -respect -to `alpha`. -*/ -Classification_type -classify(Cell_handle f, const FT& alpha = get_alpha()) const; +Classifies the cell `f` of the underlying triangulation with +respect +to `alpha`. +*/ +Classification_type +classify(Cell_handle f, const FT& alpha = get_alpha()) const; /*! -Classifies the facet `f` of the underlying triangulation with -respect to `alpha`. -*/ -Classification_type -classify(Facet f, const FT& alpha = get_alpha()) const; +Classifies the facet `f` of the underlying triangulation with +respect to `alpha`. +*/ +Classification_type +classify(Facet f, const FT& alpha = get_alpha()) const; /*! -Classifies the facet of the cell `f` opposite to the vertex with index -`i` -of the underlying triangulation with respect to `alpha`. -*/ -Classification_type -classify(Cell_handle f, int i, const FT& alpha = get_alpha()) const; +Classifies the facet of the cell `f` opposite to the vertex with index +`i` +of the underlying triangulation with respect to `alpha`. +*/ +Classification_type +classify(Cell_handle f, int i, const FT& alpha = get_alpha()) const; /*! -Classifies the edge `e` with respect to `alpha` . -*/ -Classification_type -classify(const Edge& e, const FT& alpha = get_alpha()) const; +Classifies the edge `e` with respect to `alpha` . +*/ +Classification_type +classify(const Edge& e, const FT& alpha = get_alpha()) const; /*! -Classifies the vertex `v` of the underlying triangulation with respect to `alpha`. -*/ -Classification_type -classify(Vertex_handle v, const FT& alpha = get_alpha()) const; +Classifies the vertex `v` of the underlying triangulation with respect to `alpha`. +*/ +Classification_type +classify(Vertex_handle v, const FT& alpha = get_alpha()) const; /*! Returns the alpha-status of the edge `e`. @@ -329,48 +329,48 @@ Alpha_status get_alpha_status(const Facet& f) const; /*! -Write the cells which are of type `type` for -the alpha value `alpha` to the sequence -pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_cells(OutputIterator it, -Classification_type type, -const FT& alpha = get_alpha()); - -/*! -Write the facets which are of type `type` for -the alpha value `alpha` to the sequence -pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_facets(OutputIterator it, -Classification_type type, -const FT& alpha= get_alpha()); - -/*! -Write the edges which are of type `type` for -the alpha value `alpha` to the sequence -pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_edges(OutputIterator it, -Classification_type type, -const FT& alpha = get_alpha()); - -/*! -Write the vertices which are of type `type` for -the alpha value `alpha` to the sequence -pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_vertices(OutputIterator it, -Classification_type type, -const FT& alpha); +Write the cells which are of type `type` for +the alpha value `alpha` to the sequence +pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_cells(OutputIterator it, +Classification_type type, +const FT& alpha = get_alpha()); + +/*! +Write the facets which are of type `type` for +the alpha value `alpha` to the sequence +pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_facets(OutputIterator it, +Classification_type type, +const FT& alpha= get_alpha()); + +/*! +Write the edges which are of type `type` for +the alpha value `alpha` to the sequence +pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_edges(OutputIterator it, +Classification_type type, +const FT& alpha = get_alpha()); + +/*! +Write the vertices which are of type `type` for +the alpha value `alpha` to the sequence +pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_vertices(OutputIterator it, +Classification_type type, +const FT& alpha); /*! Output all the faces of the triangulation @@ -406,54 +406,54 @@ purpose. template OutputIterator filtration_with_alpha_values(OutputIterator it) const; -/// @} +/// @} -/// \name Traversal of the alpha-Values +/// \name Traversal of the alpha-Values /// @{ /*! -Returns an iterator that allows to traverse the -sorted sequence of \f$ \alpha\f$-values of the family of alpha shapes. -*/ -Alpha_iterator alpha_begin() const; +Returns an iterator that allows to traverse the +sorted sequence of \f$ \alpha\f$-values of the family of alpha shapes. +*/ +Alpha_iterator alpha_begin() const; /*! -Returns the corresponding past-the-end iterator. -*/ -Alpha_iterator alpha_end() const; +Returns the corresponding past-the-end iterator. +*/ +Alpha_iterator alpha_end() const; /*! -Returns an iterator pointing to an element with \f$ \alpha\f$-value -`alpha`, or the corresponding past-the-end iterator if such -an element is not found. -*/ -Alpha_iterator alpha_find(const FT& alpha) const; +Returns an iterator pointing to an element with \f$ \alpha\f$-value +`alpha`, or the corresponding past-the-end iterator if such +an element is not found. +*/ +Alpha_iterator alpha_find(const FT& alpha) const; /*! -Returns an iterator pointing to the first element with -\f$ \alpha\f$-value not less than `alpha`. -*/ -Alpha_iterator alpha_lower_bound(const FT& alpha) const; +Returns an iterator pointing to the first element with +\f$ \alpha\f$-value not less than `alpha`. +*/ +Alpha_iterator alpha_lower_bound(const FT& alpha) const; /*! -Returns an iterator pointing to the first element with \f$ \alpha\f$-value -greater than `alpha`. -*/ -Alpha_iterator alpha_upper_bound(const FT& alpha) const; +Returns an iterator pointing to the first element with \f$ \alpha\f$-value +greater than `alpha`. +*/ +Alpha_iterator alpha_upper_bound(const FT& alpha) const; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns the number of solid components of the alpha shape, that is, the number of -components of its regularized version. -*/ -size_type number_of_solid_components(const FT& alpha = get_alpha()) const; +Returns the number of solid components of the alpha shape, that is, the number of +components of its regularized version. +*/ +size_type number_of_solid_components(const FT& alpha = get_alpha()) const; /*! -Returns an iterator pointing to smallest \f$ \alpha\f$ value +Returns an iterator pointing to smallest \f$ \alpha\f$ value such that the alpha shape satisfies the following two properties: - All data points are either on the boundary or in the interior @@ -461,8 +461,8 @@ of the regularized version of the alpha shape. - The number of solid component of the alpha shape is equal to or smaller than `nb_components`. -*/ -Alpha_iterator find_optimal_alpha(size_type nb_components) const; +*/ +Alpha_iterator find_optimal_alpha(size_type nb_components) const; /// @} @@ -470,25 +470,25 @@ Alpha_iterator find_optimal_alpha(size_type nb_components) const; }; /* end Alpha_shape_3 */ /*! -Inserts the alpha shape `A` for the current alpha value into the stream `os`. +Inserts the alpha shape `A` for the current alpha value into the stream `os`. Defined in `CGAL/IO/io.h` -\pre The insert operator must be defined for `Point`. -\relates Alpha_shape_3 -*/ -std::ostream& operator<<(std::ostream& os, -const Alpha_shape_3& A); +\pre The insert operator must be defined for `Point`. +\relates Alpha_shape_3 +*/ +std::ostream& operator<<(std::ostream& os, +const Alpha_shape_3& A); /*! -Inserts the alpha shape `A` for the current alpha value into the Geomview stream `W`. -\pre The insert operator must be defined for `GT::Point` and `GT::Triangle`. +Inserts the alpha shape `A` for the current alpha value into the Geomview stream `W`. +\pre The insert operator must be defined for `GT::Point` and `GT::Triangle`. Defined in `CGAL/IO/Geomview_stream.h` and `CGAL/IO/alpha_shape_geomview_ostream_3.h` -\relates Alpha_shape_3 -*/ -Geomview_stream& operator<<(Geomview_stream& W, -const Alpha_shape_3& A); +\relates Alpha_shape_3 +*/ +Geomview_stream& operator<<(Geomview_stream& W, +const Alpha_shape_3& A); } /* end namespace CGAL */ diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h index 8b57c573d9da..5a92d16b0dc2 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h @@ -4,15 +4,15 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Alpha_shape_cell_base_3` is the default model for the concept -`AlphaShapeCell_3`. +The class `Alpha_shape_cell_base_3` is the default model for the concept +`AlphaShapeCell_3`. -\tparam Traits is the geometric traits class that is provided -to the `Alpha_shape_3` class. +\tparam Traits is the geometric traits class that is provided +to the `Alpha_shape_3` class. \tparam Cb must be a cell base class adapted to the type of triangulation that is being used. By default, it is instantiated with `Delaunay_triangulation_cell_base_3`, which is appropriate for basic alpha shapes. -\tparam ExactAlphaComparisonTag is a tag that, when set to +\tparam ExactAlphaComparisonTag is a tag that, when set to \link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description provided in the documentation of `Alpha_shape_3` for more details. The default value is \link Tag_false `Tag_false`\endlink. \tparam WeightedTag is used only if `ExactAlphaComparisonTag` is \link Tag_true `Tag_true`\endlink. It @@ -37,23 +37,23 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Alpha_status` is a small data structure to store -the critical alpha values of faces of an alpha shape. -Each face has three critical alpha values, called -`alpha_min`, `alpha_mid` and `alpha_max` in increasing order. -The face will be exterior for any \f$ \alpha < \f$ `alpha_min`, -singular for `alpha_min` \f$ \leq \alpha < \f$ `alpha_mid`, -regular for `alpha_mid` \f$ \leq \alpha < \f$ `alpha_max` -and interior for `alpha_max` \f$ \leq \alpha\f$. -The value `alpha_min` is undefined for faces which are not Gabriel -faces and therefore do not appear in the alpha complex -without any of their -including face. The value `alpha_max` is undefined +The class `Alpha_status` is a small data structure to store +the critical alpha values of faces of an alpha shape. +Each face has three critical alpha values, called +`alpha_min`, `alpha_mid` and `alpha_max` in increasing order. +The face will be exterior for any \f$ \alpha < \f$ `alpha_min`, +singular for `alpha_min` \f$ \leq \alpha < \f$ `alpha_mid`, +regular for `alpha_mid` \f$ \leq \alpha < \f$ `alpha_max` +and interior for `alpha_max` \f$ \leq \alpha\f$. +The value `alpha_min` is undefined for faces which are not Gabriel +faces and therefore do not appear in the alpha complex +without any of their +including face. The value `alpha_max` is undefined for convex hull faces which can never be interior. -The data structure also includes two Boolean to mark -if the face is a Gabriel face or a convex hull face. +The data structure also includes two Boolean to mark +if the face is a Gabriel face or a convex hull face. -The class `Alpha_status` is parameterized by a number type `NT`. +The class `Alpha_status` is parameterized by a number type `NT`. \sa `::AlphaShapeCell_3` \sa `::AlphaShapeVertex_3` @@ -63,75 +63,75 @@ template< typename NT > class Alpha_status { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Alpha_status(); +default constructor. +*/ +Alpha_status(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets Gabriel marker. -*/ -void set_is_Gabriel(bool yesorno); +sets Gabriel marker. +*/ +void set_is_Gabriel(bool yesorno); /*! sets convex hull marker. -*/ -void set_is_on_chull(bool yesorno); +*/ +void set_is_on_chull(bool yesorno); /*! -sets `alpha_min`. -*/ -void set_alpha_min(NT alpha); +sets `alpha_min`. +*/ +void set_alpha_min(NT alpha); /*! -sets `alpha_mid`. -*/ -void set_alpha_mid(NT alpha); +sets `alpha_mid`. +*/ +void set_alpha_mid(NT alpha); /*! -sets `alpha_max`. -*/ -void set_alpha_max(NT alpha); +sets `alpha_max`. +*/ +void set_alpha_max(NT alpha); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns `true` for Gabriel faces. -*/ -bool is_Gabriel() const ; +returns `true` for Gabriel faces. +*/ +bool is_Gabriel() const ; /*! -returns `true` for convex hull faces. -*/ -bool is_on_chull() const; +returns `true` for convex hull faces. +*/ +bool is_on_chull() const; /*! -returns the `alpha_min`. -\pre `is_Gabriel()` returns `false`. -*/ -NT alpha_min() const; +returns the `alpha_min`. +\pre `is_Gabriel()` returns `false`. +*/ +NT alpha_min() const; /*! returns `alpha_mid`. -*/ -NT alpha_mid() const; +*/ +NT alpha_mid() const; /*! -returns `alpha_max`. -\pre `is_on_chull()` returns `false`. -*/ -NT alpha_max() const; +returns `alpha_max`. +\pre `is_on_chull()` returns `false`. +*/ +NT alpha_max() const; /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h index 0eda36219960..0ba47d5cb6fe 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h @@ -4,8 +4,8 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Alpha_shape_vertex_base_3` is the default model for the concept -`AlphaShapeVertex_3`. +The class `Alpha_shape_vertex_base_3` is the default model for the concept +`AlphaShapeVertex_3`. \tparam Traits is the geometric traits class that is provided to the `Alpha_shape_3` class. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h index 3cf5a43d7304..156159f256dc 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h @@ -4,13 +4,13 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Fixed_alpha_shape_3` represents one (fixed) -alpha shape of points in the 3D space for a real -\f$ \alpha\f$. It maintains an underlying triangulation -of the class `Dt` which -represents connectivity and order among its faces. Each -\f$ k\f$-dimensional face of the `Dt` is associated with -a classification that specifies its status in the alpha complex, alpha being fixed. +The class `Fixed_alpha_shape_3` represents one (fixed) +alpha shape of points in the 3D space for a real +\f$ \alpha\f$. It maintains an underlying triangulation +of the class `Dt` which +represents connectivity and order among its faces. Each +\f$ k\f$-dimensional face of the `Dt` is associated with +a classification that specifies its status in the alpha complex, alpha being fixed. \tparam Dt must be either `Delaunay_triangulation_3`, `Regular_triangulation_3`, `Periodic_3_Delaunay_triangulation_3` or `Periodic_3_regular_triangulation_3`. @@ -27,184 +27,184 @@ At the moment, only the static version is implemented. \cgalHeading{I/O} -The I/O operators are defined for `iostream`, and for -the window stream provided by \cgal. The format for the iostream -is an internal format. +The I/O operators are defined for `iostream`, and for +the window stream provided by \cgal. The format for the iostream +is an internal format. */ template< typename Dt > class Fixed_alpha_shape_3 : public Dt { public: -/// \name Types +/// \name Types /// @{ /*! the alpha shape traits type. It has to derive from a triangulation traits class. For example `Dt::Point` is a Point class. -*/ -typedef unspecified_type Gt; +*/ +typedef unspecified_type Gt; /*! -the number type of alpha. -*/ -typedef Gt::FT FT; +the number type of alpha. +*/ +typedef Gt::FT FT; /*! -Enum to classify the simplices of the underlying -triangulation with respect to a given alpha value. +Enum to classify the simplices of the underlying +triangulation with respect to a given alpha value. -Each k-dimensional simplex of the triangulation -can be classified as `EXTERIOR`, `SINGULAR`, `REGULAR` -or `INTERIOR`. -A \f$ k\f$ simplex is `REGULAR` if it is on the boundary -of the alpha complex and belongs to a \f$ k+1\f$ simplex in this complex -and it is `SINGULAR` if it is a boundary simplex that is not included in a \f$ k+1\f$ simplex of the complex. +Each k-dimensional simplex of the triangulation +can be classified as `EXTERIOR`, `SINGULAR`, `REGULAR` +or `INTERIOR`. +A \f$ k\f$ simplex is `REGULAR` if it is on the boundary +of the alpha complex and belongs to a \f$ k+1\f$ simplex in this complex +and it is `SINGULAR` if it is a boundary simplex that is not included in a \f$ k+1\f$ simplex of the complex. -*/ -enum Classification_type {EXTERIOR, SINGULAR, REGULAR, INTERIOR}; +*/ +enum Classification_type {EXTERIOR, SINGULAR, REGULAR, INTERIOR}; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -builds an empty fixed alpha shape and sets the alpha value to `alpha`. -*/ -Fixed_alpha_shape_3(FT alpha = 0); +builds an empty fixed alpha shape and sets the alpha value to `alpha`. +*/ +Fixed_alpha_shape_3(FT alpha = 0); /*! -builds a fixed alpha shape from the triangulation `dt`, -and sets the alpha value to `alpha`. +builds a fixed alpha shape from the triangulation `dt`, +and sets the alpha value to `alpha`. \attention This operation swaps `*this` and `dt`, that is `dt` is an empty triangulation once the fixed alpha shape is built. -*/ -Fixed_alpha_shape_3(Dt& dt,FT alpha = 0); +*/ +Fixed_alpha_shape_3(Dt& dt,FT alpha = 0); /*! -builds a fixed alpha shape for the points in the range -`[first,last)` and sets the alpha value to `alpha`. -\tparam InputIterator must be an input iterator with value type `Point` (the type point of the underlying triangulation.) -*/ -template < class InputIterator > -Fixed_alpha_shape_3( -InputIterator first, -InputIterator last, -const FT& alpha = 0); +builds a fixed alpha shape for the points in the range +`[first,last)` and sets the alpha value to `alpha`. +\tparam InputIterator must be an input iterator with value type `Point` (the type point of the underlying triangulation.) +*/ +template < class InputIterator > +Fixed_alpha_shape_3( +InputIterator first, +InputIterator last, +const FT& alpha = 0); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! inserts the point `p` in the underlying triangulation and returns the corresponding vertex. -The optional argument `start` is used as a starting place for the search. -The classification types of the new simplices are computed and that of the simplices incident -to the new ones are updated. +The optional argument `start` is used as a starting place for the search. +The classification types of the new simplices are computed and that of the simplices incident +to the new ones are updated. -*/ -Vertex_handle insert (Point p,Cell_handle start = Cell_handle()); +*/ +Vertex_handle insert (Point p,Cell_handle start = Cell_handle()); /*! -removes the vertex `v` from the underlying triangulation. +removes the vertex `v` from the underlying triangulation. The classification types of new simplices and their incident faces are set or reset. -*/ -void remove (Vertex_handle v); +*/ +void remove (Vertex_handle v); /*! -clears the structure. -*/ -void -clear(); +clears the structure. +*/ +void +clear(); -/// @} +/// @} -/// \name Query Functions +/// \name Query Functions /// @{ /*! -returns the \f$ \alpha\f$-value. -*/ -const FT& -get_alpha(void) const; +returns the \f$ \alpha\f$-value. +*/ +const FT& +get_alpha(void) const; /*! -classifies the cell `c` of the underlying triangulation in the alpha complex. -*/ -Classification_type -classify(Cell_handle c) const; +classifies the cell `c` of the underlying triangulation in the alpha complex. +*/ +Classification_type +classify(Cell_handle c) const; /*! -classifies the facet `f` of the underlying triangulation in the alpha complex. -*/ -Classification_type classify(Facet f) const; +classifies the facet `f` of the underlying triangulation in the alpha complex. +*/ +Classification_type classify(Facet f) const; /*! -classifies the facet of the cell `f` opposite to the vertex with index -`i` of the underlying triangulation in the alpha complex. -*/ -Classification_type classify(Cell_handle f, int i) const; +classifies the facet of the cell `f` opposite to the vertex with index +`i` of the underlying triangulation in the alpha complex. +*/ +Classification_type classify(Cell_handle f, int i) const; /*! -classifies the edge `e` of the underlying triangulation in the alpha complex. -*/ -Classification_type classify(const Edge& e) const; +classifies the edge `e` of the underlying triangulation in the alpha complex. +*/ +Classification_type classify(const Edge& e) const; /*! -classifies the vertex `v` of the underlying triangulation in the alpha complex. -*/ -Classification_type classify(Vertex_handle v) const; +classifies the vertex `v` of the underlying triangulation in the alpha complex. +*/ +Classification_type classify(Vertex_handle v) const; /*! -writes the cells which are of type `type` in the alpha complex -to the sequence -pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_cells(OutputIterator it, Classification_type type); +writes the cells which are of type `type` in the alpha complex +to the sequence +pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_cells(OutputIterator it, Classification_type type); /*! -writes the facets which are of type `type` in the alpha complex -to the sequence pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_facets(OutputIterator it, Classification_type type); +writes the facets which are of type `type` in the alpha complex +to the sequence pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_facets(OutputIterator it, Classification_type type); /*! -writes the edges which are of type `type` in the alpha complex -to the sequence -pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_edges(OutputIterator it, Classification_type type); +writes the edges which are of type `type` in the alpha complex +to the sequence +pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_edges(OutputIterator it, Classification_type type); /*! -writes the vertices which are of type `type` in the alpha complex -to the sequence pointed to by the output iterator `it`. Returns past the end -of the output sequence. -*/ -template -OutputIterator get_alpha_shape_vertices(OutputIterator it, Classification_type type); +writes the vertices which are of type `type` in the alpha complex +to the sequence pointed to by the output iterator `it`. Returns past the end +of the output sequence. +*/ +template +OutputIterator get_alpha_shape_vertices(OutputIterator it, Classification_type type); /// @} }; /* end Fixed_alpha_shape_3 */ /*! -inserts the fixed alpha shape `A` into the stream `os`. +inserts the fixed alpha shape `A` into the stream `os`. An overlaoad of `operator<<` must be available for `GT::Point`. -\relates Fixed_alpha_shape_3 -*/ - std::ostream& operator<<(std::ostream& os, const Fixed_alpha_shape_3
    & A); +\relates Fixed_alpha_shape_3 +*/ + std::ostream& operator<<(std::ostream& os, const Fixed_alpha_shape_3
    & A); } /* end namespace CGAL */ diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h index 78364d4cbed5..fc558a82d759 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h @@ -4,8 +4,8 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Fixed_alpha_shape_cell_base_3` is the default model for the concept -`FixedAlphaShapeCell_3`. +The class `Fixed_alpha_shape_cell_base_3` is the default model for the concept +`FixedAlphaShapeCell_3`. \tparam Traits is the geometric traits class that is provided to the `Alpha_shape_3` class. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h index a069afa09783..4b237a562f2b 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h @@ -4,8 +4,8 @@ namespace CGAL { /*! \ingroup PkgAlphaShapes3Ref -The class `Fixed_alpha_shape_vertex_base_3` is the default model for the concept -`FixedAlphaShapeVertex_3`. +The class `Fixed_alpha_shape_vertex_base_3` is the default model for the concept +`FixedAlphaShapeVertex_3`. \tparam Traits is the geometric traits class that is provided to the `Alpha_shape_3` class. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h index cfc43489b6e4..00dcd06f13b6 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h @@ -21,68 +21,68 @@ class AlphaShapeCell_3 { /// @{ /*! -A number type. Must be the same as the number type used -in the traits class of the triangulation underlying the alpha shape. -*/ -typedef unspecified_type NT; +A number type. Must be the same as the number type used +in the traits class of the triangulation underlying the alpha shape. +*/ +typedef unspecified_type NT; /*! -An iterator with value type `CGAL::Alpha_status`. -*/ -typedef unspecified_type Alpha_status_iterator; +An iterator with value type `CGAL::Alpha_status`. +*/ +typedef unspecified_type Alpha_status_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -AlphaShapeCell_3(); +default constructor. +*/ +AlphaShapeCell_3(); /*! -constructor setting the incident vertices. -*/ -AlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3); +constructor setting the incident vertices. +*/ +AlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3); /*! -constructor setting the incident vertices and the neighboring cells. -*/ -AlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, -const Cell_handle& n0, const Cell_handle& n1, const Cell_handle& n2, const Cell_handle& n3); +constructor setting the incident vertices and the neighboring cells. +*/ +AlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, +const Cell_handle& n0, const Cell_handle& n1, const Cell_handle& n2, const Cell_handle& n3); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns the alpha value of the cell. -*/ -NT get_alpha(); +Returns the alpha value of the cell. +*/ +NT get_alpha(); /*! -Returns an iterator on the `CGAL::Alpha_status` of the facet -`i` of the cell. -*/ -Alpha_status_iterator get_facet_status(int i); +Returns an iterator on the `CGAL::Alpha_status` of the facet +`i` of the cell. +*/ +Alpha_status_iterator get_facet_status(int i); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -Sets the critical value of the cell. -*/ -void set_alpha(const NT & alpha); +Sets the critical value of the cell. +*/ +void set_alpha(const NT & alpha); /*! -Sets the iterator pointing to the `CGAL::Alpha_status` -of the facet `i` of the cell. -*/ -void set_facet_status(int i, Alpha_status_iterator as); +Sets the iterator pointing to the `CGAL::Alpha_status` +of the facet `i` of the cell. +*/ +void set_facet_status(int i, Alpha_status_iterator as); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeTraits_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeTraits_3.h index 42d237162db1..239e5cfff55f 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeTraits_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeTraits_3.h @@ -3,9 +3,9 @@ \ingroup PkgAlphaShapes3Concepts \cgalConcept -The concept `AlphaShapeTraits_3` describes the requirements -for the geometric traits class -of the underlying Delaunay triangulation of a basic alpha shape. +The concept `AlphaShapeTraits_3` describes the requirements +for the geometric traits class +of the underlying Delaunay triangulation of a basic alpha shape. \cgalRefines `DelaunayTriangulationTraits_3` @@ -22,48 +22,48 @@ following. class AlphaShapeTraits_3 { public: -/// \name Types +/// \name Types /// @{ /*! -A number type compatible with the type used for -the points coordinate. -*/ -typedef unspecified_type FT; +A number type compatible with the type used for +the points coordinate. +*/ +typedef unspecified_type FT; /*! -An object constructor able to compute: - -- the squared radius of the -smallest circumscribing sphere of 4 points `p0, p1, p2, p3`, -- the squared radius of the -smallest circumscribing sphere of 3 points `p0, p1, p2`, -- the squared radius of the smallest circumscribing sphere -of 2 points `p0, p1`, -- the squared radius of the smallest circumscribing sphere -to a single point `p0` (which is `FT(0)`). -*/ -typedef unspecified_type Compute_squared_radius_3; - -/// @} - -/// \name Creation +An object constructor able to compute: + +- the squared radius of the +smallest circumscribing sphere of 4 points `p0, p1, p2, p3`, +- the squared radius of the +smallest circumscribing sphere of 3 points `p0, p1, p2`, +- the squared radius of the smallest circumscribing sphere +of 2 points `p0, p1`, +- the squared radius of the smallest circumscribing sphere +to a single point `p0` (which is `FT(0)`). +*/ +typedef unspecified_type Compute_squared_radius_3; + +/// @} + +/// \name Creation /// @{ /*! -Default constructor. -*/ -AlphaShapeTraits_3(); +Default constructor. +*/ +AlphaShapeTraits_3(); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -*/ -Compute_squared_radius_3 compute_squared_radius_3_object(); +*/ +Compute_squared_radius_3 compute_squared_radius_3_object(); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeVertex_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeVertex_3.h index c179257efe86..4ffdc52948d0 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeVertex_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeVertex_3.h @@ -17,51 +17,51 @@ The concept `AlphaShapeVertex_3` describes the requirements for the base vertex class AlphaShapeVertex_3 { public: -/// \name Types +/// \name Types /// @{ /*! -Must be the same as the point type provided by -the geometric traits class of the triangulation. -*/ -typedef unspecified_type Point; +Must be the same as the point type provided by +the geometric traits class of the triangulation. +*/ +typedef unspecified_type Point; /*! -Must be `CGAL::Alpha_status` -where `NT` is the number type used in the geometric traits class -of the triangulation. -*/ -typedef unspecified_type Alpha_status; +Must be `CGAL::Alpha_status` +where `NT` is the number type used in the geometric traits class +of the triangulation. +*/ +typedef unspecified_type Alpha_status; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -AlphaShapeVertex_3(); +default constructor. +*/ +AlphaShapeVertex_3(); /*! -constructor setting the point. -*/ -AlphaShapeVertex_3(Point p); +constructor setting the point. +*/ +AlphaShapeVertex_3(Point p); /*! -constructor setting the point and an incident cell. -*/ -AlphaShapeVertex_3(Point p, const Cell_handle& c); +constructor setting the point and an incident cell. +*/ +AlphaShapeVertex_3(Point p, const Cell_handle& c); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -Returns a pointer the alpha status of the vertex. -*/ -Alpha_status* get_alpha_status(); +Returns a pointer the alpha status of the vertex. +*/ +Alpha_status* get_alpha_status(); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h index 95b29d94909d..ca23a4c3220c 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h @@ -14,54 +14,54 @@ The concept `FixedAlphaShapeCell_3` describes the requirements for the base cell class FixedAlphaShapeCell_3 { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -FixedAlphaShapeCell_3(); +default constructor. +*/ +FixedAlphaShapeCell_3(); /*! -constructor setting the incident vertices. -*/ -FixedAlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3); +constructor setting the incident vertices. +*/ +FixedAlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3); /*! -constructor setting the incident vertices and the neighboring cells. -*/ -FixedAlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, -const Cell_handle& n0, const Cell_handle& n1, const Cell_handle& n2, const Cell_handle& n3); +constructor setting the incident vertices and the neighboring cells. +*/ +FixedAlphaShapeCell_3(const Vertex_handle& v0, const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, +const Cell_handle& n0, const Cell_handle& n1, const Cell_handle& n2, const Cell_handle& n3); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns the classification of the cell. -*/ -Classification_type get_classification_type(); +Returns the classification of the cell. +*/ +Classification_type get_classification_type(); /*! -Returns the classification of the i-th facet of the cell. -*/ -Classification_type get_facet_classification_type(int i); +Returns the classification of the i-th facet of the cell. +*/ +Classification_type get_facet_classification_type(int i); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -Sets the classification of the cell. -*/ -void set_classification_type(Classification_type type); +Sets the classification of the cell. +*/ +void set_classification_type(Classification_type type); /*! -Sets the classification of the i-th facet of the cell. -*/ -void set_facet_classification_type(int i, Classification_type type); +Sets the classification of the i-th facet of the cell. +*/ +void set_facet_classification_type(int i, Classification_type type); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeTraits_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeTraits_3.h index 4f10a10a049b..65a58c2d56ff 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeTraits_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeTraits_3.h @@ -3,9 +3,9 @@ \ingroup PkgAlphaShapes3Concepts \cgalConcept -The concept `FixedAlphaShapeTraits_3` describes the requirements -for the geometric traits class -of the underlying Delaunay triangulation of a basic alpha shape with a fixed value alpha. +The concept `FixedAlphaShapeTraits_3` describes the requirements +for the geometric traits class +of the underlying Delaunay triangulation of a basic alpha shape with a fixed value alpha. \cgalRefines `DelaunayTriangulationTraits_3` @@ -21,46 +21,46 @@ value provides the following. class FixedAlphaShapeTraits_3 { public: -/// \name Types +/// \name Types /// @{ /*! -`CGAL::Comparison_result` or `Uncertain` -*/ -typedef unspecified_type Comparison_result; +`CGAL::Comparison_result` or `Uncertain` +*/ +typedef unspecified_type Comparison_result; /*! -An object constructor able to compare the squared radius of the smallest circumscribing sphere of -either four, three, two or one point(s) -with a given value of alpha. -It provides: -- `Comparison_result operator()(Point_3,Point_3,Point_3,Point_3)` -- `Comparison_result operator()(Point_3,Point_3,Point_3)` -- `Comparison_result operator()(Point_3,Point_3)` -- `Comparison_result operator()(Point_3)` +An object constructor able to compare the squared radius of the smallest circumscribing sphere of +either four, three, two or one point(s) +with a given value of alpha. +It provides: +- `Comparison_result operator()(Point_3,Point_3,Point_3,Point_3)` +- `Comparison_result operator()(Point_3,Point_3,Point_3)` +- `Comparison_result operator()(Point_3,Point_3)` +- `Comparison_result operator()(Point_3)` -*/ -typedef unspecified_type Compare_squared_radius_3; +*/ +typedef unspecified_type Compare_squared_radius_3; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -Default constructor. -*/ -FixedAlphaShapeTraits_3(); +Default constructor. +*/ +FixedAlphaShapeTraits_3(); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -*/ -Compare_squared_radius_3 compare_squared_radius_3_object(); +*/ +Compare_squared_radius_3 compare_squared_radius_3_object(); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeVertex_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeVertex_3.h index 4e2e55842f01..256d3b5f9be1 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeVertex_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeVertex_3.h @@ -15,64 +15,64 @@ The concept `FixedAlphaShapeVertex_3` describes the requirements for the base ve class FixedAlphaShapeVertex_3 { public: -/// \name Types +/// \name Types /// @{ /*! -Must be the same as the point type provided by -the geometric traits class of the triangulation. -*/ -typedef unspecified_type Point; +Must be the same as the point type provided by +the geometric traits class of the triangulation. +*/ +typedef unspecified_type Point; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -FixedAlphaShapeVertex_3(); +default constructor. +*/ +FixedAlphaShapeVertex_3(); /*! -constructor setting the point. -*/ -FixedAlphaShapeVertex_3(Point p); +constructor setting the point. +*/ +FixedAlphaShapeVertex_3(Point p); /*! -constructor setting the point and an incident cell. -*/ -FixedAlphaShapeVertex_3(Point p, const Cell_handle& c); +constructor setting the point and an incident cell. +*/ +FixedAlphaShapeVertex_3(Point p, const Cell_handle& c); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns a boolean indicating whether the point is on the convex hull of the point of the triangulation. -*/ -bool is_on_chull(); +Returns a boolean indicating whether the point is on the convex hull of the point of the triangulation. +*/ +bool is_on_chull(); /*! -Returns the classification of the vertex. -*/ -Classification_type get_classification_type(); +Returns the classification of the vertex. +*/ +Classification_type get_classification_type(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -Sets the classification of the vertex. -*/ -void set_classification_type(Classification_type type); +Sets the classification of the vertex. +*/ +void set_classification_type(Classification_type type); /*! -Sets whether the vertex is on the convex hull. -*/ -void is_on_chull(bool b); +Sets whether the vertex is on the convex hull. +*/ +void is_on_chull(bool b); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedWeightedAlphaShapeTraits_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedWeightedAlphaShapeTraits_3.h index 3b4e87d983cc..80129a48e2b6 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedWeightedAlphaShapeTraits_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedWeightedAlphaShapeTraits_3.h @@ -3,10 +3,10 @@ \ingroup PkgAlphaShapes3Concepts \cgalConcept -The concept `FixedWeightedAlphaShapeTraits_3` describes the requirements +The concept `FixedWeightedAlphaShapeTraits_3` describes the requirements for the geometric traits class of the underlying regular triangulation of a weighted alpha shape with fixed alpha value. -\cgalRefines `RegularTriangulationTraits_3` +\cgalRefines `RegularTriangulationTraits_3` In addition to the requirements described in the concept ::RegularTriangulationTraits_3, the geometric traits class of a @@ -21,46 +21,46 @@ alpha value provides the following. class FixedWeightedAlphaShapeTraits_3 { public: -/// \name Types +/// \name Types /// @{ /*! -`CGAL::Comparison_result` or `Uncertain` -*/ -typedef unspecified_type Comparison_result; +`CGAL::Comparison_result` or `Uncertain` +*/ +typedef unspecified_type Comparison_result; /*! -An object constructor able to compare the squared radius of the -smallest sphere orthogonal to either four, three, two or one weighted point(s) -to a given value of alpha. -It provides: -- `Comparison_result operator()(Weighted_point_3 ,Weighted_point_3 ,Weighted_point_3 ,Weighted_point_3 )` -- `Comparison_result operator()(Weighted_point_3 ,Weighted_point_3 ,Weighted_point_3 )` -- `Comparison_result operator()(Weighted_point_3 ,Weighted_point_3 )` -- `Comparison_result operator()(Weighted_point_3 )` +An object constructor able to compare the squared radius of the +smallest sphere orthogonal to either four, three, two or one weighted point(s) +to a given value of alpha. +It provides: +- `Comparison_result operator()(Weighted_point_3 ,Weighted_point_3 ,Weighted_point_3 ,Weighted_point_3 )` +- `Comparison_result operator()(Weighted_point_3 ,Weighted_point_3 ,Weighted_point_3 )` +- `Comparison_result operator()(Weighted_point_3 ,Weighted_point_3 )` +- `Comparison_result operator()(Weighted_point_3 )` -*/ -typedef unspecified_type Compare_weighted_squared_radius_3; +*/ +typedef unspecified_type Compare_weighted_squared_radius_3; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -FixedWeightedAlphaShapeTraits_3(); +default constructor. +*/ +FixedWeightedAlphaShapeTraits_3(); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -*/ -Compare_weighted_squared_radius_3 compare_weighted_squared_radius_3_object(); +*/ +Compare_weighted_squared_radius_3 compare_weighted_squared_radius_3_object(); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/WeightedAlphaShapeTraits_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/WeightedAlphaShapeTraits_3.h index 0ff511e04fa0..7c68fdb49d3c 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/WeightedAlphaShapeTraits_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/WeightedAlphaShapeTraits_3.h @@ -3,11 +3,11 @@ \ingroup PkgAlphaShapes3Concepts \cgalConcept -The concept `WeightedAlphaShapeTraits_3` describes the requirements -for the geometric traits class +The concept `WeightedAlphaShapeTraits_3` describes the requirements +for the geometric traits class of the underlying regular triangulation of a weighted alpha shape. -\cgalRefines `RegularTriangulationTraits_3` +\cgalRefines `RegularTriangulationTraits_3` In addition to the requirements described in the concept `RegularTriangulationTraits_3`, the geometric traits class of a @@ -22,46 +22,46 @@ following. class WeightedAlphaShapeTraits_3 { public: -/// \name Types +/// \name Types /// @{ /*! -A number type compatible with the type used for -the points coordinates. -*/ -typedef unspecified_type FT; +A number type compatible with the type used for +the points coordinates. +*/ +typedef unspecified_type FT; /*! -An object constructor able to compute the squared radius of the -smallest sphere orthogonal to four weighted points `p0, p1, p2, p3`, -and the squared radius of the -smallest sphere orthogonal to three weighted points `p0, p1, p2`, -and the squared radius of smallest sphere orthogonal to -two weighted points `p0, p1`, -and the squared radius of the smallest sphere orthogonal to a single -point `p0`. -*/ -typedef unspecified_type Compute_squared_radius_smallest_orthogonal_sphere_3; - -/// @} - -/// \name Creation +An object constructor able to compute the squared radius of the +smallest sphere orthogonal to four weighted points `p0, p1, p2, p3`, +and the squared radius of the +smallest sphere orthogonal to three weighted points `p0, p1, p2`, +and the squared radius of smallest sphere orthogonal to +two weighted points `p0, p1`, +and the squared radius of the smallest sphere orthogonal to a single +point `p0`. +*/ +typedef unspecified_type Compute_squared_radius_smallest_orthogonal_sphere_3; + +/// @} + +/// \name Creation /// @{ /*! -default constructor. -*/ -WeightedAlphaShapeTraits_3(); +default constructor. +*/ +WeightedAlphaShapeTraits_3(); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -*/ -Compute_squared_radius_smallest_orthogonal_sphere_3 compute_squared_radius_smallest_orthogonal_sphere_3_object(); +*/ +Compute_squared_radius_smallest_orthogonal_sphere_3 compute_squared_radius_smallest_orthogonal_sphere_3_object(); /// @} diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt b/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt index 7be6153c52db..97bf10a844da 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt @@ -20,19 +20,19 @@ \cgalPkgDescriptionEnd Alpha shapes definition is based on an underlying -triangulation that may be a Delaunay triangulation -in case of basic alpha shapes or a regular triangulation +triangulation that may be a Delaunay triangulation +in case of basic alpha shapes or a regular triangulation (cf. Section \ref Triangulation3secclassRegulartriangulation "3D Regular Triangulation") in case of weighted alpha shapes. Let us consider the basic case with a Delaunay triangulation. -We first define the alpha complex of the set of points \f$ S\f$. -The alpha complex is a subcomplex +We first define the alpha complex of the set of points \f$ S\f$. +The alpha complex is a subcomplex of the Delaunay triangulation. For a given value of \f$ \alpha\f$, the alpha complex includes all the simplices in the Delaunay triangulation which have an empty circumscribing sphere with squared radius equal or smaller than \f$ \alpha\f$. -Here "empty" means that the open sphere +Here "empty" means that the open sphere do not include any points of \f$ S\f$. The alpha shape is then simply the domain covered by the simplices of the alpha complex (see \cgalCite{em-tdas-94}). @@ -43,10 +43,10 @@ singular faces. For \f$ 0 \leq k \leq d-1\f$, a \f$ k\f$-simplex of the alpha complex is said to be singular if it is not a facet of a \f$ (k+1)\f$-simplex of the complex -The alpha shapes of a set of points +The alpha shapes of a set of points \f$ S\f$ form a discrete family, even though they are defined for all real numbers \f$ \alpha\f$. -The entire family of alpha shapes can be represented +The entire family of alpha shapes can be represented through the underlying triangulation of \f$ S\f$. In this representation, each \f$ k\f$-simplex of the underlying triangulation is associated with an interval that specifies for which values of \f$ \alpha\f$ the \f$ k\f$-simplex @@ -58,21 +58,21 @@ and having less than a given number of connected components. The definition is analog in the case of weighted alpha shapes. The input set is now a set of weighted points (which can be regarded -as spheres) and the underlying triangulation +as spheres) and the underlying triangulation is the regular triangulation of this set. Two spheres, or two weighted points, with centers \f$ C_1, C_2\f$ -and radii \f$ r_1, r_2 \f$ are said to be orthogonal iff +and radii \f$ r_1, r_2 \f$ are said to be orthogonal iff \f$ C_1C_2 ^2 = r_1^2 + r_2^2\f$ and suborthogonal iff \f$ C_1C_2 ^2 < r_1^2 + r_2^2\f$. For a given value of \f$ \alpha\f$ -the weighted alpha complex is formed with the simplices of the +the weighted alpha complex is formed with the simplices of the regular triangulation triangulation such that there is a sphere orthogonal to the weighted points associated with the vertices of the simplex and suborthogonal to all the other input weighted points. Once again the alpha shape is then defined as the domain covered by a the alpha complex. -CGAL provides two versions to compute alpha shapes. +CGAL provides two versions to compute alpha shapes. The first one gives access to an explicit classification of all the simplices for a fixed alpha value. The second one gives access to the entire family of alpha shapes of a set of points. This latter version comes with two modes. In the general mode, diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt index 749ba649534c..bd91f6c8705d 100644 --- a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/ex_alpha_shapes_with_fast_location_3.cpp b/Alpha_shapes_3/examples/Alpha_shapes_3/ex_alpha_shapes_with_fast_location_3.cpp index 73ea3aaba58c..8c8e101a4766 100644 --- a/Alpha_shapes_3/examples/Alpha_shapes_3/ex_alpha_shapes_with_fast_location_3.cpp +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/ex_alpha_shapes_with_fast_location_3.cpp @@ -38,15 +38,15 @@ int main() // compute alpha shape Alpha_shape_3 as(dt); std::cout << "Alpha shape computed in REGULARIZED mode by defaut." - << std::endl; + << std::endl; // find optimal alpha values Alpha_shape_3::NT alpha_solid = as.find_alpha_solid(); Alpha_iterator opt = as.find_optimal_alpha(1); std::cout << "Smallest alpha value to get a solid through data points is " - << alpha_solid << std::endl; + << alpha_solid << std::endl; std::cout << "Optimal alpha value to get one connected component is " - << *opt << std::endl; + << *opt << std::endl; as.set_alpha(*opt); assert(as.number_of_solid_components() == 1); return 0; diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/ex_weighted_alpha_shapes_3.cpp b/Alpha_shapes_3/examples/Alpha_shapes_3/ex_weighted_alpha_shapes_3.cpp index cfd9f4c75b8a..972b3ab43e47 100644 --- a/Alpha_shapes_3/examples/Alpha_shapes_3/ex_weighted_alpha_shapes_3.cpp +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/ex_weighted_alpha_shapes_3.cpp @@ -46,13 +46,13 @@ int main() std::list facets; std::list edges; as.get_alpha_shape_cells(std::back_inserter(cells), - Alpha_shape_3::INTERIOR); + Alpha_shape_3::INTERIOR); as.get_alpha_shape_facets(std::back_inserter(facets), - Alpha_shape_3::REGULAR); + Alpha_shape_3::REGULAR); as.get_alpha_shape_facets(std::back_inserter(facets), - Alpha_shape_3::SINGULAR); + Alpha_shape_3::SINGULAR); as.get_alpha_shape_edges(std::back_inserter(edges), - Alpha_shape_3::SINGULAR); + Alpha_shape_3::SINGULAR); std::cout << " The 0-shape has : " << std::endl; std::cout << cells.size() << " interior tetrahedra" << std::endl; std::cout << facets.size() << " boundary facets" << std::endl; diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h index c66b47be7d16..e05a19a83345 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h @@ -58,32 +58,32 @@ class Alpha_shape_3 : public Dt // in case of weighted points) empty of other points // (or suborthogonal to other sites in case of weighted points) // with squared radius equal or less than alpha - + // The alpha_shapes comes in two versions : GENERAL or REGULARIZED // where the REGULARIZED version is onbtaining by restricting the // alpha complex ti is pure 3D component. // The cells of the triangulation are classified as INTERIOR - // or EXTERIOR according to the value alpha_cell of their circumsphere + // or EXTERIOR according to the value alpha_cell of their circumsphere // squared radius compared to alpha. // In GENERAL mode each k-dimensional simplex of the triangulation - // for (k=0,1,2) + // for (k=0,1,2) // can be classified as EXTERIOR, SINGULAR, REGULAR // or INTERIOR with respect to the alpha shape. // In GENERAL mode a $k$ simplex is REGULAR if it is on the boundary // of the alpha_complex and belongs to a $k+1$ simplex in the complex // and it is SINGULAR simplex if it is a boundary simplex tht is not // included in a $k+1$ simplex of the complex. - + // In REGULARIZED mode each k-dimensional simplex of the triangulation - // for (k=0,1,2) + // for (k=0,1,2) // can be classified as EXTERIOR, REGULAR // or INTERIOR with respect to the alpha shape. // A $k$ simplex is REGULAR if it is on the boundary of alpha complex // and belong to a tetrahedral cell of the complex. - // Roughly, the Alpha_shapes data structure computes and stores, + // Roughly, the Alpha_shapes data structure computes and stores, // for each simplex // the at most three critical value (alpha_min, alpha_mid and alpha_max) // which compared to the actual alpha value @@ -116,7 +116,7 @@ class Alpha_shape_3 : public Dt CGAL_static_assertion( (boost::is_same::value) ); typedef typename Dt::Point Point; - + typedef typename Dt::Cell_handle Cell_handle; typedef typename Dt::Vertex_handle Vertex_handle; typedef typename Dt::Facet Facet; @@ -173,9 +173,9 @@ class Alpha_shape_3 : public Dt typedef CGAL::Alpha_status< NT > Alpha_status; typedef Compact_container Alpha_status_container; - typedef typename Alpha_status_container::const_iterator + typedef typename Alpha_status_container::const_iterator Alpha_status_const_iterator; - typedef typename Alpha_status_container::iterator + typedef typename Alpha_status_container::iterator Alpha_status_iterator; typedef std::vector< NT > Alpha_spectrum; @@ -187,11 +187,11 @@ class Alpha_shape_3 : public Dt typedef std::pair Vertex_handle_pair; typedef std::map Edge_alpha_map; - typedef typename std::list< Vertex_handle >::iterator + typedef typename std::list< Vertex_handle >::iterator Alpha_shape_vertices_iterator; typedef typename std::list< Facet >::iterator Alpha_shape_facets_iterator; - + //test if a cell is exterior to the alphashape class Exterior_cell_test{ const Alpha_shape_3 * _as; @@ -238,45 +238,45 @@ class Alpha_shape_3 : public Dt //------------------------- CONSTRUCTORS ------------------------------ public: - // Introduces an empty alpha-shape `A' for a - // alpha-value `alpha'. - Alpha_shape_3(NT alpha = 0, - Mode m = REGULARIZED) - : _alpha(alpha), _mode(m), + // Introduces an empty alpha-shape `A' for a + // alpha-value `alpha'. + Alpha_shape_3(NT alpha = 0, + Mode m = REGULARIZED) + : _alpha(alpha), _mode(m), use_vertex_cache(false), use_facet_cache(false) {} Alpha_shape_3(Dt& dt, NT alpha = 0, Mode m = REGULARIZED) - :_alpha(alpha), _mode(m), + :_alpha(alpha), _mode(m), use_vertex_cache(false), use_facet_cache(false) { Dt::swap(dt); if (dimension() == 3) initialize_alpha(); } - + // Introduces an alpha-shape `A' for the alpha-value // `alpha' that is initialized with the points in the range // from first to last - template < class InputIterator > - Alpha_shape_3(const InputIterator& first, - const InputIterator& last, - const NT& alpha = 0, - Mode m = REGULARIZED) - : _alpha(alpha), _mode(m), + template < class InputIterator > + Alpha_shape_3(const InputIterator& first, + const InputIterator& last, + const NT& alpha = 0, + Mode m = REGULARIZED) + : _alpha(alpha), _mode(m), use_vertex_cache(false), use_facet_cache(false) { Dt::insert(first, last); - if (dimension() == 3) initialize_alpha(); + if (dimension() == 3) initialize_alpha(); } - + public: //----------------------- OPERATIONS --------------------------------- - template < class InputIterator > - std::ptrdiff_t make_alpha_shape(const InputIterator& first, + template < class InputIterator > + std::ptrdiff_t make_alpha_shape(const InputIterator& first, const InputIterator& last) { clear(); @@ -287,7 +287,7 @@ class Alpha_shape_3 : public Dt return n; } - // Introduces an alpha-shape `A' + // Introduces an alpha-shape `A' // that is initialized with the points in the range // from first to last @@ -324,30 +324,30 @@ private : // the version to be used with Tag_true is templated to avoid // instanciation through explicit instantiation of the whole class - void set_alpha_min_of_vertices(Tag_false) - { - for( Finite_vertices_iterator vit = finite_vertices_begin(); - vit != finite_vertices_end(); ++vit){ + void set_alpha_min_of_vertices(Tag_false) + { + for( Finite_vertices_iterator vit = finite_vertices_begin(); + vit != finite_vertices_end(); ++vit){ Alpha_status* as = vit->get_alpha_status(); - as->set_is_Gabriel(true); + as->set_is_Gabriel(true); as->set_alpha_min(NT(0)); } - // insert a single vertex into the map because they all have the + // insert a single vertex into the map because they all have the // same alpha_min value alpha_min_vertex_map.insert(typename Alpha_vertex_map::value_type - ( NT(0), finite_vertices_begin())); + ( NT(0), finite_vertices_begin())); } template - void set_alpha_min_of_vertices(Tag) + void set_alpha_min_of_vertices(Tag) { - for( Finite_vertices_iterator vit = finite_vertices_begin(); - vit != finite_vertices_end(); ++vit) { + for( Finite_vertices_iterator vit = finite_vertices_begin(); + vit != finite_vertices_end(); ++vit) { if (is_Gabriel(vit)) { - Alpha_status* as = vit->get_alpha_status(); - as->set_is_Gabriel(true); - as->set_alpha_min(squared_radius(vit)); - alpha_min_vertex_map.insert(typename Alpha_vertex_map::value_type - (as->alpha_min(),vit)); + Alpha_status* as = vit->get_alpha_status(); + as->set_is_Gabriel(true); + as->set_alpha_min(squared_radius(vit)); + alpha_min_vertex_map.insert(typename Alpha_vertex_map::value_type + (as->alpha_min(),vit)); } } return; @@ -369,7 +369,7 @@ private : alpha_min_facet_map.clear(); alpha_min_edge_map.clear(); alpha_min_vertex_map.clear(); - + alpha_spectrum.clear(); alpha_shape_vertices_list.clear(); @@ -399,17 +399,17 @@ private : { return _alpha; } - + const NT& get_nth_alpha(int n) const // Returns the n-th alpha-value. // n < size() { - CGAL_triangulation_assertion( n > 0 && - n <= static_cast(alpha_spectrum.size()) ); + CGAL_triangulation_assertion( n > 0 && + n <= static_cast(alpha_spectrum.size()) ); return alpha_spectrum[n-1]; } - + size_type number_of_alphas() const // Returns the number of different alpha-values { @@ -419,8 +419,8 @@ private : const Edge_alpha_map* get_edge_alpha_map() const { return &edge_alpha_map; - } - + } + //--------------------------------------------------------------------- private: @@ -451,9 +451,9 @@ private : Mode previous_mode = _mode; _mode = mode; if (previous_mode != _mode) { - initialize_alpha(true); - use_vertex_cache = false; - use_facet_cache = false; + initialize_alpha(true); + use_vertex_cache = false; + use_facet_cache = false; } return previous_mode; } @@ -468,7 +468,7 @@ private : private: void update_alpha_shape_vertex_list() const; - void update_alpha_shape_facet_list() const; + void update_alpha_shape_facet_list() const; //--------------------------------------------------------------------- public: @@ -499,7 +499,7 @@ private : Alpha_shape_facets_iterator alpha_shape_facets_begin() const { - if(! use_facet_cache) update_alpha_shape_facet_list(); + if(! use_facet_cache) update_alpha_shape_facet_list(); return alpha_shape_facets_list.begin(); } @@ -520,24 +520,24 @@ private : return alpha_shape_facets_end(); } - Alpha_shape_cells_iterator alpha_shape_cells_begin() const + Alpha_shape_cells_iterator alpha_shape_cells_begin() const { return CGAL::filter_iterator(finite_cells_end(), - Exterior_cell_test(this), - finite_cells_begin()); + Exterior_cell_test(this), + finite_cells_begin()); } - + Alpha_shape_cells_iterator alpha_shape_cells_end() const { return CGAL::filter_iterator(finite_cells_end(), - Exterior_cell_test(this)); + Exterior_cell_test(this)); } -public: - +public: + // Traversal of the alpha-Values - // + // // The alpha shape class defines an iterator that allows to // visit the sorted sequence of alpha-values. This iterator is // non-mutable and bidirectional. Its value type is NT. @@ -551,8 +551,8 @@ private : // element is not found. { return std::find(alpha_spectrum.begin(), - alpha_spectrum.end(), - alpha); + alpha_spectrum.end(), + alpha); } Alpha_iterator alpha_lower_bound(const NT& alpha) const @@ -560,8 +560,8 @@ private : // alpha-value not less than `alpha'. { return std::lower_bound(alpha_spectrum.begin(), - alpha_spectrum.end(), - alpha); + alpha_spectrum.end(), + alpha); } Alpha_iterator alpha_upper_bound(const NT& alpha) const @@ -569,21 +569,21 @@ private : // alpha-value greater than `alpha'. { return std::upper_bound(alpha_spectrum.begin(), - alpha_spectrum.end(), - alpha); + alpha_spectrum.end(), + alpha); } //--------------------- PREDICATES ----------------------------------- public: - void compute_edge_status( const Cell_handle& c, - int i, - int j, - Alpha_status& as) const; + void compute_edge_status( const Cell_handle& c, + int i, + int j, + Alpha_status& as) const; Classification_type classify(const Alpha_status& as, const NT& alpha) const; Classification_type classify(const Alpha_status* as, const NT& alpha) const; - Classification_type classify(const Alpha_status_const_iterator as, - const NT& alpha) const; + Classification_type classify(const Alpha_status_const_iterator as, + const NT& alpha) const; public: @@ -592,26 +592,26 @@ private : return classify(p, get_alpha()); } - - Classification_type classify(const Point& p, - const NT& alpha) const + + Classification_type classify(const Point& p, + const NT& alpha) const // Classifies a point `p' with respect to `A'. { Locate_type type; int i, j; Cell_handle pCell = locate(p, type, i, j); switch (type) - { - case VERTEX : return classify(pCell->vertex(i), alpha); - case EDGE : return classify(pCell, i, j, alpha); - case FACET : return classify(pCell, i, alpha); - case CELL : return classify(pCell, alpha); - case OUTSIDE_CONVEX_HULL : return EXTERIOR; - case OUTSIDE_AFFINE_HULL : return EXTERIOR; - default : return EXTERIOR; - }; - } - + { + case VERTEX : return classify(pCell->vertex(i), alpha); + case EDGE : return classify(pCell, i, j, alpha); + case FACET : return classify(pCell, i, alpha); + case CELL : return classify(pCell, alpha); + case OUTSIDE_CONVEX_HULL : return EXTERIOR; + case OUTSIDE_AFFINE_HULL : return EXTERIOR; + default : return EXTERIOR; + }; + } + //--------------------------------------------------------------------- Classification_type classify(const Cell_handle& s) const @@ -620,9 +620,9 @@ private : { return classify(s, get_alpha()); } - - Classification_type classify(const Cell_handle& s, - const NT& alpha) const + + Classification_type classify(const Cell_handle& s, + const NT& alpha) const // Classifies the cell `f' of the underlying Delaunay // tetrahedralization with respect to `A'. // s->radius == alpha => f interior @@ -632,57 +632,57 @@ private : } //--------------------------------------------------------------------- - + Classification_type classify(const Facet& f) const - { + { return classify(f.first, f.second, get_alpha()); } - - Classification_type classify(const Cell_handle& s, int i) const - { + + Classification_type classify(const Cell_handle& s, int i) const + { return classify(s, i, get_alpha()); } - Classification_type classify(const Facet& f, const NT& alpha) const - { + Classification_type classify(const Facet& f, const NT& alpha) const + { return classify(f.first, f.second, alpha); } - Classification_type classify(const Cell_handle& s, - int i, - const NT& alpha) const; + Classification_type classify(const Cell_handle& s, + int i, + const NT& alpha) const; // Classifies the face `f' of the underlying Delaunay // tetrahedralization with respect to `A'. //--------------------------------------------------------------------- Classification_type classify(const Edge& e) const - { + { return classify(e.first, e.second, e.third, get_alpha()); } - - Classification_type classify(const Cell_handle& s, - int i, - int j) const - { + + Classification_type classify(const Cell_handle& s, + int i, + int j) const + { return classify(s, i, j, get_alpha()); } Classification_type classify(const Edge& e, - const NT& alpha ) const - { + const NT& alpha ) const + { return classify(e.first, e.second, e.third, alpha); } - Classification_type classify(const Cell_handle& s, - int i, - int j, - const NT& alpha) const; + Classification_type classify(const Cell_handle& s, + int i, + int j, + const NT& alpha) const; // Classifies the edge `e' of the underlying Delaunay // tetrahedralization with respect to `A'. - + //--------------------------------------------------------------------- @@ -692,7 +692,7 @@ private : } Classification_type classify(const Vertex_handle& v, - const NT& alpha) const; + const NT& alpha) const; // Classifies the vertex `v' of the underlying Delaunay // tetrahedralization with respect to `A'. @@ -718,16 +718,16 @@ private : size_type number_of_solid_components(const NT& alpha) const; - // Determine the number of connected solid components + // Determine the number of connected solid components // takes time O(#alpha_shape) amortized if STL_HASH_TABLES // O(#alpha_shape log n) otherwise private: void traverse(Cell_handle pCell, - Marked_cell_set& marked_cell_set, - const NT alpha) const; - + Marked_cell_set& marked_cell_set, + const NT alpha) const; + //---------------------------------------------------------------------- public: @@ -737,12 +737,12 @@ private : // (1) all data points are on the boundary of some 3d component // or in its interior // (2) the nb of solid components is equal or less than nb_component - + NT find_alpha_solid() const; - // compute the minumum alpha such that all data points + // compute the minumum alpha such that all data points // are either on the boundary or in the interior // not necessarily connected - // starting point for searching + // starting point for searching // takes O(#alpha_shape) time //------------------- GEOMETRIC PRIMITIVES ---------------------------- @@ -774,7 +774,7 @@ private : } NT squared_radius(const Vertex_handle& v) const { - return Compute_squared_radius_3()(*this)(v->point()); + return Compute_squared_radius_3()(*this)(v->point()); } //--------------------------------------------------------------------- @@ -785,7 +785,7 @@ private : void operator=(const Alpha_shape_3&); //--------------------------------------------------------------------- -public: +public: #ifdef CGAL_USE_GEOMVIEW void show_triangulation_edges(Geomview_stream &gv) const; void show_alpha_shape_faces(Geomview_stream &gv) const; @@ -793,19 +793,19 @@ private : // to Debug - void print_maps() const; + void print_maps() const; void print_alphas() const; void print_alpha_status( const Alpha_status& as) const; - + // To extract the alpha_shape faces for a given alpha value template - OutputIterator get_alpha_shape_cells(OutputIterator it, - Classification_type type, - const NT& alpha) const + OutputIterator get_alpha_shape_cells(OutputIterator it, + Classification_type type, + const NT& alpha) const { Finite_cells_iterator cit = finite_cells_begin(); for( ; cit != finite_cells_end() ; ++cit){ @@ -815,9 +815,9 @@ private : } template - OutputIterator get_alpha_shape_facets(OutputIterator it, - Classification_type type, - const NT& alpha) const + OutputIterator get_alpha_shape_facets(OutputIterator it, + Classification_type type, + const NT& alpha) const { Finite_facets_iterator fit = finite_facets_begin(); for( ; fit != finite_facets_end() ; ++fit){ @@ -827,9 +827,9 @@ private : } template - OutputIterator get_alpha_shape_edges(OutputIterator it, - Classification_type type, - const NT& alpha) const + OutputIterator get_alpha_shape_edges(OutputIterator it, + Classification_type type, + const NT& alpha) const { Finite_edges_iterator eit = finite_edges_begin(); for( ; eit != finite_edges_end() ; ++eit){ @@ -839,9 +839,9 @@ private : } template - OutputIterator get_alpha_shape_vertices(OutputIterator it, - Classification_type type, - const NT& alpha) const + OutputIterator get_alpha_shape_vertices(OutputIterator it, + Classification_type type, + const NT& alpha) const { Finite_vertices_iterator vit = finite_vertices_begin(); for( ; vit != finite_vertices_end() ; ++vit){ @@ -863,38 +863,38 @@ private : } template - OutputIterator get_alpha_shape_cells(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_cells(OutputIterator it, + Classification_type type) const { return get_alpha_shape_cells(it, type, get_alpha());} template - OutputIterator get_alpha_shape_facets(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_facets(OutputIterator it, + Classification_type type) const { return get_alpha_shape_facets(it, type, get_alpha());} template - OutputIterator get_alpha_shape_edges(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_edges(OutputIterator it, + Classification_type type) const { return get_alpha_shape_edges(it, type, get_alpha());} template - OutputIterator get_alpha_shape_vertices(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_vertices(OutputIterator it, + Classification_type type) const { return get_alpha_shape_vertices(it, type, get_alpha());} - template + template OutputIterator filtration_with_alpha_values(OutputIterator it) const - // scan the alpha_cell_map, alpha_min_facet_map, alpha_min_edge_map - // and alpha_min_vertex in GENERAL mode - // only alpha_cell_map in REGULARIZED mode - // and output all the faces in order of alpha value of their appearing - // in the alpha complexe - { + // scan the alpha_cell_map, alpha_min_facet_map, alpha_min_edge_map + // and alpha_min_vertex in GENERAL mode + // only alpha_cell_map in REGULARIZED mode + // and output all the faces in order of alpha value of their appearing + // in the alpha complexe + { typename Alpha_cell_map::const_iterator cit ; typename Alpha_facet_map::const_iterator fit ; typename Alpha_edge_map::const_iterator eit ; typename Alpha_vertex_map::const_iterator vit; - + if (get_mode() == GENERAL) { cit = alpha_cell_map.begin(); fit = alpha_min_facet_map.begin(); @@ -908,232 +908,232 @@ private : vit = alpha_min_vertex_map.end(); } - // sets to avoid multiple output of the same face - // as a regular subfaces of different faces - std::set facet_set; - std::set edge_set; - std::set vertex_set; - NT alpha_current = 0; - - while (cit != alpha_cell_map.end()) { - - if ( vit != alpha_min_vertex_map.end() - && (eit == alpha_min_edge_map.end() || (vit->first <= eit->first)) - && (fit == alpha_min_facet_map.end()|| (vit->first <= fit->first)) - && (cit == alpha_cell_map.end() || (vit->first <= cit->first))) - { - //advance on vit - filtration_set_management(vit, alpha_current, - facet_set, edge_set, vertex_set); - filtration_output(vit->first, vit->second, it); - vit++; - } - - if ( eit != alpha_min_edge_map.end() - && ( fit == alpha_min_facet_map.end() || (eit->first <= fit->first) ) - && ( cit == alpha_cell_map.end() || (eit->first <= cit->first) ) - && ( vit == alpha_min_vertex_map.end()|| (vit->first > eit->first) ) - ) { //advance on eit - filtration_set_management(eit, alpha_current, - facet_set, edge_set, vertex_set); - filtration_output(eit->first, eit->second, it, vertex_set); - eit++; - } - - if ( fit != alpha_min_facet_map.end() - && (cit == alpha_cell_map.end() || (fit->first <= cit->first)) - && (eit == alpha_min_edge_map.end() || (eit->first > fit->first)) - && (vit == alpha_min_vertex_map.end()|| (vit->first > fit->first)) - ) { //advance on fit - filtration_set_management(fit, alpha_current, - facet_set, edge_set, vertex_set); - filtration_output(fit->first, fit->second, it, - edge_set, vertex_set); - fit++; - } - - if ( cit != alpha_cell_map.end() - && (fit == alpha_min_facet_map.end() || (fit->first > cit->first) ) - && (eit == alpha_min_edge_map.end() || (eit->first > cit->first) ) - && (vit == alpha_min_vertex_map.end()|| (vit->first > cit->first) ) - ) { //advance on cit - filtration_set_management(cit, alpha_current, - facet_set, edge_set, vertex_set); - filtration_output(cit->first, cit->second, it, - facet_set, edge_set, vertex_set); - cit++; - } - } - return it; - } - - template + // sets to avoid multiple output of the same face + // as a regular subfaces of different faces + std::set facet_set; + std::set edge_set; + std::set vertex_set; + NT alpha_current = 0; + + while (cit != alpha_cell_map.end()) { + + if ( vit != alpha_min_vertex_map.end() + && (eit == alpha_min_edge_map.end() || (vit->first <= eit->first)) + && (fit == alpha_min_facet_map.end()|| (vit->first <= fit->first)) + && (cit == alpha_cell_map.end() || (vit->first <= cit->first))) + { + //advance on vit + filtration_set_management(vit, alpha_current, + facet_set, edge_set, vertex_set); + filtration_output(vit->first, vit->second, it); + vit++; + } + + if ( eit != alpha_min_edge_map.end() + && ( fit == alpha_min_facet_map.end() || (eit->first <= fit->first) ) + && ( cit == alpha_cell_map.end() || (eit->first <= cit->first) ) + && ( vit == alpha_min_vertex_map.end()|| (vit->first > eit->first) ) + ) { //advance on eit + filtration_set_management(eit, alpha_current, + facet_set, edge_set, vertex_set); + filtration_output(eit->first, eit->second, it, vertex_set); + eit++; + } + + if ( fit != alpha_min_facet_map.end() + && (cit == alpha_cell_map.end() || (fit->first <= cit->first)) + && (eit == alpha_min_edge_map.end() || (eit->first > fit->first)) + && (vit == alpha_min_vertex_map.end()|| (vit->first > fit->first)) + ) { //advance on fit + filtration_set_management(fit, alpha_current, + facet_set, edge_set, vertex_set); + filtration_output(fit->first, fit->second, it, + edge_set, vertex_set); + fit++; + } + + if ( cit != alpha_cell_map.end() + && (fit == alpha_min_facet_map.end() || (fit->first > cit->first) ) + && (eit == alpha_min_edge_map.end() || (eit->first > cit->first) ) + && (vit == alpha_min_vertex_map.end()|| (vit->first > cit->first) ) + ) { //advance on cit + filtration_set_management(cit, alpha_current, + facet_set, edge_set, vertex_set); + filtration_output(cit->first, cit->second, it, + facet_set, edge_set, vertex_set); + cit++; + } + } + return it; + } + + template OutputIterator filtration(OutputIterator it) const { Dispatch_or_drop_output_iterator, std::tuple > out(it); return std::template get<0>( filtration_with_alpha_values(out) ); } - private: - - template - void - filtration_set_management ( Alpha_face_iterator afit, - NT& alpha_current, - std::set& facet_set, - std::set& edge_set, - std::set& vertex_set) const - { - if (afit->first != alpha_current) { //new alpha_value - alpha_current = afit->first; - facet_set.clear(); - edge_set.clear(); - vertex_set.clear(); - } - return; - } - - template - OutputIterator + private: + + template + void + filtration_set_management ( Alpha_face_iterator afit, + NT& alpha_current, + std::set& facet_set, + std::set& edge_set, + std::set& vertex_set) const + { + if (afit->first != alpha_current) { //new alpha_value + alpha_current = afit->first; + facet_set.clear(); + edge_set.clear(); + vertex_set.clear(); + } + return; + } + + template + OutputIterator filtration_output( const NT & alpha, - Vertex_handle vh, - OutputIterator it, - Tag_true) const - { - *it++ = make_object(vh); + Vertex_handle vh, + OutputIterator it, + Tag_true) const + { + *it++ = make_object(vh); *it++ = alpha; - //std::cerr << "filtration " << alpha << " \t VERTEX " << std::endl; - return it; - } + //std::cerr << "filtration " << alpha << " \t VERTEX " << std::endl; + return it; + } - template - OutputIterator + template + OutputIterator filtration_output( const NT& alpha, - Vertex_handle vh, - OutputIterator it, - Tag_false) const - { - // when Delaunay, the alpha_min_vertex_map contains a single vertex - // because all vertices are Gabriel with the same alpha_min=0 + Vertex_handle vh, + OutputIterator it, + Tag_false) const + { + // when Delaunay, the alpha_min_vertex_map contains a single vertex + // because all vertices are Gabriel with the same alpha_min=0 // this affects only the GENERAL mode if (get_mode() == GENERAL){ - Finite_vertices_iterator vit=finite_vertices_begin(); - for( ; vit != finite_vertices_end(); vit++) { - *it++ = make_object( Vertex_handle(vit)); + Finite_vertices_iterator vit=finite_vertices_begin(); + for( ; vit != finite_vertices_end(); vit++) { + *it++ = make_object( Vertex_handle(vit)); *it++ = alpha; - } + } } else { *it++ = make_object(vh); *it++ = alpha; } - //std::cerr << "filtration " << alpha << " \t VERTEX " << std::endl; - return it; - } - - template - OutputIterator - filtration_output( const NT& alpha, - Vertex_handle vh, - OutputIterator it) const - { - return filtration_output(alpha, vh, it, Weighted_tag()); - } - - - template - OutputIterator - filtration_output( const NT& alpha, - Edge e, - OutputIterator it, - std::set& vertex_set) const - { - Vertex_handle vh[] = {e.first->vertex(e.second), - e.first->vertex(e.third)}; - for(int i=0; i<2; i++) { - Alpha_status* as = vh[i]->get_alpha_status(); - if ( (get_mode()== REGULARIZED || !as->is_Gabriel()) - && as->alpha_mid() == alpha - && vertex_set.find(vh[i]) == vertex_set.end() ) { - filtration_output( alpha, vh[i], it); - vertex_set.insert(vh[i]); - } - } - *it++ = make_object(e); - *it++ = alpha; - //std::cerr << "filtration " << alpha << " \t EDGE " << std::endl; - return it; - } - - template - OutputIterator - filtration_output( const NT& alpha, - Facet f, - OutputIterator it, - std::set& edge_set, - std::set& vertex_set ) const - { - Cell_handle c = f.first; - int facet_index = f.second; - - for(int k=0; k<3; k++) { - int i = vertex_triple_index(facet_index, k ); - int j = vertex_triple_index(facet_index, this->ccw(k)); - Alpha_status as; - Vertex_handle_pair - vhp = make_vertex_handle_pair(c->vertex(i),c->vertex(j)); - - if (get_mode() == GENERAL) { - as = *(edge_alpha_map.find(vhp)->second); - } - else{ //no edge map in REGULARIZED mode - classify on the fly - compute_edge_status( c, i, j, as); - } - + //std::cerr << "filtration " << alpha << " \t VERTEX " << std::endl; + return it; + } + + template + OutputIterator + filtration_output( const NT& alpha, + Vertex_handle vh, + OutputIterator it) const + { + return filtration_output(alpha, vh, it, Weighted_tag()); + } + + + template + OutputIterator + filtration_output( const NT& alpha, + Edge e, + OutputIterator it, + std::set& vertex_set) const + { + Vertex_handle vh[] = {e.first->vertex(e.second), + e.first->vertex(e.third)}; + for(int i=0; i<2; i++) { + Alpha_status* as = vh[i]->get_alpha_status(); + if ( (get_mode()== REGULARIZED || !as->is_Gabriel()) + && as->alpha_mid() == alpha + && vertex_set.find(vh[i]) == vertex_set.end() ) { + filtration_output( alpha, vh[i], it); + vertex_set.insert(vh[i]); + } + } + *it++ = make_object(e); + *it++ = alpha; + //std::cerr << "filtration " << alpha << " \t EDGE " << std::endl; + return it; + } + + template + OutputIterator + filtration_output( const NT& alpha, + Facet f, + OutputIterator it, + std::set& edge_set, + std::set& vertex_set ) const + { + Cell_handle c = f.first; + int facet_index = f.second; + + for(int k=0; k<3; k++) { + int i = vertex_triple_index(facet_index, k ); + int j = vertex_triple_index(facet_index, this->ccw(k)); + Alpha_status as; + Vertex_handle_pair + vhp = make_vertex_handle_pair(c->vertex(i),c->vertex(j)); + + if (get_mode() == GENERAL) { + as = *(edge_alpha_map.find(vhp)->second); + } + else{ //no edge map in REGULARIZED mode - classify on the fly + compute_edge_status( c, i, j, as); + } + if ( (get_mode()== REGULARIZED || !as.is_Gabriel()) - && as.alpha_mid() == alpha - && edge_set.find(vhp)== edge_set.end() ) { - filtration_output( alpha, make_triple(c,i,j), it, vertex_set); - edge_set.insert(vhp); - } - } - - *it++ = make_object(f); - *it++ = alpha; - //std::cerr << "filtration " << alpha << " \t FACET " << std::endl; - return it; - } - - template - OutputIterator - filtration_output( const NT& alpha, - Cell_handle c, - OutputIterator it, - std::set& facet_set, - std::set& edge_set, - std::set& vertex_set) const - { - for(int i=0; i<4; i++) { - Alpha_status_iterator as = c->get_facet_status(i); - Facet f = std::make_pair(c,i); + && as.alpha_mid() == alpha + && edge_set.find(vhp)== edge_set.end() ) { + filtration_output( alpha, make_triple(c,i,j), it, vertex_set); + edge_set.insert(vhp); + } + } + + *it++ = make_object(f); + *it++ = alpha; + //std::cerr << "filtration " << alpha << " \t FACET " << std::endl; + return it; + } + + template + OutputIterator + filtration_output( const NT& alpha, + Cell_handle c, + OutputIterator it, + std::set& facet_set, + std::set& edge_set, + std::set& vertex_set) const + { + for(int i=0; i<4; i++) { + Alpha_status_iterator as = c->get_facet_status(i); + Facet f = std::make_pair(c,i); if ((get_mode()== REGULARIZED || !as->is_Gabriel()) - && as->alpha_mid() == alpha - && facet_set.find(f) == facet_set.end() - && facet_set.find(std::make_pair(c->neighbor(i), - this->mirror_index(c, i))) - == facet_set.end()) { - filtration_output( alpha, f, it, edge_set, vertex_set); - facet_set.insert(f); - } - } + && as->alpha_mid() == alpha + && facet_set.find(f) == facet_set.end() + && facet_set.find(std::make_pair(c->neighbor(i), + this->mirror_index(c, i))) + == facet_set.end()) { + filtration_output( alpha, f, it, edge_set, vertex_set); + facet_set.insert(f); + } + } *it++ = make_object(c); *it++ = alpha; - //std::cerr << "filtration " << alpha << " \t CELL " << std::endl; - return it; - } - - + //std::cerr << "filtration " << alpha << " \t CELL " << std::endl; + return it; + } + + }; @@ -1144,11 +1144,11 @@ private : //--------------------- INITIALIZATION OF PRIVATE MEMBERS ------------- - + template -void +void Alpha_shape_3::initialize_alpha_cell_map() -{ +{ Finite_cells_iterator cell_it, done = finite_cells_end(); NT alpha ; @@ -1166,49 +1166,49 @@ Alpha_shape_3::initialize_alpha_cell_map() //--------------------------------------------------------------------- template -void +void Alpha_shape_3::initialize_alpha_facet_maps(bool reinitialize) { - Finite_facets_iterator fit; + Finite_facets_iterator fit; Cell_handle pCell, pNeighbor ; int i, iNeigh; Alpha_status_iterator as; if (!reinitialize) { NT alpha_max, alpha_mid; - for( fit = finite_facets_begin(); - fit != finite_facets_end(); ++fit) { + for( fit = finite_facets_begin(); + fit != finite_facets_end(); ++fit) { as = alpha_status_container.insert(Alpha_status()); - + pCell = fit->first; i = fit->second; pNeighbor = pCell->neighbor(i); iNeigh = pNeighbor->index(pCell); - + // not on the convex hull - if(!is_infinite(pCell) && !is_infinite(pNeighbor)) { - NT alpha_Cell = pCell->get_alpha(); - NT alpha_Neighbor = pNeighbor->get_alpha(); - if ( alpha_Cell < alpha_Neighbor) { - alpha_mid = alpha_Cell; - alpha_max = alpha_Neighbor; - } - else { - alpha_mid = alpha_Neighbor; - alpha_max = alpha_Cell; - } - as->set_is_on_chull(false); - as->set_alpha_mid(alpha_mid); - as->set_alpha_max(alpha_max); - // alpha_mid_facet_map.insert(typename - // Alpha_facet_map::value_type(alpha_mid, *fit)); + if(!is_infinite(pCell) && !is_infinite(pNeighbor)) { + NT alpha_Cell = pCell->get_alpha(); + NT alpha_Neighbor = pNeighbor->get_alpha(); + if ( alpha_Cell < alpha_Neighbor) { + alpha_mid = alpha_Cell; + alpha_max = alpha_Neighbor; + } + else { + alpha_mid = alpha_Neighbor; + alpha_max = alpha_Cell; + } + as->set_is_on_chull(false); + as->set_alpha_mid(alpha_mid); + as->set_alpha_max(alpha_max); + // alpha_mid_facet_map.insert(typename + // Alpha_facet_map::value_type(alpha_mid, *fit)); } else { // on the convex hull - alpha_mid = !is_infinite(pCell) ? pCell->get_alpha() - : pNeighbor->get_alpha(); - as->set_alpha_mid(alpha_mid); - as->set_is_on_chull(true); + alpha_mid = !is_infinite(pCell) ? pCell->get_alpha() + : pNeighbor->get_alpha(); + as->set_alpha_mid(alpha_mid); + as->set_is_on_chull(true); } //cross links @@ -1217,19 +1217,19 @@ Alpha_shape_3::initialize_alpha_facet_maps(bool reinitialize) } } - // initialize alpha_min if mode GENERAL + // initialize alpha_min if mode GENERAL if(get_mode() == GENERAL && alpha_min_facet_map.empty()) { //already done if !alpha_min_facet_map.empty() NT alpha_min; - for( fit = finite_facets_begin(); - fit != finite_facets_end(); ++fit) { + for( fit = finite_facets_begin(); + fit != finite_facets_end(); ++fit) { as = fit->first->get_facet_status(fit->second); if (is_Gabriel(*fit)) { - as->set_is_Gabriel(true); - alpha_min = squared_radius(*fit); - as->set_alpha_min(alpha_min); - alpha_min_facet_map.insert(typename - Alpha_facet_map::value_type(alpha_min, *fit)); + as->set_is_Gabriel(true); + alpha_min = squared_radius(*fit); + as->set_alpha_min(alpha_min); + alpha_min_facet_map.insert(typename + Alpha_facet_map::value_type(alpha_min, *fit)); } else{ as->set_is_Gabriel(false); @@ -1241,10 +1241,10 @@ Alpha_shape_3::initialize_alpha_facet_maps(bool reinitialize) } template -void +void Alpha_shape_3::initialize_alpha_edge_maps(bool ) { - // alpha_status for edges, edge_alpha_map + // alpha_status for edges, edge_alpha_map // and alpha_mid_edge and alpha_min_edge // are initialized only in GENERAL mode if(get_mode() == REGULARIZED) {return;} //no_edge_map in REGULARIZED mode @@ -1253,33 +1253,33 @@ Alpha_shape_3::initialize_alpha_edge_maps(bool ) Finite_edges_iterator eit; Alpha_status_iterator as; - for (eit = finite_edges_begin(); + for (eit = finite_edges_begin(); eit != finite_edges_end(); ++eit) { as = alpha_status_container.insert(Alpha_status()); compute_edge_status(eit->first, eit->second, eit->third, *as); if ( as->is_Gabriel()) { alpha_min_edge_map.insert(typename - Alpha_edge_map::value_type(as->alpha_min(), - *eit)); + Alpha_edge_map::value_type(as->alpha_min(), + *eit)); } //cross links - Vertex_handle_pair + Vertex_handle_pair vhp = make_vertex_handle_pair( eit->first->vertex(eit->second), - eit->first->vertex(eit->third)); + eit->first->vertex(eit->third)); edge_alpha_map.insert(std::make_pair(vhp, as)); } return; } template -void +void Alpha_shape_3::initialize_alpha_vertex_maps(bool reinitialize) { - //for a vertex + //for a vertex // alpha_max = max of alpha values of incident cells // alpha_mid = min of alpha values of incident cells in REGULAR mode // = min of alpha values of incidents faces in GENERAL mode - // alpha_min = -squared_radius of weighted point, + // alpha_min = -squared_radius of weighted point, // if the vertex is Gabriel set only in GENERAL mode NT alpha, alpha_mid; @@ -1287,18 +1287,18 @@ Alpha_shape_3::initialize_alpha_vertex_maps(bool reinitialize) if (reinitialize == false) _alpha_solid = alpha_cell_map.begin()->first; - for( vit = finite_vertices_begin(); - vit != finite_vertices_end(); ++vit) { + for( vit = finite_vertices_begin(); + vit != finite_vertices_end(); ++vit) { Alpha_status* as = vit->get_alpha_status(); if (reinitialize == false) { - // set is_on_chull, compute alpha_max + // set is_on_chull, compute alpha_max // and alpha_mid (version REGULAR) // compute _alpha_solid (max of alpha_mid of vertices in REGULAR mode) as->set_is_on_chull(false); std::list incidents; incident_cells(static_cast(vit), - back_inserter(incidents)); + back_inserter(incidents)); typename std::list::iterator chit=incidents.begin(); if (is_infinite(*chit)) as->set_is_on_chull(true); while (is_infinite(*chit)) ++chit; //skip infinte cells @@ -1307,29 +1307,29 @@ Alpha_shape_3::initialize_alpha_vertex_maps(bool reinitialize) as->set_alpha_max(alpha); ++chit; for( ; chit != incidents.end(); ++chit) { - if (is_infinite(*chit)) as->set_is_on_chull(true); - else { - alpha = (*chit)->get_alpha(); - if (alpha < as->alpha_mid()) as->set_alpha_mid(alpha); - if (alpha > as->alpha_max()) as->set_alpha_max(alpha); - } + if (is_infinite(*chit)) as->set_is_on_chull(true); + else { + alpha = (*chit)->get_alpha(); + if (alpha < as->alpha_mid()) as->set_alpha_mid(alpha); + if (alpha > as->alpha_max()) as->set_alpha_max(alpha); + } } if (as->alpha_mid() > _alpha_solid) _alpha_solid = as->alpha_mid(); } - + if (get_mode() == GENERAL) { //reset alpha_mid, set alph_min std::list incidentv; incident_vertices(static_cast(vit), - back_inserter(incidentv)); + back_inserter(incidentv)); typename std::list::iterator vvit=incidentv.begin(); for( ; vvit != incidentv.end(); ++vvit) { - if (!is_infinite(*vvit)) { - Vertex_handle_pair vhp = make_vertex_handle_pair( *vvit, vit); - Alpha_status_iterator asedge = edge_alpha_map[vhp]; - alpha_mid = asedge->is_Gabriel() ? asedge->alpha_min() - : asedge->alpha_mid(); - if ( alpha_mid < as->alpha_mid()) as->set_alpha_mid(alpha_mid); - } + if (!is_infinite(*vvit)) { + Vertex_handle_pair vhp = make_vertex_handle_pair( *vvit, vit); + Alpha_status_iterator asedge = edge_alpha_map[vhp]; + alpha_mid = asedge->is_Gabriel() ? asedge->alpha_min() + : asedge->alpha_mid(); + if ( alpha_mid < as->alpha_mid()) as->set_alpha_mid(alpha_mid); + } } } @@ -1337,23 +1337,23 @@ Alpha_shape_3::initialize_alpha_vertex_maps(bool reinitialize) // reset alpha_mid std::list incidents; incident_cells(static_cast(vit), - back_inserter(incidents)); + back_inserter(incidents)); typename std::list::iterator chit=incidents.begin(); while (is_infinite(*chit)) ++chit; //skip infinte cells alpha = (*chit)->get_alpha(); as->set_alpha_mid(alpha); for( ; chit != incidents.end(); ++chit) { - if (is_infinite(*chit)) as->set_is_on_chull(true); - else { - alpha = (*chit)->get_alpha(); - if (alpha < as->alpha_mid()) as->set_alpha_mid(alpha); - } + if (is_infinite(*chit)) as->set_is_on_chull(true); + else { + alpha = (*chit)->get_alpha(); + if (alpha < as->alpha_mid()) as->set_alpha_mid(alpha); + } } } - + } - - // set alpha_min in case GENERAL + + // set alpha_min in case GENERAL if (get_mode() == GENERAL && alpha_min_vertex_map.empty()) { set_alpha_min_of_vertices(Weighted_tag()); } @@ -1365,9 +1365,9 @@ Alpha_shape_3::initialize_alpha_vertex_maps(bool reinitialize) //--------------------------------------------------------------------- template -void +void Alpha_shape_3::initialize_alpha_spectrum() -// merges the alpha values of alpha_cell_map +// merges the alpha values of alpha_cell_map // and alpha_min_facet_map alpha_min_edge_map alpha_min_vertex in GENERAL mode // only alpha_cell_map in REGULARIZED mode { @@ -1383,9 +1383,9 @@ Alpha_shape_3::initialize_alpha_spectrum() eit = alpha_min_edge_map.begin(); vit = alpha_min_vertex_map.begin(); alpha_spectrum.reserve(alpha_cell_map.size() + - alpha_min_facet_map.size() + - alpha_min_edge_map.size() + - alpha_min_vertex_map.size()); + alpha_min_facet_map.size() + + alpha_min_edge_map.size() + + alpha_min_vertex_map.size()); } else { alpha_spectrum.reserve(alpha_cell_map.size()); @@ -1397,55 +1397,55 @@ Alpha_shape_3::initialize_alpha_spectrum() while (cit != alpha_cell_map.end() || - fit != alpha_min_facet_map.end() || - eit != alpha_min_edge_map.end() ) { - - if ( cit != alpha_cell_map.end() - && ( fit == alpha_min_facet_map.end() || !(fit->first < cit->first) ) - && ( eit == alpha_min_edge_map.end() || !(eit->first < cit->first) ) - && ( vit == alpha_min_vertex_map.end() || !(vit->first < cit->first) ) - ) { //advance on cit + fit != alpha_min_facet_map.end() || + eit != alpha_min_edge_map.end() ) { + + if ( cit != alpha_cell_map.end() + && ( fit == alpha_min_facet_map.end() || !(fit->first < cit->first) ) + && ( eit == alpha_min_edge_map.end() || !(eit->first < cit->first) ) + && ( vit == alpha_min_vertex_map.end() || !(vit->first < cit->first) ) + ) { //advance on cit if (alpha_spectrum.empty() || alpha_spectrum.back() < cit->first){ - alpha_spectrum.push_back(cit->first); + alpha_spectrum.push_back(cit->first); } cit++; } - if ( fit != alpha_min_facet_map.end() - && ( cit == alpha_cell_map.end() || !(cit->first < fit->first) ) - && ( eit == alpha_min_edge_map.end() || !(eit->first < fit->first) ) - && ( vit == alpha_min_vertex_map.end() || !(vit->first < fit->first) ) - ) { //advance on fit + if ( fit != alpha_min_facet_map.end() + && ( cit == alpha_cell_map.end() || !(cit->first < fit->first) ) + && ( eit == alpha_min_edge_map.end() || !(eit->first < fit->first) ) + && ( vit == alpha_min_vertex_map.end() || !(vit->first < fit->first) ) + ) { //advance on fit if (alpha_spectrum.empty() || alpha_spectrum.back() < fit->first){ - alpha_spectrum.push_back(fit->first); + alpha_spectrum.push_back(fit->first); } fit++; } - if ( eit != alpha_min_edge_map.end() - && ( fit == alpha_min_facet_map.end() || !(fit->first < eit->first) ) - && ( cit == alpha_cell_map.end() || !(cit->first < eit->first) ) - && ( vit == alpha_min_vertex_map.end() || !(vit->first < eit->first) ) - ) { //advance on eit + if ( eit != alpha_min_edge_map.end() + && ( fit == alpha_min_facet_map.end() || !(fit->first < eit->first) ) + && ( cit == alpha_cell_map.end() || !(cit->first < eit->first) ) + && ( vit == alpha_min_vertex_map.end() || !(vit->first < eit->first) ) + ) { //advance on eit if (alpha_spectrum.empty() || alpha_spectrum.back() < eit->first) { - alpha_spectrum.push_back(eit->first); + alpha_spectrum.push_back(eit->first); } eit++; } - if ( vit != alpha_min_vertex_map.end() - && ( fit == alpha_min_facet_map.end() || !(fit->first < vit->first) ) - && ( cit == alpha_cell_map.end() || !(cit->first < vit->first) ) - && ( eit == alpha_min_edge_map.end() || !(eit->first < vit->first) ) - ) { //advance on vit + if ( vit != alpha_min_vertex_map.end() + && ( fit == alpha_min_facet_map.end() || !(fit->first < vit->first) ) + && ( cit == alpha_cell_map.end() || !(cit->first < vit->first) ) + && ( eit == alpha_min_edge_map.end() || !(eit->first < vit->first) ) + ) { //advance on vit if (alpha_spectrum.empty() || alpha_spectrum.back() < vit->first) { - alpha_spectrum.push_back(vit->first); + alpha_spectrum.push_back(vit->first); } vit++; } } } - + //--------------------------------------------------------------------- @@ -1465,14 +1465,14 @@ std::istream& operator>>(std::istream& is, const Alpha_shape_3& A) template std::ostream& operator<<(std::ostream& os, const Alpha_shape_3& A) - // Inserts the alpha shape into the stream `os' as an indexed face set. + // Inserts the alpha shape into the stream `os' as an indexed face set. // Precondition: The insert operator must be defined for `Point' { typedef Alpha_shape_3 AS; typedef typename AS::size_type size_type; typedef typename AS::Vertex_handle Vertex_handle; typedef typename AS::Cell_handle Cell_handle; - typedef typename AS::Alpha_shape_vertices_iterator + typedef typename AS::Alpha_shape_vertices_iterator Alpha_shape_vertices_iterator; typedef typename AS::Alpha_shape_facets_iterator Alpha_shape_facets_iterator; @@ -1505,8 +1505,8 @@ std::ostream& operator<<(std::ostream& os, const Alpha_shape_3& A) int i0 = Triangulation_utils_3::vertex_triple_index(i,0); int i1 = Triangulation_utils_3::vertex_triple_index(i,1); int i2 = Triangulation_utils_3::vertex_triple_index(i,2); - os << V[c->vertex(i0)] << ' ' - << V[c->vertex(i1)] << ' ' + os << V[c->vertex(i0)] << ' ' + << V[c->vertex(i1)] << ' ' << V[c->vertex(i2)] << std::endl; } return os; @@ -1526,10 +1526,10 @@ Alpha_shape_3::update_alpha_shape_vertex_list() const get_alpha_shape_vertices(it, REGULAR); if (get_mode()==GENERAL) get_alpha_shape_vertices(it, SINGULAR); - + return; } - + //--------------------------------------------------------------------- @@ -1547,7 +1547,7 @@ Alpha_shape_3::update_alpha_shape_facet_list() const get_alpha_shape_facets(it, REGULAR); if (get_mode()==GENERAL) get_alpha_shape_facets(it, SINGULAR); - + return; } @@ -1556,64 +1556,64 @@ Alpha_shape_3::update_alpha_shape_facet_list() const //--------------------------------------------------------------------- template -typename Alpha_shape_3::Classification_type +typename Alpha_shape_3::Classification_type Alpha_shape_3::classify(const Alpha_status& as, - const NT& alpha) const + const NT& alpha) const { //tetrahedra with circumradius=alpha are considered inside if ( !as.is_on_chull() && alpha >= as.alpha_max()) return INTERIOR; else if ( alpha >= as.alpha_mid()) return REGULAR; - else if ( get_mode() == GENERAL && - as.is_Gabriel() && - alpha >= as.alpha_min()) return SINGULAR; + else if ( get_mode() == GENERAL && + as.is_Gabriel() && + alpha >= as.alpha_min()) return SINGULAR; else return EXTERIOR; } template -typename Alpha_shape_3::Classification_type +typename Alpha_shape_3::Classification_type Alpha_shape_3::classify(const Alpha_status* as, - const NT& alpha) const + const NT& alpha) const { //tetrahedra with circumradius=alpha are considered inside if ( !as->is_on_chull() && alpha >= as->alpha_max()) return INTERIOR; else if ( alpha >= as->alpha_mid()) return REGULAR; - else if ( get_mode() == GENERAL && - as->is_Gabriel() && - alpha >= as->alpha_min()) return SINGULAR; + else if ( get_mode() == GENERAL && + as->is_Gabriel() && + alpha >= as->alpha_min()) return SINGULAR; else return EXTERIOR; } template -typename Alpha_shape_3::Classification_type +typename Alpha_shape_3::Classification_type Alpha_shape_3::classify(Alpha_status_const_iterator as, - const NT& alpha) const + const NT& alpha) const { return classify(&(*as), alpha); } template -typename Alpha_shape_3::Classification_type -Alpha_shape_3::classify(const Cell_handle& s, - int i, - const NT& alpha) const +typename Alpha_shape_3::Classification_type +Alpha_shape_3::classify(const Cell_handle& s, + int i, + const NT& alpha) const // Classifies the face `f' of the underlying Delaunay // tetrahedralization with respect to `A'. -{ +{ if (is_infinite(s,i)) return EXTERIOR; Alpha_status_iterator as = s->get_facet_status(i); return classify(as, alpha); } - + template -typename Alpha_shape_3::Classification_type -Alpha_shape_3::classify(const Cell_handle& c, - int i, - int j, - const NT& alpha) const +typename Alpha_shape_3::Classification_type +Alpha_shape_3::classify(const Cell_handle& c, + int i, + int j, + const NT& alpha) const // Classifies the edge `e' of the underlying Delaunay // tetrahedralization with respect to `A'. -{ +{ if (is_infinite(c, i, j)) return EXTERIOR; if (get_mode() == GENERAL) { Alpha_status_iterator asit; @@ -1622,7 +1622,7 @@ Alpha_shape_3::classify(const Cell_handle& c, asit = edge_alpha_map.find(vhp)->second; return classify(asit,alpha); } - + //no edge map in REGULARIZED mode - classify on the fly Alpha_status as; compute_edge_status( c, i, j, as); @@ -1632,24 +1632,24 @@ Alpha_shape_3::classify(const Cell_handle& c, template void Alpha_shape_3:: -compute_edge_status( const Cell_handle& c, - int i, - int j, - Alpha_status& as) const +compute_edge_status( const Cell_handle& c, + int i, + int j, + Alpha_status& as) const { Facet_circulator fcirc, done; Alpha_status_iterator asf; NT alpha; as.set_is_on_chull(false); - + Cell_circulator ccirc, last; ccirc = incident_cells(c,i,j); last=ccirc; while (is_infinite(ccirc) ) ++ccirc; //skip infinite incident cells alpha = (*ccirc).get_alpha(); as.set_alpha_mid(alpha); // initialise as.alpha_mid to alpha value of an incident cell - as.set_alpha_max(alpha); // same for as.alpha_max - while (++ccirc != last) + as.set_alpha_max(alpha); // same for as.alpha_max + while (++ccirc != last) { if (!is_infinite(ccirc)) { alpha = (*ccirc).get_alpha(); @@ -1660,10 +1660,10 @@ compute_edge_status( const Cell_handle& c, as.set_alpha_max( alpha ); } } - } - + } + fcirc = incident_facets(c,i,j); - done = fcirc; + done = fcirc; do { if (!is_infinite(*fcirc)) { asf = (*fcirc).first->get_facet_status((*fcirc).second); @@ -1674,7 +1674,7 @@ compute_edge_status( const Cell_handle& c, if (asf->is_on_chull()) as.set_is_on_chull(true); } - } while (++fcirc != done); + } while (++fcirc != done); // initialize alphamin if ( get_mode() == GENERAL){ @@ -1687,15 +1687,15 @@ compute_edge_status( const Cell_handle& c, as.set_is_Gabriel(false); as.set_alpha_min(as.alpha_mid()); } - } + } } //--------------------------------------------------------------------- template -typename Alpha_shape_3::Classification_type +typename Alpha_shape_3::Classification_type Alpha_shape_3::classify(const Vertex_handle& v, - const NT& alpha) const + const NT& alpha) const // Classifies the vertex `v' of the underlying Delaunay // tetrahedralization with respect to `A'. { @@ -1709,7 +1709,7 @@ Alpha_shape_3::classify(const Vertex_handle& v, template typename Alpha_shape_3::size_type Alpha_shape_3::number_of_solid_components(const NT& alpha) const - // Determine the number of connected solid components + // Determine the number of connected solid components // takes time O(#alpha_shape) amortized if STL_HASH_TABLES // O(#alpha_shape log n) otherwise { @@ -1723,15 +1723,15 @@ Alpha_shape_3::number_of_solid_components(const NT& alpha) const { Cell_handle pCell = cell_it; CGAL_triangulation_assertion(pCell != nullptr); - + if (classify(pCell, alpha) == INTERIOR){ - Data& data = marked_cell_set[pCell]; - if(data == false) { - // we traverse only interior simplices - data = true; - traverse(pCell, marked_cell_set, alpha); - nb_solid_components++; - } + Data& data = marked_cell_set[pCell]; + if(data == false) { + // we traverse only interior simplices + data = true; + traverse(pCell, marked_cell_set, alpha); + nb_solid_components++; + } } } return nb_solid_components; @@ -1740,8 +1740,8 @@ Alpha_shape_3::number_of_solid_components(const NT& alpha) const template void Alpha_shape_3::traverse(Cell_handle pCell, - Marked_cell_set& marked_cell_set, - const NT alpha) const + Marked_cell_set& marked_cell_set, + const NT alpha) const { typedef typename Marked_cell_set::Data Data; std::list cells; @@ -1753,23 +1753,23 @@ void Alpha_shape_3::traverse(Cell_handle pCell, cells.pop_back(); for (int i=0; i<=3; i++) { - pNeighbor = pCell->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != nullptr); - if (classify(pNeighbor, alpha) == INTERIOR){ - Data& data = marked_cell_set[pNeighbor]; - if(data == false){ - data = true; - cells.push_back(pNeighbor); - } - } + pNeighbor = pCell->neighbor(i); + CGAL_triangulation_assertion(pNeighbor != nullptr); + if (classify(pNeighbor, alpha) == INTERIOR){ + Data& data = marked_cell_set[pNeighbor]; + if(data == false){ + data = true; + cells.push_back(pNeighbor); + } + } } - } + } } //---------------------------------------------------------------------- template -typename Alpha_shape_3::Alpha_iterator +typename Alpha_shape_3::Alpha_iterator Alpha_shape_3::find_optimal_alpha(size_type nb_components) const // find the minimum alpha that satisfies the properties // (1) nb_components solid components <= nb_components @@ -1777,23 +1777,23 @@ Alpha_shape_3::find_optimal_alpha(size_type nb_components) const { NT alpha = find_alpha_solid(); // from this alpha on the alpha_solid satisfies property (2) - + Alpha_iterator first = alpha_lower_bound(alpha); if (number_of_solid_components(alpha) == nb_components) { - // if ((first+1) < alpha_end()) - // return (first+1); - // else - return first; + // if ((first+1) < alpha_end()) + // return (first+1); + // else + return first; } // do binary search on the alpha values - // number_of_solid_components() is a monotone function + // number_of_solid_components() is a monotone function // if we start with find_alpha_solid - + Alpha_iterator last = alpha_end(); Alpha_iterator middle; - + std::ptrdiff_t len = last - first - 1; std::ptrdiff_t half; @@ -1842,9 +1842,9 @@ Alpha_shape_3::find_optimal_alpha(size_type nb_components) const //---------------------------------------------------------------------- template -typename Alpha_shape_3::NT +typename Alpha_shape_3::NT Alpha_shape_3::find_alpha_solid() const - // compute the minumum alpha such that all data points + // compute the minumum alpha such that all data points // are either on the boundary or in the interior // not necessarily connected { @@ -1854,7 +1854,7 @@ Alpha_shape_3::find_alpha_solid() const // TO DEBUG template -void +void Alpha_shape_3::print_maps() const { typename Alpha_cell_map::const_iterator cit ; @@ -1862,8 +1862,8 @@ Alpha_shape_3::print_maps() const typename Alpha_edge_map::const_iterator eit ; typename Alpha_vertex_map::const_iterator vit; - std::cerr << "size of cell map " << alpha_cell_map.size() - << std::endl; + std::cerr << "size of cell map " << alpha_cell_map.size() + << std::endl; std::cerr << "size of facet map " << alpha_min_facet_map.size() << std::endl; std::cerr << "size of edge map " << alpha_min_edge_map.size() << @@ -1899,7 +1899,7 @@ Alpha_shape_3::print_maps() const template -void +void Alpha_shape_3::print_alphas() const { std::cerr << std::endl; @@ -1914,11 +1914,11 @@ Alpha_shape_3::print_alphas() const std::cerr << " alpha values of edges " << std::endl; if (get_mode() == GENERAL) { for(Finite_edges_iterator eit = finite_edges_begin(); - eit != finite_edges_end(); - ++eit) { - Vertex_handle_pair - vhp = make_vertex_handle_pair(eit->first->vertex(eit->second), - eit->first->vertex(eit->third)); + eit != finite_edges_end(); + ++eit) { + Vertex_handle_pair + vhp = make_vertex_handle_pair(eit->first->vertex(eit->second), + eit->first->vertex(eit->third)); Alpha_status_iterator as = edge_alpha_map.find(vhp)->second; print_alpha_status(*as); } @@ -1935,7 +1935,7 @@ Alpha_shape_3::print_alphas() const } template -void +void Alpha_shape_3::print_alpha_status(const Alpha_status& as) const { if ( get_mode() == GENERAL && as.is_Gabriel()) diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h index bdc6670fd426..2032448d0ae5 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h @@ -23,7 +23,7 @@ namespace CGAL { template < class NT_> -class Alpha_status +class Alpha_status : public Compact_container_base { bool _is_Gabriel; @@ -77,13 +77,13 @@ class Alpha_shape_cell_base_3 NT A; public: - Alpha_shape_cell_base_3() + Alpha_shape_cell_base_3() : Cb() {} - + Alpha_shape_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) : Cb(v0, v1, v2, v3) {} - + Alpha_shape_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, Cell_handle n0, Cell_handle n1, diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_euclidean_traits_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_euclidean_traits_3.h index b4d26169b25d..bcfb4c4f46cc 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_euclidean_traits_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_euclidean_traits_3.h @@ -6,12 +6,12 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Tran Kai Frank DA #ifndef CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H -#define CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H +#define CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H #include diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_vertex_base_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_vertex_base_3.h index 3628a4072038..e45041b4b117 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_vertex_base_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_vertex_base_3.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Tran Kai Frank DA @@ -56,10 +56,10 @@ class Alpha_shape_vertex_base_3 public: Alpha_shape_vertex_base_3() : Vb() {} - + Alpha_shape_vertex_base_3(const Point& p) : Vb(p) {} - + Alpha_shape_vertex_base_3(const Point& p, Cell_handle c) : Vb(p, c) {} diff --git a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_3.h index 08575cf95ffb..68acacb241d1 100644 --- a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_3.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Sebastien Loriot // @@ -65,42 +65,42 @@ namespace internal{ return T.geom_traits().compare_weighted_squared_radius_3_object(); } }; - + //small utility to insert hidden vertices after a removal (in non-weighted case do nothing) template struct Hidden_inserter { typedef typename One_alpha::Triangulation Dt; - + template static void insert(One_alpha& one_alpha, Vertex_remover& remover) { typename One_alpha::Cell_handle c; for (typename Vertex_remover::Hidden_points_iterator hi = remover.hidden_points_begin(); - hi != remover.hidden_points_end(); ++hi) + hi != remover.hidden_points_end(); ++hi) { typename One_alpha::Vertex_handle hv = one_alpha.insert (*hi, c); if (hv != typename One_alpha::Vertex_handle()) c = hv->cell(); } } }; - + template struct Hidden_inserter{ typedef typename One_alpha::Triangulation Dt; template static void insert(const One_alpha&,const Vertex_remover&){} }; - - + + } //internal template < class Dt > class Fixed_alpha_shape_3 : public Dt { - // DEFINITION The class Fixed_alpha_shape_3
    represents the + // DEFINITION The class Fixed_alpha_shape_3
    represents the // alpha-shape for a set of points (or a set of weighted points) // for a given value of alpha. The alphashape is defined through // the Delaunay tetrahedralization of the points @@ -112,19 +112,19 @@ class Fixed_alpha_shape_3 : public Dt // in case of weighted points) empty of other points // (or suborthogonal to other sites in case of weighted points) // with squared radius equal or less than alpha - + // In each k-dimensional simplex of the triangulation - // for (k=0,1,2) + // for (k=0,1,2) // can be classified as EXTERIOR, SINGULAR, REGULAR // or INTERIOR with respect to the alpha shape. // A $k$ simplex is REGULAR if it is on the boundary // of the alpha_complex and belongs to a $k+1$ simplex in the complex // and it is SINGULAR simplex if it is a boundary simplex tht is not // included in a $k+1$ simplex of the complex. - - // Roughly, the Fixed_alpha_shape data structure computes and stores, + + // Roughly, the Fixed_alpha_shape data structure computes and stores, // for each simplex it classification type. - + //------------------------- TYPES ------------------------------------ @@ -145,7 +145,7 @@ class Fixed_alpha_shape_3 : public Dt typedef Coord_type FT; typedef typename Dt::Point Point; - + typedef typename Dt::Cell_handle Cell_handle; typedef typename Dt::Vertex_handle Vertex_handle; typedef typename Dt::Facet Facet; @@ -221,9 +221,9 @@ class Fixed_alpha_shape_3 : public Dt typedef Filter_iterator< Finite_facets_iterator, Exterior_simplex_test> Alpha_shape_facets_iterator; typedef Filter_iterator< Finite_edges_iterator, Exterior_simplex_test> Alpha_shape_edges_iterator; typedef Filter_iterator< Finite_cells_iterator, Exterior_simplex_test> Alpha_shape_cells_iterator; - - - Vertex_handle + + + Vertex_handle insert(const Point& p,Cell_handle start=Cell_handle()) { if (this->dimension() < 3){ @@ -231,7 +231,7 @@ class Fixed_alpha_shape_3 : public Dt if (this->dimension() == 3) initialize_alpha(); return new_v; } - + //Handle only case of dimension 3 of insert_in_conflict from Triangulation_3 class. typename Triangulation::Locate_type lt; int li, lj; @@ -251,7 +251,7 @@ class Fixed_alpha_shape_3 : public Dt // First, find the conflict region. std::vector cells; std::vector facets_on_the_boundary_of_the_hole; - + cells.reserve(32); this->find_conflicts (c, tester, make_triple(std::back_inserter(facets_on_the_boundary_of_the_hole), @@ -259,7 +259,7 @@ class Fixed_alpha_shape_3 : public Dt Emptyset_iterator())); Facet facet=*boost::prior(facets_on_the_boundary_of_the_hole.end()); - + // Remember the points that are hidden by the conflicting cells, // as they will be deleted during the insertion. this->hidden_point_visitor.process_cells_in_conflict(cells.begin(), cells.end()); @@ -269,7 +269,7 @@ class Fixed_alpha_shape_3 : public Dt //recover edges on the boundary of the hole. std::set hole_boundary_edges; const int indices[3]={1,2,3}; - for (typename std::vector::iterator + for (typename std::vector::iterator it=facets_on_the_boundary_of_the_hole.begin(); it!=facets_on_the_boundary_of_the_hole.end(); ++it) @@ -333,9 +333,9 @@ class Fixed_alpha_shape_3 : public Dt int itmp1,itmp2; v->is_on_chull( this->is_edge(this->infinite_vertex(),v,tmp,itmp1,itmp2) ); finalize_status_of_vertex(v); - + //--set classification of old edges - for (typename std::set::iterator + for (typename std::set::iterator eit=hole_boundary_edges.begin();eit!=hole_boundary_edges.end();++eit) { CGAL_precondition (!this->is_infinite(*eit)); @@ -345,7 +345,7 @@ class Fixed_alpha_shape_3 : public Dt CGAL_precondition(it_status!=edge_status_map.end()); it_status->second = status; } - + //--set status of old vertices + update is_on_chull //TODO: find a better way to do it : make an update std::vector vertices; @@ -357,21 +357,21 @@ class Fixed_alpha_shape_3 : public Dt } set_vertex_status(*vit); } - + // Store the hidden points in their new cells. this->hidden_point_visitor.reinsert_vertices(v); return v; } - + void remove (Vertex_handle vertex_to_remove) { CGAL_precondition(vertex_to_remove!=Vertex_handle()); CGAL_precondition(vertex_to_remove!=this->infinite_vertex()); - + std::vector link; - std::vector vertices_to_update; + std::vector vertices_to_update; std::map old_classification; - + if (this->dimension() == 3) { //recover facet of the link: they are bounding @@ -388,7 +388,7 @@ class Fixed_alpha_shape_3 : public Dt //get vertices that will need to be updated this->finite_adjacent_vertices(vertex_to_remove,std::back_inserter(vertices_to_update)); - + //1-erase removed edges from edge_map //2-store old classification of vertices and set it to SINGULAR for(typename std::vector::iterator it=vertices_to_update.begin();it!=vertices_to_update.end();++it){ @@ -398,18 +398,18 @@ class Fixed_alpha_shape_3 : public Dt (*it)->set_classification_type(SINGULAR); } } - + //Do remove the vertex from the underlying triangulation Dt tmp; typename Dt:: template Vertex_remover
    remover(tmp); typedef typename Dt::Tr_Base Tr_Base; Tr_Base::remove(vertex_to_remove,remover); - + if (this->dimension()<3){ edge_status_map.clear(); return; } - + //recover new cells std::set new_cells;//cells in the hole std::set outer;//cells that are not in the hole @@ -422,7 +422,7 @@ class Fixed_alpha_shape_3 : public Dt outer.insert(it->first); } } - + while (!to_visit.empty()){ Cell_handle cell=to_visit.front(); to_visit.pop(); @@ -434,13 +434,13 @@ class Fixed_alpha_shape_3 : public Dt to_visit.push(candidate); } } - + //set status of new cells for (typename std::set::iterator it=new_cells.begin();it!=new_cells.end();++it){ CGAL_precondition(!this->is_infinite(*it)); set_cell_status(*it); } - + //recover new facets + link facets //set vertex that are on the convex hull (those on a facet incident to infinite cell) while (!new_cells.empty()) @@ -460,7 +460,7 @@ class Fixed_alpha_shape_3 : public Dt } } } - + std::set new_edges; //1- set status of these facets //2- recover new edges + edges incident to link facets @@ -471,29 +471,29 @@ class Fixed_alpha_shape_3 : public Dt new_edges.insert(Edge(it->first,(it->second+index[i])%4,(it->second+index[(i+1)%3])%4)); } } - + //set status of these edges for(typename std::set::iterator it=new_edges.begin();it!=new_edges.end();++it){ Classification_type status=compute_edge_status(it->first, it->second, it->third); //cross links Vertex_handle_pair vhp = make_vertex_handle_pair( *it ); edge_status_map[vhp]=status; - + //update status of incident vertices update_vertex_status(it->first->vertex(it->second),status); update_vertex_status(it->first->vertex(it->third),status); } - + //set final status of vertices for(typename std::vector::iterator it=vertices_to_update.begin();it!=vertices_to_update.end();++it){ //this one is working but should be more expensive //set_vertex_status(*it); continue; - + Classification_type old_status=old_classification[*it]; Classification_type status=(*it)->get_classification_type(); - + CGAL_precondition( status!=SINGULAR ); // at least on edge is incident to that vertex - + if (status==INTERIOR){ if (old_status!=INTERIOR || (*it)->is_on_chull()) (*it)->set_classification_type(REGULAR); @@ -501,14 +501,14 @@ class Fixed_alpha_shape_3 : public Dt (*it)->set_classification_type(INTERIOR); continue; } - + if (status==REGULAR) continue; if ( status==EXTERIOR && ( old_status==REGULAR || old_status==INTERIOR) ){ //if vertex was EXTERIOR or SINGULAR other edges are not in the alpha complex //check if former REGULAR vertex becomes EXTERIOR or SINGULAR std::list incidentv; finite_adjacent_vertices(*it,back_inserter(incidentv)); - + typename std::list::iterator vvit=incidentv.begin(); for( ; vvit != incidentv.end(); ++vvit) { //TODO: We take all edges -> WE SHOULD ONLY TAKE THOSE NOT IN THE HOLE @@ -520,22 +520,22 @@ class Fixed_alpha_shape_3 : public Dt break; } } - + if ( vvit != incidentv.end() ) continue; } - + if ( is_vertex_Gabriel((*it),Weighted_tag()) && is_gabriel_simplex_in_alpha_complex((*it)) ) (*it)->set_classification_type(SINGULAR); else (*it)->set_classification_type(EXTERIOR); } - + //Insert possible hidden points internal::Hidden_inserter,Weighted_tag>::insert(*this,remover); } - - - + + + private: typedef internal::Simplex_classif_predicate,Weighted_tag> Simplex_classif; @@ -548,36 +548,36 @@ class Fixed_alpha_shape_3 : public Dt //------------------------- CONSTRUCTORS ------------------------------ public: - Fixed_alpha_shape_3(NT alpha=0):_alpha(alpha){} + Fixed_alpha_shape_3(NT alpha=0):_alpha(alpha){} Fixed_alpha_shape_3(Dt& dt, NT alpha = 0):_alpha(alpha){ Dt::swap(dt); if (dimension() == 3) initialize_alpha(); } - + // Introduces an alpha-shape `A' for the alpha-value // `alpha' that is initialized with the points in the range // from first to last - template < class InputIterator > - Fixed_alpha_shape_3(const InputIterator& first, - const InputIterator& last, + template < class InputIterator > + Fixed_alpha_shape_3(const InputIterator& first, + const InputIterator& last, const NT& alpha = 0): _alpha(alpha) { Dt::insert(first, last); - if (dimension() == 3) initialize_alpha(); + if (dimension() == 3) initialize_alpha(); } - - - + + + private : - template < class InputIterator > - int make_alpha_shape(const InputIterator& first, - const InputIterator& last) + template < class InputIterator > + int make_alpha_shape(const InputIterator& first, + const InputIterator& last) { clear(); int n = Dt::insert(first, last); - if (dimension() == 3) initialize_alpha(); + if (dimension() == 3) initialize_alpha(); return n; } @@ -593,7 +593,7 @@ private : incident_vertices(this->infinite_vertex(),std::back_inserter(chull)); for ( typename std::vector::iterator it=chull.begin();it!=chull.end();++it) (*it)->is_on_chull(true); - + initialize_status_of_cells(); initialize_status_of_facets(); initialize_status_of_edges(); @@ -603,7 +603,7 @@ private : private : // prevent default copy constructor and default assigment Fixed_alpha_shape_3(const Fixed_alpha_shape_3&); - void operator=(const Fixed_alpha_shape_3&); + void operator=(const Fixed_alpha_shape_3&); static Vertex_handle_pair @@ -617,14 +617,14 @@ private : make_vertex_handle_pair( const Edge& e) { return make_vertex_handle_pair(e.first->vertex(e.second),e.first->vertex(e.third)); } - + struct Compare_edge{ bool operator()(const Edge& e1,const Edge& e2) const { return make_vertex_handle_pair(e1) bool is_vertex_Gabriel(Vertexhandle v,Tag_true){return is_Gabriel(v);} @@ -633,7 +633,7 @@ private : void set_vertex_status(Vertex_handle v); inline void set_cell_status (Cell_handle c); Classification_type compute_edge_status( const Cell_handle& c,int i,int j) const; - + //--------------------------------------------------------------------- public: @@ -642,32 +642,32 @@ private : { return _alpha; } - + void clear() { // clears the structure Dt::clear(); edge_status_map.clear(); } - + //--------------------- PREDICATES ----------------------------------- public: Classification_type classify(const Cell_handle& s) const { if (is_infinite(s)) return EXTERIOR; - return s->get_classification_type(); + return s->get_classification_type(); } Classification_type classify(const Facet& f) const { if (is_infinite(f)) return EXTERIOR; - return f.first->get_facet_classification_type(f.second); + return f.first->get_facet_classification_type(f.second); } Classification_type classify(const Edge& e) const { if (is_infinite(e)) return EXTERIOR; - return edge_status_map.find(make_vertex_handle_pair(e))->second; + return edge_status_map.find(make_vertex_handle_pair(e))->second; } Classification_type classify(const Vertex_handle& v) const { if (is_infinite(v)) return EXTERIOR; - return v->get_classification_type(); + return v->get_classification_type(); } @@ -703,7 +703,7 @@ private : bool is_gabriel_simplex_in_alpha_complex (const Cell_handle& s, const int& i, const int& j) const { - return + return Simplex_classif::predicate(*this)( s->vertex(i)->point(), s->vertex(j)->point(), @@ -726,7 +726,7 @@ private : } //--------------------------------------------------------------------- -public: +public: #ifdef CGAL_USE_GEOMVIEW void show_alpha_shape_faces(Geomview_stream &gv) const; #endif @@ -759,8 +759,8 @@ private : //--------------------------------------------------------------------- // To extract simplices given a classification type template - OutputIterator get_alpha_shape_cells(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_cells(OutputIterator it, + Classification_type type) const { Finite_cells_iterator cit = finite_cells_begin(); for( ; cit != finite_cells_end() ; ++cit){ @@ -770,8 +770,8 @@ private : } template - OutputIterator get_alpha_shape_facets(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_facets(OutputIterator it, + Classification_type type) const { Finite_facets_iterator fit = finite_facets_begin(); for( ; fit != finite_facets_end() ; ++fit){ @@ -781,8 +781,8 @@ private : } template - OutputIterator get_alpha_shape_edges(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_edges(OutputIterator it, + Classification_type type) const { Finite_edges_iterator eit = finite_edges_begin(); for( ; eit != finite_edges_end() ; ++eit){ @@ -792,8 +792,8 @@ private : } template - OutputIterator get_alpha_shape_vertices(OutputIterator it, - Classification_type type) const + OutputIterator get_alpha_shape_vertices(OutputIterator it, + Classification_type type) const { Finite_vertices_iterator vit = finite_vertices_begin(); for( ; vit != finite_vertices_end() ; ++vit){ @@ -801,7 +801,7 @@ private : } return it; } - + }; @@ -824,13 +824,13 @@ const typename Fixed_alpha_shape_3
    ::Classification_type Fixed_alpha_shape_3< template void Fixed_alpha_shape_3
    ::set_cell_status(Cell_handle c){ Classification_type status=is_infinite(c) ? EXTERIOR:( is_gabriel_simplex_in_alpha_complex(c) ? INTERIOR : EXTERIOR ); - c->set_classification_type(status); + c->set_classification_type(status); } template -void +void Fixed_alpha_shape_3
    ::initialize_status_of_cells() -{ +{ Finite_cells_iterator cell_it, done = finite_cells_end(); for( cell_it = finite_cells_begin(); cell_it != done; ++cell_it) { set_cell_status(cell_it); @@ -850,17 +850,17 @@ set_facet_classification_type( const Facet& f) { int iNeigh = pNeighbor->index(pCell); unsigned nb_interior_cells=0; - + if(!is_infinite(pCell)){ if (pCell->get_classification_type()==INTERIOR) ++nb_interior_cells; } - + if(!is_infinite(pNeighbor)){ if (pNeighbor->get_classification_type()==INTERIOR) ++nb_interior_cells; } - + Classification_type status=EXTERIOR; switch (nb_interior_cells){ case 2: @@ -872,21 +872,21 @@ set_facet_classification_type( const Facet& f) { default: { if ( is_Gabriel(f) ){ - if ( is_gabriel_simplex_in_alpha_complex(f) ) status=SINGULAR; + if ( is_gabriel_simplex_in_alpha_complex(f) ) status=SINGULAR; } } - } + } pCell->set_facet_classification_type(i,status); pNeighbor->set_facet_classification_type(iNeigh,status); } template -void +void Fixed_alpha_shape_3
    ::initialize_status_of_facets() { for(Finite_facets_iterator fit = finite_facets_begin(); - fit != finite_facets_end(); ++fit) + fit != finite_facets_end(); ++fit) set_facet_classification_type(*fit); } @@ -900,7 +900,7 @@ compute_edge_status( const Cell_handle& c, int i, int j) const Facet_circulator fcirc, done; fcirc = incident_facets(c,i,j); done = fcirc; - + bool is_regular=false; bool is_interior=true; do{ @@ -916,19 +916,19 @@ compute_edge_status( const Cell_handle& c, int i, int j) const }while(++fcirc!=done); if (is_interior) return INTERIOR; if (is_regular) return REGULAR; - + if ( is_Gabriel(c,i,j) ){ if ( is_gabriel_simplex_in_alpha_complex(c,i,j) ) return SINGULAR; - } + } return EXTERIOR; } template -void +void Fixed_alpha_shape_3
    ::initialize_status_of_edges() { - for (Finite_edges_iterator eit = finite_edges_begin(); - eit != finite_edges_end(); ++eit) + for (Finite_edges_iterator eit = finite_edges_begin(); + eit != finite_edges_end(); ++eit) { Classification_type status=compute_edge_status(eit->first, eit->second, eit->third); //cross links @@ -940,11 +940,11 @@ Fixed_alpha_shape_3
    ::initialize_status_of_edges() //this function is only to use for update (removal/update) template -void +void Fixed_alpha_shape_3
    ::set_vertex_status(Vertex_handle v){ std::list incidentv; finite_adjacent_vertices(v,back_inserter(incidentv)); - + bool is_interior=true; bool is_regular=false; typename std::list::iterator vvit=incidentv.begin(); @@ -957,7 +957,7 @@ Fixed_alpha_shape_3
    ::set_vertex_status(Vertex_handle v){ break; } } - + Classification_type status=EXTERIOR; if (is_interior) status=v->is_on_chull() ? REGULAR : INTERIOR; @@ -972,15 +972,15 @@ Fixed_alpha_shape_3
    ::set_vertex_status(Vertex_handle v){ } v->set_classification_type(status); } - + template -void +void Fixed_alpha_shape_3
    ::update_vertex_status(Vertex_handle v,Classification_type edge_status){ Classification_type status=v->get_classification_type(); switch(status){ case SINGULAR: switch(edge_status){ - case INTERIOR: + case INTERIOR: status=INTERIOR; break; case EXTERIOR: @@ -993,15 +993,15 @@ Fixed_alpha_shape_3
    ::update_vertex_status(Vertex_handle v,Classification_typ break; case INTERIOR: switch(edge_status){ - case INTERIOR: + case INTERIOR: break; case EXTERIOR: case REGULAR: case SINGULAR: status=REGULAR; } - break; - case EXTERIOR: + break; + case EXTERIOR: switch(edge_status){ case EXTERIOR: break; @@ -1011,14 +1011,14 @@ Fixed_alpha_shape_3
    ::update_vertex_status(Vertex_handle v,Classification_typ status=REGULAR; } break; - case REGULAR: + case REGULAR: break; } v->set_classification_type(status); } template -void +void Fixed_alpha_shape_3
    ::finalize_status_of_vertex(Vertex_handle v) { Classification_type status=v->get_classification_type(); @@ -1028,21 +1028,21 @@ Fixed_alpha_shape_3
    ::finalize_status_of_vertex(Vertex_handle v) } if (status==INTERIOR || status==REGULAR) return; - + //when dimension is 3 any vertex has at least one incident edge, // thus can't be SINGULAR again (because of update_vertex_status behavior) CGAL_assertion(v->get_classification_type()==EXTERIOR); - + if ( is_vertex_Gabriel(v,Weighted_tag()) && is_gabriel_simplex_in_alpha_complex(v) ) v->set_classification_type(SINGULAR); } template -void +void Fixed_alpha_shape_3
    ::initialize_status_of_vertices() { #if 1 //approach avoiding extensive use of the map on 3hfli we move from 0.110983 to 0.082987 - for( Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit) + for( Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit) vit->set_classification_type(SINGULAR); for (typename Edge_status_map::const_iterator eit=edge_status_map.begin();eit!=edge_status_map.end();++eit){ Classification_type edge_status=eit->second; @@ -1050,12 +1050,12 @@ Fixed_alpha_shape_3
    ::initialize_status_of_vertices() update_vertex_status(vhp.first,edge_status); update_vertex_status(vhp.second,edge_status); } - for( Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit) + for( Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit) finalize_status_of_vertex(vit); #else //This method is slower because it always makes queries in the edge classification map - for( Finite_vertices_iterator vit = finite_vertices_begin(); - vit != finite_vertices_end(); ++vit) + for( Finite_vertices_iterator vit = finite_vertices_begin(); + vit != finite_vertices_end(); ++vit) set_vertex_status(vit); #endif } @@ -1064,13 +1064,13 @@ Fixed_alpha_shape_3
    ::initialize_status_of_vertices() template std::ostream& operator<<(std::ostream& os, const Fixed_alpha_shape_3
    & A) - // Inserts the alpha shape into the stream `os' as an indexed face set. + // Inserts the alpha shape into the stream `os' as an indexed face set. // Precondition: The insert operator must be defined for `Point' { typedef Fixed_alpha_shape_3
    AS; typedef typename AS::Vertex_handle Vertex_handle; typedef typename AS::Cell_handle Cell_handle; - typedef typename AS::Alpha_shape_vertices_iterator + typedef typename AS::Alpha_shape_vertices_iterator Alpha_shape_vertices_iterator; typedef typename AS::Alpha_shape_facets_iterator Alpha_shape_facets_iterator; @@ -1103,8 +1103,8 @@ std::ostream& operator<<(std::ostream& os, const Fixed_alpha_shape_3
    & A) int i0 = Triangulation_utils_3::vertex_triple_index(i,0); int i1 = Triangulation_utils_3::vertex_triple_index(i,1); int i2 = Triangulation_utils_3::vertex_triple_index(i,2); - os << V[c->vertex(i0)] << ' ' - << V[c->vertex(i1)] << ' ' + os << V[c->vertex(i0)] << ' ' + << V[c->vertex(i1)] << ' ' << V[c->vertex(i2)] << std::endl; } return os; diff --git a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h index b7b36840eb04..b50d9e4a3a35 100644 --- a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Sebastien Loriot // @@ -46,14 +46,14 @@ class Fixed_alpha_shape_cell_base_3 Classification_type status_; public: - - Fixed_alpha_shape_cell_base_3() + + Fixed_alpha_shape_cell_base_3() : Cb() {} - + Fixed_alpha_shape_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) : Cb(v0, v1, v2, v3) {} - + Fixed_alpha_shape_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, Cell_handle n0, Cell_handle n1, @@ -64,7 +64,7 @@ class Fixed_alpha_shape_cell_base_3 Classification_type get_facet_classification_type(int i) const {return facet_status[i];} void set_facet_classification_type(int i, Classification_type status) { facet_status[i]=status; } Classification_type get_classification_type() { return status_;} - void set_classification_type(Classification_type status) {status_=status;} + void set_classification_type(Classification_type status) {status_=status;} }; } //namespace CGAL diff --git a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_vertex_base_3.h b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_vertex_base_3.h index 4bdbe72c759a..731db54804b6 100644 --- a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_vertex_base_3.h +++ b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_vertex_base_3.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Sebastien Loriot // @@ -38,30 +38,30 @@ class Fixed_alpha_shape_vertex_base_3 }; typedef typename Vb::Point Point; - + private: - typedef internal::Classification_type Classification_type; + typedef internal::Classification_type Classification_type; Classification_type status_; bool is_on_chull_; public: - Fixed_alpha_shape_vertex_base_3() + Fixed_alpha_shape_vertex_base_3() : Vb(),is_on_chull_(false) {} - + Fixed_alpha_shape_vertex_base_3(const Point& p) : Vb(p),is_on_chull_(false) {} - + Fixed_alpha_shape_vertex_base_3(const Point& p, Cell_handle c) : Vb(p, c),is_on_chull_(false) {} Classification_type get_classification_type() { return status_;} void set_classification_type(Classification_type status) {status_=status;} - + void is_on_chull(bool b){is_on_chull_=b;}; bool is_on_chull(){return is_on_chull_;} - + }; } //namespace CGAL diff --git a/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h b/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h index 7364a1d76934..e1fd36c933ea 100644 --- a/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h +++ b/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h @@ -10,7 +10,7 @@ // Author(s) : Tran Kai Frank DA #ifndef CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H -#define CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H +#define CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H #include diff --git a/Alpha_shapes_3/include/CGAL/internal/Classification_type.h b/Alpha_shapes_3/include/CGAL/internal/Classification_type.h index 74471e313162..6e28f7f81948 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Classification_type.h +++ b/Alpha_shapes_3/include/CGAL/internal/Classification_type.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Sebastien Loriot // @@ -22,5 +22,5 @@ namespace CGAL{ namespace internal{ enum Classification_type {EXTERIOR,SINGULAR,REGULAR,INTERIOR}; } -} +} #endif //CGAL_INTERNAL_CLASSIFICATION_TYPE_H diff --git a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h index 4c23fbe94a80..c4384e9ccff3 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h @@ -76,7 +76,7 @@ struct Input_points_for_lazy_alpha_nt_3 const T* p3; }; -//non-weighted case +//non-weighted case template struct Types_for_alpha_nt_3 { @@ -87,12 +87,12 @@ struct Types_for_alpha_nt_3 typedef typename Kernel_approx::Point_3 Approx_point; typedef typename Kernel_exact::Point_3 Exact_point; typedef typename Input_traits::Point_3 Input_point; -//Constructions +//Constructions typedef typename Kernel_approx::Compute_squared_radius_3 Approx_squared_radius; typedef typename Kernel_exact::Compute_squared_radius_3 Exact_squared_radius; }; - - + + //weighted case template struct Types_for_alpha_nt_3< ::CGAL::Tag_true,Input_traits,Kernel_input,Kernel_approx,Kernel_exact> @@ -104,7 +104,7 @@ struct Types_for_alpha_nt_3< ::CGAL::Tag_true,Input_traits,Kernel_input,Kernel_a typedef typename Kernel_approx::Weighted_point_3 Approx_point; typedef typename Kernel_exact::Weighted_point_3 Exact_point; typedef typename Input_traits::Weighted_point_3 Input_point; -//Constructions +//Constructions typedef typename Kernel_approx::Compute_squared_radius_smallest_orthogonal_sphere_3 Approx_squared_radius; typedef typename Kernel_exact::Compute_squared_radius_smallest_orthogonal_sphere_3 Exact_squared_radius; }; @@ -120,17 +120,17 @@ class Lazy_alpha_nt_3{ typedef CGAL::Simple_cartesian Kernel_exact; typedef typename Kernel_traits::Kernel Kernel_input; -//Helper class for weighted and non-weighted case - typedef Types_for_alpha_nt_3 Types; - +//Helper class for weighted and non-weighted case + typedef Types_for_alpha_nt_3 Types; + //Converters typedef typename Types::To_approx To_approx; typedef typename Types::To_exact To_exact; - + //Constructions class typedef typename Types::Approx_squared_radius Approx_squared_radius; typedef typename Types::Exact_squared_radius Exact_squared_radius; - + //Point typedef typename Types::Approx_point Approx_point; typedef typename Types::Exact_point Exact_point; @@ -145,7 +145,7 @@ class Lazy_alpha_nt_3{ To_approx converter; return converter(wp); } - + Exact_point to_exact(const Input_point& wp) const { // The traits class' Point_3 must be convertible using the Cartesian converter @@ -156,7 +156,7 @@ class Lazy_alpha_nt_3{ return converter(wp); } -//members +//members //the members can be updated when calling method exact() mutable boost::optional exact_; mutable NT_approx approx_; @@ -208,7 +208,7 @@ class Lazy_alpha_nt_3{ CGAL_assertion(false); } } - + void set_approx(){ switch (data().nbpts){ case 1: @@ -225,7 +225,7 @@ class Lazy_alpha_nt_3{ break; default: CGAL_assertion(false); - } + } } const NT_exact& exact() const { @@ -239,7 +239,7 @@ class Lazy_alpha_nt_3{ const NT_approx& approx() const{ return approx_; } -//Constructors +//Constructors Lazy_alpha_nt_3() : exact_(Exact_nt(0)),approx_(0) { @@ -249,7 +249,7 @@ class Lazy_alpha_nt_3{ data().p2=nullptr; data().p3=nullptr; } - + Lazy_alpha_nt_3(double d) : exact_(Exact_nt(d)),approx_(d) { @@ -259,7 +259,7 @@ class Lazy_alpha_nt_3{ data().p2=nullptr; data().p3=nullptr; } - + Lazy_alpha_nt_3(const Input_point& wp1) { data().nbpts=1; @@ -305,7 +305,7 @@ class Lazy_alpha_nt_3{ data().p3=&wp4; set_approx(); } - + #define CGAL_LANT_COMPARE_FUNCTIONS(CMP) \ bool \ operator CMP (const Lazy_alpha_nt_3 &other) const \ @@ -324,7 +324,7 @@ class Lazy_alpha_nt_3{ CGAL_LANT_COMPARE_FUNCTIONS(==) CGAL_LANT_COMPARE_FUNCTIONS(!=) - #undef CGAL_LANT_COMPARE_FUNCTIONS + #undef CGAL_LANT_COMPARE_FUNCTIONS }; template @@ -332,7 +332,7 @@ std::ostream& operator<< (std::ostream& os,const Lazy_alpha_nt_3& a){ return os << ::CGAL::to_double(a.approx()); } - + //small class to select predicate in weighted and unweighted case template struct iCompute_squared_radius_3; @@ -359,22 +359,22 @@ struct iCompute_squared_radius_3 template struct Lazy_compute_squared_radius_3 { - Type_of_alpha operator() (const Point& p, - const Point& q , - const Point& r, + Type_of_alpha operator() (const Point& p, + const Point& q , + const Point& r, const Point& s) {return Type_of_alpha(p,q,r,s);} - Type_of_alpha operator() ( const Point& p, - const Point& q , + Type_of_alpha operator() ( const Point& p, + const Point& q , const Point& r) {return Type_of_alpha(p,q,r); } - Type_of_alpha operator() (const Point& p, + Type_of_alpha operator() (const Point& p, const Point& q ) {return Type_of_alpha(p,q); } - Type_of_alpha operator() (const Point& p) + Type_of_alpha operator() (const Point& p) {return Type_of_alpha(p);} }; @@ -396,7 +396,7 @@ struct Alpha_nt_selector_impl_3 typedef Lazy_compute_squared_radius_3 Functor; struct Compute_squared_radius_3{ template - Functor operator()(const As&){return Functor();} + Functor operator()(const As&){return Functor();} }; }; @@ -407,7 +407,7 @@ struct Alpha_nt_selector_impl_3 typedef Lazy_compute_squared_radius_3 Functor; struct Compute_squared_radius_3{ template - Functor operator()(const As&){return Functor();} + Functor operator()(const As&){return Functor();} }; }; diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt index 9350624cb635..98bae1eaab99 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp b/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp index 716d69e2f873..58d2e8d00af8 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp +++ b/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp @@ -48,7 +48,7 @@ template void fill_wp_lists(const char* file_path,std::list& Ls,double rw=0){ double x,y,z,r; std::ifstream input(file_path); - + while(input){ input >> x; if (!input) break; @@ -65,26 +65,26 @@ void make_one_run(const char* filename){ std::list lst; fill_wp_lists(filename,lst,1.4); CGAL::Timer time; - + //---Test weighted alpha shape //build regular triangulation time.start(); WFixed_DT T(lst.begin(),lst.end()); time.stop(); - std::cout << "Building regular triangulation: " << time.time() << std::endl;; + std::cout << "Building regular triangulation: " << time.time() << std::endl;; time.reset(); - + if (lst.size()!=T.number_of_vertices()) std::cout << lst.size()-T.number_of_vertices() << " hidden vertices.\n"; - + std::cout << "Build Fixed weighted alpha complex" << std::endl; time.start(); WFixed_AS wfixed_as(T); time.stop(); std::cout << "Fixed "<< time.time() << std::endl; - + time.reset(); - + //copy triangulation for family alpha-shape WDT T1; T1.set_infinite_vertex( T1.tds().copy_tds( wfixed_as.tds(), wfixed_as.infinite_vertex() ) ); @@ -99,15 +99,15 @@ void make_one_run(const char* filename){ //copy triangulation for family alpha-shape WDT_f T1f; T1f.set_infinite_vertex( T1f.tds().copy_tds(wfixed_as.tds(),wfixed_as.infinite_vertex()) ); - + std::cout << "Build family filtered weighted alpha complex" << std::endl; time.start(); WAS_f w_asf(T1f,0,WAS_f::GENERAL); time.stop(); std::cout << "Family filtered "<< time.time() << std::endl; - - - + + + time.reset(); std::list elst; @@ -123,15 +123,15 @@ void make_one_run(const char* filename){ EAS ase(edt,0,EAS::GENERAL); time.stop(); std::cout << "Family exact "<< time.time() << std::endl; - + } int main(int argc, char** argv){ if (argc==1){ std::cerr << "Nothing was tested\n"; return EXIT_SUCCESS; - } - + } + for (int i=1;i @@ -18,21 +18,21 @@ template -void +void count_faces(const AS &A, bool verbose) { typedef AS Alpha_shape_3; - - typedef typename AS::Alpha_shape_cells_iterator + + typedef typename AS::Alpha_shape_cells_iterator Alpha_shape_cells_iterator; - typedef typename AS::Alpha_shape_vertices_iterator + typedef typename AS::Alpha_shape_vertices_iterator Alpha_shape_vertices_iterator; - typedef typename AS::Alpha_shape_facets_iterator - Alpha_shape_facets_iterator; + typedef typename AS::Alpha_shape_facets_iterator + Alpha_shape_facets_iterator; typedef typename AS::size_type size_type; - + typedef typename AS::Cell_handle Cell_handle; typedef typename AS::Facet Facet; typedef typename AS::Edge Edge; @@ -48,31 +48,31 @@ count_faces(const AS &A, bool verbose) Cell_list exterior_cells; Cell_list interior_cells; - A.get_alpha_shape_cells( std::back_inserter(exterior_cells), - Alpha_shape_3::EXTERIOR); - A.get_alpha_shape_cells( std:: back_inserter(interior_cells), - Alpha_shape_3::INTERIOR); + A.get_alpha_shape_cells( std::back_inserter(exterior_cells), + Alpha_shape_3::EXTERIOR); + A.get_alpha_shape_cells( std:: back_inserter(interior_cells), + Alpha_shape_3::INTERIOR); assert(count_cells == interior_cells.size()); - assert(interior_cells.size() + exterior_cells.size() == - A.number_of_finite_cells()); + assert(interior_cells.size() + exterior_cells.size() == + A.number_of_finite_cells()); + - size_type count_facets = 0; Facet_list exterior_facets; Facet_list singular_facets; - Facet_list regular_facets; + Facet_list regular_facets; Facet_list interior_facets; Alpha_shape_facets_iterator face_iterator = A.alpha_shape_facets_begin(); - for (;face_iterator!=A.alpha_shape_facets_end();face_iterator++) + for (;face_iterator!=A.alpha_shape_facets_end();face_iterator++) count_facets++; - A.get_alpha_shape_facets(std::back_inserter(exterior_facets), - Alpha_shape_3::EXTERIOR); - A.get_alpha_shape_facets(std::back_inserter(singular_facets), - Alpha_shape_3::SINGULAR); - A.get_alpha_shape_facets(std::back_inserter(regular_facets), - Alpha_shape_3::REGULAR); - A.get_alpha_shape_facets(std::back_inserter(interior_facets), - Alpha_shape_3::INTERIOR); + A.get_alpha_shape_facets(std::back_inserter(exterior_facets), + Alpha_shape_3::EXTERIOR); + A.get_alpha_shape_facets(std::back_inserter(singular_facets), + Alpha_shape_3::SINGULAR); + A.get_alpha_shape_facets(std::back_inserter(regular_facets), + Alpha_shape_3::REGULAR); + A.get_alpha_shape_facets(std::back_inserter(interior_facets), + Alpha_shape_3::INTERIOR); size_type count_exterior_facets = exterior_facets.size(); size_type count_singular_facets = singular_facets.size(); size_type count_regular_facets = regular_facets.size(); @@ -80,64 +80,64 @@ count_faces(const AS &A, bool verbose) Edge_list exterior_edges; Edge_list singular_edges; - Edge_list regular_edges; + Edge_list regular_edges; Edge_list interior_edges; - A.get_alpha_shape_edges(std::back_inserter(exterior_edges), - Alpha_shape_3::EXTERIOR); - A.get_alpha_shape_edges(std::back_inserter(singular_edges), - Alpha_shape_3::SINGULAR); - A.get_alpha_shape_edges(std::back_inserter(regular_edges), - Alpha_shape_3::REGULAR); - A.get_alpha_shape_edges(std::back_inserter(interior_edges), - Alpha_shape_3::INTERIOR); + A.get_alpha_shape_edges(std::back_inserter(exterior_edges), + Alpha_shape_3::EXTERIOR); + A.get_alpha_shape_edges(std::back_inserter(singular_edges), + Alpha_shape_3::SINGULAR); + A.get_alpha_shape_edges(std::back_inserter(regular_edges), + Alpha_shape_3::REGULAR); + A.get_alpha_shape_edges(std::back_inserter(interior_edges), + Alpha_shape_3::INTERIOR); size_type count_exterior_edges = exterior_edges.size(); size_type count_singular_edges = singular_edges.size(); size_type count_regular_edges = regular_edges.size(); size_type count_interior_edges = interior_edges.size(); - - + + size_type count_vertices = 0; Alpha_shape_vertices_iterator vit=A.alpha_shape_vertices_begin(); for ( ; vit != A.alpha_shape_vertices_end() ; ++vit) ++count_vertices; Vertex_list exterior_vertices; Vertex_list singular_vertices; - Vertex_list regular_vertices; + Vertex_list regular_vertices; Vertex_list interior_vertices; - A.get_alpha_shape_vertices(std::back_inserter(exterior_vertices), - Alpha_shape_3::EXTERIOR); - A.get_alpha_shape_vertices(std::back_inserter(singular_vertices), - Alpha_shape_3::SINGULAR); - A.get_alpha_shape_vertices(std::back_inserter(regular_vertices), - Alpha_shape_3::REGULAR); - A.get_alpha_shape_vertices(std::back_inserter(interior_vertices), - Alpha_shape_3::INTERIOR); + A.get_alpha_shape_vertices(std::back_inserter(exterior_vertices), + Alpha_shape_3::EXTERIOR); + A.get_alpha_shape_vertices(std::back_inserter(singular_vertices), + Alpha_shape_3::SINGULAR); + A.get_alpha_shape_vertices(std::back_inserter(regular_vertices), + Alpha_shape_3::REGULAR); + A.get_alpha_shape_vertices(std::back_inserter(interior_vertices), + Alpha_shape_3::INTERIOR); size_type count_exterior_vertices = exterior_vertices.size(); size_type count_singular_vertices = singular_vertices.size(); size_type count_regular_vertices = regular_vertices.size(); size_type count_interior_vertices = interior_vertices.size(); - + if (verbose) { std::cerr << "facets " << "\t" << "\t" - << count_exterior_facets << "\t" - << count_singular_facets << "\t" - << count_regular_facets << "\t" - << count_interior_facets << "\t" - << count_facets << std::endl; + << count_exterior_facets << "\t" + << count_singular_facets << "\t" + << count_regular_facets << "\t" + << count_interior_facets << "\t" + << count_facets << std::endl; std::cerr << "edges " << "\t" << "\t" - << count_exterior_edges << "\t" - << count_singular_edges << "\t" - << count_regular_edges << "\t" - << count_interior_edges << std::endl; + << count_exterior_edges << "\t" + << count_singular_edges << "\t" + << count_regular_edges << "\t" + << count_interior_edges << std::endl; std::cerr << "vertices "<< "\t" - << count_exterior_vertices << "\t" - << count_singular_vertices << "\t" - << count_regular_vertices << "\t" - << count_interior_vertices << "\t" - << count_vertices << std::endl; + << count_exterior_vertices << "\t" + << count_singular_vertices << "\t" + << count_regular_vertices << "\t" + << count_interior_vertices << "\t" + << count_vertices << std::endl; std::cerr<< std::endl; } @@ -145,41 +145,41 @@ count_faces(const AS &A, bool verbose) if (A.get_mode() == Alpha_shape_3::REGULARIZED){ assert( count_facets == count_regular_facets ); assert (count_singular_facets == 0); - assert (count_exterior_facets - + count_regular_facets - + count_interior_facets == A.number_of_finite_facets()); + assert (count_exterior_facets + + count_regular_facets + + count_interior_facets == A.number_of_finite_facets()); - assert(count_singular_edges == 0); + assert(count_singular_edges == 0); assert( count_interior_edges - + count_regular_edges - + count_exterior_edges == A.number_of_finite_edges()); + + count_regular_edges + + count_exterior_edges == A.number_of_finite_edges()); assert(count_singular_vertices == 0); assert(count_vertices == count_regular_vertices ); - assert( count_interior_vertices - + count_regular_vertices - + count_singular_vertices - + count_exterior_vertices == A.number_of_vertices()); + assert( count_interior_vertices + + count_regular_vertices + + count_singular_vertices + + count_exterior_vertices == A.number_of_vertices()); } if( A.get_mode() == Alpha_shape_3::GENERAL) { assert( count_facets == count_regular_facets + count_singular_facets); - assert ( count_exterior_facets - + count_singular_facets - + count_regular_facets - + count_interior_facets == A.number_of_finite_facets()); + assert ( count_exterior_facets + + count_singular_facets + + count_regular_facets + + count_interior_facets == A.number_of_finite_facets()); assert( count_interior_edges - + count_regular_edges - + count_singular_edges - + count_exterior_edges == A.number_of_finite_edges()); + + count_regular_edges + + count_singular_edges + + count_exterior_edges == A.number_of_finite_edges()); assert( count_vertices == count_regular_vertices - + count_singular_vertices); + + count_singular_vertices); assert( count_exterior_vertices - + count_regular_vertices - + count_singular_vertices - + count_interior_vertices == A.number_of_vertices()); + + count_regular_vertices + + count_singular_vertices + + count_interior_vertices == A.number_of_vertices()); } if (count_cells >= 1 && A.get_mode()== Alpha_shape_3::REGULARIZED) { @@ -196,7 +196,7 @@ template void show_alpha_status(AS&, const typename AS::Alpha_status&); template -void +void test_filtration(AS &A, bool verbose) { typename std::list filtration; @@ -206,7 +206,7 @@ test_filtration(AS &A, bool verbose) typename AS::size_type count_edges = 0; typename AS::size_type count_facets = 0; typename AS::size_type count_cells = 0; - + typename std::list::iterator filtre_it = filtration.begin(); @@ -222,45 +222,45 @@ test_filtration(AS &A, bool verbose) } for (; filtre_it != filtration.end(); filtre_it++) { if(assign(vertex, *filtre_it)) { - as = *(vertex->get_alpha_status()); - if(verbose) std::cerr << "Vertex" << "\t"; - if(verbose)show_alpha_status(A,as); - count_vertices++; + as = *(vertex->get_alpha_status()); + if(verbose) std::cerr << "Vertex" << "\t"; + if(verbose)show_alpha_status(A,as); + count_vertices++; } if(assign(edge, *filtre_it)) { - // could be done with Edge_alpha_map in GENERAL mode - A.compute_edge_status(edge.first,edge.second,edge.third, as); - if(verbose) std::cerr << "Edge" << "\t"; - if(verbose) show_alpha_status(A,as); - count_edges++; + // could be done with Edge_alpha_map in GENERAL mode + A.compute_edge_status(edge.first,edge.second,edge.third, as); + if(verbose) std::cerr << "Edge" << "\t"; + if(verbose) show_alpha_status(A,as); + count_edges++; } if(assign(facet, *filtre_it)) { - as = *(facet.first->get_facet_status(facet.second)); - if(verbose) std::cerr << "Facet" << "\t"; - if(verbose) show_alpha_status(A,as); - count_facets++; + as = *(facet.first->get_facet_status(facet.second)); + if(verbose) std::cerr << "Facet" << "\t"; + if(verbose) show_alpha_status(A,as); + count_facets++; } if(assign(cell, *filtre_it)) { - alpha = cell->get_alpha(); - if(verbose) std::cerr << "Cell" << "\t"; - if(verbose) std::cerr << alpha << std::endl; - count_cells++; + alpha = cell->get_alpha(); + if(verbose) std::cerr << "Cell" << "\t"; + if(verbose) std::cerr << alpha << std::endl; + count_cells++; } } if(verbose) { std::cerr << "vertices \t" << count_vertices << "\t" - << A.number_of_vertices() << std::endl; + << A.number_of_vertices() << std::endl; std::cerr << "edges \t" << count_edges << "\t" - << A.number_of_finite_edges() << std::endl; + << A.number_of_finite_edges() << std::endl; std::cerr << "facets \t" << count_facets << "\t" - << A.number_of_finite_facets() << std::endl; + << A.number_of_finite_facets() << std::endl; std::cerr << "cellss \t" << count_cells << "\t" - << A.number_of_finite_cells() << std::endl; + << A.number_of_finite_cells() << std::endl; } assert(count_vertices == A.number_of_vertices()); assert(count_edges == A.number_of_finite_edges()); assert(count_facets == A.number_of_finite_facets()); - assert(count_cells == A.number_of_finite_cells()); + assert(count_cells == A.number_of_finite_cells()); filtration.clear(); std::list alpha_values; @@ -271,7 +271,7 @@ test_filtration(AS &A, bool verbose) std::back_inserter(alpha_values) ) ); - + assert( filtration.size() == alpha_values.size() ); typename std::list::iterator av_it=alpha_values.begin(); typename AS::FT previous_alpha_value=*av_it++; @@ -287,21 +287,21 @@ template void show_triangulation(AS& A) { - std::cerr << "number of finite cells " << A.number_of_finite_cells() - << std::endl; - std::cerr << "number of finite faces " << A.number_of_finite_facets() - << std::endl; - std::cerr << "number of finite edges " << A.number_of_finite_edges() - << std::endl; + std::cerr << "number of finite cells " << A.number_of_finite_cells() + << std::endl; + std::cerr << "number of finite faces " << A.number_of_finite_facets() + << std::endl; + std::cerr << "number of finite edges " << A.number_of_finite_edges() + << std::endl; typedef typename AS::Finite_cells_iterator Finite_cells_iterator; for ( Finite_cells_iterator cit = A.finite_cells_begin(); - cit != A.finite_cells_end(); ++cit) { + cit != A.finite_cells_end(); ++cit) { std::cerr << "cell " << "alpha " << cit->get_alpha() << std::endl; std::cerr << cit->vertex(0)->point() << std::endl - << cit->vertex(1)->point() << std::endl - << cit->vertex(2)->point() << std::endl - << cit->vertex(3)->point() << std::endl; + << cit->vertex(1)->point() << std::endl + << cit->vertex(2)->point() << std::endl + << cit->vertex(3)->point() << std::endl; } } @@ -331,6 +331,6 @@ void show_alpha_status(AS& A, const typename AS::Alpha_status& as) else std::cerr << as.alpha_max() << std::endl; return; } - + #endif // CGAL_COUNT_ALPHA_H diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h index d9b8ee0bb0e1..dc01d1e9392d 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h +++ b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h @@ -3,11 +3,11 @@ // // This file is part of CGAL (www.cgal.org). // -// $URL$ +// $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // $Date$ -// +// // // Author(s) : Mariette Yvinec @@ -50,7 +50,7 @@ _test_cls_alpha_shape_3() std::list L; bool verbose = false; - + // first a known small case // a cube with one corner less and two small pyramids // on back and front face @@ -64,14 +64,14 @@ _test_cls_alpha_shape_3() L.push_back(Point(1.,-1.5 ,1.)); L.push_back(Point(1.,3.5 ,1.)); - + Alpha_shape_3 a1( L.begin(), L.end(), 0, Alpha_shape_3::REGULARIZED); if(verbose) show_triangulation(a1); assert(a1.number_of_alphas() == 3 ); std::cout << "REGULARIZED mode" << std::endl; - std::cout << "test_classify_and_iterators" - << std::endl; + std::cout << "test_classify_and_iterators" + << std::endl; Alpha_iterator alpha_it = a1.alpha_begin(); for (;alpha_it != a1.alpha_end();alpha_it++){ a1.set_alpha(*alpha_it); @@ -96,9 +96,9 @@ _test_cls_alpha_shape_3() if(verbose) a1.print_maps(); if(verbose) a1.print_alphas(); assert(a1.number_of_alphas() == 9) ; - std::cout << "test_classify_and_iterators" - << std::endl; - + std::cout << "test_classify_and_iterators" + << std::endl; + for(alpha_it = a1.alpha_begin();alpha_it!=a1.alpha_end();alpha_it++){ a1.set_alpha(*alpha_it); if (verbose) { @@ -125,7 +125,7 @@ _test_cls_alpha_shape_3() a1.set_mode(Alpha_shape_3::REGULARIZED); std::cout << "REGULARIZED mode" << std::endl; std::cout << "test number_of_components - find_optimal_alpha " - << std::endl; + << std::endl; if (verbose) { std::cerr << std::endl; std::cerr << "REGULARIZED mode" << std::endl; @@ -133,9 +133,9 @@ _test_cls_alpha_shape_3() a1.print_alphas(); for(alpha_it = a1.alpha_begin();alpha_it!=a1.alpha_end();alpha_it++) - std::cerr << "alpha " << *alpha_it << "\t" - << "number of solid componenst " - << a1.number_of_solid_components(*alpha_it) << std::endl; + std::cerr << "alpha " << *alpha_it << "\t" + << "number of solid componenst " + << a1.number_of_solid_components(*alpha_it) << std::endl; } // alpha 2.00694 number of solid components 2 @@ -159,7 +159,7 @@ _test_cls_alpha_shape_3() if(verbose) a2.print_maps(); if(verbose) a2.print_alphas(); assert(a2.number_of_alphas() == 3) ; - + Triangulation dt3( L.begin(), L.end()); Alpha_shape_3 a3(dt3, 0, Alpha_shape_3::GENERAL); assert(a3.number_of_alphas() == 9) ; @@ -193,11 +193,11 @@ _test_cls_alpha_shape_3() Alpha_iterator previous = opt; --previous; if(verbose) { std::cerr << " optimal de 1 " << *opt - << "nb of componants " << a1.number_of_solid_components(*opt) - << std::endl; - std::cerr << " previous " << *previous - << "nb of componants " - << a1.number_of_solid_components(*previous) << std::endl; + << "nb of componants " << a1.number_of_solid_components(*opt) + << std::endl; + std::cerr << " previous " << *previous + << "nb of componants " + << a1.number_of_solid_components(*previous) << std::endl; } assert (a1.number_of_solid_components(*opt) == 1); assert (a1.number_of_solid_components(*previous) > 1); diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h index 320f57e22422..c8a099743c5b 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h +++ b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h @@ -3,11 +3,11 @@ // // This file is part of CGAL (www.cgal.org). // -// $URL$ +// $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // $Date$ -// +// // // Author(s) : Mariette Yvinec @@ -50,7 +50,7 @@ _test_weighted_alpha_shape_3() std::list L; bool verbose = false; - + // first a known small case // four groups of sphere : // - two groups of 4 intersecting spheres @@ -74,8 +74,8 @@ _test_weighted_alpha_shape_3() L.push_back(Weighted_point(Bare_point(30.,0.,0.), 3)); L.push_back(Weighted_point(Bare_point(32.,0.,0.), 3)); - - + + Alpha_shape_3 A( L.begin(), L.end(), 0, Alpha_shape_3::REGULARIZED); if(verbose) show_alpha_values(A); A.set_alpha(0.); @@ -97,12 +97,12 @@ _test_weighted_alpha_shape_3() count_faces(A, verbose); test_filtration(A,verbose); - // I add a test for CH4 + // I add a test for CH4 // This test detected a bug in make_alpha_shape() cominig from clear() if(verbose) std::cerr << "test for CH4" << std::endl; L.clear(); L.push_back(Weighted_point(Bare_point(-1.,-1.,-1.), 1.)); - L.push_back(Weighted_point(Bare_point(-1., 1., 1.), 1.)); + L.push_back(Weighted_point(Bare_point(-1., 1., 1.), 1.)); L.push_back(Weighted_point(Bare_point( 1.,-1., 1.), 1.)); L.push_back(Weighted_point(Bare_point( 1., 1.,-1.), 1.)); L.push_back(Weighted_point(Bare_point( 0., 0., 0.), 3.)); @@ -134,7 +134,7 @@ _test_weighted_alpha_shape_3() std::size_t n = A.make_alpha_shape(L.begin(), L.end()); std::cout << "Alpha Shape computed :" << n << " points" << std::endl; std::cout << " test number_of_components - find_optimal_alpha " - << std::endl; + << std::endl; A.set_alpha(*A.find_optimal_alpha(2)); assert( A.number_of_solid_components() <= 2); @@ -142,16 +142,16 @@ _test_weighted_alpha_shape_3() Alpha_iterator previous = opt; --previous; if(verbose) { std::cerr << " alpha optimal for 1 component = " << *opt - << "nb of components " << A.number_of_solid_components(*opt) - << std::endl; - std::cerr << " previous " << *previous - << "nb of components " - << A.number_of_solid_components(*previous) << std::endl; + << "nb of components " << A.number_of_solid_components(*opt) + << std::endl; + std::cerr << " previous " << *previous + << "nb of components " + << A.number_of_solid_components(*previous) << std::endl; std::cerr << "alpha_solid " << A.find_alpha_solid() << std::endl; } assert (A.number_of_solid_components(*opt) == 1); - assert (A.number_of_solid_components(*previous) > 1 - || *opt == A.find_alpha_solid()); + assert (A.number_of_solid_components(*previous) > 1 + || *opt == A.find_alpha_solid()); } diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp b/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp index 26146781e4ce..13eae6a422c1 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp +++ b/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp @@ -51,7 +51,7 @@ void fill_lists(const char* file_path, { double x,y,z,r; std::ifstream input(file_path); - + while(input >> x >> y >> z >> r){ Point_3 p(x,y,z); lst.push_back(p); @@ -114,16 +114,16 @@ void print_simplices_classif_fe(Iterator begin,Iterator end, const Alpha_shape_3 template void print_comparison(const AS1& as1, const AS2& as2){ std::cout << "Cells\n"; - print_simplices_classif(as1.finite_cells_begin(),as1.finite_cells_end(),as1); + print_simplices_classif(as1.finite_cells_begin(),as1.finite_cells_end(),as1); print_simplices_classif(as2.finite_cells_begin(),as2.finite_cells_end(),as2); std::cout << "Facets\n"; - print_simplices_classif_fe(as1.finite_facets_begin(),as1.finite_facets_end(),as1); + print_simplices_classif_fe(as1.finite_facets_begin(),as1.finite_facets_end(),as1); print_simplices_classif_fe(as2.finite_facets_begin(),as2.finite_facets_end(),as2); std::cout << "Edges\n"; - print_simplices_classif_fe(as1.finite_edges_begin(),as1.finite_edges_end(),as1); + print_simplices_classif_fe(as1.finite_edges_begin(),as1.finite_edges_end(),as1); print_simplices_classif_fe(as2.finite_edges_begin(),as2.finite_edges_end(),as2); std::cout << "Vertices\n"; - print_simplices_classif(as1.finite_vertices_begin(),as1.finite_vertices_end(),as1); + print_simplices_classif(as1.finite_vertices_begin(),as1.finite_vertices_end(),as1); print_simplices_classif(as2.finite_vertices_begin(),as2.finite_vertices_end(),as2); } @@ -186,29 +186,29 @@ void compare_edges_classif(Iterator1 begin1, Iterator1 end1,const AS1& as1,Itera template void compare_all(const AS1& as1, const AS2& as2,bool debug=false) { - compare_classif(as1.finite_cells_begin(),as1.finite_cells_end(),as1,as2.finite_cells_begin(),as2,"Cells",debug); + compare_classif(as1.finite_cells_begin(),as1.finite_cells_end(),as1,as2.finite_cells_begin(),as2,"Cells",debug); compare_facets_classif(as1.finite_cells_begin(),as1.finite_cells_end(),as1,as2.finite_cells_begin(),as2,"Facets",debug); compare_edges_classif(as1.finite_cells_begin(),as1.finite_cells_end(),as1,as2.finite_cells_begin(),as2,"Edges",debug); - compare_classif(as1.finite_vertices_begin(),as1.finite_vertices_end(),as1,as2.finite_vertices_begin(),as2,"Vertices",debug); + compare_classif(as1.finite_vertices_begin(),as1.finite_vertices_end(),as1,as2.finite_vertices_begin(),as2,"Vertices",debug); } - + void test_dynamic_insert(const std::list& wlst) { typedef std::list::const_iterator Iterator; Iterator min_it=wlst.begin(); WFixed_AS dynamic_as; - + while(min_it!=wlst.end() && dynamic_as.dimension() != 3) { dynamic_as.insert(*min_it); ++min_it; } -// int k=0; +// int k=0; for (Iterator it=min_it ;it!=wlst.end(); ++it) { -// std::cout << ++k << " " << std::flush; +// std::cout << ++k << " " << std::flush; dynamic_as.insert(*it); - WFixed_DT tr_copy; + WFixed_DT tr_copy; tr_copy.set_infinite_vertex( tr_copy.tds().copy_tds( dynamic_as.tds(), dynamic_as.infinite_vertex() ) ); WFixed_AS static_as (tr_copy); compare_all(dynamic_as,static_as); @@ -219,7 +219,7 @@ void test_dynamic_insert(const std::list& wlst) void test_dynamic_remove(const std::list& wlst) { WFixed_AS dynamic_as(wlst.begin(),wlst.end()); - + // int k=0; while (dynamic_as.dimension() == 3) { @@ -231,7 +231,7 @@ void test_dynamic_remove(const std::list& wlst) dynamic_as.remove(dynamic_as.finite_vertices_begin()); } std::cout << "done"<< std::endl; - + while (dynamic_as.number_of_vertices() != 0) dynamic_as.remove(dynamic_as.finite_vertices_begin()); } @@ -248,24 +248,24 @@ void make_one_run(const char* filename){ WFixed_DT T(wlst.begin(),wlst.end()); if (wlst.size()!=T.number_of_vertices()) std::cout << wlst.size()-T.number_of_vertices() << " hidden vertices.\n"; - + std::cout << "Build Fixed weighted alpha complex" << std::endl; WFixed_AS wfixed_as(T); - + //copy triangulation for family alpha-shape WDT T1; T1.set_infinite_vertex( T1.tds().copy_tds( wfixed_as.tds(),wfixed_as.infinite_vertex() ) ); std::cout << "Build family weighted alpha complex" << std::endl; WAS w_as(T1,0,WAS::GENERAL); - + //DEBUG info // print_comparison(wfixed_as,w_as); - + //compare classification of simplices std::cout << "Compare both.... "; - compare_all(wfixed_as,w_as); + compare_all(wfixed_as,w_as); std::cout << "OK\n"; //---Test alpha shape @@ -276,11 +276,11 @@ void make_one_run(const char* filename){ std::cout << "Build Fixed alpha complex" << std::endl; Fixed_AS fixed_as(delaunay0); std::cout << "Build family alpha complex" << std::endl; - AS as(delaunay1,0,AS::GENERAL); + AS as(delaunay1,0,AS::GENERAL); std::cout << "Compare both.... "; compare_all(fixed_as,as); std::cout << "OK\n"; - + //test dynamic version std::cout << "Test dynamic remove \n"; test_dynamic_remove(wlst); @@ -293,8 +293,8 @@ int main(int argc, char** argv){ if (argc==1){ std::cerr << "Nothing was tested\n"; return EXIT_SUCCESS; - } - + } + for (int i=1;i " - << "[bit size of weights] [seed]" << std::endl; + << " " + << "[bit size of weights] [seed]" << std::endl; return 2; } diff --git a/Apollonius_graph_2/archive/generators/gen_integral_sites_on_parabola.cpp b/Apollonius_graph_2/archive/generators/gen_integral_sites_on_parabola.cpp index 648d403d9ee2..e79e61825076 100644 --- a/Apollonius_graph_2/archive/generators/gen_integral_sites_on_parabola.cpp +++ b/Apollonius_graph_2/archive/generators/gen_integral_sites_on_parabola.cpp @@ -16,8 +16,8 @@ typedef CGAL::Random Random; int usage (int argc, char *argv[]) { std::cerr << "usage: " << argv[0] - << " " - << "[bit size of perturbation] [seed]" << std::endl; + << " " + << "[bit size of perturbation] [seed]" << std::endl; return 2; } diff --git a/Apollonius_graph_2/archive/generators/gen_sites_in_0x1_box.cpp b/Apollonius_graph_2/archive/generators/gen_sites_in_0x1_box.cpp index 2d3c01c5b42a..72216777c562 100644 --- a/Apollonius_graph_2/archive/generators/gen_sites_in_0x1_box.cpp +++ b/Apollonius_graph_2/archive/generators/gen_sites_in_0x1_box.cpp @@ -14,7 +14,7 @@ typedef CGAL::Apollonius_site_2 Site_2; int usage (int argc, char **argv) { std::cerr << "usage: " << argv[0] - << " [seed]" << std::endl; + << " [seed]" << std::endl; return 2; } diff --git a/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/make_degenerate.h b/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/make_degenerate.h index 5ff9bae703d1..54e2198b1fae 100644 --- a/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/make_degenerate.h +++ b/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/make_degenerate.h @@ -9,9 +9,9 @@ namespace CGAL { template OutputIterator make_degenerate(InputIterator first, - InputIterator beyond, - OutputIterator oit, - const Traits& tr = Traits()) + InputIterator beyond, + OutputIterator oit, + const Traits& tr = Traits()) { typedef CGAL::Apollonius_graph_hierarchy_2 Apollonius_graph; @@ -19,7 +19,7 @@ make_degenerate(InputIterator first, typedef typename Apollonius_graph::Finite_faces_iterator Finite_faces_iterator; - + Apollonius_graph ag; Site_2 site; diff --git a/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_on_parabola_2.h b/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_on_parabola_2.h index 369317b997eb..357d33f01f1d 100644 --- a/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_on_parabola_2.h +++ b/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_on_parabola_2.h @@ -28,7 +28,7 @@ class Random_integral_sites_on_parabola_2 } Random_integral_sites_on_parabola_2(unsigned int b, unsigned int p, - int seed) + int seed) : b_(b), p_(p), r_(seed) { CGAL_precondition( b >= 0 && b <= 26 ); CGAL_precondition( p >= 0 && p <= 26 ); diff --git a/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_sites_in_0x1_box.h b/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_sites_in_0x1_box.h index 316e338ffa89..6941db05a0c7 100644 --- a/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_sites_in_0x1_box.h +++ b/Apollonius_graph_2/archive/generators/include/CGAL/Apollonius_graph_2/random_sites_in_0x1_box.h @@ -15,7 +15,7 @@ class Random_sites_in_0x1_box private: typedef typename Site_2::Point_2 Point_2; - + public: Random_sites_in_0x1_box(double rmax = 0.125, int seed = 0) : rmax_(rmax), random_(seed) {} diff --git a/Apollonius_graph_2/archive/generators/include/CGAL/random_integer.h b/Apollonius_graph_2/archive/generators/include/CGAL/random_integer.h index 7b2a51e62cc5..f7c29dee82f1 100644 --- a/Apollonius_graph_2/archive/generators/include/CGAL/random_integer.h +++ b/Apollonius_graph_2/archive/generators/include/CGAL/random_integer.h @@ -17,18 +17,18 @@ namespace CGAL { // powers of 2 from 2^0 to 2^53 double P2[54]={1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, - 512.0, 1024.0, 2048.0, 4096.0, 8192.0, 16384.0, 32768.0, - 65536.0, 131072.0, 262144.0, 524288.0, 1048576.0, - 2097152.0, 4194304.0, 8388608.0, 16777216.0, 33554432.0, - 67108864.0, 134217728.0, 268435456.0, 536870912.0, - 1073741824.0, 2147483648.0, 4294967296.0, 8589934592.0, - 17179869184.0, 34359738368.0, 68719476736.0, - 137438953472.0, 274877906944.0, 549755813888.0, - 1099511627776.0, 2199023255552.0, 4398046511104.0, - 8796093022208.0, 17592186044416.0, 35184372088832.0, - 70368744177664.0, 140737488355328.0, 281474976710656.0, - 562949953421312.0, 1125899906842624.0, 2251799813685248.0, - 4503599627370496.0, 9007199254740992.0}; + 512.0, 1024.0, 2048.0, 4096.0, 8192.0, 16384.0, 32768.0, + 65536.0, 131072.0, 262144.0, 524288.0, 1048576.0, + 2097152.0, 4194304.0, 8388608.0, 16777216.0, 33554432.0, + 67108864.0, 134217728.0, 268435456.0, 536870912.0, + 1073741824.0, 2147483648.0, 4294967296.0, 8589934592.0, + 17179869184.0, 34359738368.0, 68719476736.0, + 137438953472.0, 274877906944.0, 549755813888.0, + 1099511627776.0, 2199023255552.0, 4398046511104.0, + 8796093022208.0, 17592186044416.0, 35184372088832.0, + 70368744177664.0, 140737488355328.0, 281474976710656.0, + 562949953421312.0, 1125899906842624.0, 2251799813685248.0, + 4503599627370496.0, 9007199254740992.0}; // set the random number generator seed void set_seed(unsigned int seed) @@ -78,7 +78,7 @@ double random_integer(Random& r, unsigned int b, bool allow_negative = true) template double random_even_integer(Random& r, unsigned int b, - bool allow_negative = true) + bool allow_negative = true) { // returns random even integers in the range [0, 2^b - 1). // b is required to be at least 1 and at most 52 diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h index a3041c8e792d..c221d5fdd524 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -43,11 +43,11 @@ namespace CGAL { //----------------------------------------------------------------------- template, - class EK_MTag = CK_MTag, - class FK_t = Simple_cartesian< Interval_nt >, - class FK_MTag = CK_MTag, + class CK_MTag = Integral_domain_without_division_tag, + class EK_t = Simple_cartesian< MP_Float >, + class EK_MTag = CK_MTag, + class FK_t = Simple_cartesian< Interval_nt >, + class FK_MTag = CK_MTag, class C2E_t = Cartesian_converter, class C2F_t = Cartesian_converter > > @@ -193,15 +193,15 @@ class Apollonius_graph_mixed_filtered_traits_2 // changes in the spec/concept); see also changes needed for the // filtered construction above. typedef Filtered_construction + EK_Construct_Apollonius_vertex_2, + FK_Construct_Apollonius_vertex_2, + C2E, C2F, E2C, F2C> Construct_Apollonius_vertex_2; typedef Filtered_construction + EK_Construct_Apollonius_site_2, + FK_Construct_Apollonius_site_2, + C2E, C2F, E2C, F2C> Construct_Apollonius_site_2; #else typedef typename CK_traits::Construct_Apollonius_vertex_2 @@ -288,27 +288,27 @@ class Apollonius_graph_mixed_filtered_traits_2 typedef Filtered_predicate + FK_Oriented_side_of_bisector_2, C2E, C2F> Oriented_side_of_bisector_2; typedef Filtered_predicate + FK_Vertex_conflict_2, C2E, C2F> Vertex_conflict_2; typedef Filtered_predicate + FK_Finite_edge_interior_conflict_2, C2E, C2F> Finite_edge_interior_conflict_2; typedef Filtered_predicate + FK_Infinite_edge_interior_conflict_2, C2E, C2F> Infinite_edge_interior_conflict_2; typedef Filtered_predicate + FK_Is_degenerate_edge_2, C2E, C2F> Is_degenerate_edge_2; public: @@ -323,7 +323,7 @@ class Apollonius_graph_mixed_filtered_traits_2 } Construct_object_2 - construct_object_2_object() const { + construct_object_2_object() const { return Construct_object_2(); } @@ -331,7 +331,7 @@ class Apollonius_graph_mixed_filtered_traits_2 // CONSTRUCTIONS //-------------- Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { + construct_Apollonius_vertex_2_object() const { return Construct_Apollonius_vertex_2(); } diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h index 90361a363295..08f0ce667202 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -40,7 +40,7 @@ class Apollonius_graph_mixed_traits_2 // BASIC TYPES //------------ -private: +private: typedef Apollonius_graph_new_traits_2 Self; typedef @@ -94,7 +94,7 @@ class Apollonius_graph_mixed_traits_2 typedef CGAL_APOLLONIUS_GRAPH_2_NS::Is_hidden_2 Is_hidden_2; - typedef CGAL_APOLLONIUS_GRAPH_2_NS::Oriented_side_of_bisector_2 + typedef CGAL_APOLLONIUS_GRAPH_2_NS::Oriented_side_of_bisector_2 /* */ Oriented_side_of_bisector_2; typedef CGAL_APOLLONIUS_GRAPH_2_NS::Vertex_conflict_new_2 @@ -124,7 +124,7 @@ class Apollonius_graph_mixed_traits_2 } Construct_object_2 - construct_object_2_object() const { + construct_object_2_object() const { return Construct_object_2(); } @@ -132,7 +132,7 @@ class Apollonius_graph_mixed_traits_2 // CONSTRUCTIONS //-------------- Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { + construct_Apollonius_vertex_2_object() const { return Construct_Apollonius_vertex_2(); } diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h index ba5b864d708d..b6fc3246cf32 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -43,11 +43,11 @@ namespace CGAL { //----------------------------------------------------------------------- template, - class EK_MTag = CK_MTag, - class FK_t = Simple_cartesian< Interval_nt >, - class FK_MTag = CK_MTag, + class CK_MTag = Integral_domain_without_division_tag, + class EK_t = Simple_cartesian< MP_Float >, + class EK_MTag = CK_MTag, + class FK_t = Simple_cartesian< Interval_nt >, + class FK_MTag = CK_MTag, class C2E_t = Cartesian_converter, class C2F_t = Cartesian_converter > > @@ -193,15 +193,15 @@ class Apollonius_graph_new_filtered_traits_2 // changes in the spec/concept); see also changes needed for the // filtered construction above. typedef Filtered_construction + EK_Construct_Apollonius_vertex_2, + FK_Construct_Apollonius_vertex_2, + C2E, C2F, E2C, F2C> Construct_Apollonius_vertex_2; typedef Filtered_construction + EK_Construct_Apollonius_site_2, + FK_Construct_Apollonius_site_2, + C2E, C2F, E2C, F2C> Construct_Apollonius_site_2; #else typedef typename CK_traits::Construct_Apollonius_vertex_2 @@ -274,7 +274,7 @@ class Apollonius_graph_new_filtered_traits_2 typedef Filtered_predicate + C2E, C2F> Compare_weight_2; typedef @@ -291,27 +291,27 @@ class Apollonius_graph_new_filtered_traits_2 typedef Filtered_predicate + FK_Oriented_side_of_bisector_2, C2E, C2F> Oriented_side_of_bisector_2; typedef Filtered_predicate + FK_Vertex_conflict_2, C2E, C2F> Vertex_conflict_2; typedef Filtered_predicate + FK_Finite_edge_interior_conflict_2, C2E, C2F> Finite_edge_interior_conflict_2; typedef Filtered_predicate + FK_Infinite_edge_interior_conflict_2, C2E, C2F> Infinite_edge_interior_conflict_2; typedef Filtered_predicate + FK_Is_degenerate_edge_2, C2E, C2F> Is_degenerate_edge_2; public: @@ -326,7 +326,7 @@ class Apollonius_graph_new_filtered_traits_2 } Construct_object_2 - construct_object_2_object() const { + construct_object_2_object() const { return Construct_object_2(); } @@ -334,7 +334,7 @@ class Apollonius_graph_new_filtered_traits_2 // CONSTRUCTIONS //-------------- Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { + construct_Apollonius_vertex_2_object() const { return Construct_Apollonius_vertex_2(); } diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h index 8a86ea3926ac..f3e33e91f098 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -40,7 +40,7 @@ class Apollonius_graph_new_traits_2 // BASIC TYPES //------------ -private: +private: typedef Apollonius_graph_new_traits_2 Self; typedef @@ -97,7 +97,7 @@ class Apollonius_graph_new_traits_2 typedef CGAL_APOLLONIUS_GRAPH_2_NS::Is_hidden_2 Is_hidden_2; - typedef CGAL_APOLLONIUS_GRAPH_2_NS::Oriented_side_of_bisector_2 + typedef CGAL_APOLLONIUS_GRAPH_2_NS::Oriented_side_of_bisector_2 /* */ Oriented_side_of_bisector_2; typedef CGAL_APOLLONIUS_GRAPH_2_NS::Vertex_conflict_new_2 @@ -127,7 +127,7 @@ class Apollonius_graph_new_traits_2 } Construct_object_2 - construct_object_2_object() const { + construct_object_2_object() const { return Construct_object_2(); } @@ -135,7 +135,7 @@ class Apollonius_graph_new_traits_2 // CONSTRUCTIONS //-------------- Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { + construct_Apollonius_vertex_2_object() const { return Construct_Apollonius_vertex_2(); } diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h index 4cb1c1b251af..4fba67aa2b22 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -30,19 +30,19 @@ class Conflict_2 { public: typedef Inverted_weighted_point_2 Inverted_weighted_point; - typedef typename K::RT RT; + typedef typename K::RT RT; typedef typename K::Sign Sign; typedef Sign result_type; protected: - Sign orientation(const Inverted_weighted_point &p1, + Sign orientation(const Inverted_weighted_point &p1, const Inverted_weighted_point &p2, const Inverted_weighted_point &p3) const { return sign_of_determinant( p1.p(), p2.p(), p3.p(), - p1.x(), p2.x(), p3.x(), - p1.y(), p2.y(), p3.y() ); + p1.x(), p2.x(), p3.x(), + p1.y(), p2.y(), p3.y() ); } Sign radical_intersection(const Inverted_weighted_point &p1, @@ -50,7 +50,7 @@ class Conflict_2 const Inverted_weighted_point &p3, int i) const { Sign s = CGAL::sign( - CGAL::square(determinant( + CGAL::square(determinant( p1.p(), p1.weight(), p1.y(), p2.p(), p2.weight(), p2.y(), p3.p(), p3.weight(), p3.y())) @@ -74,7 +74,7 @@ class Conflict_2 CGAL_error_msg( "Case should not hapen"); return ZERO; } - } + } Sign radical_side(const Inverted_weighted_point &p1, const Inverted_weighted_point &p2, @@ -84,8 +84,8 @@ class Conflict_2 Sign s = -CGAL::sign( determinant( - p1.p(), p1.x(), - p2.p(), p2.x()) + p1.p(), p1.x(), + p2.p(), p2.x()) * determinant( p1.p(), p1.weight(), p1.x(), p2.p(), p2.weight(), p2.x(), @@ -105,35 +105,35 @@ class Conflict_2 } Sign power_test(const Inverted_weighted_point &p1, - const Inverted_weighted_point &p2, - const Inverted_weighted_point &p3, int i) const + const Inverted_weighted_point &p2, + const Inverted_weighted_point &p3, int i) const { CGAL_assertion(i == -1 || i == 1 || i == 2 || i == 3); Sign s; - Sign s_xTest = sign_of_determinant(p2.p(), p2.x(), p1.p(), p1.x()); - if ( s_xTest != ZERO ) { - s = s_xTest * - sign_of_determinant( p1.p(), p1.x(), p1.weight(), - p2.p(), p2.x(), p2.weight(), - p3.p(), p3.x(), p3.weight() ); - } else { + Sign s_xTest = sign_of_determinant(p2.p(), p2.x(), p1.p(), p1.x()); + if ( s_xTest != ZERO ) { + s = s_xTest * + sign_of_determinant( p1.p(), p1.x(), p1.weight(), + p2.p(), p2.x(), p2.weight(), + p3.p(), p3.x(), p3.weight() ); + } else { s = sign_determinant2x2( p2.p(), p2.y(), p1.p(), p1.y() ) * - sign_of_determinant( p1.p(), p1.y(), p1.weight(), - p2.p(), p2.y(), p2.weight(), - p3.p(), p3.y(), p3.weight() ); - } + sign_of_determinant( p1.p(), p1.y(), p1.weight(), + p2.p(), p2.y(), p2.weight(), + p3.p(), p3.y(), p3.weight() ); + } if (s != ZERO || i < 1) { return s; } switch (i) { - case 1: - return ordered_on_line (p1, p2, p3) ? NEGATIVE : POSITIVE; - case 2: - return ordered_on_line (p2, p1, p3) ? NEGATIVE : POSITIVE; - case 3: - return NEGATIVE; - default: - CGAL_error_msg( "this should not happen."); + case 1: + return ordered_on_line (p1, p2, p3) ? NEGATIVE : POSITIVE; + case 2: + return ordered_on_line (p2, p1, p3) ? NEGATIVE : POSITIVE; + case 3: + return NEGATIVE; + default: + CGAL_error_msg( "this should not happen."); } // perturbation @@ -143,14 +143,14 @@ class Conflict_2 } else if (i == 2) { ool = ordered_on_line(p1, p2, p3); } else if (i == 3) { - ool = ordered_on_line(p1, p3, p2); - } else { + ool = ordered_on_line(p1, p3, p2); + } else { CGAL_error_msg( "this does not happen."); ool = false; } if (ool) { return NEGATIVE; } - + return POSITIVE; } @@ -167,7 +167,7 @@ class Conflict_2 const Inverted_weighted_point &p3) const { if (ordered_on_line_test(p1, p2) == POSITIVE) { - return ordered_on_line_test(p2, p3) == POSITIVE; + return ordered_on_line_test(p2, p3) == POSITIVE; } return ordered_on_line_test(p3, p2) == POSITIVE; } diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h index 3aa9edc14ed3..f4631da2d2b2 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -60,39 +60,39 @@ class Edge_conflict_2 : public Conflict_2 // order of a line bool oolQ24 = this->ordered_on_line(q, p2, p4); - bool oolQ23 = this->ordered_on_line(q, p2, p3); + bool oolQ23 = this->ordered_on_line(q, p2, p3); if ( b ) { - if ( CGAL::sign(q.p()) != POSITIVE ) { return true; } - // degenerate case - if (orient234 == ZERO && orient23Q == ZERO && orient42Q == ZERO) { - return (oolQ23 || oolQ24); - } else if (! ((radInt23Q != NEGATIVE && radSid2Q3 == NEGATIVE) && - (radInt24Q != NEGATIVE && radSid2Q4 == NEGATIVE))) { - // non degenerate case - return true; - } else if (orient234 != NEGATIVE) { - return orient23Q != POSITIVE && orient42Q != POSITIVE; - } else { - return orient23Q != POSITIVE || orient42Q != POSITIVE; - } + if ( CGAL::sign(q.p()) != POSITIVE ) { return true; } + // degenerate case + if (orient234 == ZERO && orient23Q == ZERO && orient42Q == ZERO) { + return (oolQ23 || oolQ24); + } else if (! ((radInt23Q != NEGATIVE && radSid2Q3 == NEGATIVE) && + (radInt24Q != NEGATIVE && radSid2Q4 == NEGATIVE))) { + // non degenerate case + return true; + } else if (orient234 != NEGATIVE) { + return orient23Q != POSITIVE && orient42Q != POSITIVE; + } else { + return orient23Q != POSITIVE || orient42Q != POSITIVE; + } } else { - CGAL_assertion ( CGAL::sign(q.p()) == POSITIVE ); - // degenerate case - if (orient234 == ZERO && orient23Q == ZERO && orient42Q == ZERO) { - return (oolQ23 && oolQ24); - } else if (! ((radInt23Q != NEGATIVE && radSid2Q3 == NEGATIVE) && + CGAL_assertion ( CGAL::sign(q.p()) == POSITIVE ); + // degenerate case + if (orient234 == ZERO && orient23Q == ZERO && orient42Q == ZERO) { + return (oolQ23 && oolQ24); + } else if (! ((radInt23Q != NEGATIVE && radSid2Q3 == NEGATIVE) && (radInt24Q != NEGATIVE && radSid2Q4 == NEGATIVE))) { - // non degenerate case - return false; - } else if (orient234 != NEGATIVE) { - return orient23Q != POSITIVE || orient42Q != POSITIVE; - } else { - return orient23Q != POSITIVE && orient42Q != POSITIVE; - } + // non degenerate case + return false; + } else if (orient234 != NEGATIVE) { + return orient23Q != POSITIVE || orient42Q != POSITIVE; + } else { + return orient23Q != POSITIVE && orient42Q != POSITIVE; + } } } }; diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h index cc419447b6f5..5c6ab3904dcd 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -42,37 +42,37 @@ class Finite_edge_interior_conflict_new_2 typedef bool result_type; inline - bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q, bool b) const + bool operator()(const Site_2& p1, const Site_2& p2, + const Site_2& q, bool b) const { Weighted_point_inverter inverter(p1); Point_2 origin(0,0); Site_2 origin_site(origin,0); return edge_conflict_test(inverter(p2), - Inverted_weighted_point(origin_site,1), - Inverted_weighted_point(origin_site,1), - inverter(q), b, 2, 2); + Inverted_weighted_point(origin_site,1), + Inverted_weighted_point(origin_site,1), + inverter(q), b, 2, 2); } inline - bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& q, bool b) const + bool operator()(const Site_2& p1, const Site_2& p2, + const Site_2& p3, const Site_2& q, bool b) const { Weighted_point_inverter inverter(p2); Point_2 origin(0,0); Site_2 origin_site(origin,0); - return edge_conflict_test(inverter(p1), - Inverted_weighted_point(origin_site,1), - inverter(p3), inverter(q), b, 2, 1); + return edge_conflict_test(inverter(p1), + Inverted_weighted_point(origin_site,1), + inverter(p3), inverter(q), b, 2, 1); } inline - bool operator()(const Site_2& p1, const Site_2& p2, const Site_2& p3, - const Site_2& p4, const Site_2& q, bool b) const + bool operator()(const Site_2& p1, const Site_2& p2, const Site_2& p3, + const Site_2& p4, const Site_2& q, bool b) const { Weighted_point_inverter inverter(p2); - return edge_conflict_test(inverter(p1), inverter(p4), inverter(p3), - inverter(q), b, 1, 1); + return edge_conflict_test(inverter(p1), inverter(p4), inverter(p3), + inverter(q), b, 1, 1); } }; diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h index 986d6d7cb268..6be7d9522dde 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -42,15 +42,15 @@ class Infinite_edge_interior_conflict_new_2 typedef bool result_type; inline - bool operator()(const Site_2& p2, const Site_2& p3, - const Site_2& p4, const Site_2& q, bool b) const + bool operator()(const Site_2& p2, const Site_2& p3, + const Site_2& p4, const Site_2& q, bool b) const { Weighted_point_inverter inverter(p2); Point_2 origin(0,0); Site_2 origin_site(origin,0); return edge_conflict_test(Inverted_weighted_point(origin_site, 1), - inverter(p4), inverter(p3), inverter(q), - b, 1, 1); + inverter(p4), inverter(p3), inverter(q), + b, 1, 1); } }; diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h index b5c3507f8cd0..6fee61f36262 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h index b1ffa00596fd..2894971a5916 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -39,7 +39,7 @@ class Orientation_new_2 : public Orientation_2 typedef Site_2 argument_type; Orientation operator() (const Site_2 &s0, const Site_2 &s1, - const Site_2 &s2, const Point_2 &q) const + const Site_2 &s2, const Point_2 &q) const { RT x1 = s1.x() - s0.x(); RT y1 = s1.y() - s0.y(); @@ -54,7 +54,7 @@ class Orientation_new_2 : public Orientation_2 RT a1 = CGAL::square(x1) + CGAL::square(y1) - CGAL::square(w1); RT a2 = CGAL::square(x2) + CGAL::square(y2) - CGAL::square(w2); - + CGAL_assertion (CGAL::sign(a1) == POSITIVE); CGAL_assertion (CGAL::sign(a2) == POSITIVE); @@ -69,18 +69,18 @@ class Orientation_new_2 : public Orientation_2 if (W == ZERO) { return -S; } RT o = x * yq - y * xq; - + Sign O = CGAL::sign(o); if (S == 0) { return O * W; } - + if (W * S * O != POSITIVE) { return -S; } RT i = CGAL::square(w) * (CGAL::square(xq) + CGAL::square(yq)) - - CGAL::square(s); + - CGAL::square(s); Sign I = CGAL::sign(i); - + return S * I; } }; diff --git a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h index 98d6ddaa58f7..2990c589105e 100644 --- a/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h +++ b/Apollonius_graph_2/archive/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -27,16 +27,16 @@ namespace ApolloniusGraph_2 { // Vertex conflict //----------------------------------------------------------------------- -template < class K, class Method_tag > -class Vertex_conflict_new_2 +template < class K, class Method_tag > +class Vertex_conflict_new_2 { public: typedef typename K::Site_2 Site_2; - typedef typename K::RT RT; + typedef typename K::RT RT; typedef Sign result_type; private: - + inline bool is_less (const Site_2 &p0, const Site_2 &p1) const { @@ -50,7 +50,7 @@ class Vertex_conflict_new_2 } inline - int max_radius(const Site_2 &p0, const Site_2 &p1, + int max_radius(const Site_2 &p0, const Site_2 &p1, const Site_2 &p2, const Site_2 &p3) const { int i = 0; @@ -66,36 +66,36 @@ class Vertex_conflict_new_2 inline Sign predicate (const Site_2 &p1, const Site_2 &p2, const Site_2 &p3, const Site_2 &q, bool perturb) const - { + { RT xq = q.x() - p1.x(); - RT yq = q.y() - p1.y(); - RT wq = q.weight() - p1.weight(); + RT yq = q.y() - p1.y(); + RT wq = q.weight() - p1.weight(); RT aq = CGAL::square(xq) + CGAL::square(yq) - CGAL::square(wq); // q is hiding p1 if (CGAL::sign(aq) != POSITIVE){ - // I BELIEVE MENELAOS RETURNS -1 in this case even when degernate + // I BELIEVE MENELAOS RETURNS -1 in this case even when degernate //if (sign (aq) == ZERO && ! perturb) return ZERO; - //return NEGATIVE; - return POSITIVE; + //return NEGATIVE; + return POSITIVE; } RT x2 = p2.x() - p1.x(); - RT y2 = p2.y() - p1.y(); - RT w2 = p2.weight() - p1.weight(); + RT y2 = p2.y() - p1.y(); + RT w2 = p2.weight() - p1.weight(); RT a2 = CGAL::square(x2) + CGAL::square(y2) - CGAL::square(w2); CGAL_assertion (a2 > 0); RT x3 = p3.x() - p1.x(); - RT y3 = p3.y() - p1.y(); - RT w3 = p3.weight() - p1.weight(); + RT y3 = p3.y() - p1.y(); + RT w3 = p3.weight() - p1.weight(); RT a3 = CGAL::square(x3) + CGAL::square(y3) - CGAL::square(w3); CGAL_assertion (a3 > 0); - RT ax3q = a3 * xq - x3 * aq; + RT ax3q = a3 * xq - x3 * aq; RT ax2q = a2 * xq - x2 * aq; RT ax23 = a2 * x3 - x2 * a3; @@ -116,14 +116,14 @@ class Vertex_conflict_new_2 Sign orient1 = CGAL::sign(ax23); Sign power_test = - ( orient1 == ZERO ? - (CGAL::sign(ay23) * CGAL::sign(ayw23q)) : - (orient1 * CGAL::sign(axw23q)) - ); + ( orient1 == ZERO ? + (CGAL::sign(ay23) * CGAL::sign(ayw23q)) : + (orient1 * CGAL::sign(axw23q)) + ); if (power_test != ZERO || !perturb) { - return -power_test; - } + return -power_test; + } int i = max_radius (p1, p2, p3, q); @@ -147,30 +147,30 @@ class Vertex_conflict_new_2 return i == 0 ? NEGATIVE : POSITIVE; } - - // radical side + + // radical side RT rs23q = ax23 * axw23q + ay23 * ayw23q; Sign radSide = CGAL::sign(rs23q); if (radSide == ZERO || radSide != orient) { return orient; } - + // radical intersection Sign radInt = - CGAL::sign(CGAL::square(axw23q) + CGAL::square(ayw23q) - - CGAL::square( axy23q)); + CGAL::sign(CGAL::square(axw23q) + CGAL::square(ayw23q) + - CGAL::square( axy23q)); // radical intersection degenerate if (radInt == ZERO) { Sign radSideQ = CGAL::sign(ax23 * axw23q + ay23 * ayw23q); - + CGAL_assertion (radSideQ != ZERO); if (!perturb) { return (radSideQ == orient) ? ZERO : orient; } int i = max_radius (p1, p2, p3, q); - if (i == 3) { + if (i == 3) { radInt = radSideQ; } else if (i == 2) { radInt = -CGAL::sign(ax2q * axw23q + ay2q * ayw23q); @@ -189,34 +189,34 @@ class Vertex_conflict_new_2 radInt = Sign (-(radSideQ + radSide1 + radSide2)); } } - + CGAL_assertion (!perturb || radInt != ZERO); if (radInt == NEGATIVE) { return orient; } - + return -radSide; } - + inline - Sign predicate(const Site_2 &p1, const Site_2 &p2, - const Site_2 &q, bool perturb) const + Sign predicate(const Site_2 &p1, const Site_2 &p2, + const Site_2 &q, bool perturb) const { // NOTE:*************************************** - // * the perturb boolean variable is not used + // * the perturb boolean variable is not used // * for consistancy with Menelaos // NOTE:*************************************** RT x2 = p2.x() - p1.x(); - RT y2 = p2.y() - p1.y(); - RT w2 = p2.weight() - p1.weight(); + RT y2 = p2.y() - p1.y(); + RT w2 = p2.weight() - p1.weight(); RT xq = q.x() - p1.x(); - RT yq = q.y() - p1.y(); - RT wq = q.weight() - p1.weight(); + RT yq = q.y() - p1.y(); + RT wq = q.weight() - p1.weight(); RT xw2q = x2 * wq - xq * w2; RT yw2q = y2 * wq - yq * w2; RT xy2q = x2 * yq - xq * y2; - + // orientation Sign orient = CGAL::sign(xy2q); @@ -228,7 +228,7 @@ class Vertex_conflict_new_2 Sign power_test; if (o12 != ZERO) { power_test = o12 * CGAL::sign(xw2q); - + // this results is consistant with Menelaos if (power_test != ZERO) { return -power_test; } @@ -255,7 +255,7 @@ class Vertex_conflict_new_2 return NEGATIVE; } - // radical side + // radical side RT rs12q = x2 * xw2q + y2 * yw2q; Sign radSide = CGAL::sign(rs12q); @@ -265,24 +265,24 @@ class Vertex_conflict_new_2 // radical intersection Sign radInt = - CGAL::sign(CGAL::square(xw2q) + CGAL::square(yw2q) - - CGAL::square(xy2q)); + CGAL::sign(CGAL::square(xw2q) + CGAL::square(yw2q) + - CGAL::square(xy2q)); // radical intersection degerate if (radInt == ZERO) { CGAL_assertion (radSide != ZERO); - + // this result is consistant with the perturb on off idea //if (! perturb) return (radSide == orient) ? ZERO : orient; RT rs2q1 = (p2.x() - q.x()) * xw2q + (p2.y() - q.y()) * yw2q; Sign radSide1 = CGAL::sign(rs2q1); if (radSide1 == ZERO) { return NEGATIVE; } - + RT rsq12 = xq * xw2q + yq * yw2q; Sign radSide2 = CGAL::sign(rsq12); if (radSide2 == ZERO) { return NEGATIVE; } - + return -(radSide1 * radSide2); } @@ -296,9 +296,9 @@ class Vertex_conflict_new_2 inline Sign operator()(const Site_2 &p1, const Site_2 &p2, const Site_2 &p3, const Site_2 &q, - bool perturb = true) const - { - Sign newPred = predicate(p1, p2, p3, q, perturb); + bool perturb = true) const + { + Sign newPred = predicate(p1, p2, p3, q, perturb); CGAL_assertion (!perturb || newPred != ZERO); return newPred; } @@ -307,7 +307,7 @@ class Vertex_conflict_new_2 Sign operator()(const Site_2 &p1, const Site_2 &p2, const Site_2 &q, bool perturb = true) const { - Sign newPred = predicate(p1, p2, q, perturb); + Sign newPred = predicate(p1, p2, q, perturb); CGAL_assertion (!perturb || newPred != ZERO); return newPred; } diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Apollonius_graph_2.txt b/Apollonius_graph_2/doc/Apollonius_graph_2/Apollonius_graph_2.txt index 196fc8451f15..34fb02551116 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Apollonius_graph_2.txt +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Apollonius_graph_2.txt @@ -1,16 +1,16 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_2D_Apollonius_Graphs \anchor chapterapollonius2 \cgalAutoToc \authors Menelaos Karavelas and Mariette Yvinec This chapter describes the two-dimensional Apollonius graph -of \cgal. We start with a few definitions in +of \cgal. We start with a few definitions in Section \ref secapollonius2definitions. -The software design of the 2D Apollonius graph package is described +The software design of the 2D Apollonius graph package is described in Section \ref secapollonius2design. In Section \ref secapollonius2traits we discuss the geometric traits of the 2D Apollonius graph package and in Section @@ -18,7 +18,7 @@ traits of the 2D Apollonius graph package and in Section structure suitable for fast nearest neighbor queries, is briefly described. -\section secapollonius2definitions Definitions +\section secapollonius2definitions Definitions \cgalFigureBegin{figapollonius,apollonius_diagram.png,apollonius_graph.png} The Apollonius diagram (left) and its dual the Apollonius graph (right). @@ -41,11 +41,11 @@ The Apollonius diagram is defined over a set of sites \f$ P_i=(c_i,w_i)\f$, \f$ i=1,\ldots,n\f$, where \f$ c_i\f$ is the point and \f$ w_i\f$ the weight of \f$ P_i\f$. It is a subdivision of the plane into connected regions, called cells, associated with the sites (see -\cgalFigureRef{figapollonius} (left)). The cell of a +\cgalFigureRef{figapollonius} (left)). The cell of a site \f$ P_i\f$ is the locus of points on the plane that are closer to \f$ P_i\f$ than any other site \f$ P_j\f$, \f$ j\neq i\f$. The distance \f$ \delta(x, P_i)\f$ of a point \f$ x\f$ in the plane to a -site \f$ P_i\f$ is defined as: +site \f$ P_i\f$ is defined as: \f[ \delta(x,P_i)=\|x-c_i\|-w_i, \f] where \f$ \|\cdot\|\f$ denotes the Euclidean norm. It can easily be seen that it is a generalization of the Voronoi @@ -69,7 +69,7 @@ means geometrically. We identify the 2D Euclidean plane with the seen as the vertical projection on the \f$ xy\f$-plane of the lower envelope of a set of 3D cones defined as follows: for each point \f$ p\f$ in the set of 2D points we have a cone \f$ C_p\f$ whose apex is the point -\f$ p\f$. The axis of +\f$ p\f$. The axis of \f$ C_p\f$ is a line parallel to the \f$ z\f$-axis passing through \f$ p\f$, the angle of \f$ C_p\f$ is \f$ 45^\circ\f$ and, finally \f$ C_p\f$ is facing in the positive \f$ z\f$-direction (that is, \f$ C_p\f$ is contained in the positive @@ -100,7 +100,7 @@ such way is shown in \cgalFigureRef{figapollonius} (right). The Apollonius graph is uniquely defined once we have the Apollonius diagram. If the circles are in general position (see precise definition below), then the Apollonius graph is a graph -with triangular faces away from +with triangular faces away from the convex hull of the set of circles (by triangular we mean that every face has exactly three edges). Near the convex hull we may have some spikes (i.e., vertices of degree 1). To unify our approach @@ -177,7 +177,7 @@ one visible circle. two visible circles. -\section secapollonius2design Software Design +\section secapollonius2design Software Design The 2D Apollonius graph class `Apollonius_graph_2` @@ -234,14 +234,14 @@ default `true` and it indicates that hidden sites should be stored. The user can indicate that hidden sites may be discarded by setting this value to `false`. -\section secapollonius2traits The Geometric Traits +\section secapollonius2traits The Geometric Traits The predicates required for the computation of the Apollonius graph are rather complicated. It is not the purpose of this document to discuss them in detail. The interested reader may refer to the papers by Karavelas and Emiris for the details \cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}. However, we would like to give a brief -overview of what they +overview of what they compute. There are several predicates needed by this algorithm. We will discuss the most important/complicated ones. It turns out that it is much easier to describe them in terms of the Apollonius diagram, @@ -285,7 +285,7 @@ The `Vertex_conflict_2` predicate. The left-most, bottom-most and top-most circl What we essentially want to compute when we construct incrementally a Voronoi diagram, is whether the object to be inserted destroys an edge of the Voronoi diagram or not. In the case of points this is really -easy and it amounts to the well known incircle test. +easy and it amounts to the well known incircle test. In the case of circles the situation is more complicated. We can have six possible outcomes as to what portion of an edge of the Apollonius diagram the @@ -301,7 +301,7 @@ what the `Finite_edge_interior_conflict_2` and is the same predicate (same idea) applied to two different types of edges in the Apollonius diagram: a finite or an infinite edge. An edge is infinite if its dual edge in the Apollonius graph connects the -site at infinity with the vertex corresponding to a (finite) circle; +site at infinity with the vertex corresponding to a (finite) circle; otherwise it is a finite edge. \cgalFigureAnchor{figag2edgeconflict} @@ -399,7 +399,7 @@ they are not necessarily exact. All template parameters except `CK` have default values, which are explained in the reference manual. -\section secapollonius2hierarchy The Apollonius Graph Hierarchy +\section secapollonius2hierarchy The Apollonius Graph Hierarchy The `Apollonius_graph_hierarchy_2` class is nothing but the equivalent of the `Triangulation_hierarchy_2` class, applied to the Apollonius graph. It consists of a series of @@ -415,7 +415,7 @@ consisting of more than 1,000 circles. This threshold holds for both the construction of the Apollonius diagram itself, as well as for nearest neighbor queries. -\section secapollonius2examples Examples +\section secapollonius2examples Examples \subsection Apollonius_graph_2FirstExample First Example @@ -433,6 +433,6 @@ nearest neighbor queries. \cgalExample{Apollonius_graph_2/ag2_hierarchy.cpp} -*/ +*/ } /* namespace CGAL */ diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h index 91df4a31e7c8..c20ebc9846da 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h @@ -4,12 +4,12 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -The class `Apollonius_graph_2` represents the -Apollonius graph. It supports insertions and deletions of sites. -It is templated by two template arguments `Gt`, which -must be a model of `ApolloniusGraphTraits_2`, and `Agds`, -which must be a model of `ApolloniusGraphDataStructure_2`. -The second template argument defaults to +The class `Apollonius_graph_2` represents the +Apollonius graph. It supports insertions and deletions of sites. +It is templated by two template arguments `Gt`, which +must be a model of `ApolloniusGraphTraits_2`, and `Agds`, +which must be a model of `ApolloniusGraphDataStructure_2`. +The second template argument defaults to `CGAL::Triangulation_data_structure_2< CGAL::Apollonius_graph_vertex_base_2, CGAL::Triangulation_face_base_2 >`. \cgalModels `DelaunayGraph_2` @@ -30,63 +30,63 @@ to the `infinite_vertex` is a clockwise traversal of the convex hull. CGAL::Apollonius_graph_2 ag; CGAL::Apollonius_graph_2::Face f; -ag.incident_vertices(ag.infinite_vertex()); -ag.incident_vertices(ag.infinite_vertex(), f); +ag.incident_vertices(ag.infinite_vertex()); +ag.incident_vertices(ag.infinite_vertex(), f); -ag.incident_faces(ag.infinite_vertex()); -ag.incident_faces(ag.infinite_vertex(), f); +ag.incident_faces(ag.infinite_vertex()); +ag.incident_faces(ag.infinite_vertex(), f); -ag.incident_edges(ag.infinite_vertex()); -ag.incident_edges(ag.infinite_vertex(), f); +ag.incident_edges(ag.infinite_vertex()); +ag.incident_edges(ag.infinite_vertex(), f); \endcode -\sa `DelaunayGraph_2` -\sa `ApolloniusGraphTraits_2` -\sa `ApolloniusGraphDataStructure_2` -\sa `ApolloniusGraphVertexBase_2` -\sa `TriangulationFaceBase_2` -\sa `CGAL::Apollonius_graph_traits_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` -\sa `CGAL::Triangulation_data_structure_2` -\sa `CGAL::Apollonius_graph_vertex_base_2` -\sa `CGAL::Triangulation_face_base_2` +\sa `DelaunayGraph_2` +\sa `ApolloniusGraphTraits_2` +\sa `ApolloniusGraphDataStructure_2` +\sa `ApolloniusGraphVertexBase_2` +\sa `TriangulationFaceBase_2` +\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `CGAL::Triangulation_data_structure_2` +\sa `CGAL::Apollonius_graph_vertex_base_2` +\sa `CGAL::Triangulation_face_base_2` */ template< typename Gt, typename Agds > class Apollonius_graph_2 { public: -/// \name Types +/// \name Types /// @{ /*! -A type for the underlying -data structure. -*/ -typedef Agds Data_structure; +A type for the underlying +data structure. +*/ +typedef Agds Data_structure; /*! -Same as the `Data_structure` type. This type has been introduced -in order for the `Apollonius_graph_2` class to be a -model of the `DelaunayGraph_2` concept. -*/ -typedef Data_structure Triangulation_data_structure; +Same as the `Data_structure` type. This type has been introduced +in order for the `Apollonius_graph_2` class to be a +model of the `DelaunayGraph_2` concept. +*/ +typedef Data_structure Triangulation_data_structure; /*! -A type for the geometric traits. -*/ -typedef Gt Geom_traits; +A type for the geometric traits. +*/ +typedef Gt Geom_traits; /*! -A type for the -point defined in the geometric traits. -*/ -typedef Gt::Point_2 Point_2; +A type for the +point defined in the geometric traits. +*/ +typedef Gt::Point_2 Point_2; /*! -A type for the Apollonius site, defined in the geometric traits. -*/ -typedef Gt::Site_2 Site_2; +A type for the Apollonius site, defined in the geometric traits. +*/ +typedef Gt::Site_2 Site_2; /// @} @@ -109,90 +109,90 @@ typedef Gt::Site_2 Site_2; /// @{ /*! -the edge type. -The `Edge(f,i)` is the edge common to faces `f` and -`f.neighbor(i)`. It is also the edge joining the vertices -`vertex(cw(i))` and `vertex(ccw(i))` of `f`. -\pre `i` must be `0`, `1` or `2`. -*/ -typedef Data_structure::Edge Edge; +the edge type. +The `Edge(f,i)` is the edge common to faces `f` and +`f.neighbor(i)`. It is also the edge joining the vertices +`vertex(cw(i))` and `vertex(ccw(i))` of `f`. +\pre `i` must be `0`, `1` or `2`. +*/ +typedef Data_structure::Edge Edge; /*! -A type for a vertex. -*/ -typedef Data_structure::Vertex Vertex; +A type for a vertex. +*/ +typedef Data_structure::Vertex Vertex; /*! -A type for a face. -*/ -typedef Data_structure::Face Face; +A type for a face. +*/ +typedef Data_structure::Face Face; /*! -A type for a handle to a vertex. -*/ -typedef Data_structure::Vertex_handle Vertex_handle; +A type for a handle to a vertex. +*/ +typedef Data_structure::Vertex_handle Vertex_handle; /*! -A type for a handle to a face. -*/ -typedef Data_structure::Face_handle Face_handle; +A type for a handle to a face. +*/ +typedef Data_structure::Face_handle Face_handle; /*! -A type for a circulator over vertices incident to a given vertex. -*/ -typedef Data_structure::Vertex_circulator Vertex_circulator; +A type for a circulator over vertices incident to a given vertex. +*/ +typedef Data_structure::Vertex_circulator Vertex_circulator; /*! -A type for a circulator over faces incident to a given vertex. -*/ -typedef Data_structure::Face_circulator Face_circulator; +A type for a circulator over faces incident to a given vertex. +*/ +typedef Data_structure::Face_circulator Face_circulator; /*! -A type for a circulator over edges incident to a given vertex. -*/ -typedef Data_structure::Edge_circulator Edge_circulator; +A type for a circulator over edges incident to a given vertex. +*/ +typedef Data_structure::Edge_circulator Edge_circulator; /*! -A type for an iterator over all vertices. -*/ -typedef Data_structure::Vertex_iterator -All_vertices_iterator; +A type for an iterator over all vertices. +*/ +typedef Data_structure::Vertex_iterator +All_vertices_iterator; /*! -A type for an iterator over all faces. -*/ -typedef Data_structure::Face_iterator -All_faces_iterator; +A type for an iterator over all faces. +*/ +typedef Data_structure::Face_iterator +All_faces_iterator; /*! -A type for an iterator over all edges. -*/ -typedef Data_structure::Edge_iterator -All_edges_iterator; +A type for an iterator over all edges. +*/ +typedef Data_structure::Edge_iterator +All_edges_iterator; /*! -An unsigned integral type. -*/ -typedef Data_structure::size_type size_type; +An unsigned integral type. +*/ +typedef Data_structure::size_type size_type; /*! -A type for an iterator over finite vertices. -*/ -typedef unspecified_type Finite_vertices_iterator; +A type for an iterator over finite vertices. +*/ +typedef unspecified_type Finite_vertices_iterator; /*! -A type for an iterator over finite faces. -*/ -typedef unspecified_type Finite_faces_iterator; +A type for an iterator over finite faces. +*/ +typedef unspecified_type Finite_faces_iterator; /*! -A type for an iterator over finite edges. -*/ -typedef unspecified_type Finite_edges_iterator; +A type for an iterator over finite edges. +*/ +typedef unspecified_type Finite_edges_iterator; /// @} -/// \name Site Iterators +/// \name Site Iterators /// In addition to iterators and circulators for vertices and faces, /// iterators for sites are provided. In particular there are /// iterators for the entire set of sites, the hidden sites and the @@ -200,128 +200,128 @@ typedef unspecified_type Finite_edges_iterator; /// @{ /*! -A type for an iterator over all sites. -*/ -typedef unspecified_type Sites_iterator; +A type for an iterator over all sites. +*/ +typedef unspecified_type Sites_iterator; /*! -A type for an iterator over all visible sites. -*/ -typedef unspecified_type Visible_sites_iterator; +A type for an iterator over all visible sites. +*/ +typedef unspecified_type Visible_sites_iterator; /*! -A type for an iterator over all hidden sites. -*/ -typedef unspecified_type Hidden_sites_iterator; +A type for an iterator over all hidden sites. +*/ +typedef unspecified_type Hidden_sites_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -Creates an -Apollonius graph `ag` using `gt` as geometric traits. -*/ -Apollonius_graph_2(Gt gt=Gt()); +Creates an +Apollonius graph `ag` using `gt` as geometric traits. +*/ +Apollonius_graph_2(Gt gt=Gt()); /*! -Creates an Apollonius graph `ag` using `gt` as -geometric traits and inserts all sites in the range -[`first`, `beyond`). -\pre `Input_iterator` must be a model of `InputIterator`. The value type of `Input_iterator` must be `Site_2`. -*/ -template< class Input_iterator > -Apollonius_graph_2(Input_iterator first, Input_iterator beyond, -Gt gt=Gt()); +Creates an Apollonius graph `ag` using `gt` as +geometric traits and inserts all sites in the range +[`first`, `beyond`). +\pre `Input_iterator` must be a model of `InputIterator`. The value type of `Input_iterator` must be `Site_2`. +*/ +template< class Input_iterator > +Apollonius_graph_2(Input_iterator first, Input_iterator beyond, +Gt gt=Gt()); /*! -Copy constructor. All faces and vertices are duplicated. After the -construction, -`ag` and `other` refer to two different Apollonius graphs : if -`other` is modified, `ag` is not. -*/ -Apollonius_graph_2(const Apollonius_graph_2& other); +Copy constructor. All faces and vertices are duplicated. After the +construction, +`ag` and `other` refer to two different Apollonius graphs : if +`other` is modified, `ag` is not. +*/ +Apollonius_graph_2(const Apollonius_graph_2& other); /*! -Assignment. If `ag` and `other` are the same object -nothing is done. Otherwise, all the vertices and faces are -duplicated. After the assignment, `ag` and `other` refer to -different Apollonius graphs : if `other` is modified, `ag` is -not. -*/ -Apollonius_graph_2 -operator=(const Apollonius_graph_2& other); +Assignment. If `ag` and `other` are the same object +nothing is done. Otherwise, all the vertices and faces are +duplicated. After the assignment, `ag` and `other` refer to +different Apollonius graphs : if `other` is modified, `ag` is +not. +*/ +Apollonius_graph_2 +operator=(const Apollonius_graph_2& other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns a reference to the Apollonius graph traits object. -*/ -Geom_traits geom_traits(); +Returns a reference to the Apollonius graph traits object. +*/ +Geom_traits geom_traits(); /*! -Returns a reference to the -underlying data structure. -*/ -Data_structure data_structure(); +Returns a reference to the +underlying data structure. +*/ +Data_structure data_structure(); /*! -Same as `data_structure()`. This -method has been added in compliance with the `DelaunayGraph_2` -concept. -*/ -Data_structure tds(); +Same as `data_structure()`. This +method has been added in compliance with the `DelaunayGraph_2` +concept. +*/ +Data_structure tds(); /*! -Returns the dimension of the Apollonius graph. -*/ -int dimension(); +Returns the dimension of the Apollonius graph. +*/ +int dimension(); /*! -Returns the number of finite vertices. -*/ -size_type number_of_vertices(); +Returns the number of finite vertices. +*/ +size_type number_of_vertices(); /*! -Returns the number of visible sites. -*/ -size_type number_of_visible_sites(); +Returns the number of visible sites. +*/ +size_type number_of_visible_sites(); /*! -Returns the number of hidden sites. -*/ -size_type number_of_hidden_sites(); +Returns the number of hidden sites. +*/ +size_type number_of_hidden_sites(); /*! -Returns the number of faces (both finite and infinite) of the -Apollonius graph. -*/ -size_type number_of_faces(); +Returns the number of faces (both finite and infinite) of the +Apollonius graph. +*/ +size_type number_of_faces(); /*! -Returns a face incident to the `infinite_vertex`. -*/ -Face_handle infinite_face(); +Returns a face incident to the `infinite_vertex`. +*/ +Face_handle infinite_face(); /*! -Returns the `infinite_vertex`. -*/ -Vertex_handle -infinite_vertex(); +Returns the `infinite_vertex`. +*/ +Vertex_handle +infinite_vertex(); /*! -Returns a vertex distinct from the `infinite_vertex`. -\pre The number of (visible) vertices in the Apollonius graph must be at least one. -*/ -Vertex_handle finite_vertex(); +Returns a vertex distinct from the `infinite_vertex`. +\pre The number of (visible) vertices in the Apollonius graph must be at least one. +*/ +Vertex_handle finite_vertex(); -/// @} +/// @} -/// \name Face, Edge and Vertex Iterators +/// \name Face, Edge and Vertex Iterators /// The following iterators allow respectively to visit finite faces, /// finite edges and finite vertices of the Apollonius graph. These /// iterators are non-mutable, bidirectional and their value types are @@ -335,69 +335,69 @@ Vertex_handle finite_vertex(); /// @{ /*! -Starts at an arbitrary finite vertex. -*/ -Finite_vertices_iterator finite_vertices_begin(); +Starts at an arbitrary finite vertex. +*/ +Finite_vertices_iterator finite_vertices_begin(); /*! -Past-the-end iterator. -*/ -Finite_vertices_iterator finite_vertices_end(); +Past-the-end iterator. +*/ +Finite_vertices_iterator finite_vertices_end(); /*! -Starts at an arbitrary finite edge. -*/ -Finite_edges_iterator finite_edges_begin(); +Starts at an arbitrary finite edge. +*/ +Finite_edges_iterator finite_edges_begin(); /*! -Past-the-end iterator. -*/ -Finite_edges_iterator finite_edges_end(); +Past-the-end iterator. +*/ +Finite_edges_iterator finite_edges_end(); /*! -Starts at an arbitrary finite face. -*/ -Finite_faces_iterator finite_faces_begin(); +Starts at an arbitrary finite face. +*/ +Finite_faces_iterator finite_faces_begin(); /*! -Past-the-end iterator. -*/ -Finite_faces_iterator finite_faces_end() -const; +Past-the-end iterator. +*/ +Finite_faces_iterator finite_faces_end() +const; /*! -Starts at an arbitrary vertex. -*/ -All_vertices_iterator all_vertices_begin(); +Starts at an arbitrary vertex. +*/ +All_vertices_iterator all_vertices_begin(); /*! -Past-the-end iterator. -*/ -All_vertices_iterator all_vertices_end(); +Past-the-end iterator. +*/ +All_vertices_iterator all_vertices_end(); /*! -Starts at an arbitrary edge. -*/ -All_edges_iterator all_edges_begin(); +Starts at an arbitrary edge. +*/ +All_edges_iterator all_edges_begin(); /*! -Past-the-end iterator. -*/ -All_edges_iterator all_edges_end(); +Past-the-end iterator. +*/ +All_edges_iterator all_edges_end(); /*! -Starts at an arbitrary face. -*/ -All_faces_iterator all_faces_begin(); +Starts at an arbitrary face. +*/ +All_faces_iterator all_faces_begin(); /*! -Past-the-end iterator. -*/ -All_faces_iterator all_faces_end(); +Past-the-end iterator. +*/ +All_faces_iterator all_faces_end(); -/// @} +/// @} -/// \name Site Iterators +/// \name Site Iterators /// The following iterators allow respectively to visit all sites, the /// visible sites and the hidden sites. These iterators are /// non-mutable, bidirectional and their value type is `Site_2`. They @@ -405,38 +405,38 @@ All_faces_iterator all_faces_end(); /// @{ /*! -Starts at an arbitrary site. -*/ -Sites_iterator sites_begin(); +Starts at an arbitrary site. +*/ +Sites_iterator sites_begin(); /*! -Past-the-end iterator. -*/ -Sites_iterator sites_end(); +Past-the-end iterator. +*/ +Sites_iterator sites_end(); /*! -Starts at an arbitrary visible site. -*/ -Visible_sites_iterator visible_sites_begin(); +Starts at an arbitrary visible site. +*/ +Visible_sites_iterator visible_sites_begin(); /*! -Past-the-end iterator. -*/ -Visible_sites_iterator visible_sites_end(); +Past-the-end iterator. +*/ +Visible_sites_iterator visible_sites_end(); /*! -Starts at an arbitrary hidden site. -*/ -Hidden_sites_iterator hidden_sites_begin(); +Starts at an arbitrary hidden site. +*/ +Hidden_sites_iterator hidden_sites_begin(); /*! -Past-the-end iterator. -*/ -Hidden_sites_iterator hidden_sites_end(); +Past-the-end iterator. +*/ +Hidden_sites_iterator hidden_sites_end(); -/// @} +/// @} -/// \name Face, Edge and Vertex Circulators +/// \name Face, Edge and Vertex Circulators /// The Apollonius graph also provides circulators that allow to visit /// respectively all faces or edges incident to a given vertex or all /// vertices adjacent to a given vertex. These circulators are @@ -451,152 +451,152 @@ Hidden_sites_iterator hidden_sites_end(); /// @{ /*! -Starts at an arbitrary face incident -to `v`. -*/ -Face_circulator incident_faces(Vertex_handle v); +Starts at an arbitrary face incident +to `v`. +*/ +Face_circulator incident_faces(Vertex_handle v); /*! -Starts at face `f`. -\pre Face `f` is incident to vertex `v`. -*/ -Face_circulator incident_faces(Vertex_handle v, Face_handle f); +Starts at face `f`. +\pre Face `f` is incident to vertex `v`. +*/ +Face_circulator incident_faces(Vertex_handle v, Face_handle f); /*! -Starts at an arbitrary edge incident -to `v`. -*/ -Edge_circulator incident_edges(Vertex_handle v); +Starts at an arbitrary edge incident +to `v`. +*/ +Edge_circulator incident_edges(Vertex_handle v); /*! -Starts at the first edge of `f` incident to -`v`, in counterclockwise order around `v`. -\pre Face `f` is incident to vertex `v`. -*/ -Edge_circulator incident_edges(Vertex_handle v, Face_handle f); +Starts at the first edge of `f` incident to +`v`, in counterclockwise order around `v`. +\pre Face `f` is incident to vertex `v`. +*/ +Edge_circulator incident_edges(Vertex_handle v, Face_handle f); /*! -Starts at an arbitrary vertex incident -to `v`. -*/ -Vertex_circulator incident_vertices(Vertex_handle v); +Starts at an arbitrary vertex incident +to `v`. +*/ +Vertex_circulator incident_vertices(Vertex_handle v); /*! -Starts at the first vertex of `f` adjacent to `v` -in counterclockwise order around `v`. -\pre Face `f` is incident to vertex `v`. -*/ -Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f); +Starts at the first vertex of `f` adjacent to `v` +in counterclockwise order around `v`. +\pre Face `f` is incident to vertex `v`. +*/ +Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f); -/// @} +/// @} -/// \name Predicates +/// \name Predicates /// The class `Apollonius_graph_2` provides methods to test the finite /// or infinite character of any feature. /// @{ /*! -`true`, iff `v` is the `infinite_vertex`. -*/ -bool -is_infinite(Vertex_handle v) const; +`true`, iff `v` is the `infinite_vertex`. +*/ +bool +is_infinite(Vertex_handle v) const; /*! -`true`, iff face `f` is infinite. -*/ -bool -is_infinite(Face_handle f) const; +`true`, iff face `f` is infinite. +*/ +bool +is_infinite(Face_handle f) const; /*! -`true`, iff edge `(f,i)` is infinite. -*/ -bool is_infinite(Face_handle f, int i) const; +`true`, iff edge `(f,i)` is infinite. +*/ +bool is_infinite(Face_handle f, int i) const; /*! -`true`, iff edge `e` is infinite. -*/ -bool -is_infinite(Edge e) const; +`true`, iff edge `e` is infinite. +*/ +bool +is_infinite(Edge e) const; /*! -`true`, iff edge `*ec` is infinite. -*/ -bool -is_infinite(Edge_circulator ec) const; +`true`, iff edge `*ec` is infinite. +*/ +bool +is_infinite(Edge_circulator ec) const; -/// @} +/// @} -/// \name Insertion +/// \name Insertion /// @{ /*! -Inserts the sites in the range -[`first`,`beyond`). The number of sites in the range -[`first`, `beyond`) is returned. -\pre `Input_iterator` must be a model of `InputIterator` and its value type must be `Site_2`. -*/ -template< class Input_iterator > -unsigned int insert(Input_iterator first, Input_iterator beyond); +Inserts the sites in the range +[`first`,`beyond`). The number of sites in the range +[`first`, `beyond`) is returned. +\pre `Input_iterator` must be a model of `InputIterator` and its value type must be `Site_2`. +*/ +template< class Input_iterator > +unsigned int insert(Input_iterator first, Input_iterator beyond); /*! -Inserts the -site `s` in the Apollonius graph. If `s` is visible then the -vertex handle of `s` is returned, otherwise -`Vertex_handle(nullptr)` is returned. -*/ -Vertex_handle insert(Site_2 s); +Inserts the +site `s` in the Apollonius graph. If `s` is visible then the +vertex handle of `s` is returned, otherwise +`Vertex_handle(nullptr)` is returned. +*/ +Vertex_handle insert(Site_2 s); /*! -Inserts `s` in the Apollonius graph using the site -associated with `vnear` as an estimate for the nearest neighbor of -the center of `s`. If `s` is visible then the vertex handle of -`s` is returned, otherwise `Vertex_handle(nullptr)` is -returned. -*/ -Vertex_handle insert(Site_2 s, Vertex_handle -vnear); +Inserts `s` in the Apollonius graph using the site +associated with `vnear` as an estimate for the nearest neighbor of +the center of `s`. If `s` is visible then the vertex handle of +`s` is returned, otherwise `Vertex_handle(nullptr)` is +returned. +*/ +Vertex_handle insert(Site_2 s, Vertex_handle +vnear); -/// @} +/// @} -/// \name Removal +/// \name Removal /// @{ /*! -Removes the site -associated to the vertex handle `v` from the Apollonius -graph. -\pre `v` must correspond to a valid finite vertex of the Apollonius graph. -*/ -void remove(Vertex_handle v); +Removes the site +associated to the vertex handle `v` from the Apollonius +graph. +\pre `v` must correspond to a valid finite vertex of the Apollonius graph. +*/ +void remove(Vertex_handle v); -/// @} +/// @} -/// \name Nearest Neighbor Location +/// \name Nearest Neighbor Location /// @{ /*! -Finds the nearest neighbor of the point `p`. In other words it -finds the site whose Apollonius cell contains `p`. Ties are broken -arbitrarily and one of the nearest neighbors of `p` is -returned. If there are no visible sites in the Apollonius diagram -`Vertex_handle(nullptr)` is returned. -*/ -Vertex_handle nearest_neighbor(Point_2 p); +Finds the nearest neighbor of the point `p`. In other words it +finds the site whose Apollonius cell contains `p`. Ties are broken +arbitrarily and one of the nearest neighbors of `p` is +returned. If there are no visible sites in the Apollonius diagram +`Vertex_handle(nullptr)` is returned. +*/ +Vertex_handle nearest_neighbor(Point_2 p); /*! -Finds the nearest neighbor of the point -`p` using the site associated with `vnear` as an -estimate for the nearest neighbor of `p`. Ties are broken -arbitrarily and one of the nearest neighbors of `p` is -returned. If there are no visible sites in the Apollonius diagram -`Vertex_handle(nullptr)` is returned. -*/ -Vertex_handle nearest_neighbor(Point_2 p, -Vertex_handle vnear); +Finds the nearest neighbor of the point +`p` using the site associated with `vnear` as an +estimate for the nearest neighbor of `p`. Ties are broken +arbitrarily and one of the nearest neighbors of `p` is +returned. If there are no visible sites in the Apollonius diagram +`Vertex_handle(nullptr)` is returned. +*/ +Vertex_handle nearest_neighbor(Point_2 p, +Vertex_handle vnear); -/// @} +/// @} -/// \name Access to the Dual +/// \name Access to the Dual /// The `Apollonius_graph_2` class provides access to the duals of the /// faces of the graph. The dual of a face of the Apollonius graph is /// a site. If the originating face is infinite, its dual is a site @@ -610,139 +610,139 @@ Vertex_handle vnear); /// @{ /*! -Returns the -dual corresponding to the face handle `f`. The returned object can -be assignable to one of the following: `Site_2`, `Gt::Line_2`. -*/ -Gt::Object_2 dual(Face_handle f) const; +Returns the +dual corresponding to the face handle `f`. The returned object can +be assignable to one of the following: `Site_2`, `Gt::Line_2`. +*/ +Gt::Object_2 dual(Face_handle f) const; /*! -Returns the -dual of the face to which `it` points to. The returned object can -be assignable to one of the following: `Site_2`, `Gt::Line_2`. -*/ -Gt::Object_2 dual(All_faces_iterator it) const; +Returns the +dual of the face to which `it` points to. The returned object can +be assignable to one of the following: `Site_2`, `Gt::Line_2`. +*/ +Gt::Object_2 dual(All_faces_iterator it) const; /*! -Returns -the dual of the face to which `it` points to. The returned -object can be assignable to one of the following: `Site_2`, -`Gt::Line_2`. -*/ -Gt::Object_2 dual(Finite_faces_iterator it) const; +Returns +the dual of the face to which `it` points to. The returned +object can be assignable to one of the following: `Site_2`, +`Gt::Line_2`. +*/ +Gt::Object_2 dual(Finite_faces_iterator it) const; -/// @} +/// @} -/// \name I/O +/// \name I/O /// @{ /*! -Draws the Apollonius graph to -the stream `str`. -\pre The following operators must be defined: -`Stream& operator<<(Stream&, Gt::Segment_2)`, -`Stream& operator<<(Stream&, Gt::Ray_2)`. +Draws the Apollonius graph to +the stream `str`. +\pre The following operators must be defined: +`Stream& operator<<(Stream&, Gt::Segment_2)`, +`Stream& operator<<(Stream&, Gt::Ray_2)`. -*/ -template< class Stream > -Stream& draw_primal(Stream& str); +*/ +template< class Stream > +Stream& draw_primal(Stream& str); /*! -Draws the dual of the -Apollonius graph, i.e., the Apollonius diagram, to the stream -`str`. -\pre The following operators must be defined: -`Stream& operator<<(Stream&, Gt::Segment_2)`, -`Stream& operator<<(Stream&, Gt::Ray_2)`, -`Stream& operator<<(Stream&, Gt::Line_2)`. +Draws the dual of the +Apollonius graph, i.e., the Apollonius diagram, to the stream +`str`. +\pre The following operators must be defined: +`Stream& operator<<(Stream&, Gt::Segment_2)`, +`Stream& operator<<(Stream&, Gt::Ray_2)`, +`Stream& operator<<(Stream&, Gt::Line_2)`. -*/ -template < class Stream > -Stream& draw_dual(Stream& str); +*/ +template < class Stream > +Stream& draw_dual(Stream& str); /*! -Draws the edge -`e` of the Apollonius graph to the stream `str`. -\pre The following operators must be defined: -`Stream& operator<<(Stream&, Gt::Segment_2)`, -`Stream& operator<<(Stream&, Gt::Ray_2)`. +Draws the edge +`e` of the Apollonius graph to the stream `str`. +\pre The following operators must be defined: +`Stream& operator<<(Stream&, Gt::Segment_2)`, +`Stream& operator<<(Stream&, Gt::Ray_2)`. -*/ -template< class Stream > -Stream& draw_primal_edge(Edge e, Stream& str); +*/ +template< class Stream > +Stream& draw_primal_edge(Edge e, Stream& str); /*! -Draws the dual of the -edge `e` to the stream `str`. The dual of `e` is an edge -of the Apollonius diagram. -\pre The following operators must be defined: -`Stream& operator<<(Stream&, Gt::Segment_2)`, -`Stream& operator<<(Stream&, Gt::Ray_2)`, -`Stream& operator<<(Stream&, Gt::Line_2)`. +Draws the dual of the +edge `e` to the stream `str`. The dual of `e` is an edge +of the Apollonius diagram. +\pre The following operators must be defined: +`Stream& operator<<(Stream&, Gt::Segment_2)`, +`Stream& operator<<(Stream&, Gt::Ray_2)`, +`Stream& operator<<(Stream&, Gt::Line_2)`. -*/ -template< class Stream > -Stream& draw_dual_edge(Edge e, Stream& str); +*/ +template< class Stream > +Stream& draw_dual_edge(Edge e, Stream& str); /*! -Writes the current -state of the Apollonius graph to an output stream. In particular, -all visible and hidden sites are written as well as the -underlying combinatorial data structure. -*/ -void file_output(std::ostream& os); +Writes the current +state of the Apollonius graph to an output stream. In particular, +all visible and hidden sites are written as well as the +underlying combinatorial data structure. +*/ +void file_output(std::ostream& os); /*! -Reads the state of the -Apollonius graph from an input stream. -*/ -void file_input(std::istream& is); +Reads the state of the +Apollonius graph from an input stream. +*/ +void file_input(std::istream& is); /*! -Writes the current state of the Apollonius graph to an output stream. -*/ -std::ostream& operator<<(std::ostream& os, -Apollonius_graph_2 ag); +Writes the current state of the Apollonius graph to an output stream. +*/ +std::ostream& operator<<(std::ostream& os, +Apollonius_graph_2 ag); /*! -Reads the state of the Apollonius graph from an input stream. -*/ -std::istream& operator>>(std::istream& is, -Apollonius_graph_2 ag); +Reads the state of the Apollonius graph from an input stream. +*/ +std::istream& operator>>(std::istream& is, +Apollonius_graph_2 ag); -/// @} +/// @} -/// \name Validity Check +/// \name Validity Check /// @{ /*! -Checks the validity of the Apollonius graph. If `verbose` is -`true` a short message is sent to `std::cerr`. If `level` -is 0, only the data structure is validated. If `level` is 1, then -both the data structure and the Apollonius graph are -validated. Negative values of `level` always return true, and -values greater then 1 are equivalent to `level` being 1. -*/ -bool is_valid(bool verbose = false, int level = 1); +Checks the validity of the Apollonius graph. If `verbose` is +`true` a short message is sent to `std::cerr`. If `level` +is 0, only the data structure is validated. If `level` is 1, then +both the data structure and the Apollonius graph are +validated. Negative values of `level` always return true, and +values greater then 1 are equivalent to `level` being 1. +*/ +bool is_valid(bool verbose = false, int level = 1); -/// @} +/// @} -/// \name Miscellaneous +/// \name Miscellaneous /// @{ /*! -Clears all contents of the Apollonius graph. -*/ -void clear(); +Clears all contents of the Apollonius graph. +*/ +void clear(); /*! -The Apollonius graphs -`other` and `ag` are swapped. `ag`.`swap(other)` should -be preferred to `ag`` = other` or to `ag``(other)` if -`other` is deleted afterwards. -*/ -void swap(Apollonius_graph_2 -other); +The Apollonius graphs +`other` and `ag` are swapped. `ag`.`swap(other)` should +be preferred to `ag`` = other` or to `ag``(other)` if +`other` is deleted afterwards. +*/ +void swap(Apollonius_graph_2 +other); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h index c49c4a0bb76d..155a7b240cb3 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h @@ -4,73 +4,73 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -The class `Apollonius_graph_filtered_traits_2` provides a model for the -`ApolloniusGraphTraits_2` concept. +The class `Apollonius_graph_filtered_traits_2` provides a model for the +`ApolloniusGraphTraits_2` concept. -The class `Apollonius_graph_filtered_traits_2` uses the filtering technique \cgalCite{cgal:bbp-iayed-01} -to achieve traits for the `Apollonius_graph_2` class -with efficient and exact predicates given an exact -kernel `EK` and a filtering kernel `FK`. The geometric -constructions associated provided by this class are equivalent -to those provided by the traits class -`Apollonius_graph_traits_2`, which means that they may -be inexact. +The class `Apollonius_graph_filtered_traits_2` uses the filtering technique \cgalCite{cgal:bbp-iayed-01} +to achieve traits for the `Apollonius_graph_2` class +with efficient and exact predicates given an exact +kernel `EK` and a filtering kernel `FK`. The geometric +constructions associated provided by this class are equivalent +to those provided by the traits class +`Apollonius_graph_traits_2`, which means that they may +be inexact. -This class has six template parameters. The first, third and fifth -template parameters must be a models of the `Kernel` concept. The -second, fourth and sixth template parameters correspond to how -predicates are evaluated. There are two predefined possible values for +This class has six template parameters. The first, third and fifth +template parameters must be a models of the `Kernel` concept. The +second, fourth and sixth template parameters correspond to how +predicates are evaluated. There are two predefined possible values for `Method_tag`, namely `CGAL::Field_with_sqrt_tag` and `CGAL::Integral_domain_without_division_tag`. The first one must be used when the number type -used in the representation supports the exact evaluation of signs of -expressions involving all four basic operations and square roots, -whereas the second one requires the exact evaluation of signs of -ring-type expressions, i.e., expressions involving only additions, -subtractions and multiplications. -The way the predicates are evaluated is discussed in -\cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}. +used in the representation supports the exact evaluation of signs of +expressions involving all four basic operations and square roots, +whereas the second one requires the exact evaluation of signs of +ring-type expressions, i.e., expressions involving only additions, +subtractions and multiplications. +The way the predicates are evaluated is discussed in +\cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}. -The default values for the template parameters are as follows: +The default values for the template parameters are as follows: `CM = CGAL::Integral_domain_without_division_tag`, -`EK = CGAL::Simple_cartesian`, -`EM = CM`, -`FK = CGAL::Simple_cartesian >`, -`FM = CM`. +`EK = CGAL::Simple_cartesian`, +`EM = CM`, +`FK = CGAL::Simple_cartesian >`, +`FM = CM`. \cgalModels `ApolloniusGraphTraits_2` -\sa `Kernel` -\sa `ApolloniusGraphTraits_2` +\sa `Kernel` +\sa `ApolloniusGraphTraits_2` \sa `CGAL::Integral_domain_without_division_tag` \sa `CGAL::Field_with_sqrt_tag` -\sa `CGAL::Apollonius_graph_2` -\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_2` +\sa `CGAL::Apollonius_graph_traits_2` */ template< typename CK, typename CM, typename EK, typename EM, typename FK, typename FM > class Apollonius_graph_filtered_traits_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -Apollonius_graph_filtered_traits_2(); +%Default constructor. +*/ +Apollonius_graph_filtered_traits_2(); /*! -Copy -constructor. -*/ -Apollonius_graph_filtered_traits_2 -(Apollonius_graph_filtered_traits_2 other); +Copy +constructor. +*/ +Apollonius_graph_filtered_traits_2 +(Apollonius_graph_filtered_traits_2 other); /*! -Assignment -operator. -*/ -Apollonius_graph_filtered_traits_2 operator=(other); +Assignment +operator. +*/ +Apollonius_graph_filtered_traits_2 operator=(other); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h index 4dbe28f82786..24a11cebc802 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h @@ -4,234 +4,234 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -We provide an alternative to the class -`Apollonius_graph_2` for the dynamic -construction of the Apollonius graph. The `Apollonius_graph_hierarchy_2` class maintains -a hierarchy of Apollonius graphs. The bottom-most level of the -hierarchy contains the full Apollonius diagram. A site that -is in level \f$ i\f$, is in level \f$ i+1\f$ with probability \f$ 1/\alpha\f$ -where \f$ \alpha > 1\f$ is some constant. The difference between the -`Apollonius_graph_2` class and the -`Apollonius_graph_hierarchy_2` is on how the nearest neighbor location is done. Given a -point \f$ p\f$ the location is done as follows: at the top most level we -find the nearest neighbor of \f$ p\f$ as in the -`Apollonius_graph_2` class. At every subsequent level \f$ i\f$ -we use the nearest neighbor found at level \f$ i+1\f$ to find the nearest -neighbor at level \f$ i\f$. This is a variant of the corresponding -hierarchy for points found in \cgalCite{d-iirdt-98}. -The class has two template parameters which have essentially the same -meaning as in the `Apollonius_graph_2` class. The first -template parameter must be a model of the -`ApolloniusGraphTraits_2` concept. -The second template parameter must be a model of the -`ApolloniusGraphDataStructure_2` concept. However, the vertex base -class that is to be used in the Apollonius graph data structure must -be a model of the `ApolloniusGraphHierarchyVertexBase_2` concept. -The second template parameter defaults to -`Triangulation_data_structure_2< Apollonius_graph_hierarchy_vertex_base_2< Apollonius_graph_vertex_base_2 >, Triangulation_face_base_2 >`. - -The `Apollonius_graph_hierarchy_2` class derives publicly from the -`Apollonius_graph_2` class. The interface is -the same with its base class. In the sequel only the methods -overridden are documented. +We provide an alternative to the class +`Apollonius_graph_2` for the dynamic +construction of the Apollonius graph. The `Apollonius_graph_hierarchy_2` class maintains +a hierarchy of Apollonius graphs. The bottom-most level of the +hierarchy contains the full Apollonius diagram. A site that +is in level \f$ i\f$, is in level \f$ i+1\f$ with probability \f$ 1/\alpha\f$ +where \f$ \alpha > 1\f$ is some constant. The difference between the +`Apollonius_graph_2` class and the +`Apollonius_graph_hierarchy_2` is on how the nearest neighbor location is done. Given a +point \f$ p\f$ the location is done as follows: at the top most level we +find the nearest neighbor of \f$ p\f$ as in the +`Apollonius_graph_2` class. At every subsequent level \f$ i\f$ +we use the nearest neighbor found at level \f$ i+1\f$ to find the nearest +neighbor at level \f$ i\f$. This is a variant of the corresponding +hierarchy for points found in \cgalCite{d-iirdt-98}. +The class has two template parameters which have essentially the same +meaning as in the `Apollonius_graph_2` class. The first +template parameter must be a model of the +`ApolloniusGraphTraits_2` concept. +The second template parameter must be a model of the +`ApolloniusGraphDataStructure_2` concept. However, the vertex base +class that is to be used in the Apollonius graph data structure must +be a model of the `ApolloniusGraphHierarchyVertexBase_2` concept. +The second template parameter defaults to +`Triangulation_data_structure_2< Apollonius_graph_hierarchy_vertex_base_2< Apollonius_graph_vertex_base_2 >, Triangulation_face_base_2 >`. + +The `Apollonius_graph_hierarchy_2` class derives publicly from the +`Apollonius_graph_2` class. The interface is +the same with its base class. In the sequel only the methods +overridden are documented. \cgalHeading{Types} -`Apollonius_graph_hierarchy_2` does not introduce other types than those introduced by -its base class `Apollonius_graph_2`. +`Apollonius_graph_hierarchy_2` does not introduce other types than those introduced by +its base class `Apollonius_graph_2`. -\sa `ApolloniusGraphDataStructure_2` -\sa `ApolloniusGraphTraits_2` -\sa `ApolloniusGraphHierarchyVertexBase_2` -\sa `CGAL::Apollonius_graph_2` -\sa `CGAL::Triangulation_data_structure_2` -\sa `CGAL::Apollonius_graph_traits_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` -\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` +\sa `ApolloniusGraphDataStructure_2` +\sa `ApolloniusGraphTraits_2` +\sa `ApolloniusGraphHierarchyVertexBase_2` +\sa `CGAL::Apollonius_graph_2` +\sa `CGAL::Triangulation_data_structure_2` +\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` */ template< typename Gt, typename Agds > class Apollonius_graph_hierarchy_2 : public CGAL::Apollonius_graph_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -Creates an hierarchy of Apollonius graphs using `gt` as -geometric traits. -*/ -Apollonius_graph_hierarchy_2(Gt -gt=Gt()); +Creates an hierarchy of Apollonius graphs using `gt` as +geometric traits. +*/ +Apollonius_graph_hierarchy_2(Gt +gt=Gt()); /*! -Creates an Apollonius graph hierarchy using -`gt` as geometric traits and inserts all sites in the -range [`first`, `beyond`). -*/ -template< class Input_iterator > -Apollonius_graph_hierarchy_2(Input_iterator -first, Input_iterator beyond, Gt gt=Gt()); +Creates an Apollonius graph hierarchy using +`gt` as geometric traits and inserts all sites in the +range [`first`, `beyond`). +*/ +template< class Input_iterator > +Apollonius_graph_hierarchy_2(Input_iterator +first, Input_iterator beyond, Gt gt=Gt()); /*! -Copy constructor. All faces, vertices and inter-level pointers -are duplicated. After the construction, `agh` and `other` refer -to two different Apollonius graph hierarchies: if -`other` is modified, `agh` is not. -*/ -Apollonius_graph_hierarchy_2 -(Apollonius_graph_hierarchy_2 other); +Copy constructor. All faces, vertices and inter-level pointers +are duplicated. After the construction, `agh` and `other` refer +to two different Apollonius graph hierarchies: if +`other` is modified, `agh` is not. +*/ +Apollonius_graph_hierarchy_2 +(Apollonius_graph_hierarchy_2 other); /*! -Assignment. All faces, vertices and inter-level pointers -are duplicated. After the construction, `agh` and `other` refer -to two different Apollonius graph hierarchies: if -`other` is modified, `agh` is not. -*/ -Apollonius_graph_hierarchy_2 -operator=(Apollonius_graph_hierarchy_2 -other); +Assignment. All faces, vertices and inter-level pointers +are duplicated. After the construction, `agh` and `other` refer +to two different Apollonius graph hierarchies: if +`other` is modified, `agh` is not. +*/ +Apollonius_graph_hierarchy_2 +operator=(Apollonius_graph_hierarchy_2 +other); -/// @} +/// @} -/// \name Insertion +/// \name Insertion /// @{ /*! -Inserts the sites in the range -[`first`,`beyond`). The number of sites in the range -[`first`, `beyond`) is returned. -\pre `Input_iterator` must be a model of `InputIterator` and its value type must be `Site_2`. -*/ -template< class Input_iterator > -unsigned int insert(Input_iterator first, Input_iterator beyond); +Inserts the sites in the range +[`first`,`beyond`). The number of sites in the range +[`first`, `beyond`) is returned. +\pre `Input_iterator` must be a model of `InputIterator` and its value type must be `Site_2`. +*/ +template< class Input_iterator > +unsigned int insert(Input_iterator first, Input_iterator beyond); /*! -Inserts the -site `s` in the Apollonius graph hierarchy. If `s` -is visible then the vertex handle of `s` is returned, otherwise -`Vertex_handle(nullptr)` is returned. -*/ -Vertex_handle insert(Site_2 s); +Inserts the +site `s` in the Apollonius graph hierarchy. If `s` +is visible then the vertex handle of `s` is returned, otherwise +`Vertex_handle(nullptr)` is returned. +*/ +Vertex_handle insert(Site_2 s); /*! -Inserts `s` in the Apollonius graph hierarchy using the -site associated with `vnear` as -an estimate for the nearest neighbor of the center of `s`. -If `s` is visible then the vertex handle of `s` is -returned, otherwise `Vertex_handle(nullptr)` is returned. -A call to this method is equivalent to `agh.insert(s);` and it has -been added for the sake of conformity with the interface of the -`Apollonius_graph_2` class. -*/ -Vertex_handle insert(Site_2 s, Vertex_handle -vnear); +Inserts `s` in the Apollonius graph hierarchy using the +site associated with `vnear` as +an estimate for the nearest neighbor of the center of `s`. +If `s` is visible then the vertex handle of `s` is +returned, otherwise `Vertex_handle(nullptr)` is returned. +A call to this method is equivalent to `agh.insert(s);` and it has +been added for the sake of conformity with the interface of the +`Apollonius_graph_2` class. +*/ +Vertex_handle insert(Site_2 s, Vertex_handle +vnear); -/// @} +/// @} -/// \name Removal +/// \name Removal /// @{ /*! -Removes the site -associated to the vertex handle `v` from the Apollonius -graph hierarchy. -\pre `v` must correspond to a valid finite vertex of the Apollonius graph hierarchy. -*/ -void remove(Vertex_handle v); +Removes the site +associated to the vertex handle `v` from the Apollonius +graph hierarchy. +\pre `v` must correspond to a valid finite vertex of the Apollonius graph hierarchy. +*/ +void remove(Vertex_handle v); -/// @} +/// @} -/// \name Nearest Neighbor Location +/// \name Nearest Neighbor Location /// @{ /*! -Finds the nearest neighbor of the point `p`. In other words it -finds the site whose Apollonius cell contains `p`. Ties are broken -arbitrarily and one of the nearest neighbors of `p` is -returned. If there are no visible sites in the Apollonius diagram -`Vertex_handle(nullptr)` is returned. -*/ -Vertex_handle nearest_neighbor(Point p); +Finds the nearest neighbor of the point `p`. In other words it +finds the site whose Apollonius cell contains `p`. Ties are broken +arbitrarily and one of the nearest neighbors of `p` is +returned. If there are no visible sites in the Apollonius diagram +`Vertex_handle(nullptr)` is returned. +*/ +Vertex_handle nearest_neighbor(Point p); /*! -Finds the nearest neighbor of the point -`p`. If there are no visible sites in the Apollonius diagram -`Vertex_handle(nullptr)` is returned. -A call to this method is equivalent to -`agh.nearest_neighbor(p);` and it has been added for the sake of -conformity with the interface of the -`Apollonius_graph_2` class. -*/ -Vertex_handle nearest_neighbor(Point p, -Vertex_handle vnear); +Finds the nearest neighbor of the point +`p`. If there are no visible sites in the Apollonius diagram +`Vertex_handle(nullptr)` is returned. +A call to this method is equivalent to +`agh.nearest_neighbor(p);` and it has been added for the sake of +conformity with the interface of the +`Apollonius_graph_2` class. +*/ +Vertex_handle nearest_neighbor(Point p, +Vertex_handle vnear); -/// @} +/// @} -/// \name I/O +/// \name I/O /// @{ /*! -Writes the current -state of the Apollonius graph hierarchy to an output stream. In particular, -all visible and hidden sites are written as well as the -underlying combinatorial hierarchical data structure. -*/ -void file_output(std::ostream& os); +Writes the current +state of the Apollonius graph hierarchy to an output stream. In particular, +all visible and hidden sites are written as well as the +underlying combinatorial hierarchical data structure. +*/ +void file_output(std::ostream& os); /*! -Reads the state of the -Apollonius graph hierarchy from an input stream. -*/ -void file_input(std::istream& is); +Reads the state of the +Apollonius graph hierarchy from an input stream. +*/ +void file_input(std::istream& is); /*! -Writes the current state of the Apollonius graph hierarchy to an -output stream. -*/ -std::ostream& operator<<(std::ostream& os, Apollonius_graph_hierarchy_2 agh); +Writes the current state of the Apollonius graph hierarchy to an +output stream. +*/ +std::ostream& operator<<(std::ostream& os, Apollonius_graph_hierarchy_2 agh); /*! -Reads the state of the Apollonius graph hierarchy from an input stream. -*/ -std::istream& operator>>(std::istream& is, Apollonius_graph_hierarchy_2 agh); +Reads the state of the Apollonius graph hierarchy from an input stream. +*/ +std::istream& operator>>(std::istream& is, Apollonius_graph_hierarchy_2 agh); -/// @} +/// @} -/// \name Validity Check +/// \name Validity Check /// @{ /*! -Checks the validity of the Apollonius graph hierarchy. If -`verbose` is `true` a short message is sent to -`std::cerr`. If `level` is 0, the data structure at all levels -is validated, as well as the inter-level pointers. If `level` is -1, then the data structure at all levels is validated, the inter-level -pointers are validated and all levels of the Apollonius graph -hierarchy are also validated. Negative values of `level` always -return `true`, and values greater then 1 are equivalent to -`level` being 1. -*/ -bool is_valid(bool verbose = false, int level = 1) const; +Checks the validity of the Apollonius graph hierarchy. If +`verbose` is `true` a short message is sent to +`std::cerr`. If `level` is 0, the data structure at all levels +is validated, as well as the inter-level pointers. If `level` is +1, then the data structure at all levels is validated, the inter-level +pointers are validated and all levels of the Apollonius graph +hierarchy are also validated. Negative values of `level` always +return `true`, and values greater then 1 are equivalent to +`level` being 1. +*/ +bool is_valid(bool verbose = false, int level = 1) const; -/// @} +/// @} -/// \name Miscellaneous +/// \name Miscellaneous /// @{ /*! -Clears all contents of the Apollonius graph -hierarchy. -*/ -void clear(); +Clears all contents of the Apollonius graph +hierarchy. +*/ +void clear(); /*! -The Apollonius graph hierarchies `other` and `agh` are -swapped. `agh`.`swap(other)` should be preferred to `agh`` = -other` or to `agh``(other)` if `other` is deleted afterwards. -*/ -void swap(Apollonius_graph_hierarchy_2 -other); +The Apollonius graph hierarchies `other` and `agh` are +swapped. `agh`.`swap(other)` should be preferred to `agh`` = +other` or to `agh``(other)` if `other` is deleted afterwards. +*/ +void swap(Apollonius_graph_hierarchy_2 +other); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h index 5dd5bf067930..3d6bc26db216 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h @@ -4,45 +4,45 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -The class `Apollonius_graph_hierarchy_vertex_base_2` provides a model for the -`ApolloniusGraphHierarchyVertexBase_2` concept, which is the -vertex base required by the -`Apollonius_graph_hierarchy_2` class. The class -`Apollonius_graph_hierarchy_vertex_base_2` is templated by a class `Agvb` which must be a model -of the `ApolloniusGraphVertexBase_2` concept. +The class `Apollonius_graph_hierarchy_vertex_base_2` provides a model for the +`ApolloniusGraphHierarchyVertexBase_2` concept, which is the +vertex base required by the +`Apollonius_graph_hierarchy_2` class. The class +`Apollonius_graph_hierarchy_vertex_base_2` is templated by a class `Agvb` which must be a model +of the `ApolloniusGraphVertexBase_2` concept. \cgalModels `ApolloniusGraphHierarchyVertexBase_2` -\sa `ApolloniusGraphVertexBase_2` -\sa `ApolloniusGraphHierarchyVertexBase_2` -\sa `CGAL::Apollonius_graph_vertex_base_2` +\sa `ApolloniusGraphVertexBase_2` +\sa `ApolloniusGraphHierarchyVertexBase_2` +\sa `CGAL::Apollonius_graph_vertex_base_2` */ template< typename Agvb > class Apollonius_graph_hierarchy_vertex_base_2 : Agvb { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -Apollonius_graph_hierarchy_vertex_base_2(); +%Default constructor. +*/ +Apollonius_graph_hierarchy_vertex_base_2(); /*! -Constructs a vertex associated with the site `s` and -embedded at the center of `s`. -*/ -Apollonius_graph_hierarchy_vertex_base_2(Site_2 s); +Constructs a vertex associated with the site `s` and +embedded at the center of `s`. +*/ +Apollonius_graph_hierarchy_vertex_base_2(Site_2 s); /*! -Constructs a vertex associated with -the site `s`, embedded at the center of `s`, -and pointing to the face associated with the face -handle `f`. -*/ -Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f); +Constructs a vertex associated with +the site `s`, embedded at the center of `s`, +and pointing to the face associated with the face +handle `f`. +*/ +Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h index 2b9ebca56250..ae347df1437e 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h @@ -4,55 +4,55 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -The class `Apollonius_graph_traits_2` provides a model for the -`ApolloniusGraphTraits_2` concept. -This class has two template parameters. The first template parameter -must be a model of the `Kernel` concept. The second template -parameter corresponds to how predicates are evaluated. There are two -predefined possible values for `Method_tag`, namely +The class `Apollonius_graph_traits_2` provides a model for the +`ApolloniusGraphTraits_2` concept. +This class has two template parameters. The first template parameter +must be a model of the `Kernel` concept. The second template +parameter corresponds to how predicates are evaluated. There are two +predefined possible values for `Method_tag`, namely `CGAL::Field_with_sqrt_tag` and `CGAL::Integral_domain_without_division_tag`. The first one -must be used when the number type used in the representation supports -the exact evaluation of signs of expressions involving all four basic -operations and square roots, whereas the second one requires the exact -evaluation of signs of ring-type expressions, i.e., expressions -involving only additions, subtractions and multiplications. The +must be used when the number type used in the representation supports +the exact evaluation of signs of expressions involving all four basic +operations and square roots, whereas the second one requires the exact +evaluation of signs of ring-type expressions, i.e., expressions +involving only additions, subtractions and multiplications. The default value for `Method_tag` is `CGAL::Integral_domain_without_division_tag`. -The way the predicates are evaluated is discussed in -\cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}. +The way the predicates are evaluated is discussed in +\cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}. \cgalModels `ApolloniusGraphTraits_2` -\sa `Kernel` -\sa `ApolloniusGraphTraits_2` +\sa `Kernel` +\sa `ApolloniusGraphTraits_2` \sa `CGAL::Integral_domain_without_division_tag` \sa `CGAL::Field_with_sqrt_tag` -\sa `CGAL::Apollonius_graph_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `CGAL::Apollonius_graph_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` */ template< typename K, typename Method_tag > class Apollonius_graph_traits_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -Apollonius_graph_traits_2(); +%Default constructor. +*/ +Apollonius_graph_traits_2(); /*! -Copy constructor. -*/ -Apollonius_graph_traits_2(Apollonius_graph_traits_2 other); +Copy constructor. +*/ +Apollonius_graph_traits_2(Apollonius_graph_traits_2 other); /*! -Assignment operator. -*/ -Apollonius_graph_traits_2 -operator=(Apollonius_graph_traits_2 -other); +Assignment operator. +*/ +Apollonius_graph_traits_2 +operator=(Apollonius_graph_traits_2 +other); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h index c86d80b0b1a3..a4ba4a49194b 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h @@ -4,54 +4,54 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -The class `Apollonius_graph_vertex_base_2` provides a model for the -`ApolloniusGraphVertexBase_2` concept which is the vertex base -required by the `ApolloniusGraphDataStructure_2` concept. The -class `Apollonius_graph_vertex_base_2` has two template arguments, the first being the -geometric traits of the Apollonius graph and should be a model of the -concept `ApolloniusGraphTraits_2`. The second is a Boolean which -controls whether hidden sites are actually stored. Such a -control is important if the user is not interested in hidden sites -and/or if only insertions are made, in which case no hidden -site can become visible. If `StoreHidden` is set to -`true`, hidden sites are stored, otherwise they are -discarded. By default `StoreHidden` is set to `true`. +The class `Apollonius_graph_vertex_base_2` provides a model for the +`ApolloniusGraphVertexBase_2` concept which is the vertex base +required by the `ApolloniusGraphDataStructure_2` concept. The +class `Apollonius_graph_vertex_base_2` has two template arguments, the first being the +geometric traits of the Apollonius graph and should be a model of the +concept `ApolloniusGraphTraits_2`. The second is a Boolean which +controls whether hidden sites are actually stored. Such a +control is important if the user is not interested in hidden sites +and/or if only insertions are made, in which case no hidden +site can become visible. If `StoreHidden` is set to +`true`, hidden sites are stored, otherwise they are +discarded. By default `StoreHidden` is set to `true`. \cgalModels `ApolloniusGraphVertexBase_2` -\sa `ApolloniusGraphVertexBase_2` -\sa `ApolloniusGraphDataStructure_2` -\sa `ApolloniusGraphTraits_2` -\sa `CGAL::Triangulation_data_structure_2` -\sa `CGAL::Apollonius_graph_traits_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `ApolloniusGraphVertexBase_2` +\sa `ApolloniusGraphDataStructure_2` +\sa `ApolloniusGraphTraits_2` +\sa `CGAL::Triangulation_data_structure_2` +\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` */ template< typename Gt, typename StoreHidden > class Apollonius_graph_vertex_base_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -Apollonius_graph_bertex_base_2(); +%Default constructor. +*/ +Apollonius_graph_bertex_base_2(); /*! -Constructs a vertex associated with the site `s` and -embedded at the center of `s`. -*/ -Apollonius_graph_vertex_base_2(Site_2 s); +Constructs a vertex associated with the site `s` and +embedded at the center of `s`. +*/ +Apollonius_graph_vertex_base_2(Site_2 s); /*! -Constructs a vertex associated with -the site `s`, embedded at the center of `s`, -and pointing to the face associated with the face -handle `f`. -*/ -Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f); +Constructs a vertex associated with +the site `s`, embedded at the center of `s`, +and pointing to the face associated with the face +handle `f`. +*/ +Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h index a77be4d6fe1a..03bee290f372 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h @@ -4,79 +4,79 @@ namespace CGAL { /*! \ingroup PkgApolloniusGraph2Ref -The class `Apollonius_site_2` is a model for the concept -`ApolloniusSite_2`. It is parametrized by a template parameter -`K` which must be a model of the `Kernel` concept. +The class `Apollonius_site_2` is a model for the concept +`ApolloniusSite_2`. It is parametrized by a template parameter +`K` which must be a model of the `Kernel` concept. \cgalModels `ApolloniusSite_2` \cgalHeading{Types} -The class `Apollonius_site_2` does not introduce any types in addition to the -concept `ApolloniusSite_2`. +The class `Apollonius_site_2` does not introduce any types in addition to the +concept `ApolloniusSite_2`. \cgalHeading{I/O} -The I/O operators are defined for `iostream`. +The I/O operators are defined for `iostream`. -The information output in the `iostream` is: the point of the -Apollonius site and its weight. +The information output in the `iostream` is: the point of the +Apollonius site and its weight. -\sa `Kernel` -\sa `ApolloniusSite_2` -\sa `CGAL::Qt_widget` -\sa `CGAL::Apollonius_graph_traits_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `Kernel` +\sa `ApolloniusSite_2` +\sa `CGAL::Qt_widget` +\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` */ template< typename K > class Apollonius_site_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -*/ -Apollonius_site_2(Point_2 p=Point_2(), Weight w= Weight(0)); +*/ +Apollonius_site_2(Point_2 p=Point_2(), Weight w= Weight(0)); /*! -Copy constructor. -*/ -Apollonius_site_2(Apollonius_site_2 other); +Copy constructor. +*/ +Apollonius_site_2(Apollonius_site_2 other); /// @} }; /* end Apollonius_site_2 */ /*! -Inserts the -Apollonius site `s` into the stream `os`. +Inserts the +Apollonius site `s` into the stream `os`. \note Included through `CGAL/IO/Qt_widget_Apollonius_site_2.h`. -\pre The insert operator must be defined for `Point_2` and `Weight`. -\relates Apollonius_site_2 -*/ -std::ostream& operator<<(std::ostream& os, -const Apollonius_site_2& s); +\pre The insert operator must be defined for `Point_2` and `Weight`. +\relates Apollonius_site_2 +*/ +std::ostream& operator<<(std::ostream& os, +const Apollonius_site_2& s); /*! -Reads an Apollonius site from the stream `is` and assigns it -to `s`. +Reads an Apollonius site from the stream `is` and assigns it +to `s`. \note Included through `CGAL/IO/Qt_widget_Apollonius_site_2.h`. -\pre The extract operator must be defined for `Point_2` and `Weight`. -\relates Apollonius_site_2 -*/ -std::istream& operator>>(std::istream& is, -const Apollonius_site_2& s); +\pre The extract operator must be defined for `Point_2` and `Weight`. +\relates Apollonius_site_2 +*/ +std::istream& operator>>(std::istream& is, +const Apollonius_site_2& s); /*! -Inserts the Apollonius site `s` into the `Qt_widget` stream `w`. +Inserts the Apollonius site `s` into the `Qt_widget` stream `w`. \note Included through `CGAL/IO/Qt_widget_Apollonius_site_2.h`. -\pre The insert operator must be defined for `K::Circle_2`. -\relates Apollonius_site_2 -*/ -Qt_widget& operator<<(Qt_widget& w, -const Apollonius_site_2& s); +\pre The insert operator must be defined for `K::Circle_2`. +\relates Apollonius_site_2 +*/ +Qt_widget& operator<<(Qt_widget& w, +const Apollonius_site_2& s); } /* end namespace CGAL */ diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphDataStructure_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphDataStructure_2.h index de0a9523f970..c2f31f5fa593 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphDataStructure_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphDataStructure_2.h @@ -3,17 +3,17 @@ \ingroup PkgApolloniusGraph2Concepts \cgalConcept -The concept `ApolloniusGraphDataStructure_2` refines the concept -`TriangulationDataStructure_2`. In addition -it provides two methods for the insertion and removal of a degree 2 -vertex in the data structure. The insertion method adds a new vertex -to the specified edge, thus creating two new edges. Moreover, it -creates two new faces that have the two newly created edges in -common (see figure below). The removal method performs the reverse -operation. - -\image html insert_degree_2.png -\image latex insert_degree_2.png +The concept `ApolloniusGraphDataStructure_2` refines the concept +`TriangulationDataStructure_2`. In addition +it provides two methods for the insertion and removal of a degree 2 +vertex in the data structure. The insertion method adds a new vertex +to the specified edge, thus creating two new edges. Moreover, it +creates two new faces that have the two newly created edges in +common (see figure below). The removal method performs the reverse +operation. + +\image html insert_degree_2.png +\image latex insert_degree_2.png
    Insertion and removal of degree 2 vertices. Left to right: The edge `(f,i)` is replaced by two edges by means of inserting a @@ -22,45 +22,45 @@ created. Right to left: the faces \f$ f_1\f$ and \f$ f_2\f$ are destroyed. The vertex `v` is deleted and its two adjacent edges are merged.
    -We only describe the additional requirements with respect to the -`TriangulationDataStructure_2` concept. +We only describe the additional requirements with respect to the +`TriangulationDataStructure_2` concept. -\cgalRefines `TriangulationDataStructure_2` +\cgalRefines `TriangulationDataStructure_2` -\cgalHasModel `CGAL::Triangulation_data_structure_2` +\cgalHasModel `CGAL::Triangulation_data_structure_2` -\sa `TriangulationDataStructure_2` -\sa `ApolloniusGraphVertexBase_2` -\sa `TriangulationFaceBase_2` +\sa `TriangulationDataStructure_2` +\sa `ApolloniusGraphVertexBase_2` +\sa `TriangulationFaceBase_2` */ class ApolloniusGraphDataStructure_2 { public: -/// \name Insertion +/// \name Insertion /// @{ /*! -Inserts -a degree two vertex and two faces adjacent to it that have two common -edges. The edge defined by the face handle `f` and the integer -`i` is duplicated. It returns a handle to the vertex created. -*/ -Vertex_handle insert_degree_2(Face_handle f, int i); +Inserts +a degree two vertex and two faces adjacent to it that have two common +edges. The edge defined by the face handle `f` and the integer +`i` is duplicated. It returns a handle to the vertex created. +*/ +Vertex_handle insert_degree_2(Face_handle f, int i); -/// @} +/// @} -/// \name Removal +/// \name Removal /// @{ /*! -Removes a degree 2 -vertex and the two faces adjacent to it. The two edges of the star of -`v` that are not incident to it are collapsed. -\pre The degree of `v` must be equal to 2. -*/ -void remove_degree_2(Vertex_handle v); +Removes a degree 2 +vertex and the two faces adjacent to it. The two edges of the star of +`v` that are not incident to it are collapsed. +\pre The degree of `v` must be equal to 2. +*/ +void remove_degree_2(Vertex_handle v); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h index 2d769d3d9e84..7de3add41e0b 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h @@ -3,87 +3,87 @@ \ingroup PkgApolloniusGraph2Concepts \cgalConcept -The vertex of an Apollonius graph -included in an Apollonius graph hierarchy has to provide -some pointers to the corresponding vertices in the -graphs of the next and preceding levels. -Therefore, the concept `ApolloniusGraphHierarchyVertexBase_2` -refines the concept `ApolloniusGraphVertexBase_2`, by -adding two vertex handles to the corresponding vertices for the -next and previous level graphs. +The vertex of an Apollonius graph +included in an Apollonius graph hierarchy has to provide +some pointers to the corresponding vertices in the +graphs of the next and preceding levels. +Therefore, the concept `ApolloniusGraphHierarchyVertexBase_2` +refines the concept `ApolloniusGraphVertexBase_2`, by +adding two vertex handles to the corresponding vertices for the +next and previous level graphs. -\cgalRefines `ApolloniusGraphVertexBase_2` +\cgalRefines `ApolloniusGraphVertexBase_2` \cgalHeading{Types} -`ApolloniusGraphHierarchyVertexBase_2` does not introduce any -types in addition to those of `ApolloniusGraphVertexBase_2`. +`ApolloniusGraphHierarchyVertexBase_2` does not introduce any +types in addition to those of `ApolloniusGraphVertexBase_2`. -\cgalHasModel CGAL::Apollonius_graph_hierarchy_vertex_base_2 > +\cgalHasModel CGAL::Apollonius_graph_hierarchy_vertex_base_2 > -\sa `ApolloniusGraphDataStructure_2` -\sa `ApolloniusGraphVertexBase_2` -\sa `CGAL::Apollonius_graph_hierarchy_2` -\sa `CGAL::Triangulation_data_structure_2` -\sa `CGAL::Apollonius_graph_vertex_base_2` -\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` +\sa `ApolloniusGraphDataStructure_2` +\sa `ApolloniusGraphVertexBase_2` +\sa `CGAL::Apollonius_graph_hierarchy_2` +\sa `CGAL::Triangulation_data_structure_2` +\sa `CGAL::Apollonius_graph_vertex_base_2` +\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` */ class ApolloniusGraphHierarchyVertexBase_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -Default -constructor. -*/ -ApolloniusGraphHierarchyVertexBase_2(); +Default +constructor. +*/ +ApolloniusGraphHierarchyVertexBase_2(); /*! -Constructs a vertex associated with the site `s` and -embedded at the center of `s`. -*/ -ApolloniusGraphHierarchyVertexBase_2(Site_2 s).; +Constructs a vertex associated with the site `s` and +embedded at the center of `s`. +*/ +ApolloniusGraphHierarchyVertexBase_2(Site_2 s).; /*! -Constructs a vertex associated with -the site `s`, embedded at the center of `s`, -and pointing to face `f`. -*/ -ApolloniusGraphHierarchyVertexBase_2(Site_2 s, Face_handle f).; +Constructs a vertex associated with +the site `s`, embedded at the center of `s`, +and pointing to face `f`. +*/ +ApolloniusGraphHierarchyVertexBase_2(Site_2 s, Face_handle f).; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Returns a handle to the corresponding -vertex of the next level Apollonius graph. If such a vertex does not -exist `Vertex_handle(nullptr)` is returned. -*/ -Vertex_handle up(); +Returns a handle to the corresponding +vertex of the next level Apollonius graph. If such a vertex does not +exist `Vertex_handle(nullptr)` is returned. +*/ +Vertex_handle up(); /*! -Returns a handle to the corresponding -vertex of the previous level Apollonius graph. -*/ -Vertex_handle down(); +Returns a handle to the corresponding +vertex of the previous level Apollonius graph. +*/ +Vertex_handle down(); /*! -Sets the handle for the -vertex of the next level Apollonius graph. -*/ -void set_up(Vertex_handle u); +Sets the handle for the +vertex of the next level Apollonius graph. +*/ +void set_up(Vertex_handle u); /*! -Sets the handle for the -vertex of the previous level Apollonius graph; -*/ -void set_down(Vertex_handle d); +Sets the handle for the +vertex of the previous level Apollonius graph; +*/ +void set_down(Vertex_handle d); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphTraits_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphTraits_2.h index c817820fac4d..5ef6ff44848d 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphTraits_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphTraits_2.h @@ -5,391 +5,391 @@ \cgalRefines `TriangulationTraits_2` -The concept `ApolloniusGraphTraits_2` provides the traits -requirements for the `Apollonius_graph_2` class. In particular, -it provides a type `Site_2`, which must be a model of the concept -`ApolloniusSite_2`. It also provides -constructions for sites and several function object -types for the predicates. +The concept `ApolloniusGraphTraits_2` provides the traits +requirements for the `Apollonius_graph_2` class. In particular, +it provides a type `Site_2`, which must be a model of the concept +`ApolloniusSite_2`. It also provides +constructions for sites and several function object +types for the predicates. -\cgalHasModel `CGAL::Apollonius_graph_traits_2` -\cgalHasModel `CGAL::Apollonius_graph_filtered_traits_2` +\cgalHasModel `CGAL::Apollonius_graph_traits_2` +\cgalHasModel `CGAL::Apollonius_graph_filtered_traits_2` -\sa `CGAL::Apollonius_graph_2` -\sa `CGAL::Apollonius_graph_traits_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `CGAL::Apollonius_graph_2` +\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` */ class ApolloniusGraphTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -A type for a point. -*/ -typedef unspecified_type Point_2; +A type for a point. +*/ +typedef unspecified_type Point_2; + +/*! +A type for an Apollonius site. Must be a model +of the concept `ApolloniusSite_2`. +*/ +typedef unspecified_type Site_2; /*! -A type for an Apollonius site. Must be a model -of the concept `ApolloniusSite_2`. -*/ -typedef unspecified_type Site_2; +A type for a line. Only required if access to +the dual of the Apollonius graph is required or if the primal +or dual diagram are inserted in a stream. +*/ +typedef unspecified_type Line_2; + +/*! +A type for a ray. Only required if access to +the dual of the Apollonius graph is required or if the primal +or dual diagram are inserted in a stream. +*/ +typedef unspecified_type Ray_2; /*! -A type for a line. Only required if access to -the dual of the Apollonius graph is required or if the primal -or dual diagram are inserted in a stream. -*/ -typedef unspecified_type Line_2; +A type for a segment. Only required if access to +the dual of the Apollonius graph is required or if the primal +or dual diagram are inserted in a stream. +*/ +typedef unspecified_type Segment_2; /*! -A type for a ray. Only required if access to -the dual of the Apollonius graph is required or if the primal -or dual diagram are inserted in a stream. -*/ -typedef unspecified_type Ray_2; +A type representing different types of objects +in two dimensions, namely: `Point_2`, `Site_2`, +`Line_2`, `Ray_2` and `Segment_2`. +*/ +typedef unspecified_type Object_2; /*! -A type for a segment. Only required if access to -the dual of the Apollonius graph is required or if the primal -or dual diagram are inserted in a stream. -*/ -typedef unspecified_type Segment_2; +A type for the field number type of sites. +*/ +typedef unspecified_type FT; /*! -A type representing different types of objects -in two dimensions, namely: `Point_2`, `Site_2`, -`Line_2`, `Ray_2` and `Segment_2`. -*/ -typedef unspecified_type Object_2; +A type for the ring number type of sites. +*/ +typedef unspecified_type RT; /*! -A type for the field number type of sites. -*/ -typedef unspecified_type FT; +Must provide `template bool operator() ( T& t, +Object_2 o)` which assigns `o` to `t` if `o` was +constructed from an object of type `T`. Returns +`true`, if the assignment was possible. +*/ +typedef unspecified_type Assign_2; /*! -A type for the ring number type of sites. -*/ -typedef unspecified_type RT; +Must provide `template +Object_2 operator()( T t)` that constructs an object of type +`Object_2` that contains `t` and returns it. +*/ +typedef unspecified_type Construct_object_2; /*! -Must provide `template bool operator() ( T& t, -Object_2 o)` which assigns `o` to `t` if `o` was -constructed from an object of type `T`. Returns -`true`, if the assignment was possible. -*/ -typedef unspecified_type Assign_2; + +A constructor for a point of the Apollonius diagram equidistant +from three sites. Must provide +`Point_2 operator()(Site_2 s1, Site_2 s2, Site_2 s3)`, which +constructs a point equidistant from the sites `s1`, `s2` and +`s3`. + +*/ +typedef unspecified_type Construct_Apollonius_vertex_2; + +/*! +A constructor for +a dual Apollonius site (a site whose center is a +vertex of the Apollonius diagram and its weight is the common +distance of its center from the three defining sites). +Must provide `Site_2 operator()(Site_2 s1, +Site_2 s2, Site_2 s3)`, which constructs a +dual site whose center \f$ c\f$ is equidistant from `s1`, `s2` and +`s3`, and its weight is equal to the (signed) distance of \f$ c\f$ +from `s1` (or `s2` or `s3`). + +Must also provide `Line_2 operator()(Site_2 s1, Site_2 s2)`, which +constructs a line bitangent to `s1` and `s2`. This line is the +dual site of `s1`, `s2` and the site at infinity; it can be +viewed as a dual Apollonius site whose center is at infinity +and its weight is infinite. + +*/ +typedef unspecified_type Construct_Apollonius_site_2; + +/*! +A predicate object type. Must +provide `Comparison_result operator()(Site_2 s1, +Site_2 s2)`, which compares the \f$ x\f$-coordinates of the centers of +`s1` and `s2`. +*/ +typedef unspecified_type Compare_x_2; + +/*! +A predicate object type. Must +provide `Comparison_result operator()(Site_2 s1, +Site_2 s2)`, which compares the \f$ y\f$-coordinates of the centers of +`s1` and `s2`. +*/ +typedef unspecified_type Compare_y_2; + +/*! +A predicate object type. Must +provide `Comparison_result operator()(Site_2 s1, +Site_2 s2)`, which compares the weights of `s1` +and `s2`. +*/ +typedef unspecified_type Compare_weight_2; /*! -Must provide `template -Object_2 operator()( T t)` that constructs an object of type -`Object_2` that contains `t` and returns it. -*/ -typedef unspecified_type Construct_object_2; +A predicate object type. Must +provide `Orientation operator()(Site_2 s1, +Site_2 s2, Site_2 s3)`, which performs the +usual orientation test for the centers of the three sites +`s1`, `s2` and `s3`. + +Must also provide `Orientation operator()(Site_2 s1, Site_2 s2, +Site_2 s3, Site_2 p1, Site_2 p2)`, +which performs the usual orientation test for the Apollonius vertex of +`s1`, `s2`, `s3` and the centers of `p1` and +`p2`. +\pre the Apollonius vertex of `s1`, `s2` and `s3` must exist. +*/ +typedef unspecified_type Orientation_2; /*! +A predicate object type. Must +provide `bool operator()(Site_2 s1, +Site_2 s2)`, which returns `true` if the circle +corresponding to `s2` is contained in the closure of the disk +corresponding to `s1`, `false` otherwise. +*/ +typedef unspecified_type Is_hidden_2; + +/*! +A predicate object type. +Must provide `Oriented_side operator()(Site_2 s1, +Site_2 s2, Point_2 p)`, which returns +the oriented side of the bisector of `s1` and `s2` that +contains `p`. Returns `ON_POSITIVE_SIDE` if `p` lies in +the half-space of `s1` (i.e., `p` is closer to `s1` than +`s2`); returns `ON_NEGATIVE_SIDE` if `p` lies in the +half-space of `s2`; returns `ON_ORIENTED_BOUNDARY` if `p` +lies on the bisector of `s1` and `s2`. +*/ +typedef unspecified_type Oriented_side_of_bisector_2; -A constructor for a point of the Apollonius diagram equidistant -from three sites. Must provide -`Point_2 operator()(Site_2 s1, Site_2 s2, Site_2 s3)`, which -constructs a point equidistant from the sites `s1`, `s2` and -`s3`. +/*! +A predicate object type. +Must provide `Sign operator()(Site_2 s1, Site_2 +s2, Site_2 s3, Site_2 q)`, which +returns the sign of the distance of `q` from the dual Apollonius +site of `s1`, `s2`, `s3`. +\pre the dual Apollonius site of `s1`, `s2`, `s3` must exist. -*/ -typedef unspecified_type Construct_Apollonius_vertex_2; +Must also provide `Sign operator()(Site_2 s1, +Site_2 s2, Site_2 q)`, which returns the sign of the distance of +`q` from the bitangent line of `s1`, `s2` (a degenerate +dual Apollonius site, with its center at infinity). +*/ +typedef unspecified_type Vertex_conflict_2; + +/*! +A predicate object type. +Must provide `bool operator()(Site_2 s1, Site_2 s2, Site_2 s3, Site_2 s4, Site_2 q, bool b)`. +The sites `s1`, `s2`, `s3` and `s4` define an Apollonius edge that lies on the +bisector of `s1` and `s2` and has as endpoints the Apollonius +vertices defined by the triplets `s1`, `s2`, `s3` and +`s1`, `s4` and `s2`. The Boolean `b` denotes if the +two Apollonius vertices are in conflict with the site +`q` (in which case `b` should be `true`, otherwise +`false`). In case that `b` is `true`, the predicate +returns `true` if and only if the entire Apollonius edge is in +conflict with `q`. If `b` is `false`, the predicate returns +`false` if and only if `q` is not in conflict with the +Apollonius edge. +\pre the Apollonius vertices of `s1`, `s2`, `s3`, and `s1`, `s4`, `s2` must exist. + +Must also provide `bool operator()(Site_2 s1, +Site_2 s2, Site_2 s3, Site_2 q, bool b)`. The +sites `s1`, `s2`, `s3` and the site at infinity +\f$ s_\infty\f$ define an Apollonius edge that lies on the bisector of +`s1` and `s2` and has as endpoints the Apollonius vertices +defined by the triplets `s1`, `s2`, `s3` and `s1`, +\f$ s_\infty\f$ and `s2` (the second Apollonius vertex is actually at +infinity). The Boolean `b` denotes if the two Apollonius vertices +are in conflict with the site `q` (in which case `b` +should be `true`, otherwise `false`). +In case that `b` is `true`, the predicate +returns `true` if and only if the entire Apollonius edge is in +conflict with `q`. If `b` is `false`, the predicate returns +`false` if and only if `q` is not in conflict with the +Apollonius edge. +\pre the Apollonius vertex of `s1`, `s2`, `s3` must exist. + +Must finally provide `bool operator()(Site_2 s1, +Site_2 s2, Site_2 q, bool b)`. The +sites `s1`, `s2` and the site at infinity +\f$ s_\infty\f$ define an Apollonius edge that lies on the bisector of +`s1` and `s2` and has as endpoints the Apollonius vertices +defined by the triplets `s1`, `s2`, \f$ s_\infty\f$ and `s1`, +\f$ s_\infty\f$ and `s2` (both Apollonius vertices are actually at +infinity). The Boolean `b` denotes if the two Apollonius vertices +are in conflict with the site `q` (in which case `b` +should be `true`, otherwise `false`). +In case that `b` is `true`, the predicate +returns `true` if and only if the entire Apollonius edge is in +conflict with `q`. If `b` is `false`, the predicate returns +`false` if and only if `q` is not in conflict with the +Apollonius edge. +*/ +typedef unspecified_type Finite_edge_interior_conflict_2; + +/*! +A predicate +object type. Must provide `bool operator()(Site_2 s1, +Site_2 s2, Site_2 s3, Site_2 q, bool b)`. The +sites \f$ s_\infty\f$, `s1`, `s2` and `s3` define an +Apollonius edge that lies on the bisector of \f$ s_\infty\f$ and `s1` +and has as endpoints the Apollonius vertices defined by the triplets +\f$ s_\infty\f$, `s1`, `s2` and \f$ s_\infty\f$, `s3` and +`s1`. The Boolean `b` denotes if the two Apollonius vertices +are in conflict with the site `q` (in which case `b` +should be `true`, otherwise `false`. +In case that `b` is `true`, the predicate +returns `true` if and only if the entire Apollonius edge is in +conflict with `q`. If `b` is `false`, the predicate returns +`false` if and only if `q` is not in conflict with the +Apollonius edge. +*/ +typedef unspecified_type Infinite_edge_interior_conflict_2; /*! -A constructor for -a dual Apollonius site (a site whose center is a -vertex of the Apollonius diagram and its weight is the common -distance of its center from the three defining sites). -Must provide `Site_2 operator()(Site_2 s1, -Site_2 s2, Site_2 s3)`, which constructs a -dual site whose center \f$ c\f$ is equidistant from `s1`, `s2` and -`s3`, and its weight is equal to the (signed) distance of \f$ c\f$ -from `s1` (or `s2` or `s3`). +A predicate object type. +Must provide `bool operator()(Site_2 s1, Site_2 +s2, Site_2 s3, Site_2 s4)`. It returns `true` if +the Apollonius edge defined by `s1`, `s2`, `s3` and +`s4` is degenerate, `false` otherwise. An Apollonius edge is +called degenerate if its two endpoints coincide. +\pre the Apollonius vertices of `s1`, `s2`, `s3`, and `s1`, `s4`, `s2` must exist. +*/ +typedef unspecified_type Is_degenerate_edge_2; + +/// @} -Must also provide `Line_2 operator()(Site_2 s1, Site_2 s2)`, which -constructs a line bitangent to `s1` and `s2`. This line is the -dual site of `s1`, `s2` and the site at infinity; it can be -viewed as a dual Apollonius site whose center is at infinity -and its weight is infinite. - -*/ -typedef unspecified_type Construct_Apollonius_site_2; - -/*! -A predicate object type. Must -provide `Comparison_result operator()(Site_2 s1, -Site_2 s2)`, which compares the \f$ x\f$-coordinates of the centers of -`s1` and `s2`. -*/ -typedef unspecified_type Compare_x_2; - -/*! -A predicate object type. Must -provide `Comparison_result operator()(Site_2 s1, -Site_2 s2)`, which compares the \f$ y\f$-coordinates of the centers of -`s1` and `s2`. -*/ -typedef unspecified_type Compare_y_2; - -/*! -A predicate object type. Must -provide `Comparison_result operator()(Site_2 s1, -Site_2 s2)`, which compares the weights of `s1` -and `s2`. -*/ -typedef unspecified_type Compare_weight_2; - -/*! -A predicate object type. Must -provide `Orientation operator()(Site_2 s1, -Site_2 s2, Site_2 s3)`, which performs the -usual orientation test for the centers of the three sites -`s1`, `s2` and `s3`. - -Must also provide `Orientation operator()(Site_2 s1, Site_2 s2, -Site_2 s3, Site_2 p1, Site_2 p2)`, -which performs the usual orientation test for the Apollonius vertex of -`s1`, `s2`, `s3` and the centers of `p1` and -`p2`. -\pre the Apollonius vertex of `s1`, `s2` and `s3` must exist. -*/ -typedef unspecified_type Orientation_2; - -/*! -A predicate object type. Must -provide `bool operator()(Site_2 s1, -Site_2 s2)`, which returns `true` if the circle -corresponding to `s2` is contained in the closure of the disk -corresponding to `s1`, `false` otherwise. -*/ -typedef unspecified_type Is_hidden_2; - -/*! -A predicate object type. -Must provide `Oriented_side operator()(Site_2 s1, -Site_2 s2, Point_2 p)`, which returns -the oriented side of the bisector of `s1` and `s2` that -contains `p`. Returns `ON_POSITIVE_SIDE` if `p` lies in -the half-space of `s1` (i.e., `p` is closer to `s1` than -`s2`); returns `ON_NEGATIVE_SIDE` if `p` lies in the -half-space of `s2`; returns `ON_ORIENTED_BOUNDARY` if `p` -lies on the bisector of `s1` and `s2`. -*/ -typedef unspecified_type Oriented_side_of_bisector_2; - -/*! -A predicate object type. -Must provide `Sign operator()(Site_2 s1, Site_2 -s2, Site_2 s3, Site_2 q)`, which -returns the sign of the distance of `q` from the dual Apollonius -site of `s1`, `s2`, `s3`. -\pre the dual Apollonius site of `s1`, `s2`, `s3` must exist. - -Must also provide `Sign operator()(Site_2 s1, -Site_2 s2, Site_2 q)`, which returns the sign of the distance of -`q` from the bitangent line of `s1`, `s2` (a degenerate -dual Apollonius site, with its center at infinity). -*/ -typedef unspecified_type Vertex_conflict_2; - -/*! -A predicate object type. -Must provide `bool operator()(Site_2 s1, Site_2 s2, Site_2 s3, Site_2 s4, Site_2 q, bool b)`. -The sites `s1`, `s2`, `s3` and `s4` define an Apollonius edge that lies on the -bisector of `s1` and `s2` and has as endpoints the Apollonius -vertices defined by the triplets `s1`, `s2`, `s3` and -`s1`, `s4` and `s2`. The Boolean `b` denotes if the -two Apollonius vertices are in conflict with the site -`q` (in which case `b` should be `true`, otherwise -`false`). In case that `b` is `true`, the predicate -returns `true` if and only if the entire Apollonius edge is in -conflict with `q`. If `b` is `false`, the predicate returns -`false` if and only if `q` is not in conflict with the -Apollonius edge. -\pre the Apollonius vertices of `s1`, `s2`, `s3`, and `s1`, `s4`, `s2` must exist. - -Must also provide `bool operator()(Site_2 s1, -Site_2 s2, Site_2 s3, Site_2 q, bool b)`. The -sites `s1`, `s2`, `s3` and the site at infinity -\f$ s_\infty\f$ define an Apollonius edge that lies on the bisector of -`s1` and `s2` and has as endpoints the Apollonius vertices -defined by the triplets `s1`, `s2`, `s3` and `s1`, -\f$ s_\infty\f$ and `s2` (the second Apollonius vertex is actually at -infinity). The Boolean `b` denotes if the two Apollonius vertices -are in conflict with the site `q` (in which case `b` -should be `true`, otherwise `false`). -In case that `b` is `true`, the predicate -returns `true` if and only if the entire Apollonius edge is in -conflict with `q`. If `b` is `false`, the predicate returns -`false` if and only if `q` is not in conflict with the -Apollonius edge. -\pre the Apollonius vertex of `s1`, `s2`, `s3` must exist. - -Must finally provide `bool operator()(Site_2 s1, -Site_2 s2, Site_2 q, bool b)`. The -sites `s1`, `s2` and the site at infinity -\f$ s_\infty\f$ define an Apollonius edge that lies on the bisector of -`s1` and `s2` and has as endpoints the Apollonius vertices -defined by the triplets `s1`, `s2`, \f$ s_\infty\f$ and `s1`, -\f$ s_\infty\f$ and `s2` (both Apollonius vertices are actually at -infinity). The Boolean `b` denotes if the two Apollonius vertices -are in conflict with the site `q` (in which case `b` -should be `true`, otherwise `false`). -In case that `b` is `true`, the predicate -returns `true` if and only if the entire Apollonius edge is in -conflict with `q`. If `b` is `false`, the predicate returns -`false` if and only if `q` is not in conflict with the -Apollonius edge. -*/ -typedef unspecified_type Finite_edge_interior_conflict_2; - -/*! -A predicate -object type. Must provide `bool operator()(Site_2 s1, -Site_2 s2, Site_2 s3, Site_2 q, bool b)`. The -sites \f$ s_\infty\f$, `s1`, `s2` and `s3` define an -Apollonius edge that lies on the bisector of \f$ s_\infty\f$ and `s1` -and has as endpoints the Apollonius vertices defined by the triplets -\f$ s_\infty\f$, `s1`, `s2` and \f$ s_\infty\f$, `s3` and -`s1`. The Boolean `b` denotes if the two Apollonius vertices -are in conflict with the site `q` (in which case `b` -should be `true`, otherwise `false`. -In case that `b` is `true`, the predicate -returns `true` if and only if the entire Apollonius edge is in -conflict with `q`. If `b` is `false`, the predicate returns -`false` if and only if `q` is not in conflict with the -Apollonius edge. -*/ -typedef unspecified_type Infinite_edge_interior_conflict_2; - -/*! -A predicate object type. -Must provide `bool operator()(Site_2 s1, Site_2 -s2, Site_2 s3, Site_2 s4)`. It returns `true` if -the Apollonius edge defined by `s1`, `s2`, `s3` and -`s4` is degenerate, `false` otherwise. An Apollonius edge is -called degenerate if its two endpoints coincide. -\pre the Apollonius vertices of `s1`, `s2`, `s3`, and `s1`, `s4`, `s2` must exist. -*/ -typedef unspecified_type Is_degenerate_edge_2; - -/// @} - -/// \name Creation +/// \name Creation /// @{ /*! -Default constructor. -*/ -ApolloniusGraphTraits_2(); +Default constructor. +*/ +ApolloniusGraphTraits_2(); /*! -Copy constructor. -*/ -ApolloniusGraphTraits_2(ApolloniusGraphTraits_2 other); +Copy constructor. +*/ +ApolloniusGraphTraits_2(ApolloniusGraphTraits_2 other); /*! -Assignment operator. -*/ -ApolloniusGraphTraits_2 operator=(ApolloniusGraphTraits_2 other); +Assignment operator. +*/ +ApolloniusGraphTraits_2 operator=(ApolloniusGraphTraits_2 other); -/// @} +/// @} -/// \name Access to predicate objects +/// \name Access to predicate objects /// @{ /*! -*/ -Compare_x_2 compare_x_2_object(); +*/ +Compare_x_2 compare_x_2_object(); /*! -*/ -Compare_y_2 compare_y_2_object(); +*/ +Compare_y_2 compare_y_2_object(); /*! -*/ -Compare_weight_2 compare_weight_2_object(); +*/ +Compare_weight_2 compare_weight_2_object(); /*! -*/ -Orientation_2 orientation_2_object(); +*/ +Orientation_2 orientation_2_object(); /*! -*/ -Is_hidden_2 is_hidden_2_object(); +*/ +Is_hidden_2 is_hidden_2_object(); /*! -*/ -Oriented_side_of_bisector_2 -oriented_side_of_bisector_test_2_object(); +*/ +Oriented_side_of_bisector_2 +oriented_side_of_bisector_test_2_object(); /*! -*/ -Vertex_conflict_2 vertex_conflict_2_object(); +*/ +Vertex_conflict_2 vertex_conflict_2_object(); /*! -*/ -Finite_edge_interior_conflict_2 -finite_edge_interior_conflict_2_object(); +*/ +Finite_edge_interior_conflict_2 +finite_edge_interior_conflict_2_object(); /*! -*/ -Infinite_edge_interior_conflict_2 -infinite_edge_interior_conflict_2_object(); +*/ +Infinite_edge_interior_conflict_2 +infinite_edge_interior_conflict_2_object(); /*! -*/ -Is_degenerate_edge_2 is_degenerate_edge_2_object(); +*/ +Is_degenerate_edge_2 is_degenerate_edge_2_object(); -/// @} +/// @} -/// \name Access to constructor objects +/// \name Access to constructor objects /// @{ /*! -*/ -Construct_object_2 -construct_object_2_object(); +*/ +Construct_object_2 +construct_object_2_object(); /*! -*/ -Construct_Apollonius_vertex_2 -construct_Apollonius_vertex_2_object(); +*/ +Construct_Apollonius_vertex_2 +construct_Apollonius_vertex_2_object(); /*! -*/ -Construct_Apollonius_site_2 -construct_Apollonius_site_2_object(); +*/ +Construct_Apollonius_site_2 +construct_Apollonius_site_2_object(); -/// @} +/// @} -/// \name Access to other objects +/// \name Access to other objects /// @{ /*! -*/ -Assign_2 assign_2_object(); +*/ +Assign_2 assign_2_object(); /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphVertexBase_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphVertexBase_2.h index 9c427f055028..78fad9020885 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphVertexBase_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphVertexBase_2.h @@ -5,162 +5,162 @@ \cgalRefines `TriangulationVertexBase_2` -The concept `ApolloniusGraphVertexBase_2` describes the -requirements for the vertex base class of the -`ApolloniusGraphDataStructure_2` concept. A vertex stores an -Apollonius site and provides access to one of its incident faces -through a `Face_handle`. In addition, it maintains a container of -sites. The container stores the hidden sites related to the vertex. +The concept `ApolloniusGraphVertexBase_2` describes the +requirements for the vertex base class of the +`ApolloniusGraphDataStructure_2` concept. A vertex stores an +Apollonius site and provides access to one of its incident faces +through a `Face_handle`. In addition, it maintains a container of +sites. The container stores the hidden sites related to the vertex. \cgalHasModel `CGAL::Apollonius_graph_vertex_base_2` -\sa `ApolloniusGraphDataStructure_2` -\sa `ApolloniusGraphTraits_2` -\sa `CGAL::Apollonius_graph_vertex_base_2` +\sa `ApolloniusGraphDataStructure_2` +\sa `ApolloniusGraphTraits_2` +\sa `CGAL::Apollonius_graph_vertex_base_2` */ class ApolloniusGraphVertexBase_2 { public: -/// \name Types +/// \name Types /// @{ /*! -A type for the geometric traits that defines -the site stored. \pre The type `Geom_traits` must define the type `Site_2`. -*/ -typedef unspecified_type Geom_traits; +A type for the geometric traits that defines +the site stored. \pre The type `Geom_traits` must define the type `Site_2`. +*/ +typedef unspecified_type Geom_traits; /*! -A Boolean that indicates if -hidden sites are actually stored or not. Its value is `true` if -hidden sites are stored, `false` otherwise. -*/ -typedef unspecified_type Store_hidden; +A Boolean that indicates if +hidden sites are actually stored or not. Its value is `true` if +hidden sites are stored, `false` otherwise. +*/ +typedef unspecified_type Store_hidden; /*! -A type for the site stored. -\pre This type must coincide with the type `Geom_traits::Site_2`. -*/ -typedef unspecified_type Site_2; +A type for the site stored. +\pre This type must coincide with the type `Geom_traits::Site_2`. +*/ +typedef unspecified_type Site_2; /*! -A type for the -Apollonius graph data structure, to which the vertex belongs to. -*/ -typedef unspecified_type Apollonius_graph_data_structure_2; +A type for the +Apollonius graph data structure, to which the vertex belongs to. +*/ +typedef unspecified_type Apollonius_graph_data_structure_2; /*! -A type for the vertex handle of the -Apollonius graph data structure. -*/ -typedef unspecified_type Vertex_handle; +A type for the vertex handle of the +Apollonius graph data structure. +*/ +typedef unspecified_type Vertex_handle; /*! -A type for the face handle of the -Apollonius graph data structure. -*/ -typedef unspecified_type Face_handle; +A type for the face handle of the +Apollonius graph data structure. +*/ +typedef unspecified_type Face_handle; /*! -An iterator that -iterates over the hidden sites in the hidden sites -container of the vertex. -\pre Must be a model of `Iterator`. -*/ -typedef unspecified_type Hidden_sites_iterator; +An iterator that +iterates over the hidden sites in the hidden sites +container of the vertex. +\pre Must be a model of `Iterator`. +*/ +typedef unspecified_type Hidden_sites_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -Default constructor. -*/ -ApolloniusGraphVertexBase_2(); +Default constructor. +*/ +ApolloniusGraphVertexBase_2(); /*! -Constructs a vertex associated with the Apollonius site `s` and -embedded at the center of `s`. -*/ -ApolloniusGraphVertexBase_2(Site_2 s); +Constructs a vertex associated with the Apollonius site `s` and +embedded at the center of `s`. +*/ +ApolloniusGraphVertexBase_2(Site_2 s); /*! -Constructs a vertex associated with -the site `s`, embedded at the center of `s`, -and pointing to the face associated with the face handle `f`. -*/ -ApolloniusGraphVertexBase_2(Site_2 s, -Face_handle f); +Constructs a vertex associated with +the site `s`, embedded at the center of `s`, +and pointing to the face associated with the face handle `f`. +*/ +ApolloniusGraphVertexBase_2(Site_2 s, +Face_handle f); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns the Apollonius site. -*/ -Site_2 site(); +Returns the Apollonius site. +*/ +Site_2 site(); /*! -Returns a handle to an incident face. -*/ -Face_handle face(); +Returns a handle to an incident face. +*/ +Face_handle face(); /*! -Returns the number of hidden sites in the hidden -sites container. -*/ -unsigned int number_of_hidden_sites(); +Returns the number of hidden sites in the hidden +sites container. +*/ +unsigned int number_of_hidden_sites(); /*! -Starts at an arbitrary hidden site. -*/ -Hidden_sites_iterator -hidden_sites_begin(); +Starts at an arbitrary hidden site. +*/ +Hidden_sites_iterator +hidden_sites_begin(); /*! -Past-the-end iterator. -*/ -Hidden_sites_iterator hidden_sites_end(); +Past-the-end iterator. +*/ +Hidden_sites_iterator hidden_sites_end(); -/// @} +/// @} -/// \name Setting and unsetting +/// \name Setting and unsetting /// @{ /*! -Sets the Apollonius site. -*/ -void set_site(Site_2 s); +Sets the Apollonius site. +*/ +void set_site(Site_2 s); /*! -Sets the incident face. -*/ -void set_face(Face_handle f); +Sets the incident face. +*/ +void set_face(Face_handle f); /*! -Adds a hidden site to the container of hidden sites. -*/ -void add_hidden_site(Site_2 s); +Adds a hidden site to the container of hidden sites. +*/ +void add_hidden_site(Site_2 s); /*! -Clears the container of hidden sites. -*/ -void clear_hidden_sites_container(); +Clears the container of hidden sites. +*/ +void clear_hidden_sites_container(); -/// @} +/// @} -/// \name Checking +/// \name Checking /// @{ /*! -Performs any required tests on a vertex. -*/ -bool is_valid(bool verbose, int level) const; +Performs any required tests on a vertex. +*/ +bool is_valid(bool verbose, int level) const; /// @} diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusSite_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusSite_2.h index ee5b64bc667b..9f1dd5ff9dd0 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusSite_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusSite_2.h @@ -3,74 +3,74 @@ \ingroup PkgApolloniusGraph2Concepts \cgalConcept -The concept `ApolloniusSite_2` provides the requirements for an -Apollonius site class. +The concept `ApolloniusSite_2` provides the requirements for an +Apollonius site class. -\sa `ApolloniusGraphTraits_2` -\sa `CGAL::Apollonius_site_2` -\sa `CGAL::Apollonius_graph_traits_2` -\sa `CGAL::Apollonius_graph_filtered_traits_2` +\sa `ApolloniusGraphTraits_2` +\sa `CGAL::Apollonius_site_2` +\sa `CGAL::Apollonius_graph_traits_2` +\sa `CGAL::Apollonius_graph_filtered_traits_2` */ class ApolloniusSite_2 { public: -/// \name Types +/// \name Types /// @{ /*! -The point type. -*/ -typedef unspecified_type Point_2; +The point type. +*/ +typedef unspecified_type Point_2; /*! -The field number type. -*/ -typedef unspecified_type FT; +The field number type. +*/ +typedef unspecified_type FT; /*! -The ring number type. -*/ -typedef unspecified_type RT; +The ring number type. +*/ +typedef unspecified_type RT; /*! -The weight type. -\pre It must be the same as `FT`. -*/ -typedef unspecified_type Weight; +The weight type. +\pre It must be the same as `FT`. +*/ +typedef unspecified_type Weight; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -*/ -ApolloniusSite2(Point_2 p=Point_2(), Weight w= Weight(0)); +*/ +ApolloniusSite2(Point_2 p=Point_2(), Weight w= Weight(0)); /*! -Copy constructor. -*/ -ApolloniusSite_2(ApolloniusSite_2 other); +Copy constructor. +*/ +ApolloniusSite_2(ApolloniusSite_2 other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns the center of the Apollonius -site. -*/ -Point_2 point() const; +Returns the center of the Apollonius +site. +*/ +Point_2 point() const; /*! -Returns the weight of the -Apollonius site. -*/ -Weight weight() const; +Returns the weight of the +Apollonius site. +*/ +Weight weight() const; /// @} diff --git a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt index e61205e45ae6..86194af24b3b 100644 --- a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h index 6f1cfec354f6..c864aaf171bc 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -90,10 +90,10 @@ template class Apollonius_graph_hierarchy_2; template < class Gt, - class Agds = Triangulation_data_structure_2 < + class Agds = Triangulation_data_structure_2 < Apollonius_graph_vertex_base_2, Triangulation_face_base_2 >, - class LTag = Tag_false> + class LTag = Tag_false> class Apollonius_graph_2 : private Triangulation_2 ,Agds> @@ -133,17 +133,17 @@ class Apollonius_graph_2 } Construct_Apollonius_bisector_segment_2 - construct_Apollonius_bisector_segment_2_object() const { - return Construct_Apollonius_bisector_segment_2(); + construct_Apollonius_bisector_segment_2_object() const { + return Construct_Apollonius_bisector_segment_2(); } Construct_Apollonius_primal_ray_2 construct_Apollonius_primal_ray_2_object() const { - return Construct_Apollonius_primal_ray_2(); + return Construct_Apollonius_primal_ray_2(); } Construct_Apollonius_primal_segment_2 - construct_Apollonius_primal_segment_2_object() const { + construct_Apollonius_primal_segment_2_object() const { return Construct_Apollonius_primal_segment_2(); } @@ -190,24 +190,24 @@ class Apollonius_graph_2 // Auxiliary iterators for convenience // do not use default template argument to please VC++ typedef internal::Project_site_2 Proj_site; - typedef Iterator_project /* */ Visible_sites_iterator; typedef Apollonius_graph_vertex_base_nested_iterator_traits< Finite_vertices_iterator> Hidden_sites_nested_iterator_traits; - + typedef Nested_iterator + Hidden_sites_nested_iterator_traits> /* */ Hidden_sites_iterator; typedef Concatenate_iterator Sites_iterator; + Hidden_sites_iterator> Sites_iterator; typedef Site_2 value_type; // to have a back_inserter - typedef const value_type& const_reference; + typedef const value_type& const_reference; typedef value_type& reference; public: @@ -236,7 +236,7 @@ class Apollonius_graph_2 typedef typename internal::AG2_which_list::List List; typedef enum { NO_CONFLICT = -1, INTERIOR, LEFT_VERTEX, - RIGHT_VERTEX, BOTH_VERTICES, ENTIRE_EDGE } + RIGHT_VERTEX, BOTH_VERTICES, ENTIRE_EDGE } Conflict_type; static Conflict_type opposite(const Conflict_type& ct) { @@ -257,7 +257,7 @@ class Apollonius_graph_2 Site_less_than_comparator(const Gt& gt) : gt(gt) {} bool operator ()(const Site_2& p, - const Site_2& q) { + const Site_2& q) { Comparison_result result = gt.compare_weight_2_object()(p, q); return (result == LARGER); } @@ -271,7 +271,7 @@ class Apollonius_graph_2 template< class Input_iterator > Apollonius_graph_2(Input_iterator first, Input_iterator beyond, - const Gt& gt=Gt()) + const Gt& gt=Gt()) : DG( Modified_traits(gt) ) { insert(first, beyond); @@ -323,7 +323,7 @@ class Apollonius_graph_2 size_type n_hidden(0); for (Finite_vertices_iterator vit = finite_vertices_begin(); - vit != finite_vertices_end(); ++vit) { + vit != finite_vertices_end(); ++vit) { n_hidden += vit->number_of_hidden_sites(); } @@ -366,23 +366,23 @@ class Apollonius_graph_2 } Finite_edges_iterator finite_edges_begin() const { - return DG::finite_edges_begin(); + return DG::finite_edges_begin(); } Finite_edges_iterator finite_edges_end() const { - return DG::finite_edges_end(); + return DG::finite_edges_end(); } Sites_iterator sites_begin() const { return Sites_iterator(visible_sites_end(), - hidden_sites_begin(), - visible_sites_begin()); + hidden_sites_begin(), + visible_sites_begin()); } Sites_iterator sites_end() const { return Sites_iterator(visible_sites_end(), - hidden_sites_begin(), - hidden_sites_end(),0); + hidden_sites_begin(), + hidden_sites_end(),0); } Visible_sites_iterator visible_sites_begin() const { @@ -395,12 +395,12 @@ class Apollonius_graph_2 Hidden_sites_iterator hidden_sites_begin() const { return Hidden_sites_iterator(finite_vertices_end(), - finite_vertices_begin()); + finite_vertices_begin()); } Hidden_sites_iterator hidden_sites_end() const { return Hidden_sites_iterator(finite_vertices_end(), - finite_vertices_end()); + finite_vertices_end()); } @@ -433,22 +433,22 @@ class Apollonius_graph_2 //------------ Face_circulator incident_faces(Vertex_handle v, - Face_handle f = Face_handle()) const { + Face_handle f = Face_handle()) const { return DG::incident_faces(v, f); } Vertex_circulator incident_vertices(Vertex_handle v, - Face_handle f = Face_handle()) const { + Face_handle f = Face_handle()) const { return DG::incident_vertices(v, f); } Edge_circulator incident_edges(Vertex_handle v, - Face_handle f = Face_handle()) const { + Face_handle f = Face_handle()) const { return DG::incident_edges(v, f); } - + public: // PREDICATES //----------- @@ -519,7 +519,7 @@ class Apollonius_graph_2 //-------------------------- Vertex_handle nearest_neighbor(const Point_2& p) const; Vertex_handle nearest_neighbor(const Point_2& p, - Vertex_handle vnear) const; + Vertex_handle vnear) const; public: // ACCESS TO THE DUAL @@ -567,14 +567,14 @@ class Apollonius_graph_2 Vertex_handle v2(++finite_vertices_begin()); Site_2 p1 = v1->site(); Site_2 p2 = v2->site(); - + typename Geom_traits::Segment_2 seg = - construct_Apollonius_primal_segment_2_object()(p1,p2); + construct_Apollonius_primal_segment_2_object()(p1,p2); typename Geom_traits::Ray_2 ray1 = - construct_Apollonius_primal_ray_2_object()(p1,p2,p2); + construct_Apollonius_primal_ray_2_object()(p1,p2,p2); typename Geom_traits::Ray_2 ray2 = - construct_Apollonius_primal_ray_2_object()(p2,p1,p1); + construct_Apollonius_primal_ray_2_object()(p2,p1,p1); str << seg; str << ray1; @@ -582,13 +582,13 @@ class Apollonius_graph_2 } else { All_edges_iterator eit = all_edges_begin(); for (; eit != all_edges_end(); ++eit) { - draw_primal_edge< Stream >(eit, str); + draw_primal_edge< Stream >(eit, str); } } return str; } - template < class Stream > + template < class Stream > Stream& draw_dual(Stream &str) const { Finite_edges_iterator eit = finite_edges_begin(); @@ -601,7 +601,7 @@ class Apollonius_graph_2 CGAL::Hyperbola_segment_2 hs; CGAL::Hyperbola_ray_2 hr; if (assign(hs, o)) hs.draw(str); - else if (assign(s, o)) str << s; + else if (assign(s, o)) str << s; else if (assign(hr, o)) hr.draw(str); else if (assign(r, o)) str << r; else if (assign(h, o)) h.draw(str); @@ -613,7 +613,7 @@ class Apollonius_graph_2 protected: template< class Stream > Stream& draw_primal_vertex(const Finite_vertices_iterator& it, - Stream &str) const + Stream &str) const { return str << it->site().point(); } @@ -621,7 +621,7 @@ class Apollonius_graph_2 template< class Stream > Stream& draw_dual_vertex(const Finite_faces_iterator& it, - Stream &str) const + Stream &str) const { return str << dual(it); } @@ -629,22 +629,22 @@ class Apollonius_graph_2 public: template< class Stream > Stream& draw_primal_edge(const Finite_edges_iterator& eit, - Stream &str) const + Stream &str) const { return draw_primal_edge(*eit, str); } template< class Stream > Stream& draw_primal_edge(const All_edges_iterator& eit, - Stream &str) const + Stream &str) const { return draw_primal_edge(*eit, str); } - template < class Stream > + template < class Stream > Stream& draw_dual_edge(const Finite_edges_iterator& eit, - Stream &str) const + Stream &str) const { return draw_dual_edge(*eit, str); } @@ -663,14 +663,14 @@ class Apollonius_graph_2 CGAL::Hyperbola_segment_2 hs; CGAL::Parabola_segment_2 ps; if (assign(hs, o)) hs.draw(str); - if (assign(s, o)) str << s; + if (assign(s, o)) str << s; if (assign(ps, o)) ps.draw(str); if (assign(r, o)) str << r; if (assign(s_pair, o)) str << s_pair.first << s_pair.second; return str; } - template < class Stream > + template < class Stream > Stream& draw_dual_edge(const Edge& e, Stream &str) const { if ( is_infinite(e) ) { return str; } @@ -682,7 +682,7 @@ class Apollonius_graph_2 CGAL::Hyperbola_segment_2 hs; CGAL::Hyperbola_ray_2 hr; if (assign(hs, o)) hs.draw(str); - if (assign(s, o)) str << s; + if (assign(s, o)) str << s; if (assign(hr, o)) hr.draw(str); if (assign(r, o)) str << r; if (assign(h, o)) h.draw(str); @@ -704,7 +704,7 @@ class Apollonius_graph_2 template< class Stream > Stream& draw_dual_face(const All_vertices_iterator& vit, - Stream &str) const + Stream &str) const { Edge_circulator ec_start = incident_edges(Vertex_handle(vit)); Edge_circulator ec = ec_start; @@ -716,28 +716,28 @@ class Apollonius_graph_2 } protected: - template < class Stream > + template < class Stream > Stream& draw_dual_sites(Stream &str) const { All_faces_iterator fit = all_faces_begin(); for (; fit != all_faces_end(); ++fit) { Face_handle f(fit); if ( is_infinite(f) ) { - if ( is_infinite(f->vertex(0)) ) { - str << circumcircle( f->vertex(1)->site(), - f->vertex(2)->site() ); - } else if ( is_infinite(f->vertex(1)) ){ - str << circumcircle( f->vertex(2)->site(), - f->vertex(0)->site() ); - } else { - str << circumcircle( f->vertex(0)->site(), - f->vertex(1)->site() ); - } + if ( is_infinite(f->vertex(0)) ) { + str << circumcircle( f->vertex(1)->site(), + f->vertex(2)->site() ); + } else if ( is_infinite(f->vertex(1)) ){ + str << circumcircle( f->vertex(2)->site(), + f->vertex(0)->site() ); + } else { + str << circumcircle( f->vertex(0)->site(), + f->vertex(1)->site() ); + } } else { - Site_2 wp = circumcircle(f); - typename Gt::Rep::Circle_2 c(wp.point(), - CGAL::square(wp.weight())); - str << c; + Site_2 wp = circumcircle(f); + typename Gt::Rep::Circle_2 c(wp.point(), + CGAL::square(wp.weight())); + str << c; } } return str; @@ -782,129 +782,129 @@ class Apollonius_graph_2 // ON_NEGATIVE_SIDE if q is closer to p2 // ON_ORIENTED_BOUNDARY if q is on the bisector of p1 and p2 Oriented_side side_of_bisector(const Site_2 &p1, - const Site_2 &p2, - const Point_2 &q) const; + const Site_2 &p2, + const Point_2 &q) const; Sign incircle(const Site_2 &p1, const Site_2 &p2, - const Site_2 &p3, const Site_2 &q) const; + const Site_2 &p3, const Site_2 &q) const; Sign incircle(const Site_2 &p1, const Site_2 &p2, - const Site_2 &q) const; + const Site_2 &q) const; Sign incircle(const Face_handle& f, const Site_2& q) const; Sign incircle(const Vertex_handle& v0, const Vertex_handle& v1, - const Vertex_handle& v) const; + const Vertex_handle& v) const; Sign incircle(const Vertex_handle& v0, const Vertex_handle& v1, - const Vertex_handle& v2, const Vertex_handle& v) const; + const Vertex_handle& v2, const Vertex_handle& v) const; + - bool finite_edge_interior(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, - bool endpoints_in_conflict) const; + const Site_2& p2, + const Site_2& p3, + const Site_2& p4, + const Site_2& q, + bool endpoints_in_conflict) const; bool finite_edge_interior(const Face_handle& f, int i, - const Site_2& q, - bool endpoints_in_conflict) const; + const Site_2& q, + bool endpoints_in_conflict) const; bool finite_edge_interior(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, - bool endpoints_in_conflict) const; + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, + bool endpoints_in_conflict) const; bool finite_edge_interior_degenerated(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& q, - bool endpoints_in_conflict) const; + const Site_2& p2, + const Site_2& p3, + const Site_2& q, + bool endpoints_in_conflict) const; bool finite_edge_interior_degenerated(const Site_2& p1, - const Site_2& p2, - const Site_2& q, - bool endpoints_in_conflict) const; + const Site_2& p2, + const Site_2& q, + bool endpoints_in_conflict) const; bool finite_edge_interior_degenerated(const Face_handle& f, int i, - const Site_2& p, - bool endpoints_in_conflict) const; + const Site_2& p, + bool endpoints_in_conflict) const; bool finite_edge_interior_degenerated(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, - bool endpoints_in_conflict) const; + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, + bool endpoints_in_conflict) const; bool infinite_edge_interior(const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, - bool endpoints_in_conflict) const; + const Site_2& p3, + const Site_2& p4, + const Site_2& q, + bool endpoints_in_conflict) const; bool infinite_edge_interior(const Face_handle& f, int i, - const Site_2& p, - bool endpoints_in_conflict) const; + const Site_2& p, + bool endpoints_in_conflict) const; bool infinite_edge_interior(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, - bool endpoints_in_conflict) const; + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, + bool endpoints_in_conflict) const; Conflict_type infinite_edge_conflict_type(const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q) const; + const Site_2& p3, + const Site_2& p4, + const Site_2& q) const; Conflict_type finite_edge_conflict_type_degenerated(const Site_2& p1, - const Site_2& p2, - const Site_2& q) const; + const Site_2& p2, + const Site_2& q) const; bool edge_interior(const Face_handle& f, int i, - const Site_2& p, bool b) const; + const Site_2& p, bool b) const; bool edge_interior(const Edge& e, - const Site_2& p, bool b) const { + const Site_2& p, bool b) const { return edge_interior(e.first, e.second, p, b); } bool edge_interior(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, - bool endpoints_in_conflict) const; + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, + bool endpoints_in_conflict) const; bool is_degenerate_edge(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& p4) const { + const Site_2& p2, + const Site_2& p3, + const Site_2& p4) const { return geom_traits().is_degenerate_edge_2_object() (p1, p2, p3, p4); } bool is_degenerate_edge(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4) const { + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4) const { CGAL_precondition( !is_infinite(v1) && !is_infinite(v2) && - !is_infinite(v3) && !is_infinite(v4) ); + !is_infinite(v3) && !is_infinite(v4) ); return is_degenerate_edge(v1->site(), v2->site(), - v3->site(), v4->site()); + v3->site(), v4->site()); } bool is_degenerate_edge(const Face_handle& f, int i) const { @@ -924,17 +924,17 @@ class Apollonius_graph_2 protected: // wrappers for constructions Point_2 circumcenter(const Face_handle& f) const; - Point_2 circumcenter(const Site_2& p0, - const Site_2& p1, - const Site_2& p2) const; + Point_2 circumcenter(const Site_2& p0, + const Site_2& p1, + const Site_2& p2) const; Site_2 circumcircle(const Face_handle& f) const; - Site_2 circumcircle(const Site_2& p0, - const Site_2& p1, - const Site_2& p2) const; + Site_2 circumcircle(const Site_2& p0, + const Site_2& p1, + const Site_2& p2) const; typename Gt::Line_2 circumcircle(const Site_2& p0, - const Site_2& p1) const; + const Site_2& p1) const; protected: // wrappers for combinatorial operations on the data structure @@ -981,11 +981,11 @@ class Apollonius_graph_2 // methods for insertion void initialize_conflict_region(const Face_handle& f, List& l) const; bool check_edge_for_hidden_sites(const Face_handle& f, int i, - const Site_2& p, Vertex_map& vm) const; + const Site_2& p, Vertex_map& vm) const; void expand_conflict_region(const Face_handle& f, - const Site_2& p, - List& l, Face_map& fm, Vertex_map& vm, - std::vector* fe); + const Site_2& p, + List& l, Face_map& fm, Vertex_map& vm, + std::vector* fe); Vertex_handle add_bogus_vertex(Edge e, List& l); Vertex_list add_bogus_vertices(List& l); @@ -995,12 +995,12 @@ class Apollonius_graph_2 // MK: this is not currently used std::vector get_faces_for_recycling(Face_map& fm, - unsigned int n_wanted); + unsigned int n_wanted); void remove_hidden_vertices(Vertex_map& vm); Vertex_handle retriangulate_conflict_region(const Site_2& p, - List& l, - Face_map& fm, - Vertex_map& vm); + List& l, + Face_map& fm, + Vertex_map& vm); protected: // methods for removal @@ -1011,10 +1011,10 @@ class Apollonius_graph_2 void minimize_degree(Vertex_handle v); void find_conflict_region_remove(const Vertex_handle& v, - const Vertex_handle& vnearest, - List& l, Face_map& fm, - Vertex_map& vm, - std::vector* fe); + const Vertex_handle& vnearest, + List& l, Face_map& fm, + Vertex_map& vm, + std::vector* fe); protected: // methods for I/O @@ -1029,11 +1029,11 @@ class Apollonius_graph_2 protected: template OutputItFaces find_conflicts(const Face_handle& f, - const Site_2& p, - List& l, - Face_map& fm, - Vertex_map& vm, - OutputItFaces fit) const + const Site_2& p, + List& l, + Face_map& fm, + Vertex_map& vm, + OutputItFaces fit) const { // setting fm[f] to true means that the face has been reached and // that the face is available for recycling. If we do not want the @@ -1051,22 +1051,22 @@ class Apollonius_graph_2 Face_handle n = f->neighbor(i); if ( !hidden_found ) { - Sign s = incircle(n, p); - if ( s != NEGATIVE ) { continue; } + Sign s = incircle(n, p); + if ( s != NEGATIVE ) { continue; } - bool interior_in_conflict = edge_interior(f, i, p, true); + bool interior_in_conflict = edge_interior(f, i, p, true); - if ( !interior_in_conflict ) { continue; } + if ( !interior_in_conflict ) { continue; } } if ( fm.find(n) != fm.end() ) { - Edge e = sym_edge(f, i); - if ( l.is_in_list(e) || - l.is_in_list(sym_edge(e)) ) { - l.remove(e); - l.remove(sym_edge(e)); - } - continue; + Edge e = sym_edge(f, i); + if ( l.is_in_list(e) || + l.is_in_list(sym_edge(e)) ) { + l.remove(e); + l.remove(sym_edge(e)); + } + continue; } Edge e = sym_edge(f, i); @@ -1076,10 +1076,10 @@ class Apollonius_graph_2 Edge e_before = sym_edge(n, ccw(j)); Edge e_after = sym_edge(n, cw(j)); if ( !l.is_in_list(e_before) ) { - l.insert_before(e, e_before); + l.insert_before(e, e_before); } if ( !l.is_in_list(e_after) ) { - l.insert_after(e, e_after); + l.insert_after(e, e_after); } l.remove(e); @@ -1095,15 +1095,15 @@ class Apollonius_graph_2 protected: template + class OutputItHiddenVertices> boost::tuples::tuple + OutputItHiddenVertices> get_all(const Site_2& p, - OutputItFaces fit, - OutputItBoundaryEdges eit, - OutputItHiddenVertices vit, - Vertex_handle start, - bool find_nearest) const + OutputItFaces fit, + OutputItBoundaryEdges eit, + OutputItHiddenVertices vit, + Vertex_handle start, + bool find_nearest) const { CGAL_precondition( dimension() == 2 ); @@ -1131,8 +1131,8 @@ class Apollonius_graph_2 s = incircle(f, p); if ( s == NEGATIVE ) { - start_f = f; - break; + start_f = f; + break; } ++fc; } while ( fc != fc_start ); @@ -1146,11 +1146,11 @@ class Apollonius_graph_2 bool interior_in_conflict(false); Edge e; do { - e = *ec; - interior_in_conflict = edge_interior(e, p, false); - - if ( interior_in_conflict ) { break; } - ++ec; + e = *ec; + interior_in_conflict = edge_interior(e, p, false); + + if ( interior_in_conflict ) { break; } + ++ec; } while ( ec != ec_start ); CGAL_assertion( interior_in_conflict ); @@ -1160,7 +1160,7 @@ class Apollonius_graph_2 return boost::tuples::make_tuple(fit, eit, vit); } - // we are in conflict with an Apollonius vertex; start from that and + // we are in conflict with an Apollonius vertex; start from that and // find the entire conflict region and then repair the diagram List l; Face_map fm; @@ -1178,8 +1178,8 @@ class Apollonius_graph_2 // assignment: e = l.next(e); Edge e = l.front(); do { - *eit++ = e; - e = l.next(e); + *eit++ = e; + e = l.next(e); } while ( !equal(e, e_front) ); } @@ -1198,15 +1198,15 @@ class Apollonius_graph_2 public: template + class OutputItHiddenVertices> boost::tuples::tuple + OutputItHiddenVertices> get_conflicts_and_boundary_and_hidden_vertices(const Site_2& p, - OutputItFaces fit, - OutputItBoundaryEdges eit, - OutputItHiddenVertices vit, - Vertex_handle start = - Vertex_handle()) const + OutputItFaces fit, + OutputItBoundaryEdges eit, + OutputItHiddenVertices vit, + Vertex_handle start = + Vertex_handle()) const { return get_all(p, fit, eit, vit, start, true); } @@ -1214,104 +1214,104 @@ class Apollonius_graph_2 template std::pair get_conflicts_and_boundary(const Site_2& p, - OutputItFaces fit, - OutputItBoundaryEdges eit, - Vertex_handle start = - Vertex_handle()) const { + OutputItFaces fit, + OutputItBoundaryEdges eit, + Vertex_handle start = + Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - fit, - eit, - Emptyset_iterator(), - start); + fit, + eit, + Emptyset_iterator(), + start); return std::make_pair( boost::tuples::get<0>(tup), - boost::tuples::get<1>(tup) ); + boost::tuples::get<1>(tup) ); } template std::pair get_boundary_of_conflicts_and_hidden_vertices(const Site_2& p, - OutputItBoundaryEdges eit, - OutputItHiddenVertices vit, - Vertex_handle start = - Vertex_handle()) const { + OutputItBoundaryEdges eit, + OutputItHiddenVertices vit, + Vertex_handle start = + Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - Emptyset_iterator(), - eit, - vit, - start); + Emptyset_iterator(), + eit, + vit, + start); return std::make_pair( boost::tuples::get<1>(tup), - boost::tuples::get<2>(tup) ); + boost::tuples::get<2>(tup) ); } template std::pair get_conflicts_and_hidden_vertices(const Site_2& p, - OutputItFaces fit, - OutputItHiddenVertices vit, - Vertex_handle start = - Vertex_handle()) const { + OutputItFaces fit, + OutputItHiddenVertices vit, + Vertex_handle start = + Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - fit, - Emptyset_iterator(), - vit, - start); + fit, + Emptyset_iterator(), + vit, + start); return std::make_pair( boost::tuples::get<0>(tup), - boost::tuples::get<2>(tup) ); + boost::tuples::get<2>(tup) ); } template OutputItFaces get_conflicts(const Site_2& p, - OutputItFaces fit, - Vertex_handle start = Vertex_handle()) const { + OutputItFaces fit, + Vertex_handle start = Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - fit, - Emptyset_iterator(), - Emptyset_iterator(), - start); + fit, + Emptyset_iterator(), + Emptyset_iterator(), + start); return boost::tuples::get<0>(tup); } template OutputItBoundaryEdges get_boundary_of_conflicts(const Site_2& p, - OutputItBoundaryEdges eit, - Vertex_handle start = Vertex_handle()) const { + OutputItBoundaryEdges eit, + Vertex_handle start = Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - Emptyset_iterator(), - eit, - Emptyset_iterator(), - start); + Emptyset_iterator(), + eit, + Emptyset_iterator(), + start); return boost::tuples::get<1>(tup); } template OutputItHiddenVertices get_hidden_vertices(const Site_2& p, - OutputItHiddenVertices vit, - Vertex_handle start = Vertex_handle()) const { + OutputItHiddenVertices vit, + Vertex_handle start = Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - Emptyset_iterator(), - Emptyset_iterator(), - vit, - start); + Emptyset_iterator(), + Emptyset_iterator(), + vit, + start); return boost::tuples::get<2>(tup); } @@ -1320,7 +1320,7 @@ class Apollonius_graph_2 template std::ostream& operator<<(std::ostream& os, - const Apollonius_graph_2& ag) + const Apollonius_graph_2& ag) { ag.file_output(os); return os; @@ -1328,7 +1328,7 @@ std::ostream& operator<<(std::ostream& os, template std::istream& operator>>(std::istream& is, - Apollonius_graph_2& ag) + Apollonius_graph_2& ag) { ag.file_input(is); return is; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index f7241bcd8cc9..cad9b1996471 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -63,7 +63,7 @@ is_valid(bool verbose, int level) const if ( f->vertex(e.second) == v ) { continue; } if ( !is_infinite(v) ) { result = result && - ( incircle(f, v->site()) != NEGATIVE ); + ( incircle(f, v->site()) != NEGATIVE ); // CGAL_triangulation_assertion(result); } Edge sym_e = sym_edge(e); @@ -71,7 +71,7 @@ is_valid(bool verbose, int level) const v = tds().mirror_vertex(f, sym_e.second); if ( !is_infinite(v) ) { result = result && - ( incircle(f, v->site()) != NEGATIVE ); + ( incircle(f, v->site()) != NEGATIVE ); // CGAL_triangulation_assertion(result); } } @@ -102,15 +102,15 @@ circumcenter(const Face_handle& f) const { CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f)); return circumcenter(f->vertex(0)->site(), - f->vertex(1)->site(), - f->vertex(2)->site()); + f->vertex(1)->site(), + f->vertex(2)->site()); } template typename Apollonius_graph_2::Point_2 Apollonius_graph_2:: -circumcenter(const Site_2& p0, const Site_2& p1, - const Site_2& p2) const +circumcenter(const Site_2& p0, const Site_2& p1, + const Site_2& p2) const { return geom_traits().construct_Apollonius_vertex_2_object()(p0, p1, p2); @@ -124,15 +124,15 @@ circumcircle(const Face_handle& f) const { CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f)); return circumcircle(f->vertex(0)->site(), - f->vertex(1)->site(), - f->vertex(2)->site()); + f->vertex(1)->site(), + f->vertex(2)->site()); } template typename Apollonius_graph_2::Site_2 Apollonius_graph_2:: -circumcircle(const Site_2& p0, const Site_2& p1, - const Site_2& p2) const +circumcircle(const Site_2& p0, const Site_2& p1, + const Site_2& p2) const { return geom_traits().construct_Apollonius_site_2_object()(p0, p1, p2); @@ -168,7 +168,7 @@ dual(const Face_handle& f) const } } typename Gt::Line_2 ll = circumcircle(f->vertex((i_inf+1)%3)->site(), - f->vertex((i_inf+2)%3)->site()); + f->vertex((i_inf+2)%3)->site()); return geom_traits().construct_object_2_object()(ll); } @@ -208,13 +208,13 @@ dual(const Edge e) const // only one of the adjacent faces is infinite CGAL_triangulation_assertion( is_infinite( e.first ) || - is_infinite( e.first->neighbor(e.second) ) - ); + is_infinite( e.first->neighbor(e.second) ) + ); CGAL_triangulation_assertion( !(is_infinite( e.first ) && - is_infinite( e.first->neighbor(e.second) ) - ) - ); + is_infinite( e.first->neighbor(e.second) ) + ) + ); CGAL_triangulation_assertion ( is_infinite( e.first->vertex(e.second) ) || @@ -252,17 +252,17 @@ primal(const Edge e) const if ( is_infinite(e) ) { Ray ray; if ( is_infinite( e.first->vertex(cw(e.second)) ) ) { - Site_2 p = e.first->vertex( ccw(e.second) )->site(); - Site_2 r = e.first->vertex( e.second )->site(); - Site_2 s = tds().mirror_vertex( e.first, e.second )->site(); - ray = construct_Apollonius_primal_ray_2_object()(p,r,s); + Site_2 p = e.first->vertex( ccw(e.second) )->site(); + Site_2 r = e.first->vertex( e.second )->site(); + Site_2 s = tds().mirror_vertex( e.first, e.second )->site(); + ray = construct_Apollonius_primal_ray_2_object()(p,r,s); } else { - CGAL_triangulation_assertion - ( is_infinite( e.first->vertex(ccw(e.second)) ) ); - Site_2 q = e.first->vertex( cw(e.second) )->site(); - Site_2 r = e.first->vertex( e.second )->site(); - Site_2 s = tds().mirror_vertex( e.first, e.second )->site(); - ray = construct_Apollonius_primal_ray_2_object()(q,s,r); + CGAL_triangulation_assertion + ( is_infinite( e.first->vertex(ccw(e.second)) ) ); + Site_2 q = e.first->vertex( cw(e.second) )->site(); + Site_2 r = e.first->vertex( e.second )->site(); + Site_2 s = tds().mirror_vertex( e.first, e.second )->site(); + ray = construct_Apollonius_primal_ray_2_object()(q,s,r); } return make_object(ray); } @@ -319,7 +319,7 @@ flip(Face_handle& f, int i) { CGAL_triangulation_precondition ( f != Face_handle() ); CGAL_triangulation_precondition (i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( dimension()==2 ); + CGAL_triangulation_precondition( dimension()==2 ); CGAL_triangulation_precondition( f->vertex(i) != tds().mirror_vertex(f,i) ); @@ -433,7 +433,7 @@ insert_second(const Site_2& p) Vertex_handle v(finite_vertices_begin()); if ( is_hidden(v->site(), p) ) { v->add_hidden_site(p); - vnew = Vertex_handle(); + vnew = Vertex_handle(); } else if ( is_hidden(p, v->site()) ) { v->add_hidden_site(v->site()); v->set_site(p); @@ -549,8 +549,8 @@ insert_third(const Site_2& p) Edge_circulator ec = incident_edges(v); while ( true ) { if ( ec->first->vertex( ccw(ec->second) ) == vv ) { - flip(*ec); - break; + flip(*ec); + break; } ++ec; } @@ -559,8 +559,8 @@ insert_third(const Site_2& p) while ( true ) { if ( is_infinite(ec) ) { - flip(*ec); - break; + flip(*ec); + break; } ec++; } @@ -570,8 +570,8 @@ insert_third(const Site_2& p) while ( true ) { Face_handle ff(fc); if ( !is_infinite(ff) ) { - flip(ff, ff->index(v)); - break; + flip(ff, ff->index(v)); + break; } ++fc; } @@ -585,8 +585,8 @@ insert_third(const Site_2& p) ( ct1 == INTERIOR ) ? incident_edges(v2) : incident_edges(v1); while ( true ) { if ( is_infinite(ec) ) { - flip(*ec); - break; + flip(*ec); + break; } ec++; } @@ -669,7 +669,7 @@ insert(const Site_2& p, Vertex_handle vnear) } - // we are in conflict with an Apollonius vertex; start from that and + // we are in conflict with an Apollonius vertex; start from that and // find the entire conflict region and then repair the diagram List l; Face_map fm; @@ -677,7 +677,7 @@ insert(const Site_2& p, Vertex_handle vnear) // MK:: NEED TO WRITE A FUNCTION CALLED find_conflict_region WHICH // IS GIVEN A STARTING FACE, A LIST, A FACE MAP, A VERTEX MAP AND A - // LIST OF FLIPPED EDGES AND WHAT IS DOES IS INITIALIZE THE CONFLICT + // LIST OF FLIPPED EDGES AND WHAT IS DOES IS INITIALIZE THE CONFLICT // REGION AND EXPANDS THE CONFLICT REGION. initialize_conflict_region(start_f, l); expand_conflict_region(start_f, p, l, fm, vm, nullptr); @@ -700,10 +700,10 @@ template void Apollonius_graph_2:: find_conflict_region_remove(const Vertex_handle& v, - const Vertex_handle& vnearest, - List& l, Face_map& fm, - Vertex_map& vm, - std::vector* fe) + const Vertex_handle& vnearest, + List& l, Face_map& fm, + Vertex_map& vm, + std::vector* fe) { Site_2 p = v->site(); // check if it is hidden @@ -778,7 +778,7 @@ template bool Apollonius_graph_2:: check_edge_for_hidden_sites(const Face_handle& f, int i, - const Site_2& p, Vertex_map& vm) const + const Site_2& p, Vertex_map& vm) const { bool found(false); @@ -911,7 +911,7 @@ add_bogus_vertex(Edge e, List& l) int i2 = f2->index(v); CGAL_assertion( ((f1->neighbor(i1) == g1) && (f2->neighbor(i2) == g2)) || - ((f1->neighbor(i1) == g2) && (f2->neighbor(i2) == g1)) ); + ((f1->neighbor(i1) == g2) && (f2->neighbor(i2) == g1)) ); Edge ee, eesym; if ( f1->neighbor(i1) == g1 ) { @@ -941,7 +941,7 @@ add_bogus_vertices(List& l) do { Edge esym = sym_edge(e); if ( l.is_in_list(esym) && - edge_list.find(esym) == edge_list.end() ) { + edge_list.find(esym) == edge_list.end() ) { edge_list.insert(e); } e = l.next(e); @@ -1012,7 +1012,7 @@ get_faces_for_recycling(Face_map& fm, unsigned int n_wanted) vf.pop_back(); this->_tds.delete_face(fp); } - + return vf; } @@ -1034,8 +1034,8 @@ remove_hidden_vertices(Vertex_map& vm) template typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: -retriangulate_conflict_region(const Site_2& p, List& l, - Face_map& fm, Vertex_map& vm) +retriangulate_conflict_region(const Site_2& p, List& l, + Face_map& fm, Vertex_map& vm) { size_type vmsize = vm.size(); size_type num_vert = number_of_vertices(); @@ -1050,9 +1050,9 @@ retriangulate_conflict_region(const Site_2& p, List& l, wp_list.push_back(vhidden->site()); typename Vertex::Hidden_sites_iterator it; for (it = vhidden->hidden_sites_begin(); - it != vhidden->hidden_sites_end(); ++it) { - wp_list.push_back(*it); - } + it != vhidden->hidden_sites_end(); ++it) { + wp_list.push_back(*it); + } vhidden->clear_hidden_sites_container(); } @@ -1080,9 +1080,9 @@ retriangulate_conflict_region(const Site_2& p, List& l, wp_list.push_back(vhidden->site()); typename Vertex::Hidden_sites_iterator it; for (it = vhidden->hidden_sites_begin(); - it != vhidden->hidden_sites_end(); ++it) { - wp_list.push_back(*it); - } + it != vhidden->hidden_sites_end(); ++it) { + wp_list.push_back(*it); + } vhidden->clear_hidden_sites_container(); } @@ -1099,9 +1099,9 @@ retriangulate_conflict_region(const Site_2& p, List& l, Site_list wp_list1; typename Vertex::Hidden_sites_iterator it; for (it = non_hidden->hidden_sites_begin(); - it != non_hidden->hidden_sites_end(); ++it) { + it != non_hidden->hidden_sites_end(); ++it) { wp_list1.push_back(*it); - } + } non_hidden->clear_hidden_sites_container(); // 3. clear the current Apollonius graph @@ -1111,13 +1111,13 @@ retriangulate_conflict_region(const Site_2& p, List& l, // hidden sites Vertex_handle v1 = insert_first(p1); for (Site_list_iterator it = wp_list1.begin(); - it != wp_list1.end(); ++it) { + it != wp_list1.end(); ++it) { v1->add_hidden_site(*it); } Vertex_handle v = insert_second(p); for (Site_list_iterator it = wp_list.begin(); - it != wp_list.end(); ++it) { + it != wp_list.end(); ++it) { v->add_hidden_site(*it); } @@ -1157,7 +1157,7 @@ retriangulate_conflict_region(const Site_2& p, List& l, // std::vector vf = get_faces_for_recycling(fm, l.size()); std::list vf; - // 4. copy the edge list to a vector of edges and clear the in place + // 4. copy the edge list to a vector of edges and clear the in place // list typedef typename Agds::Edge Agds_edge; std::vector ve; @@ -1212,7 +1212,7 @@ template typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: nearest_neighbor(const Point_2& p, - Vertex_handle start_vertex) const + Vertex_handle start_vertex) const { if ( number_of_vertices() == 0 ) { return Vertex_handle(); @@ -1233,11 +1233,11 @@ nearest_neighbor(const Point_2& p, for (; vit != finite_vertices_end(); ++vit) { Vertex_handle v1(vit); if ( v1 != vclosest /*&& !is_infinite(v1)*/ ) { - Site_2 p1 = vclosest->site(); - Site_2 p2 = v1->site(); - if ( side_of_bisector(p1, p2, p) == ON_NEGATIVE_SIDE ) { - vclosest = v1; - } + Site_2 p1 = vclosest->site(); + Site_2 p2 = v1->site(); + if ( side_of_bisector(p1, p2, p) == ON_NEGATIVE_SIDE ) { + vclosest = v1; + } } } return vclosest; @@ -1250,12 +1250,12 @@ nearest_neighbor(const Point_2& p, Vertex_circulator vc = vc_start; do { if ( !is_infinite(vc) ) { - Vertex_handle v1(vc); - Site_2 p2 = v1->site(); - if ( side_of_bisector(p1, p2, p) == ON_NEGATIVE_SIDE ) { - v = v1; - break; - } + Vertex_handle v1(vc); + Site_2 p2 = v1->site(); + if ( side_of_bisector(p1, p2, p) == ON_NEGATIVE_SIDE ) { + v = v1; + break; + } } ++vc; } while ( vc != vc_start ); @@ -1281,8 +1281,8 @@ template Oriented_side Apollonius_graph_2:: side_of_bisector(const Site_2 &p1, - const Site_2 &p2, - const Point_2 &p) const + const Site_2 &p2, + const Point_2 &p) const { return geom_traits().oriented_side_of_bisector_2_object()(p1, p2, p); } @@ -1292,7 +1292,7 @@ template Sign Apollonius_graph_2:: incircle(const Site_2 &p1, const Site_2 &p2, - const Site_2 &p3, const Site_2 &q) const + const Site_2 &p3, const Site_2 &q) const { return geom_traits().vertex_conflict_2_object()(p1, p2, p3, q); } @@ -1301,7 +1301,7 @@ template Sign Apollonius_graph_2:: incircle(const Site_2 &p1, const Site_2 &p2, - const Site_2 &q) const + const Site_2 &q) const { return geom_traits().vertex_conflict_2_object()(p1, p2, q); @@ -1315,8 +1315,8 @@ incircle(const Face_handle& f, const Site_2& q) const { if ( !is_infinite(f) ) { return incircle(f->vertex(0)->site(), - f->vertex(1)->site(), - f->vertex(2)->site(), q); + f->vertex(1)->site(), + f->vertex(2)->site(), q); } int inf_i(-1); // to avoid compiler warning @@ -1327,7 +1327,7 @@ incircle(const Face_handle& f, const Site_2& q) const } } return incircle( f->vertex( ccw(inf_i) )->site(), - f->vertex( cw(inf_i) )->site(), q ); + f->vertex( cw(inf_i) )->site(), q ); } @@ -1335,10 +1335,10 @@ template Sign Apollonius_graph_2:: incircle(const Vertex_handle& v0, const Vertex_handle& v1, - const Vertex_handle& v) const + const Vertex_handle& v) const { CGAL_precondition( !is_infinite(v0) && !is_infinite(v1) - && !is_infinite(v) ); + && !is_infinite(v) ); return incircle( v0->site(), v1->site(), v->site()); } @@ -1347,14 +1347,14 @@ template Sign Apollonius_graph_2:: incircle(const Vertex_handle& v0, const Vertex_handle& v1, - const Vertex_handle& v2, const Vertex_handle& v) const + const Vertex_handle& v2, const Vertex_handle& v) const { CGAL_precondition( !is_infinite(v) ); if ( !is_infinite(v0) && !is_infinite(v1) && !is_infinite(v2) ) { return incircle(v0->site(), v1->site(), - v2->site(), v->site()); + v2->site(), v->site()); } if ( is_infinite(v0) ) { @@ -1376,10 +1376,10 @@ template bool Apollonius_graph_2:: finite_edge_interior(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, bool b) const + const Site_2& p2, + const Site_2& p3, + const Site_2& p4, + const Site_2& q, bool b) const { if ( is_hidden(q, p1) ) { return true; } if ( is_hidden(q, p2) ) { return true; } @@ -1391,41 +1391,41 @@ template bool Apollonius_graph_2:: finite_edge_interior(const Face_handle& f, int i, - const Site_2& p, bool b) const + const Site_2& p, bool b) const { CGAL_precondition( !is_infinite(f) && - !is_infinite(f->neighbor(i)) ); + !is_infinite(f->neighbor(i)) ); return finite_edge_interior( f->vertex( ccw(i) )->site(), - f->vertex( cw(i) )->site(), - f->vertex( i )->site(), - tds().mirror_vertex(f, i)->site(), p, b); + f->vertex( cw(i) )->site(), + f->vertex( i )->site(), + tds().mirror_vertex(f, i)->site(), p, b); } template bool Apollonius_graph_2:: finite_edge_interior(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, bool b) const + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, bool b) const { CGAL_precondition( !is_infinite(v1) && !is_infinite(v2) && - !is_infinite(v3) && !is_infinite(v4) && - !is_infinite(v) ); + !is_infinite(v3) && !is_infinite(v4) && + !is_infinite(v) ); return finite_edge_interior( v1->site(), v2->site(), - v3->site(), v4->site(), - v->site(), b); + v3->site(), v4->site(), + v->site(), b); } template bool Apollonius_graph_2:: finite_edge_interior_degenerated(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& q, - bool b) const + const Site_2& p2, + const Site_2& p3, + const Site_2& q, + bool b) const { if ( is_hidden(q, p1) ) { return true; } if ( is_hidden(q, p2) ) { return true; } @@ -1437,9 +1437,9 @@ template bool Apollonius_graph_2:: finite_edge_interior_degenerated(const Site_2& p1, - const Site_2& p2, - const Site_2& q, - bool b) const + const Site_2& p2, + const Site_2& q, + bool b) const { if ( is_hidden(q, p1) ) { return true; } if ( is_hidden(q, p2) ) { return true; } @@ -1452,7 +1452,7 @@ template bool Apollonius_graph_2:: finite_edge_interior_degenerated(const Face_handle& f, int i, - const Site_2& p, bool b) const + const Site_2& p, bool b) const { if ( !is_infinite( tds().mirror_vertex(f, i) ) ) { CGAL_precondition( is_infinite(f->vertex(i)) ); @@ -1480,13 +1480,13 @@ template bool Apollonius_graph_2:: finite_edge_interior_degenerated(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, bool b) const + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, bool b) const { - CGAL_precondition( !is_infinite(v1) && !is_infinite(v2) && - !is_infinite(v) ); + CGAL_precondition( !is_infinite(v1) && !is_infinite(v2) && + !is_infinite(v) ); if ( !is_infinite( v4 ) ) { CGAL_precondition( is_infinite(v3) ); @@ -1512,10 +1512,10 @@ template bool Apollonius_graph_2:: infinite_edge_interior(const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, - bool b) const + const Site_2& p3, + const Site_2& p4, + const Site_2& q, + bool b) const { if ( is_hidden(q, p2) ) { return true; } return @@ -1526,7 +1526,7 @@ template bool Apollonius_graph_2:: infinite_edge_interior(const Face_handle& f, int i, - const Site_2& p, bool b) const + const Site_2& p, bool b) const { if ( !is_infinite( f->vertex(ccw(i)) ) ) { CGAL_precondition( is_infinite( f->vertex(cw(i)) ) ); @@ -1550,13 +1550,13 @@ template bool Apollonius_graph_2:: infinite_edge_interior(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, bool b) const + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, bool b) const { - CGAL_precondition( !is_infinite(v3) && !is_infinite(v4) && - !is_infinite(v) ); + CGAL_precondition( !is_infinite(v3) && !is_infinite(v4) && + !is_infinite(v) ); if ( !is_infinite( v1 ) ) { CGAL_precondition( is_infinite( v2 ) ); @@ -1581,10 +1581,10 @@ template bool Apollonius_graph_2:: edge_interior(const Vertex_handle& v1, - const Vertex_handle& v2, - const Vertex_handle& v3, - const Vertex_handle& v4, - const Vertex_handle& v, bool b) const + const Vertex_handle& v2, + const Vertex_handle& v3, + const Vertex_handle& v4, + const Vertex_handle& v, bool b) const { CGAL_precondition( !is_infinite(v) ); @@ -1611,7 +1611,7 @@ template bool Apollonius_graph_2:: edge_interior(const Face_handle& f, int i, - const Site_2& p, bool b) const + const Site_2& p, bool b) const { Face_handle g = f->neighbor(i); @@ -1640,9 +1640,9 @@ template typename Apollonius_graph_2::Conflict_type Apollonius_graph_2:: infinite_edge_conflict_type(const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q) const + const Site_2& p3, + const Site_2& p4, + const Site_2& q) const { Sign i1 = incircle(p2, p3, q); Sign i2 = incircle(p4, p2, q); @@ -1673,8 +1673,8 @@ template typename Apollonius_graph_2::Conflict_type Apollonius_graph_2:: finite_edge_conflict_type_degenerated(const Site_2& p1, - const Site_2& p2, - const Site_2& q) const + const Site_2& p2, + const Site_2& q) const { Sign i1 = incircle(p1, p2, q); Sign i2 = incircle(p2, p1, q); @@ -1735,9 +1735,9 @@ remove_third(Vertex_handle v) for (int i = 0; i < 4; i++) { Edge e = *ec; Edge sym = sym_edge(e); - if ( e.first->vertex(e.second) != sym.first->vertex(sym.second) ) { - flip(e); - break; + if ( e.first->vertex(e.second) != sym.first->vertex(sym.second) ) { + flip(e); + break; } ++ec; } @@ -1763,11 +1763,11 @@ remove(Vertex_handle v) Vertex_circulator vc_start = incident_vertices(v); Vertex_circulator vc = vc_start; do { - if ( !is_infinite(vc) ) { - vnear = Vertex_handle(vc); - break; - } - ++vc; + if ( !is_infinite(vc) ) { + vnear = Vertex_handle(vc); + break; + } + ++vc; } while ( vc != vc_start ); } } @@ -1820,7 +1820,7 @@ remove_degree_d_vertex(Vertex_handle v) remove_degree_2(v); return; } - + Apollonius_graph_2 ag_small; std::map vmap; @@ -1833,10 +1833,10 @@ remove_degree_d_vertex(Vertex_handle v) if ( is_infinite(vh_large) ) { vh_small = ag_small.infinite_vertex(); vmap[vh_small] = vh_large; - } else { + } else { vh_small = ag_small.insert(vc->site()); if ( vh_small != Vertex_handle() ) { - vmap[vh_small] = vh_large; + vmap[vh_small] = vh_large; } } ++vc; @@ -1848,9 +1848,9 @@ remove_degree_d_vertex(Vertex_handle v) for (int i = 0; i < 4; i++) { Edge e = *ec; Edge sym = sym_edge(e); - if ( e.first->vertex(e.second) != sym.first->vertex(sym.second) ) { - flip(e); - break; + if ( e.first->vertex(e.second) != sym.first->vertex(sym.second) ) { + flip(e); + break; } ++ec; } @@ -1866,10 +1866,10 @@ remove_degree_d_vertex(Vertex_handle v) List l; Face_map fm; Vertex_map vm; - std::vector flipped_edges; + std::vector flipped_edges; ag_small.find_conflict_region_remove(v, vn, l, fm, vm, - &flipped_edges); + &flipped_edges); l.clear(); fm.clear(); @@ -1887,12 +1887,12 @@ remove_degree_d_vertex(Vertex_handle v) do { Edge e = *ec; if ( (e.first->vertex( cw(e.second) ) == vmap[(*vhq)[1]] && - e.first->vertex( e.second ) == vmap[(*vhq)[2]]) || - (e.first->vertex( ccw(e.second) ) == vmap[(*vhq)[1]] && - tds().mirror_vertex(e.first,e.second) == vmap[(*vhq)[2]]) ) { - flip(e); - found = true; - break; + e.first->vertex( e.second ) == vmap[(*vhq)[2]]) || + (e.first->vertex( ccw(e.second) ) == vmap[(*vhq)[1]] && + tds().mirror_vertex(e.first,e.second) == vmap[(*vhq)[2]]) ) { + flip(e); + found = true; + break; } ++ec; } while ( ec != ec_start ); @@ -1937,8 +1937,8 @@ minimize_degree(Vertex_handle v) f = e.first; if ( !f->has_vertex(v) ) { - f = e.first->neighbor(e.second); - CGAL_assertion( f->has_vertex(v) ); + f = e.first->neighbor(e.second); + CGAL_assertion( f->has_vertex(v) ); } fc = --( incident_faces(v,f) ); @@ -1975,10 +1975,10 @@ Apollonius_graph_2::file_output(std::ostream& os) const std::map V; std::map F; - // first vertex (infinite vertex) + // first vertex (infinite vertex) int inum = 0; V[infinite_vertex()] = inum++; - + // finite vertices if (is_ascii(os)) os << std::endl; for (Finite_vertices_iterator vit = finite_vertices_begin(); @@ -1989,7 +1989,7 @@ Apollonius_graph_2::file_output(std::ostream& os) const os << vit->number_of_hidden_sites(); typename Vertex::Hidden_sites_iterator hit; for (hit = vit->hidden_sites_begin(); hit != vit->hidden_sites_end(); - ++hit) { + ++hit) { if ( is_ascii(os) ) { os << ' '; } os << *hit; } @@ -2014,7 +2014,7 @@ Apollonius_graph_2::file_output(std::ostream& os) const if( is_ascii(os) ) { os << std::endl; } } if( is_ascii(os) ) { os << std::endl; } - + // neighbor pointers of the faces for( All_faces_iterator it = all_faces_begin(); it != all_faces_end(); ++it) { @@ -2069,8 +2069,8 @@ Apollonius_graph_2::file_input(std::istream& is) unsigned int n_hidden; is >> n_hidden; for (unsigned int i = 0; i < n_hidden; i++) { - is >> s; - v->add_hidden_site(s); + is >> s; + v->add_hidden_site(s); } } return; @@ -2106,7 +2106,7 @@ Apollonius_graph_2::file_input(std::istream& is) // read non-combinatorial info of the vertex // is >> *(V[i]); } - + // Creation of the faces int index; int dim = (dimension() == -1 ? 1 : dimension() + 1); @@ -2124,7 +2124,7 @@ Apollonius_graph_2::file_input(std::istream& is) // is >> *(F[i]) ; } - // Setting the neighbor pointers + // Setting the neighbor pointers for (i = 0; i < m; ++i) { for (int j = 0; j < dimension()+1; ++j){ is >> index; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index b9b649fbf6cb..2b9e0acf72c1 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -27,7 +27,7 @@ void Apollonius_graph_hierarchy_2:: init_hierarchy(const Geom_traits& gt) { - hierarchy[0] = this; + hierarchy[0] = this; for(unsigned int i = 1; i < ag_hierarchy_2__maxlevel; ++i) { hierarchy[i] = new Apollonius_graph_base(gt); } @@ -37,7 +37,7 @@ template Apollonius_graph_hierarchy_2:: Apollonius_graph_hierarchy_2(const Geom_traits& gt) : Apollonius_graph_base(gt) -{ +{ init_hierarchy(gt); } @@ -48,11 +48,11 @@ Apollonius_graph_hierarchy_2:: Apollonius_graph_hierarchy_2 (const Apollonius_graph_hierarchy_2& agh) : Apollonius_graph_base(agh.geom_traits()) -{ +{ init_hierarchy(agh.geom_traits()); copy(agh); -} - +} + //Assignement template @@ -78,14 +78,14 @@ copy //up and down have been copied in straightforward way // compute a map at lower level - for( Finite_vertices_iterator it = hierarchy[0]->finite_vertices_begin(); + for( Finite_vertices_iterator it = hierarchy[0]->finite_vertices_begin(); it != hierarchy[0]->finite_vertices_end(); ++it) { if ( it->up() != Vertex_handle() ) V[ it->up()->down() ] = it; } for(unsigned int i = 1; i < ag_hierarchy_2__maxlevel; ++i) { - for( Finite_vertices_iterator it = hierarchy[i]->finite_vertices_begin(); - it != hierarchy[i]->finite_vertices_end(); ++it) { + for( Finite_vertices_iterator it = hierarchy[i]->finite_vertices_begin(); + it != hierarchy[i]->finite_vertices_end(); ++it) { // down pointer goes in original instead in copied triangulation it->set_down(V[it->down()]); // make reverse link @@ -97,7 +97,7 @@ copy } template -Apollonius_graph_hierarchy_2:: +Apollonius_graph_hierarchy_2:: ~Apollonius_graph_hierarchy_2() { clear(); @@ -108,7 +108,7 @@ Apollonius_graph_hierarchy_2:: template void -Apollonius_graph_hierarchy_2:: +Apollonius_graph_hierarchy_2:: clear() { for(unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) { @@ -118,7 +118,7 @@ clear() template bool -Apollonius_graph_hierarchy_2:: +Apollonius_graph_hierarchy_2:: is_valid(bool verbose, int level) const { bool result(true); @@ -134,15 +134,15 @@ is_valid(bool verbose, int level) const } } //verify that lower level has no down pointers - for( Finite_vertices_iterator it = hierarchy[0]->finite_vertices_begin(); + for( Finite_vertices_iterator it = hierarchy[0]->finite_vertices_begin(); it != hierarchy[0]->finite_vertices_end(); ++it) { result = result && ( it->down() == 0 ); } //verify that other levels has down pointer and reciprocal link is fine for(unsigned int i = 1; i < ag_hierarchy_2__maxlevel; ++i) { - for( Finite_vertices_iterator it = hierarchy[i]->finite_vertices_begin(); - it != hierarchy[i]->finite_vertices_end(); ++it) { + for( Finite_vertices_iterator it = hierarchy[i]->finite_vertices_begin(); + it != hierarchy[i]->finite_vertices_end(); ++it) { result = result && ( &*it == &*(it->down()->up()) ); } } @@ -226,7 +226,7 @@ insert(const Site_2 &p) } while ( fc != fc_start ); if ( s != NEGATIVE ) { - typename Apollonius_graph_base::Edge_circulator ec_start = + typename Apollonius_graph_base::Edge_circulator ec_start = hierarchy[0]->incident_edges(vnear[0]); typename Apollonius_graph_base::Edge_circulator ec = ec_start; @@ -235,7 +235,7 @@ insert(const Site_2 &p) do { e = *ec; interior_in_conflict = edge_interior(e, p, false); - + if ( interior_in_conflict ) { break; } ++ec; } while ( ec != ec_start ); @@ -267,36 +267,36 @@ insert(const Site_2 &p) std::size_t n_non_hidden = this->number_of_vertices() - n_hidden; if ( n_non_hidden < 2 ) { for(unsigned int i = 1; i < ag_hierarchy_2__maxlevel; ++i) { - hierarchy[i]->clear(); + hierarchy[i]->clear(); } if ( n_non_hidden == 1 ) { - Vertex_handle non_hidden; - Finite_vertices_iterator vit = this->finite_vertices_begin(); - do { - non_hidden = Vertex_handle(vit); - ++vit; - } while ( v_hidden.find(non_hidden) != v_hidden.end() ); - - non_hidden->set_up( Vertex_handle() ); + Vertex_handle non_hidden; + Finite_vertices_iterator vit = this->finite_vertices_begin(); + do { + non_hidden = Vertex_handle(vit); + ++vit; + } while ( v_hidden.find(non_hidden) != v_hidden.end() ); + + non_hidden->set_up( Vertex_handle() ); } } else { typename Apollonius_graph_base::Vertex_map::iterator it; for (it = v_hidden.begin(); it != v_hidden.end(); it++) { - Vertex_handle v = (*it).first; - Vertex_handle u = v->up(); - if ( u != Vertex_handle() ) { - v = u; - u = v->up(); - unsigned int l = 1; - while ( true ) { - hierarchy[l++]->remove(v); - if ( u == Vertex_handle() ) break; - if(l >= ag_hierarchy_2__maxlevel) { break; } - v = u; - u = v->up(); - } - } + Vertex_handle v = (*it).first; + Vertex_handle u = v->up(); + if ( u != Vertex_handle() ) { + v = u; + u = v->up(); + unsigned int l = 1; + while ( true ) { + hierarchy[l++]->remove(v); + if ( u == Vertex_handle() ) break; + if(l >= ag_hierarchy_2__maxlevel) { break; } + v = u; + u = v->up(); + } + } } } } @@ -315,7 +315,7 @@ insert(const Site_2 &p) if ( n_hidden != 0 ) { nearest_neighbor(p.point(), vnear); } - + int level = 1; while (level <= vertex_level ){ vertex = hierarchy[level]->insert(p, vnear[level]); @@ -328,7 +328,7 @@ insert(const Site_2 &p) } template -void +void Apollonius_graph_hierarchy_2:: remove(Vertex_handle v) { @@ -350,7 +350,7 @@ remove(Vertex_handle v) unsigned int l = 0; while ( true ) { hierarchy[l++]->remove(v); - if ( u == Vertex_handle() ) break; + if ( u == Vertex_handle() ) break; if(l >= ag_hierarchy_2__maxlevel) break; v = u; u = v->up(); @@ -361,7 +361,7 @@ remove(Vertex_handle v) template -typename Apollonius_graph_hierarchy_2::Vertex_handle +typename Apollonius_graph_hierarchy_2::Vertex_handle Apollonius_graph_hierarchy_2:: nearest_neighbor(const Point_2& p) const { @@ -393,14 +393,14 @@ template void Apollonius_graph_hierarchy_2:: nearest_neighbor(const Point_2& p, - Vertex_handle vnear[ag_hierarchy_2__maxlevel]) const + Vertex_handle vnear[ag_hierarchy_2__maxlevel]) const { Vertex_handle nearest = 0; unsigned int level = ag_hierarchy_2__maxlevel; // find the highest level with enough vertices - while ( hierarchy[--level]->number_of_vertices() - < ag_hierarchy_2__minsize ) { + while ( hierarchy[--level]->number_of_vertices() + < ag_hierarchy_2__minsize ) { if ( !level ) break; // do not go below 0 } for (unsigned int i = level+1; i < ag_hierarchy_2__maxlevel; ++i) { @@ -409,7 +409,7 @@ nearest_neighbor(const Point_2& p, while ( level > 0 ) { vnear[level] = nearest = - hierarchy[level]->nearest_neighbor(p, nearest); + hierarchy[level]->nearest_neighbor(p, nearest); CGAL_assertion( !hierarchy[level]->is_infinite(vnear[level]) ); // go at the same vertex on level below @@ -424,7 +424,7 @@ template int Apollonius_graph_hierarchy_2:: random_level() -{ +{ boost::geometric_distribution<> proba(1.0/ag_hierarchy_2__ratio); boost::variate_generator > die(random, proba); @@ -451,7 +451,7 @@ file_input(std::istream& is) V[i].resize(hierarchy[i]->number_of_vertices()); int j = 0; for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); - vit != hierarchy[i]->finite_vertices_end(); ++vit, ++j) { + vit != hierarchy[i]->finite_vertices_end(); ++vit, ++j) { V[i][j] = vit; } } @@ -493,7 +493,7 @@ file_output(std::ostream& os) const for (unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) { int inum = 0; for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); - vit != hierarchy[i]->finite_vertices_end(); ++vit) { + vit != hierarchy[i]->finite_vertices_end(); ++vit) { V[i][vit] = inum++; } } @@ -504,17 +504,17 @@ file_output(std::ostream& os) const // create the map of up and down pointers for (unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) { for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); - vit != hierarchy[i]->finite_vertices_end(); ++vit) { + vit != hierarchy[i]->finite_vertices_end(); ++vit) { if ( vit->up() != Vertex_handle() ) { - V_up[i][vit] = V[i+1][vit->up()]; + V_up[i][vit] = V[i+1][vit->up()]; } else { - V_up[i][vit] = -1; + V_up[i][vit] = -1; } if ( vit->down() != Vertex_handle() ) { - V_down[i][vit] = V[i-1][vit->down()]; + V_down[i][vit] = V[i-1][vit->down()]; } else { - V_down[i][vit] = -1; + V_down[i][vit] = -1; } } } @@ -527,7 +527,7 @@ file_output(std::ostream& os) const os << hierarchy[i]->number_of_vertices(); if ( is_ascii(os) ) { os << std::endl; } for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); - vit != hierarchy[i]->finite_vertices_end(); ++vit) { + vit != hierarchy[i]->finite_vertices_end(); ++vit) { os << V[i][vit]; if ( is_ascii(os) ) { os << " "; } os << V_down[i][vit]; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h index 649ccf3eeffa..bbef2be6ac0b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -61,9 +61,9 @@ class Sign_of_Voronoi_radius // the existence test Sign sign_of_root; if ( is_first_root ) { - sign_of_root = sign_of_first_root(s_beta, s_gamma); + sign_of_root = sign_of_first_root(s_beta, s_gamma); } else { - sign_of_root = sign_of_second_root(s_beta, s_gamma); + sign_of_root = sign_of_second_root(s_beta, s_gamma); } return sign_of_root; } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h index 850bd0fe0057..d6aa847c7c1a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h index 91fe1c25b23b..4f5ea415f5f7 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h index e102eb84be05..c6086a430d3e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h index a11e9f72c256..2c72c8e7c8d0 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -49,15 +49,15 @@ template < class Gt > inline typename Gt::Point_2 ad_circumcenter_2(const typename Gt::Site_2& p, - const typename Gt::Site_2& q, - const typename Gt::Site_2& r) + const typename Gt::Site_2& q, + const typename Gt::Site_2& r) { typedef typename Gt::Point_2 Point_2; typename Gt::FT x,y; ad_circumcenterC2(p.x(),p.y(),p.weight(), - q.x(),q.y(),q.weight(), - r.x(),r.y(),r.weight(),x,y); + q.x(),q.y(),q.weight(), + r.x(),r.y(),r.weight(),x,y); return Point_2(x,y); } @@ -94,8 +94,8 @@ ad_circumcircle_2(const typename Gt::Site_2& p, typename Gt::FT x, y, wt; ad_circumcircleC2(p.x(),p.y(),p.weight(), - q.x(),q.y(),q.weight(), - r.x(),r.y(),r.weight(),x,y,wt); + q.x(),q.y(),q.weight(), + r.x(),r.y(),r.weight(),x,y,wt); return Site_2(Point_2(x,y), wt); } @@ -103,14 +103,14 @@ template < class Gt > inline typename Gt::Line_2 ad_left_bitangent_line_2(const typename Gt::Site_2& p, - const typename Gt::Site_2& q) + const typename Gt::Site_2& q) { typedef typename Gt::Line_2 Line_2; typename Gt::FT a, b, c; ad_left_bitangent_lineC2(p.x(),p.y(),p.weight(), - q.x(),q.y(),q.weight(), - a,b,c); + q.x(),q.y(),q.weight(), + a,b,c); return Line_2(a, b, c); } @@ -130,15 +130,15 @@ class Construct_Apollonius_site_2 #endif inline Site_2 operator()(const Site_2& p, - const Site_2& q, - const Site_2& r) const + const Site_2& q, + const Site_2& r) const { // CGAL_precondition( ! collinear(p, q, r) ); return ad_circumcircle_2< Gt >(p,q,r); } inline Line_2 operator()(const Site_2 &p, - const Site_2 &q) const + const Site_2 &q) const { return ad_left_bitangent_line_2< Gt >(p, q); } @@ -169,7 +169,7 @@ class Construct_Apollonius_bisector_2 } public: - Object_2 operator() (const Site_2& p, const Site_2& q) const + Object_2 operator() (const Site_2& p, const Site_2& q) const { Comparison_result cr = CGAL::compare(p.weight(), q.weight()); if ( cr == EQUAL ) { @@ -212,9 +212,9 @@ class Construct_Apollonius_bisector_ray_2 public: Object_2 operator() (const Site_2& p, - const Site_2& q, - const Point_2& r, - const Hyperbola_direction& direction) const { + const Site_2& q, + const Point_2& r, + const Hyperbola_direction& direction) const { // Comparison_result cr = CGAL::compare(p.weight(), q.weight()); if ( cr == EQUAL ) { @@ -229,8 +229,8 @@ class Construct_Apollonius_bisector_ray_2 Object_2 operator() (const Site_2& p, - const Site_2& q, - const Site_2& r) const { + const Site_2& q, + const Site_2& r) const { Point_2 c = Apollonius_vertex_2()(p, q, r); Comparison_result cr = CGAL::compare(p.weight(), q.weight()); if ( cr == EQUAL ) { @@ -265,12 +265,12 @@ class Construct_Apollonius_bisector_segment_2 Object_2 make_object(const T& t) const { return Construct_object_2()(t); - } + } public: inline Object_2 operator() (const Site_2& p, - const Site_2& q, - const Point_2& r, const Point_2& s) const { + const Site_2& q, + const Point_2& r, const Point_2& s) const { // Comparison_result cr = CGAL::compare(p.weight(), q.weight()); if ( cr == EQUAL ) { @@ -282,9 +282,9 @@ class Construct_Apollonius_bisector_segment_2 } inline Object_2 operator() (const Site_2& p, - const Site_2& q, - const Site_2& r, - const Site_2& s) const { + const Site_2& q, + const Site_2& r, + const Site_2& s) const { Apollonius_vertex_2 apollonius_vertex_2; Point_2 c_pqr = apollonius_vertex_2(p,q,r); Point_2 c_qps = apollonius_vertex_2(q,p,s); @@ -319,8 +319,8 @@ class Construct_Apollonius_primal_ray_2 typedef typename Gt::Construct_Apollonius_site_2 Apollonius_circle_2; inline Ray_2 operator() (const Site_2& p, - const Site_2& r, - const Site_2& s) const { + const Site_2& r, + const Site_2& s) const { // Apollonius_circle_2 apollonius_circle_2; Line_2 l1 = apollonius_circle_2(r, p); @@ -367,15 +367,15 @@ class Construct_Apollonius_primal_segment_2 inline Segment_2 operator() (const Site_2& p, - const Site_2& q) const { + const Site_2& q) const { // return Segment_2(p.point(), q.point()); } inline Object_2 operator() (const Site_2& p, - const Site_2& q, - const Point_2& r, const Point_2& s) const { + const Site_2& q, + const Point_2& r, const Point_2& s) const { // Comparison_result cr = CGAL::compare(p.weight(), q.weight()); if ( cr == EQUAL ) { @@ -388,9 +388,9 @@ class Construct_Apollonius_primal_segment_2 inline Object_2 operator() (const Site_2& p, - const Site_2& q, - const Site_2& r, - const Site_2& s) const { + const Site_2& q, + const Site_2& r, + const Site_2& s) const { if ( Is_degenerate_edge_2()(p, q, r, s) ) { Point_2 v = Apollonius_vertex_2()(p, q, r); Segment_2 seg1(p.point(), v); @@ -412,8 +412,8 @@ class Construct_Apollonius_primal_segment_2 inline Parabola_segment_2 operator() (const Site_2& p, - const Site_2& q, - const Site_2& r) const { + const Site_2& q, + const Site_2& r) const { // Apollonius_circle_2 apollonius_circle_2; Site_2 c = apollonius_circle_2(p, q, r); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h index 06fdb56957de..f76cd7bd8563 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -29,7 +29,7 @@ template < class FT > inline void invert_C2(const FT &x, const FT &y, const FT &wt, - FT &new_x, FT &new_y, FT &new_wt) + FT &new_x, FT &new_y, FT &new_wt) { FT p = CGAL::square(x) + CGAL::square(y) - CGAL::square(wt); @@ -44,9 +44,9 @@ invert_C2(const FT &x, const FT &y, const FT &wt, template < class FT > void w_plane_tangent_line_2(const FT &x1, const FT &y1, const FT &w1, - const FT &x2, const FT &y2, const FT &w2, - const FT &x3, const FT &y3, const FT &w3, - FT & a, FT & b, FT & c) + const FT &x2, const FT &y2, const FT &w2, + const FT &x3, const FT &y3, const FT &w3, + FT & a, FT & b, FT & c) { // we assume that the weight w1 is the smallest among w1, w2, w3. @@ -79,15 +79,15 @@ template < class FT > inline void z_plane_circumcircle_2(const FT &x1, const FT &y1, const FT &w1, - const FT &x2, const FT &y2, const FT &w2, - const FT &x3, const FT &y3, const FT &w3, - FT &cx, FT &cy, FT &cwt) + const FT &x2, const FT &y2, const FT &w2, + const FT &x3, const FT &y3, const FT &w3, + FT &cx, FT &cy, FT &cwt) { // we assume that the weight w1 is the smallest among w1, w2, w3. FT a, b, c; w_plane_tangent_line_2(x1, y1, w1, x2, y2, w2, - x3, y3, w3, a, b, c); + x3, y3, w3, a, b, c); cx = -a / (FT(2) * c) + x1; cy = b / (FT(2) * c) + y1; @@ -95,7 +95,7 @@ z_plane_circumcircle_2(const FT &x1, const FT &y1, const FT &w1, // this the only part that is computed at vain when only the center // is needed. #if 0 - FT cwt2 = (CGAL::square(a) + CGAL::square(b)) / + FT cwt2 = (CGAL::square(a) + CGAL::square(b)) / (FT(4) * CGAL::square(c)); #endif // cwt = CGAL::sqrt(cwt2) - FT(w1); @@ -107,52 +107,52 @@ z_plane_circumcircle_2(const FT &x1, const FT &y1, const FT &w1, template < class FT > void ad_circumcircleC2(const FT &x1, const FT &y1, const FT &w1, - const FT &x2, const FT &y2, const FT &w2, - const FT &x3, const FT &y3, const FT &w3, - FT &cx, FT &cy, FT &cwt) + const FT &x2, const FT &y2, const FT &w2, + const FT &x3, const FT &y3, const FT &w3, + FT &cx, FT &cy, FT &cwt) { if (CGAL::compare(w2, w1) != LARGER && CGAL::compare(w2, w3) != LARGER) { z_plane_circumcircle_2(x2, y2, w2, - x3, y3, w3, - x1, y1, w1, - cx, cy, cwt); + x3, y3, w3, + x1, y1, w1, + cx, cy, cwt); return; } else if (CGAL::compare(w3, w1) != LARGER && - CGAL::compare(w3, w2) != LARGER) { + CGAL::compare(w3, w2) != LARGER) { z_plane_circumcircle_2(x3, y3, w3, - x1, y1, w1, - x2, y2, w2, - cx, cy, cwt); + x1, y1, w1, + x2, y2, w2, + cx, cy, cwt); return; } z_plane_circumcircle_2(x1, y1, w1, - x2, y2, w2, - x3, y3, w3, - cx, cy, cwt); + x2, y2, w2, + x3, y3, w3, + cx, cy, cwt); } template < class FT > inline void ad_circumcenterC2(const FT &x1, const FT &y1, const FT &w1, - const FT &x2, const FT &y2, const FT &w2, - const FT &x3, const FT &y3, const FT &w3, - FT &cx, FT &cy) + const FT &x2, const FT &y2, const FT &w2, + const FT &x3, const FT &y3, const FT &w3, + FT &cx, FT &cy) { FT cwt; ad_circumcircleC2(x1, y1, w1, - x2, y2, w2, - x3, y3, w3, - cx, cy, cwt); + x2, y2, w2, + x3, y3, w3, + cx, cy, cwt); } template < class FT > void ad_left_bitangent_lineC2(const FT &x1, const FT &y1, const FT &w1, - const FT &x2, const FT &y2, const FT &w2, - FT & a, FT & b, FT & c) + const FT &x2, const FT &y2, const FT &w2, + FT & a, FT & b, FT & c) { FT dx = x1 - x2; FT dy = y1 - y2; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h index 6c15bdf9c560..025ecae27e4a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -28,36 +28,36 @@ template < class RT, class We > inline void ad_circumcenterH2(const RT &hx1, const RT &hy1, const RT &hw1, - const We &w1, - const RT &hx2, const RT &hy2, const RT &hw2, - const We &w2, - const RT &hx3, const RT &hy3, const RT &hw3, - const We &w3, - RT & cx, RT & cy, RT & cw) + const We &w1, + const RT &hx2, const RT &hy2, const RT &hw2, + const We &w2, + const RT &hx3, const RT &hy3, const RT &hw3, + const We &w3, + RT & cx, RT & cy, RT & cw) { We cwt; ad_circumcircleH2(hx1, hy1, hw1, w1, - hx2, hy2, hw2, w2, - hx3, hy3, hw3, w3, - cx, cy, cw, cwt); + hx2, hy2, hw2, w2, + hx3, hy3, hw3, w3, + cx, cy, cw, cwt); } template < class RT, class We > inline void ad_circumcircleH2(const RT &hx1, const RT &hy1, const RT &hw1, - const We &w1, - const RT &hx2, const RT &hy2, const RT &hw2, - const We &w2, - const RT &hx3, const RT &hy3, const RT &hw3, - const We &w3, - RT & cx, RT & cy, RT & cw, - We &cwt) + const We &w1, + const RT &hx2, const RT &hy2, const RT &hw2, + const We &w2, + const RT &hx3, const RT &hy3, const RT &hw3, + const We &w3, + RT & cx, RT & cy, RT & cw, + We &cwt) { ad_circumcircleC2(RT(hx1/hw1), RT(hy1/hw1), w1, - RT(hx2/hw2), RT(hy2/hw2), w2, - RT(hx3/hw3), RT(hy3/hw3), w3, - cx, cy, cwt); + RT(hx2/hw2), RT(hy2/hw2), w2, + RT(hx3/hw3), RT(hy3/hw3), w3, + cx, cy, cwt); cw = RT(1); } @@ -65,12 +65,12 @@ ad_circumcircleH2(const RT &hx1, const RT &hy1, const RT &hw1, template < class RT, class We > void ad_left_bitangent_lineH2(const FT &hx1, const FT &hy1, const We &w1, - const FT &hx2, const FT &hy2, const We &w2, - RT & a, RT & b, RT & c) + const FT &hx2, const FT &hy2, const We &w2, + RT & a, RT & b, RT & c) { ad_left_bitangent_lineC2(RT(hx1/hw1), RT(hy1/hw1), w1, - RT(hx2/hw2), RT(hy2/hw2), w2, - a, b, c); + RT(hx2/hw2), RT(hy2/hw2), w2, + a, b, c); } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h index 702d69dfb12f..224952827d63 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -47,10 +47,10 @@ class Inside_Voronoi_quadrilateral8 public: bool operator()(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& p2, + const Site_2& p3, + const Site_2& p4, + const Site_2& q, bool b, const Method_tag& tag) const { #if 1 Constructive_orientation_2 orientation123(p1, p2, p3, true); @@ -75,47 +75,47 @@ class Inside_Voronoi_quadrilateral8 if ( b ) { if ( o123_s != o142_s ) { - Orientation o123_1 = orientation123(p1, q); - Orientation o123_2 = orientation123(p2, q); - if ( o123_1 == POSITIVE && o123_2 == NEGATIVE ) { return true; } + Orientation o123_1 = orientation123(p1, q); + Orientation o123_2 = orientation123(p2, q); + if ( o123_1 == POSITIVE && o123_2 == NEGATIVE ) { return true; } - Orientation o142_1 = orientation142(p1, q); - Orientation o142_2 = orientation142(p2, q); - return (o142_1 == NEGATIVE && o142_2 == POSITIVE); + Orientation o142_1 = orientation142(p1, q); + Orientation o142_2 = orientation142(p2, q); + return (o142_1 == NEGATIVE && o142_2 == POSITIVE); } Oriented_side os = Side_of_bisector_2()(p1, p2, q.point()); if ( o123_s == POSITIVE ) { - if ( os == ON_POSITIVE_SIDE ) { - Orientation o142_1 = orientation142(p1, q); - if ( o142_1 == NEGATIVE ) { return true; } + if ( os == ON_POSITIVE_SIDE ) { + Orientation o142_1 = orientation142(p1, q); + if ( o142_1 == NEGATIVE ) { return true; } - Orientation o123_1 = orientation123(p1, q); - return o123_1 == POSITIVE; - } + Orientation o123_1 = orientation123(p1, q); + return o123_1 == POSITIVE; + } - Orientation o142_2 = orientation142(p2, q); - if ( o142_2 == POSITIVE ) { return true; } + Orientation o142_2 = orientation142(p2, q); + if ( o142_2 == POSITIVE ) { return true; } - Orientation o123_2 = orientation123(p2, q); - return o123_2 == NEGATIVE; + Orientation o123_2 = orientation123(p2, q); + return o123_2 == NEGATIVE; } if ( o123_s == NEGATIVE ) { - if ( os == ON_POSITIVE_SIDE ) { - Orientation o123_1 = orientation123(p1, q); - if ( o123_1 == POSITIVE ) { return true; } + if ( os == ON_POSITIVE_SIDE ) { + Orientation o123_1 = orientation123(p1, q); + if ( o123_1 == POSITIVE ) { return true; } - Orientation o142_1 = orientation142(p1, q); - return o142_1 == NEGATIVE; - } + Orientation o142_1 = orientation142(p1, q); + return o142_1 == NEGATIVE; + } - Orientation o123_2 = orientation123(p2, q); - if ( o123_2 == NEGATIVE ) { return true; } + Orientation o123_2 = orientation123(p2, q); + if ( o123_2 == NEGATIVE ) { return true; } - Orientation o142_2 = orientation142(p2, q); - return o142_2 == POSITIVE; + Orientation o142_2 = orientation142(p2, q); + return o142_2 == POSITIVE; } CGAL_assertion( o123_s == ZERO ); @@ -132,7 +132,7 @@ class Inside_Voronoi_quadrilateral8 Orientation o123_2 = orientation123(p2, q); if ( o123_2 != NEGATIVE ) { return false; } - + Orientation o142_1 = orientation142(p1, q); if ( o142_1 != NEGATIVE ) { return false; } @@ -144,11 +144,11 @@ class Inside_Voronoi_quadrilateral8 if ( o123_s == POSITIVE ) { if ( os == ON_POSITIVE_SIDE ) { - Orientation o123_1 = orientation123(p1, q); - if ( o123_1 != POSITIVE ) { return false; } + Orientation o123_1 = orientation123(p1, q); + if ( o123_1 != POSITIVE ) { return false; } - Orientation o142_1 = orientation142(p1, q); - return o142_1 == NEGATIVE; + Orientation o142_1 = orientation142(p1, q); + return o142_1 == NEGATIVE; } Orientation o123_2 = orientation123(p2, q); @@ -160,11 +160,11 @@ class Inside_Voronoi_quadrilateral8 if ( o123_s == NEGATIVE ) { if ( os == ON_POSITIVE_SIDE ) { - Orientation o142_1 = orientation142(p1, q); - if ( o142_1 != NEGATIVE ) { return false; } + Orientation o142_1 = orientation142(p1, q); + if ( o142_1 != NEGATIVE ) { return false; } - Orientation o123_1 = orientation123(p1, q); - return o123_1 == POSITIVE; + Orientation o123_1 = orientation123(p1, q); + return o123_1 == POSITIVE; } Orientation o142_2 = orientation142(p2, q); if ( o142_2 != POSITIVE ) { return false; } @@ -184,7 +184,7 @@ class Inside_Voronoi_quadrilateral8 // std::cerr << "o142_1: " << o142_1 << std::endl; if ( b ) { - return !(o123_1 == NEGATIVE && o142_1 == POSITIVE); + return !(o123_1 == NEGATIVE && o142_1 == POSITIVE); } return o123_1 == POSITIVE && o142_1 == NEGATIVE; } @@ -212,41 +212,41 @@ class Inside_Voronoi_quadrilateral8 if ( b ) { if ( o123_s != o142_s ) { - Orientation o123_1 = orientation123(p1, q); - Orientation o123_2 = orientation123(p2, q); - if ( o123_1 == POSITIVE && o123_2 == NEGATIVE ) { return true; } + Orientation o123_1 = orientation123(p1, q); + Orientation o123_2 = orientation123(p2, q); + if ( o123_1 == POSITIVE && o123_2 == NEGATIVE ) { return true; } - Orientation o142_1 = orientation142(p1, q); - Orientation o142_2 = orientation142(p2, q); - return (o142_1 == NEGATIVE && o142_2 == POSITIVE); + Orientation o142_1 = orientation142(p1, q); + Orientation o142_2 = orientation142(p2, q); + return (o142_1 == NEGATIVE && o142_2 == POSITIVE); } if ( o123_s == POSITIVE ) { - Orientation o142_1 = orientation142(p1, q); - if ( o142_1 == NEGATIVE ) { return true; } + Orientation o142_1 = orientation142(p1, q); + if ( o142_1 == NEGATIVE ) { return true; } - Orientation o142_2 = orientation142(p2, q); - if ( o142_2 == POSITIVE ) { return true; } + Orientation o142_2 = orientation142(p2, q); + if ( o142_2 == POSITIVE ) { return true; } - Orientation o123_1 = orientation123(p1, q); - if ( o123_1 != POSITIVE ) { return false; } + Orientation o123_1 = orientation123(p1, q); + if ( o123_1 != POSITIVE ) { return false; } - Orientation o123_2 = orientation123(p2, q); - return o123_2 == NEGATIVE; + Orientation o123_2 = orientation123(p2, q); + return o123_2 == NEGATIVE; } if ( o123_s == NEGATIVE ) { - Orientation o123_1 = orientation123(p1, q); - if ( o123_1 == POSITIVE ) { return true; } + Orientation o123_1 = orientation123(p1, q); + if ( o123_1 == POSITIVE ) { return true; } - Orientation o123_2 = orientation123(p2, q); - if ( o123_2 == NEGATIVE ) { return true; } + Orientation o123_2 = orientation123(p2, q); + if ( o123_2 == NEGATIVE ) { return true; } - Orientation o142_1 = orientation142(p1, q); - if ( o142_1 != NEGATIVE ) { return false; } + Orientation o142_1 = orientation142(p1, q); + if ( o142_1 != NEGATIVE ) { return false; } - Orientation o142_2 = orientation142(p2, q); - return o142_2 == POSITIVE; + Orientation o142_2 = orientation142(p2, q); + return o142_2 == POSITIVE; } CGAL_assertion( o123_s == ZERO ); @@ -263,7 +263,7 @@ class Inside_Voronoi_quadrilateral8 Orientation o123_2 = orientation123(p2, q); if ( o123_2 != NEGATIVE ) { return false; } - + Orientation o142_1 = orientation142(p1, q); if ( o142_1 != NEGATIVE ) { return false; } @@ -335,10 +335,10 @@ class Finite_edge_interior_conflict8 public: bool operator()(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& p2, + const Site_2& p3, + const Site_2& p4, + const Site_2& q, bool b, const Method_tag& tag) const { typedef Inside_Voronoi_quadrilateral8 Inside_quadrilateral; @@ -399,7 +399,7 @@ class Finite_edge_interior_conflict8 Comparison_result r = - Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); + Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); if ( r != SMALLER ) { return false; } @@ -479,7 +479,7 @@ class Finite_edge_interior_conflict_degenerated8 template bool operator()(const Site_2& p1, const Site_2& p2, const Site_2& p3, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& q, bool b, const Method_tag& tag) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::shadow_region_type_counter++; @@ -535,7 +535,7 @@ class Finite_edge_interior_conflict_degenerated8 Voronoi_circle vc_12q(vr_12q); Comparison_result r = - Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); + Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); return ( r == SMALLER ); } @@ -553,9 +553,9 @@ class Finite_edge_interior_conflict_degenerated8 inline Sign sqrt_ext_sign(const FT& A1, const FT& Dr, const FT& B, - const FT& Dx1, const FT& Dy1, - const FT& Dx2, const FT& Dy2, - const Field_with_sqrt_tag&) const + const FT& Dx1, const FT& Dy1, + const FT& Dx2, const FT& Dy2, + const Field_with_sqrt_tag&) const { FT D = CGAL::square(Dx1) + CGAL::square(Dy1) - CGAL::square(Dr); return CGAL::sign(A1 * Dr + B * CGAL::sqrt(D)); @@ -563,9 +563,9 @@ class Finite_edge_interior_conflict_degenerated8 inline Sign sqrt_ext_sign(const FT& A1, const FT& Dr, const FT& B, - const FT& Dx1, const FT& Dy1, - const FT& Dx2, const FT& Dy2, - const Integral_domain_without_division_tag&) const + const FT& Dx1, const FT& Dy1, + const FT& Dx2, const FT& Dy2, + const Integral_domain_without_division_tag&) const { Sign sA = CGAL::sign(A1) * CGAL::sign(Dr); Sign sB = CGAL::sign(B); @@ -581,8 +581,8 @@ class Finite_edge_interior_conflict_degenerated8 template Orientation orientation_wrt_bitangent_perp(const Site_2& p1, const Site_2& p2, - const Site_2& q1, const Site_2& q2, - const Method_tag& tag) const + const Site_2& q1, const Site_2& q2, + const Method_tag& tag) const { // computes the orientation predicate of the line perpendicular to // the bitangent of p1 and p2, passing through the center of q1, @@ -606,7 +606,7 @@ class Finite_edge_interior_conflict_degenerated8 template bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& q, bool b, const Method_tag& tag) const { #if 0 Side_of_bisector_2 side_of_bisector; @@ -616,8 +616,8 @@ class Finite_edge_interior_conflict_degenerated8 if ( o12_sym == CGAL::POSITIVE ) { if ( os == ON_POSITIVE_SIDE ) { - Orientation o21_1 = orientation_wrt_bitangent_perp(p2, p1, p1, q, tag); - return o21_1 == NEGATIVE; + Orientation o21_1 = orientation_wrt_bitangent_perp(p2, p1, p1, q, tag); + return o21_1 == NEGATIVE; } Orientation o21_2 = orientation_wrt_bitangent_perp(p2, p1, p2, q, tag); @@ -625,8 +625,8 @@ class Finite_edge_interior_conflict_degenerated8 } else { if ( os == ON_POSITIVE_SIDE ) { - Orientation o12_1 = orientation_wrt_bitangent_perp(p1, p2, p1, q, tag); - return o12_1 == POSITIVE; + Orientation o12_1 = orientation_wrt_bitangent_perp(p1, p2, p1, q, tag); + return o12_1 == POSITIVE; } Orientation o12_2 = orientation_wrt_bitangent_perp(p1, p2, p2, q, tag); @@ -681,10 +681,10 @@ class Finite_edge_interior_conflict8_2 inline bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q, bool b) const + const Site_2& q, bool b) const { typedef Finite_edge_interior_conflict_2 Old_Test; - bool t = Test_degenerated()(p1, p2, q, b, Method_tag()); + bool t = Test_degenerated()(p1, p2, q, b, Method_tag()); // bool t = Old_Test()(p1, p2, q, b); #ifndef NDEBUG bool t_old = Old_Test()(p1, p2, q, b); @@ -692,7 +692,7 @@ class Finite_edge_interior_conflict8_2 if ( t != t_old ) { std::cerr << std::endl; std::cerr << "b: " << b << "; t: " << t - << "; t_old: " << t_old << std::endl; + << "; t_old: " << t_old << std::endl; std::cerr << "p1: " << p1 << std::endl; std::cerr << "p2: " << p2 << std::endl; std::cerr << "q: " << q << std::endl; @@ -705,18 +705,18 @@ class Finite_edge_interior_conflict8_2 inline bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& q, bool b) const + const Site_2& p3, const Site_2& q, bool b) const { - return Test_degenerated()(p1, p2, p3, q, b, Method_tag()); + return Test_degenerated()(p1, p2, p3, q, b, Method_tag()); } inline bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& p4, - const Site_2& q, bool b) const + const Site_2& p3, const Site_2& p4, + const Site_2& q, bool b) const { typedef Finite_edge_interior_conflict_2 Old_Test; - bool t = Test()(p1, p2, p3, p4, q, b, Method_tag()); + bool t = Test()(p1, p2, p3, p4, q, b, Method_tag()); // bool t = Old_Test()(p1, p2, p3, p4, q, b); #ifndef NDEBUG bool t_old = Old_Test()(p1, p2, p3, p4, q, b); @@ -738,7 +738,7 @@ class Finite_edge_interior_conflict8_2 CGAL_assertion( t == t_old ); #endif - return t; //Test()(p1, p2, p3, p4, q, b, Method_tag()); + return t; //Test()(p1, p2, p3, p4, q, b, Method_tag()); } }; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h index ac6290925ffc..4f4f9dcc7f01 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -44,7 +44,7 @@ class Orientation_wrt_symmetry_axis_2 Orientation operator()(const Voronoi_circle& vc, const Point_2& p1, - const Point_2& p2, const Field_with_sqrt_tag&) const + const Point_2& p2, const Field_with_sqrt_tag&) const { FT a = vc.a1() + vc.a2() * CGAL::sqrt(vc.delta()); FT b = vc.b1() + vc.b2() * CGAL::sqrt(vc.delta()); @@ -54,7 +54,7 @@ class Orientation_wrt_symmetry_axis_2 Orientation operator()(const Voronoi_circle& vc, const Point_2& p1, - const Point_2& p2, const Integral_domain_without_division_tag&) const + const Point_2& p2, const Integral_domain_without_division_tag&) const { FT dx = p2.x() - p1.x(); FT dy = p2.y() - p1.y(); @@ -79,11 +79,11 @@ class Compare_Voronoi_radii_2 private: Sign sign_of_P4(const FT& u, const FT& v, - const FT& du, const FT& dv, const FT& dr, - const FT& Du, const FT& Dv, const FT& Dr) const + const FT& du, const FT& dv, const FT& dr, + const FT& Du, const FT& Dv, const FT& Dr) const { std::pair factors = factors_of_P4(u, v, du, dv, dr, - Du, Dv, Dr); + Du, Dv, Dr); Sign s1 = CGAL::sign(factors.first); Sign s2 = CGAL::sign(factors.second); return s1 * s2; @@ -91,8 +91,8 @@ class Compare_Voronoi_radii_2 std::pair factors_of_P4(const FT& u, const FT& v, - const FT& du, const FT& dv, const FT& dr, - const FT& Du, const FT& Dv, const FT& Dr) const + const FT& du, const FT& dv, const FT& dr, + const FT& Du, const FT& Dv, const FT& Dr) const { FT u2 = CGAL::square(u); FT v2 = CGAL::square(v); @@ -120,10 +120,10 @@ class Compare_Voronoi_radii_2 FT uV_P_Uv = du * Dv + Du * dv; FT uV_M_Uv = du * Dv - Du * dv; - + FT F1 = du2_P_dv2 * Dr2 + Du2_P_Dv2 * dr2 - - uU_P_vV * drDr - CGAL::square(uV_M_Uv); + - uU_P_vV * drDr - CGAL::square(uV_M_Uv); FT F2 = CGAL::square(u2_P_v2) * (du2_P_dv2 * Dr2 + Du2_P_Dv2 * dr2); F2 -= u2_P_v2 * (u2_M_v2 * uU_M_vV + uv * uV_P_Uv) * drDr; @@ -136,7 +136,7 @@ class Compare_Voronoi_radii_2 public: Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - const Field_with_sqrt_tag&) const + const Field_with_sqrt_tag&) const { FT c1 = (vc1.c1() + vc1.c2() * CGAL::sqrt(vc1.delta())) / vc1.d(); FT c2 = (vc2.c1() + vc2.c2() * CGAL::sqrt(vc2.delta())) / vc2.d(); @@ -150,7 +150,7 @@ class Compare_Voronoi_radii_2 /* Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - Integral_domain_without_division_tag) + Integral_domain_without_division_tag) { FT A = vc1.c1() * vc2.d() - vc2.c1() * vc1.d(); FT B = vc1.c2() * vc2.d(); @@ -167,7 +167,7 @@ class Compare_Voronoi_radii_2 Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - const Integral_domain_without_division_tag&) const + const Integral_domain_without_division_tag&) const { bool is_first_root1 = vc1.is_first_root(); bool is_first_root2 = vc2.is_first_root(); @@ -177,28 +177,28 @@ class Compare_Voronoi_radii_2 Comparison_result r; if ( is_first_root1 && is_first_root2 ) { - r = ke_compare_l1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = ke_compare_l1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } else if ( is_first_root1 && !is_first_root2 ) { - r = ke_compare_l1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = ke_compare_l1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } else if ( !is_first_root1 && is_first_root2 ) { - r = ke_compare_r1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = ke_compare_r1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } else { - r = ke_compare_r1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = ke_compare_r1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } #ifdef COMPARATOR_PROFILER if ( comparator_profiler::count_cases ) { - // count cases only for the tree r1-r2 - if ( !is_first_root1 && !is_first_root2 ) { - comparator_profiler::count_case(vc1.alpha(), vc1.beta(), - vc1.gamma(), - vc2.alpha(), vc2.beta(), - vc2.gamma()); - } + // count cases only for the tree r1-r2 + if ( !is_first_root1 && !is_first_root2 ) { + comparator_profiler::count_case(vc1.alpha(), vc1.beta(), + vc1.gamma(), + vc2.alpha(), vc2.beta(), + vc2.gamma()); + } } #endif @@ -210,7 +210,7 @@ class Compare_Voronoi_radii_2 /* Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - Integral_domain_without_division_tag) + Integral_domain_without_division_tag) { bool is_first_root1 = vc1.is_first_root(); bool is_first_root2 = vc2.is_first_root(); @@ -220,17 +220,17 @@ class Compare_Voronoi_radii_2 Comparison_result r; if ( is_first_root1 && is_first_root2 ) { - r = dfmt_compare_l1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = dfmt_compare_l1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } else if ( is_first_root1 && !is_first_root2 ) { - r = dfmt_compare_l1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = dfmt_compare_l1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } else if ( !is_first_root1 && is_first_root2 ) { - r = dfmt_compare_r1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = dfmt_compare_r1_l2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } else { - r = dfmt_compare_r1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), - vc2.alpha(), vc2.beta(), vc2.gamma()); + r = dfmt_compare_r1_r2(vc1.alpha(), vc1.beta(), vc1.gamma(), + vc2.alpha(), vc2.beta(), vc2.gamma()); } if ( r == EQUAL ) { return EQUAL; } @@ -256,47 +256,47 @@ class Order_on_finite_bisector_2 typedef Orientation_wrt_symmetry_axis_2 Orientation_wrt_symmetry_axis; - + public: template Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - const Site_2& p1, const Site_2& p2, - const Method_tag& tag) const + const Site_2& p1, const Site_2& p2, + const Method_tag& tag) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::order_on_bisector_counter++; #endif Orientation o1 = - Orientation_wrt_symmetry_axis()(vc1, p1.point(), p2.point(), tag); + Orientation_wrt_symmetry_axis()(vc1, p1.point(), p2.point(), tag); Orientation o2 = - Orientation_wrt_symmetry_axis()(vc2, p1.point(), p2.point(), tag); + Orientation_wrt_symmetry_axis()(vc2, p1.point(), p2.point(), tag); Comparison_result cr; if ( o1 == LEFT_TURN ) { - if ( o2 != LEFT_TURN ) { return SMALLER; } - Comparison_result r = Compare_Voronoi_radii()(vc1, vc2, tag); - - if ( r == EQUAL ) { - cr = EQUAL; - } else { - cr = (r == LARGER ) ? SMALLER : LARGER; - } + if ( o2 != LEFT_TURN ) { return SMALLER; } + Comparison_result r = Compare_Voronoi_radii()(vc1, vc2, tag); + + if ( r == EQUAL ) { + cr = EQUAL; + } else { + cr = (r == LARGER ) ? SMALLER : LARGER; + } } else if ( o1 == COLLINEAR ) { - if ( o2 == COLLINEAR ) { - cr = EQUAL; - } else { - cr = (o2 == LEFT_TURN) ? LARGER : SMALLER; - } + if ( o2 == COLLINEAR ) { + cr = EQUAL; + } else { + cr = (o2 == LEFT_TURN) ? LARGER : SMALLER; + } } else { - if ( o2 != RIGHT_TURN ) { - cr = LARGER; - } else { - Comparison_result r = - Compare_Voronoi_radii()(vc1, vc2, tag); - cr = r; - } + if ( o2 != RIGHT_TURN ) { + cr = LARGER; + } else { + Comparison_result r = + Compare_Voronoi_radii()(vc1, vc2, tag); + cr = r; + } } return cr; @@ -334,10 +334,10 @@ class Finite_edge_interior_conflict template bool operator()(const Site_2& p1, - const Site_2& p2, - const Site_2& p3, - const Site_2& p4, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& p2, + const Site_2& p3, + const Site_2& p4, + const Site_2& q, bool b, const Method_tag& tag) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::shadow_region_type_counter++; @@ -395,7 +395,7 @@ class Finite_edge_interior_conflict Comparison_result r = - Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); + Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); if ( r != SMALLER ) { return false; } @@ -462,7 +462,7 @@ class Finite_edge_interior_conflict_degenerated template bool operator()(const Site_2& p1, const Site_2& p2, const Site_2& p3, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& q, bool b, const Method_tag& tag) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::shadow_region_type_counter++; @@ -518,7 +518,7 @@ class Finite_edge_interior_conflict_degenerated Voronoi_circle vc_12q(vr_12q); Comparison_result r = - Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); + Order_on_finite_bisector()(vc_123, vc_12q, p1, p2, tag); return ( r == SMALLER ); } @@ -540,7 +540,7 @@ class Finite_edge_interior_conflict_degenerated template bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q, bool b, const Method_tag& tag) const + const Site_2& q, bool b, const Method_tag& tag) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::shadow_region_type_counter++; @@ -571,7 +571,7 @@ class Finite_edge_interior_conflict_degenerated if ( !is_bs1 && is_bs2 ) { return false; } // both circles exist - + // check whether the shadow region is connected, i.e., whether it is // of the form (a, b) or (-oo, a) U (b, +oo) @@ -601,24 +601,24 @@ class Finite_edge_interior_conflict_2 inline bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q, bool b) const + const Site_2& q, bool b) const { return Test_degenerated()(p1, p2, q, b, Method_tag()); } inline bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& q, bool b) const + const Site_2& p3, const Site_2& q, bool b) const { - return Test_degenerated()(p1, p2, p3, q, b, Method_tag()); + return Test_degenerated()(p1, p2, p3, q, b, Method_tag()); } inline bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& p4, - const Site_2& q, bool b) const + const Site_2& p3, const Site_2& p4, + const Site_2& q, bool b) const { - return Test()(p1, p2, p3, p4, q, b, Method_tag()); + return Test()(p1, p2, p3, p4, q, b, Method_tag()); } }; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h index f6abc6e05643..dd2bc5cb7c59 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -48,8 +48,8 @@ class Vertex_conflict8_2 private: inline Sign predicate(const FT& Exp, const FT& Eyp, const FT& Erp, - const FT& Exrp, const FT& Eyrp, const FT& Exyp, - const Field_with_sqrt_tag&) const + const FT& Exrp, const FT& Eyrp, const FT& Exyp, + const Field_with_sqrt_tag&) const { FT G = CGAL::square(Exp) + CGAL::square(Eyp) - CGAL::square(Erp); return CGAL::sign(Exp * Exrp + Eyp * Eyrp + Exyp * CGAL::sqrt(G)); @@ -57,8 +57,8 @@ class Vertex_conflict8_2 inline Sign predicate(const FT& Exp, const FT& Eyp, const FT& /* Erp */, - const FT& Exrp, const FT& Eyrp, const FT& Exyp, - const Integral_domain_without_division_tag&) const + const FT& Exrp, const FT& Eyrp, const FT& Exyp, + const Integral_domain_without_division_tag&) const { Sign sA = CGAL::sign(Exp * Exrp + Eyp * Eyrp); Sign sB = CGAL::sign(Exyp); @@ -76,7 +76,7 @@ class Vertex_conflict8_2 public: inline Sign operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& q) const + const Site_2& p3, const Site_2& q) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::incircle_counter++; @@ -116,10 +116,10 @@ class Vertex_conflict8_2 inline Sign operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q) const + const Site_2& q) const { return Base::operator()(p1, p2, q); - } + } }; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h index 0f5675777c61..1420c5dde5c7 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -46,7 +46,7 @@ class Sign_of_distance_from_bitangent_line_2 inline Sign operator()(const Bitangent_line& bl, const Site_2& q, - const Field_with_sqrt_tag&) const + const Field_with_sqrt_tag&) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::distance_from_bitangent_counter++; @@ -60,13 +60,13 @@ class Sign_of_distance_from_bitangent_line_2 inline Sign operator()(const Bitangent_line& bl, const Site_2& q, - const Integral_domain_without_division_tag&) const + const Integral_domain_without_division_tag&) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::distance_from_bitangent_counter++; #endif FT A = bl.a1() * q.x() + bl.b1() * q.y() + bl.c1() - - q.weight() * bl.d(); + - q.weight() * bl.d(); FT B = bl.a2() * q.x() + bl.b2() * q.y() + bl.c2(); return sign_a_plus_b_x_sqrt_c(A, B, bl.delta()); } @@ -87,8 +87,8 @@ class Sign_of_distance_from_CCW_circle_2 public: inline Sign operator()(const Bitangent_line& bl, - const Inverted_weighted_point& v, - const Field_with_sqrt_tag&) const + const Inverted_weighted_point& v, + const Field_with_sqrt_tag&) const { FT a = bl.a1() + bl.a2() * CGAL::sqrt(bl.delta()); FT b = bl.b1() + bl.b2() * CGAL::sqrt(bl.delta()); @@ -99,11 +99,11 @@ class Sign_of_distance_from_CCW_circle_2 inline Sign operator()(const Bitangent_line& bl, - const Inverted_weighted_point& v, - const Integral_domain_without_division_tag&) const + const Inverted_weighted_point& v, + const Integral_domain_without_division_tag&) const { FT A = bl.a1() * v.x() + bl.b1() * v.y() + bl.c1() * v.p() - - v.weight() * bl.d(); + - v.weight() * bl.d(); FT B = bl.a2() * v.x() + bl.b2() * v.y() + bl.c2() * v.p(); return sign_a_plus_b_x_sqrt_c(A, B, bl.delta()); @@ -117,7 +117,7 @@ class Weighted_point_less_than public: inline bool operator()(const Weighted_point& p1, - const Weighted_point& p2) const + const Weighted_point& p2) const { if ( p1.x() == p2.x() ) { return p1.y() < p2.y(); @@ -155,7 +155,7 @@ class Vertex_conflict_2 private: inline Orientation orientation(const Bitangent_line& l, const Point_2& p, - const Field_with_sqrt_tag&) const + const Field_with_sqrt_tag&) const { FT A = l.a1() * p.x() + l.b1() * p.y() + l.c1(); FT B = l.a2() * p.x() + l.b2() * p.y() + l.c2(); @@ -165,17 +165,17 @@ class Vertex_conflict_2 inline Orientation orientation(const Bitangent_line& l, const Point_2& p, - const Integral_domain_without_division_tag&) const + const Integral_domain_without_division_tag&) const { FT A = l.a1() * p.x() + l.b1() * p.y() + l.c1(); FT B = l.a2() * p.x() + l.b2() * p.y() + l.c2(); return sign_a_plus_b_x_sqrt_c(A, B, l.delta()); } - + inline Orientation orientation(const Bitangent_line& l, - const Inverted_weighted_point& u) const + const Inverted_weighted_point& u) const { FT A = l.a1() * u.x() / u.p() + l.b1() * u.y() / u.p() + l.c1(); FT B = l.a2() * u.x() / u.p() + l.b2() * u.y() / u.p() + l.c2(); @@ -189,7 +189,7 @@ class Vertex_conflict_2 inline Sign operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& q) const + const Site_2& p3, const Site_2& q) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::incircle_counter++; @@ -214,7 +214,7 @@ class Vertex_conflict_2 inline Sign operator()(const Site_2& p1, const Site_2& p2, - const Site_2& q) const + const Site_2& q) const { Method_tag tag; // @@ -230,7 +230,7 @@ class Vertex_conflict_2 CGAL_assertion( o1 != COLLINEAR || o2 != COLLINEAR ); if ( o1 == o2 ) { return POSITIVE; } return NEGATIVE; - } + } }; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h index c5ca1bc37165..2e97eed0c64d 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -43,11 +43,11 @@ class Bounded_side_of_CCW_circular_arc_2 typedef typename K::Orientation Orientation; typedef typename K::Sign Sign; -public: +public: template< class Method_tag > Bounded_side operator()(const Bitangent_line& l1, - const Bitangent_line& l2, - const Bitangent_line& l3, Method_tag tag) const + const Bitangent_line& l2, + const Bitangent_line& l3, Method_tag tag) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::inside_circular_arc_counter++; @@ -64,43 +64,43 @@ class Bounded_side_of_CCW_circular_arc_2 if ( o == COLLINEAR ) { - Bitangent_line l2_rot = l2.get_rot90(); - Sign dot = chi2(l1, l2_rot, tag); + Bitangent_line l2_rot = l2.get_rot90(); + Sign dot = chi2(l1, l2_rot, tag); //sign_of_determinant(a1, b1, -b2, a2); - CGAL_assertion( dot != ZERO ); - Orientation o1 = chi2(l1, l3, tag); + CGAL_assertion( dot != ZERO ); + Orientation o1 = chi2(l1, l3, tag); //sign_of_determinant(a1, b1, a3, b3); - if ( dot == POSITIVE ) { - if ( o1 != COLLINEAR ) { return ON_UNBOUNDED_SIDE; } - Bitangent_line l3_rot = l3.get_rot90(); - Sign dot1 = chi2(l1, l3_rot, tag); + if ( dot == POSITIVE ) { + if ( o1 != COLLINEAR ) { return ON_UNBOUNDED_SIDE; } + Bitangent_line l3_rot = l3.get_rot90(); + Sign dot1 = chi2(l1, l3_rot, tag); //sign_of_determinant(a1, b1, -b3, a3); - CGAL_assertion( dot1 != ZERO ); - return ( dot1 == POSITIVE ) ? ON_BOUNDARY : ON_UNBOUNDED_SIDE; - } + CGAL_assertion( dot1 != ZERO ); + return ( dot1 == POSITIVE ) ? ON_BOUNDARY : ON_UNBOUNDED_SIDE; + } - if ( o1 == LEFT_TURN ) { return ON_BOUNDED_SIDE; } - return ( o1 == COLLINEAR ) ? ON_BOUNDARY : ON_UNBOUNDED_SIDE; + if ( o1 == LEFT_TURN ) { return ON_BOUNDED_SIDE; } + return ( o1 == COLLINEAR ) ? ON_BOUNDARY : ON_UNBOUNDED_SIDE; } else if ( o == LEFT_TURN ) { - Orientation o1 = chi2(l1, l3, tag); - //sign_of_determinant(a1, b1, a3, b3); - Orientation o2 = chi2(l2, l3, tag); + Orientation o1 = chi2(l1, l3, tag); + //sign_of_determinant(a1, b1, a3, b3); + Orientation o2 = chi2(l2, l3, tag); //sign_of_determinant(a2, b2, a3, b3); - // std::cout << "orientation(l1, l3): " << int(o1) << std::endl; - // std::cout << "orientation(l2, l3): " << int(o2) << std::endl; - - if ( o1 == LEFT_TURN ) { - if ( o2 == COLLINEAR ) { return ON_BOUNDARY; } - return ( o2 == RIGHT_TURN ) ? ON_BOUNDED_SIDE : ON_UNBOUNDED_SIDE; - } else if ( o1 == COLLINEAR ) { - CGAL_assertion( o2 != COLLINEAR ); - return ( o2 == RIGHT_TURN ) ? ON_BOUNDARY : ON_UNBOUNDED_SIDE; - } - return ON_UNBOUNDED_SIDE; + // std::cout << "orientation(l1, l3): " << int(o1) << std::endl; + // std::cout << "orientation(l2, l3): " << int(o2) << std::endl; + + if ( o1 == LEFT_TURN ) { + if ( o2 == COLLINEAR ) { return ON_BOUNDARY; } + return ( o2 == RIGHT_TURN ) ? ON_BOUNDED_SIDE : ON_UNBOUNDED_SIDE; + } else if ( o1 == COLLINEAR ) { + CGAL_assertion( o2 != COLLINEAR ); + return ( o2 == RIGHT_TURN ) ? ON_BOUNDARY : ON_UNBOUNDED_SIDE; + } + return ON_UNBOUNDED_SIDE; } Orientation o1 = chi2(l1, l3, tag); //sign_of_determinant(a1, b1, a3, b3); @@ -117,7 +117,7 @@ class Bounded_side_of_CCW_circular_arc_2 } Sign chi2(const Bitangent_line& bl1, - const Bitangent_line& bl2, Field_with_sqrt_tag) const + const Bitangent_line& bl2, Field_with_sqrt_tag) const { FT sigma = bl1.dx() * bl2.dx() + bl1.dy() * bl2.dy(); FT delta = bl1.dx() * bl2.dy() - bl1.dy() * bl2.dx(); @@ -132,23 +132,23 @@ class Bounded_side_of_CCW_circular_arc_2 FT P = bl2.delta(); FT E = E1 * CGAL::sqrt(p) + E2 * CGAL::sqrt(P) - + E3 * CGAL::sqrt(p * P) + E4; + + E3 * CGAL::sqrt(p * P) + E4; return CGAL::sign(E); } inline Sign chi2(const Bitangent_line& bl1, - const Bitangent_line& bl2, Integral_domain_without_division_tag) const + const Bitangent_line& bl2, Integral_domain_without_division_tag) const { return chi2(bl1.dx(), bl1.dy(), -bl1.dw(), bl1.d(), bl1.delta(), - bl2.dx(), bl2.dy(), -bl2.dw(), bl2.d(), bl2.delta()); + bl2.dx(), bl2.dy(), -bl2.dw(), bl2.d(), bl2.delta()); } Sign chi2(const FT& a, const FT& b, const FT& r, - const FT& d, const FT& p, - const FT& A, const FT& B, const FT& R, - const FT& D, const FT& P) const + const FT& d, const FT& p, + const FT& A, const FT& B, const FT& R, + const FT& D, const FT& P) const { FT sigma = a * A + b * B; FT delta = determinant(a, b, A, B); @@ -170,34 +170,34 @@ class Bounded_side_of_CCW_circular_arc_2 FT delta2 = CGAL::square(delta); if ( sign_E3 == ZERO ) { - sign_E1_plus_E3_P = sign_E1; + sign_E1_plus_E3_P = sign_E1; } else { - if ( sign_E3 == sign_E1 ) { - sign_E1_plus_E3_P = sign_E3; - } else { - FT F1 = delta2 - G; - sign_E1_plus_E3_P = sign_E3 * CGAL::sign(F1); - } + if ( sign_E3 == sign_E1 ) { + sign_E1_plus_E3_P = sign_E3; + } else { + FT F1 = delta2 - G; + sign_E1_plus_E3_P = sign_E3 * CGAL::sign(F1); + } } if ( sign_E2 == ZERO ) { - sign_E4_plus_E2_P = sign_E4; + sign_E4_plus_E2_P = sign_E4; } else { - if ( sign_E2 == sign_E4 ) { - sign_E4_plus_E2_P = sign_E2; - } else { - FT F2 = CGAL::square(sigma) - G; - if ( sign_r == ZERO ) { - sign_E4_plus_E2_P = ZERO; - } else { - sign_E4_plus_E2_P = sign_E2 * CGAL::sign(F2); - } - } + if ( sign_E2 == sign_E4 ) { + sign_E4_plus_E2_P = sign_E2; + } else { + FT F2 = CGAL::square(sigma) - G; + if ( sign_r == ZERO ) { + sign_E4_plus_E2_P = ZERO; + } else { + sign_E4_plus_E2_P = sign_E2 * CGAL::sign(F2); + } + } } if ( sign_E1_plus_E3_P == ZERO ) { return sign_E4_plus_E2_P; } if ( sign_E1_plus_E3_P == sign_E4_plus_E2_P ) { - return sign_E1_plus_E3_P; + return sign_E1_plus_E3_P; } Sign sign_E5 = -sign_R * sign_sigma * sign_delta; @@ -210,10 +210,10 @@ class Bounded_side_of_CCW_circular_arc_2 Sign sign_E6 = CGAL::sign(F3); if ( sign_E5 == ZERO ) { - return sign_E1_plus_E3_P * sign_E6; + return sign_E1_plus_E3_P * sign_E6; } if ( sign_E5 == sign_E6 ) { - return sign_E1_plus_E3_P * sign_E5; + return sign_E1_plus_E3_P * sign_E5; } // FT p = d - CGAL::square(r); @@ -265,10 +265,10 @@ class Infinite_edge_interior_conflict_2 bool operator()(const Site_2& p2, const Site_2& p3, - const Site_2& p4, const Site_2& q, bool b) const + const Site_2& p4, const Site_2& q, bool b) const { Method_tag tag = Method_tag(); - + Bitangent_line bl_32(p3, p2); Bitangent_line bl_24(p2, p4); Bitangent_line bl_2q(p2, q); @@ -278,14 +278,14 @@ class Infinite_edge_interior_conflict_2 if ( b ) { if ( bs1 == ON_BOUNDARY ) { - Bitangent_line bl_q2(q, p2); - Bounded_side bs2 = - Bounded_side_of_CCW_circular_arc()(bl_32, bl_24, bl_q2, tag); - - if ( bs2 != ON_BOUNDARY ) { - return ( bs2 != ON_BOUNDED_SIDE ); - } - return !b; + Bitangent_line bl_q2(q, p2); + Bounded_side bs2 = + Bounded_side_of_CCW_circular_arc()(bl_32, bl_24, bl_q2, tag); + + if ( bs2 != ON_BOUNDARY ) { + return ( bs2 != ON_BOUNDED_SIDE ); + } + return !b; } return ( bs1 != ON_BOUNDED_SIDE ); @@ -293,10 +293,10 @@ class Infinite_edge_interior_conflict_2 if ( bs1 == ON_BOUNDARY ) { Bitangent_line bl_q2(q, p2); Bounded_side bs2 = - Bounded_side_of_CCW_circular_arc()(bl_32, bl_24, bl_q2, tag); + Bounded_side_of_CCW_circular_arc()(bl_32, bl_24, bl_q2, tag); if ( bs2 != ON_BOUNDARY ) { - return ( bs2 == ON_BOUNDED_SIDE ); + return ( bs2 == ON_BOUNDED_SIDE ); } return !b; } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h index 9c6455500706..102ecca9e515 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -58,7 +58,7 @@ class Is_degenerate_edge_2 typedef bool result_type; bool operator()(const Site_2& p1, const Site_2& p2, - const Site_2& p3, const Site_2& p4) const + const Site_2& p3, const Site_2& p4) const { Method_tag tag; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h index a7669091a919..f98872befa4b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -41,23 +41,23 @@ class Is_hidden_2 private: bool is_hidden(const Site_2& p, const Site_2& q, - const Integral_domain_without_division_tag&) const + const Integral_domain_without_division_tag&) const { RT w1 = p.weight(); RT w2 = q.weight(); Sign s = CGAL::sign( CGAL::square(p.x() - q.x()) - + CGAL::square(p.y() - q.y()) - - CGAL::square(w1 - w2) - ); + + CGAL::square(p.y() - q.y()) + - CGAL::square(w1 - w2) + ); if ( s == POSITIVE ) { return false; } return (CGAL::compare(w1, w2) != SMALLER); } bool is_hidden(const Site_2& p, const Site_2& q, - const Field_with_sqrt_tag&) const + const Field_with_sqrt_tag&) const { RT d = CGAL::sqrt(CGAL::square(p.x() - q.x()) - + CGAL::square(p.y() - q.y())); + + CGAL::square(p.y() - q.y())); Sign s = CGAL::sign(d - p.weight() + q.weight()); return ( s != POSITIVE ); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h index e8adb457f1a7..66b91c08ce1e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -68,8 +68,8 @@ class Apollonius_graph_cartesian_converter NT_converter nt_cv; return K2_Site_2( Base::operator()(t.point()), - nt_cv(t.weight()) - ); + nt_cv(t.weight()) + ); } }; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h index 9cbda1167965..0b0511207272 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -46,18 +46,18 @@ class Orientation8_C2 public: inline Orientation operator()(const Site_2& s1, const Site_2& s2, - const Site_2& s3) const + const Site_2& s3) const { return Kernel().orientation_2_object()(s1.point(), s2.point(), - s3.point()); + s3.point()); } inline Sign sqrt_ext_sign(const FT& A, const FT& B, - const FT& Exp, const FT& Eyp, const FT& Erp, - const FT& Exy2, const FT& Exr, const FT& Eyr, - const FT dx, const FT& dy, - const Field_with_sqrt_tag&) const + const FT& Exp, const FT& Eyp, const FT& Erp, + const FT& Exy2, const FT& Exr, const FT& Eyr, + const FT dx, const FT& dy, + const Field_with_sqrt_tag&) const { FT G = CGAL::square(Exp) + CGAL::square(Eyp) - CGAL::square(Erp); return CGAL::sign(A + B * CGAL::sqrt(G)); @@ -65,10 +65,10 @@ class Orientation8_C2 inline Sign sqrt_ext_sign(const FT& A, const FT& B, - const FT& Exp, const FT& Eyp, const FT& Erp, - const FT& Exy2, const FT& Exr, const FT& Eyr, - const FT dx, const FT& dy, - const Integral_domain_without_division_tag&) const + const FT& Exp, const FT& Eyp, const FT& Erp, + const FT& Exy2, const FT& Exr, const FT& Eyr, + const FT dx, const FT& dy, + const Integral_domain_without_division_tag&) const { Sign sA = CGAL::sign(A); Sign sB = CGAL::sign(B); @@ -78,14 +78,14 @@ class Orientation8_C2 if ( sA == sB ) { return sA; } Sign s = CGAL::sign(CGAL::square(Exy2 * Exr - Erp * dy) - + CGAL::square(Exy2 * Eyr + Erp * dx) - - CGAL::square(B)); + + CGAL::square(Exy2 * Eyr + Erp * dx) + - CGAL::square(B)); return sA * s; } Orientation predicate(const Site_2& s1, const Site_2& s2, - const Site_2& s3, const Site_2& p1, - const Site_2& p2) const + const Site_2& s3, const Site_2& p1, + const Site_2& p2) const { // computes the orientation of the Voronoi vertex of s1, s2, s3 and // the points p1 and p2 @@ -127,12 +127,12 @@ class Orientation8_C2 FT B = Exy * Exy2 - Exp * dx - Eyp * dy; return sqrt_ext_sign(A, B, Exp, Eyp, Erp, - Exy2, Exr, Eyr, dx, dy, Method_tag()); + Exy2, Exr, Eyr, dx, dy, Method_tag()); } Orientation operator()(const Site_2& s1, const Site_2& s2, - const Site_2& s3, const Site_2& p1, - const Site_2& p2) const + const Site_2& s3, const Site_2& p1, + const Site_2& p2) const { Orientation o = predicate(s1, s2, s3, p1, p2); #ifndef NDEBUG @@ -168,11 +168,11 @@ class Constructive_orientation8_C2 public: Constructive_orientation8_C2(const Site_2& s1, const Site_2& s2, - const Site_2& s3, bool use_xj) + const Site_2& s3, bool use_xj) { s1x = s1.x(); s1y = s1.y(); - + xj = s2.x() - s1.x(); xk = s3.x() - s1.x(); @@ -214,9 +214,9 @@ class Constructive_orientation8_C2 private: inline - Sign sqrt_ext_sign(const FT& A, const FT& B, const FT& Exy2, - const FT& dx, const FT& dy, - const Field_with_sqrt_tag&) const + Sign sqrt_ext_sign(const FT& A, const FT& B, const FT& Exy2, + const FT& dx, const FT& dy, + const Field_with_sqrt_tag&) const { FT G = CGAL::square(Exp) + CGAL::square(Eyp) - CGAL::square(Erp); return CGAL::sign(A + B * CGAL::sqrt(G)); @@ -224,7 +224,7 @@ class Constructive_orientation8_C2 inline Sign sqrt_ext_sign(const FT& A, const FT& B, const FT&, - const Field_with_sqrt_tag&) const + const Field_with_sqrt_tag&) const { FT G = CGAL::square(Exp) + CGAL::square(Eyp) - CGAL::square(Erp); return CGAL::sign(A + B * CGAL::sqrt(G)); @@ -233,7 +233,7 @@ class Constructive_orientation8_C2 inline Sign sqrt_ext_sign(const FT& A, const FT& B, const FT& norm, - const Integral_domain_without_division_tag&) const + const Integral_domain_without_division_tag&) const { Sign sA = CGAL::sign(A); Sign sB = CGAL::sign(B); @@ -249,8 +249,8 @@ class Constructive_orientation8_C2 inline Sign sqrt_ext_sign(const FT& A, const FT& B, const FT& Exy2, - const FT dx, const FT& dy, - const Integral_domain_without_division_tag&) const + const FT dx, const FT& dy, + const Integral_domain_without_division_tag&) const { Sign sA = CGAL::sign(A); Sign sB = CGAL::sign(B); @@ -260,8 +260,8 @@ class Constructive_orientation8_C2 if ( sA == sB ) { return sA; } Sign s = CGAL::sign(CGAL::square(Exy2 * Exr - Erp * dy) - + CGAL::square(Exy2 * Eyr + Erp * dx) - - CGAL::square(B)); + + CGAL::square(Exy2 * Eyr + Erp * dx) + - CGAL::square(B)); return sA * s; } @@ -289,10 +289,10 @@ class Constructive_orientation8_C2 public: inline Orientation operator()(const Site_2& s1, const Site_2& s2, - const Site_2& s3) const + const Site_2& s3) const { return Kernel().orientation_2_object()(s1.point(), s2.point(), - s3.point()); + s3.point()); } inline diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h index ab342ac1c76a..5003be6de4d5 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -50,26 +50,26 @@ class Orientation_2 private: Orientation vv_orientation(const Voronoi_circle& vc, const Point_2& sp1, - const Point_2& p1, const Point_2& p2, - const Field_with_sqrt_tag&) const + const Point_2& p1, const Point_2& p2, + const Field_with_sqrt_tag&) const { FT a = vc.a1() + vc.a2() * CGAL::sqrt(vc.delta()); FT b = vc.b1() + vc.b2() * CGAL::sqrt(vc.delta()); FT det1 = a * (p2.y() - p1.y()) - b * (p2.x() - p1.x()); FT c = vc.c1() + vc.c2() * CGAL::sqrt(vc.delta()); FT det2 = determinant(p1.x() - sp1.x(), p1.y() - sp1.y(), - p2.x() - sp1.x(), p2.y() - sp1.y()); + p2.x() - sp1.x(), p2.y() - sp1.y()); return CGAL::sign(det1 + FT(2) * c * det2); } Orientation vv_orientation(const Voronoi_circle vc, const Point_2& sp1, - const Point_2& p1, const Point_2& p2, - const Integral_domain_without_division_tag&) const + const Point_2& p1, const Point_2& p2, + const Integral_domain_without_division_tag&) const { FT dx = p2.x() - p1.x(); FT dy = p2.y() - p1.y(); FT det1 = determinant(p1.x() - sp1.x(), p1.y() - sp1.y(), - p2.x() - sp1.x(), p2.y() - sp1.y()); + p2.x() - sp1.x(), p2.y() - sp1.y()); FT A = vc.a1() * dy - vc.b1() * dx + FT(2) * vc.c1() * det1; FT B = vc.a2() * dy - vc.b2() * dx + FT(2) * vc.c2() * det1; return sign_a_plus_b_x_sqrt_c(A, B, vc.delta()); @@ -78,15 +78,15 @@ class Orientation_2 public: inline Orientation operator()(const Site_2& s1, const Site_2& s2, - const Site_2& s3) const + const Site_2& s3) const { return Kernel().orientation_2_object()(s1.point(), s2.point(), - s3.point()); + s3.point()); } Orientation operator()(const Site_2& s1, const Site_2& s2, - const Site_2& s3, const Site_2& p1, - const Site_2& p2) const + const Site_2& s3, const Site_2& p1, + const Site_2& p2) const { // computes the operation of the Voronoi vertex of s1, s2, s3 and // the points p1 and p2 diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h index 12d6fc13dea2..d3ee22a5f196 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -47,13 +47,13 @@ class Oriented_side_of_bisector_2 private: Comparison_result compare_distances(const Site_2& p1, const Site_2& p2, - const Point_2& p, const Integral_domain_without_division_tag&) const + const Point_2& p, const Integral_domain_without_division_tag&) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::side_of_bisector_counter++; #endif - // this function compares the distances of the point(x, y) from the + // this function compares the distances of the point(x, y) from the // disks {(x1, y1), w1} and {(x2, y2), w2} RT D1 = CGAL::square(p1.x() - p.x()) + CGAL::square(p1.y() - p.y()); RT D2 = CGAL::square(p2.x() - p.x()) + CGAL::square(p2.y() - p.y()); @@ -69,25 +69,25 @@ class Oriented_side_of_bisector_2 if ( R != SMALLER ) return LARGER; Sign s = sign_a_plus_b_x_sqrt_c(D1 - D2 + CGAL::square(Dw), - RT(2) * Dw, D1); + RT(2) * Dw, D1); return ((s == POSITIVE) ? LARGER : ((s == ZERO) ? EQUAL : SMALLER)); } if ( R != LARGER ) return SMALLER; Sign s = sign_a_plus_b_x_sqrt_c(D1 - D2 - CGAL::square(Dw), - RT(2) * Dw, D2); + RT(2) * Dw, D2); return ((s == POSITIVE) ? LARGER : ((s == ZERO) ? EQUAL : SMALLER)); } Comparison_result compare_distances(const Site_2& p1, const Site_2& p2, - const Point_2 &p, const Field_with_sqrt_tag&) const + const Point_2 &p, const Field_with_sqrt_tag&) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::side_of_bisector_counter++; #endif - // this function compares the distances of the point(x, y) from the + // this function compares the distances of the point(x, y) from the // disks {(x1, y1), w1} and {(x2, y2), w2} RT D1 = CGAL::square(p1.x() - p.x()) + CGAL::square(p1.y() - p.y()); @@ -105,7 +105,7 @@ class Oriented_side_of_bisector_2 inline Oriented_side operator()(const Site_2& p1, const Site_2& p2, - const Point_2 &p) const + const Point_2 &p) const { Comparison_result r = compare_distances(p1, p2, p, Method_tag()); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h index 3b21e4540562..5b9bce0829c6 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -61,10 +61,10 @@ class Weighted_point_inverter_2 FT ys = wp.y() - _pole.y(); FT ws = wp.weight() - _pole.weight(); FT ps = CGAL::square(xs) + CGAL::square(ys) - - CGAL::square(ws); + - CGAL::square(ws); return - Inverted_weighted_point(Site_2(Point_2(xs, ys), ws), ps); + Inverted_weighted_point(Site_2(Point_2(xs, ys), ws), ps); } Site_2 pole() const { return _pole; } @@ -88,13 +88,13 @@ class Voronoi_radius_2 FT _dxp, _dyp, _dwp; Voronoi_radius_2(FT a, FT b, FT c, FT c2, FT delta, - FT dxp, FT dyp, FT dwp) + FT dxp, FT dyp, FT dwp) : _a(a), _b(b), _c(c), _c2(c2), _delta(delta), _dxp(dxp), _dyp(dyp), _dwp(dwp) {} public: Voronoi_radius_2(const Inverted_weighted_point& u1, - const Inverted_weighted_point& u2) + const Inverted_weighted_point& u2) { FT dxp = determinant(u1.x(), u1.p(), u2.x(), u2.p()); FT dyp = determinant(u1.y(), u1.p(), u2.y(), u2.p()); @@ -157,14 +157,14 @@ class Bitangent_line_2 FT _dxw, _dyw; Bitangent_line_2(FT a1, FT a2, FT b1, FT b2, FT c1, FT c2, - FT delta, FT d, FT dw, FT dxw, FT dyw) + FT delta, FT d, FT dw, FT dxw, FT dyw) : _a1(a1), _a2(a2), _b1(b1), _b2(b2), _c1(c1), _c2(c2), _delta(delta), _d(d), _dw(dw),_dxw(dxw), _dyw(dyw) {} inline void store(FT dx, FT dy, FT dw) { - _dw = dw; + _dw = dw; _a1 = dx * dw; _a2 = dy; _b1 = dy * dw; @@ -198,7 +198,7 @@ class Bitangent_line_2 Bitangent_line_2(const Inverted_weighted_point& u1, - const Inverted_weighted_point& u2) + const Inverted_weighted_point& u2) { FT dxp = determinant(u1.x(), u1.p(), u2.x(), u2.p()); FT dyp = determinant(u1.y(), u1.p(), u2.y(), u2.p()); @@ -213,15 +213,15 @@ class Bitangent_line_2 Bitangent_line_2 get_symmetric() const { return - Bitangent_line_2(_a1, -_a2, _b1, -_b2, _c1, -_c2, _delta, _d, - -_dw, -_dxw, -_dyw); + Bitangent_line_2(_a1, -_a2, _b1, -_b2, _c1, -_c2, _delta, _d, + -_dw, -_dxw, -_dyw); } Bitangent_line_2 get_rot90() const { return - Bitangent_line_2(-_b1, -_b2, _a1, _a2, _c1, _c2, _delta, _d, - _dw, -_dyw, _dxw); + Bitangent_line_2(-_b1, -_b2, _a1, _a2, _c1, _c2, _delta, _d, + _dw, -_dyw, _dxw); } Bitangent_line_2 perpendicular(const Point_2& p) const @@ -281,24 +281,24 @@ class Voronoi_circle_2 : public Bitangent_line_2 void compute_gamma() { _gamma = CGAL::square(this->_dxw) + CGAL::square(this->_dyw) - - CGAL::square(this->_c2); + - CGAL::square(this->_c2); } public: Voronoi_circle_2(const Voronoi_radius& vr) : Bitangent_line(FT(0), FT(0), FT(0), FT(0), vr.b(), vr.c2(), - vr.delta(), vr.d(), FT(0), FT(0), FT(0)), _gamma(vr.c()) + vr.delta(), vr.d(), FT(0), FT(0), FT(0)), _gamma(vr.c()) { this->store(vr.dxp(), vr.dyp(), vr.dwp()); } Voronoi_circle_2(const Bitangent_line& bl) : Bitangent_line(bl.a1(), bl.a2(), bl.b1(), bl.b2(), bl.c1(), bl.c2(), - bl.delta(), bl.d(), bl.dw(), bl.dxw(), bl.dyw()) + bl.delta(), bl.d(), bl.dw(), bl.dxw(), bl.dyw()) { compute_gamma(); } - + inline FT alpha() const { return this->_d; } inline FT beta() const { return this->_c1; } inline FT gamma() const { return _gamma; } @@ -308,8 +308,8 @@ class Voronoi_circle_2 : public Bitangent_line_2 } FT compute_P4(const Inverted_weighted_point& u1, - const Inverted_weighted_point& u2, - const Inverted_weighted_point& u3) const + const Inverted_weighted_point& u2, + const Inverted_weighted_point& u3) const { FT dx1 = determinant(u2.x(), u2.p(), u1.x(), u1.p()); FT dy1 = determinant(u2.y(), u2.p(), u1.y(), u1.p()); @@ -345,7 +345,7 @@ class Voronoi_circle_2 : public Bitangent_line_2 FT vuMuv = dy1 * dx3 - dx1 * dy3; FT G = fr1_sq + fr3_sq - FT(2) * dw1 * dw3 * uuPvv - - CGAL::square(vuMuv); + - CGAL::square(vuMuv); return (F * G); } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h index 2b1f8ca21e24..c2072b9acb7e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h index fea59bf5dce4..fe38a0a7911c 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h index b43fd59eb96e..15e872c32a44 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h index c7b4ce07fd7d..3e3283e55b4e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -76,15 +76,15 @@ class comparator_profiler template< class FT > static void count_case(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { // works correctly only with leda_real FT D1 = CGAL::square(b1) - a1 * c1; - + FT l1 = (b1 - CGAL::sqrt(D1)) / a1; FT r1 = (b1 + CGAL::sqrt(D1)) / a1; if ( a1 < 0 ) { std::swap(r1, l1); } - + FT D2 = CGAL::square(b2) - a2 * c2; if ( D1 == 0 || D2 == 0 ) { @@ -98,45 +98,45 @@ class comparator_profiler if ( l1 < l2 ) { if ( r1 > r2 ) { - FT J = a1 * b2 - a2 * b1; - if ( J > 0 ) { - case_3b_Jpos_counter++; - } else if ( J < 0 ) { - case_3b_Jneg_counter++; - } else { - case_degenerate_counter++; - } + FT J = a1 * b2 - a2 * b1; + if ( J > 0 ) { + case_3b_Jpos_counter++; + } else if ( J < 0 ) { + case_3b_Jneg_counter++; + } else { + case_degenerate_counter++; + } } else if ( r1 < r2 ) { - if ( r1 < l2 ) { - case_5_counter++; - } else if ( r1 > l2 ) { - case_4_counter++; - } else { - case_degenerate_counter++; - } + if ( r1 < l2 ) { + case_5_counter++; + } else if ( r1 > l2 ) { + case_4_counter++; + } else { + case_degenerate_counter++; + } } else { - case_degenerate_counter++; + case_degenerate_counter++; } } else if ( l1 > l2 ) { if ( r1 < r2 ) { - FT J = a1 * b2 - a2 * b1; - if ( J > 0 ) { - case_3a_Jpos_counter++; - } else if ( J < 0 ) { - case_3a_Jneg_counter++; - } else { - case_degenerate_counter++; - } + FT J = a1 * b2 - a2 * b1; + if ( J > 0 ) { + case_3a_Jpos_counter++; + } else if ( J < 0 ) { + case_3a_Jneg_counter++; + } else { + case_degenerate_counter++; + } } else if ( r1 > r2 ) { - if ( l1 < r2 ) { - case_2_counter++; - } else if ( l1 > r2 ) { - case_1_counter++; - } else { - case_degenerate_counter++; - } + if ( l1 < r2 ) { + case_2_counter++; + } else if ( l1 > r2 ) { + case_1_counter++; + } else { + case_degenerate_counter++; + } } else { - case_degenerate_counter++; + case_degenerate_counter++; } } else { case_degenerate_counter++; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h index 4182edfb6dac..621d35f6933e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -71,7 +71,7 @@ value_of_K(const FT& a1c2, const FT& a2c1, const FT& b1b2) template < class FT > inline FT value_of_K(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { return c1 * a2 + a1 * c2 - FT(2) * b1 * b2; } @@ -79,8 +79,8 @@ value_of_K(const FT& a1, const FT& b1, const FT& c1, template < class FT > inline FT value_of_R0(const FT& J, const FT& Jp, - const FT& a1, const FT& c1, - const FT& a2, const FT& c2) + const FT& a1, const FT& c1, + const FT& a2, const FT& c2) { return CGAL::square(a1 * c2 - c1 * a2) - FT(4) * J * Jp; } @@ -158,18 +158,18 @@ value_of_Q3(const FT& b2, const FT& a2, const FT& J, const FT& L) template < class FT > inline FT value_of_Q3(const FT& a2, const FT& b2, const FT& J, const FT& G, - const FT& K) + const FT& K) { return FT(2) * b2 * J - a2 * (G - K); -} +} template < class FT > inline FT value_of_Q3p(const FT& a1, const FT& b1, const FT& J, const FT& G, - const FT& K) + const FT& K) { return a1 * (G + K) - FT(2) * b1 * J; -} +} //-------------------------------------------------------------------- @@ -180,7 +180,7 @@ template < class FT > inline Comparison_result sqrt_compare_l1_l2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); @@ -195,7 +195,7 @@ template < class FT > inline Comparison_result sqrt_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); @@ -211,7 +211,7 @@ template < class FT > inline Comparison_result sqrt_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); @@ -226,7 +226,7 @@ template < class FT > inline Comparison_result sqrt_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); @@ -248,34 +248,34 @@ template < class FT > inline Comparison_result dfmt_compare_l1_l2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT J = value_of_J(a1, b1, a2, b2); FT K = value_of_K(a1, b1, c1, a2, b2, c2); - + if ( CGAL::is_positive(J) ) { if ( CGAL::is_positive(K) ) return SMALLER; // l1 < l2 - + FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); FT D = value_of_D(a1, D1, a2, D2); if ( CGAL::is_positive(D) ) return SMALLER; // l1 < l2 - + FT Jp = value_of_Jp(b1, c1, b2, c2); if ( CGAL::is_negative(Jp) ) return LARGER; // l1 > l2 - + FT R0 = value_of_R0(D1, D2, K); - + Sign s_R0 = CGAL::sign(R0); if ( s_R0 == NEGATIVE ) return SMALLER; // l1 < l2 if ( s_R0 == POSITIVE ) return LARGER; // l1 > l2 return EQUAL; } else { // J<0 if ( CGAL::is_positive(K) ) return LARGER; // l1 > l2 - + FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); @@ -300,7 +300,7 @@ template < class FT > inline Comparison_result dfmt_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT J = value_of_J(a1, b1, a2, b2); @@ -311,11 +311,11 @@ dfmt_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, if ( CGAL::is_negative(K) ) return SMALLER; // l1 < r2 FT Jp = value_of_Jp(b1, c1, b2, c2); - + if ( CGAL::is_positive(Jp) ) return LARGER; // l1 > r2 - + FT R0 = value_of_R0(J, Jp, a1, c1, a2, c2); - + Sign s_R0 = CGAL::sign(R0); if ( s_R0 == NEGATIVE ) return SMALLER; // l1 < r2 if ( s_R0 == POSITIVE ) return LARGER; // l1 > r2 @@ -328,7 +328,7 @@ template < class FT > inline Comparison_result dfmt_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT J = value_of_J(a1, b1, a2, b2); @@ -339,11 +339,11 @@ dfmt_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, if ( CGAL::is_negative(K) ) return LARGER; // r1 > l2 FT Jp = value_of_Jp(b1, c1, b2, c2); - + if ( CGAL::is_negative(Jp) ) return SMALLER; // r1 < l2 - + FT R0 = value_of_R0(J, Jp, a1, c1, a2, c2); - + Sign s_R0 = CGAL::sign(R0); if ( s_R0 == NEGATIVE ) return LARGER; // r1 > l2 if ( s_R0 == POSITIVE ) return SMALLER; // r1 < l2 @@ -354,7 +354,7 @@ template < class FT > inline Comparison_result dfmt_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { #ifdef COMPARATOR_PROFILER comparator_profiler::counter_rr++; @@ -362,14 +362,14 @@ dfmt_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, FT J = value_of_J(a1, b1, a2, b2); FT K = value_of_K(a1, b1, c1, a2, b2, c2); - + if ( CGAL::is_positive(J) ){ if ( CGAL::is_positive(K) ) return SMALLER; // r1 < r2 1,2 #ifdef COMPARATOR_PROFILER comparator_profiler::counter_rr_e++; #endif - + FT D1 = value_of_D(a1, b1, c1); FT D2 = value_of_D(a2, b2, c2); @@ -402,9 +402,9 @@ dfmt_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, FT D2 = value_of_D(a2, b2, c2); FT D = value_of_D(a1, D1, a2, D2); - + if ( CGAL::is_positive(D) ) return LARGER; // r1 > r2 3a,4 - + #ifdef COMPARATOR_PROFILER comparator_profiler::counter_rr_r0++; #endif @@ -430,7 +430,7 @@ template < class FT > inline Comparison_result ke_compare_l1_l2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT J = value_of_J(a1, b1, a2, b2); Sign s_J = CGAL::sign(J); @@ -504,7 +504,7 @@ template < class FT > inline Comparison_result ke_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT J = value_of_J(a1, b1, a2, b2); Sign s_J = CGAL::sign(J); @@ -542,11 +542,11 @@ ke_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, #endif FT Jp = value_of_Jp(b1, c1, b2, c2); - + if ( CGAL::is_positive(Jp) ) { return LARGER; } FT P4 = value_of_P4(J, Jp, a1c2 - a2c1); - + Sign s_P4 = CGAL::sign(P4); if ( s_P4 == POSITIVE ) { return SMALLER; } if ( s_P4 == NEGATIVE ) { return LARGER; } @@ -557,7 +557,7 @@ template < class FT > inline Comparison_result ke_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { FT J = value_of_J(a1, b1, a2, b2); Sign s_J = CGAL::sign(J); @@ -596,9 +596,9 @@ ke_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, #endif FT Jp = value_of_Jp(b1, c1, b2, c2); - + if ( CGAL::is_negative(Jp) ) { return SMALLER; } - + FT P4 = value_of_P4(J, Jp, a1c2 - a2c1); Sign s_P4 = CGAL::sign(P4); @@ -611,7 +611,7 @@ template < class FT > inline Comparison_result ke_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, - const FT& a2, const FT& b2, const FT& c2) + const FT& a2, const FT& b2, const FT& c2) { #ifdef COMPARATOR_PROFILER comparator_profiler::counter_rr++; @@ -624,7 +624,7 @@ ke_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, FT a2c1 = a2 * c1; FT K = value_of_K(a1c2, a2c1, b1 * b2); Sign s_K = CGAL::sign(K); - + if ( s_J == POSITIVE ) { if ( s_K == POSITIVE ) { return SMALLER; } else if ( s_K == NEGATIVE ) { @@ -705,14 +705,14 @@ ke_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, //-------------------------------------------------------------------- //-------------------------------------------------------------------- -// the following functions do the filtering for the r1-r2 tree without +// the following functions do the filtering for the r1-r2 tree without // using C++ exceptions template < class CT, class ET > inline Comparison_result sqrt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, - const CT& a2, const CT& b2, const CT& c2) + const CT& a2, const CT& b2, const CT& c2) { typedef Interval_nt IT; @@ -734,7 +734,7 @@ sqrt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( r1.inf() > r2.sup() ) { return LARGER; } return sqrt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } //-------------------------------------------------------------------- @@ -743,7 +743,7 @@ template < class CT, class ET > inline Comparison_result dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, - const CT& a2, const CT& b2, const CT& c2) + const CT& a2, const CT& b2, const CT& c2) { typedef Interval_nt IT; @@ -764,7 +764,7 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( K.sup() > 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } IT D1 = value_of_D(a1i, b1i, c1i); @@ -779,7 +779,7 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( D.inf() < 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } IT Jp = value_of_Jp(b1i, c1i, b2i, c2i); @@ -791,9 +791,9 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( Jp.inf() < 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } - + IT R0 = value_of_R0(D1, D2, K); FPU_set_cw(backup); @@ -801,11 +801,11 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( R0.sup() < 0 ) { return SMALLER; } if ( R0.inf() > 0 ) { return LARGER; } return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } else if ( J.sup() > 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } else { // J < 0 if ( K.inf() > 0 ) { FPU_set_cw(backup); @@ -814,7 +814,7 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( K.sup() > 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } IT D1 = value_of_D(a1i, b1i, c1i); @@ -829,7 +829,7 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( D.sup() > 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } @@ -842,7 +842,7 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( Jp.sup() > 0 ) { FPU_set_cw(backup); return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } IT R0 = value_of_P4(D1, D2, K); @@ -852,7 +852,7 @@ dfmt_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( R0.inf() > 0 ) { return SMALLER; } return dfmt_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } } @@ -862,7 +862,7 @@ template < class CT, class ET > inline Comparison_result ke_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, - const CT& a2, const CT& b2, const CT& c2) + const CT& a2, const CT& b2, const CT& c2) { typedef Interval_nt IT; @@ -878,9 +878,9 @@ ke_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, IT a2c1 = a2i * c1i; IT K = value_of_K(a1c2, a2c1, b1i * b2i); - + if ( J.inf() > 0 ) { - if ( K.inf() > 0 ) { + if ( K.inf() > 0 ) { FPU_set_cw(backup); return SMALLER; } else if ( K.sup() < 0 ) { @@ -888,25 +888,25 @@ ke_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, IT P3inf = value_of_P3inf(a1i, b1i, J, G); if ( P3inf.inf() >= 0 ) { - FPU_set_cw(backup); - return SMALLER; + FPU_set_cw(backup); + return SMALLER; } if ( P3inf.sup() > 0 ) { - FPU_set_cw(backup); - return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + FPU_set_cw(backup); + return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), + ET(a2), ET(b2), ET(c2)); } IT Jp = value_of_Jp(b1i, c1i, b2i, c2i); if ( Jp.sup() < 0 ) { - FPU_set_cw(backup); - return LARGER; + FPU_set_cw(backup); + return LARGER; } if ( Jp.inf() < 0 ) { - FPU_set_cw(backup); - return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + FPU_set_cw(backup); + return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), + ET(a2), ET(b2), ET(c2)); } IT P4 = value_of_P4(J, Jp, G); @@ -916,11 +916,11 @@ ke_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( P4.sup() < 0 ) { return LARGER; } return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } else { FPU_set_cw(backup); return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } } else if ( J.sup() < 0 ) { // J < 0 if ( K.inf() > 0 ) { @@ -931,25 +931,25 @@ ke_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, IT P3inf = value_of_P3inf(a1i, b1i, J, G); if ( P3inf.sup() <= 0 ) { - FPU_set_cw(backup); - return LARGER; + FPU_set_cw(backup); + return LARGER; } if ( P3inf.inf() < 0 ) { - FPU_set_cw(backup); - return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + FPU_set_cw(backup); + return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), + ET(a2), ET(b2), ET(c2)); } IT Jp = value_of_Jp(b1i, c1i, b2i, c2i); if ( Jp.inf() > 0 ) { - FPU_set_cw(backup); - return SMALLER; + FPU_set_cw(backup); + return SMALLER; } if ( Jp.sup() > 0 ) { - FPU_set_cw(backup); - return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + FPU_set_cw(backup); + return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), + ET(a2), ET(b2), ET(c2)); } IT P4 = value_of_P4(J, Jp, G); @@ -959,16 +959,16 @@ ke_compare_r1_r2_filtered(const CT& a1, const CT& b1, const CT& c1, if ( P4.sup() < 0 ) { return SMALLER; } return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } else { FPU_set_cw(backup); return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } } else { // J = ? FPU_set_cw(backup); return ke_compare_r1_r2(ET(a1), ET(b1), ET(c1), - ET(a2), ET(b2), ET(c2)); + ET(a2), ET(b2), ET(c2)); } } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h index 2686f853eea8..d543e6a92a1a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h index 919cd6dd652d..d62c21e558b6 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -39,14 +39,14 @@ class Ag2_uncertain_is_hidden_C2 private: Uncertain is_hidden(const Site_2& p, const Site_2& q, - const Integral_domain_without_division_tag&) const + const Integral_domain_without_division_tag&) const { RT w1 = p.weight(); RT w2 = q.weight(); Uncertain s = CGAL::sign( CGAL::square(p.x() - q.x()) - + CGAL::square(p.y() - q.y()) - - CGAL::square(w1 - w2) - ); + + CGAL::square(p.y() - q.y()) + - CGAL::square(w1 - w2) + ); if ( is_indeterminate(s) ) { return Uncertain::indeterminate(); } @@ -60,11 +60,11 @@ class Ag2_uncertain_is_hidden_C2 } Uncertain is_hidden(const Site_2& p, const Site_2& q, - const Field_with_sqrt_tag&) const + const Field_with_sqrt_tag&) const { RT d = CGAL::sqrt(CGAL::square(p.x() - q.x()) - + CGAL::square(p.y() - q.y())); - + + CGAL::square(p.y() - q.y())); + Uncertain s = CGAL::sign(d - p.weight() + q.weight()); if ( is_indeterminate(s) ) { return Uncertain::indeterminate(); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h index e525810ab349..6209c9060b83 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -43,13 +43,13 @@ class Ag2_uncertain_oriented_side_of_bisector_C2 private: Uncertain compare_distances(const Site_2& p1, const Site_2& p2, - const Point_2& p, const Integral_domain_without_division_tag&) const + const Point_2& p, const Integral_domain_without_division_tag&) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::side_of_bisector_counter++; #endif - // this function compares the distances of the point(x, y) from the + // this function compares the distances of the point(x, y) from the // disks {(x1, y1), w1} and {(x2, y2), w2} RT D1 = CGAL::square(p1.x() - p.x()) + CGAL::square(p1.y() - p.y()); RT D2 = CGAL::square(p2.x() - p.x()) + CGAL::square(p2.y() - p.y()); @@ -72,22 +72,22 @@ class Ag2_uncertain_oriented_side_of_bisector_C2 if ( R != SMALLER ) return LARGER; return uncertain_sign_a_plus_b_x_sqrt_c(D1 - D2 + CGAL::square(Dw), - RT(2) * Dw, D1); + RT(2) * Dw, D1); } if ( R != LARGER ) return SMALLER; return uncertain_sign_a_plus_b_x_sqrt_c(D1 - D2 - CGAL::square(Dw), - RT(2) * Dw, D2); + RT(2) * Dw, D2); } Comparison_result compare_distances(const Site_2& p1, const Site_2& p2, - const Point_2 &p, const Field_with_sqrt_tag&) const + const Point_2 &p, const Field_with_sqrt_tag&) const { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::side_of_bisector_counter++; #endif - // this function compares the distances of the point(x, y) from the + // this function compares the distances of the point(x, y) from the // disks {(x1, y1), w1} and {(x2, y2), w2} RT D1 = CGAL::square(p1.x() - p.x()) + CGAL::square(p1.y() - p.y()); @@ -106,7 +106,7 @@ class Ag2_uncertain_oriented_side_of_bisector_C2 inline Uncertain operator()(const Site_2& p1, const Site_2& p2, - const Point_2 &p) const + const Point_2 &p) const { return - compare_distances(p1, p2, p, Method_tag()); } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h index d9c0a49460c8..f82f5a8fd073 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas // Christophe Delage @@ -29,8 +29,8 @@ namespace CGAL { // Vertex conflict //----------------------------------------------------------------------- -template < class K, class Method_tag > -class Uncertain_vertex_conflict_new_2 +template < class K, class Method_tag > +class Uncertain_vertex_conflict_new_2 { public: typedef typename K::Site_2 Site_2; @@ -38,12 +38,12 @@ class Uncertain_vertex_conflict_new_2 typedef Uncertain result_type; private: - + inline Uncertain is_less (const Site_2 &p0, const Site_2 &p1) const { static const Uncertain uncertain_bool = - Uncertain::indeterminate(); + Uncertain::indeterminate(); Uncertain cr; @@ -65,33 +65,33 @@ class Uncertain_vertex_conflict_new_2 } inline - int max_radius(const Site_2 &p0, const Site_2 &p1, + int max_radius(const Site_2 &p0, const Site_2 &p1, const Site_2 &p2, const Site_2 &p3) const { int i = 0; const Site_2 *p = &p0; - Uncertain b; - b = is_less (*p, p1); - if ( is_indeterminate(b) ) { - return -1; - } else if (b) { - i = 1; p = &p1; - } - - b = is_less(*p, p2); - if ( is_indeterminate(b) ) { - return -1; - } else if (b) { - i = 2; p = &p2; - } - - b = is_less(*p, p3); - if ( is_indeterminate(b) ) { - return -1; - } else if (b) { - i = 3; - } + Uncertain b; + b = is_less (*p, p1); + if ( is_indeterminate(b) ) { + return -1; + } else if (b) { + i = 1; p = &p1; + } + + b = is_less(*p, p2); + if ( is_indeterminate(b) ) { + return -1; + } else if (b) { + i = 2; p = &p2; + } + + b = is_less(*p, p3); + if ( is_indeterminate(b) ) { + return -1; + } else if (b) { + i = 3; + } return i; } @@ -99,8 +99,8 @@ class Uncertain_vertex_conflict_new_2 inline Uncertain predicate(const Site_2 &p1, const Site_2 &p2, - const Site_2 &p3, const Site_2 &q, bool perturb) const - { + const Site_2 &p3, const Site_2 &q, bool perturb) const + { RT xq = q.x() - p1.x(); RT yq = q.y() - p1.y(); RT wq = q.weight() - p1.weight(); @@ -110,10 +110,10 @@ class Uncertain_vertex_conflict_new_2 Uncertain s = CGAL::sign(aq); if ( is_indeterminate(s) ) { return s; } if (s != POSITIVE){ - // I BELIEVE MENELAOS RETURNS -1 in this case even when degernate - //if (sign (aq) == ZERO && ! perturb) return ZERO; - // return NEGATIVE; - return POSITIVE; + // I BELIEVE MENELAOS RETURNS -1 in this case even when degernate + //if (sign (aq) == ZERO && ! perturb) return ZERO; + // return NEGATIVE; + return POSITIVE; } RT x2 = p2.x() - p1.x(); @@ -130,7 +130,7 @@ class Uncertain_vertex_conflict_new_2 CGAL_assertion (a3 > 0); - RT ax3q = a3 * xq - x3 * aq; + RT ax3q = a3 * xq - x3 * aq; RT ax2q = a2 * xq - x2 * aq; RT ax23 = a2 * x3 - x2 * a3; @@ -149,125 +149,125 @@ class Uncertain_vertex_conflict_new_2 // orientation degenerate if (orient == ZERO) { - Uncertain orient1 = CGAL::sign (ax23); - if ( is_indeterminate(orient1) ) { return orient1; } - - Sign power_test; - if ( orient1 == ZERO ) { - Uncertain s_ay23 = CGAL::sign(ay23); - if ( is_indeterminate(s_ay23) ) { return s_ay23; } - Uncertain s_ayw23q = CGAL::sign(ayw23q); - if ( is_indeterminate(s_ayw23q) ) { return s_ayw23q; } - - power_test = s_ay23 * s_ayw23q; - } else { - Uncertain s_axw23q = CGAL::sign(axw23q); - if ( is_indeterminate(s_axw23q) ) { return s_axw23q; } - - power_test = orient1 * s_axw23q; - } - - if (power_test != ZERO || ! perturb) { - return -power_test; - } - - int i = max_radius (p1, p2, p3, q); - if ( i == -1 ) { - return Uncertain::indeterminate(); - } - - if (i == 3) { return NEGATIVE; } - - Uncertain o23, o2q, o3q; - - if (orient1 == ZERO) { - o23 = CGAL::sign (ay23); - o2q = CGAL::sign (ay2q); - o3q = CGAL::sign (ay3q); - } else { - o23 = CGAL::sign (ax23); - o2q = CGAL::sign (ax2q); - o3q = CGAL::sign (ax3q); - } - if ( is_indeterminate(o23) || - is_indeterminate(o2q) || - is_indeterminate(o3q) ) { - return Uncertain::indeterminate(); - } - - if (o23 != o2q) { return i == 2 ? NEGATIVE : POSITIVE; } - - if (o23 == o3q) { return i == 1 ? NEGATIVE : POSITIVE; } - - return i == 0 ? NEGATIVE : POSITIVE; + Uncertain orient1 = CGAL::sign (ax23); + if ( is_indeterminate(orient1) ) { return orient1; } + + Sign power_test; + if ( orient1 == ZERO ) { + Uncertain s_ay23 = CGAL::sign(ay23); + if ( is_indeterminate(s_ay23) ) { return s_ay23; } + Uncertain s_ayw23q = CGAL::sign(ayw23q); + if ( is_indeterminate(s_ayw23q) ) { return s_ayw23q; } + + power_test = s_ay23 * s_ayw23q; + } else { + Uncertain s_axw23q = CGAL::sign(axw23q); + if ( is_indeterminate(s_axw23q) ) { return s_axw23q; } + + power_test = orient1 * s_axw23q; + } + + if (power_test != ZERO || ! perturb) { + return -power_test; + } + + int i = max_radius (p1, p2, p3, q); + if ( i == -1 ) { + return Uncertain::indeterminate(); + } + + if (i == 3) { return NEGATIVE; } + + Uncertain o23, o2q, o3q; + + if (orient1 == ZERO) { + o23 = CGAL::sign (ay23); + o2q = CGAL::sign (ay2q); + o3q = CGAL::sign (ay3q); + } else { + o23 = CGAL::sign (ax23); + o2q = CGAL::sign (ax2q); + o3q = CGAL::sign (ax3q); + } + if ( is_indeterminate(o23) || + is_indeterminate(o2q) || + is_indeterminate(o3q) ) { + return Uncertain::indeterminate(); + } + + if (o23 != o2q) { return i == 2 ? NEGATIVE : POSITIVE; } + + if (o23 == o3q) { return i == 1 ? NEGATIVE : POSITIVE; } + + return i == 0 ? NEGATIVE : POSITIVE; } // if (orient == ZERO ) - - // radical side + + // radical side RT rs23q = ax23 * axw23q + ay23 * ayw23q; Uncertain radSide = CGAL::sign (rs23q); if ( is_indeterminate(radSide) ) { return radSide; } if (radSide == ZERO || radSide != orient) { return orient; } - + // radical intersection Uncertain radInt = - CGAL::sign(axw23q * axw23q + ayw23q * ayw23q - axy23q * axy23q); + CGAL::sign(axw23q * axw23q + ayw23q * ayw23q - axy23q * axy23q); if ( is_indeterminate(radInt) ) { return radInt; } // radical intersection degenerate if (radInt == ZERO) { - Uncertain radSideQ = CGAL::sign(ax23 * axw23q + ay23 * ayw23q); + Uncertain radSideQ = CGAL::sign(ax23 * axw23q + ay23 * ayw23q); if ( is_indeterminate(radSideQ) ) { return radSideQ; } - CGAL_assertion (radSideQ != ZERO); + CGAL_assertion (radSideQ != ZERO); - if (! perturb) { return (radSideQ == orient) ? Uncertain(ZERO) : orient; } + if (! perturb) { return (radSideQ == orient) ? Uncertain(ZERO) : orient; } - int i = max_radius (p1, p2, p3, q); - if ( i == -1 ) { return Uncertain::indeterminate(); } + int i = max_radius (p1, p2, p3, q); + if ( i == -1 ) { return Uncertain::indeterminate(); } - if (i == 3) { - radInt = radSideQ; - } else if (i == 2) { - radInt = -CGAL::sign(ax2q * axw23q + ay2q * ayw23q); - if ( is_indeterminate(radInt) ) { return radInt; } - if (radInt == ZERO) { return NEGATIVE; } - } else if (i == 1) { - radInt = CGAL::sign(ax3q * axw23q + ay3q * ayw23q); - if ( is_indeterminate(radInt) ) { return radInt; } - if (radInt == ZERO) { return NEGATIVE; } - } else { - CGAL_assertion (i == 0); - Uncertain radSide1 = - -CGAL::sign(ax2q * axw23q + ay2q * ayw23q); - if ( is_indeterminate(radSide1) ) { return radSide1; } + if (i == 3) { + radInt = radSideQ; + } else if (i == 2) { + radInt = -CGAL::sign(ax2q * axw23q + ay2q * ayw23q); + if ( is_indeterminate(radInt) ) { return radInt; } + if (radInt == ZERO) { return NEGATIVE; } + } else if (i == 1) { + radInt = CGAL::sign(ax3q * axw23q + ay3q * ayw23q); + if ( is_indeterminate(radInt) ) { return radInt; } + if (radInt == ZERO) { return NEGATIVE; } + } else { + CGAL_assertion (i == 0); + Uncertain radSide1 = + -CGAL::sign(ax2q * axw23q + ay2q * ayw23q); + if ( is_indeterminate(radSide1) ) { return radSide1; } - if (radSide1 == ZERO) { return NEGATIVE; } + if (radSide1 == ZERO) { return NEGATIVE; } - Uncertain radSide2 = CGAL::sign(ax3q * axw23q + ay3q * ayw23q); - if ( is_indeterminate(radSide2) ) { return radSide2; } + Uncertain radSide2 = CGAL::sign(ax3q * axw23q + ay3q * ayw23q); + if ( is_indeterminate(radSide2) ) { return radSide2; } - if (radSide2 == ZERO) { return NEGATIVE; } + if (radSide2 == ZERO) { return NEGATIVE; } - radInt = -Sign( Sign(radSideQ) + Sign(radSide1) + Sign(radSide2) ); - } + radInt = -Sign( Sign(radSideQ) + Sign(radSide1) + Sign(radSide2) ); + } } - + CGAL_assertion (!perturb || radInt != ZERO); if (radInt == NEGATIVE) { return orient; } - + return -radSide; } - + inline Uncertain - predicate(const Site_2 &p1, const Site_2 &p2, - const Site_2 &q, bool perturb) const + predicate(const Site_2 &p1, const Site_2 &p2, + const Site_2 &q, bool perturb) const { // NOTE:*************************************** - // * the perturb boolean variable is not used + // * the perturb boolean variable is not used // * for consistancy with Menelaos // NOTE:*************************************** RT x2 = p2.x() - p1.x(); @@ -280,92 +280,92 @@ class Uncertain_vertex_conflict_new_2 RT xw2q = x2 * wq - xq * w2; RT yw2q = y2 * wq - yq * w2; RT xy2q = x2 * yq - xq * y2; - + // orientation Uncertain orient = CGAL::sign(xy2q); if ( is_indeterminate(orient) ) { return orient; } // orientation degenerate if (orient == ZERO) { - Uncertain o12 = CGAL::sign(x2); - if ( is_indeterminate(o12) ) { return o12; } - - Uncertain o1q, o2q; - Uncertain power_test; - - if (o12 != ZERO) { - Uncertain s_xw2q = CGAL::sign(xw2q); - if ( is_indeterminate(s_xw2q) ) { return s_xw2q; } - power_test = o12 * s_xw2q; - - // this results is consistant with Menelaos - if (power_test != ZERO) { return -power_test; } - - // this result is consistant with the perturb on off idea - //if (power_test != ZERO || ! perturb) return -power_test; - - o1q = CGAL::sign(xq); - o2q = CGAL::sign(q.x() - p2.x()); - } else { - o12 = CGAL::sign(y2); - if ( is_indeterminate(o12) ) { return o12; } - Uncertain s_yw2q = CGAL::sign(yw2q); - if ( is_indeterminate(s_yw2q) ) { return s_yw2q; } - power_test = o12 * s_yw2q; - - // this results is consistant with Menelaos - if (power_test != ZERO) { return -power_test; } - - // this result is consistant with the perturb on off idea - //if (power_test != ZERO || ! perturb) return -power_test; - - o1q = CGAL::sign(yq); - o2q = CGAL::sign(q.y() - p2.y()); - } - - if ( is_indeterminate(o1q) || is_indeterminate(o2q) ) { - return Uncertain::indeterminate(); - } - - if (o1q != o12) { return POSITIVE; } - if (o2q == o12) { return POSITIVE; } - - return NEGATIVE; + Uncertain o12 = CGAL::sign(x2); + if ( is_indeterminate(o12) ) { return o12; } + + Uncertain o1q, o2q; + Uncertain power_test; + + if (o12 != ZERO) { + Uncertain s_xw2q = CGAL::sign(xw2q); + if ( is_indeterminate(s_xw2q) ) { return s_xw2q; } + power_test = o12 * s_xw2q; + + // this results is consistant with Menelaos + if (power_test != ZERO) { return -power_test; } + + // this result is consistant with the perturb on off idea + //if (power_test != ZERO || ! perturb) return -power_test; + + o1q = CGAL::sign(xq); + o2q = CGAL::sign(q.x() - p2.x()); + } else { + o12 = CGAL::sign(y2); + if ( is_indeterminate(o12) ) { return o12; } + Uncertain s_yw2q = CGAL::sign(yw2q); + if ( is_indeterminate(s_yw2q) ) { return s_yw2q; } + power_test = o12 * s_yw2q; + + // this results is consistant with Menelaos + if (power_test != ZERO) { return -power_test; } + + // this result is consistant with the perturb on off idea + //if (power_test != ZERO || ! perturb) return -power_test; + + o1q = CGAL::sign(yq); + o2q = CGAL::sign(q.y() - p2.y()); + } + + if ( is_indeterminate(o1q) || is_indeterminate(o2q) ) { + return Uncertain::indeterminate(); + } + + if (o1q != o12) { return POSITIVE; } + if (o2q == o12) { return POSITIVE; } + + return NEGATIVE; } - // radical side + // radical side RT rs12q = x2 * xw2q + y2 * yw2q; Uncertain radSide = CGAL::sign(rs12q); if ( is_indeterminate(radSide) ) { return radSide; } if (radSide == ZERO || radSide == orient) { - return -orient; + return -orient; } // radical intersection Uncertain radInt = - CGAL::sign(CGAL::square(xw2q) + CGAL::square(yw2q) - - CGAL::square(xy2q)); + CGAL::sign(CGAL::square(xw2q) + CGAL::square(yw2q) + - CGAL::square(xy2q)); if ( is_indeterminate(radInt) ) { return radInt; } // radical intersection degerate if (radInt == ZERO) { - CGAL_assertion (radSide != ZERO); - - // this result is consistant with the perturb on off idea - //if (! perturb) return (radSide == orient) ? ZERO : orient; - - RT rs2q1 = (p2.x() - q.x()) * xw2q + (p2.y() - q.y()) * yw2q; - Uncertain radSide1 = CGAL::sign(rs2q1); - if ( is_indeterminate(radSide1) ) { return radSide1; } - if (radSide1 == ZERO) { return NEGATIVE; } - - RT rsq12 = xq * xw2q + yq * yw2q; - Uncertain radSide2 = CGAL::sign(rsq12); - if ( is_indeterminate(radSide2) ) { return radSide2; } - if (radSide2 == ZERO) { return NEGATIVE; } - - return -(radSide1 * radSide2); + CGAL_assertion (radSide != ZERO); + + // this result is consistant with the perturb on off idea + //if (! perturb) return (radSide == orient) ? ZERO : orient; + + RT rs2q1 = (p2.x() - q.x()) * xw2q + (p2.y() - q.y()) * yw2q; + Uncertain radSide1 = CGAL::sign(rs2q1); + if ( is_indeterminate(radSide1) ) { return radSide1; } + if (radSide1 == ZERO) { return NEGATIVE; } + + RT rsq12 = xq * xw2q + yq * yw2q; + Uncertain radSide2 = CGAL::sign(rsq12); + if ( is_indeterminate(radSide2) ) { return radSide2; } + if (radSide2 == ZERO) { return NEGATIVE; } + + return -(radSide1 * radSide2); } CGAL_assertion (!perturb || radInt != ZERO); @@ -377,10 +377,10 @@ class Uncertain_vertex_conflict_new_2 public: inline Uncertain operator()(const Site_2 &p1, const Site_2 &p2, - const Site_2 &p3, const Site_2 &q, - bool perturb = true) const - { - Uncertain newPred = predicate (p1, p2, p3, q, perturb); + const Site_2 &p3, const Site_2 &q, + bool perturb = true) const + { + Uncertain newPred = predicate (p1, p2, p3, q, perturb); if ( is_indeterminate(newPred) ) { return newPred; } CGAL_assertion (! perturb || newPred != ZERO); return newPred; @@ -388,9 +388,9 @@ class Uncertain_vertex_conflict_new_2 inline Uncertain operator()(const Site_2 &p1, const Site_2 &p2, - const Site_2 &q, bool perturb = true) const + const Site_2 &q, bool perturb = true) const { - Uncertain newPred = predicate (p1, p2, q, perturb); + Uncertain newPred = predicate (p1, p2, q, perturb); if ( is_indeterminate(newPred) ) { return newPred; } CGAL_assertion (! perturb || newPred != ZERO); return newPred; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h index c629bdf43982..5ae3dffa5656 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -62,7 +62,7 @@ uncertain_sign_a_plus_b_x_sqrt_c(const RT &a, const RT &b, const RT &c) template < class RT > Sign sign_a_x_sqrt_c_plus_b_x_sqrt_d(const RT &a, const RT &b, - const RT &c, const RT &d) + const RT &c, const RT &d) { // computes the sign of quantity: a * sqrt(c) + b * sqrt(d) @@ -78,17 +78,17 @@ sign_a_x_sqrt_c_plus_b_x_sqrt_d(const RT &a, const RT &b, if ( sa == ZERO ) return sb; return sa * CGAL::compare( CGAL::square(a) * c, - CGAL::square(b) * d ); + CGAL::square(b) * d ); } template < class RT > Sign sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f(const RT &a, const RT &b, - const RT &c, const RT &e, - const RT &f) + const RT &c, const RT &e, + const RT &f) { // computes the sign of quantity: a + b * sqrt(e) + c * sqrt(f) - + CGAL_assertion( !(CGAL::is_negative(e)) ); CGAL_assertion( !(CGAL::is_negative(f)) ); @@ -99,24 +99,24 @@ sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f(const RT &a, const RT &b, if ( s_a_plus_b_x_sqrt_e == sc ) return sc; if ( s_a_plus_b_x_sqrt_e == ZERO ) return sc; - return s_a_plus_b_x_sqrt_e * + return s_a_plus_b_x_sqrt_e * sign_a_plus_b_x_sqrt_c(CGAL::square(a) + CGAL::square(b) * e - - CGAL::square(c) * f, - RT(2) * a * b, e); + - CGAL::square(c) * f, + RT(2) * a * b, e); } template < class RT > Sign sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f_plus_d_sqrt_e_x_f(const RT &a, - const RT &b, - const RT &c, - const RT &d, - const RT &e, - const RT &f) + const RT &b, + const RT &c, + const RT &d, + const RT &e, + const RT &f) { // computes the sign of quantity: // a + b * sqrt(e) + c * sqrt(f) + d * sqrt(e * f) - + CGAL_assertion( !(CGAL::is_negative(e)) ); CGAL_assertion( !(CGAL::is_negative(f)) ); @@ -131,10 +131,10 @@ sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f_plus_d_sqrt_e_x_f(const RT &a, return s_a_plus_b_sqrt_e * sign_a_plus_b_x_sqrt_c(CGAL::square(a) + CGAL::square(b) * e - - CGAL::square(c) * f - - CGAL::square(d) * e * f, - RT(2) * (a * b - c * d * f), - e); + - CGAL::square(c) * f + - CGAL::square(d) * e * f, + RT(2) * (a * b - c * d * f), + e); } #endif diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h index 0e7b51a2930c..60e0ba57ada6 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h index 0f2a088f7165..bbb169fbff73 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -45,11 +45,11 @@ namespace CGAL { //----------------------------------------------------------------------- template, - class EK_MTag = CK_MTag, - class FK_t = Simple_cartesian< Interval_nt >, - class FK_MTag = CK_MTag, + class CK_MTag = Integral_domain_without_division_tag, + class EK_t = Simple_cartesian< MP_Float >, + class EK_MTag = CK_MTag, + class FK_t = Simple_cartesian< Interval_nt >, + class FK_MTag = CK_MTag, class C2E_t = Cartesian_converter, class C2F_t = Cartesian_converter > > @@ -199,15 +199,15 @@ class Apollonius_graph_filtered_traits_2 // changes in the spec/concept); see also changes needed for the // filtered construction above. typedef Filtered_construction + EK_Construct_Apollonius_vertex_2, + FK_Construct_Apollonius_vertex_2, + C2E, C2F, E2C, F2C> Construct_Apollonius_vertex_2; typedef Filtered_construction + EK_Construct_Apollonius_site_2, + FK_Construct_Apollonius_site_2, + C2E, C2F, E2C, F2C> Construct_Apollonius_site_2; #else typedef typename CK_traits::Construct_Apollonius_vertex_2 @@ -291,27 +291,27 @@ class Apollonius_graph_filtered_traits_2 typedef Filtered_predicate + FK_Oriented_side_of_bisector_2, C2E, C2F> Oriented_side_of_bisector_2; typedef Filtered_predicate + FK_Vertex_conflict_2, C2E, C2F> Vertex_conflict_2; typedef Filtered_predicate + FK_Finite_edge_interior_conflict_2, C2E, C2F> Finite_edge_interior_conflict_2; typedef Filtered_predicate + FK_Infinite_edge_interior_conflict_2, C2E, C2F> Infinite_edge_interior_conflict_2; typedef Filtered_predicate + FK_Is_degenerate_edge_2, C2E, C2F> Is_degenerate_edge_2; public: @@ -326,7 +326,7 @@ class Apollonius_graph_filtered_traits_2 } Construct_object_2 - construct_object_2_object() const { + construct_object_2_object() const { return Construct_object_2(); } @@ -338,7 +338,7 @@ class Apollonius_graph_filtered_traits_2 // CONSTRUCTIONS //-------------- Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { + construct_Apollonius_vertex_2_object() const { return Construct_Apollonius_vertex_2(); } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h index 8dada0ad55c5..83ea0290baa1 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -40,11 +40,11 @@ const unsigned int ag_hierarchy_2__maxlevel = 5; // maximal number of points is 30^5 = 24 millions ! template < class Gt, - class Agds = Triangulation_data_structure_2< + class Agds = Triangulation_data_structure_2< Apollonius_graph_hierarchy_vertex_base_2< Apollonius_graph_vertex_base_2 >, Triangulation_face_base_2 >, - class LTag = Tag_false > + class LTag = Tag_false > class Apollonius_graph_hierarchy_2 : public Apollonius_graph_2< Gt, Agds, LTag > { @@ -69,7 +69,7 @@ class Apollonius_graph_hierarchy_2 typedef typename Ag_base::Finite_faces_iterator Finite_faces_iterator; typedef typename Ag_base::All_vertices_iterator All_vertices_iterator; - typedef typename Ag_base::Finite_vertices_iterator + typedef typename Ag_base::Finite_vertices_iterator Finite_vertices_iterator; typedef typename Ag_base::All_edges_iterator All_edges_iterator; @@ -101,8 +101,8 @@ class Apollonius_graph_hierarchy_2 template Apollonius_graph_hierarchy_2(Input_iterator first, - Input_iterator beyond, - const Geom_traits& gt = Geom_traits()) + Input_iterator beyond, + const Geom_traits& gt = Geom_traits()) : Apollonius_graph_base(gt) { init_hierarchy(gt); @@ -158,7 +158,7 @@ class Apollonius_graph_hierarchy_2 Vertex_handle insert(const Site_2& p); Vertex_handle insert(const Site_2& p, - Vertex_handle vnear) { + Vertex_handle vnear) { // the following statement has been added in order to avoid // a g++3.2.1_FreeBSD-RELEASE warning vnear = Vertex_handle(); @@ -176,7 +176,7 @@ class Apollonius_graph_hierarchy_2 public: Vertex_handle nearest_neighbor(const Point_2& p) const; inline Vertex_handle nearest_neighbor(const Point_2& p, - Vertex_handle /* vnear */) const { + Vertex_handle /* vnear */) const { return nearest_neighbor(p); } @@ -200,7 +200,7 @@ class Apollonius_graph_hierarchy_2 // private methods void nearest_neighbor(const Point_2& p, - Vertex_handle vnear[ag_hierarchy_2__maxlevel]) const; + Vertex_handle vnear[ag_hierarchy_2__maxlevel]) const; int random_level(); @@ -214,15 +214,15 @@ class Apollonius_graph_hierarchy_2 public: template + class OutputItHiddenVertices> boost::tuples::tuple + OutputItHiddenVertices> get_conflicts_and_boundary_and_hidden_vertices(const Site_2& p, - OutputItFaces fit, - OutputItBoundaryEdges eit, - OutputItHiddenVertices vit, - Vertex_handle start = - Vertex_handle()) const + OutputItFaces fit, + OutputItBoundaryEdges eit, + OutputItHiddenVertices vit, + Vertex_handle start = + Vertex_handle()) const { Vertex_handle vnearest = nearest_neighbor(p.point(), start); return this->get_all(p, fit, eit, vit, vnearest, false); @@ -231,104 +231,104 @@ class Apollonius_graph_hierarchy_2 template std::pair get_conflicts_and_boundary(const Site_2& p, - OutputItFaces fit, - OutputItBoundaryEdges eit, - Vertex_handle start = - Vertex_handle()) const { + OutputItFaces fit, + OutputItBoundaryEdges eit, + Vertex_handle start = + Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - fit, - eit, - Emptyset_iterator(), - start); + fit, + eit, + Emptyset_iterator(), + start); return std::make_pair( boost::tuples::get<0>(tup), - boost::tuples::get<1>(tup) ); + boost::tuples::get<1>(tup) ); } template std::pair get_boundary_of_conflicts_and_hidden_vertices(const Site_2& p, - OutputItBoundaryEdges eit, - OutputItHiddenVertices vit, - Vertex_handle start = - Vertex_handle()) const { + OutputItBoundaryEdges eit, + OutputItHiddenVertices vit, + Vertex_handle start = + Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - Emptyset_iterator(), - eit, - vit, - start); + Emptyset_iterator(), + eit, + vit, + start); return std::make_pair( boost::tuples::get<1>(tup), - boost::tuples::get<2>(tup) ); + boost::tuples::get<2>(tup) ); } template std::pair get_conflicts_and_hidden_vertices(const Site_2& p, - OutputItFaces fit, - OutputItHiddenVertices vit, - Vertex_handle start = - Vertex_handle()) const { + OutputItFaces fit, + OutputItHiddenVertices vit, + Vertex_handle start = + Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - fit, - Emptyset_iterator(), - vit, - start); + fit, + Emptyset_iterator(), + vit, + start); return std::make_pair( boost::tuples::get<0>(tup), - boost::tuples::get<2>(tup) ); + boost::tuples::get<2>(tup) ); } template OutputItFaces get_conflicts(const Site_2& p, - OutputItFaces fit, - Vertex_handle start = Vertex_handle()) const { + OutputItFaces fit, + Vertex_handle start = Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - fit, - Emptyset_iterator(), - Emptyset_iterator(), - start); + fit, + Emptyset_iterator(), + Emptyset_iterator(), + start); return boost::tuples::get<0>(tup); } template OutputItBoundaryEdges get_boundary_of_conflicts(const Site_2& p, - OutputItBoundaryEdges eit, - Vertex_handle start = Vertex_handle()) const { + OutputItBoundaryEdges eit, + Vertex_handle start = Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - Emptyset_iterator(), - eit, - Emptyset_iterator(), - start); + Emptyset_iterator(), + eit, + Emptyset_iterator(), + start); return boost::tuples::get<1>(tup); } template OutputItHiddenVertices get_hidden_vertices(const Site_2& p, - OutputItHiddenVertices vit, - Vertex_handle start = Vertex_handle()) const { + OutputItHiddenVertices vit, + Vertex_handle start = Vertex_handle()) const { boost::tuples::tuple tup = get_conflicts_and_boundary_and_hidden_vertices(p, - Emptyset_iterator(), - Emptyset_iterator(), - vit, - start); + Emptyset_iterator(), + Emptyset_iterator(), + vit, + start); return boost::tuples::get<2>(tup); } }; @@ -336,7 +336,7 @@ class Apollonius_graph_hierarchy_2 template std::ostream& operator<<(std::ostream& os, - const Apollonius_graph_hierarchy_2& agh) + const Apollonius_graph_hierarchy_2& agh) { agh.file_output(os); return os; @@ -344,7 +344,7 @@ std::ostream& operator<<(std::ostream& os, template std::istream& operator>>(std::istream& is, - Apollonius_graph_hierarchy_2& agh) + Apollonius_graph_hierarchy_2& agh) { agh.file_input(is); return is; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h index b0a34b6a0df3..c2848c94c4b6 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -43,7 +43,7 @@ class Apollonius_graph_hierarchy_vertex_base_2 : Base(), _up(), _down() {} Apollonius_graph_hierarchy_vertex_base_2(const Site_2& p, - Face_handle f) + Face_handle f) : Base(p,f), _up(), _down() {} Apollonius_graph_hierarchy_vertex_base_2(const Site_2& p) diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h index 335b43cf0d03..e5a9eb31f6d1 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -48,7 +48,7 @@ class Apollonius_graph_traits_2 // BASIC TYPES //------------ -private: +private: typedef Apollonius_graph_traits_2 Self; typedef CGAL_APOLLONIUS_GRAPH_2_NS::Apollonius_graph_kernel_wrapper_2 Kernel; @@ -104,7 +104,7 @@ class Apollonius_graph_traits_2 typedef CGAL_APOLLONIUS_GRAPH_2_NS::Is_hidden_2 Is_hidden_2; - typedef CGAL_APOLLONIUS_GRAPH_2_NS::Oriented_side_of_bisector_2 + typedef CGAL_APOLLONIUS_GRAPH_2_NS::Oriented_side_of_bisector_2 /* */ Oriented_side_of_bisector_2; typedef CGAL_APOLLONIUS_GRAPH_2_NS::Vertex_conflict8_2 @@ -140,7 +140,7 @@ class Apollonius_graph_traits_2 } Construct_object_2 - construct_object_2_object() const { + construct_object_2_object() const { return Construct_object_2(); } @@ -152,7 +152,7 @@ class Apollonius_graph_traits_2 // CONSTRUCTIONS //-------------- Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { + construct_Apollonius_vertex_2_object() const { return Construct_Apollonius_vertex_2(); } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h index 7313660bc521..c16c2f1903f5 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -39,14 +39,14 @@ struct Apollonius_graph_vertex_base_nested_iterator_traits { return it->hidden_sites_end(); } - + }; template > + bool StoreHidden = true, + class Vb = Triangulation_ds_vertex_base_2<> > class Apollonius_graph_vertex_base_2 : public Vb { @@ -59,7 +59,7 @@ class Apollonius_graph_vertex_base_2 typedef Vb Base; typedef typename Gt::Point_2 Point; typedef typename Gt::Site_2 Site_2; - typedef AGDS Apollonius_graph_data_structure_2; + typedef AGDS Apollonius_graph_data_structure_2; typedef typename AGDS::Face_handle Face_handle; typedef typename AGDS::Vertex_handle Vertex_handle; @@ -107,7 +107,7 @@ class Apollonius_graph_vertex_base_2 return hidden_site_list.size(); } - Hidden_sites_iterator hidden_sites_begin() { + Hidden_sites_iterator hidden_sites_begin() { return hidden_site_list.begin(); } @@ -145,6 +145,6 @@ class Apollonius_graph_vertex_base_2 Site_2 _p; }; -} //namespace CGAL +} //namespace CGAL #endif // CGAL_APOLLONIUS_GRAPH_VERTEX_BASE_2_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h index cba7400c6235..abb7cbf272a2 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -36,9 +36,9 @@ class Apollonius_site_2 public: Apollonius_site_2(const Point_2& p = Point_2(), - const Weight& w = Weight(0)) + const Weight& w = Weight(0)) : _p(p), _w(w) {} - + const Point_2& point() const { return _p; } const Weight& weight() const { return _w; } RT x() const { return _p.x(); } diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_2.h index 2bf21ed16394..b8bc9b8e23d0 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -67,7 +67,7 @@ class Hyperbola_2 { std::vector< Point_2 > p = compute_points(t); if ( right(p[0]) ) return p[0]; - return p[1]; + return p[1]; } inline @@ -113,19 +113,19 @@ class Hyperbola_2 if ( CGAL::is_negative(d) ) return p; if ( CGAL::is_zero(df.x()) ) { - FT y = (d1 - d2 + norm2(f2) - norm2(f1)) / (FT(2) * df.y()); + FT y = (d1 - d2 + norm2(f2) - norm2(f1)) / (FT(2) * df.y()); - FT D = d1 - CGAL::square(y - f1.y()); + FT D = d1 - CGAL::square(y - f1.y()); - D = CGAL::abs(D); + D = CGAL::abs(D); - FT x1 = CGAL::sqrt(D) + f1.x(); - FT x2 = -CGAL::sqrt(D) + f1.x(); + FT x1 = CGAL::sqrt(D) + f1.x(); + FT x2 = -CGAL::sqrt(D) + f1.x(); - p.push_back(Point_2(x1, y)); - p.push_back(Point_2(x2, y)); + p.push_back(Point_2(x1, y)); + p.push_back(Point_2(x2, y)); - return p; + return p; } FT gamma = (d1 - d2 + norm2(f2) - norm2(f1)) / (FT(2) * df.x()); @@ -156,8 +156,8 @@ class Hyperbola_2 { return CGAL::is_negative( determinant(f1.x(), f1.y(), 1, - f2.x(), f2.y(), 1, - p.x(), p.y(), 1) ); + f2.x(), f2.y(), 1, + p.x(), p.y(), 1) ); } inline @@ -191,7 +191,7 @@ class Hyperbola_2 { STEP = FT(2); this->r = ff1.weight() - ff2.weight(); - + this->f1 = ff1.point(); this->f2 = ff2.point(); @@ -210,8 +210,8 @@ class Hyperbola_2 template void generate_points_qt(const QTWIDGET& W, - std::vector& pleft, - std::vector& pright) const + std::vector& pleft, + std::vector& pright) const { std::vector< Point_2 > p; @@ -223,23 +223,23 @@ class Hyperbola_2 FT STEP; if ( width < height ) { - STEP = width / 500.0; + STEP = width / 500.0; } else { - STEP = height / 500.0; + STEP = height / 500.0; } // double mind = distance(o, f1) - r1; for (int i = 1; i <= 100; i++) { - p = compute_points(FT(i * i) * STEP); - - if ( p.size() > 0 ) { - if ( right(p[0]) ) { - pright.push_back(p[0]); - pleft.push_back(p[1]); - } else { - pright.push_back(p[1]); - pleft.push_back(p[0]); - } - } + p = compute_points(FT(i * i) * STEP); + + if ( p.size() > 0 ) { + if ( right(p[0]) ) { + pright.push_back(p[0]); + pleft.push_back(p[1]); + } else { + pright.push_back(p[1]); + pleft.push_back(p[0]); + } + } } } @@ -250,16 +250,16 @@ class Hyperbola_2 generate_points_qt(pleft, pright); for (unsigned int i = 0; i < pleft.size() - 1; i++) { - W << Segment_2(pleft[i], pleft[i+1]); + W << Segment_2(pleft[i], pleft[i+1]); } - + for (unsigned int i = 0; i < pright.size() - 1; i++) { - W << Segment_2(pright[i], pright[i+1]); + W << Segment_2(pright[i], pright[i+1]); } } void generate_points(std::vector& pleft, - std::vector& pright) const + std::vector& pright) const { std::vector< Point_2 > p; @@ -271,13 +271,13 @@ class Hyperbola_2 p = compute_points(FT(i * i) * STEP); if ( p.size() > 0 ) { - if ( right(p[0]) ) { - pright.push_back(p[0]); - pleft.push_back(p[1]); - } else { - pright.push_back(p[1]); - pleft.push_back(p[0]); - } + if ( right(p[0]) ) { + pright.push_back(p[0]); + pleft.push_back(p[1]); + } else { + pright.push_back(p[1]); + pleft.push_back(p[0]); + } } } } @@ -291,7 +291,7 @@ class Hyperbola_2 for (unsigned int i = 0; i < pleft.size() - 1; i++) { W << Segment_2(pleft[i], pleft[i+1]); } - + for (unsigned int i = 0; i < pright.size() - 1; i++) { W << Segment_2(pright[i], pright[i+1]); } diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h index 6dc5136cd4aa..bbd6c7b089b6 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -75,8 +75,8 @@ class Hyperbola_ray_2 : public Hyperbola_segment_2< Gt > Hyperbola_ray_2(const Site_2 &f1, const Site_2 &f2, - const Point_2 &p, - const Hyperbola_direction& direction) : + const Point_2 &p, + const Hyperbola_direction& direction) : Hyperbola_segment_2< Gt >(f1, f2, p, p), _f1(f1), _f2(f2), _p(p), _dir(direction) { @@ -112,7 +112,7 @@ class Hyperbola_ray_2 : public Hyperbola_segment_2< Gt > } else { this->p2 = f(t1 - this->STEP * OFFSET()); } - + Hyperbola_segment_2< Gt >::draw(s); } @@ -127,7 +127,7 @@ class Hyperbola_ray_2 : public Hyperbola_segment_2< Gt > Hyperbola_segment_2< Gt >::draw(s); } - + }; diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h index 0a8d0357fb61..629c7d9a3534 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -75,8 +75,8 @@ class Hyperbola_segment_2 : public Hyperbola_2< Gt > public: Hyperbola_segment_2() : Hyperbola_2< Gt >() {} - Hyperbola_segment_2(const Site_2 &f1, const Site_2 &f2, - const Point_2 &p1, const Point_2 &p2) + Hyperbola_segment_2(const Site_2 &f1, const Site_2 &f2, + const Point_2 &p1, const Point_2 &p2) : Hyperbola_2< Gt >(f1, f2) { this->p1 = p1; diff --git a/Apollonius_graph_2/include/CGAL/Parabola_2.h b/Apollonius_graph_2/include/CGAL/Parabola_2.h index e8c61a3f2354..4cc53f950208 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -54,17 +54,17 @@ class Parabola_2 FT divide(const FT& x, const FT& y, Integral_domain_without_division_tag) { return FT(CGAL::to_double(x) / CGAL::to_double(y)); } - + inline static FT divide(const FT& x, const FT& y, Field_tag) { return x / y; } - + inline static FT divide(const FT& x, const FT& y) { return divide(x,y, typename AST::Algebraic_category()); } - + inline static FT sqrt(const FT& x, Integral_domain_without_division_tag) { return CGAL::sqrt(CGAL::to_double(x)); @@ -99,17 +99,17 @@ class Parabola_2 { return sqrt( distance2(p1, p2) ); } - - + + inline static FT distance(const Point_2& p, const Line_2& l) { return divide( p.x() * l.a() + p.y() * l.b() + l.c(), - sqrt( CGAL::square(l.a()) + CGAL::square(l.b()) ) ); + sqrt( CGAL::square(l.a()) + CGAL::square(l.b()) ) ); } - - + + // instance stuff Point_2 c; Line_2 l; @@ -128,7 +128,7 @@ class Parabola_2 { std::vector< Point_2 > p = compute_points(t); if ( right(p[0]) ) return p[0]; - return p[1]; + return p[1]; } std::vector< Point_2 > compute_points(const FT &d) const @@ -144,8 +144,8 @@ class Parabola_2 if ( l.a() == FT(0) ) { FT y = d2 * int(CGAL::sign(l.b())) - divide(l.c(), l.b()); - FT C = CGAL::square(y) - FT(2) * c.y() * y + - CGAL::square(c.x()) + CGAL::square(c.y()) - d1; + FT C = CGAL::square(y) - FT(2) * c.y() * y + + CGAL::square(c.x()) + CGAL::square(c.y()) - d1; FT D = CGAL::square(c.x()) - C; @@ -189,8 +189,8 @@ class Parabola_2 { return CGAL::is_positive( determinant(c.x(), c.y(), FT(1), - o.x(), o.y(), FT(1), - p.x(), p.y(), FT(1)) ); + o.x(), o.y(), FT(1), + p.x(), p.y(), FT(1)) ); } inline @@ -220,7 +220,7 @@ class Parabola_2 void compute_origin() { FT d = divide(l.a() * c.x() + l.b() * c.y() + l.c(), - FT(2) * ( CGAL::square(l.a()) + CGAL::square(l.b()) ) ); + FT(2) * ( CGAL::square(l.a()) + CGAL::square(l.b()) ) ); o = Point_2(c.x() - l.a() * d, c.y() - l.b() * d); } @@ -293,13 +293,13 @@ class Parabola_2 W << p[1]; if ( p.size() > 0 ) { - if ( right(p[0]) ) { - pright.push_back(p[0]); - pleft.push_back(p[1]); - } else { - pright.push_back(p[1]); - pleft.push_back(p[0]); - } + if ( right(p[0]) ) { + pright.push_back(p[0]); + pleft.push_back(p[1]); + } else { + pright.push_back(p[1]); + pleft.push_back(p[0]); + } } } diff --git a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h index 7f7271d3f57c..7c03ff5d5e51 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -47,7 +47,7 @@ class Parabola_segment_2 : public Parabola_2< Gt > template Parabola_segment_2(const ApolloniusSite &p, const Line_2 &l, - const Point_2 &p1, const Point_2 &p2) + const Point_2 &p1, const Point_2 &p2) : Parabola_2< Gt >(p, l) { this->p1 = p1; @@ -55,7 +55,7 @@ class Parabola_segment_2 : public Parabola_2< Gt > } Parabola_segment_2(const Point_2 &p, const Line_2 &l, - const Point_2 &p1, const Point_2 &p2) + const Point_2 &p1, const Point_2 &p2) : Parabola_2< Gt >(p, l) { this->p1 = p1; diff --git a/Apollonius_graph_2/include/CGAL/functions_on_signs.h b/Apollonius_graph_2/include/CGAL/functions_on_signs.h index 1b261d75f705..6cf97ee58a80 100644 --- a/Apollonius_graph_2/include/CGAL/functions_on_signs.h +++ b/Apollonius_graph_2/include/CGAL/functions_on_signs.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -49,13 +49,13 @@ sign_a_plus_b_x_sqrt_c(const RT &a, const RT &b, const RT &c) if ( sa == ZERO ) return sb; return sa * CGAL::compare( CGAL::square(a), - c * CGAL::square(b) ); + c * CGAL::square(b) ); } template < class RT > Sign sign_a_x_sqrt_c_plus_b_x_sqrt_d(const RT &a, const RT &b, - const RT &c, const RT &d) + const RT &c, const RT &d) { // computes the sign of quantity: a * sqrt(c) + b * sqrt(d) @@ -71,17 +71,17 @@ sign_a_x_sqrt_c_plus_b_x_sqrt_d(const RT &a, const RT &b, if ( sa == ZERO ) return sb; return sa * CGAL::compare( CGAL::square(a) * c, - CGAL::square(b) * d ); + CGAL::square(b) * d ); } template < class RT > Sign sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f(const RT &a, const RT &b, - const RT &c, const RT &e, - const RT &f) + const RT &c, const RT &e, + const RT &f) { // computes the sign of quantity: a + b * sqrt(e) + c * sqrt(f) - + CGAL_assertion( !(CGAL::is_negative(e)) ); CGAL_assertion( !(CGAL::is_negative(f)) ); @@ -92,24 +92,24 @@ sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f(const RT &a, const RT &b, if ( s_a_plus_b_x_sqrt_e == sc ) return sc; if ( s_a_plus_b_x_sqrt_e == ZERO ) return sc; - return s_a_plus_b_x_sqrt_e * + return s_a_plus_b_x_sqrt_e * sign_a_plus_b_x_sqrt_c(CGAL::square(a) + CGAL::square(b) * e - - CGAL::square(c) * f, - RT(2) * a * b, e); + - CGAL::square(c) * f, + RT(2) * a * b, e); } template < class RT > Sign sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f_plus_d_sqrt_e_x_f(const RT &a, - const RT &b, - const RT &c, - const RT &d, - const RT &e, - const RT &f) + const RT &b, + const RT &c, + const RT &d, + const RT &e, + const RT &f) { // computes the sign of quantity: // a + b * sqrt(e) + c * sqrt(f) + d * sqrt(e * f) - + CGAL_assertion( !(CGAL::is_negative(e)) ); CGAL_assertion( !(CGAL::is_negative(f)) ); @@ -124,10 +124,10 @@ sign_a_plus_b_x_sqrt_e_plus_c_x_sqrt_f_plus_d_sqrt_e_x_f(const RT &a, return s_a_plus_b_sqrt_e * sign_a_plus_b_x_sqrt_c(CGAL::square(a) + CGAL::square(b) * e - - CGAL::square(c) * f - - CGAL::square(d) * e * f, - RT(2) * (a * b - c * d * f), - e); + - CGAL::square(c) * f + - CGAL::square(d) * e * f, + RT(2) * (a * b - c * d * f), + e); } } //namespace CGAL diff --git a/Apollonius_graph_2/include/CGAL/in_place_edge_list.h b/Apollonius_graph_2/include/CGAL/in_place_edge_list.h index 7fe2f822e055..262bf298f44c 100644 --- a/Apollonius_graph_2/include/CGAL/in_place_edge_list.h +++ b/Apollonius_graph_2/include/CGAL/in_place_edge_list.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas @@ -75,7 +75,7 @@ class In_place_edge_list { inline bool is_first(const Edge& e) const { return ( (e.first == _front.first && - e.second == _front.second) ); + e.second == _front.second) ); } public: diff --git a/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h b/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h index 33acaf490bce..d9d8af7b91c7 100644 --- a/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h +++ b/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt index a98b5dd6571f..8a0318d270db 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/include/IO/Null_output_stream.h b/Apollonius_graph_2/test/Apollonius_graph_2/include/IO/Null_output_stream.h index 2caa189aa959..31e3225bbde3 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/include/IO/Null_output_stream.h +++ b/Apollonius_graph_2/test/Apollonius_graph_2/include/IO/Null_output_stream.h @@ -8,8 +8,8 @@ // // ---------------------------------------------------------------------- // -// release : -// release_date : +// release : +// release_date : // // file : include/CGAL/IO/Null_output_stream.h // package : IO diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/include/test.h b/Apollonius_graph_2/test/Apollonius_graph_2/include/test.h index 666f5e131664..6d973d3c6dfe 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/include/test.h +++ b/Apollonius_graph_2/test/Apollonius_graph_2/include/test.h @@ -34,24 +34,24 @@ bool test_algo_generic(InputStream& is, const AG& = AG()); template bool test_algo(InputStream& is, const Kernel& = Kernel(), - const Method_tag& = Method_tag()); + const Method_tag& = Method_tag()); template bool test_hierarchy_algo(InputStream& is, const Kernel& = Kernel(), - const Method_tag& = Method_tag()); + const Method_tag& = Method_tag()); template bool test_filtered_traits_algo(InputStream& is, - const CK& = CK(), const CKM& = CKM(), - const EK& = EK(), - const EKM& = EKM()); + const CK& = CK(), const CKM& = CKM(), + const EK& = EK(), + const EKM& = EKM()); template -bool test_filtered_traits_hierarchy_algo(InputStream& is, - const CK& = CK(), - const CKM& = CKM(), - const EK& = EK(), - const EKM& = EKM()); +bool test_filtered_traits_hierarchy_algo(InputStream& is, + const CK& = CK(), + const CKM& = CKM(), + const EK& = EK(), + const EKM& = EKM()); #endif @@ -212,7 +212,7 @@ bool test_traits_base(const Traits& = Traits()) //-------------------------------------------------------------------- Point_2 p = wp2.point(); assert( oriented_side_of_bisector(wp1, wp3, p) == - ON_POSITIVE_SIDE ); + ON_POSITIVE_SIDE ); // testing vertex_conflict @@ -236,7 +236,7 @@ bool test_traits_base(const Traits& = Traits()) // then we consider the case where v3 is the vertex at infinity wp1 = Site_2(Point_2(1,100),49); wp2 = Site_2(Point_2(0,-100),50); - + wp3 = Site_2(Point_2(0,0),0); assert( vertex_conflict(wp1, wp2, wp3) == POSITIVE ); @@ -273,7 +273,7 @@ bool test_traits_base(const Traits& = Traits()) assert( vertex_conflict(wp1, wp2, wp3, wp5) == POSITIVE ); assert( vertex_conflict(wp1, wp4, wp2, wp5) == POSITIVE ); - + b = finite_edge_interior_conflict(wp1, wp2, wp3, wp4, wp5, false); assert( b ); @@ -283,7 +283,7 @@ bool test_traits_base(const Traits& = Traits()) assert( vertex_conflict(wp1, wp2, wp3, wp5) == NEGATIVE ); assert( vertex_conflict(wp1, wp4, wp2, wp5) == NEGATIVE ); - + b = finite_edge_interior_conflict(wp1, wp2, wp3, wp4, wp5, true); assert( b ); @@ -293,7 +293,7 @@ bool test_traits_base(const Traits& = Traits()) assert( vertex_conflict(wp1, wp2, wp3, wp5) == NEGATIVE ); assert( vertex_conflict(wp1, wp4, wp2, wp5) == NEGATIVE ); - + b = finite_edge_interior_conflict(wp1, wp2, wp3, wp4, wp5, true); assert( !b ); @@ -304,7 +304,7 @@ bool test_traits_base(const Traits& = Traits()) assert( vertex_conflict(wp1, wp2, wp3, wp5) == POSITIVE ); assert( vertex_conflict(wp1, wp4, wp2, wp5) == POSITIVE ); - + b = finite_edge_interior_conflict(wp1, wp2, wp3, wp4, wp5, true); assert( !b ); @@ -394,14 +394,14 @@ bool test_traits_base(const Traits& = Traits()) // testing infinite_edge_interior_conflict //-------------------------------------------------------------------- - + wp2 = Site_2(Point_2(0,0),100); wp3 = Site_2(Point_2(-100,200),5); wp4 = Site_2(Point_2(100,300),4); // the endpoints are not in conflict but the interior is wp5 = Site_2(Point_2(0,-150),2); - + assert( vertex_conflict(wp2, wp3, wp5) == POSITIVE ); assert( vertex_conflict(wp4, wp2, wp5) == POSITIVE ); @@ -411,7 +411,7 @@ bool test_traits_base(const Traits& = Traits()) // the endpoints are in conflict but the interior isn't wp5 = Site_2(Point_2(0,150),150); - + assert( vertex_conflict(wp2, wp3, wp5) == NEGATIVE ); assert( vertex_conflict(wp4, wp2, wp5) == NEGATIVE ); @@ -421,7 +421,7 @@ bool test_traits_base(const Traits& = Traits()) // the endpoints are in conflict as well as the interior wp5 = Site_2(Point_2(0,-150),150); - + assert( vertex_conflict(wp2, wp3, wp5) == NEGATIVE ); assert( vertex_conflict(wp4, wp2, wp5) == NEGATIVE ); @@ -431,7 +431,7 @@ bool test_traits_base(const Traits& = Traits()) // neither the endpoints nor the interior are in conflict wp5 = Site_2(Point_2(0,150),50); - + assert( vertex_conflict(wp2, wp3, wp5) == POSITIVE ); assert( vertex_conflict(wp4, wp2, wp5) == POSITIVE ); @@ -596,7 +596,7 @@ bool test_algo_generic(InputStream& is) n_afaces++; } - + assert( 2 * n_aedges == 3 * n_afaces ); assert( n_avertices - n_aedges + n_afaces == 2 ); @@ -754,9 +754,9 @@ bool test_algo_generic(InputStream& is) typename std::vector::iterator it; for (it = wp_list.begin(); it != wp_list.end(); ++it) { if ( it == wp_list.begin() ) { - v = ag.insert(*it); + v = ag.insert(*it); } else { - v = ag.insert(*it, v); + v = ag.insert(*it, v); } } assert( ag.is_valid() ); @@ -792,7 +792,7 @@ bool test_algo_generic(InputStream& is) ag.clear(); ag.swap(ag2); assert( ag.number_of_vertices() + - ag.number_of_hidden_sites() == wp_list.size() ); + ag.number_of_hidden_sites() == wp_list.size() ); assert( ag2.number_of_vertices() == 0 ); @@ -868,7 +868,7 @@ bool test_algo_generic(InputStream& is) #if defined(__INTEL_COMPILER) template bool test_algo(InputStream& is, const Kernel&, - const Method_tag&) + const Method_tag&) #else template bool test_algo(InputStream& is) @@ -923,7 +923,7 @@ bool test_hierarchy_algo(InputStream& is) #if defined(__INTEL_COMPILER) template bool test_filtered_traits_algo(InputStream& is, const CK&, - const CKM&, const EK&, const EKM&) + const CKM&, const EK&, const EKM&) #else template bool test_filtered_traits_algo(InputStream& is) @@ -948,9 +948,9 @@ bool test_filtered_traits_algo(InputStream& is) #if defined(__INTEL_COMPILER) template -bool test_filtered_traits_hierarchy_algo(InputStream& is, - const CK&, const CKM&, - const EK&, const EKM&) +bool test_filtered_traits_hierarchy_algo(InputStream& is, + const CK&, const CKM&, + const EK&, const EKM&) #else template bool test_filtered_traits_hierarchy_algo(InputStream& is) diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/include/test_three_sites.h b/Apollonius_graph_2/test/Apollonius_graph_2/include/test_three_sites.h index b385e5987294..d8797deda4c4 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/include/test_three_sites.h +++ b/Apollonius_graph_2/test/Apollonius_graph_2/include/test_three_sites.h @@ -54,10 +54,10 @@ int number_of_infinite_vertices(const AG& ag, typename AG::Vertex_handle v) template bool test_three_sites(const AG& ag, - typename AG::Vertex_handle v1, - typename AG::Vertex_handle v2, - typename AG::Vertex_handle v3, - Middle_t mid_type) + typename AG::Vertex_handle v1, + typename AG::Vertex_handle v2, + typename AG::Vertex_handle v3, + Middle_t mid_type) { std::cout << "Site 1: " << v1->site() << std::endl; std::cout << "Site 2: " << v2->site() << std::endl; diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/test_ag_three_sites_2.cpp b/Apollonius_graph_2/test/Apollonius_graph_2/test_ag_three_sites_2.cpp index 4b6029bb9f27..d2720d79a60a 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/test_ag_three_sites_2.cpp +++ b/Apollonius_graph_2/test/Apollonius_graph_2/test_ag_three_sites_2.cpp @@ -24,7 +24,7 @@ typedef AG2::Vertex_handle Vertex_handle; int main() { std::cout << "testing the Apollonius graph class for three sites..." - << std::endl; + << std::endl; Site_2 s1(Point_2(100,100),5), s2(Point_2(150,150),10), s3(Point_2(200,200),15); diff --git a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h index d5c319c24753..a01c7b70240c 100644 --- a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h @@ -6,15 +6,15 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide class Arithmetic_kernel, a collection of number types. +// \brief provide class Arithmetic_kernel, a collection of number types. // -// +// /*! \file CGAL/Arithmetic_kernel.h * \brief Declarations pertaining to CGAL::Arithmetic_kernel @@ -26,35 +26,35 @@ #include -// Define a default Arithmetic_kernel GMP, CORE, LEDA +// Define a default Arithmetic_kernel GMP, CORE, LEDA #ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL #include -#if defined(CGAL_HAS_LEDA_ARITHMETIC_KERNEL) +#if defined(CGAL_HAS_LEDA_ARITHMETIC_KERNEL) namespace CGAL{ typedef LEDA_arithmetic_kernel Arithmetic_kernel; -}// namespace CGAL +}// namespace CGAL #define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 #endif // CGAL_USE_LEDA #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL #ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL #include -#if defined(CGAL_HAS_CORE_ARITHMETIC_KERNEL) +#if defined(CGAL_HAS_CORE_ARITHMETIC_KERNEL) namespace CGAL{ typedef CORE_arithmetic_kernel Arithmetic_kernel; -}// namespace CGAL +}// namespace CGAL #define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 #endif // CGAL_USE_CORE #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL #ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL #include -#if defined(CGAL_HAS_GMP_ARITHMETIC_KERNEL) +#if defined(CGAL_HAS_GMP_ARITHMETIC_KERNEL) namespace CGAL{ typedef GMP_arithmetic_kernel Arithmetic_kernel; -}// namespace CGAL +}// namespace CGAL #define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 #endif // CGAL_USE_GMP #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL @@ -64,7 +64,7 @@ typedef GMP_arithmetic_kernel Arithmetic_kernel; #define CGAL_SNAP_ARITHMETIC_KERNEL_TYPEDEFS(AT) \ typedef typename AT::Integer Integer; \ typedef typename AT::Rational Rational; \ - typedef typename AT::Field_with_sqrt Field_with_sqrt; + typedef typename AT::Field_with_sqrt Field_with_sqrt; #endif // CGAL_ARITHMETIC_KERNEL_H // EOF diff --git a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel/Arithmetic_kernel_base.h b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel/Arithmetic_kernel_base.h index 012669a3d296..11c49673bee8 100644 --- a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel/Arithmetic_kernel_base.h +++ b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel/Arithmetic_kernel_base.h @@ -7,11 +7,11 @@ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Michael Hemmer +// Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide base class for Arithmetic_kernel +// \brief provide base class for Arithmetic_kernel // diff --git a/Arithmetic_kernel/include/CGAL/CORE_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/CORE_arithmetic_kernel.h index 60a7ec0ec375..5df573c77de3 100644 --- a/Arithmetic_kernel/include/CGAL/CORE_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/CORE_arithmetic_kernel.h @@ -6,12 +6,12 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide class LEDA_arithmetic_kernel, a collection of number types. +// \brief provide class LEDA_arithmetic_kernel, a collection of number types. // @@ -23,7 +23,7 @@ #ifdef CGAL_USE_CORE -#define CGAL_HAS_CORE_ARITHMETIC_KERNEL +#define CGAL_HAS_CORE_ARITHMETIC_KERNEL #include #include diff --git a/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h index 78e5cf8daae3..f10104e91fe8 100644 --- a/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h @@ -6,12 +6,12 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide class Arithmetic_kernel, a collection of number types. +// \brief provide class Arithmetic_kernel, a collection of number types. // #ifndef CGAL_GMP_ARITHMETIC_KERNEL_H @@ -19,7 +19,7 @@ #include -#ifdef CGAL_USE_GMP +#ifdef CGAL_USE_GMP #include #include @@ -30,7 +30,7 @@ #include #ifdef CGAL_USE_MPFI -#define CGAL_HAS_GMP_ARITHMETIC_KERNEL +#define CGAL_HAS_GMP_ARITHMETIC_KERNEL #include #include #endif //CGAL_USE_MPFI @@ -49,7 +49,7 @@ class GMP_arithmetic_kernel : public internal::Arithmetic_kernel_base { typedef CGAL::Gmpfi Bigfloat_interval; #endif //CGAL_USE_MPFI }; - + template <> struct Get_arithmetic_kernel { typedef GMP_arithmetic_kernel Arithmetic_kernel; diff --git a/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h index 18e38ee51693..f3752560ff50 100644 --- a/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h @@ -7,11 +7,11 @@ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Michael Hemmer +// Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide base class for Get_arithmetic_kernel +// \brief provide base class for Get_arithmetic_kernel // #ifndef CGAL_GET_ARITHMETIC_KERNEL_H diff --git a/Arithmetic_kernel/include/CGAL/LEDA_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/LEDA_arithmetic_kernel.h index f18449441a33..230e7b6e85f8 100644 --- a/Arithmetic_kernel/include/CGAL/LEDA_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/LEDA_arithmetic_kernel.h @@ -6,12 +6,12 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide class LEDA_arithmetic_kernel, a collection of number types. +// \brief provide class LEDA_arithmetic_kernel, a collection of number types. // @@ -22,7 +22,7 @@ #ifdef CGAL_USE_LEDA -#define CGAL_HAS_LEDA_ARITHMETIC_KERNEL +#define CGAL_HAS_LEDA_ARITHMETIC_KERNEL #include #include diff --git a/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h index 7bd7c177ef51..9d85a42c4b6e 100644 --- a/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h @@ -6,12 +6,12 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Sebastien Loriot // // ============================================================================ // -// \brief provide class Arithmetic_kernel, a collection of number types. +// \brief provide class Arithmetic_kernel, a collection of number types. // #ifndef CGAL_MP_FLOAT_ARITHMETIC_KERNEL_H @@ -21,7 +21,7 @@ #include #include -#define CGAL_HAS_MP_FLOAT_ARITHMETIC_KERNEL +#define CGAL_HAS_MP_FLOAT_ARITHMETIC_KERNEL #include #include diff --git a/Arithmetic_kernel/package_info/Arithmetic_kernel/description.txt b/Arithmetic_kernel/package_info/Arithmetic_kernel/description.txt index 0edc8e37a8bc..954b06aeccc7 100644 --- a/Arithmetic_kernel/package_info/Arithmetic_kernel/description.txt +++ b/Arithmetic_kernel/package_info/Arithmetic_kernel/description.txt @@ -1,7 +1,7 @@ -An Arithmetic_kernel is required to provide at least the following public types: +An Arithmetic_kernel is required to provide at least the following public types: Integer, Rational, Bigfloat_interval. It is guranteed that these types are interoperable. Currently there are: Gmp_arithmetic_kernel CORE_arithmetic_kernel -LEDA_arithmetic_kernel +LEDA_arithmetic_kernel -Moreover, the package provides a class template Get_arithmetic_kernel. This cclass provides the corresponding Arithmetic_kernel for T. Note that T may also be a non trivial type such as Sqrt_extension, Polynomial etc. +Moreover, the package provides a class template Get_arithmetic_kernel. This cclass provides the corresponding Arithmetic_kernel for T. Note that T may also be a non trivial type such as Sqrt_extension, Polynomial etc. diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/Arithmetic_kernel.cpp b/Arithmetic_kernel/test/Arithmetic_kernel/Arithmetic_kernel.cpp index 1bb1400beeaa..61e1bd0d1237 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/Arithmetic_kernel.cpp +++ b/Arithmetic_kernel/test/Arithmetic_kernel/Arithmetic_kernel.cpp @@ -14,6 +14,6 @@ int main() { } #else -#warning CGAL has no default CGAL::Arithmetic kernel +#warning CGAL has no default CGAL::Arithmetic kernel int main() { return 0; } #endif diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 2807ba14ea0e..82660d4b397b 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -16,11 +16,11 @@ if ( CGAL_FOUND AND GMP_FOUND ) include(${CGAL_USE_FILE}) include( CGAL_VersionUtils ) - + get_dependency_version( GMP ) IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) - + include_directories(include) find_package( MPFI ) @@ -36,7 +36,7 @@ if ( CGAL_FOUND AND GMP_FOUND ) "MPFI tests need GMP>=4.2, some of the tests will not be compiled" ) else( _IS_GMP_VERSION_TO_LOW ) include( ${MPFI_USE_FILE} ) - create_single_source_cgal_program( "GMP_arithmetic_kernel.cpp" ) + create_single_source_cgal_program( "GMP_arithmetic_kernel.cpp" ) endif( _IS_GMP_VERSION_TO_LOW ) else( MPFI_FOUND ) message( STATUS @@ -49,8 +49,8 @@ if ( CGAL_FOUND AND GMP_FOUND ) create_single_source_cgal_program( "Get_arithmetic_kernel.cpp" ) else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/GMP_arithmetic_kernel.cpp b/Arithmetic_kernel/test/Arithmetic_kernel/GMP_arithmetic_kernel.cpp index a9334033d0c4..57b8287e0ca1 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/GMP_arithmetic_kernel.cpp +++ b/Arithmetic_kernel/test/Arithmetic_kernel/GMP_arithmetic_kernel.cpp @@ -7,7 +7,7 @@ #include int main() { - std::cout << "TEST GMP_arithmetic_kernel" << std::endl; + std::cout << "TEST GMP_arithmetic_kernel" << std::endl; typedef CGAL::GMP_arithmetic_kernel AK; CGAL::test_arithmetic_kernel(); return 0; diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp b/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp index 0dacebfcb77a..946c05df4e6f 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp +++ b/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp @@ -13,8 +13,8 @@ int main() { typedef CGAL::Arithmetic_kernel AK; typedef AK::Integer Integer; - typedef AK::Rational Rational; - typedef AK::Bigfloat_interval BFI; + typedef AK::Rational Rational; + typedef AK::Bigfloat_interval BFI; { typedef CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_; CGAL_USE_TYPE(AK_); @@ -34,6 +34,6 @@ int main() { } #else -#warning CGAL has no default CGAL::Arithmetic kernel +#warning CGAL has no default CGAL::Arithmetic kernel int main() { return 0; } #endif diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/include/CGAL/Test/_test_arithmetic_kernel.h b/Arithmetic_kernel/test/Arithmetic_kernel/include/CGAL/Test/_test_arithmetic_kernel.h index af26191cb6fd..4970b3b96653 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/include/CGAL/Test/_test_arithmetic_kernel.h +++ b/Arithmetic_kernel/test/Arithmetic_kernel/include/CGAL/Test/_test_arithmetic_kernel.h @@ -7,11 +7,11 @@ // $Id:$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Michael Hemmer +// Author(s) : Michael Hemmer // // ============================================================================ // -// \brief provide test for Arithmetic_kernel +// \brief provide test for Arithmetic_kernel // #ifndef CGAL_TEST_ARITHMETIC_KERNEL_H @@ -20,9 +20,9 @@ #include -namespace CGAL { +namespace CGAL { - typedef CGAL::Interval_nt Interval; + typedef CGAL::Interval_nt Interval; void test_coercion_from_to(CGAL::Null_tag, CGAL::Null_tag){} template void test_coercion_from_to(A, CGAL::Null_tag){} @@ -31,19 +31,19 @@ namespace CGAL { CGAL::test_explicit_interoperable_from_to(); } -template +template void test_coercion_arithmetic_kernel(){ - - typedef typename ARK::Integer Integer; - typedef typename ARK::Rational Rational; - typedef typename ARK::Field_with_sqrt Field_with_sqrt; - typedef typename ARK::Field_with_kth_root Field_with_kth_root; - typedef typename ARK::Field_with_root_of Field_with_root_of; + + typedef typename ARK::Integer Integer; + typedef typename ARK::Rational Rational; + typedef typename ARK::Field_with_sqrt Field_with_sqrt; + typedef typename ARK::Field_with_kth_root Field_with_kth_root; + typedef typename ARK::Field_with_root_of Field_with_root_of; typedef typename ARK::Bigfloat Bigfloat; typedef typename ARK::Bigfloat_interval Bigfloat_interval; - - + + test_coercion_from_to(int(),Integer()); test_coercion_from_to(short(),Integer()); test_coercion_from_to(Integer(),Integer()); @@ -53,8 +53,8 @@ void test_coercion_arithmetic_kernel(){ test_coercion_from_to(float(),Rational()); test_coercion_from_to(double(),Rational()); test_coercion_from_to(Integer(),Rational()); - // This is currently not consistent with LEDA and GMP, for CORE it is not even defined. - // test_coercion_from_to(Bigfloat(),Rational()); + // This is currently not consistent with LEDA and GMP, for CORE it is not even defined. + // test_coercion_from_to(Bigfloat(),Rational()); test_coercion_from_to(Rational(),Rational()); test_coercion_from_to(int(),Field_with_sqrt()); @@ -110,7 +110,7 @@ void test_coercion_arithmetic_kernel(){ test_coercion_from_to(Bigfloat_interval(),Bigfloat_interval()); } -template +template void test_arithmetic_kernel(){ test_coercion_arithmetic_kernel(); } diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h index 9c16fb150751..101637c9cba7 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h @@ -77,7 +77,7 @@ class Curve_selection_dialog : public QDialog { class Graphic_layer : public CGAL::Qt_widget_layer { Q_OBJECT - + public: Graphic_layer(CGAL::Qt_widget *attach_to, int index_, int color_index_, int fst_ind = -1, @@ -85,7 +85,7 @@ Q_OBJECT Qt_widget_layer(parent, name), erase(false), index(index_), color_index(color_index_), first_curve_index(fst_ind), second_curve_index(snd_ind) - { + { attach_to->attach(this); } @@ -99,7 +99,7 @@ Q_OBJECT int index, color_index; int first_curve_index, second_curve_index; - + }; typedef std::vector Layers; diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/xalci.h b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/xalci.h index a5a82c23ec65..c109870f9f3e 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/xalci.h +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/xalci.h @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -203,7 +203,7 @@ protected slots: void print_endpoint(const Arc_2& arc, CGAL::Arr_curve_end end, std::ostream& os); void print_point(const Point_2& pt, std::ostream& os); - + void arr_activate_layers(); void cad_activate_layers(); void oc_activate_layers(); @@ -212,7 +212,7 @@ protected slots: void cad_deactivate_layers(); void oc_deactivate_layers(); - + protected: Poly_int2 make_square_free(const Poly_int2& poly); @@ -221,12 +221,12 @@ protected slots: template bool read_polys_from_file(QString filename,OutputIterator out); - + void cad_to_segments(); void arr_compute_arrangement(); CGAL::Bbox_2 bbox; - + std::vector< Poly_int2 > cad_curves, arr_curves; Curve_selection_dialog* curve_selection_dialog; @@ -235,26 +235,26 @@ protected slots: QPushButton *cad_analyse_btn, *cad_rasterize_btn, *cad_file_search, *cad_partial_selection, - *arr_analyse_btn, *arr_rasterize_btn, *arr_file_search, + *arr_analyse_btn, *arr_rasterize_btn, *arr_file_search, *arr_partial_selection, *oc_analyse_btn, *oc_rasterize_btn; - + QHButtonGroup *arr_method; QRadioButton *arr_cgal, *arr_leda; QCheckBox *cad_complete_check,*oc_complete_check, *arr_complete_check; - QListBox *cad_seg_list, *cad_curve_list,*oc_seg_list, *cad_ps_curve_list, + QListBox *cad_seg_list, *cad_curve_list,*oc_seg_list, *cad_ps_curve_list, *arr_edge_list, *arr_node_list; - + QTabWidget *tab_widget; QFrame* one_curve_tab, *cad_tab, *arr_tab; QLabel *arr_node_label,*arr_edge_label; std::vector cad_curve_list_selection; - + QLineEdit *cad_input, *arr_input; QTextEdit *oc_input; QComboBox *oc_method_box; Graphic_layer *axis; - + QWidget *central_widget; CGAL::Qt_widget *widget; CGAL::Qt_widget_standard_toolbar *stoolbar; diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp index 3912e6ea697f..2ba998c0c0ff 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp @@ -15,14 +15,14 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko -// +// // ============================================================================ /*!\brief * declares miscellaneous routines in a separate file (to speed-up * compilation) */ - + #define NDEBUG 1 //#define CGAL_NO_LEDA @@ -87,18 +87,18 @@ void Graphic_layer::draw() { QPainter *ppnt = &widget->get_painter(); QPen old_pen = ppnt->pen(); - + if(index == -2) { CGAL::Bbox_2 new_box(widget->x_min(), widget->y_min(), widget->x_max(), widget->y_max()); if(bbox != new_box) { bbox = new_box; - + //subdiv_renderer.setup(bbox, // widget->width(), widget->height()); subdiv_layer_changed = true; } - + if(subdiv_layer_changed) { QPainter offscreen(subdiv_plot); //offscreen.setPen(QPen(Qt::black, 2, Qt::SolidLine, Qt::SquareCap, @@ -108,10 +108,10 @@ void Graphic_layer::draw() subdiv_layer_changed = false; typedef std::pair Int_pair; std::list points; - + //subdiv_renderer.draw(std::back_inserter(points)); if(!points.empty()) { - + offscreen.setPen(QPen(Qt::black ,1)); std::list::iterator it = points.begin(); while(it != points.end()) { @@ -122,16 +122,16 @@ void Graphic_layer::draw() subdiv_layer_changed = false; } ppnt->drawPixmap(0,0,*subdiv_plot); - + } else if(index == -1) { // this layer is dedicated to axis drawing #if !CGAL_CKvA_NO_AXES RasterOp old_raster = widget->rasterOp(); widget->setRasterOp(XorROP); ppnt->setPen(QPen(QColor(150,150,0),1,Qt::DashDotDotLine)); - ppnt->moveTo(0,widget->y_pixel(0)); + ppnt->moveTo(0,widget->y_pixel(0)); ppnt->lineTo(widget->width(),widget->y_pixel(0)); - ppnt->moveTo(widget->x_pixel(0),0); + ppnt->moveTo(widget->x_pixel(0),0); ppnt->lineTo(widget->x_pixel(0),widget->height()); widget->setRasterOp(old_raster); #endif @@ -152,9 +152,9 @@ void Graphic_layer::draw() QBrush b1(Qt::NoBrush); #endif*/ ppnt->setBrush(b1); - + timer.start(); - if(CGAL::assign(arc, obj)) + if(CGAL::assign(arc, obj)) *widget << arc; else if(CGAL::assign(pt, obj)) *widget << pt; @@ -173,15 +173,15 @@ void xAlci_main_window::arr_activate_layers() { for(Layers::iterator it = arr_layers.begin(); it != arr_layers.end(); it++, i++) { /*if(i < n_nodes) { - if(arr_node_list->isSelected(i)||arr_complete_check->isChecked()) + if(arr_node_list->isSelected(i)||arr_complete_check->isChecked()) (*it)->activate(); - else if((*it)->is_active()) + else if((*it)->is_active()) (*it)->deactivate(); } else {*/ - if(arr_edge_list->isSelected(i) || arr_complete_check->isChecked()) + if(arr_edge_list->isSelected(i) || arr_complete_check->isChecked()) (*it)->activate(); - else if((*it)->is_active()) - (*it)->deactivate(); + else if((*it)->is_active()) + (*it)->deactivate(); } } @@ -216,7 +216,7 @@ void xAlci_main_window::oc_activate_layers() void xAlci_main_window::arr_rasterize_click() { arr_activate_layers(); - + timer.reset(); widget->redraw(); std::cout << "\n\nRasterize elapsed time: " << timer.time() << std::endl; @@ -225,7 +225,7 @@ void xAlci_main_window::arr_rasterize_click() { void xAlci_main_window::cad_rasterize_click() { cad_activate_layers(); - + timer.reset(); widget->redraw(); std::cout << "\n\nRasterize elapsed time: " << timer.time() << std::endl; @@ -242,14 +242,14 @@ void xAlci_main_window::oc_rasterize_click() if(!input_poly(f, oc_input->text().ascii())) return; - + //subdiv_renderer.set_polynomial(f); subdiv_layer_changed = true; } refine_timer.reset(); timer.reset(); - + widget->redraw(); refine_timer.stop(); @@ -257,7 +257,7 @@ void xAlci_main_window::oc_rasterize_click() std::endl; std::cout << "\n\nRasterize elapsed time: " << timer.time() << std::endl; } - + bool xAlci_main_window::input_poly(Poly_int2& p, const char *ascii) { if(ascii == NULL) @@ -270,7 +270,7 @@ bool xAlci_main_window::input_poly(Poly_int2& p, const char *ascii) { Poly_rat_2 prat; if(parser(str, prat)) { - + typedef CGAL::Fraction_traits< Poly_rat_2 > FTraits; FTraits::Denominator_type det(1); FTraits::Decompose decompose; @@ -292,7 +292,7 @@ bool xAlci_main_window::input_poly(Poly_int2& p, const char *ascii) { p = make_square_free(p); std::cout << "squarefree part: " << p << std::endl; } -#endif +#endif return true; } @@ -318,7 +318,7 @@ void xAlci_main_window::print_endpoint(const Arc_2& arc, os << "-oo"; else if(loc == CGAL::ARR_RIGHT_BOUNDARY) os << "+oo"; - else + else os << CGAL::to_double(arc.curve_end_x(end)); switch(loc) { @@ -329,26 +329,26 @@ void xAlci_main_window::print_endpoint(const Arc_2& arc, case CGAL::ARR_TOP_BOUNDARY: os << "; y: +oo)"; break; - + case CGAL::ARR_LEFT_BOUNDARY: case CGAL::ARR_RIGHT_BOUNDARY: { CGAL::Object obj = arc.curve().asymptotic_value_of_arc(loc, arc.arcno()); - + CGAL::Arr_parameter_space loc2; - if(CGAL::assign(loc2, obj)) + if(CGAL::assign(loc2, obj)) os << (loc2 == CGAL::ARR_BOTTOM_BOUNDARY ? "; y: -oo)" : "; y: +oo)"); else { Kernel_2::Coordinate_1 y; - if(CGAL::assign(y, obj)) + if(CGAL::assign(y, obj)) os << "; y: " << CGAL::to_double(y) << " (asym))"; else CGAL_error_msg("Ill-typed object returned..\n"); } break; - } + } default: os << "; arcno: " << arc.curve_end(end).arcno() << ')'; } @@ -409,7 +409,7 @@ void xAlci_main_window::cad_file_search_click() { void xAlci_main_window::arr_file_search_click() { QFileDialog file_dialog("", QString::null, central_widget, 0, true); - if(file_dialog.exec() == QDialog::Accepted) + if(file_dialog.exec() == QDialog::Accepted) arr_input->setText(file_dialog.selectedFile()); } @@ -451,14 +451,14 @@ void xAlci_main_window::setup(int w, int h) arcs_plot = new QPixmap(w, h); subdiv_plot->fill(); arcs_plot->fill(); - + subdiv_layer = NULL; QBoxLayout *hbox = new QHBoxLayout(central_widget, 10, 10); widget = new CGAL::Qt_widget(central_widget); hbox->addWidget(widget,8); - //QBoxLayout *vbox = new QVBoxLayout(0,0,5); + //QBoxLayout *vbox = new QVBoxLayout(0,0,5); //hbox->addLayout(vbox); - + tab_widget = new QTabWidget(central_widget); hbox->addWidget(tab_widget,4); one_curve_tab = new QFrame(tab_widget,"one_curve"); @@ -489,13 +489,13 @@ void xAlci_main_window::setup(int w, int h) cad_file_search = new QPushButton("Browse",cad_hbox1); cad_vbox->addWidget(cad_hbox1); QHBox* cad_hbox2 = new QHBox(cad_tab); - + cad_analyse_btn = new QPushButton("Analyse",cad_hbox2); cad_partial_selection = new QPushButton("Choose polynomials",cad_hbox2); cad_vbox->addWidget(cad_hbox2); cad_vbox->addWidget(new QLabel("Curve segments:",cad_tab)); - + cad_seg_list = new QListBox(cad_tab); cad_seg_list->setSelectionMode(QListBox::Multi); cad_vbox->addWidget(cad_seg_list,6); @@ -507,7 +507,7 @@ void xAlci_main_window::setup(int w, int h) cad_vbox->addWidget(cad_curve_list,6); cad_complete_check = new QCheckBox("rasterize complete cad",cad_tab); cad_vbox->addWidget(cad_complete_check); - + cad_rasterize_btn = new QPushButton("Rasterize",cad_tab); cad_vbox->addWidget(cad_rasterize_btn); @@ -519,7 +519,7 @@ void xAlci_main_window::setup(int w, int h) arr_input = new QLineEdit("", QString::null,arr_hbox1); arr_file_search = new QPushButton("Browse",arr_hbox1); arr_vbox->addWidget(arr_hbox1); - + arr_method = new QHButtonGroup(arr_tab); arr_method->setTitle("Arrangement data structure"); arr_leda = new QRadioButton(arr_method); @@ -527,7 +527,7 @@ void xAlci_main_window::setup(int w, int h) arr_cgal = new QRadioButton(arr_method); arr_cgal->setText("CGAL"); arr_method->setExclusive(true); - + arr_vbox->addWidget(arr_method); QHBox* arr_hbox2 = new QHBox(arr_tab); @@ -537,7 +537,7 @@ void xAlci_main_window::setup(int w, int h) arr_vbox->addWidget(arr_hbox2); arr_node_label = new QLabel("Nodes:",arr_tab); arr_vbox->addWidget(arr_node_label); - + arr_node_list = new QListBox(arr_tab); arr_node_list->setSelectionMode(QListBox::Multi); @@ -553,20 +553,20 @@ void xAlci_main_window::setup(int w, int h) new QCheckBox("rasterize complete arrangement", arr_tab); // complete_check->setChecked(true); arr_vbox->addWidget(arr_complete_check); - + arr_rasterize_btn = new QPushButton("Rasterize",arr_tab); arr_vbox->addWidget(arr_rasterize_btn); // ONE CURVE TAB QBoxLayout* oc_vbox = new QVBoxLayout(one_curve_tab,10,10); oc_vbox->addWidget(new QLabel("Input polynomial:",one_curve_tab)); - + oc_input = new QTextEdit("", QString::null,one_curve_tab); oc_vbox->addWidget(oc_input,6); oc_analyse_btn = new QPushButton("Analyse",one_curve_tab); oc_vbox->addWidget(oc_analyse_btn); oc_vbox->addWidget(new QLabel("Curve segments:",one_curve_tab)); - + oc_seg_list = new QListBox(one_curve_tab); oc_seg_list->setSelectionMode(QListBox::Multi); oc_vbox->addWidget(oc_seg_list,6); @@ -574,17 +574,17 @@ void xAlci_main_window::setup(int w, int h) oc_complete_check = new QCheckBox("rasterize complete curve",one_curve_tab); oc_vbox->addWidget(oc_complete_check); - + oc_method_box = new QComboBox("Rasterization method", one_curve_tab); oc_method_box->insertItem("Segment Renderer"); oc_method_box->insertItem("Space Subdivision"); oc_method_box->setEditable(false); - + oc_vbox->addWidget(oc_method_box); oc_rasterize_btn = new QPushButton("Rasterize",one_curve_tab); oc_vbox->addWidget(oc_rasterize_btn); - + QPopupMenu * file = new QPopupMenu( this ); menuBar()->insertItem( "&File", file ); file->insertItem("&New", this, SLOT(new_instance()), CTRL+Key_N); @@ -594,16 +594,16 @@ void xAlci_main_window::setup(int w, int h) file->insertItem("Print", widget, SLOT(print_to_ps()), CTRL+Key_P); file->insertSeparator(); file->insertItem( "&Close", this, SLOT(close()), CTRL+Key_X ); - file->insertItem( "&Quit", qApp, SLOT( closeAllWindows() ), - CTRL+Key_Q ); + file->insertItem( "&Quit", qApp, SLOT( closeAllWindows() ), + CTRL+Key_Q ); QPopupMenu * help = new QPopupMenu( this ); menuBar()->insertItem( "&Help", help ); help->insertItem("How To", this, SLOT(howto()), Key_F1); help->insertSeparator(); help->insertItem("&About", this, SLOT(about()), 0); help->insertItem("About &Qt", this, SLOT(aboutQt()) ); - - QToolBar *layers_toolbar = + + QToolBar *layers_toolbar = new QToolBar("Tools", this, QMainWindow::DockTop, TRUE, "Tools"); QToolButton *axis_button = new QToolButton(QPixmap(axis_xpm), "Show axis", 0, this, SLOT(axis_toggle()), layers_toolbar); @@ -618,12 +618,12 @@ void xAlci_main_window::setup(int w, int h) connect(cad_analyse_btn, SIGNAL(clicked()), SLOT(cad_analyse_click())); connect(cad_partial_selection,SIGNAL(clicked()), SLOT(cad_partial_selection_click())); - + connect(cad_rasterize_btn, SIGNAL(clicked()), SLOT(cad_rasterize_click())); connect(cad_file_search,SIGNAL(clicked()), SLOT(cad_file_search_click())); - connect(cad_complete_check, SIGNAL(toggled(bool)), + connect(cad_complete_check, SIGNAL(toggled(bool)), SLOT(cad_complete_toggle(bool))); - + connect(cad_seg_list, SIGNAL(selectionChanged()), SLOT(cad_seg_list_click())); connect(cad_curve_list, SIGNAL(selectionChanged()), @@ -635,10 +635,10 @@ void xAlci_main_window::setup(int w, int h) connect(arr_rasterize_btn, SIGNAL(clicked()), SLOT(arr_rasterize_click())); connect(arr_file_search,SIGNAL(clicked()), SLOT(arr_file_search_click())); - + connect(arr_complete_check, SIGNAL(toggled(bool)), SLOT(arr_complete_toggle(bool))); - + connect(arr_node_list, SIGNAL(selectionChanged()), SLOT(arr_node_list_click())); connect(arr_edge_list, SIGNAL(selectionChanged()), @@ -646,7 +646,7 @@ void xAlci_main_window::setup(int w, int h) connect(oc_analyse_btn, SIGNAL(clicked()), SLOT(oc_analyse_click())); connect(oc_rasterize_btn, SIGNAL(clicked()), SLOT(oc_rasterize_click())); - connect(oc_complete_check, SIGNAL(toggled(bool)), + connect(oc_complete_check, SIGNAL(toggled(bool)), SLOT(oc_complete_toggle(bool))); connect(oc_seg_list, SIGNAL(selectionChanged()), SLOT(oc_seg_list_click())); diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/poly2ntl.cpp b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/poly2ntl.cpp index 963a8a8cb5dc..3127ec1ff9e3 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/poly2ntl.cpp +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/poly2ntl.cpp @@ -19,7 +19,7 @@ // ============================================================================ /*! \file NiX/poly2ntl.C - * + * * Conversion of polynomials to NTL format & back */ @@ -52,7 +52,7 @@ namespace CGAL { // namespace internal { // int *primes = CGAL::CGALi::primes; -// } +// } struct NTL_bigint_rep { long alloc; @@ -77,9 +77,9 @@ void poly2ntl(const Poly_1& p, NTL::ZZX& q) { // //special handling // //a is zero if a.rep.length() == 0; // q = NTL::ZZX(); -// } +// } q.rep.SetLength(p.degree() + 1); - + int i; Poly_1::const_iterator pit; for(i = 0, pit = p.begin(); pit != p.end(); pit++, i++) { @@ -91,7 +91,7 @@ void poly2ntl(const Poly_1& p, NTL::ZZX& q) { continue; if(sz < 0) sz = -sz; - + zz.SetSize(sz); NTL_bigint_rep *rep = (NTL_bigint_rep *)zz.rep; rep->size = tmp->_mp_size; @@ -132,7 +132,7 @@ Poly_1& Poly_1::operator *= (const Poly_1& p2) { Poly_1 p(TAG, p1.degree() + p2.degree() + 1); for (int i=0; i <= p1.degree(); ++i) for (int j=0; j <= p2.degree(); ++j) - p.coeff(i+j) += (p1[i]*p2[j]); + p.coeff(i+j) += (p1[i]*p2[j]); p.reduce(); // std::cout << "mul usual: " << p << "\n\n";; return (*this) = p ; @@ -156,33 +156,33 @@ Poly_1& Poly_1::operator *= (const Poly_1& p2) { mpz_t tmp; mpz_init(tmp); for(int i = 0; i <= d; i++) { - + const NTL::ZZ& zz = q.rep[i]; if(NTL::IsZero(zz)) { coeff(i) = Integer(0); continue; - } + } NTL_bigint_rep *rep = (NTL_bigint_rep *)zz.rep; int sz = rep->size; if(sz < 0) sz = -sz; - + mpz_realloc2(tmp, sz * GMP_NUMB_BITS); tmp->_mp_size = rep->size; memcpy(tmp->_mp_d, &rep->data, sz*sizeof(mp_limb_t)); - + // coeff(i).makeCopy(); // mpz_ptr mpd = coeff(i).get_mp(); // mpd->_mp_size = rep->size; // mpz_realloc2(mpd, sz * GMP_NUMB_BITS); // memcpy(mpd->_mp_d, &rep->data, sz*sizeof(mp_limb_t)); coeff(i) = Integer(tmp); - + // mpz_init_set(coeff(i).get_mp(), tmp); } mpz_clear(tmp); - + // CGALi::Creation_tag TAG; // Poly_1 p(TAG, p1.degree() + p2.degree() + 1); // for (int i=0; i <= p1.degree(); ++i) @@ -205,7 +205,7 @@ Poly_1& Poly_1::operator *= (const Poly_1& p2) { return (*this);// = pp; } -template <> +template <> Integer prs_resultant_ufd< Integer >(Poly_1 A, Poly_1 B) { #ifdef CGAL_ACK_BENCHMARK_RES @@ -229,14 +229,14 @@ res_tm.start(); if(NTL::IsZero(zz)) return Integer(0); - + Integer res; NTL_bigint_rep *rep = (NTL_bigint_rep *)zz.rep; int sz = rep->size; if(sz < 0) sz = -sz; - - mpz_ptr tmp = res.get_mp(); + + mpz_ptr tmp = res.get_mp(); mpz_realloc2(tmp, sz * GMP_NUMB_BITS); tmp->_mp_size = rep->size; memcpy(tmp->_mp_d, &rep->data, sz*sizeof(mp_limb_t)); @@ -253,7 +253,7 @@ res_tm.stop(); #else // CGAL_POLYNOMIAL_USE_NTL_MUL #if 0 -template <> +template <> Integer prs_resultant_ufd< Integer >(Poly_1 A, Poly_1 B) { #ifdef CGAL_ACK_BENCHMARK_RES @@ -287,7 +287,7 @@ res_tm.start(); delta = A.degree() - B.degree(); typedef CGAL::Algebraic_structure_traits::Is_exact Is_exact; - + A = B; B = R / (g * CGAL::ipower(h, delta)); g = A.lcoeff(); diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp index 9ff7d36d8fe1..3aa7f377f4b2 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp @@ -62,9 +62,9 @@ bool check_testsuite(int argc, char** argv) { int main (int argc, char** argv) { - if(check_testsuite(argc, argv)) + if(check_testsuite(argc, argv)) return 0; - + std::cerr << "This demo requires Qt!" << std::endl; return 0; } @@ -76,7 +76,7 @@ extern int n_rast_colors; extern Object_vector cad_objects, oc_objects, arr_objects; extern Object_vector* curr_objects; extern bool subdiv_layer_changed; - + extern Graphic_layer *subdiv_layer; extern Layers cad_layers, oc_layers, arr_layers; @@ -107,7 +107,7 @@ void xAlci_main_window::cad_curve_list_click() { if(fidx == i || sidx == i) if(cad_curve_list_selection[fidx] && - cad_curve_list_selection[sidx]) + cad_curve_list_selection[sidx]) cad_seg_list->setSelected(j, true); } } @@ -115,8 +115,8 @@ void xAlci_main_window::cad_curve_list_click() { cad_curve_list_selection[i]=false; for(int j = 0; j < static_cast(cad_seg_list->count()); j++) { if(cad_layers[j]->get_first_index() == i || - cad_layers[j]->get_second_index() == i) - cad_seg_list->setSelected(j,false); + cad_layers[j]->get_second_index() == i) + cad_seg_list->setSelected(j,false); } } } @@ -147,11 +147,11 @@ void xAlci_main_window::oc_switch_method(int index) void xAlci_main_window::arr_analyse_click() { arr_rasterize_btn->setEnabled(false); - + //CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); //std::scientific(std::cout); //std::cout.precision(10); - + std::vector temp_arr_curves; if(read_polys_from_file(arr_input->text(), std::back_inserter(temp_arr_curves))) { @@ -176,10 +176,10 @@ void xAlci_main_window::oc_analyse_click() widget->detach(*it); delete (*it); } - + oc_layers.clear(); oc_rasterize_btn->setEnabled(false); - + Poly_int2 f; if(!input_poly(f, oc_input->text().ascii())) return; @@ -189,11 +189,11 @@ void xAlci_main_window::oc_analyse_click() CGAL::Polynomial_traits_d< Poly_int2 >::Differentiate diff; - Poly_int2 fx = diff(f, 0), fxx = diff(f, 0), fxy = diff(fx, 1), + Poly_int2 fx = diff(f, 0), fxx = diff(f, 0), fxy = diff(fx, 1), fy = diff(f, 1), fyy = diff(fy, 1); Poly_int2 ress = fxx*fy*fy - ((fx*fy*fxy)*Poly_int1(2,0)) + fyy*fx*fx, res1 = f*fx, res2 = f*fy; - + CGAL::set_pretty_mode(std::cout); std::cout << "curv:\n " << ress << "\n\n"; std::cout << "fx:\n " << fx << "\n\n"; @@ -205,16 +205,16 @@ void xAlci_main_window::oc_analyse_click() std::cout << "f:\n " << f << "\n\n"; CGAL::set_pretty_mode(std::cout); std::cout << "f:\n " << f << "\n\n"; - + timer.reset(); timer.start(); - + // CGAL::res_tm.reset(); { Kernel_2::Construct_curve_2 cc_2 = kernel_2.construct_curve_2_object(); - + Lbegin: try { Curve_analysis_2 curve = cc_2(f); @@ -234,11 +234,11 @@ void xAlci_main_window::oc_analyse_click() // std::cout << "\nResultant time: " << CGAL::res_tm.time() << "\n"; std::cout << oc_objects.size() << " arcs found (incl isolated points)" << std::endl; - + Object_vector::const_iterator oit; Arc_2 arc; Point_2 pt; - + for(oit = oc_objects.begin(), i = 0; oit != oc_objects.end(); oit++, i++) { @@ -260,8 +260,8 @@ void xAlci_main_window::oc_analyse_click() oc_layers[i]->deactivate(); } //subdiv_renderer.set_polynomial(f); - - } + + } subdiv_layer_changed = true; //layers.push_back(new Graphic_layer(-1,widget)); @@ -274,29 +274,29 @@ void xAlci_main_window::cad_partial_selection_click() std::vector temp_cad_curves; if(read_polys_from_file(cad_input->text(), std::back_inserter(temp_cad_curves))) { - + cad_curves = temp_cad_curves; std::stringstream strstr; - strstr << "Choose polynomials (" << cad_curves.size() + strstr << "Choose polynomials (" << cad_curves.size() << " in total)"; curve_selection_dialog = new Curve_selection_dialog(central_widget,tr(strstr.str().c_str()), false, cad_curves.begin(), cad_curves.end()); - + curve_selection_dialog->setCaption(tr(strstr.str().c_str())); int sel_res = curve_selection_dialog->exec(); - + if(sel_res==QDialog::Accepted) { - + QListBox* curve_selection = curve_selection_dialog->curve_list; std::vector::iterator curve_it = cad_curves.begin(); int n = static_cast(cad_curves.size()); CGAL_assertion(n==curve_selection->numRows()); - + for(int i=0;iisSelected(i)) + if(!curve_selection->isSelected(i)) curve_it = cad_curves.erase(curve_it); - else + else curve_it++; } CGAL_assertion(curve_it == cad_curves.end()); @@ -309,10 +309,10 @@ void xAlci_main_window::cad_partial_selection_click() void xAlci_main_window::arr_partial_selection_click() { std::vector temp_arr_curves; - + if(read_polys_from_file(arr_input->text(), std::back_inserter(temp_arr_curves))) { - + if(arr_method->selectedId() == -1) { QMessageBox::warning(this, "Error", "No Sweep-line method specified", 0); @@ -322,7 +322,7 @@ void xAlci_main_window::arr_partial_selection_click() arr_curves = temp_arr_curves; std::stringstream strstr; strstr << "Choose polynomials (" << arr_curves.size() << " in total)"; - + curve_selection_dialog = new Curve_selection_dialog(central_widget, tr(strstr.str().c_str()), false, arr_curves.begin(), arr_curves.end()); @@ -338,9 +338,9 @@ void xAlci_main_window::arr_partial_selection_click() CGAL_assertion(n==curve_selection->numRows()); for(int i = 0; i < n; i++) { - if(!curve_selection->isSelected(i)) + if(!curve_selection->isSelected(i)) curve_it = arr_curves.erase(curve_it); - else + else curve_it++; } CGAL_assertion(curve_it == arr_curves.end()); @@ -372,7 +372,7 @@ bool xAlci_main_window::read_polys_from_file(QString filename, int g = ifstr.get(); if(g=='P') { ifstr.putback(g); - ifstr >> f; + ifstr >> f; *out++ = f; } } @@ -389,7 +389,7 @@ void xAlci_main_window::cad_to_segments() { it++) { widget->detach(*it); delete (*it); - } + } cad_layers.clear(); typedef std::vector Curve_vector; @@ -398,7 +398,7 @@ void xAlci_main_window::cad_to_segments() { std::vector > arc_info, inter_info, s_arcs_info; int curve_count = 0; - + typedef Kernel_2::Curve_pair_analysis_2 Curve_pair_analysis_2; typedef Curve_pair_analysis_2::Status_line_1 Status_line_1; @@ -406,17 +406,17 @@ void xAlci_main_window::cad_to_segments() { Kernel_2::Construct_curve_pair_2 ccp_2 = kernel_2.construct_curve_pair_2_object(); CKvA_2::Make_x_monotone_2 make_x_monotone(&CKvA_2::instance()); - + int n = static_cast(cad_curves.size()); int number_of_steps = n + n*(n-1)/2; timer.reset(); timer.start(); - + QProgressDialog* progress = new QProgressDialog( tr("Please wait"), tr("Abort"), number_of_steps, this, "Progress", true); - + progress->setCaption("Analyse curves"); connect(progress,SIGNAL(canceled),SLOT(cancel)); progress->show(); @@ -428,7 +428,7 @@ void xAlci_main_window::cad_to_segments() { Curve_analysis_2 curve = cc_2(make_square_free(cad_curves[j])); progress->setProgress(progress_count++); - + int arc_before = arcs.size(), arc_no; make_x_monotone(curve, std::back_inserter(arcs)); arc_no = arcs.size() - arc_before; @@ -440,15 +440,15 @@ void xAlci_main_window::cad_to_segments() { for(int i = 0; i < arc_no; i++) arc_info.push_back(std::make_pair(curve_count,curve_count)); - -// int curve_int_count=0; + +// int curve_int_count=0; for(Curve_vector::const_iterator cit = curves.begin(); cit != curves.end(); cit++) { //#warning "cad2segments is temporary (or permanently ?) out of service" /* if(progress->wasCanceled()) break; - + Curve_pair_analysis_2 cpa; try { cpa = ccp_2(curve, *cit); @@ -458,15 +458,15 @@ void xAlci_main_window::cad_to_segments() { progress_count++; continue; } - + Poly_int2 no_content, q, r, pair_gcd = NiX::gcd( curve._internal_curve().f_primitive(), cit->_internal_curve().f_primitive()); - + Poly_int1 d, pair_content = NiX::gcd( curve._internal_curve().content(), cit->_internal_curve().content()); - + Poly_int2::euclidean_division(cit->polynomial_2(), pair_gcd, q, r); @@ -478,7 +478,7 @@ void xAlci_main_window::cad_to_segments() { Curve_pair_analysis_2::Status_line_1 cpa_line = cpa.status_line_at_event(i); - + if(!cpa_line.is_intersection()) continue; @@ -487,7 +487,7 @@ void xAlci_main_window::cad_to_segments() { curve.status_line_for_x(x0); for(int j = 0; j < sline.number_of_events(); j++) { - + int pair_idx = cpa_line.event_of_curve(j, 0); Status_line_1::Arc_pair pair = cpa_line.curves_at_event(pair_idx); @@ -515,35 +515,35 @@ void xAlci_main_window::cad_to_segments() { } else { CGAL_assertion(progress_count == number_of_steps); } - + delete progress; timer.stop(); std::cout << "\n\nAnalyse elapsed time: " << timer.time() << std::endl; std::cout << arcs.size() << " arcs found" << std::endl; - + CGAL_assertion(arcs.size() == arc_info.size()); - + std::cout << intersections.size() << " intersections found" << std::endl; CGAL_assertion(intersections.size() == inter_info.size()); - + std::copy(arcs.begin(), arcs.end(), std::back_inserter(cad_objects)); - + std::copy(arc_info.begin(), arc_info.end(), std::back_inserter(s_arcs_info)); std::copy(intersections.begin(), intersections.end(), std::back_inserter(cad_objects)); - + std::copy(inter_info.begin(), inter_info.end(), std::back_inserter(s_arcs_info)); Color_map color_map; - + int i = 0; Point_2 pt; Arc_2 arc; - + for(Object_vector::const_iterator oit = cad_objects.begin(); oit != cad_objects.end(); oit++, i++) { @@ -565,7 +565,7 @@ void xAlci_main_window::cad_to_segments() { cad_layers[i]->deactivate(); } - + cad_rasterize_btn->setEnabled(cad_complete_check->isChecked()); widget->redraw(); } @@ -579,12 +579,12 @@ void xAlci_main_window::arr_compute_arrangement() { it++) { widget->detach(*it); delete (*it); - } + } arr_layers.clear(); - + timer.reset(); timer.start(); - + Kernel_2::Construct_curve_2 cc_2 = kernel_2.construct_curve_2_object(); typedef std::vector Curve_vector; @@ -602,19 +602,19 @@ void xAlci_main_window::arr_compute_arrangement() { if(arr_method->selectedId()==0) { #if 0 #ifdef CGAL_USE_LEDA - + typedef Arrangement_2::SoX_Arrangement_2 Leda_graph_2; - + Leda_graph_2 leda_graph_2; - + arrangement(segments.begin(), segments.end(), leda_graph_2, true, GAPS_2_inst()); - + timer.stop(); - + std::cout << "\n\nAnalyse elapsed time: " << timer.time() << std::endl; int i=0; std::stringstream strstr1; @@ -634,7 +634,7 @@ void xAlci_main_window::arr_compute_arrangement() { out_point(p,buf); arr_node_list->insertItem(buf.str()); arr_layers.push_back(new Graphic_layer(i,widget,static_cast(0),static_cast(0),random_color())); - arr_layers[i]->deactivate(); + arr_layers[i]->deactivate(); arr_objects.push_back(Arc_2(p)); i++; } @@ -651,9 +651,9 @@ void xAlci_main_window::arr_compute_arrangement() { if(std::find(arr_objects.begin(), arr_objects.end(), seg)==arr_objects.end()) { - - //if(true) { - buf << "from: "; + + //if(true) { + buf << "from: "; out_point(seg.source(), buf); buf << " to: "; out_point(seg.target(), buf); @@ -663,12 +663,12 @@ void xAlci_main_window::arr_compute_arrangement() { buf << " vertical"; arr_edge_list->insertItem(buf.str()); arr_layers.push_back(new Graphic_layer(i,widget,static_cast(0),static_cast(0),random_color())); - arr_layers[i]->deactivate(); + arr_layers[i]->deactivate(); arr_objects.push_back(seg); i++; } } - + #endif // CGAL_USE_LEDA #endif } else if(arr_method->selectedId()==1) { @@ -677,7 +677,7 @@ void xAlci_main_window::arr_compute_arrangement() { Arrangement arr; CGAL::insert(arr, curves.begin(), curves.end(), boost::false_type()); - + timer.stop(); std::cout << "\n\nAnalyse elapsed time: " << timer.time() << std::endl; @@ -691,9 +691,9 @@ void xAlci_main_window::arr_compute_arrangement() { arr.number_of_isolated_vertices()) << " in total):"; arr_edge_label->setText(outs2.str()); arr_edge_label->update(); - + Color_map color_map; - + int i = 0, cindex; for(Arrangement::Vertex_const_iterator vit = arr.vertices_begin(); vit != arr.vertices_end(); vit++) { @@ -706,15 +706,15 @@ void xAlci_main_window::arr_compute_arrangement() { arr_node_list->insertItem(os.str()); continue; } - + os << "; isolated"; arr_edge_list->insertItem(os.str()); #if !XALCI_USE_FLAT_COLOR_SCHEME - cindex = i; + cindex = i; #else cindex = pick_color(pt.curve().id(), color_map); -#endif - +#endif + arr_layers.push_back(new Graphic_layer(widget, i, cindex)); arr_layers[i]->deactivate(); arr_objects.push_back(CGAL::make_object(pt)); @@ -729,7 +729,7 @@ void xAlci_main_window::arr_compute_arrangement() { print_arc(arc, os); arr_edge_list->insertItem(os.str()); -#if !XALCI_USE_FLAT_COLOR_SCHEME +#if !XALCI_USE_FLAT_COLOR_SCHEME cindex = i; #else cindex = pick_color(arc.curve().id(), color_map); @@ -765,7 +765,7 @@ void xAlci_main_window::visualize() void xAlci_main_window::cad_analyse_click() { cad_rasterize_btn->setEnabled(false); - + // CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); //std::scientific(std::cout); //std::cout.precision(10); @@ -773,7 +773,7 @@ void xAlci_main_window::cad_analyse_click() if(read_polys_from_file(cad_input->text(), std::back_inserter(temp_cad_curves))) { - + cad_curves = temp_cad_curves; cad_to_segments(); } @@ -782,19 +782,19 @@ void xAlci_main_window::cad_analyse_click() void xAlci_main_window::tab_changed(QWidget*) { Layers *detach[2], *attach; - + if(tab_widget->currentPage() == cad_tab) { curr_objects = &cad_objects; attach = &cad_layers; detach[0] = &oc_layers; detach[1] = &arr_layers; - + } else if(tab_widget->currentPage() == one_curve_tab) { curr_objects = &oc_objects; attach = &oc_layers; detach[0] = &cad_layers; detach[1] = &arr_layers; - + } else { curr_objects = &arr_objects; attach = &arr_layers; diff --git a/Arrangement_on_surface_2/archive/include/CGAL/Arr_extended_rational_arc_traits_d_1.h b/Arrangement_on_surface_2/archive/include/CGAL/Arr_extended_rational_arc_traits_d_1.h index 1100ab29927e..a4c447248b1a 100644 --- a/Arrangement_on_surface_2/archive/include/CGAL/Arr_extended_rational_arc_traits_d_1.h +++ b/Arrangement_on_surface_2/archive/include/CGAL/Arr_extended_rational_arc_traits_d_1.h @@ -46,7 +46,7 @@ namespace CGAL { # define Min_bounded(ver) \ ( ((ver).min_parameter_space() == ARR_BOTTOM_BOUNDARY ) ? false : true ) - + template class Arr_traits_with_vertical_segments @@ -54,30 +54,30 @@ class Arr_traits_with_vertical_segments public: typedef Traits_ Traits; typedef Arr_traits_with_vertical_segments Self; - + typedef typename Traits::Algebraic_kernel_d_1 Algebraic_kernel_d_1; typedef typename Traits::Point_2 Point_2; typedef typename Traits::Multiplicity Multiplicity; typedef typename Traits::Algebraic_real_1 Algebraic_real_1; typedef typename Traits::Rat_vector Rat_vector; - typedef typename Traits::Coefficient Coefficient; + typedef typename Traits::Coefficient Coefficient; typedef typename Traits::Integer Integer; - typedef typename Traits::Rational Rational; - typedef typename Traits::Polynomial_1 Polynomial_1; + typedef typename Traits::Rational Rational; + typedef typename Traits::Polynomial_1 Polynomial_1; typedef typename Traits::Rational_function Rational_function; - + typedef typename Traits::X_monotone_curve_2 Non_vertical_x_curve_2; typedef typename Traits::Curve_2 Non_vertical_curve_2; typedef typename Traits::Vertical_segment Vertical_segment; - typedef Arr_vertical_rational_arc::Rational_arc_with_ver_d_1 + typedef Arr_vertical_rational_arc::Rational_arc_with_ver_d_1 X_monotone_curve_2; - typedef Arr_vertical_rational_arc::Rational_arc_with_ver_d_1 + typedef Arr_vertical_rational_arc::Rational_arc_with_ver_d_1 Curve_2; - + //Category tags: typedef Tag_true Has_left_category; typedef Tag_true Has_merge_category; @@ -112,17 +112,17 @@ class Arr_traits_with_vertical_segments Construct_point_2 (Traits& traits) :_traits(traits) {} Point_2 operator() (const Rational_function& rational_function, const Algebraic_real_1& x_coordinate) - { + { return _traits.construct_point_2_object()(rational_function,x_coordinate); } Point_2 operator() (const Rational& x,const Rational& y) - { + { return _traits.construct_point_2_object()(x,y); } Point_2 operator() (const Algebraic_real_1& x,const Rational& y) { return _traits.construct_point_2_object()(x,y); - } + } }; //Construct_point_2 Construct_point_2 construct_point_2_object() const {return Construct_point_2(_traits);} @@ -132,7 +132,7 @@ class Arr_traits_with_vertical_segments private: Traits& _traits; public: - Construct_vertical_x_curve_2(Traits& traits) + Construct_vertical_x_curve_2(Traits& traits) :_traits(traits) {} @@ -175,7 +175,7 @@ class Arr_traits_with_vertical_segments { return _traits.construct_vertical_segment_object()(p,is_directed_up); } - + }; //Construct_vertical_curve_2 Construct_vertical_curve_2 construct_vertical_curve_2_object () const @@ -185,48 +185,48 @@ class Arr_traits_with_vertical_segments class Construct_curve_2 { - private: + private: typedef typename Traits::Algebraic_real_1 Algebraic_real_1; Traits& _traits; public: - Construct_curve_2 (Traits& traits) + Construct_curve_2 (Traits& traits) :_traits(traits) {} template Curve_2 operator() (InputIterator begin, InputIterator end) const { - return _traits.construct_curve_2_object()(begin,end); + return _traits.construct_curve_2_object()(begin,end); } template Curve_2 operator() (InputIterator begin, InputIterator end,const Algebraic_real_1& x_s, bool dir_right) const { - return _traits.construct_curve_2_object()(begin,end,x_s,dir_right); + return _traits.construct_curve_2_object()(begin,end,x_s,dir_right); } template Curve_2 operator() (InputIterator begin, InputIterator end, const Algebraic_real_1& x_s, const Algebraic_real_1& x_t) const { - return _traits.construct_curve_2_object()(begin,end,x_s,x_t); + return _traits.construct_curve_2_object()(begin,end,x_s,x_t); } template Curve_2 operator() (InputIterator begin_numer, InputIterator end_numer, - InputIterator begin_denom, InputIterator end_denom) const + InputIterator begin_denom, InputIterator end_denom) const { - return _traits.construct_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom); + return _traits.construct_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom); } template Curve_2 operator() (InputIterator begin_numer, InputIterator end_numer, InputIterator begin_denom, InputIterator end_denom, const Algebraic_real_1& x_s, bool dir_right) const { - return _traits.construct_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,dir_right); + return _traits.construct_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,dir_right); } template Curve_2 operator() (InputIterator begin_numer, InputIterator end_numer, InputIterator begin_denom, InputIterator end_denom, const Algebraic_real_1& x_s, const Algebraic_real_1& x_t) const { - return _traits.construct_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,x_t); + return _traits.construct_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,x_t); } }; //Construct_rational_curve_2 @@ -236,7 +236,7 @@ class Arr_traits_with_vertical_segments } class Construct_x_monotone_curve_2 { - private: + private: typedef typename Traits::Algebraic_real_1 Algebraic_real_1; Traits& _traits; public: @@ -246,39 +246,39 @@ class Arr_traits_with_vertical_segments template X_monotone_curve_2 operator() (InputIterator begin, InputIterator end) const { - return _traits.construct_x_monotone_curve_2_object()(begin,end); + return _traits.construct_x_monotone_curve_2_object()(begin,end); } template X_monotone_curve_2 operator() ( InputIterator begin, InputIterator end, const Algebraic_real_1& x_s, bool dir_right) const { - return _traits.construct_x_monotone_curve_2_object()(begin,end,x_s,dir_right); + return _traits.construct_x_monotone_curve_2_object()(begin,end,x_s,dir_right); } template X_monotone_curve_2 operator() (InputIterator begin, InputIterator end, const Algebraic_real_1& x_s, const Algebraic_real_1& x_t) const { - return _traits.construct_x_monotone_curve_2_object()(begin,end,x_s,x_t); + return _traits.construct_x_monotone_curve_2_object()(begin,end,x_s,x_t); } template X_monotone_curve_2 operator() ( InputIterator begin_numer, InputIterator end_numer, - InputIterator begin_denom, InputIterator end_denom) const + InputIterator begin_denom, InputIterator end_denom) const { - return _traits.construct_x_monotone_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom); + return _traits.construct_x_monotone_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom); } template X_monotone_curve_2 operator() ( InputIterator begin_numer, InputIterator end_numer, InputIterator begin_denom, InputIterator end_denom, const Algebraic_real_1& x_s, bool dir_right) const { - return _traits.construct_x_monotone_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,dir_right); + return _traits.construct_x_monotone_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,dir_right); } template X_monotone_curve_2 operator() ( InputIterator begin_numer, InputIterator end_numer, InputIterator begin_denom, InputIterator end_denom, const Algebraic_real_1& x_s, const Algebraic_real_1& x_t) const { - return _traits.construct_x_monotone_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,x_t); + return _traits.construct_x_monotone_curve_2_object()(begin_numer, end_numer,begin_denom,end_denom,x_s,x_t); } }; //Construct_rational_x_curve_2 @@ -291,7 +291,7 @@ class Arr_traits_with_vertical_segments //------------------------ //--------------------------------------------------------------- - //A functor that compares the x-coordinates of two points + //A functor that compares the x-coordinates of two points class Compare_x_2 { private: @@ -339,7 +339,7 @@ class Arr_traits_with_vertical_segments /*! A functor that obtains the left endpoint of a curve. */ class Construct_min_vertex_2 - { + { private: Traits& _traits; public: @@ -457,7 +457,7 @@ class Arr_traits_with_vertical_segments class Compare_y_at_x_2 { private: - Traits& _traits; + Traits& _traits; public: Compare_y_at_x_2(Traits& traits) : _traits(traits) {} /*! @@ -488,10 +488,10 @@ class Arr_traits_with_vertical_segments } Comparison_result operator() (const Vertical_segment & cv) const { - CGAL_precondition(_traits.compare_x_2_object()(_p,cv.max()) == CGAL::EQUAL); + CGAL_precondition(_traits.compare_x_2_object()(_p,cv.max()) == CGAL::EQUAL); typename Traits::Compare_xy_2 compare_xy_2 = _traits.compare_xy_2_object(); - + if (Is_line(cv)) return CGAL::EQUAL; if ((Max_bounded(cv)) && (!Min_bounded(cv)) ) @@ -535,7 +535,7 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Compare_y_at_x_left_2_visitor(Traits& traits,const Point_2& p) + Compare_y_at_x_left_2_visitor(Traits& traits,const Point_2& p) : _traits(traits), _p(p), Base() {} Comparison_result operator() (const Non_vertical_x_curve_2 & cv1, const Non_vertical_x_curve_2 & cv2) const @@ -570,7 +570,7 @@ class Arr_traits_with_vertical_segments /*! A functor that compares compares the y-coordinates of two curves * immediately to the left of their intersection point. */ - + /*! A functor that checks whether two points and two curves are identical. */ class Equal_2 { @@ -601,34 +601,34 @@ class Arr_traits_with_vertical_segments if (&p1 == &p2) return (true); return _traits.equal_2_object() (p1,p2); - + } private: class Equal_2_visitor : public boost::static_visitor { private: - typedef boost::static_visitor Base; + typedef boost::static_visitor Base; Traits& _traits; public: Equal_2_visitor(Traits& traits) : _traits(traits), Base() {} bool operator() (const Non_vertical_x_curve_2& cv1, - const Non_vertical_x_curve_2& cv2) const + const Non_vertical_x_curve_2& cv2) const { return _traits.equal_2_object() (cv1,cv2); } bool operator() (const Non_vertical_x_curve_2& cv1, - const Vertical_segment & cv2) const + const Vertical_segment & cv2) const { - return false; + return false; } bool operator() (const Vertical_segment & cv1, - const Non_vertical_x_curve_2& cv2) const + const Non_vertical_x_curve_2& cv2) const { - return false; + return false; } bool operator() (const Vertical_segment & cv1, - const Vertical_segment & cv2) const + const Vertical_segment & cv2) const { if (&cv1 == &cv2) return (true); @@ -648,7 +648,7 @@ class Arr_traits_with_vertical_segments if (Min_bounded(cv1) && Min_bounded(cv2)) return (_traits.equal_2_object() (cv1.min(),cv2.min() )); - + return false; } }; //Equal_2_visitor @@ -663,12 +663,12 @@ class Arr_traits_with_vertical_segments /*! A functor that divides a curve into continues (x-monotone) curves. */ class Make_x_monotone_2 { - private: + private: Traits& _traits; public: Make_x_monotone_2(Traits& traits) : _traits(traits) {} template - OutputIterator operator() (const Curve_2& cv, OutputIterator oi) const + OutputIterator operator() (const Curve_2& cv, OutputIterator oi) const { Object_vector res (boost::apply_visitor(Make_x_monotone_2_visitor(_traits),cv.variant())); re_cast_object_vector(res,oi); @@ -679,17 +679,17 @@ class Arr_traits_with_vertical_segments : public boost::static_visitor < Object_vector > { private: - typedef boost::static_visitor Base; + typedef boost::static_visitor Base; Traits& _traits; public: Make_x_monotone_2_visitor(Traits& traits) : _traits(traits), Base() {} - Object_vector operator() (const Non_vertical_curve_2& cv) const + Object_vector operator() (const Non_vertical_curve_2& cv) const { Object_vector vec; _traits.make_x_monotone_2_object() (cv,std::back_inserter(vec)); return vec; } - Object_vector operator() (const Vertical_segment & cv) const + Object_vector operator() (const Vertical_segment & cv) const { Object_vector vec; vec.push_back(make_object (Vertical_segment(cv))); @@ -734,7 +734,7 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Split_2_visitor(Traits& traits,const Point_2 & p) + Split_2_visitor(Traits& traits,const Point_2 & p) : _traits(traits),_p(p), Base() {} Res_type operator() (const Non_vertical_x_curve_2& cv) const { @@ -742,9 +742,9 @@ class Arr_traits_with_vertical_segments _traits.split_2_object() (cv,_p,_c1,_c2); return Res_type(_c1,_c2); } - Res_type operator() (const Vertical_segment & cv) const + Res_type operator() (const Vertical_segment & cv) const { - typename Traits::Construct_vertical_segment + typename Traits::Construct_vertical_segment construct_vertical_segment = _traits.construct_vertical_segment_object(); Vertical_segment _c1,_c2; if (Is_line(cv)) @@ -785,7 +785,7 @@ class Arr_traits_with_vertical_segments class Intersect_2 { private: - Traits& _traits; + Traits& _traits; public: /*! * Find the intersections of the two given curves and insert them to the @@ -800,7 +800,7 @@ class Arr_traits_with_vertical_segments template OutputIterator operator() ( const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2, - OutputIterator oi) const + OutputIterator oi) const { Object_vector res (boost::apply_visitor(Intersect_2_visitor(_traits),cv1.variant(),cv2.variant())); re_cast_object_vector(res,oi); @@ -814,12 +814,12 @@ class Arr_traits_with_vertical_segments typedef boost::static_visitor Base; Traits& _traits; public: - Intersect_2_visitor(Traits& traits) + Intersect_2_visitor(Traits& traits) : _traits(traits), Base() {} //intersection of two Non_vertical_x_curve_2 Object_vector operator() (const Non_vertical_x_curve_2& cv1, - const Non_vertical_x_curve_2& cv2) const + const Non_vertical_x_curve_2& cv2) const { Object_vector vec; _traits.intersect_2_object() (cv1,cv2,std::back_inserter(vec)); @@ -827,7 +827,7 @@ class Arr_traits_with_vertical_segments } //intersection of a Non_vertical_x_curve_2 and a Vertical_segment Object_vector operator() (const Vertical_segment& cv1, - const Non_vertical_x_curve_2& cv2) const + const Non_vertical_x_curve_2& cv2) const { Object_vector vec; _traits.intersect_2_object() (cv2,cv1,std::back_inserter(vec)); @@ -835,7 +835,7 @@ class Arr_traits_with_vertical_segments } //intersection of a Non_vertical_x_curve_2 and a Vertical_segment Object_vector operator() (const Non_vertical_x_curve_2& cv1, - const Vertical_segment& cv2) const + const Vertical_segment& cv2) const { Object_vector vec; _traits.intersect_2_object() (cv1,cv2,std::back_inserter(vec)); @@ -843,7 +843,7 @@ class Arr_traits_with_vertical_segments } //intersection of two Vertical_segment Object_vector operator() (const Vertical_segment& cv1, - const Vertical_segment& cv2) const + const Vertical_segment& cv2) const { Object_vector vec; CGAL::Object object; @@ -853,7 +853,7 @@ class Arr_traits_with_vertical_segments object = make_object(Vertical_segment(cv2)); else if (Is_line(cv2)) object = make_object(Vertical_segment(cv1)); - + if (object.empty() == false) { vec.push_back(object); @@ -885,9 +885,9 @@ class Arr_traits_with_vertical_segments Object_vector intersect_ray_ray ( const Vertical_segment& ray1, const Vertical_segment& ray2) const { - typename Traits::Compare_xy_2 + typename Traits::Compare_xy_2 compare_xy_2 = _traits.compare_xy_2_object(); - typename Traits::Construct_vertical_segment + typename Traits::Construct_vertical_segment construct_vertical_segment = _traits.construct_vertical_segment_object(); CGAL_precondition (Is_ray(ray1)); @@ -943,10 +943,10 @@ class Arr_traits_with_vertical_segments { CGAL_precondition (Is_ray(ray)); CGAL_precondition (Is_segment(seg)); - - typename Traits::Compare_xy_2 + + typename Traits::Compare_xy_2 compare_xy_2 = _traits.compare_xy_2_object(); - typename Traits::Construct_vertical_segment + typename Traits::Construct_vertical_segment construct_vertical_segment = _traits.construct_vertical_segment_object(); Object_vector vec; @@ -958,7 +958,7 @@ class Arr_traits_with_vertical_segments Comparison_result cr = compare_xy_2 (ray.min(),seg.min()); if (cr != LARGER) object = make_object (seg); - else + else { cr = compare_xy_2 (ray.min(),seg.max()); if (cr == LARGER) @@ -975,7 +975,7 @@ class Arr_traits_with_vertical_segments Comparison_result cr = compare_xy_2 (ray.max(),seg.max()); if (cr != SMALLER) object = make_object (seg); - else + else { cr = compare_xy_2 (ray.max(),seg.min()); if (cr == SMALLER) @@ -996,11 +996,11 @@ class Arr_traits_with_vertical_segments CGAL_precondition (Is_segment(seg1)); CGAL_precondition (Is_segment(seg2)); - typename Traits::Compare_xy_2 + typename Traits::Compare_xy_2 compare_xy_2 = _traits.compare_xy_2_object(); - typename Traits::Construct_vertical_segment + typename Traits::Construct_vertical_segment construct_vertical_segment = _traits.construct_vertical_segment_object(); - + Object_vector vec; CGAL::Object object; @@ -1015,18 +1015,18 @@ class Arr_traits_with_vertical_segments Comparison_result cr1 = compare_xy_2 (seg1.min(),seg2.min()); Comparison_result cr2 = compare_xy_2 (seg1.max(),seg2.max()); - if ( (cr1 == CGAL::LARGER ) && + if ( (cr1 == CGAL::LARGER ) && (cr2 == CGAL::LARGER ) ) object = make_object (construct_vertical_segment(seg1.min(),seg2.max())); - else if ( (cr1 == CGAL::LARGER ) && + else if ( (cr1 == CGAL::LARGER ) && (cr2 == CGAL::SMALLER ) ) object = make_object (construct_vertical_segment(seg1.min(),seg1.max())); - else if ( (cr1 == CGAL::SMALLER) && + else if ( (cr1 == CGAL::SMALLER) && (cr2 == CGAL::LARGER ) ) object = make_object (construct_vertical_segment(seg2.min(),seg2.max())); else //SMALLER,SMALLER object = make_object (construct_vertical_segment(seg2.min(),seg1.max())); - + vec.push_back(object); return vec; } @@ -1063,10 +1063,10 @@ class Arr_traits_with_vertical_segments : public boost::static_visitor { private: - typedef boost::static_visitor Base; + typedef boost::static_visitor Base; Traits& _traits; public: - Are_mergeable_2_visitor(Traits& traits) + Are_mergeable_2_visitor(Traits& traits) : _traits(traits), Base() {} bool operator() ( const Non_vertical_x_curve_2& cv1, const Non_vertical_x_curve_2& cv2) const @@ -1099,7 +1099,7 @@ class Arr_traits_with_vertical_segments if (_traits.equal_2_object()(cv1.min(),cv2.min())) return true; } - //try to merge at minimum and maximum + //try to merge at minimum and maximum if ((Max_bounded(cv1)) && (Min_bounded(cv2))) { res = (_traits.equal_2_object()(cv1.max(),cv2.min())); @@ -1138,7 +1138,7 @@ class Arr_traits_with_vertical_segments const X_monotone_curve_2& cv2, X_monotone_curve_2& c) const { - c = boost::apply_visitor(Merge_2_visitor(_traits),cv1.variant(),cv2.variant()); + c = boost::apply_visitor(Merge_2_visitor(_traits),cv1.variant(),cv2.variant()); return; } private: @@ -1146,7 +1146,7 @@ class Arr_traits_with_vertical_segments : public boost::static_visitor { private: - typedef boost::static_visitor Base; + typedef boost::static_visitor Base; Traits& _traits; public: Merge_2_visitor(Traits& traits) : _traits(traits), Base() {} @@ -1169,14 +1169,14 @@ class Arr_traits_with_vertical_segments } X_monotone_curve_2 operator() (const Vertical_segment& cv1,const Vertical_segment& cv2) const { - typename Traits::Construct_vertical_segment + typename Traits::Construct_vertical_segment construct_vertical_segment = _traits.construct_vertical_segment_object(); - typename Traits::Compare_xy_2 + typename Traits::Compare_xy_2 compare_xy_2 = _traits.compare_xy_2_object(); Vertical_segment _c; - if ((Max_bounded(cv1)) && + if ((Max_bounded(cv1)) && (Max_bounded(cv2)) && (compare_xy_2(cv1.max() , cv2.max()) == CGAL::EQUAL)) { @@ -1189,7 +1189,7 @@ class Arr_traits_with_vertical_segments return _c; } - if ((Min_bounded(cv1)) && + if ((Min_bounded(cv1)) && (Min_bounded(cv2)) && (compare_xy_2(cv1.min() , cv2.min()) == CGAL::EQUAL)) { @@ -1202,7 +1202,7 @@ class Arr_traits_with_vertical_segments return _c; } - if ((Max_bounded(cv1)) && + if ((Max_bounded(cv1)) && (Min_bounded(cv2)) && (compare_xy_2(cv1.max() , cv2.min()) == CGAL::EQUAL)) { @@ -1261,7 +1261,7 @@ class Arr_traits_with_vertical_segments { return (boost::apply_visitor(Parameter_space_in_x_2_visitor(_traits,ce),xcv.variant())); } - + /*! Obtains the parameter space at a point along the x-axis. * \param p the point. * \return the parameter space at p. @@ -1276,7 +1276,7 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Parameter_space_in_x_2_visitor(Traits& traits,Arr_curve_end ce) + Parameter_space_in_x_2_visitor(Traits& traits,Arr_curve_end ce) :_traits(traits), _ce(ce), Base() {} Arr_parameter_space operator()(const Non_vertical_x_curve_2& xcv ) const { @@ -1295,14 +1295,14 @@ class Arr_traits_with_vertical_segments /*! Obtain a Parameter_space_in_x_2 function object */ Parameter_space_in_x_2 parameter_space_in_x_2_object() const - { - return Parameter_space_in_x_2(_traits); + { + return Parameter_space_in_x_2(_traits); } - + /*! A function object that obtains the parameter space of a geometric * entity along the y-axis */ - class Parameter_space_in_y_2 + class Parameter_space_in_y_2 { private: Traits& _traits; @@ -1339,14 +1339,14 @@ class Arr_traits_with_vertical_segments //{ // return ARR_INTERIOR; //} - + private: class Parameter_space_in_y_2_visitor : public boost::static_visitor { public: typedef boost::static_visitor Base; - Parameter_space_in_y_2_visitor(Traits& traits,Arr_curve_end ce) + Parameter_space_in_y_2_visitor(Traits& traits,Arr_curve_end ce) :_traits(traits),_ce(ce), Base() {} Arr_parameter_space operator()(const Non_vertical_x_curve_2& xcv ) const { @@ -1384,7 +1384,7 @@ class Arr_traits_with_vertical_segments * defined (lexicographically) to its right. * \return The relative position of cv1 with respect to cv2 immdiately to * the right of p: SMALLER, LARGER or EQUAL. - */ + */ Compare_y_at_x_right_2 (Traits& traits) : _traits(traits) {} Comparison_result operator() (const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2, @@ -1398,27 +1398,27 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Compare_y_at_x_right_2_visitor(Traits& traits,const Point_2& p) + Compare_y_at_x_right_2_visitor(Traits& traits,const Point_2& p) : _traits(traits), _p(p), Base() {} Comparison_result operator() (const Non_vertical_x_curve_2& cv1, - const Non_vertical_x_curve_2& cv2) const + const Non_vertical_x_curve_2& cv2) const { return _traits.compare_y_at_x_right_2_object() (cv1,cv2,_p); } Comparison_result operator() (const Non_vertical_x_curve_2& cv1, - const Vertical_segment & cv2) const + const Vertical_segment & cv2) const { return CGAL::SMALLER; } Comparison_result operator() (const Vertical_segment & cv1, - const Non_vertical_x_curve_2& cv2) const + const Non_vertical_x_curve_2& cv2) const { return CGAL::LARGER; } Comparison_result operator() (const Vertical_segment & cv1, - const Vertical_segment & cv2) const + const Vertical_segment & cv2) const { - return CGAL::EQUAL; //test bug fix + return CGAL::EQUAL; //test bug fix } private: Traits& _traits; @@ -1432,14 +1432,14 @@ class Arr_traits_with_vertical_segments { return Compare_y_at_x_right_2(_traits); } - class Compare_x_near_limit_2 + class Compare_x_near_limit_2 { private: Traits& _traits; public: Compare_x_near_limit_2 (Traits& traits) : _traits(traits) {} - Comparison_result operator()( const X_monotone_curve_2& xcv1, - const X_monotone_curve_2& xcv2, + Comparison_result operator()( const X_monotone_curve_2& xcv1, + const X_monotone_curve_2& xcv2, Arr_curve_end ce) const { return (boost::apply_visitor(Compare_x_near_limit_2_visitor(_traits,ce),xcv1.variant(),xcv2.variant())); @@ -1450,14 +1450,14 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Compare_x_near_limit_2_visitor(Traits& traits,Arr_curve_end ce) + Compare_x_near_limit_2_visitor(Traits& traits,Arr_curve_end ce) :_traits(traits), _ce(ce), Base() {} Comparison_result operator()(const Non_vertical_x_curve_2& xcv1,const Non_vertical_x_curve_2& xcv2 ) const { return _traits.compare_x_near_limit_2_object()(xcv1,xcv2,_ce); } Comparison_result operator()(const Non_vertical_x_curve_2& xcv1,const Vertical_segment& xcv2 ) const - { + { if (_ce == ARR_MIN_END) { CGAL_precondition (xcv2.min_parameter_space() == CGAL::ARR_BOTTOM_BOUNDARY); @@ -1490,12 +1490,12 @@ class Arr_traits_with_vertical_segments CGAL_precondition (xcv1.min_parameter_space() == CGAL::ARR_BOTTOM_BOUNDARY); else //_ce1 == ARR_MAX_END CGAL_precondition (xcv1.max_parameter_space() == CGAL::ARR_TOP_BOUNDARY); - + if (_ce == ARR_MIN_END) CGAL_precondition (xcv2.min_parameter_space() == CGAL::ARR_BOTTOM_BOUNDARY); else //_ce2 == ARR_MAX_END CGAL_precondition (xcv2.max_parameter_space() == CGAL::ARR_TOP_BOUNDARY); - + return _traits.compare_x_2_object() (xcv1.min(),xcv2.min()); } @@ -1505,12 +1505,12 @@ class Arr_traits_with_vertical_segments }; //Compare_x_near_limit_2_visitor }; //Compare_x_near_limit_2 - Compare_x_near_limit_2 compare_x_near_limit_2_object() const + Compare_x_near_limit_2 compare_x_near_limit_2_object() const { return Compare_x_near_limit_2(_traits); } - class Compare_x_at_limit_2 + class Compare_x_at_limit_2 { private: Traits& _traits; @@ -1535,7 +1535,7 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Compare_x_at_limit_2_visitor_1(Traits& traits,Arr_curve_end ce,const Point_2 & p) + Compare_x_at_limit_2_visitor_1(Traits& traits,Arr_curve_end ce,const Point_2 & p) :_traits(traits), _ce(ce), _p(p), Base() {} Comparison_result operator()(const Non_vertical_x_curve_2& xcv ) const { @@ -1554,13 +1554,13 @@ class Arr_traits_with_vertical_segments Point_2 _p; Arr_curve_end _ce; }; //Compare_x_at_limit_2_visitor_1 - + class Compare_x_at_limit_2_visitor_2 : public boost::static_visitor { public: typedef boost::static_visitor Base; - Compare_x_at_limit_2_visitor_2(Traits& traits,Arr_curve_end ce1,Arr_curve_end ce2) + Compare_x_at_limit_2_visitor_2(Traits& traits,Arr_curve_end ce1,Arr_curve_end ce2) :_traits(traits), _ce1(ce1), _ce2(ce2), Base() {} Comparison_result operator()(const Non_vertical_x_curve_2& xcv1,const Non_vertical_x_curve_2& xcv2 ) const { @@ -1590,12 +1590,12 @@ class Arr_traits_with_vertical_segments CGAL_precondition (xcv1.min_parameter_space() == CGAL::ARR_BOTTOM_BOUNDARY); else //_ce1 == ARR_MAX_END CGAL_precondition (xcv1.max_parameter_space() == CGAL::ARR_TOP_BOUNDARY); - + if (_ce2 == ARR_MIN_END) CGAL_precondition (xcv2.min_parameter_space() == CGAL::ARR_BOTTOM_BOUNDARY); else //_ce2 == ARR_MAX_END CGAL_precondition (xcv2.max_parameter_space() == CGAL::ARR_TOP_BOUNDARY); - + return _traits.compare_x_2_object() (xcv1.min(),xcv2.min()); } private: @@ -1610,7 +1610,7 @@ class Arr_traits_with_vertical_segments /*! A function object that compares the y-coordinates of arc ends near the * boundary of the parameter space. */ - class Compare_y_near_boundary_2 + class Compare_y_near_boundary_2 { private: Traits& _traits; @@ -1637,7 +1637,7 @@ class Arr_traits_with_vertical_segments { public: typedef boost::static_visitor Base; - Compare_y_near_boundary_2_visitor(Traits& traits,Arr_curve_end ce) + Compare_y_near_boundary_2_visitor(Traits& traits,Arr_curve_end ce) :_traits(traits), _ce(ce), Base() {} Comparison_result operator()(const Non_vertical_x_curve_2& xcv1,const Non_vertical_x_curve_2& xcv2 ) const { @@ -1671,7 +1671,7 @@ class Arr_traits_with_vertical_segments Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const { return Compare_y_near_boundary_2(_traits); } //@} - + /// \name Functor definitions for the Boolean set-operation traits. //@{ class Compare_endpoints_xy_2 @@ -1742,7 +1742,7 @@ class Arr_traits_with_vertical_segments } public: template - static void re_cast_object_vector(const Object_vector& vec,OutputIterator& oi) + static void re_cast_object_vector(const Object_vector& vec,OutputIterator& oi) { for (Object_vector::const_iterator it = vec.begin() ; it != vec.end(); ++it) { @@ -1775,7 +1775,7 @@ class Arr_traits_with_vertical_segments } else CGAL_precondition(false); - + ++oi; } return; diff --git a/Arrangement_on_surface_2/archive/include/CGAL/Arr_hyperbolic_arc_traits_2.h b/Arrangement_on_surface_2/archive/include/CGAL/Arr_hyperbolic_arc_traits_2.h index 505e1e091a50..107e65a5c734 100644 --- a/Arrangement_on_surface_2/archive/include/CGAL/Arr_hyperbolic_arc_traits_2.h +++ b/Arrangement_on_surface_2/archive/include/CGAL/Arr_hyperbolic_arc_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -34,7 +34,7 @@ namespace CGAL { * A traits class for maintaining an arrangement of circles. */ template -class Arr_hyperbolic_arc_traits_2 +class Arr_hyperbolic_arc_traits_2 { public: @@ -327,7 +327,7 @@ class Arr_hyperbolic_arc_traits_2 { /*! - * Cut the given conic curve (or conic arc) into x-monotone subcurves + * Cut the given conic curve (or conic arc) into x-monotone subcurves * and insert them to the given output iterator. * \param cv The curve. * \param oi The output iterator, whose value-type is Object. The returned diff --git a/Arrangement_on_surface_2/archive/include/CGAL/Arr_rational_arc_traits_2.h b/Arrangement_on_surface_2/archive/include/CGAL/Arr_rational_arc_traits_2.h index 6037f86a8aba..cd8d80f962fd 100644 --- a/Arrangement_on_surface_2/archive/include/CGAL/Arr_rational_arc_traits_2.h +++ b/Arrangement_on_surface_2/archive/include/CGAL/Arr_rational_arc_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -18,7 +18,7 @@ #include /*! \file - * Definition of the Arr_rational_arc_traits_2 class. + * Definition of the Arr_rational_arc_traits_2 class. */ #include @@ -34,15 +34,15 @@ namespace CGAL { * A traits class for maintaining an arrangement of bounded arcs (segments) of * rational functions of arbitrary degree. * - * The class is templated with two parameters: + * The class is templated with two parameters: * Alg_kernel A geometric kernel, where Alg_kernel::FT is the number type * for the coordinates of arrangement vertices, which are algebraic * numbers (defined by Nt_traits::Algebraic). * Nt_traits A traits class for performing various operations on the integer, - * rational and algebraic types. + * rational and algebraic types. */ template -class Arr_rational_arc_traits_2 +class Arr_rational_arc_traits_2 { public: @@ -256,7 +256,7 @@ class Arr_rational_arc_traits_2 ); CGAL_precondition ((cv1.left_infinite_in_x() != ARR_INTERIOR || cv1.left_infinite_in_y() != ARR_INTERIOR || - ker.compare_xy_2_object() (p, + ker.compare_xy_2_object() (p, cv1.left()) == LARGER) && (cv2.left_infinite_in_x() != ARR_INTERIOR || cv2.left_infinite_in_y() != ARR_INTERIOR || @@ -266,17 +266,17 @@ class Arr_rational_arc_traits_2 // Compare the slopes of the two arcs. Comparison_result res; unsigned int mult; - + res = cv1.compare_slopes (cv2, p, mult); - // The comparison result is to the right of p. In case the multiplicity + // The comparison result is to the right of p. In case the multiplicity // of the intersection point p is odd, reverse this result. if (mult % 2 == 1) { - if (res == SMALLER) - res = LARGER; - else if (res == LARGER) - res = SMALLER; + if (res == SMALLER) + res = LARGER; + else if (res == LARGER) + res = SMALLER; } return (res); @@ -320,7 +320,7 @@ class Arr_rational_arc_traits_2 ); CGAL_precondition((cv1.right_infinite_in_x() != ARR_INTERIOR || cv1.right_infinite_in_y() != ARR_INTERIOR || - ker.compare_xy_2_object() (p, + ker.compare_xy_2_object() (p, cv1.right()) == SMALLER) && (cv2.right_infinite_in_x() != ARR_INTERIOR || cv2.right_infinite_in_y() != ARR_INTERIOR || @@ -388,7 +388,7 @@ class Arr_rational_arc_traits_2 public: /*! - * Cut the given conic curve (or conic arc) into x-monotone subcurves + * Cut the given conic curve (or conic arc) into x-monotone subcurves * and insert them to the given output iterator. * \param cv The curve. * \param oi The output iterator, whose value-type is Object. The returned @@ -511,14 +511,14 @@ class Arr_rational_arc_traits_2 /*! The traits (in case it has state) */ const Traits* m_traits; - + /*! Constructor * \param traits the traits (in case it has state) */ Merge_2(const Traits* traits) : m_traits(traits) {} friend class Arr_rational_arc_traits_2; - + public: /*! * Merge two given x-monotone curves into a single curve (segment). @@ -586,7 +586,7 @@ class Arr_rational_arc_traits_2 /*! Obtain a Parameter_space_in_x_2 function object */ Parameter_space_in_x_2 parameter_space_in_x_2_object() const { return Parameter_space_in_x_2(); } - + /*! A function object that obtains the parameter space of a geometric * entity along the y-axis */ @@ -646,7 +646,7 @@ class Arr_rational_arc_traits_2 * \return the comparison result: * SMALLER - x(p) < x(xc, ce); * EQUAL - x(p) = x(xc, ce); - * LARGER - x(p) > x(xc, ce). + * LARGER - x(p) > x(xc, ce). * \pre p lies in the interior of the parameter space. * \pre the ce end of the curve xcv lies on a boundary, implying that xcv * is either a vertical line or a curve with a vertical asymptote. @@ -691,13 +691,13 @@ class Arr_rational_arc_traits_2 /*! Obtain a Compare_x_at_limit_2 function object */ Compare_x_at_limit_2 compare_x_at_limit_2_object() const { return Compare_x_at_limit_2(); } - + /*! A function object that compares the x-coordinates of arc ends near the * boundary of the parameter space */ class Compare_x_near_limit_2 { public: - + /*! Compare the x-coordinates of 2 arcs ends near the boundary of the * parameter space at y = +/- oo. * \param xcv1 the first arc. @@ -724,7 +724,7 @@ class Arr_rational_arc_traits_2 /*! Obtain a Compare_x_near_limit_2 function object */ Compare_x_near_limit_2 compare_x_near_limit_2_object() const { return Compare_x_near_limit_2(); } - + /*! A function object that compares the y-coordinates of arc ends near the * boundary of the parameter space. @@ -755,10 +755,10 @@ class Arr_rational_arc_traits_2 { return Compare_y_near_boundary_2(); } //@} - + /// \name Functor definitions for the Boolean set-operation traits. //@{ - + class Compare_endpoints_xy_2 { public: @@ -775,7 +775,7 @@ class Arr_rational_arc_traits_2 if (cv.is_directed_right()) return (SMALLER); else - return (LARGER); + return (LARGER); } }; diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Conic_reader.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Conic_reader.hpp index dacf3b80cbb9..effc5820e5d0 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Conic_reader.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Conic_reader.hpp @@ -35,7 +35,7 @@ CORE::BigRat lexical_cast(std::string & str) return result; } -/*! A reader of conic curves and arcs of conic curves */ +/*! A reader of conic curves and arcs of conic curves */ template class Conic_reader { public: @@ -45,21 +45,21 @@ class Conic_reader { typedef typename Traits::Rat_kernel Rat_kernel; typedef typename Rat_kernel::FT Rational; - + typedef typename Rat_kernel::Point_2 Rat_point_2; typedef typename Rat_kernel::Segment_2 Rat_segment_2; typedef typename Rat_kernel::Line_2 Rat_line_2; typedef typename Rat_kernel::Circle_2 Rat_circle_2; - + /*! A parser of bff files that contains conic curves or arcs of conic * curves */ - template + template class Conic_parser_visitor : public Point_parser_visitor { private: typedef Point_parser_visitor Base; - + /*! The iterator of the output container */ OutputIterator & m_output_iterator; @@ -83,10 +83,10 @@ class Conic_reader { m_processing_arc(false), m_orient(CGAL::COUNTERCLOCKWISE) {} - - /*! Accept only unbounded lines for Arrangements */ + + /*! Accept only unbounded lines for Arrangements */ virtual void accept_classification(std::string problem, - std::string geom, + std::string geom, std::string clas, std::string family, std::string instance, @@ -105,7 +105,7 @@ class Conic_reader { CORE::BigInt integer = lexical_cast(s); m_bigints.push_back(integer); } - + virtual void accept_orientation( std::string s) { m_orient = @@ -125,7 +125,7 @@ class Conic_reader { begin_full(); m_processing_arc = true; } - + /*! Start a line segment */ virtual void begin_line_segment_2() { begin_arc(); } @@ -183,7 +183,7 @@ class Conic_reader { m_orient, ps ,pt); ++m_output_iterator = conic_arc; } - + /*! Start a circle arc */ virtual void begin_circle_arc_2() { begin_arc(); } @@ -237,7 +237,7 @@ class Conic_reader { /*! End an ellipse arc */ virtual void end_iso_ellipse_arc_2() { end_arc(); } - + /*! Accept a conic curve */ virtual void accept_conic_2(std::string r_str, std::string s_str, std::string t_str, std::string u_str, @@ -278,10 +278,10 @@ class Conic_reader { { // Construct a circular arc. The line should have the format: // t - // where (x1, y1), (x2, y2), (x3, y3), (x4, y4) and (x5, y5) define the + // where (x1, y1), (x2, y2), (x3, y3), (x4, y4) and (x5, y5) define the // arc. CORE::BigInt x1, y1, x2, y2, x3, y3, x4, y4, x5, y5; - + str_line >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4 >> x5 >> y5; Rat_point_2 p1(x1, y1), p2(x2, y2), p3(x3, y3), p4(x4, y4), p5(x5, y5); cv = Curve_2 (p1, p2, p3, p4, p5); diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Double.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Double.hpp index ca24fe03c7d4..2f32d5716ed6 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Double.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Double.hpp @@ -23,7 +23,7 @@ class Double { typedef Tag_false Has_exact_sqrt; typedef Tag_true Is_real_embeddable; - + // Constructors. Double() : val(0) {} @@ -60,7 +60,7 @@ class Double { // Equality operators. Note that x equals y iff: // // |x - y| - // ----------- > > #endif #endif -//#ifdef _CORE_EXPR_H_ +//#ifdef _CORE_EXPR_H_ #ifdef CGAL_CORE_EXPR_H /*! CORE::Expr */ template <> diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp index 9e460258ec26..ebfb3db89e2d 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp @@ -13,7 +13,7 @@ char * Option_parser::s_type_opts[] = { }; char * Option_parser::s_strategy_opts[] = { - "RIC", "naive", "walk", "simple", "triangle", "landmarks", + "RIC", "naive", "walk", "simple", "triangle", "landmarks", "R", "n", "w", "s", "t", "l" }; @@ -88,7 +88,7 @@ Option_parser::Option_parser() : ("license,l", "print licence information") ("version,v", "print version string") ; - + // Options allowed on the command line, config file, or env. variables m_config_opts.add_options() ("input-path,P", po::value()->composing(), "input path") @@ -122,7 +122,7 @@ Option_parser::Option_parser() : po::value(&m_win_height)->default_value(DEF_WIN_HEIGHT), "window height") ; - + // Options hidden to the user. Allowed only on the command line: m_hidden_opts.add_options() ("input-file", po::value()->composing(), "input file") @@ -133,7 +133,7 @@ Option_parser::Option_parser() : m_config_file_opts.add(m_bench_opts).add(m_config_opts); m_environment_opts.add(m_bench_opts).add(m_config_opts); - m_positional_opts.add("input-file", -1); + m_positional_opts.add("input-file", -1); } /*! Parse the options */ @@ -142,7 +142,7 @@ void Option_parser::operator()(int argc, char * argv[]) po::store(po::command_line_parser(argc, argv). options(m_cmd_line_opts).positional(m_positional_opts).run(), m_variable_map); - + std::ifstream ifs(".bench.cfg"); po::store(parse_config_file(ifs, m_config_file_opts), m_variable_map); po::notify(m_variable_map); @@ -179,7 +179,7 @@ void Option_parser::operator()(int argc, char * argv[]) m_type_mask |= 0x1 << ((*it).m_id % size); } } - + if (m_variable_map.count("strategy")) { Vector_strategy_id strategys = m_variable_map["strategy"].as(); @@ -193,7 +193,7 @@ void Option_parser::operator()(int argc, char * argv[]) // Add directories specified on the command line via the "input-path" opt.: Add_dir tmp = for_each_dir(Add_dir(m_dirs)); - + if (!m_variable_map.count("input-file")) { std::string str("input file missing!"); throw Input_file_missing_error(str); @@ -216,7 +216,7 @@ void Option_parser::operator()(int argc, char * argv[]) break; } } - if (m_full_names[m_number_files].empty()) { + if (m_full_names[m_number_files].empty()) { std::cerr << "cannot find file " << (*it).c_str() << "!" << std::endl; throw Error_exception(FILE_NOT_FOUND); return; diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp index 84e237ff0d8f..4fcfc0aafd6a 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp @@ -67,17 +67,17 @@ class Option_parser : public cb::Option_parser { /*! \brief obtains number of strategy options */ static unsigned int get_number_opts(Strategy_id &); - + /*! Compare the i-th type option to a given option */ static bool compare_opt(unsigned int i, const char * opt, Type_id &) { return strcmp(s_type_opts[i], opt) == 0; } - + /*! Compare the i-th strategy option to a given option */ static bool compare_opt(unsigned int i, const char * opt, Strategy_id &) { return strcmp(s_strategy_opts[i], opt) == 0; } Option_parser(); - + enum Generic_option_id { AUTHOR, HELP, LICENSE, VERSION }; struct Generic_option_exception { Generic_option_exception(Generic_option_id option) : m_option(option) {} @@ -93,16 +93,16 @@ class Option_parser : public cb::Option_parser { struct Input_file_missing_error : public po::error { Input_file_missing_error(std::string & str) : error(str) {} }; - + /*! Parse the options */ void operator()(int argc, char * argv[]); - + /*! Obtain the verbosity level */ unsigned int get_verbose_level() const { return m_verbose_level; } /*! Obtain the number of input files */ unsigned int get_number_files() const { return m_number_files; } - + /*! \brief obtains the base file-name */ const std::string & get_file_name(unsigned int i) const; @@ -122,11 +122,11 @@ class Option_parser : public cb::Option_parser { /*! Obtain the window height */ unsigned int get_height() const { return m_win_height; } - + template static void my_validate(boost::any & v, const std::vector & values); - + protected: /*! The variable map */ po::variables_map m_variable_map; @@ -136,7 +136,7 @@ class Option_parser : public cb::Option_parser { /*! Visible options */ po::options_description m_visible_opts; - + /*! Command line options */ po::options_description m_cmd_line_opts; @@ -150,7 +150,7 @@ class Option_parser : public cb::Option_parser { po::options_description m_config_opts; /*! The hidden option description */ - po::options_description m_hidden_opts; + po::options_description m_hidden_opts; /*! Positional option description */ po::positional_options_description m_positional_opts; @@ -161,7 +161,7 @@ class Option_parser : public cb::Option_parser { typedef std::vector Input_path; typedef Input_path::const_iterator Input_path_const_iterator; - + Input_path_const_iterator dirs_begin() { return m_variable_map["input-path"].as().begin(); } @@ -174,7 +174,7 @@ class Option_parser : public cb::Option_parser { if (!m_variable_map.count("input-path")) return func; return std::for_each(dirs_begin(), dirs_end(), func); } - + /*! A functor that adds a directory to the directory-search structure */ struct Add_dir { Path_list & m_dirs; @@ -189,7 +189,7 @@ class Option_parser : public cb::Option_parser { static char * s_strategy_opts[]; /*! Verbosity level */ - unsigned int m_verbose_level; + unsigned int m_verbose_level; /*! The window width */ unsigned int m_win_width; @@ -199,7 +199,7 @@ class Option_parser : public cb::Option_parser { unsigned int m_type_mask; unsigned int m_strategy_mask; - + bool m_postscript; unsigned int m_number_files; diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_parser_visitor.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_parser_visitor.hpp index 6a0802caaae5..dfa35f35f03a 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_parser_visitor.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_parser_visitor.hpp @@ -46,7 +46,7 @@ class Point_parser_visitor : public cb::Benchmark_visitor { void make_point(FT & x, FT & y, Rat_point & p) { typename Rat_kernel::FT kx(x); - typename Rat_kernel::FT ky(y); + typename Rat_kernel::FT ky(y); p = Rat_point(kx, ky); double dx = CGAL::to_double(x); double dy = CGAL::to_double(y); @@ -59,7 +59,7 @@ class Point_parser_visitor : public cb::Benchmark_visitor { void make_point(FT & x, FT & y, FT & w, Rat_point & p) { typename Rat_kernel::FT kx(x/w); - typename Rat_kernel::FT ky(y/w); + typename Rat_kernel::FT ky(y/w); p = Rat_point(kx, ky); } @@ -71,7 +71,7 @@ class Point_parser_visitor : public cb::Benchmark_visitor { template void make_ft(RT & num, RT & denom, FT & n, CGAL::Tag_false) { n = num / denom; } - + /*! Parse a generic Cartesian point */ virtual void accept_point_2(std::string x, std::string y) { @@ -100,7 +100,7 @@ class Point_parser_visitor : public cb::Benchmark_visitor { } /*! Parse a rational Cartesian point */ - virtual void accept_point_2(std::string x_num, std::string x_denom, + virtual void accept_point_2(std::string x_num, std::string x_denom, std::string y_num, std::string y_denom) { typedef typename Number_type_traits::RT RT; diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_reader.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_reader.hpp index bea7cb44785c..693e93333f88 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_reader.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Point_reader.hpp @@ -26,7 +26,7 @@ class Point_reader { } int count; inp >> count; - + int i; for (i = 0; i < count; ++i) { Number_type x, y; @@ -37,16 +37,16 @@ class Point_reader { } else if (format == Option_parser::FORMAT_INT) { Input_traits::Input_int_type ix, iy; inp >> ix >> iy; - x = (Number_type) ix; y = (Number_type) iy; + x = (Number_type) ix; y = (Number_type) iy; } else if (format == Option_parser::FORMAT_FLOAT) { Input_traits::Input_float_type ix, iy; inp >> ix >> iy; - x = (Number_type) ix; y = (Number_type) iy; + x = (Number_type) ix; y = (Number_type) iy; } else { std::cerr << "Illegal format!" << std::endl; return -1; } - + Point_2 pnt(x, y); ++points_out = pnt; } diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Polyline_reader.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Polyline_reader.hpp index 830e1f3b8c0a..708660b8099e 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Polyline_reader.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Polyline_reader.hpp @@ -38,7 +38,7 @@ class Toint { }; #endif -/*! A reader of polyline curves */ +/*! A reader of polyline curves */ template class Polyline_reader { public: @@ -46,7 +46,7 @@ class Polyline_reader { typedef typename Traits::Curve_2 Curve_2; /*! A parser of bff files that contains polylines */ - template + template class Polyline_parser_visitor : public Point_parser_visitor { private: @@ -59,10 +59,10 @@ class Polyline_reader { Point_parser_visitor(bbox), m_output_iterator(oi) {} - - /*! Accept only unbounded lines for Arrangements */ + + /*! Accept only unbounded lines for Arrangements */ virtual void accept_classification(std::string problem, - std::string geom, + std::string geom, std::string clas, std::string family, std::string instance, @@ -88,7 +88,7 @@ class Polyline_reader { ++m_output_iterator = polyline; } }; - + /*! Read the segments from the input file * \param filename the name of the input file * \param curves_out the iterator of the container of the read curves diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Segment_reader.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Segment_reader.hpp index 085027243054..fc5b8dec7559 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Segment_reader.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Segment_reader.hpp @@ -17,7 +17,7 @@ namespace cb = CGAL::benchmark; -/*! A reader of line segments */ +/*! A reader of line segments */ template class Segment_reader { public: @@ -39,9 +39,9 @@ class Segment_reader { m_output_iterator(oi) {} - /*! Accept only unbounded lines for Arrangements */ + /*! Accept only unbounded lines for Arrangements */ virtual void accept_classification(std::string problem, - std::string geom, + std::string geom, std::string clas, std::string family, std::string instance, diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp index 903fc5a1b908..391544b48e3f 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp @@ -298,7 +298,7 @@ class Basic_arr { { } virtual ~Basic_arr() {} - + /*! */ //virtual void op() = 0; @@ -329,18 +329,18 @@ class Basic_arr { return 0; } - + /* */ void clean() { m_curve_list.clear(); -#if defined(CGAL_TRAITS_COUNTING) +#if defined(CGAL_TRAITS_COUNTING) if (m_verbose_level > 0) std::cout << m_traits; #endif } void sync(){} - void set_file_name(const char * filename, int file_index=0) + void set_file_name(const char * filename, int file_index=0) { m_filename = filename; } void set_verbose_level(const unsigned int level) { m_verbose_level = level; } void set_postscript(const bool postscript) { m_postscript = postscript; } @@ -363,16 +363,16 @@ class Basic_arr { /*! This class is supplied to the bench as a templatwe parameter. * it defines the operations we want to measure. - * in this case we measure only the incremental construction + * in this case we measure only the incremental construction * of the arrangement. */ template class Increment_arr : public Basic_arr { public: // op is the main function that must be implemented in each benchable class - // that is supplied to the Bench class. + // that is supplied to the Bench class. // the other functions that should be implemented are inherited from Basic_arr - // This (op) is the main method, that is different from all other classes + // This (op) is the main method, that is different from all other classes // inherite from Basic_arr void op() { @@ -381,7 +381,7 @@ class Increment_arr : public Basic_arr { Strategy strategy(arr); for (i = m_curve_list.begin(); i != m_curve_list.end(); ++i) insert(arr, *i, strategy); - + if (m_verbose_level > 0) { //print to cout if (m_verbose_level > 1) { if (!arr.is_valid()) std::cerr << "map invalid!" << std::endl; @@ -506,7 +506,7 @@ class Display_arr : public Basic_arr { CST::Point_2::clear_cache(); #endif } - + /*! */ int init() { @@ -520,7 +520,7 @@ class Display_arr : public Basic_arr { float min_range = (x_range < y_range) ? x_range : y_range; float x_margin = min_range / 4; float y_margin = (height * x_margin) / m_width; - + m_x0 = m_bbox.xmin() - x_margin; m_x1 = m_bbox.xmax() + x_margin; m_y0 = m_bbox.ymin() - y_margin; @@ -530,7 +530,7 @@ class Display_arr : public Basic_arr { #if defined(USE_CGAL_WINDOW) m_window = new Window_stream(m_width, m_height); if (!m_window) return -1; - m_window->init(m_x0, m_x1, m_y0); // logical window size + m_window->init(m_x0, m_x1, m_y0); // logical window size m_window->set_redraw(&Display_arr::redraw); m_window->set_mode(leda_src_mode); @@ -545,7 +545,7 @@ class Display_arr : public Basic_arr { if (!m_window) return -1; App->setMainWidget(m_window); m_window->resize(m_width, m_height); - m_window->set_window(m_x0, m_x1, m_y0, m_y1); // logical window size + m_window->set_window(m_x0, m_x1, m_y0, m_y1); // logical window size m_window->setLineWidth(1); m_window->setPointSize(3); m_window->show(); @@ -559,15 +559,15 @@ class Display_arr : public Basic_arr { Basic_arr::clean(); delete m_window; } - + private: /*! */ #if defined(USE_CGAL_WINDOW) static void - redraw(leda_window * wp, double x0, double y0, double x1, double y1) + redraw(leda_window * wp, double x0, double y0, double x1, double y1) { wp->flush_buffer(x0,y0,x1,y1); } #endif - + Window_stream * m_window; }; @@ -576,9 +576,9 @@ typedef cb::Benchmark Dis_arr_bench; /*! */ template void run_bench(Bench_inst & bench_inst, Benchable & benchable, - const char * fullname, + const char * fullname, int samples, int iterations, unsigned int verbose_level, - bool postscript = false, + bool postscript = false, const char * fullname2 = 0) { //set some variable @@ -586,10 +586,10 @@ void run_bench(Bench_inst & bench_inst, Benchable & benchable, benchable.set_verbose_level(verbose_level); benchable.set_postscript(postscript); if (fullname2) benchable.set_file_name(fullname2, 1); - + if (samples > 0) bench_inst.set_samples(samples); else if (iterations > 0) bench_inst.set_iterations(iterations); - + //opertor () in the Bench - does all the work ! bench_inst(); } @@ -641,8 +641,8 @@ int main(int argc, char * argv[]) //general definitions Type_code type_code; // operation we want to apply - Strategy_code strategy_code; // point location strategy - + Strategy_code strategy_code; // point location strategy + if (verbose_level > 0) { std::cout << "type_mask = "<< type_mask << std::endl; std::cout << "strategy_mask = " << strategy_mask << std::endl; @@ -660,7 +660,7 @@ int main(int argc, char * argv[]) std::string name = std::string(option_parser.get_type_name(type_code)) + " " + std::string(option_parser.get_strategy_name(strategy_code)) + " " + - TRAITS_TYPE + " " + KERNEL_TYPE + " " + + TRAITS_TYPE + " " + KERNEL_TYPE + " " + NUMBER_TYPE + " " + " (" + std::string(filename[0]) + ")"; Trap_inc_arr_bench bench_inst(name, seconds, false); Trap_inc_arr & benchable = bench_inst.get_benchable(); @@ -670,7 +670,7 @@ int main(int argc, char * argv[]) verbose_level, postscript); } #endif - + // Naive point location: strategy_code = Option_parser::STRATEGY_NAIVE; if (strategy_mask & (0x1 << strategy_code)) { @@ -686,7 +686,7 @@ int main(int argc, char * argv[]) samples, iterations, verbose_level, postscript); } - + // Walk point location: strategy_code = Option_parser::STRATEGY_WALK; if (strategy_mask & (0x1 << strategy_code)) { @@ -702,7 +702,7 @@ int main(int argc, char * argv[]) samples, iterations, verbose_level, postscript); } - + #if defined(LANDMARK_SUPPORTED) // Landmarks point location: strategy_code = Option_parser::STRATEGY_LANDMARKS; @@ -723,7 +723,7 @@ int main(int argc, char * argv[]) postscript); } #endif - + #if defined(TRIANGLE_SUPPORTED) // Triangle point location: strategy_code = Option_parser::STRATEGY_TRIANGLE; @@ -731,19 +731,19 @@ int main(int argc, char * argv[]) std::string name = std::string(option_parser.get_type_name(type_code)) + " " + std::string(option_parser.get_strategy_name(strategy_code)) + " " + - TRAITS_TYPE + " " + KERNEL_TYPE + " " + + TRAITS_TYPE + " " + KERNEL_TYPE + " " + NUMBER_TYPE +" " + " (" + std::string(file_name) + ")"; Triangle_inc_arr_bench bench_inst(name, seconds, false); Triangle_inc_arr & benchable = bench_inst.get_benchable(); run_bench(bench_inst, benchable, - full_name, + full_name, samples, iterations, verbose_level, postscript); } #endif } - + // Construct Aggregately type_code = Option_parser::TYPE_AGGREGATE; if (type_mask & (0x1 << type_code)) { @@ -754,7 +754,7 @@ int main(int argc, char * argv[]) NUMBER_TYPE + " " + " (" + std::string(file_name) + ")"; Agg_arr_bench bench_inst(name, seconds, false); Aggregate_arr & benchable = bench_inst.get_benchable(); - run_bench(bench_inst, benchable, full_name, + run_bench(bench_inst, benchable, full_name, samples, iterations, verbose_level, postscript); } @@ -779,10 +779,10 @@ int main(int argc, char * argv[]) Display_arr & benchable = bench_inst.get_benchable(); benchable.set_width(width); benchable.set_height(height); - run_bench(bench_inst, benchable, full_name, + run_bench(bench_inst, benchable, full_name, samples, iterations, verbose_level, postscript); } - + return 0; } diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_ellipses.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_ellipses.cpp index 9b01a4c5e353..42de403d8229 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_ellipses.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_ellipses.cpp @@ -28,13 +28,13 @@ int main (int argc, char *argv[]) // Check the number of program arguments. if (argc < 3) { std::cerr << "Usage: " << argv[0] << " " - << std::endl - << "method is either:" << std::endl - << " -a for aggragated insertion;" << std::endl - << " -n for incremental insertion with naive point-location;" - << std::endl - << " -w for incremental insertion with walk point-location." - << std::endl; + << std::endl + << "method is either:" << std::endl + << " -a for aggragated insertion;" << std::endl + << " -n for incremental insertion with naive point-location;" + << std::endl + << " -w for incremental insertion with walk point-location." + << std::endl; return 1; } @@ -108,12 +108,12 @@ int main (int argc, char *argv[]) Naive_pl pl (arr); Conic_arcs_list::const_iterator iter; - std::cout << "Performing incremental insertion (with naive PL) of " - << n << " ellipses." << std::endl; + std::cout << "Performing incremental insertion (with naive PL) of " + << n << " ellipses." << std::endl; timer.start(); for (iter = ellipses.begin(); iter != ellipses.end(); ++iter) - insert (arr, *iter, pl); + insert (arr, *iter, pl); timer.stop(); } else { @@ -121,19 +121,19 @@ int main (int argc, char *argv[]) Walk_pl pl (arr); Conic_arcs_list::const_iterator iter; - std::cout << "Performing incremental insertion (with walk PL) of " - << n << " ellipses." << std::endl; + std::cout << "Performing incremental insertion (with walk PL) of " + << n << " ellipses." << std::endl; timer.start(); for (iter = ellipses.begin(); iter != ellipses.end(); ++iter) - insert (arr, *iter, pl); + insert (arr, *iter, pl); timer.stop(); } } else { // Perform aggregated insertion. - std::cout << "Performing aggregated insertion of " - << n << " ellipses." << std::endl; + std::cout << "Performing aggregated insertion of " + << n << " ellipses." << std::endl; timer.start(); insert (arr, ellipses.begin(), ellipses.end()); @@ -142,11 +142,11 @@ int main (int argc, char *argv[]) // Print the arrangement dimensions. std::cout << "V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl << std::endl; + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << std::endl << std::endl; - std::cout << "Construction took " << timer.time() - << " seconds." << std::endl; + std::cout << "Construction took " << timer.time() + << " seconds." << std::endl; // Check the validity of the arrangement: std::cout << "Checking validity ... " << std::flush; diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_polylines.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_polylines.cpp index eadcfacb47ce..b196130ae46a 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_polylines.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_polylines.cpp @@ -6,13 +6,13 @@ // -n -- Use incremental insertion with naive point-location; // -w -- Use incremental insertion with walk point-location. // - + //#define USE_FILTERED_KERNEL //#define USE_LAZY_KERNEL //#define USE_APPROX_KERNEL #ifdef USE_FILTERED_KERNEL - + #include typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; @@ -69,14 +69,14 @@ int main (int argc, char **argv) { std::cerr << "Usage: " << argv[0] << " [format]" << std::endl - << "method is either:" << std::endl - << " -a for aggragated insertion;" << std::endl - << " -n for incremental insertion with naive point-location;" - << std::endl - << " -w for incremental insertion with walk point-location." + << "method is either:" << std::endl + << " -a for aggragated insertion;" << std::endl + << " -n for incremental insertion with naive point-location;" + << std::endl + << " -w for incremental insertion with walk point-location." << std::endl << "Specify -q as the format for reading rationals." - << std::endl; + << std::endl; return (1); } @@ -102,7 +102,7 @@ int main (int argc, char **argv) // Check whether we should integers or rationals. bool read_rationals = false; - if (argc > 3 && + if (argc > 3 && (strcmp (argv[3], "-Q") == 0 || strcmp (argv[3], "-q") == 0)) { read_rationals = true; @@ -172,13 +172,13 @@ int main (int argc, char **argv) Naive_pl pl (arr); Polylines_list::const_iterator iter; - std::cout << "Performing incremental insertion (with naive PL) of " - << n << " polylines." << std::endl; + std::cout << "Performing incremental insertion (with naive PL) of " + << n << " polylines." << std::endl; timer.start(); for (iter = polylines.begin(); iter != polylines.end(); ++iter) { - insert (arr, *iter, pl); + insert (arr, *iter, pl); } timer.stop(); } @@ -188,13 +188,13 @@ int main (int argc, char **argv) Walk_pl pl (arr); Polylines_list::const_iterator iter; - std::cout << "Performing incremental insertion (with walk PL) of " - << n << " polylines." << std::endl; + std::cout << "Performing incremental insertion (with walk PL) of " + << n << " polylines." << std::endl; timer.start(); for (iter = polylines.begin(); iter != polylines.end(); ++iter) { - insert (arr, *iter, pl); + insert (arr, *iter, pl); } timer.stop(); } @@ -202,8 +202,8 @@ int main (int argc, char **argv) else { // Perform aggregated insertion. - std::cout << "Performing aggregated insertion of " - << n << " polylines." << std::endl; + std::cout << "Performing aggregated insertion of " + << n << " polylines." << std::endl; timer.start(); insert (arr, polylines.begin(), polylines.end()); @@ -212,15 +212,15 @@ int main (int argc, char **argv) // Print the arrangement dimensions. std::cout << "V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl << std::endl; + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << std::endl << std::endl; - std::cout << "Construction took " << timer.time() - << " seconds." << std::endl; + std::cout << "Construction took " << timer.time() + << " seconds." << std::endl; // Check the validity of the arrangement: std::cout << "Checking validity ... " << std::flush; std::cout << (arr.is_valid() ? "OK." : "INVALID !!!") << std::endl; - + return 0; } diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_segments.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_segments.cpp index 3b3590330941..aceb4e66b7a2 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_segments.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/bench_arr_segments.cpp @@ -6,13 +6,13 @@ // -n -- Use incremental insertion with naive point-location; // -w -- Use incremental insertion with walk point-location. // - + //#define USE_FILTERED_KERNEL //#define USE_LAZY_KERNEL //#define USE_APPROX_KERNEL #ifdef USE_FILTERED_KERNEL - + #include typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; @@ -69,16 +69,16 @@ int main (int argc, char **argv) { std::cerr << "Usage: " << argv[0] << " [format]" << std::endl - << "method is either:" << std::endl - << " -a for aggragated insertion;" << std::endl - << " -n for incremental insertion with naive point-location;" - << std::endl - << " -s for incremental insertion with simple point-location;" - << std::endl - << " -w for incremental insertion with walk point-location." + << "method is either:" << std::endl + << " -a for aggragated insertion;" << std::endl + << " -n for incremental insertion with naive point-location;" + << std::endl + << " -s for incremental insertion with simple point-location;" + << std::endl + << " -w for incremental insertion with walk point-location." << std::endl << "Specify -q as the format for reading rationals." - << std::endl; + << std::endl; return (1); } @@ -110,7 +110,7 @@ int main (int argc, char **argv) // Check whether we should integers or rationals. bool read_rationals = false; - if (argc > 3 && + if (argc > 3 && (strcmp (argv[3], "-Q") == 0 || strcmp (argv[3], "-q") == 0)) { read_rationals = true; @@ -172,13 +172,13 @@ int main (int argc, char **argv) Naive_pl pl (arr); Segments_list::const_iterator iter; - std::cout << "Performing incremental insertion (with naive PL) of " - << n << " segments." << std::endl; + std::cout << "Performing incremental insertion (with naive PL) of " + << n << " segments." << std::endl; timer.start(); for (iter = segments.begin(); iter != segments.end(); ++iter) { - insert (arr, *iter, pl); + insert (arr, *iter, pl); } timer.stop(); } @@ -188,13 +188,13 @@ int main (int argc, char **argv) Simple_pl pl (arr); Segments_list::const_iterator iter; - std::cout << "Performing incremental insertion (with simple PL) of " - << n << " segments." << std::endl; + std::cout << "Performing incremental insertion (with simple PL) of " + << n << " segments." << std::endl; timer.start(); for (iter = segments.begin(); iter != segments.end(); ++iter) { - insert (arr, *iter, pl); + insert (arr, *iter, pl); } timer.stop(); } @@ -204,13 +204,13 @@ int main (int argc, char **argv) Walk_pl pl (arr); Segments_list::const_iterator iter; - std::cout << "Performing incremental insertion (with walk PL) of " - << n << " segments." << std::endl; + std::cout << "Performing incremental insertion (with walk PL) of " + << n << " segments." << std::endl; timer.start(); for (iter = segments.begin(); iter != segments.end(); ++iter) { - insert (arr, *iter, pl); + insert (arr, *iter, pl); } timer.stop(); } @@ -218,8 +218,8 @@ int main (int argc, char **argv) else { // Perform aggregated insertion. - std::cout << "Performing aggregated insertion of " - << n << " segments." << std::endl; + std::cout << "Performing aggregated insertion of " + << n << " segments." << std::endl; timer.start(); insert (arr, segments.begin(), segments.end()); @@ -228,15 +228,15 @@ int main (int argc, char **argv) // Print the arrangement dimensions. std::cout << "V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl << std::endl; + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << std::endl << std::endl; - std::cout << "Construction took " << timer.time() - << " seconds." << std::endl; + std::cout << "Construction took " << timer.time() + << " seconds." << std::endl; // Check the validity of the arrangement: std::cout << "Checking validity ... " << std::flush; std::cout << (arr.is_valid() ? "OK." : "INVALID !!!") << std::endl; - + return 0; } diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp index 65bebb921a41..79d885905ef8 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp @@ -45,7 +45,7 @@ CGAL::Quotient lexical_cast >(std::string & str) { typedef CGAL::MP_Float RT; - + RT rt = lexical_cast(str); CGAL::Quotient result(rt, 1); return result; @@ -86,7 +86,7 @@ CGAL::Quotient lexical_cast >(std::string & str) { typedef CGAL::Gmpz RT; - + RT rt = lexical_cast(str); CGAL::Quotient result(rt, 1); return result; diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/number_type.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/number_type.hpp index 4c43ddc7be0e..1bfb1e03691d 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/number_type.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/number_type.hpp @@ -74,7 +74,7 @@ #include #else -#error No Number Type (NT) specified! +#error No Number Type (NT) specified! #endif // Typedefs: diff --git a/Arrangement_on_surface_2/benchmark/data/curves/polylines/cnv_polyline.cpp b/Arrangement_on_surface_2/benchmark/data/curves/polylines/cnv_polyline.cpp index 769b6be5caca..a5c75e03b1a1 100644 --- a/Arrangement_on_surface_2/benchmark/data/curves/polylines/cnv_polyline.cpp +++ b/Arrangement_on_surface_2/benchmark/data/curves/polylines/cnv_polyline.cpp @@ -12,7 +12,7 @@ int main(int argc, char * argv[]) << "BenchmarkName( \"" << argv[1] << "\" )" << std::endl << "Classification( \"Arrangement\", \"Polylines\", \"BoundedArcs\", \"Dgn\", \"O\", \"Aug-2007\" )" << std::endl << std::endl; - + std::ifstream is(argv[1]); #if 1 int c; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementCurveInputCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementCurveInputCallback.h index 684cc8fae8be..a628687f119c 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementCurveInputCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementCurveInputCallback.h @@ -64,7 +64,7 @@ class ArrangementCurveInputCallback: CGAL::insert( *( this->arrangement ), box.begin( ), box.end( ) ); } #endif - + Q_EMIT CGAL::Qt::GraphicsViewInput::modelChanged( ); } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h index 1f64f7807429..4e20f9c7835d 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h @@ -49,7 +49,7 @@ class ArrangementDemoPropertiesDialog : public QDialog protected: void setupUi( ); void updateUi( ); - + ArrangementDemoWindow* parent; Ui::ArrangementDemoPropertiesDialog* ui; }; // class ArrangementDemoPropertiesDialog diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.cpp index 876cf9f04344..83eb31ce5187 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.cpp @@ -32,7 +32,7 @@ ArrangementDemoTabBase::ArrangementDemoTabBase( QWidget* parent ) : } ArrangementDemoTabBase::~ArrangementDemoTabBase( ) -{ +{ } void ArrangementDemoTabBase::setupUi( ) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementSegmentInputCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementSegmentInputCallback.h index 984bf460bc9a..320505f67593 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementSegmentInputCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementSegmentInputCallback.h @@ -80,7 +80,7 @@ processInput( CGAL::Object o ) Curve_2 curve = this->construct_x_monotone_curve_2( p1, p2 ); CGAL::insert( *( this->arrangement ), curve ); } - + Q_EMIT CGAL::Qt::GraphicsViewInput::modelChanged( ); } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt index cbb231c76f5a..2bed310a6e09 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt @@ -18,7 +18,7 @@ find_package( Qt5 QUIET COMPONENTS Gui Widgets) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) include(${CGAL_USE_FILE}) - + include_directories( ./ ) # Arrangement package includes add_definitions(-DQT_NO_KEYWORDS) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/DeleteCurveCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/DeleteCurveCallback.h index a2610b682da5..deb7a06bf704 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/DeleteCurveCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/DeleteCurveCallback.h @@ -104,7 +104,7 @@ void DeleteCurveCallback< Arr_ >::reset( ) } template < typename Arr_ > -void +void DeleteCurveCallback::mousePressEvent(QGraphicsSceneMouseEvent* /* event */) { if ( this->removableHalfedge == Halfedge_handle( ) ) @@ -144,7 +144,7 @@ mouseMoveEvent( QGraphicsSceneMouseEvent* event ) } template < typename Arr_ > -void +void DeleteCurveCallback< Arr_ >:: highlightNearestCurve( QGraphicsSceneMouseEvent* event ) { diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.h index f567fadf0a43..cc8b95f65026 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.h @@ -146,7 +146,7 @@ class EnvelopeCallback : public EnvelopeCallbackBase void updateEnvelope(bool lower, CGAL::Arr_algebraic_segment_traits_2 traits); - + Construct_x_monotone_subcurve_2< Traits > construct_x_monotone_subcurve_2; Arrangement* arr; CGAL::Qt::CurveGraphicsItem< Traits >* lowerEnvelope; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/FillFaceCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/FillFaceCallback.h index 9eb9460373e2..da5251917f29 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/FillFaceCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/FillFaceCallback.h @@ -126,12 +126,12 @@ void FillFaceCallback::mousePressEvent(QGraphicsSceneMouseEvent* event) } template < class Arr_ > -void +void FillFaceCallback< Arr_ >::mouseMoveEvent(QGraphicsSceneMouseEvent* /* event */) { } template < class Arr_ > -void +void FillFaceCallback< Arr_ >:: fillFace( QGraphicsSceneMouseEvent* event ) { diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp index fc14bb952c64..6650e582ad46 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp @@ -60,7 +60,7 @@ GraphicsViewCurveInputBase::mouseMoveEvent(QGraphicsSceneMouseEvent* /* event */ void GraphicsViewCurveInputBase:: mousePressEvent(QGraphicsSceneMouseEvent* /* event */) -{ +{ // std::cout << "GraphicsViewCurveInputBase::mousePressEvent" << std::endl; } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/MergeEdgeCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/MergeEdgeCallback.h index 93841c3a4df7..cfc96a16cb4d 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/MergeEdgeCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/MergeEdgeCallback.h @@ -127,7 +127,7 @@ void MergeEdgeCallback::mousePressEvent(QGraphicsSceneMouseEvent* event) } else { - Halfedge_handle nextHalfedge = + Halfedge_handle nextHalfedge = this->getNearestMergeableCurve( this->mergeableHalfedge, event ); this->arr->merge_edge( this->mergeableHalfedge, nextHalfedge ); this->reset( ); @@ -152,7 +152,7 @@ void MergeEdgeCallback::mouseMoveEvent(QGraphicsSceneMouseEvent* event) } else { - Halfedge_handle nextHalfedge = + Halfedge_handle nextHalfedge = this->getNearestMergeableCurve( this->mergeableHalfedge, event ); this->highlightedCurve2->clear( ); this->highlightedCurve2->insert( nextHalfedge->curve( ) ); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.cpp index 3c8cb8c0979c..cf40a748f044 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.cpp @@ -20,7 +20,7 @@ NewTabDialog::NewTabDialog( QWidget* parent, Qt::WindowFlags f ) : buttonGroup( new QButtonGroup ) { this->ui->setupUi( this ); - + this->buttonGroup->addButton( this->ui->segmentRadioButton, ArrangementDemoWindow::SEGMENT_TRAITS ); this->buttonGroup->addButton( this->ui->polylineRadioButton, diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointLocationCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointLocationCallback.h index 2431b436081d..dd5f4d7a5c25 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointLocationCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointLocationCallback.h @@ -103,7 +103,7 @@ PointLocationCallback( Arrangement* arr_, QObject* parent_ ) : pointLocationStrategy( CGAL::make_object( new Walk_pl_strategy( *arr_ ) ) ), arr( arr_ ), highlightedCurves( new CGAL::Qt::CurveGraphicsItem< Traits >( ) ) -{ +{ QObject::connect( this, SIGNAL( modelChanged( ) ), this->highlightedCurves, SLOT( modelChanged( ) ) ); } @@ -131,7 +131,7 @@ reset( ) } template < typename Arr_ > -void +void PointLocationCallback< Arr_ >:: mousePressEvent( QGraphicsSceneMouseEvent* event ) { @@ -172,7 +172,7 @@ highlightPointLocation( QGraphicsSceneMouseEvent *event, this->highlightedCurves->insert( curve ); } while ( ++cc != face->outer_ccb( ) ); } - Hole_const_iterator hit; + Hole_const_iterator hit; Hole_const_iterator eit = face->holes_end( ); for ( hit = face->holes_begin( ); hit != eit; ++hit ) { // highlight any holes inside this face @@ -205,7 +205,7 @@ highlightPointLocation( QGraphicsSceneMouseEvent *event, this->highlightedCurves->insert( curve ); } } while ( ++cc != face->outer_ccb( ) ); - Hole_const_iterator hit; + Hole_const_iterator hit; Hole_const_iterator eit = face->holes_end( ); for ( hit = face->holes_begin( ); hit != eit; ++hit ) { // highlight any holes inside this face diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.cpp index b97582865c42..da000d5083f5 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.cpp @@ -20,7 +20,7 @@ PropertyValueDelegate::PropertyValueDelegate( QObject* parent ): QItemDelegate( parent ) -{ +{ QItemEditorFactory* factory = new QItemEditorFactory; QItemEditorCreatorBase* creator = new QStandardItemEditorCreator< PositiveSpinBox >( ); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/SplitEdgeCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/SplitEdgeCallback.h index 581a645cd90b..47871586abb4 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/SplitEdgeCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/SplitEdgeCallback.h @@ -73,7 +73,7 @@ class SplitEdgeCallback : public SplitEdgeCallbackBase void setScene( QGraphicsScene* scene_ ); virtual void setColor( QColor c ); void reset( ); - + void slotModelChanged( ); protected: @@ -249,7 +249,7 @@ splitEdges(const Point_2& /* clickedPoint */, } template < typename Arr_ > -void +void SplitEdgeCallback< Arr_ >::mouseMoveEvent( QGraphicsSceneMouseEvent* event ) { Point_2 clickedPoint = this->snapPoint( event ); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h index aa8f3d0e9473..53cb0fcb76e1 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h @@ -225,7 +225,7 @@ highlightPointLocation( QGraphicsSceneMouseEvent* event ) { return; } - + QRectF viewportRect = this->viewportRect( ); FT y2; if ( this->shootingUp ) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/Test.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/Test.cpp index a6e22cfe0148..e8966bc2e209 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/Test.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/Test.cpp @@ -38,7 +38,7 @@ int main( ) Circle_2 circle( p1, p2, p3 ); Circular_arc_2 arc( circle ); Traits::Curve_2 curveBox = arc; - + std::vector< Circular_arc_2 > arcs; arcs.push_back( arc ); CGAL::insert( arr2, arcs.begin( ), arcs.end( ) ); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestAlgebraic.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestAlgebraic.cpp index dba919f3cc01..41acec251bb1 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestAlgebraic.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestAlgebraic.cpp @@ -37,7 +37,7 @@ X_monotone_curve_2 makeVerticalLine( Bound x ) Traits traits; Traits::Construct_point_2 constructPoint = traits.construct_point_2_object( ); - Traits::Construct_x_monotone_segment_2 constructSegment = + Traits::Construct_x_monotone_segment_2 constructSegment = traits.construct_x_monotone_segment_2_object( ); std::vector< X_monotone_curve_2 > curves; @@ -55,7 +55,7 @@ int main( ) Algebraic_real_1 real( 1 ); //CGAL::Qt::Converter< Algebraic_kernel_d_2 > testConverter; //CGAL::Qt::Converter< CKvA_2 > testConverter; - + //CGAL::Qt::Converter< Cartesian > testConverter; Kernel_point_2 testPt( 1, 2 ); Point_2 testPt2( testPt.x( ), testPt.y( ) ); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestRayPL.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestRayPL.cpp index 1703901f9234..e2be25f6b520 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestRayPL.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/TestRayPL.cpp @@ -28,6 +28,6 @@ int main( ) WalkAlongLinePointLocationStrategy pl( arr ); CGAL::Object o = pl.locate( Point_2( 1, -1 ) ); - + return 0; } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h index ccb6bc91e062..138274e13052 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h @@ -4,53 +4,53 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The traits class `Arr_Bezier_curve_traits_2` is a model of the `ArrangementTraits_2` -concept that handles planar Bézier curves. A planar Bézier curve -\f$ B\f$ is a parametric curve defined by a sequence of control points -\f$ p_0, \ldots, p_n\f$ as follows: +The traits class `Arr_Bezier_curve_traits_2` is a model of the `ArrangementTraits_2` +concept that handles planar Bézier curves. A planar Bézier curve +\f$ B\f$ is a parametric curve defined by a sequence of control points +\f$ p_0, \ldots, p_n\f$ as follows: \f{eqnarray*}{ -B(t) = \left(X(t), Y(t)\right) -= \ccSum{k=0}{n}{p_k \cdot \frac{n!}{k! (n-k)!} \cdot -t^k (1-t)^{n-k}}\ . +B(t) = \left(X(t), Y(t)\right) += \ccSum{k=0}{n}{p_k \cdot \frac{n!}{k! (n-k)!} \cdot +t^k (1-t)^{n-k}}\ . \f} -where \f$ t \in [0, 1]\f$. The degree of the curve is therefore \f$ n\f$ - -namely, \f$ X(t)\f$ and \f$ Y(t)\f$ are polynomials of degree \f$ n\f$. Bézier curves -have numerous applications in computer graphics and solid modelling. They -are used, for example, in free-form sketches and for defining the true-type -fonts. - -In our representation, we assume that the coordinates of all control -points are rational numbers (namely they are given as objects of the -`RatKernel::Point_2` type), so both \f$ X(t)\f$ and \f$ Y(t)\f$ are polynomials -with rational coefficients. The intersection points between curves are -however algebraic numbers, and their exact computation is time-consuming. -The traits class therefore contains a layer of geometric filtering that -performs all computation in an approximate manner whenever possible, and -it resorts to exact computations only when the approximate computation -fails to produce an unambiguous result. - -We therefore require separate representations of the control points and -the intersection points. The `NtTraits` should be instantiated with a class -that defines nested `Integer`, `Rational` and `Algebraic` number -types and supports various operations on them, yielding certified computation -results (for example, in can convert rational numbers to algebraic numbers -and can compute roots of polynomials with integer coefficients). -The other template parameters, `RatKernel` and `AlgKernel` should be -geometric kernels templated with the `NtTraits::Rational` and -`NtTraits::Algebraic` number types, respectively. It is recommended to -instantiate the `CORE_algebraic_number_traits` class as the `NtTraits` -parameter, with `Cartesian` and -`Cartesian` instantiating the two kernel types, -respectively. The number types in this case are provided by the Core -library, with its ability to exactly represent simple algebraic numbers. - -While `Arr_Bezier_curve_traits_2` models the concept -`ArrangementDirectionalXMonotoneTraits_2`, the implementation of -the `Are_mergeable_2` operation does not enforce the input curves -to have the same direction as a precondition. Moreover, `Arr_Bezier_curve_traits_2` -supports the merging of curves of opposite directions. +where \f$ t \in [0, 1]\f$. The degree of the curve is therefore \f$ n\f$ - +namely, \f$ X(t)\f$ and \f$ Y(t)\f$ are polynomials of degree \f$ n\f$. Bézier curves +have numerous applications in computer graphics and solid modelling. They +are used, for example, in free-form sketches and for defining the true-type +fonts. + +In our representation, we assume that the coordinates of all control +points are rational numbers (namely they are given as objects of the +`RatKernel::Point_2` type), so both \f$ X(t)\f$ and \f$ Y(t)\f$ are polynomials +with rational coefficients. The intersection points between curves are +however algebraic numbers, and their exact computation is time-consuming. +The traits class therefore contains a layer of geometric filtering that +performs all computation in an approximate manner whenever possible, and +it resorts to exact computations only when the approximate computation +fails to produce an unambiguous result. + +We therefore require separate representations of the control points and +the intersection points. The `NtTraits` should be instantiated with a class +that defines nested `Integer`, `Rational` and `Algebraic` number +types and supports various operations on them, yielding certified computation +results (for example, in can convert rational numbers to algebraic numbers +and can compute roots of polynomials with integer coefficients). +The other template parameters, `RatKernel` and `AlgKernel` should be +geometric kernels templated with the `NtTraits::Rational` and +`NtTraits::Algebraic` number types, respectively. It is recommended to +instantiate the `CORE_algebraic_number_traits` class as the `NtTraits` +parameter, with `Cartesian` and +`Cartesian` instantiating the two kernel types, +respectively. The number types in this case are provided by the Core +library, with its ability to exactly represent simple algebraic numbers. + +While `Arr_Bezier_curve_traits_2` models the concept +`ArrangementDirectionalXMonotoneTraits_2`, the implementation of +the `Are_mergeable_2` operation does not enforce the input curves +to have the same direction as a precondition. Moreover, `Arr_Bezier_curve_traits_2` +supports the merging of curves of opposite directions. \cgalModels `ArrangementTraits_2` \cgalModels `ArrangementDirectionalXMonotoneTraits_2` @@ -61,20 +61,20 @@ template< typename RatKernel, typename AlgKernel, typename NtTraits > class Arr_Bezier_curve_traits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the `NtTraits::Rational` type -(and also the `RatKernel::FT` type). -*/ -typedef unspecified_type Rational; +the `NtTraits::Rational` type +(and also the `RatKernel::FT` type). +*/ +typedef unspecified_type Rational; /*! -the `NtTraits::Algebraic` type -(and also the `AlgKernel::FT` type). -*/ -typedef unspecified_type Algebraic; +the `NtTraits::Algebraic` type +(and also the `AlgKernel::FT` type). +*/ +typedef unspecified_type Algebraic; /// @} @@ -82,63 +82,63 @@ typedef unspecified_type Algebraic; /*! -The `Curve_2` class nested within the Bézier traits class is used -to represent a Bézier curve of arbitrary degree, which is defined by a -sequence of rational control points. In addition to the methods listed -below, the I/O operators \link PkgArrangementOnSurface2op_left_shift `operator<<` \endlink and \link PkgArrangementOnSurface2op_right_shift `operator>>` \endlink for -standard output-streams are also supported. The copy constructor and -assignment operator are supported as well. +The `Curve_2` class nested within the Bézier traits class is used +to represent a Bézier curve of arbitrary degree, which is defined by a +sequence of rational control points. In addition to the methods listed +below, the I/O operators \link PkgArrangementOnSurface2op_left_shift `operator<<` \endlink and \link PkgArrangementOnSurface2op_right_shift `operator>>` \endlink for +standard output-streams are also supported. The copy constructor and +assignment operator are supported as well. */ class Curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Curve_2 (); +default constructor. +*/ +Curve_2 (); /*! -constructs a Bézier curve as defined by the given range of control -points. The value-type of `InputIterator` is `RatKernel::Point_2`. -\pre The input range must contain at least two control points. +constructs a Bézier curve as defined by the given range of control +points. The value-type of `InputIterator` is `RatKernel::Point_2`. +\pre The input range must contain at least two control points. -*/ -template -Curve_2 (InputIterator pts_begin, InputIterator pts_end); +*/ +template +Curve_2 (InputIterator pts_begin, InputIterator pts_end); /// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the number of control points that define `B`. -*/ -size_t number_of_control_points () const; +returns the number of control points that define `B`. +*/ +size_t number_of_control_points () const; /*! -returns the \f$ k\f$th control point. Note that the first control point equals -the curve source, while the last control point equals its target. The rest -of the control points do not lie on the curve. -\pre \f$ k\f$ is smaller than the number of control points. -*/ -typename RatKernel::Point_2 control_point (size_t k) const; +returns the \f$ k\f$th control point. Note that the first control point equals +the curve source, while the last control point equals its target. The rest +of the control points do not lie on the curve. +\pre \f$ k\f$ is smaller than the number of control points. +*/ +typename RatKernel::Point_2 control_point (size_t k) const; /*! -returns the point \f$ B(t)\f$ on the curve that corresponds to the given -rational parameter value. -*/ -typename RatKernel::Point_2 operator() (const Rational& t) const; +returns the point \f$ B(t)\f$ on the curve that corresponds to the given +rational parameter value. +*/ +typename RatKernel::Point_2 operator() (const Rational& t) const; /*! -returns the point \f$ B(t)\f$ on the curve that corresponds to the given -algebraic parameter value. -*/ -typename AlgKernel::Point_2 operator() (const Algebraic& t) const; +returns the point \f$ B(t)\f$ on the curve that corresponds to the given +algebraic parameter value. +*/ +typename AlgKernel::Point_2 operator() (const Algebraic& t) const; /// @} @@ -147,80 +147,80 @@ typename AlgKernel::Point_2 operator() (const Algebraic& t) const; /*! -The `Point_2` class nested within the Bézier traits class is used -to represent: (i) an endpoint of a Bézier curve, (ii) a vertical tangency -point of a curve, used to subdivide it into \f$ x\f$-monotone subcurve, and -(iii) an intersection point between two curves. While, points of type (i) have -rational coordinates and are given as part of the input, points of the two -latter types have algebraic coordinates. However, to speed up the arrangement -construction, such point are not computed in an exact manner, and instead -are given in an approximate representation. Note that the exact coordinates -of a point may only be accessed if it is exactly computed. +The `Point_2` class nested within the Bézier traits class is used +to represent: (i) an endpoint of a Bézier curve, (ii) a vertical tangency +point of a curve, used to subdivide it into \f$ x\f$-monotone subcurve, and +(iii) an intersection point between two curves. While, points of type (i) have +rational coordinates and are given as part of the input, points of the two +latter types have algebraic coordinates. However, to speed up the arrangement +construction, such point are not computed in an exact manner, and instead +are given in an approximate representation. Note that the exact coordinates +of a point may only be accessed if it is exactly computed. -In addition to the methods listed below, the copy constructor and assignment -operator for `Point_2` objects are also supported. +In addition to the methods listed below, the copy constructor and assignment +operator for `Point_2` objects are also supported. */ class Point_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Point_2 (); +default constructor. +*/ +Point_2 (); /*! -constructs the point \f$ B(t_0)\f$ on the given curve. As \f$ t_0\f$ is an -algebraic number, the point has algebraic coordinates. -*/ -Point_2 (const Curve_2& B, const Algebraic& t_0); +constructs the point \f$ B(t_0)\f$ on the given curve. As \f$ t_0\f$ is an +algebraic number, the point has algebraic coordinates. +*/ +Point_2 (const Curve_2& B, const Algebraic& t_0); /*! -constructs the point \f$ B(t_0)\f$ on the given curve. As \f$ t_0\f$ is a -rational number, the point has rational coordinates. -*/ -Point_2 (const Curve_2& B, const Rational& t_0); +constructs the point \f$ B(t_0)\f$ on the given curve. As \f$ t_0\f$ is a +rational number, the point has rational coordinates. +*/ +Point_2 (const Curve_2& B, const Rational& t_0); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the approximated coordinates of `p`. -*/ -std::pair approximate () const; +returns the approximated coordinates of `p`. +*/ +std::pair approximate () const; /*! -returns whether the coordinates of `p` are computed in an exact manner. -*/ -bool is_exact () const; +returns whether the coordinates of `p` are computed in an exact manner. +*/ +bool is_exact () const; /*! -returns the \f$ x\f$-coordinate of `p`. -\pre `p` is exactly computed. -*/ -Algebraic x () const; +returns the \f$ x\f$-coordinate of `p`. +\pre `p` is exactly computed. +*/ +Algebraic x () const; /*! -returns the \f$ y\f$-coordinate of `p`. -\pre `p` is exactly computed. -*/ -Algebraic y () const; +returns the \f$ y\f$-coordinate of `p`. +\pre `p` is exactly computed. +*/ +Algebraic y () const; /*! -returns whether the coordinates of `p` are rational numbers. -*/ -bool is_rational () const; +returns whether the coordinates of `p` are rational numbers. +*/ +bool is_rational () const; /*! -casts `p` to a point with rational coordinates. -\pre `p` has rational coordinates. -*/ -operator typename RatKernel::Point_2 () const; +casts `p` to a point with rational coordinates. +\pre `p` has rational coordinates. +*/ +operator typename RatKernel::Point_2 () const; /// @} @@ -229,54 +229,54 @@ operator typename RatKernel::Point_2 () const; /*! -The `X_monotone_curve_2` class nested within the Bézier traits is -used to represent \f$ x\f$-monotone subcurves of Bézier curves. The subcurve is -defined by a supporting Bézier curve \f$ B(t)\f$ and a range of definition in -the parameter space \f$ [t_1, t_2] \subseteq [0, 1]\f$, where \f$ B(t_1)\f$ is the -subcurve source and \f$ B(t_2)\f$ is its target. Note that as the point endpoints -may only be approximated, the parameter range defining the subcurve may -only be approximately known. +The `X_monotone_curve_2` class nested within the Bézier traits is +used to represent \f$ x\f$-monotone subcurves of Bézier curves. The subcurve is +defined by a supporting Bézier curve \f$ B(t)\f$ and a range of definition in +the parameter space \f$ [t_1, t_2] \subseteq [0, 1]\f$, where \f$ B(t_1)\f$ is the +subcurve source and \f$ B(t_2)\f$ is its target. Note that as the point endpoints +may only be approximated, the parameter range defining the subcurve may +only be approximately known. -It is not possible to construct \f$ x\f$-monotone subcurves directly. Instead, -use the `Make_x_monotone_2` functor supplied by the traits class to -subdivide a `Curve_2` object into \f$ x\f$-monotone subcurves. +It is not possible to construct \f$ x\f$-monotone subcurves directly. Instead, +use the `Make_x_monotone_2` functor supplied by the traits class to +subdivide a `Curve_2` object into \f$ x\f$-monotone subcurves. */ class X_monotone_curve_2 { public: -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the supporting Bézier curve of `b`. -*/ -Curve_2 supporting_curve () const; +returns the supporting Bézier curve of `b`. +*/ +Curve_2 supporting_curve () const; /*! -returns the source point of `b`. -*/ -Point_2 source () const; +returns the source point of `b`. +*/ +Point_2 source () const; /*! -returns the target point of `b`. -*/ -Point_2 target () const; +returns the target point of `b`. +*/ +Point_2 target () const; /*! -returns the left (\f$ xy\f$-lexicographically smaller) endpoint of `b`. -*/ -Point_2 left () const; +returns the left (\f$ xy\f$-lexicographically smaller) endpoint of `b`. +*/ +Point_2 left () const; /*! -returns the right (\f$ xy\f$-lexicographically smaller) endpoint of `b`. -*/ -Point_2 right () const; +returns the right (\f$ xy\f$-lexicographically smaller) endpoint of `b`. +*/ +Point_2 right () const; /*! -return the approximate parameter range defining the subcurve `b`. -*/ -std::pair parameter_range () const; +return the approximate parameter range defining the subcurve `b`. +*/ +std::pair parameter_range () const; /// @} @@ -284,15 +284,15 @@ std::pair parameter_range () const; class Trim_2{ public: -/// \name Creation +/// \name Creation /// @{ /*! Trims the given x-monotone curve to an from src to tgt. -\ pre `src` and `tgt` lies on the curve -*/ +\ pre `src` and `tgt` lies on the curve +*/ -X_monotone_curve_2(const X_monotone_curve_2& xcv, +X_monotone_curve_2(const X_monotone_curve_2& xcv, const Point_2& src, const Point_2& tgt)const diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h index 29d6417b375e..97222b173e21 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h @@ -4,312 +4,312 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Ref -\anchor arr_refarr_access +\anchor arr_refarr_access -`Arr_accessor` provides an access to some of the private -`Arrangement` functions. Users may use these functions to achieve -more efficient programs when they have the exact topological information -required by the specialized functions. +`Arr_accessor` provides an access to some of the private +`Arrangement` functions. Users may use these functions to achieve +more efficient programs when they have the exact topological information +required by the specialized functions. -It is however highly recommended to be very careful when using the -accessor functions that modify the arrangement. As we have just mentioned, -these functions have very specific requirement on their input on one hand, -and perform no preconditions on the other hand, so providing incorrect -topological input may invalidate the arrangement. +It is however highly recommended to be very careful when using the +accessor functions that modify the arrangement. As we have just mentioned, +these functions have very specific requirement on their input on one hand, +and perform no preconditions on the other hand, so providing incorrect +topological input may invalidate the arrangement. */ template< typename Arrangement > class Arr_accessor { public: -/// \name Types +/// \name Types /// @{ /*! -the type of the associated arrangement. -*/ -typedef unspecified_type Arrangement_2; +the type of the associated arrangement. +*/ +typedef unspecified_type Arrangement_2; /*! -the point type. -*/ -typedef typename Arrangement_2::Point_2 Point_2; +the point type. +*/ +typedef typename Arrangement_2::Point_2 Point_2; /*! -the \f$ x\f$-monotone curve type. -*/ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; +the \f$ x\f$-monotone curve type. +*/ +typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; /*! -*/ -typedef typename Arrangement_2::Vertex_handle Vertex_handle; +*/ +typedef typename Arrangement_2::Vertex_handle Vertex_handle; /*! -*/ -typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; +*/ +typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; /*! -*/ -typedef typename Arrangement_2::Face_handle Face_handle; +*/ +typedef typename Arrangement_2::Face_handle Face_handle; /*! -represents the boundary of a connected component (CCB). -*/ -typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; +represents the boundary of a connected component (CCB). +*/ +typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -constructs an accessor attached to the given arrangement -`arr`. -*/ -Arr_accessor(Arrangement_2& arr); +constructs an accessor attached to the given arrangement +`arr`. +*/ +Arr_accessor(Arrangement_2& arr); -/// @} +/// @} -/// \name Accessing the Notification Functions +/// \name Accessing the Notification Functions /// @{ /*! -notifies the arrangement observer that a global change is going to take -place (for the usage of the global functions that operate on -arrangements). -*/ -void notify_before_global_change (); +notifies the arrangement observer that a global change is going to take +place (for the usage of the global functions that operate on +arrangements). +*/ +void notify_before_global_change (); /*! -notifies the arrangement observer that a global change has taken -place (for the usage of the global functions that operate on -arrangements). -*/ -void notify_after_global_change (); +notifies the arrangement observer that a global change has taken +place (for the usage of the global functions that operate on +arrangements). +*/ +void notify_after_global_change (); -/// @} +/// @} -/// \name Arrangement Predicates +/// \name Arrangement Predicates /// @{ /*! -locates a place for the curve `c` around the vertex `v` -and returns a halfedge whose target is `v`, where c should be -inserted between this halfedge and the next halfedge around `v` -in a clockwise order. -*/ -Halfedge_handle -locate_around_vertex (Vertex_handle v, -const X_monotone_curve_2& c) const; +locates a place for the curve `c` around the vertex `v` +and returns a halfedge whose target is `v`, where c should be +inserted between this halfedge and the next halfedge around `v` +in a clockwise order. +*/ +Halfedge_handle +locate_around_vertex (Vertex_handle v, +const X_monotone_curve_2& c) const; /*! -counts the number of edges along the path from `e1` to `e2`. -In case the two halfedges do not belong to the same connected component, -the function returns (-1). -*/ -int halfedge_distance (Halfedge_const_handle e1, -Halfedge_const_handle e2) const; +counts the number of edges along the path from `e1` to `e2`. +In case the two halfedges do not belong to the same connected component, +the function returns (-1). +*/ +int halfedge_distance (Halfedge_const_handle e1, +Halfedge_const_handle e2) const; /*! -determines whether a new halfedge we are about to create, which is to be associated -with the curve `c` and directed from `pred1->target()` to -`pred2->target()`, lies on the inner CCB of the new face that will be created, -introducing this new edge. -\pre `pred1->target()` and `pred2->target()` are associated with `c`'s endpoints. -\pre `pred1` and `pred2` belong to the same connected component, such that a new face is created by connecting `pred1->target()` and `pred2->target()`. -*/ -bool is_inside_new_face (Halfedge_handle pred1, -Halfedge_handle pred2, -const X_monotone_curve_2& c) const; +determines whether a new halfedge we are about to create, which is to be associated +with the curve `c` and directed from `pred1->target()` to +`pred2->target()`, lies on the inner CCB of the new face that will be created, +introducing this new edge. +\pre `pred1->target()` and `pred2->target()` are associated with `c`'s endpoints. +\pre `pred1` and `pred2` belong to the same connected component, such that a new face is created by connecting `pred1->target()` and `pred2->target()`. +*/ +bool is_inside_new_face (Halfedge_handle pred1, +Halfedge_handle pred2, +const X_monotone_curve_2& c) const; /*! -determines whether a given point lies within the region bounded by -a boundary of the connected component that `he` belongs to. -Note that if the function returns `true`, then `p` is contained within -`he->face()` (but not on its boundary), or inside one of the holes inside this -face, or it may coincide with an isolated vertex in this face. -*/ -bool point_is_in (const Point_2& p, -Halfedge_const_handle he) const; +determines whether a given point lies within the region bounded by +a boundary of the connected component that `he` belongs to. +Note that if the function returns `true`, then `p` is contained within +`he->face()` (but not on its boundary), or inside one of the holes inside this +face, or it may coincide with an isolated vertex in this face. +*/ +bool point_is_in (const Point_2& p, +Halfedge_const_handle he) const; /*! -determines whether `he` lies on the outer boundary of its incident -face. -*/ -bool is_on_outer_boundary (Halfedge_const_handle he) const; +determines whether `he` lies on the outer boundary of its incident +face. +*/ +bool is_on_outer_boundary (Halfedge_const_handle he) const; /*! -determines whether `he` lies on the inner boundary of its incident -face (that is, whether it lies on the boundary of one of the holes -in this face). -*/ -bool is_on_inner_boundary (Halfedge_const_handle he) const; +determines whether `he` lies on the inner boundary of its incident +face (that is, whether it lies on the boundary of one of the holes +in this face). +*/ +bool is_on_inner_boundary (Halfedge_const_handle he) const; -/// @} +/// @} -/// \name Arrangement Modifiers +/// \name Arrangement Modifiers /// @{ /*! -creates a new vertex an associates it with the point `p`. -\pre There is no existing vertex already associated with `p`. -*/ -Vertex_handle create_vertex (const Point_2& p); - -/*! -inserts the curve `c` as a new hole (inner component) of the face -`f`, connecting the two isolated vertices `v1` and `v2`. -`res` is the comparison result between these two end-vertices. -The function returns a handle for one of the new halfedges -corresponding to the inserted curve, directed from `v1` to `v2`. -\pre `v1` and `v2` are associated with `c`'s endpoints, that they lie of `f`'s interior and that and that they have no incident edges. -*/ -Halfedge_handle insert_in_face_interior_ex (const X_monotone_curve_2& c, -Face_handle f, -Vertex_handle v1, -Vertex_handle v2, -Comparison_result res); - -/*! -inserts the curve `c` into the arrangement, such that one of its -endpoints corresponds to an arrangement, which is the -target vertex of the halfedge `pred`, such that `c` is inserted -to the circular list of halfedges around `pred->target()` right -between `pred` and its successor. The other end-vertex is given by -an isolated vertex `v`, -where `res` is the comparison result between `pred->target()` and `v`. -The function returns a handle for one of the new halfedges directed from -`pred->target()` to `v`. -\pre `pred->target()` and `v` are associated with `c`'s endpoints and that and that `v` has no incident edges. -*/ -Halfedge_handle insert_from_vertex_ex (const X_monotone_curve_2& c, -Halfedge_handle pred, -Vertex_handle v, -Comparison_result res); - -/*! -inserts the curve `c` into the arrangement, such that both `c`'s -endpoints correspond to existing arrangement vertices, given by -`pred1->target()` and `pred2->target()`. `res` is the comparison -result between these two end-vertices. The function creates a -new halfedge pair that connects the two vertices (with `pred1` and -`pred2` indicate the exact place for these halfedges around the two -target vertices) and returns a handle for the halfedge directed from -`pred1->target()` to `pred2->target()`. -The output flag `new_face` indicates whether a new face has been created -following the insertion of the new curve. -\pre `pred1->target()` and `pred2->target()` are associated with `c`'s endpoints and that if a new face is created, then `is_inside_new_face (pred1, pred2, c)` is `true`. -*/ -Halfedge_handle insert_at_vertices_ex (const X_monotone_curve_2& c, -Halfedge_handle pred1, -Halfedge_handle pred2, -Comparison_result res, -bool& new_face); - -/*! -inserts `v` as an isolated vertex inside `f`. -\pre `v->point()` is contained in the interior of the given face. -*/ -void insert_isolated_vertex (Face_handle f, Vertex_handle v); - -/*! -moves the given hole from the interior of the face `f1` inside the -face `f2`. -\pre `hole` is currently contained in `f1` and should be moved to `f2`. -*/ -void move_hole (Face_handle f1, Face_handle f2, -Ccb_halfedge_circulator hole); - -/*! -moves the given isolated vertex from the interior of the face `f1` -inside the face `f2`. -\pre `v` is indeed an isolated vertex currently contained in `f1` and should be moved to `f2`. -*/ -bool move_isolated_vertex (Face_handle f1, Face_handle f2, -Vertex_handle v); - -/*! -relocates all holes and isolated vertices to their proper position -immediately after a face has split due to the insertion of a new halfedge, -namely after `insert_at_vertices_ex()` was invoked and indicated that -a new face has been created. `he` is the halfegde returned by -`insert_at_vertices_ex()`, -such that `he->twin()->face` is the face that has just been split and -`he->face()` is the newly created face. -*/ -void relocate_in_new_face (Halfedge_handle he); - -/*! -relocates all holes in a new face, as detailed above. -*/ -void relocate_holes_in_new_face (Halfedge_handle he); - -/*! -relocates all isolated vertices in a new face, as detailed above. -*/ -void relocate_isolated_vertices_in_new_face (Halfedge_handle he); - -/*! -modifies the point associated with the vertex `v` (the point may be -geometrically different than the one currently associated with `v`). -The function returns a handle to the modified vertex (same as `v`). -\pre No other arrangement vertex is already associated with `p`. +creates a new vertex an associates it with the point `p`. +\pre There is no existing vertex already associated with `p`. +*/ +Vertex_handle create_vertex (const Point_2& p); + +/*! +inserts the curve `c` as a new hole (inner component) of the face +`f`, connecting the two isolated vertices `v1` and `v2`. +`res` is the comparison result between these two end-vertices. +The function returns a handle for one of the new halfedges +corresponding to the inserted curve, directed from `v1` to `v2`. +\pre `v1` and `v2` are associated with `c`'s endpoints, that they lie of `f`'s interior and that and that they have no incident edges. +*/ +Halfedge_handle insert_in_face_interior_ex (const X_monotone_curve_2& c, +Face_handle f, +Vertex_handle v1, +Vertex_handle v2, +Comparison_result res); + +/*! +inserts the curve `c` into the arrangement, such that one of its +endpoints corresponds to an arrangement, which is the +target vertex of the halfedge `pred`, such that `c` is inserted +to the circular list of halfedges around `pred->target()` right +between `pred` and its successor. The other end-vertex is given by +an isolated vertex `v`, +where `res` is the comparison result between `pred->target()` and `v`. +The function returns a handle for one of the new halfedges directed from +`pred->target()` to `v`. +\pre `pred->target()` and `v` are associated with `c`'s endpoints and that and that `v` has no incident edges. +*/ +Halfedge_handle insert_from_vertex_ex (const X_monotone_curve_2& c, +Halfedge_handle pred, +Vertex_handle v, +Comparison_result res); + +/*! +inserts the curve `c` into the arrangement, such that both `c`'s +endpoints correspond to existing arrangement vertices, given by +`pred1->target()` and `pred2->target()`. `res` is the comparison +result between these two end-vertices. The function creates a +new halfedge pair that connects the two vertices (with `pred1` and +`pred2` indicate the exact place for these halfedges around the two +target vertices) and returns a handle for the halfedge directed from +`pred1->target()` to `pred2->target()`. +The output flag `new_face` indicates whether a new face has been created +following the insertion of the new curve. +\pre `pred1->target()` and `pred2->target()` are associated with `c`'s endpoints and that if a new face is created, then `is_inside_new_face (pred1, pred2, c)` is `true`. +*/ +Halfedge_handle insert_at_vertices_ex (const X_monotone_curve_2& c, +Halfedge_handle pred1, +Halfedge_handle pred2, +Comparison_result res, +bool& new_face); + +/*! +inserts `v` as an isolated vertex inside `f`. +\pre `v->point()` is contained in the interior of the given face. +*/ +void insert_isolated_vertex (Face_handle f, Vertex_handle v); + +/*! +moves the given hole from the interior of the face `f1` inside the +face `f2`. +\pre `hole` is currently contained in `f1` and should be moved to `f2`. +*/ +void move_hole (Face_handle f1, Face_handle f2, +Ccb_halfedge_circulator hole); + +/*! +moves the given isolated vertex from the interior of the face `f1` +inside the face `f2`. +\pre `v` is indeed an isolated vertex currently contained in `f1` and should be moved to `f2`. +*/ +bool move_isolated_vertex (Face_handle f1, Face_handle f2, +Vertex_handle v); + +/*! +relocates all holes and isolated vertices to their proper position +immediately after a face has split due to the insertion of a new halfedge, +namely after `insert_at_vertices_ex()` was invoked and indicated that +a new face has been created. `he` is the halfegde returned by +`insert_at_vertices_ex()`, +such that `he->twin()->face` is the face that has just been split and +`he->face()` is the newly created face. +*/ +void relocate_in_new_face (Halfedge_handle he); + +/*! +relocates all holes in a new face, as detailed above. +*/ +void relocate_holes_in_new_face (Halfedge_handle he); + +/*! +relocates all isolated vertices in a new face, as detailed above. +*/ +void relocate_isolated_vertices_in_new_face (Halfedge_handle he); + +/*! +modifies the point associated with the vertex `v` (the point may be +geometrically different than the one currently associated with `v`). +The function returns a handle to the modified vertex (same as `v`). +\pre No other arrangement vertex is already associated with `p`. \pre The topology of the arrangement does not change after the vertex point is modified. -*/ -Vertex_handle modify_vertex_ex (Vertex_handle v, -const Point_2& p); - -/*! -modifies the \f$ x\f$-monotone curve associated with the edge `e` (the -curve `c` may be geometrically different than the one currently -associated with `e`). -The function returns a handle to the modified edge (same as `e`). -\pre The interior of `c` is disjoint from all existing arrangement vertices and edges. -*/ -Halfedge_handle modify_edge_ex (Halfedge_handle e, -const X_monotone_curve_2& c); - -/*! -splits a given edge into two at the split point `p`, and associate the -x-monotone curves `c1` and `c2` with the resulting edges, such that -`c1` connects `he->source()` with `p` and `c2` connects -`p` with `he->target()`. The function return a handle to the split -halfedge directed from `he->source()` to the split point `p`. -\pre The endpoints of `c1` and `c2` correspond to `p` and to `he`'s end-vertices, as indicated above. -*/ -Halfedge_handle split_edge_ex (Halfedge_handle he, -const Point_2& p, -const X_monotone_curve_2& c1, -const X_monotone_curve_2& c2); - -/*! -splits a given edge into two at by the vertex `v`, and associate the -x-monotone curves `c1` and `c2` with the resulting edges, such that -`c1` connects `he->source()` with `v` and `c2` connects -`v` with `he->target()`. The function return a handle to the split -halfedge directed from `he->source()` to `v`. -\pre The endpoints of `c1` and `c2` correspond to `v` and to `he`'s end-vertices, as indicated above. It is also assumed that `v` has no incident edges. -*/ -Halfedge_handle split_edge_ex (Halfedge_handle he, -Vertex_handle v, -const X_monotone_curve_2& c1, -const X_monotone_curve_2& c2); - -/*! -removes the edge `he` from the arrangement, such that if the edge removal causes -the creation of a new hole, `he->target()` lies on the boundary of this hole. -The flags `remove_source` and `remove_target` indicate whether the end-vertices -of `he` should be removed as well, in case they have no other incident edges. -If the operation causes two faces to merge, the merged face is returned. -Otherwise, the face to which the edge was incident is returned. -*/ -Face_handle remove_edge_ex (Halfedge_handle he, -bool remove_source = true, -bool remove_target = true); +*/ +Vertex_handle modify_vertex_ex (Vertex_handle v, +const Point_2& p); + +/*! +modifies the \f$ x\f$-monotone curve associated with the edge `e` (the +curve `c` may be geometrically different than the one currently +associated with `e`). +The function returns a handle to the modified edge (same as `e`). +\pre The interior of `c` is disjoint from all existing arrangement vertices and edges. +*/ +Halfedge_handle modify_edge_ex (Halfedge_handle e, +const X_monotone_curve_2& c); + +/*! +splits a given edge into two at the split point `p`, and associate the +x-monotone curves `c1` and `c2` with the resulting edges, such that +`c1` connects `he->source()` with `p` and `c2` connects +`p` with `he->target()`. The function return a handle to the split +halfedge directed from `he->source()` to the split point `p`. +\pre The endpoints of `c1` and `c2` correspond to `p` and to `he`'s end-vertices, as indicated above. +*/ +Halfedge_handle split_edge_ex (Halfedge_handle he, +const Point_2& p, +const X_monotone_curve_2& c1, +const X_monotone_curve_2& c2); + +/*! +splits a given edge into two at by the vertex `v`, and associate the +x-monotone curves `c1` and `c2` with the resulting edges, such that +`c1` connects `he->source()` with `v` and `c2` connects +`v` with `he->target()`. The function return a handle to the split +halfedge directed from `he->source()` to `v`. +\pre The endpoints of `c1` and `c2` correspond to `v` and to `he`'s end-vertices, as indicated above. It is also assumed that `v` has no incident edges. +*/ +Halfedge_handle split_edge_ex (Halfedge_handle he, +Vertex_handle v, +const X_monotone_curve_2& c1, +const X_monotone_curve_2& c2); + +/*! +removes the edge `he` from the arrangement, such that if the edge removal causes +the creation of a new hole, `he->target()` lies on the boundary of this hole. +The flags `remove_source` and `remove_target` indicate whether the end-vertices +of `he` should be removed as well, in case they have no other incident edges. +If the operation causes two faces to merge, the merged face is returned. +Otherwise, the face to which the edge was incident is returned. +*/ +Face_handle remove_edge_ex (Halfedge_handle he, +bool remove_source = true, +bool remove_target = true); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h index 0b7f00df91ab..165e9cbd5872 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h @@ -4,23 +4,23 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The traits class `Arr_algebraic_segment_traits_2` is a model of the `ArrangementTraits_2` -concept that handles planar algebraic curves of arbitrary degree, -and \f$ x\f$-monotone of such curves. -A planar (real) algebraic curve -is the vanishing set of a polynomial in two variables, that is, the -curve is defined by the defining equation -\f[ f(x):=\sum_{i+j\leq n} a_{ij} x^i y^j =0, \f] -where \f$ n\f$ is the degree of the curve. - -The traits class allows the construction of algebraic curves, -by specifying their implicit equation. \f$ x\f$-monotone and vertical segments -of a curve can also be defined; unbounded curves and segments are supported. -The template parameter `Coefficient` defines -the innermost coefficient type of the polynomials. Currently, -the types `leda::integer` and `CORE::BigInt` are supported as well -as any instance of `CGAL::Sqrt_extension` that is instantiated with -one of the integral types above. +The traits class `Arr_algebraic_segment_traits_2` is a model of the `ArrangementTraits_2` +concept that handles planar algebraic curves of arbitrary degree, +and \f$ x\f$-monotone of such curves. +A planar (real) algebraic curve +is the vanishing set of a polynomial in two variables, that is, the +curve is defined by the defining equation +\f[ f(x):=\sum_{i+j\leq n} a_{ij} x^i y^j =0, \f] +where \f$ n\f$ is the degree of the curve. + +The traits class allows the construction of algebraic curves, +by specifying their implicit equation. \f$ x\f$-monotone and vertical segments +of a curve can also be defined; unbounded curves and segments are supported. +The template parameter `Coefficient` defines +the innermost coefficient type of the polynomials. Currently, +the types `leda::integer` and `CORE::BigInt` are supported as well +as any instance of `CGAL::Sqrt_extension` that is instantiated with +one of the integral types above. \cgalModels `ArrangementTraits_2` @@ -30,62 +30,62 @@ template< typename Coefficient > class Arr_algebraic_segment_traits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -Value to specify whether a point should be in the interior -of a segment, or its minimal point, -or its maximal point in lexicographic order. +Value to specify whether a point should be in the interior +of a segment, or its minimal point, +or its maximal point in lexicographic order. */ enum Site_of_point { POINT_IN_INTERIOR = 0, MIN_ENDPOINT = -1, MAX_ENDPOINT = 1 }; /*! -the type for bivariate polynomials, -with innermost coefficient type `Coefficient`. -Constitutes a model of the concept `Polynomial_d` -with two variables. +the type for bivariate polynomials, +with innermost coefficient type `Coefficient`. +Constitutes a model of the concept `Polynomial_d` +with two variables. \sa `CGAL::Polynomial_d` -*/ -typedef unspecified_type Polynomial_2; +*/ +typedef unspecified_type Polynomial_2; /*! -model for the concept -`AlgebraicKernel_1` -*/ -typedef unspecified_type Algebraic_kernel_1; +model for the concept +`AlgebraicKernel_1` +*/ +typedef unspecified_type Algebraic_kernel_1; /*! -represents coordinates of points. -Typedef from `Algebraic_kernel_1::Algebraic_real_1` -*/ -typedef unspecified_type Algebraic_real_1; +represents coordinates of points. +Typedef from `Algebraic_kernel_1::Algebraic_real_1` +*/ +typedef unspecified_type Algebraic_real_1; /*! -Typedef from `Algebraic_kernel_1::Bound` -*/ -typedef unspecified_type Bound; +Typedef from `Algebraic_kernel_1::Bound` +*/ +typedef unspecified_type Bound; -/// @} +/// @} -/// \name Accessing functor objects +/// \name Accessing functor objects /// @{ /*! -*/ -Construct_curve_2 construct_curve_2_object() const; +*/ +Construct_curve_2 construct_curve_2_object() const; /*! -*/ -Construct_point_2 construct_point_2_object() const; +*/ +Construct_point_2 construct_point_2_object() const; /*! -*/ -Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const; +*/ +Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const; /// @} @@ -96,25 +96,25 @@ Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const; class Construct_curve_2 { public: -/// \name Object Creation Functors +/// \name Object Creation Functors /// @{ /*! -Returns a `Curve_2` object that represents the curve defined by -the polynomial `p` -*/ -Curve_2 operator() (Polynomial_2 p); +Returns a `Curve_2` object that represents the curve defined by +the polynomial `p` +*/ +Curve_2 operator() (Polynomial_2 p); /*! -Returns a `Curve_2` object specified by `s`. -The passed string represents the defining polynomial of the curve -and must be given in a MAPLE-readable format using "x" as first -and "y" as second variable, e.g., -"(x^3*y-2*x)*(-6*x-y^3*x^6)" -for integer coefficients, and "3/2*x*y^4-5/7*x^2+3/1" -for rational coefficients. -*/ -Curve_2 operator() (std::string s); +Returns a `Curve_2` object specified by `s`. +The passed string represents the defining polynomial of the curve +and must be given in a MAPLE-readable format using "x" as first +and "y" as second variable, e.g., +"(x^3*y-2*x)*(-6*x-y^3*x^6)" +for integer coefficients, and "3/2*x*y^4-5/7*x^2+3/1" +for rational coefficients. +*/ +Curve_2 operator() (std::string s); /// @} @@ -127,45 +127,45 @@ Curve_2 operator() (std::string s); class Construct_point_2 { public: -/// \name Object Creation Functors +/// \name Object Creation Functors /// @{ /*! -Returns a `Point_2` object that represents the `arcno`-th -point in the fiber of `cv` at \f$ x\f$-coordinate `x`, -counted from the bottom, starting with zero. -\pre (`cv` must not have a vertical line at `x`, -and \f$ 0\leq arcno < c\f$, where \f$ c\f$ is the number of points -in the fiber of `cv` at `x`.) -*/ -Point_2 operator() (Algebraic_real_1 x, Curve_2 cv, int arcno); +Returns a `Point_2` object that represents the `arcno`-th +point in the fiber of `cv` at \f$ x\f$-coordinate `x`, +counted from the bottom, starting with zero. +\pre (`cv` must not have a vertical line at `x`, +and \f$ 0\leq arcno < c\f$, where \f$ c\f$ is the number of points +in the fiber of `cv` at `x`.) +*/ +Point_2 operator() (Algebraic_real_1 x, Curve_2 cv, int arcno); /*! -Returns a `Point_2` object that represents the -point on `xcv` at \f$ x\f$-coordinate `x` -\pre (`x` is in the \f$ x\f$-range of `xcv`.) -*/ -Point_2 operator() (Algebraic_real_1 x, X_monotone_curve_2 xcv); +Returns a `Point_2` object that represents the +point on `xcv` at \f$ x\f$-coordinate `x` +\pre (`x` is in the \f$ x\f$-range of `xcv`.) +*/ +Point_2 operator() (Algebraic_real_1 x, X_monotone_curve_2 xcv); /*! -Returns a `Point_2` object that represents (x,y) -*/ -Point_2 operator() (Algebraic_real_1 x, Algebraic_real_1 y); +Returns a `Point_2` object that represents (x,y) +*/ +Point_2 operator() (Algebraic_real_1 x, Algebraic_real_1 y); /*! -Returns a `Point_2` object that represents (x,y) -*/ -Point_2 operator() (Coefficient x, Coefficient y); +Returns a `Point_2` object that represents (x,y) +*/ +Point_2 operator() (Coefficient x, Coefficient y); /*! -Returns a `Point_2` object that represents (x,y) -*/ -Point_2 operator() (Bound x, Bound y); +Returns a `Point_2` object that represents (x,y) +*/ +Point_2 operator() (Bound x, Bound y); /*! -Returns a `Point_2` object that represents (x,y) -*/ -Point_2 operator() (int x, int y); +Returns a `Point_2` object that represents (x,y) +*/ +Point_2 operator() (int x, int y); /// @} @@ -178,63 +178,63 @@ Point_2 operator() (int x, int y); class Construct_x_monotone_segment_2 { public: -/// \name Object Creation Functors +/// \name Object Creation Functors /// @{ /*! -Writes a sequence of `X_monotone_curve_2` objects (terminal -segments) into `out`. These terminal segments compose an -\f$ x\f$-monotone (or vertical) segment of the curve `cv` that -starts in `end_min`, and ends in `end_max`. -\pre (`end_min` must have a unique \f$ x\f$-monotone segment -to its right, or `end_max` must have a unique -\f$ x\f$-monotone segment to its left. Furthermore, -`end_min` and `end_max` must be connected -by an \f$ x\f$-monotone segment of `cv`) -*/ -template OutputIterator -operator() (Curve_2 cv, Point_2 end_min, Point_2 end_max, -OutputIterator out); - -/*! -Writes a sequence of `X_monotone_curve_2` objects into `out`. -These segments form an \f$ x\f$-monotone (or vertical) -segment of the curve `cv`. - -If `site_of_p==POINT_IN_INTERIOR`, the maximal segment is -returned that contains `p` in its interior. - -returned that contains `p` as its left endpoint. - -returned that contains `p` as its left endpoint. -\pre (If `site_of_p==POINT_IN_INTERIOR`, `p` -must be an interior point of an \f$ x\f$-monotone or a vertical -segment. -must either have a unique \f$ x\f$-monotone segment to the right, -or a vertical segment from `p` upwards. -must either have a unique \f$ x\f$-monotone segment to the left, -or a vertical segment from `p` downwards.) -*/ -template OutputIterator -operator() (Curve_2 cv, Point_2 p, -Site_of_point site_of_p, -OutputIterator out); - -/*! -Writes a sequence of `X_monotone_curve_2` objects into `out`. -These segments form a straight-line segment connecting -the points `p` and `q`. If `p` and `q` share the -same \f$ x\f$-coordinate, the constructed vertical segment consists of -only one `X_monotone_curve_2` object and can be computed -efficiently. In the non-vertical case, -the construction is only possible if `p` and `q` -have both rational x- and y-coordinates. -\pre (`p` must not be equal to `q`.) - -*/ -template OutputIterator -operator() (Point_2 p, Point_2 q, -OutputIterator out); +Writes a sequence of `X_monotone_curve_2` objects (terminal +segments) into `out`. These terminal segments compose an +\f$ x\f$-monotone (or vertical) segment of the curve `cv` that +starts in `end_min`, and ends in `end_max`. +\pre (`end_min` must have a unique \f$ x\f$-monotone segment +to its right, or `end_max` must have a unique +\f$ x\f$-monotone segment to its left. Furthermore, +`end_min` and `end_max` must be connected +by an \f$ x\f$-monotone segment of `cv`) +*/ +template OutputIterator +operator() (Curve_2 cv, Point_2 end_min, Point_2 end_max, +OutputIterator out); + +/*! +Writes a sequence of `X_monotone_curve_2` objects into `out`. +These segments form an \f$ x\f$-monotone (or vertical) +segment of the curve `cv`. + +If `site_of_p==POINT_IN_INTERIOR`, the maximal segment is +returned that contains `p` in its interior. + +returned that contains `p` as its left endpoint. + +returned that contains `p` as its left endpoint. +\pre (If `site_of_p==POINT_IN_INTERIOR`, `p` +must be an interior point of an \f$ x\f$-monotone or a vertical +segment. +must either have a unique \f$ x\f$-monotone segment to the right, +or a vertical segment from `p` upwards. +must either have a unique \f$ x\f$-monotone segment to the left, +or a vertical segment from `p` downwards.) +*/ +template OutputIterator +operator() (Curve_2 cv, Point_2 p, +Site_of_point site_of_p, +OutputIterator out); + +/*! +Writes a sequence of `X_monotone_curve_2` objects into `out`. +These segments form a straight-line segment connecting +the points `p` and `q`. If `p` and `q` share the +same \f$ x\f$-coordinate, the constructed vertical segment consists of +only one `X_monotone_curve_2` object and can be computed +efficiently. In the non-vertical case, +the construction is only possible if `p` and `q` +have both rational x- and y-coordinates. +\pre (`p` must not be equal to `q`.) + +*/ +template OutputIterator +operator() (Point_2 p, Point_2 q, +OutputIterator out); /// @} @@ -243,23 +243,23 @@ OutputIterator out); /*! -Models the `ArrangementTraits_2::Curve_2` concept. -Represents algebraic curves. Internally, the type stores -topological-geometric information about the particular curve. -In order to use internal caching, instances should only be created -using the `Construct_curve_2` functor of the traits class. +Models the `ArrangementTraits_2::Curve_2` concept. +Represents algebraic curves. Internally, the type stores +topological-geometric information about the particular curve. +In order to use internal caching, instances should only be created +using the `Construct_curve_2` functor of the traits class. */ class Curve_2 { public: -/// \name Modifiers +/// \name Modifiers /// @{ /*! -returns the defining polynomial of the curve. -*/ -Polynomial_2 polynomial () const; +returns the defining polynomial of the curve. +*/ +Polynomial_2 polynomial () const; /// @} @@ -268,63 +268,63 @@ Polynomial_2 polynomial () const; /*! -Models the `ArrangementBasicTraits_2::Point_2` concept. -Represents points in \f$ \mathbb{R}^2\f$. Intersection points of algebraic curves -are in general non-rational, so we need a data structure that is capable -of representing arbitrary points with algebraic coordinates. +Models the `ArrangementBasicTraits_2::Point_2` concept. +Represents points in \f$ \mathbb{R}^2\f$. Intersection points of algebraic curves +are in general non-rational, so we need a data structure that is capable +of representing arbitrary points with algebraic coordinates. -The traits class represents algebraic coordinates by the type -`Algebraic_real_1`, which is a model of the `AlgebraicReal_1` -concept. -A point \f$ p\f$ is stored by a triple \f$ (x,cv,arcno)\f$, -where \f$ x\f$ is the \f$ x\f$-coordinate of a point, \f$ cv\f$ is an instance -of `Curve_2` that contains the point, (and has no vertical line at \f$ x\f$), -and \f$ arcno\f$ is an `int`, denoting that \f$ p\f$ is met as the \f$ arcno\f$-th -point when shooting a vertical ray at \f$ x\f$, starting from \f$ -\infty\f$ -(where counting starts with \f$ 0\f$). +The traits class represents algebraic coordinates by the type +`Algebraic_real_1`, which is a model of the `AlgebraicReal_1` +concept. +A point \f$ p\f$ is stored by a triple \f$ (x,cv,arcno)\f$, +where \f$ x\f$ is the \f$ x\f$-coordinate of a point, \f$ cv\f$ is an instance +of `Curve_2` that contains the point, (and has no vertical line at \f$ x\f$), +and \f$ arcno\f$ is an `int`, denoting that \f$ p\f$ is met as the \f$ arcno\f$-th +point when shooting a vertical ray at \f$ x\f$, starting from \f$ -\infty\f$ +(where counting starts with \f$ 0\f$). -In addition to the methods listed below, the copy constructor and assignment -operator for `Point_2` objects are also supported. +In addition to the methods listed below, the copy constructor and assignment +operator for `Point_2` objects are also supported. -The functor `Construct_point_2` constructs `Point_2` instances. +The functor `Construct_point_2` constructs `Point_2` instances. */ class Point_2 { public: -/// \name Modifiers +/// \name Modifiers /// @{ /*! -returns the \f$ x\f$-coordinate of `p`. -*/ -Algebraic_real_1 x () const; +returns the \f$ x\f$-coordinate of `p`. +*/ +Algebraic_real_1 x () const; /*! -returns the \f$ y\f$-coordinates of `p`. +returns the \f$ y\f$-coordinates of `p`. -Attention: As described above, points are not stored -by their \f$ y\f$-coordinate in `Algebraic_real_1` representation. In fact, -this representation must be computed on demand, and might become quite -costly for points defined by high-degree polynomials. Therefore, it is -recommended to avoid to call this function as much as possible. -*/ -Algebraic_real_1 y () const; +Attention: As described above, points are not stored +by their \f$ y\f$-coordinate in `Algebraic_real_1` representation. In fact, +this representation must be computed on demand, and might become quite +costly for points defined by high-degree polynomials. Therefore, it is +recommended to avoid to call this function as much as possible. +*/ +Algebraic_real_1 y () const; /*! -returns a `Curve_2` instance that `p`is part of. -*/ -Curve_2 curve () const; +returns a `Curve_2` instance that `p`is part of. +*/ +Curve_2 curve () const; /*! -returns the arc number of `p`. -*/ -int arcno () const; +returns the arc number of `p`. +*/ +int arcno () const; /*! -returns double-approximations of the \f$ x\f$- and \f$ y\f$-coordinates. -*/ -std::pair to_double () const; +returns double-approximations of the \f$ x\f$- and \f$ y\f$-coordinates. +*/ +std::pair to_double () const; /// @} @@ -333,63 +333,63 @@ std::pair to_double () const; /*! -Models the `ArrangementBasicTraits_2::X_monotone_curve_2` concept. -Represents terminal segments of an algebraic curves, -that means vertical segments or \f$ x\f$-monotone segments with no critical -\f$ x\f$-coordinate in the interior of their \f$ x\f$-range. -Terminal segments might either be bounded or unbounded. -By definition, each interior point of -a non-vertical segment has the same arc number (see the documentation of -type `Point_2` above, which is called the arc number of the segment -(note the arc number at the endpoints might differ). -Such segments are represented internally by a 4-tuple \f$ (p,q,cv,arcno)\f$, -where \f$ p\f$ and \f$ q\f$ are the endpoints, \f$ cv\f$ is the supporting curve -that the segment belongs to, and arcno is the arc number of the segment. +Models the `ArrangementBasicTraits_2::X_monotone_curve_2` concept. +Represents terminal segments of an algebraic curves, +that means vertical segments or \f$ x\f$-monotone segments with no critical +\f$ x\f$-coordinate in the interior of their \f$ x\f$-range. +Terminal segments might either be bounded or unbounded. +By definition, each interior point of +a non-vertical segment has the same arc number (see the documentation of +type `Point_2` above, which is called the arc number of the segment +(note the arc number at the endpoints might differ). +Such segments are represented internally by a 4-tuple \f$ (p,q,cv,arcno)\f$, +where \f$ p\f$ and \f$ q\f$ are the endpoints, \f$ cv\f$ is the supporting curve +that the segment belongs to, and arcno is the arc number of the segment. -Arbitrary (weakly) \f$ x\f$-monotone segments are presented by a range -of `X_monotone_curve_2` instances, whose union equals the segment. -The functor `Construct_x_monotone_segment_2` allows their construction. -To construct all (maximal) terminal segments of a curve, -use the `Make_x_monotone_2` functor supplied by the traits class. +Arbitrary (weakly) \f$ x\f$-monotone segments are presented by a range +of `X_monotone_curve_2` instances, whose union equals the segment. +The functor `Construct_x_monotone_segment_2` allows their construction. +To construct all (maximal) terminal segments of a curve, +use the `Make_x_monotone_2` functor supplied by the traits class. */ class X_monotone_curve_2 { public: -/// \name Modifiers +/// \name Modifiers /// @{ /*! -returns the supporting algebraic curve of `s`. -*/ -Curve_2 curve () const; +returns the supporting algebraic curve of `s`. +*/ +Curve_2 curve () const; /*! -returns whether `s` is a vertical segment. -*/ -bool is_vertical () const; +returns whether `s` is a vertical segment. +*/ +bool is_vertical () const; /*! -returns whether `s` has a finite endpoint on the left -*/ -bool is_finite (CGAL::Arr_curve_end ce) const; +returns whether `s` has a finite endpoint on the left +*/ +bool is_finite (CGAL::Arr_curve_end ce) const; /*! -\pre (The corresponding curve end is finite) -*/ -Point_2 curve_end (CGAL::Arr_curve_end ce) const; +\pre (The corresponding curve end is finite) +*/ +Point_2 curve_end (CGAL::Arr_curve_end ce) const; /*! -returns the arc number of the segment. -\pre (The segment is non-vertical) -*/ -int arcno () const; +returns the arc number of the segment. +\pre (The segment is non-vertical) +*/ +int arcno () const; /*! -returns the \f$ x\f$-coordinate of a vertical segment. -\pre (The segment is vertical) -*/ -Algebraic_real_1 x () const; +returns the \f$ x\f$-coordinate of a vertical segment. +\pre (The segment is vertical) +*/ +Algebraic_real_1 x () const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h index 2609eae0af3a..82c932fca8b2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h @@ -3,20 +3,20 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2PointLocation -Performs a batched point-location operation on a -given arrangement. It accepts a range of query points, and locates each -point in the arrangement. The query results are returned through the output +Performs a batched point-location operation on a +given arrangement. It accepts a range of query points, and locates each +point in the arrangement. The query results are returned through the output iterator. Each query result is given as a pair of the query point and an object representing the arrangement feature that contains it, namely a discriminated union container of the bounded types `Face_const_handle`, `Halfedge_const_handle`, and `Vertex_const_hanlde`. The resulting -pairs in the output sequence are sorted in increasing \f$ xy\f$-lexicographical -order of the query points. The function returns a past-the-end iterator of -the output sequence. +pairs in the output sequence are sorted in increasing \f$ xy\f$-lexicographical +order of the query points. The function returns a past-the-end iterator of +the output sequence. \cgalHeading{Requirements} -
      +
      • `InputIterator::value_type` must be `Arrangement_2::Point_2`.
      • `OutputIterator::value_type` must be convertible to `std::pair::%Type>`. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h index 8801d7502377..d54eda4d8e8a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h @@ -4,36 +4,36 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The class `Arr_circle_segment_traits_2` is a model of the `ArrangementTraits_2` concept -and can be used to construct and maintain arrangements of circular arcs -and line segments. - -The traits class must be instantiated with a geometric kernel, such that -the supporting circles of the circular arcs are of type `Kernel::Circle_2` -and the supporting lines of the line segments are of type `Kernel::Line_2`. -Thus, the coordinates of the center of supporting circles, and its squared -radius are of type `Kernel::FT`, which should be an exact rational -number-type; similarly, the coefficients of each supporting line -\f$ ax + by + c = 0\f$ are also of type `Kernel::FT`. Note however that -the intersection point between two such arcs do not have rational coordinates -in general. For this reason, we do not require the endpoints of the input arcs -and segments to have rational coordinates. - -The nested `Point_2` type defined by the traits class is therefore -different than the `Kernel::Point_2` type. Its coordinates are -of type `CoordNT`, which an instantiation of -`Sqrt_extension` where `NT = ROOT = Kernel::FT`. -Moreover, the third and fourth (hidden) template parameters of -`Sqrt_extension` are set to `CGAL::Tag_true`, which -enables efficient comparison among different extensions. - -For more details see the documentation of `Sqrt_extension`. - -While `Arr_circle_segment_traits_2` models the concept -`ArrangementDirectionalXMonotoneTraits_2`, the implementation of -the `Are_mergeable_2` operation does not enforce the input curves -to have the same direction as a precondition. Moreover, `Arr_circle_segment_traits_2` -supports the merging of curves of opposite directions. +The class `Arr_circle_segment_traits_2` is a model of the `ArrangementTraits_2` concept +and can be used to construct and maintain arrangements of circular arcs +and line segments. + +The traits class must be instantiated with a geometric kernel, such that +the supporting circles of the circular arcs are of type `Kernel::Circle_2` +and the supporting lines of the line segments are of type `Kernel::Line_2`. +Thus, the coordinates of the center of supporting circles, and its squared +radius are of type `Kernel::FT`, which should be an exact rational +number-type; similarly, the coefficients of each supporting line +\f$ ax + by + c = 0\f$ are also of type `Kernel::FT`. Note however that +the intersection point between two such arcs do not have rational coordinates +in general. For this reason, we do not require the endpoints of the input arcs +and segments to have rational coordinates. + +The nested `Point_2` type defined by the traits class is therefore +different than the `Kernel::Point_2` type. Its coordinates are +of type `CoordNT`, which an instantiation of +`Sqrt_extension` where `NT = ROOT = Kernel::FT`. +Moreover, the third and fourth (hidden) template parameters of +`Sqrt_extension` are set to `CGAL::Tag_true`, which +enables efficient comparison among different extensions. + +For more details see the documentation of `Sqrt_extension`. + +While `Arr_circle_segment_traits_2` models the concept +`ArrangementDirectionalXMonotoneTraits_2`, the implementation of +the `Are_mergeable_2` operation does not enforce the input curves +to have the same direction as a precondition. Moreover, `Arr_circle_segment_traits_2` +supports the merging of curves of opposite directions. \cgalModels `ArrangementTraits_2` \cgalModels `ArrangementDirectionalXMonotoneTraits_2` @@ -43,139 +43,139 @@ supports the merging of curves of opposite directions. template< typename Kernel > class Arr_circle_segment_traits_2 { -public: +public: /*! -The `Curve_2` class nested within the traits class can represent -arbitrary circular arcs, full circles and line segments and support their -construction in various ways. -The copy and default constructor as well as the assignment operator are -provided. In addition, an `operator<<` for the curves is defined for -standard output streams. +The `Curve_2` class nested within the traits class can represent +arbitrary circular arcs, full circles and line segments and support their +construction in various ways. +The copy and default constructor as well as the assignment operator are +provided. In addition, an `operator<<` for the curves is defined for +standard output streams. */ class Curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -constructs an curve corresponding to the line segment `seg`. -*/ -Curve_2 (const typename Kernel::Segment_2& seg); +constructs an curve corresponding to the line segment `seg`. +*/ +Curve_2 (const typename Kernel::Segment_2& seg); /*! -constructs an curve corresponding to the line segment directed -from `source` to `target`, both having rational coordinates. -*/ -Curve_2 (const typename Kernel::Point_2& source, -const typename Kernel::Point_2& target); +constructs an curve corresponding to the line segment directed +from `source` to `target`, both having rational coordinates. +*/ +Curve_2 (const typename Kernel::Point_2& source, +const typename Kernel::Point_2& target); /*! -constructs an curve corresponding to the line segment supported by -the given line, directed from `source` to `target`. -Note that the two endpoints may have one-root coordinates. -\pre Both endpoints must lie on the given supporting line. -*/ -Curve_2 (const typename Kernel::Line_2& line, -const Point_2& source, -const Point_2& target); +constructs an curve corresponding to the line segment supported by +the given line, directed from `source` to `target`. +Note that the two endpoints may have one-root coordinates. +\pre Both endpoints must lie on the given supporting line. +*/ +Curve_2 (const typename Kernel::Line_2& line, +const Point_2& source, +const Point_2& target); /*! -constructs an curve corresponding to the given circle. `circ` -has a center point with rational coordinates and its squared -radius is rational. -*/ -Curve_2 (const typename Kernel::Circle_2& circ); +constructs an curve corresponding to the given circle. `circ` +has a center point with rational coordinates and its squared +radius is rational. +*/ +Curve_2 (const typename Kernel::Circle_2& circ); /*! -constructs an curve corresponding to a circle centered at the rational -point `c` whose radius `r` is rational. -*/ -Curve_2 (const typename Kernel::Point_2& c, -const typename Kernel::FT& r, -Orientation orient = COUNTERCLOCKWISE); +constructs an curve corresponding to a circle centered at the rational +point `c` whose radius `r` is rational. +*/ +Curve_2 (const typename Kernel::Point_2& c, +const typename Kernel::FT& r, +Orientation orient = COUNTERCLOCKWISE); /*! -constructs a circular arc supported by `circ`, which has a -center point with rational coordinates and whose squared -radius is rational, with the given endpoints. The orientation of the -arc is the same as the orientation of `circ`. -\pre Both endpoints must lie on the given supporting circle. -*/ -Curve_2 (const typename Kernel::Circle_2& circ, -const Point_2& source, const Point_2& target); +constructs a circular arc supported by `circ`, which has a +center point with rational coordinates and whose squared +radius is rational, with the given endpoints. The orientation of the +arc is the same as the orientation of `circ`. +\pre Both endpoints must lie on the given supporting circle. +*/ +Curve_2 (const typename Kernel::Circle_2& circ, +const Point_2& source, const Point_2& target); /*! -constructs a circular arc supported by a circle centered at the rational -point `c` whose radius `r` is rational, directed from -`source` to `target` with the given orientation. -\pre Both endpoints must lie on the supporting circle. -*/ -Curve_2 (const typename Kernel::Point_2& c, -const typename Kernel::FT& r, -Orientation orient, -const Point_2& source, const Point_2& target); +constructs a circular arc supported by a circle centered at the rational +point `c` whose radius `r` is rational, directed from +`source` to `target` with the given orientation. +\pre Both endpoints must lie on the supporting circle. +*/ +Curve_2 (const typename Kernel::Point_2& c, +const typename Kernel::FT& r, +Orientation orient, +const Point_2& source, const Point_2& target); /*! -constructs an circular arc whose endpoints are `source` and -`target` that passes through `mid`. All three points have -rational coordinates. -\pre The three points must not be collinear. -*/ -Curve_2 (const typename Kernel::Point_2& source, -const typename Kernel::Point_2& mid, -const typename Kernel::Point_2& target); +constructs an circular arc whose endpoints are `source` and +`target` that passes through `mid`. All three points have +rational coordinates. +\pre The three points must not be collinear. +*/ +Curve_2 (const typename Kernel::Point_2& source, +const typename Kernel::Point_2& mid, +const typename Kernel::Point_2& target); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -indicates whether the curve represents a full circle. -*/ -bool is_full() const; +indicates whether the curve represents a full circle. +*/ +bool is_full() const; /*! -returns the source point. -\pre `cv` is not a full circle. -*/ -const Point_2& source() const; +returns the source point. +\pre `cv` is not a full circle. +*/ +const Point_2& source() const; /*! -returns the target point. -\pre `cv` is not a full circle. -*/ -const Point_2& target() const; +returns the target point. +\pre `cv` is not a full circle. +*/ +const Point_2& target() const; /*! -returns the orientation of the curve (`COLLINEAR` in case of -line segments). -*/ -Orientation orientation() const; +returns the orientation of the curve (`COLLINEAR` in case of +line segments). +*/ +Orientation orientation() const; /*! -determines whether `cv` is a line segment. -*/ -bool is_linear () const; +determines whether `cv` is a line segment. +*/ +bool is_linear () const; /*! -determines whether `cv` is a circular arc. -*/ -bool is_circular () const; +determines whether `cv` is a circular arc. +*/ +bool is_circular () const; /*! -returns the supporting line of `cv`. -\pre `cv` is a line segment. -*/ -typename Kernel::Line_2 supporting_line() const; +returns the supporting line of `cv`. +\pre `cv` is a line segment. +*/ +typename Kernel::Line_2 supporting_line() const; /*! -returns the supporting circle of `cv`. -\pre `cv` is a circular arc. -*/ -typename Kernel::Circle_2 supporting_circle() const; +returns the supporting circle of `cv`. +\pre `cv` is a circular arc. +*/ +typename Kernel::Circle_2 supporting_circle() const; /// @} @@ -183,61 +183,61 @@ typename Kernel::Circle_2 supporting_circle() const; /*! -The `Point_2` number-type nested within the traits class represents -a Cartesian point whose coordinates are algebraic numbers of type -`CoordNT`. +The `Point_2` number-type nested within the traits class represents +a Cartesian point whose coordinates are algebraic numbers of type +`CoordNT`. */ class Point_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the `Kernel::FT` type. -*/ -typedef unspecified_type Rational; +the `Kernel::FT` type. +*/ +typedef unspecified_type Rational; /*! -the algebraic number-type. -*/ -typedef unspecified_type CoordNT; +the algebraic number-type. +*/ +typedef unspecified_type CoordNT; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Point_2 (); +default constructor. +*/ +Point_2 (); /*! -creates the point \f$ (x,y)\f$. -*/ -Point_2 (const Rational& x, const Rational& y); +creates the point \f$ (x,y)\f$. +*/ +Point_2 (const Rational& x, const Rational& y); /*! -creates the point \f$ (x,y)\f$. -*/ -Point_2 (const CoordNT& x, const CoordNT& y); +creates the point \f$ (x,y)\f$. +*/ +Point_2 (const CoordNT& x, const CoordNT& y); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the \f$ x\f$-coordinate. -*/ -CoordNT x () const; +returns the \f$ x\f$-coordinate. +*/ +CoordNT x () const; /*! -returns the \f$ y\f$-coordinate. -*/ -CoordNT y () const; +returns the \f$ y\f$-coordinate. +*/ +CoordNT y () const; /// @} @@ -245,110 +245,110 @@ CoordNT y () const; /*! -The `X_monotone_curve_2` class nested within the traits class can -represent \f$ x\f$-monotone and line segments (which are always weakly \f$ x\f$-monotone). -The copy and default constructor as well as the assignment operator are -provided. In addition, an `operator<<` for the curves is defined for -standard output streams. +The `X_monotone_curve_2` class nested within the traits class can +represent \f$ x\f$-monotone and line segments (which are always weakly \f$ x\f$-monotone). +The copy and default constructor as well as the assignment operator are +provided. In addition, an `operator<<` for the curves is defined for +standard output streams. */ class X_monotone_curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -constructs an curve corresponding to the line segment directed -from `source` to `target`, both having rational coordinates. -*/ -X_monotone_curve_2 (const typename Kernel::Point_2& source, -const typename Kernel::Point_2& target); +constructs an curve corresponding to the line segment directed +from `source` to `target`, both having rational coordinates. +*/ +X_monotone_curve_2 (const typename Kernel::Point_2& source, +const typename Kernel::Point_2& target); /*! -constructs an curve corresponding to the line segment supported by -the given line, directed from `source` to `target`. -Note that the two endpoints may have one-root coordinates. -\pre Both endpoints must lie on the given supporting line. -*/ -X_monotone_curve_2 (const typename Kernel::Line_2& line, -const Point_2& source, -const Point_2& target); +constructs an curve corresponding to the line segment supported by +the given line, directed from `source` to `target`. +Note that the two endpoints may have one-root coordinates. +\pre Both endpoints must lie on the given supporting line. +*/ +X_monotone_curve_2 (const typename Kernel::Line_2& line, +const Point_2& source, +const Point_2& target); /*! -constructs a circular arc supported by `circ`, which has a -center point with rational coordinates and whose squared -radius is rational, with the given endpoints. The orientation of the -arc is determined by `orient`. -\pre Both endpoints must lie on the given supporting circle. -\pre The circular arc is \f$ x\f$-monotone. -*/ -X_monotone_curve_2 (const typename Kernel::Circle_2& circ, -const Point_2& source, const Point_2& target, -Orientation orient); +constructs a circular arc supported by `circ`, which has a +center point with rational coordinates and whose squared +radius is rational, with the given endpoints. The orientation of the +arc is determined by `orient`. +\pre Both endpoints must lie on the given supporting circle. +\pre The circular arc is \f$ x\f$-monotone. +*/ +X_monotone_curve_2 (const typename Kernel::Circle_2& circ, +const Point_2& source, const Point_2& target, +Orientation orient); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the source point of `xcv`. -*/ -const Point_2& source() const; +returns the source point of `xcv`. +*/ +const Point_2& source() const; /*! -returns the target point of `xcv`. -*/ -const Point_2& target() const; +returns the target point of `xcv`. +*/ +const Point_2& target() const; /*! -returns true if `xcv` is directed right, false otherwise. -*/ -bool is_directed_right () const; +returns true if `xcv` is directed right, false otherwise. +*/ +bool is_directed_right () const; /*! -returns the left (lexicographically smaller) endpoint of `xcv`. -*/ -const Point_2& left() const; +returns the left (lexicographically smaller) endpoint of `xcv`. +*/ +const Point_2& left() const; /*! -returns the right (lexicographically larger) endpoint of `xcv`. -*/ -const Point_2& right() const; +returns the right (lexicographically larger) endpoint of `xcv`. +*/ +const Point_2& right() const; /*! -returns the orientation of the curve (`COLLINEAR` in case of -line segments). -*/ -Orientation orientation() const; +returns the orientation of the curve (`COLLINEAR` in case of +line segments). +*/ +Orientation orientation() const; /*! -determines whether `xcv` is a line segment. -*/ -bool is_linear () const; +determines whether `xcv` is a line segment. +*/ +bool is_linear () const; /*! -determines whether `xcv` is a circular arc. -*/ -bool is_circular () const; +determines whether `xcv` is a circular arc. +*/ +bool is_circular () const; /*! -returns the supporting line of `xcv`. -\pre `xcv` is a line segment. -*/ -typename Kernel::Line_2 supporting_line() const; +returns the supporting line of `xcv`. +\pre `xcv` is a line segment. +*/ +typename Kernel::Line_2 supporting_line() const; /*! -returns the supporting circle of `xcv`. -\pre `xcv` is a circular arc. -*/ -typename Kernel::Circle_2 supporting_circle() const; +returns the supporting circle of `xcv`. +\pre `xcv` is a circular arc. +*/ +typename Kernel::Circle_2 supporting_circle() const; /*! -returns a bounding box of the arc `xcv`. -*/ -Bbox_2 bbox() const; +returns a bounding box of the arc `xcv`. +*/ +Bbox_2 bbox() const; /// @} @@ -356,15 +356,15 @@ Bbox_2 bbox() const; class Trim_2{ public: -/// \name Creation +/// \name Creation /// @{ /*! Trims the given x-monotone curve to an from src to tgt. -\ pre `src` and `tgt` lies on the curve -*/ +\ pre `src` and `tgt` lies on the curve +*/ -X_monotone_curve_2(const X_monotone_curve_2& xcv, +X_monotone_curve_2(const X_monotone_curve_2& xcv, const Point_2& src, const Point_2& tgt)const /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h index f8b00a1cc105..f8307dbca1b0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h @@ -4,9 +4,9 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -This class is a traits class for \cgal arrangements, built on top of a model of -concept `CircularKernel`. -It provides curves of type `CGAL::Circular_arc_2`. +This class is a traits class for \cgal arrangements, built on top of a model of +concept `CircularKernel`. +It provides curves of type `CGAL::Circular_arc_2`. \cgalModels `ArrangementTraits_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h index 586da53ba08d..b12a51541cf4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h @@ -4,13 +4,13 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -This class is a traits class for \cgal arrangements, built on top of a -model of concept `CircularKernel`. It provides curves that can be -of both types -`CGAL::Line_arc_2` or -`CGAL::Circular_arc_2`. +This class is a traits class for \cgal arrangements, built on top of a +model of concept `CircularKernel`. It provides curves that can be +of both types +`CGAL::Line_arc_2` or +`CGAL::Circular_arc_2`. -It uses the boost::variant. +It uses the boost::variant. \cgalModels `ArrangementTraits_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h index edc4262b5cad..36af11a5e52a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h @@ -4,74 +4,74 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The class `Arr_conic_traits_2` is a model of the `ArrangementTraits_2` concept -and can be used to construct and maintain arrangements of bounded segments of -algebraic curves of degree \f$ 2\f$ at most, also known as conic curves. - -A general conic curve \f$ C\f$ is the locus of all points \f$ (x,y)\f$ satisfying the -equation: \f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$, where: -
          -
        • If \f$ 4 r s - t^2 > 0\f$, \f$ C\f$ is an ellipse. -A special case occurs when \f$ r = s\f$ and \f$ t = 0\f$, when \f$ C\f$ -becomes a circle. -
        • If \f$ 4 r s - t^2 < 0\f$, \f$ C\f$ is a hyperbola. -
        • If \f$ 4 r s - t^2 = 0\f$, \f$ C\f$ is a parabola. -A degenerate case occurs when \f$ r = s = t = 0\f$, when \f$ C\f$ is a line. -
        - -A bounded conic arc is defined as either of the following: -
          -
        • A full ellipse (or a circle) \f$ C\f$. -
        • The tuple \f$ \langle C, p_s, p_t, o \rangle\f$, where \f$ C\f$ is the supporting -conic curve, with the arc endpoints being \f$ p_s\f$ and \f$ p_t\f$ -(the source and target points, respectively). The orientation \f$ o\f$ -indicates whether we proceed from \f$ p_s\f$ to \f$ p_t\f$ in a clockwise or in a -counterclockwise direction. Note that \f$ C\f$ may also -correspond to a line or to pair of lines - in this case \f$ o\f$ may -specify a `COLLINEAR` orientation. -
        - -A very useful subset of the set of conic arcs are line segments and circular -arcs, as arrangements of circular arcs and line segments have some -interesting applications (e.g. offsetting polygons, motion planning for a -disc robot, etc.). Circular arcs and line segment are simpler objects and can -be dealt with more efficiently than arbitrary arcs. For these reasons, it is -possible to construct conic arcs from segments and from circles. Using these -constructors is highly recommended: It is more straightforward and also speeds -up the arrangement construction. However, in case the set of input curves -contain only circular arcs and line segments, it is recommended to use the -`Arr_circle_segment_2` class to achieve faster running times. - -In our representation, all conic coefficients (namely \f$ r, s, t, u, v, w\f$) -must be rational numbers. This guarantees that the coordinates of all -arrangement vertices (in particular, those representing intersection -points) are algebraic numbers of degree \f$ 4\f$ (a real number \f$ \alpha\f$ -is an algebraic number of degree \f$ d\f$ if there exist a polynomial \f$ p\f$ with -integer coefficient of degree \f$ d\f$ such that \f$ p(\alpha) = 0\f$). -We therefore require separate representations of the curve coefficients and -the point coordinates. The `NtTraits` should be instantiated with a class -that defines nested `Integer`, `Rational` and `Algebraic` -number types and supports various operations on them, yielding certified -computation results (for example, it can convert rational numbers to algebraic -numbers and can compute roots of polynomials with integer coefficients). -The other template parameters, `RatKernel` and `AlgKernel` should be -geometric kernels templated with the `NtTraits::Rational` and -`NtTraits::Algebraic` number types, respectively. -It is recommended to instantiate the `CORE_algebraic_number_traits` -class as the `NtTraits` parameter, with -`Cartesian` and `Cartesian` -instantiating the two kernel types, respectively. -The number types in this case are provided by the Core library, with its -ability to exactly represent simple algebraic numbers. - -The traits class inherits its point type from `AlgKernel::Point_2`, -and defines a curve and \f$ x\f$-monotone curve types, as detailed below. - -While the `Arr_conic_traits_2` models the concept -`ArrangementDirectionalXMonotoneTraits_2`, the implementation of -the `Are_mergeable_2` operation does not enforce the input curves -to have the same direction as a precondition. Moreover, `Arr_conic_traits_2` -supports the merging of curves of opposite directions. +The class `Arr_conic_traits_2` is a model of the `ArrangementTraits_2` concept +and can be used to construct and maintain arrangements of bounded segments of +algebraic curves of degree \f$ 2\f$ at most, also known as conic curves. + +A general conic curve \f$ C\f$ is the locus of all points \f$ (x,y)\f$ satisfying the +equation: \f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$, where: +
          +
        • If \f$ 4 r s - t^2 > 0\f$, \f$ C\f$ is an ellipse. +A special case occurs when \f$ r = s\f$ and \f$ t = 0\f$, when \f$ C\f$ +becomes a circle. +
        • If \f$ 4 r s - t^2 < 0\f$, \f$ C\f$ is a hyperbola. +
        • If \f$ 4 r s - t^2 = 0\f$, \f$ C\f$ is a parabola. +A degenerate case occurs when \f$ r = s = t = 0\f$, when \f$ C\f$ is a line. +
        + +A bounded conic arc is defined as either of the following: +
          +
        • A full ellipse (or a circle) \f$ C\f$. +
        • The tuple \f$ \langle C, p_s, p_t, o \rangle\f$, where \f$ C\f$ is the supporting +conic curve, with the arc endpoints being \f$ p_s\f$ and \f$ p_t\f$ +(the source and target points, respectively). The orientation \f$ o\f$ +indicates whether we proceed from \f$ p_s\f$ to \f$ p_t\f$ in a clockwise or in a +counterclockwise direction. Note that \f$ C\f$ may also +correspond to a line or to pair of lines - in this case \f$ o\f$ may +specify a `COLLINEAR` orientation. +
        + +A very useful subset of the set of conic arcs are line segments and circular +arcs, as arrangements of circular arcs and line segments have some +interesting applications (e.g. offsetting polygons, motion planning for a +disc robot, etc.). Circular arcs and line segment are simpler objects and can +be dealt with more efficiently than arbitrary arcs. For these reasons, it is +possible to construct conic arcs from segments and from circles. Using these +constructors is highly recommended: It is more straightforward and also speeds +up the arrangement construction. However, in case the set of input curves +contain only circular arcs and line segments, it is recommended to use the +`Arr_circle_segment_2` class to achieve faster running times. + +In our representation, all conic coefficients (namely \f$ r, s, t, u, v, w\f$) +must be rational numbers. This guarantees that the coordinates of all +arrangement vertices (in particular, those representing intersection +points) are algebraic numbers of degree \f$ 4\f$ (a real number \f$ \alpha\f$ +is an algebraic number of degree \f$ d\f$ if there exist a polynomial \f$ p\f$ with +integer coefficient of degree \f$ d\f$ such that \f$ p(\alpha) = 0\f$). +We therefore require separate representations of the curve coefficients and +the point coordinates. The `NtTraits` should be instantiated with a class +that defines nested `Integer`, `Rational` and `Algebraic` +number types and supports various operations on them, yielding certified +computation results (for example, it can convert rational numbers to algebraic +numbers and can compute roots of polynomials with integer coefficients). +The other template parameters, `RatKernel` and `AlgKernel` should be +geometric kernels templated with the `NtTraits::Rational` and +`NtTraits::Algebraic` number types, respectively. +It is recommended to instantiate the `CORE_algebraic_number_traits` +class as the `NtTraits` parameter, with +`Cartesian` and `Cartesian` +instantiating the two kernel types, respectively. +The number types in this case are provided by the Core library, with its +ability to exactly represent simple algebraic numbers. + +The traits class inherits its point type from `AlgKernel::Point_2`, +and defines a curve and \f$ x\f$-monotone curve types, as detailed below. + +While the `Arr_conic_traits_2` models the concept +`ArrangementDirectionalXMonotoneTraits_2`, the implementation of +the `Are_mergeable_2` operation does not enforce the input curves +to have the same direction as a precondition. Moreover, `Arr_conic_traits_2` +supports the merging of curves of opposite directions. \cgalModels `ArrangementTraits_2` \cgalModels `ArrangementLandmarkTraits_2` @@ -85,20 +85,20 @@ template< typename RatKernel, typename AlgKernel, typename NtTraits > class Arr_conic_traits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the `NtTraits::Rational` type -(and also the `RatKernel::FT` type). -*/ -typedef unspecified_type Rational; +the `NtTraits::Rational` type +(and also the `RatKernel::FT` type). +*/ +typedef unspecified_type Rational; /*! -the `NtTraits::Algebraic` type -(and also the `AlgKernel::FT` type). -*/ -typedef unspecified_type Algebraic; +the `NtTraits::Algebraic` type +(and also the `AlgKernel::FT` type). +*/ +typedef unspecified_type Algebraic; /// @} @@ -107,235 +107,235 @@ typedef unspecified_type Algebraic; /*! -The `Curve_2` class nested within the conic-arc traits can represent -arbitrary conic arcs and support their construction in various ways. -The copy and default constructor as well as the assignment operator are -provided for conic arcs. In addition, an `operator<<` -for the curves is defined for standard output streams. +The `Curve_2` class nested within the conic-arc traits can represent +arbitrary conic arcs and support their construction in various ways. +The copy and default constructor as well as the assignment operator are +provided for conic arcs. In addition, an `operator<<` +for the curves is defined for standard output streams. */ class Curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -constructs an arc corresponding to the line segment `seg`. -*/ -Curve_2 (const typename RatKernel::Segment_2& seg); - -/*! -constructs an arc corresponding to the full circle `circ` -(note that this circle has a center point with rational coordinates -and rational squared radius). -*/ -Curve_2 (const typename RatKernel::Circle_2& circ); - -/*! -constructs a circular arc supported by the circle `circ`, going -in the given orientation `o` from the source point `ps` to -its target point `pt`. -\pre `ps` and `pt` both lie on the circle `circ`. -\pre `o` is not `COLLINEAR`. -*/ -Curve_2 (const typename RatKernel::Circle_2& circ, -Orientation o, -const Point_2& ps, -const Point_2& pt); - -/*! -constructs a circular arc going from `p1` (its source point) -through `p2` to `p3` (its target point). Note that all three -points have rational coordinates. The orientation of the arc is -determined automatically. -\pre The three points are not collinear. -*/ -Curve_2 (const typename RatKernel::Point_2& p1, -const typename RatKernel::Point_2& p2, -const typename RatKernel::Point_2& p3); - -/*! -constructs a conic arc that corresponds to the full conic curve -\f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$. -\pre As a conic arc must be bounded, the given curve must be an ellipse, that is \f$ 4 r s - t^2 > 0\f$. -*/ -Curve_2 (const Rational& r, const Rational& s, -const Rational& t, const Rational& u, -const Rational& v, const Rational& w); - -/*! -constructs a conic arc supported by the conic curve -\f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$, going -in the given orientation `o` from the source point `ps` to -its target point `pt`. -\pre `ps` and `pt` both satisfy the equation of the supporting conic curve and define a bounded segment of this -curve (e.g. in case of a hyperbolic arc, both point should be located on the same branch of the hyperbola). -\pre `o` is not `COLLINEAR` if the supporting conic is curves, and must be `COLLINEAR` if it is not curved (a line or a line-pair). -*/ -Curve_2 (const Rational& r, const Rational& s, -const Rational& t, const Rational& u, -const Rational& v, const Rational& w, -Orientation o, -const Point_2& ps, -const Point_2& pt); - -/*! -constructs a conic arc going from `p1` (its source point) -through `p2`, `p3` and `p4` (in this order) to `p5` -(its target point). Note that all five points have rational coordinates. -The orientation of the arc is determined automatically. -\pre No three points of the five are not collinear. -\pre The five points define a valid arc, in their given order. -*/ -Curve_2 (const typename RatKernel::Point_2& p1, -const typename RatKernel::Point_2& p2, -const typename RatKernel::Point_2& p3, -const typename RatKernel::Point_2& p4, -const typename RatKernel::Point_2& p5); - -/*! -constructs a conic arc supported by the conic curve -\f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$, going -in the given orientation `o` from its source point to its target -Point. In this case only some approximations of the endpoints -(`app_ps` and `app_pt`, respectively) is available, -and their exact locations are given implicitly, specified by the -intersections of the supporting conic curve with -\f$ r_1 x^2 + s_1 y^2 + t_1 x y + u_1 x + v_1 y + w_1 = 0\f$ and -\f$ r_2 x^2 + s_2 y^2 + t_2 x y + u_2 x + v_2 y + w_2 = 0\f$, respectively. -\pre The two auxiliary curves specifying the endpoints really intersect with the supporting conic curve, -such that the arc endpoints define a bounded segment of the supporting -curve (e.g. in case of a hyperbolic arc, both point should be located on the same branch of the hyperbola). -\pre `o` is not `COLLINEAR` if the supporting conic is curves, and must be `COLLINEAR` if it is not curved (a line or a line-pair). -*/ -Curve_2 (const Rational& r, const Rational& s, -const Rational& t, const Rational& u, -const Rational& v, const Rational& w, -Orientation o, -const Point_2& app_ps, -const Rational& r1, const Rational& s1, -const Rational& t1, const Rational& u1, -const Rational& v1, const Rational& w1, -const Point_2& app_pt, -const Rational& r2, const Rational& s2, -const Rational& t2, const Rational& u2, -const Rational& v2, const Rational& w2); - -/// @} - -/// \name Access Functions +constructs an arc corresponding to the line segment `seg`. +*/ +Curve_2 (const typename RatKernel::Segment_2& seg); + +/*! +constructs an arc corresponding to the full circle `circ` +(note that this circle has a center point with rational coordinates +and rational squared radius). +*/ +Curve_2 (const typename RatKernel::Circle_2& circ); + +/*! +constructs a circular arc supported by the circle `circ`, going +in the given orientation `o` from the source point `ps` to +its target point `pt`. +\pre `ps` and `pt` both lie on the circle `circ`. +\pre `o` is not `COLLINEAR`. +*/ +Curve_2 (const typename RatKernel::Circle_2& circ, +Orientation o, +const Point_2& ps, +const Point_2& pt); + +/*! +constructs a circular arc going from `p1` (its source point) +through `p2` to `p3` (its target point). Note that all three +points have rational coordinates. The orientation of the arc is +determined automatically. +\pre The three points are not collinear. +*/ +Curve_2 (const typename RatKernel::Point_2& p1, +const typename RatKernel::Point_2& p2, +const typename RatKernel::Point_2& p3); + +/*! +constructs a conic arc that corresponds to the full conic curve +\f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$. +\pre As a conic arc must be bounded, the given curve must be an ellipse, that is \f$ 4 r s - t^2 > 0\f$. +*/ +Curve_2 (const Rational& r, const Rational& s, +const Rational& t, const Rational& u, +const Rational& v, const Rational& w); + +/*! +constructs a conic arc supported by the conic curve +\f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$, going +in the given orientation `o` from the source point `ps` to +its target point `pt`. +\pre `ps` and `pt` both satisfy the equation of the supporting conic curve and define a bounded segment of this +curve (e.g. in case of a hyperbolic arc, both point should be located on the same branch of the hyperbola). +\pre `o` is not `COLLINEAR` if the supporting conic is curves, and must be `COLLINEAR` if it is not curved (a line or a line-pair). +*/ +Curve_2 (const Rational& r, const Rational& s, +const Rational& t, const Rational& u, +const Rational& v, const Rational& w, +Orientation o, +const Point_2& ps, +const Point_2& pt); + +/*! +constructs a conic arc going from `p1` (its source point) +through `p2`, `p3` and `p4` (in this order) to `p5` +(its target point). Note that all five points have rational coordinates. +The orientation of the arc is determined automatically. +\pre No three points of the five are not collinear. +\pre The five points define a valid arc, in their given order. +*/ +Curve_2 (const typename RatKernel::Point_2& p1, +const typename RatKernel::Point_2& p2, +const typename RatKernel::Point_2& p3, +const typename RatKernel::Point_2& p4, +const typename RatKernel::Point_2& p5); + +/*! +constructs a conic arc supported by the conic curve +\f$ r x^2 + s y^2 + t x y + u x + v y + w = 0\f$, going +in the given orientation `o` from its source point to its target +Point. In this case only some approximations of the endpoints +(`app_ps` and `app_pt`, respectively) is available, +and their exact locations are given implicitly, specified by the +intersections of the supporting conic curve with +\f$ r_1 x^2 + s_1 y^2 + t_1 x y + u_1 x + v_1 y + w_1 = 0\f$ and +\f$ r_2 x^2 + s_2 y^2 + t_2 x y + u_2 x + v_2 y + w_2 = 0\f$, respectively. +\pre The two auxiliary curves specifying the endpoints really intersect with the supporting conic curve, +such that the arc endpoints define a bounded segment of the supporting +curve (e.g. in case of a hyperbolic arc, both point should be located on the same branch of the hyperbola). +\pre `o` is not `COLLINEAR` if the supporting conic is curves, and must be `COLLINEAR` if it is not curved (a line or a line-pair). +*/ +Curve_2 (const Rational& r, const Rational& s, +const Rational& t, const Rational& u, +const Rational& v, const Rational& w, +Orientation o, +const Point_2& app_ps, +const Rational& r1, const Rational& s1, +const Rational& t1, const Rational& u1, +const Rational& v1, const Rational& w1, +const Point_2& app_pt, +const Rational& r2, const Rational& s2, +const Rational& t2, const Rational& u2, +const Rational& v2, const Rational& w2); + +/// @} + +/// \name Access Functions /// @{ /*! -indicates whether `a` is a valid conic arc. As the precondition to -some of the constructor listed above are quite complicated, their -violation does not cause the program to abort. Instead, the constructed -arc is invalid (a defaultly constructed arc is also invalid). -It is however recommended to check that a constructed arc is valid before -inserting it to an arrangement, as this operation will cause the -program to abort. -*/ -bool is_valid() const; +indicates whether `a` is a valid conic arc. As the precondition to +some of the constructor listed above are quite complicated, their +violation does not cause the program to abort. Instead, the constructed +arc is invalid (a defaultly constructed arc is also invalid). +It is however recommended to check that a constructed arc is valid before +inserting it to an arrangement, as this operation will cause the +program to abort. +*/ +bool is_valid() const; /*! -determines whether the arc is \f$ x\f$-monotone, namely each vertical line -intersects it at most once. A vertical line segment is also considered -(weakly) \f$ x\f$-monotone. -*/ -bool is_x_monotone() const; +determines whether the arc is \f$ x\f$-monotone, namely each vertical line +intersects it at most once. A vertical line segment is also considered +(weakly) \f$ x\f$-monotone. +*/ +bool is_x_monotone() const; /*! -determines whether the arc is \f$ y\f$-monotone, namely each horizontal line -intersects it at most once. A horizontal line segment is also considered -(weakly) \f$ x\f$-monotone. -*/ -bool is_y_monotone() const; +determines whether the arc is \f$ y\f$-monotone, namely each horizontal line +intersects it at most once. A horizontal line segment is also considered +(weakly) \f$ x\f$-monotone. +*/ +bool is_y_monotone() const; /*! -indicates whether the arc represents a full conic curve (en ellipse or -a circle). -*/ -bool is_full_conic() const; +indicates whether the arc represents a full conic curve (en ellipse or +a circle). +*/ +bool is_full_conic() const; /// @} /*! \name -The six following methods return the coefficients of the supported conic, after their conversion to integer +The six following methods return the coefficients of the supported conic, after their conversion to integer number (represented by the `Integer` type of the `NtTraits` class): */ /// @{ /*! -returns the coefficient of \f$ x^2\f$. -*/ -const typename NtTraits::Integer& r() const; +returns the coefficient of \f$ x^2\f$. +*/ +const typename NtTraits::Integer& r() const; /*! -returns the coefficient of \f$ t^2\f$. -*/ -const typename NtTraits::Integer& s() const; +returns the coefficient of \f$ t^2\f$. +*/ +const typename NtTraits::Integer& s() const; /*! -returns the coefficient of \f$ x y\f$. -*/ -const typename NtTraits::Integer& t() const; +returns the coefficient of \f$ x y\f$. +*/ +const typename NtTraits::Integer& t() const; /*! -returns the coefficient of \f$ x\f$. -*/ -const typename NtTraits::Integer& u() const; +returns the coefficient of \f$ x\f$. +*/ +const typename NtTraits::Integer& u() const; /*! -returns the coefficient of \f$ y\f$. -*/ -const typename NtTraits::Integer& v() const; +returns the coefficient of \f$ y\f$. +*/ +const typename NtTraits::Integer& v() const; /*! -returns the free coefficient. -*/ -const typename NtTraits::Integer& w() const; +returns the free coefficient. +*/ +const typename NtTraits::Integer& w() const; /*! -returns the source point of the arc. -\pre `a` is not a full conic curve. -*/ -const Point_2& source() const; +returns the source point of the arc. +\pre `a` is not a full conic curve. +*/ +const Point_2& source() const; /*! -returns the target point of the arc. -\pre `a` is not a full conic curve. -*/ -const Point_2& target() const; +returns the target point of the arc. +\pre `a` is not a full conic curve. +*/ +const Point_2& target() const; /*! -returns the orientation of the arc. -*/ -Orientation orientation() const; +returns the orientation of the arc. +*/ +Orientation orientation() const; /*! -return a bounding box of the arc `a`. -*/ -Bbox_2 bbox() const; +return a bounding box of the arc `a`. +*/ +Bbox_2 bbox() const; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -sets a new source point for the conic arc. -\pre `ps` lies on the supporting conic of `a`. -*/ -void set_source (const Point_2 & ps); +sets a new source point for the conic arc. +\pre `ps` lies on the supporting conic of `a`. +*/ +void set_source (const Point_2 & ps); /*! -sets a new target point for the conic arc. -\pre `pt` lies on the supporting conic of `a`. -*/ -void set_target (const Point_2 & pt); +sets a new target point for the conic arc. +\pre `pt` lies on the supporting conic of `a`. +*/ +void set_target (const Point_2 & pt); /// @} @@ -344,42 +344,42 @@ void set_target (const Point_2 & pt); /*! -The `X_monotone_curve_2` class nested within the conic-arc traits is -used to represent \f$ x\f$-monotone conic arcs. It inherits from the `Curve_2` -type, therefore supports the access methods and the operations listed above. +The `X_monotone_curve_2` class nested within the conic-arc traits is +used to represent \f$ x\f$-monotone conic arcs. It inherits from the `Curve_2` +type, therefore supports the access methods and the operations listed above. -For efficiency reasons, we recommend users not to construct \f$ x\f$-monotone -conic arc directly, but rather use the `Make_x_monotone_2` functor -supplied by the conic-arc traits class to convert conic curves to -\f$ x\f$-monotone curves. +For efficiency reasons, we recommend users not to construct \f$ x\f$-monotone +conic arc directly, but rather use the `Make_x_monotone_2` functor +supplied by the conic-arc traits class to convert conic curves to +\f$ x\f$-monotone curves. */ class X_monotone_curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -converts the given arc to an \f$ x\f$-monotone arc. -\pre `arc` is \f$ x\f$-monotone. -*/ -X_monotone_curve_2 (const Curve_2& arc); +converts the given arc to an \f$ x\f$-monotone arc. +\pre `arc` is \f$ x\f$-monotone. +*/ +X_monotone_curve_2 (const Curve_2& arc); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the left (lexicographically smaller) endpoint of `xa`. -*/ -const Point_2& left() const; +returns the left (lexicographically smaller) endpoint of `xa`. +*/ +const Point_2& left() const; /*! -returns the right (lexicographically larger) endpoint of `xa`. -*/ -const Point_2& right() const; +returns the right (lexicographically larger) endpoint of `xa`. +*/ +const Point_2& right() const; /// @} @@ -387,15 +387,15 @@ const Point_2& right() const; class Trim_2{ public: -/// \name Creation +/// \name Creation /// @{ /*! Trims the given x-monotone curve to an from src to tgt. -\ pre `src` and `tgt` lies on the curve -*/ +\ pre `src` and `tgt` lies on the curve +*/ -X_monotone_curve_2(const X_monotone_curve_2& xcv, +X_monotone_curve_2(const X_monotone_curve_2& xcv, const Point_2& src, const Point_2& tgt)const diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h index ab71d28ecc9e..bbf6205037d8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h @@ -4,61 +4,61 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The class `Arr_consolidated_curve_data_traits_2` is a model of the concept `ArrangementTraits_2`, -and serves as a decorator class that enables the extension of the curve -type defined by the `Traits` parameter. The traits class inherits its -point type from `Traits::Point_2`, and defines the types -`Curve_2` and `X_monotone_curve_2` extended with extraneous data -fields of type `Data`. - -Each `Curve_2` object is associated with a single data field of type -`Data`, and each `X_monotone_curve_2` object is associated with -a set of unique data objects. When a curve is subdivided into \f$ x\f$-monotone -subcurves, all resulting subcurves are associated with a list containing -a single data object, copied from the inducing curve. When an \f$ x\f$-monotone -curve is split, its data set is duplicated, and inserted into the sets of -both resulting subcurves. In case two (or more) \f$ x\f$-monotone curves -overlap, their data sets are consolidated, and are inserted into the set -of the \f$ x\f$-monotone curve that represents the overlap. +The class `Arr_consolidated_curve_data_traits_2` is a model of the concept `ArrangementTraits_2`, +and serves as a decorator class that enables the extension of the curve +type defined by the `Traits` parameter. The traits class inherits its +point type from `Traits::Point_2`, and defines the types +`Curve_2` and `X_monotone_curve_2` extended with extraneous data +fields of type `Data`. + +Each `Curve_2` object is associated with a single data field of type +`Data`, and each `X_monotone_curve_2` object is associated with +a set of unique data objects. When a curve is subdivided into \f$ x\f$-monotone +subcurves, all resulting subcurves are associated with a list containing +a single data object, copied from the inducing curve. When an \f$ x\f$-monotone +curve is split, its data set is duplicated, and inserted into the sets of +both resulting subcurves. In case two (or more) \f$ x\f$-monotone curves +overlap, their data sets are consolidated, and are inserted into the set +of the \f$ x\f$-monotone curve that represents the overlap. \cgalModels `ArrangementTraits_2` */ template< typename Traits, typename Data > -class Arr_consolidated_curve_data_traits_2 - : public Arr_curve_data_traits_2, - _Consolidate_unique_lists, +class Arr_consolidated_curve_data_traits_2 + : public Arr_curve_data_traits_2, + _Consolidate_unique_lists, Data> { public: -/// \name Types +/// \name Types /// @{ /*! -the base traits-class. -*/ -typedef Traits Base_traits_2; +the base traits-class. +*/ +typedef Traits Base_traits_2; /*! -the base curve. -*/ -typedef typename Base_traits_2::Curve_2 Base_curve_2; +the base curve. +*/ +typedef typename Base_traits_2::Curve_2 Base_curve_2; /*! -the base \f$ x\f$-monotone curve curve. -*/ -typedef typename Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2; +the base \f$ x\f$-monotone curve curve. +*/ +typedef typename Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2; /*! -a set of data objects that is associated with an \f$ x\f$-monotone curve. -*/ -typedef unspecified_type typedef Data_container; +a set of data objects that is associated with an \f$ x\f$-monotone curve. +*/ +typedef unspecified_type typedef Data_container; /*! -a non-mutable iterator for the data objects in the data container. -*/ -typedef unspecified_type typedef Data_iterator; +a non-mutable iterator for the data objects in the data container. +*/ +typedef unspecified_type typedef Data_iterator; /// @} @@ -66,99 +66,99 @@ typedef unspecified_type typedef Data_iterator; /*! -The `Data_container` class nested within the consolidated -curve-data traits and associated with the `Traits::X_monotone_curve_2` -type is maintained as a list with unique data objects. This representation is -simple and efficient in terms of memory consumption. It also requires that -the `Data` class supports only the equality operator. Note however that -most set operations require linear time. +The `Data_container` class nested within the consolidated +curve-data traits and associated with the `Traits::X_monotone_curve_2` +type is maintained as a list with unique data objects. This representation is +simple and efficient in terms of memory consumption. It also requires that +the `Data` class supports only the equality operator. Note however that +most set operations require linear time. */ class Data_container { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Data_container (); +default constructor. +*/ +Data_container (); /*! -constructs set containing a single `data` object. -*/ -Data_container (const Data& data); +constructs set containing a single `data` object. +*/ +Data_container (const Data& data); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the number of data objects in the set. -*/ -std::size_t size () const; +returns the number of data objects in the set. +*/ +std::size_t size () const; /*! -returns an iterator pointing to the first data object. -*/ -Data_iterator begin () const; +returns an iterator pointing to the first data object. +*/ +Data_iterator begin () const; /*! -returns a past-the-end iterator for the data objects. -*/ -Data_iterator end () const; +returns a past-the-end iterator for the data objects. +*/ +Data_iterator end () const; /*! -returns the first data object inserted into the set. -\pre The number of data objects is not \f$ 0\f$. -*/ -const Data& front () const; +returns the first data object inserted into the set. +\pre The number of data objects is not \f$ 0\f$. +*/ +const Data& front () const; /*! -returns the last data object inserted into the set. -\pre The number of data objects is not \f$ 0\f$. -*/ -const Data& back () const; +returns the last data object inserted into the set. +\pre The number of data objects is not \f$ 0\f$. +*/ +const Data& back () const; -/// @} +/// @} -/// \name Predicates +/// \name Predicates /// @{ /*! -check if the two sets contain the same data objects (regardless of order). -*/ -bool operator== (const Data_container& other) const; +check if the two sets contain the same data objects (regardless of order). +*/ +bool operator== (const Data_container& other) const; /*! -find the given `data` object in the set and returns an iterator -for this object, or `end()` if it is not found. -*/ -Data_iterator find (const Data& data); +find the given `data` object in the set and returns an iterator +for this object, or `end()` if it is not found. +*/ +Data_iterator find (const Data& data); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -inserts the given `data` object into the set. Returns `true` on -success, or `false` if the set already contains the object. -*/ -bool insert (const Data& data); +inserts the given `data` object into the set. Returns `true` on +success, or `false` if the set already contains the object. +*/ +bool insert (const Data& data); /*! -erases the given `data` object from the set. Returns `true` on -success, or `false` if the set does not contain the object. -*/ -bool erase (const Data& data); +erases the given `data` object from the set. Returns `true` on +success, or `false` if the set does not contain the object. +*/ +bool erase (const Data& data); /*! -clears the set. -*/ -void clear (); +clears the set. +*/ +void clear (); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h index eb94a838578d..d441c4511fd4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h @@ -4,54 +4,54 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The class `Arr_curve_data_traits_2` is a model of the `ArrangementTraits_2` concept -and serves as a decorator class that allows the extension of the curves -defined by the base traits-class (the `Tr` parameter), which serves as a -geometric traits-class (a model of the `ArrangementTraits_2` concept), with -extraneous (non-geometric) data fields. - -The traits class inherits its point type from `Traits::Point_2`, -and defines an extended `Curve_2` and `X_monotone_curve_2` types, -as detailed below. - -Each `Curve_2` object is associated with a single data field of type -`CData`, and each `X_monotone_curve_2` object is associated with -a single data field of type `XData`. When a curve is -subdivided into \f$ x\f$-monotone subcurves, its data field is converted using -the conversion functor, which is specified by the `Cnv` template-parameter, -and the resulting objects is copied to all `X_monotone_curve_2` objects -induced by this curve. The conversion functor should provide an operator with -the following prototype: - -`XData operator() (const CData& d) const;` - -By default, the two data types are the same, so the conversion operator -is trivial: +The class `Arr_curve_data_traits_2` is a model of the `ArrangementTraits_2` concept +and serves as a decorator class that allows the extension of the curves +defined by the base traits-class (the `Tr` parameter), which serves as a +geometric traits-class (a model of the `ArrangementTraits_2` concept), with +extraneous (non-geometric) data fields. + +The traits class inherits its point type from `Traits::Point_2`, +and defines an extended `Curve_2` and `X_monotone_curve_2` types, +as detailed below. + +Each `Curve_2` object is associated with a single data field of type +`CData`, and each `X_monotone_curve_2` object is associated with +a single data field of type `XData`. When a curve is +subdivided into \f$ x\f$-monotone subcurves, its data field is converted using +the conversion functor, which is specified by the `Cnv` template-parameter, +and the resulting objects is copied to all `X_monotone_curve_2` objects +induced by this curve. The conversion functor should provide an operator with +the following prototype: + +`XData operator() (const CData& d) const;` + +By default, the two data types are the same, so the conversion operator +is trivial: -
        -`CData` = +`CData` = -`XData` +`XData`
        -`Cnv` = +`Cnv` = -`_Default_convert_functor` +`_Default_convert_functor`
        + -In case two (or more) \f$ x\f$-monotone curves overlap, their data fields are -merged to a single field, using the merge functor functor, which is -specified by the `Mrg` template-parameter. This functor should provide -an operator with the following prototype: +In case two (or more) \f$ x\f$-monotone curves overlap, their data fields are +merged to a single field, using the merge functor functor, which is +specified by the `Mrg` template-parameter. This functor should provide +an operator with the following prototype: -`XData operator() (const XData& d1, const XData& d2) const;` +`XData operator() (const XData& d1, const XData& d2) const;` -which returns a single data object that represents the merged data field -of `d1` and `d2`. The \f$ x\f$-monotone curve that represents the overlap -is associated with the output of this functor. +which returns a single data object that represents the merged data field +of `d1` and `d2`. The \f$ x\f$-monotone curve that represents the overlap +is associated with the output of this functor. \cgalModels `ArrangementTraits_2` */ @@ -59,43 +59,43 @@ template< typename Tr, typename XData, typename Mrg, typename CData, typename Cn class Arr_curve_data_traits_2 : public Tr { public: -/// \name Types +/// \name Types /// @{ /*! -the base traits-class. -*/ -typedef Tr Base_traits_2; +the base traits-class. +*/ +typedef Tr Base_traits_2; /*! -the base curve. -*/ -typedef typename Base_traits_2::Curve_2 Base_curve_2; +the base curve. +*/ +typedef typename Base_traits_2::Curve_2 Base_curve_2; /*! -the base \f$ x\f$-monotone curve curve. -*/ -typedef typename Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2; +the base \f$ x\f$-monotone curve curve. +*/ +typedef typename Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2; /*! -the merge functor. -*/ -typedef Mrg Merge; +the merge functor. +*/ +typedef Mrg Merge; /*! -the conversion functor. -*/ -typedef Cnv Convert; +the conversion functor. +*/ +typedef Cnv Convert; /*! -the type of data associated with curves. -*/ -typedef CData Curve_data; +the type of data associated with curves. +*/ +typedef CData Curve_data; /*! -the type of data associated with \f$ x\f$-monotone curves. -*/ -typedef XData X_monotone_curve_data; +the type of data associated with \f$ x\f$-monotone curves. +*/ +typedef XData X_monotone_curve_data; /// @} @@ -103,9 +103,9 @@ typedef XData X_monotone_curve_data; /*! -The `Curve_2` class nested within the curve-data traits -extends the `Base_traits_2::Curve_2` type with an extra data field of type -`Data`. +The `Curve_2` class nested within the curve-data traits +extends the `Base_traits_2::Curve_2` type with an extra data field of type +`Data`. */ class Curve_2 @@ -113,41 +113,41 @@ class Curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Curve_2 (); +default constructor. +*/ +Curve_2 (); /*! -constructs curve from the given `base` curve with uninitialized -data field. -*/ -Curve_2 (const Base_curve_2& base); +constructs curve from the given `base` curve with uninitialized +data field. +*/ +Curve_2 (const Base_curve_2& base); /*! -constructs curve from the given `base` curve with an attached -`data` field. -*/ -Curve_2 (const Base_curve_2& base, const Data& data); +constructs curve from the given `base` curve with an attached +`data` field. +*/ +Curve_2 (const Base_curve_2& base, const Data& data); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the data field (a non-const version, which returns a reference -to the data object, is also available). -*/ -const Curve_data& data () const; +returns the data field (a non-const version, which returns a reference +to the data object, is also available). +*/ +const Curve_data& data () const; /*! -sets the data field. -*/ -void set_data (const Curve_data& data); +sets the data field. +*/ +void set_data (const Curve_data& data); /// @} @@ -156,49 +156,49 @@ void set_data (const Curve_data& data); /*! -The `X_monotone_curve_2` class nested within the -curve-data traits extends the `Base_traits_2::X_monotone_curve_2` type -with an extra data field. +The `X_monotone_curve_2` class nested within the +curve-data traits extends the `Base_traits_2::X_monotone_curve_2` type +with an extra data field. */ class X_monotone_curve_2 : public Base_x_monotone_curve_2 { public: -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -X_monotone_curve_2 (); +default constructor. +*/ +X_monotone_curve_2 (); /*! -constructs an \f$ x\f$-monotone curve from the given `base` curve with -uninitialized data field. -*/ -X_monotone_curve_2 (const Base_x_monotone_curve_2& base); +constructs an \f$ x\f$-monotone curve from the given `base` curve with +uninitialized data field. +*/ +X_monotone_curve_2 (const Base_x_monotone_curve_2& base); /*! -constructs an \f$ x\f$-monotone curve from the given `base` \f$ x\f$-monotone -curve with an attached `data` field. -*/ -X_monotone_curve_2 (const Base_x_monotone_curve_2& base, -const X_monotone_curve_data& data); +constructs an \f$ x\f$-monotone curve from the given `base` \f$ x\f$-monotone +curve with an attached `data` field. +*/ +X_monotone_curve_2 (const Base_x_monotone_curve_2& base, +const X_monotone_curve_data& data); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the field (a non-const version, which returns a reference -to the data object, is also available). -*/ -const X_monotone_curve_data& data () const; +returns the field (a non-const version, which returns a reference +to the data object, is also available). +*/ +const X_monotone_curve_data& data () const; /*! -sets the data field. -*/ -void set_data (const X_monotone_curve_data& data); +sets the data field. +*/ +void set_data (const X_monotone_curve_data& data); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h index da8b6d0e672e..4697a9c2bc36 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h @@ -4,17 +4,17 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -\anchor arr_refarr_dcel_base - -The `Arr_dcel_base` class is an important ingredient in the -definition of Dcel data structures. It serves as a basis class for -any instance of the `Dcel` template parameter of the -`Arrangement_2` template. In particular it is the basis class of -the default `Dcel` template parameter, and the basis class of any -extended Dcel. The template parameters `V`, `H`, and `F` -must be instantiated with models of the concepts -`ArrangementDcelVertex`, `ArrangementDcelHalfedge`, -and `ArrangementDcelFace` respectively. +\anchor arr_refarr_dcel_base + +The `Arr_dcel_base` class is an important ingredient in the +definition of Dcel data structures. It serves as a basis class for +any instance of the `Dcel` template parameter of the +`Arrangement_2` template. In particular it is the basis class of +the default `Dcel` template parameter, and the basis class of any +extended Dcel. The template parameters `V`, `H`, and `F` +must be instantiated with models of the concepts +`ArrangementDcelVertex`, `ArrangementDcelHalfedge`, +and `ArrangementDcelFace` respectively. \cgalModels `ArrangementDcel` @@ -26,8 +26,8 @@ class Arr_dcel_base { /*! -The basic Dcel face type. Serves as a basis class for an extended -face record with auxiliary data fields. +The basic Dcel face type. Serves as a basis class for an extended +face record with auxiliary data fields. \cgalModels `ArrangementDcelFace` @@ -39,9 +39,9 @@ class Arr_face_base { /*! -The basic Dcel halfedge type. Serves as a basis class for an -extended halfedge record with auxiliary data fields. The `Curve` -parameter is the type of \f$ x\f$-monotone curves associated with the vertices. +The basic Dcel halfedge type. Serves as a basis class for an +extended halfedge record with auxiliary data fields. The `Curve` +parameter is the type of \f$ x\f$-monotone curves associated with the vertices. \cgalModels `ArrangementDcelHalfedge` @@ -54,9 +54,9 @@ class Arr_halfedge_base { /*! -The basic Dcel vertex type. Serves as a basis class for an extended -vertex record with auxiliary data fields. The `Point` parameter is -the type of points associated with the vertices. +The basic Dcel vertex type. Serves as a basis class for an extended +vertex record with auxiliary data fields. The `Point` parameter is +the type of points associated with the vertices. \cgalModels `ArrangementDcelVertex` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h index 937f9961de59..bb8ce9bed4a3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h @@ -4,20 +4,20 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -The default Dcel class used by the `Arrangement_2` class-template -is parameterized by a traits class, which is a model of the -`ArrangementBasicTraits_2` concept. It simply uses the nested -`Traits::Point_2` and `Traits::X_monotone_curve_2` to instantiate -the base vertex and halfedge types, respectively. Thus, the default -Dcel records store no other information, except for the topological -incidence relations and the geometric data attached to vertices and edges. +The default Dcel class used by the `Arrangement_2` class-template +is parameterized by a traits class, which is a model of the +`ArrangementBasicTraits_2` concept. It simply uses the nested +`Traits::Point_2` and `Traits::X_monotone_curve_2` to instantiate +the base vertex and halfedge types, respectively. Thus, the default +Dcel records store no other information, except for the topological +incidence relations and the geometric data attached to vertices and edges. \cgalModels `ArrangementDcelWithRebind` -\sa `Arr_dcel_base` +\sa `Arr_dcel_base` */ template< typename Traits > -class Arr_default_dcel : +class Arr_default_dcel : public Arr_dcel_base< Arr_vertex_base, Arr_halfedge_base, Arr_face_base> diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h index 1c07e6b2b792..072d4b24fc14 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h @@ -5,14 +5,14 @@ namespace CGAL { \ingroup PkgArrangementOnSurface2TraitsClasses \ingroup PkgArrangementOnSurface2Overlay -An instance of `Arr_default_overlay_traits` should be used for overlaying two arrangements -of type `Arrangement` that store no auxiliary data with their Dcel records, where the resulting overlaid arrangement stores no auxiliary -Dcel data as well. This class simply gives empty implementation for all -traits-class functions. +An instance of `Arr_default_overlay_traits` should be used for overlaying two arrangements +of type `Arrangement` that store no auxiliary data with their Dcel records, where the resulting overlaid arrangement stores no auxiliary +Dcel data as well. This class simply gives empty implementation for all +traits-class functions. \cgalModels `OverlayTraits` -\sa `overlay` +\sa `overlay` */ template< typename Arrangement > @@ -28,25 +28,25 @@ namespace CGAL { \ingroup PkgArrangementOnSurface2TraitsClasses \ingroup PkgArrangementOnSurface2Overlay -An instance of `Arr_face_overlay_traits` should be used for overlaying two arrangements -of types `Arr_A` and `Arr_B`, which are instantiated using the same -geometric traits-class and with the Dcel classes `Dcel_A` and -`Dcel_B` respectively, in order to store their overlay in an arrangement -of type `Arr_R`, which is instantiated using a third Dcel class -`Dcel_R`. All three Dcel classes are assumed to be instantiations of the -`Arr_face_extended_dcel` template with types `FaceData_A`, -`FaceData_B` and `FaceData_R`, respectively. - -This class gives empty implementation for all overlay traits-class functions, -except the function that computes the overlay of two faces. In this case, -it uses the functor `OvlFaceData`, which accepts a `FaceData_A` object -and a `FaceData_B` object and computes a corresponding `FaceData_R` -object, in order to set the auxiliary data of the overlay face. +An instance of `Arr_face_overlay_traits` should be used for overlaying two arrangements +of types `Arr_A` and `Arr_B`, which are instantiated using the same +geometric traits-class and with the Dcel classes `Dcel_A` and +`Dcel_B` respectively, in order to store their overlay in an arrangement +of type `Arr_R`, which is instantiated using a third Dcel class +`Dcel_R`. All three Dcel classes are assumed to be instantiations of the +`Arr_face_extended_dcel` template with types `FaceData_A`, +`FaceData_B` and `FaceData_R`, respectively. + +This class gives empty implementation for all overlay traits-class functions, +except the function that computes the overlay of two faces. In this case, +it uses the functor `OvlFaceData`, which accepts a `FaceData_A` object +and a `FaceData_B` object and computes a corresponding `FaceData_R` +object, in order to set the auxiliary data of the overlay face. \cgalModels `OverlayTraits` -\sa `overlay` -\sa `CGAL::Arr_face_extended_dcel` +\sa `overlay` +\sa `CGAL::Arr_face_extended_dcel` */ template< typename Arr_A, typename Arr_B, typename Arr_R, typename OvlFaceData > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h index 21fd0d44af67..77d6d91dcce2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h @@ -16,7 +16,7 @@ enum Arr_curve_end { ARR_MIN_END, ARR_MAX_END }; The enumeration `Arr_halfedge_direction` is defined by `CGAL::Arrangement_2::Halfedge` to specify the direction of the halfedge. - + \sa `CGAL::Arrangement_2::Halfedge` */ enum Arr_halfedge_direction { ARR_LEFT_TO_RIGHT, ARR_RIGHT_TO_LEFT }; diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h index 8a948545117c..fce858fb241d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h @@ -4,38 +4,38 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -The `Arr_extended_dcel` class-template extends the topological-features of the Dcel -namely the vertex, halfedge, and face types. While it is possible to maintain -extra (non-geometric) data with the curves or points of the arrangement by -extending their types respectively, it is also possible to extend the vertex, -halfedge, or face types of the Dcel through inheritance. As the technique to -extend these types is somewhat cumbersome and difficult for inexperienced -users, the `Arr_extended_dcel` class-template provides a convenient way to do that. -Each one of the three features is extended with a corresponding data type -provided as parameters. This class template is also parameterized with a -traits class used to extract default values for the vertex, halfedge, and face -base classes, which are the remaining three template parameters respectively. -The default values follow: - -
        - -`V` = - -`Arr_vertex_base` -
        -`H` = - -`Arr_halfedge_base` -
        -`F` = - -`Arr_face_base` - -
        +The `Arr_extended_dcel` class-template extends the topological-features of the Dcel +namely the vertex, halfedge, and face types. While it is possible to maintain +extra (non-geometric) data with the curves or points of the arrangement by +extending their types respectively, it is also possible to extend the vertex, +halfedge, or face types of the Dcel through inheritance. As the technique to +extend these types is somewhat cumbersome and difficult for inexperienced +users, the `Arr_extended_dcel` class-template provides a convenient way to do that. +Each one of the three features is extended with a corresponding data type +provided as parameters. This class template is also parameterized with a +traits class used to extract default values for the vertex, halfedge, and face +base classes, which are the remaining three template parameters respectively. +The default values follow: + +
        + +`V` = + +`Arr_vertex_base` +
        +`H` = + +`Arr_halfedge_base` +
        +`F` = + +`Arr_face_base` + +
        \cgalModels `ArrangementDcelWithRebind` -\sa `Arr_dcel_base` +\sa `Arr_dcel_base` */ template< typename Traits, typename VData, typename HData, typename FData, typename V, typename H, typename F > @@ -53,47 +53,47 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -The `Arr_extended_face` class-template extends the face topological-features of the -Dcel. It is parameterized by a face base-type `FaceBase` and a data type -`FData` used to extend the face base-type. +The `Arr_extended_face` class-template extends the face topological-features of the +Dcel. It is parameterized by a face base-type `FaceBase` and a data type +`FData` used to extend the face base-type. \cgalModels `ArrangementDcelFace` -\sa `Arr_dcel_base` +\sa `Arr_dcel_base` */ template< typename FaceBase, typename FData > class Arr_extended_face : FaceBase { public: -/// \name Creation +/// \name Creation /// @{ /*! -assigns `f` with the contents of the `other` vertex. -*/ -void assign (const Self & other); +assigns `f` with the contents of the `other` vertex. +*/ +void assign (const Self & other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -obtains the auxiliary data (a non-const version, returning a reference -to a mutable data object is also available). -*/ -const FData & data () const; +obtains the auxiliary data (a non-const version, returning a reference +to a mutable data object is also available). +*/ +const FData & data () const; -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the auxiliary data. -*/ -void set_data (const FData & data); +sets the auxiliary data. +*/ +void set_data (const FData & data); /// @} @@ -105,47 +105,47 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -The `Arr_extended_halfedge` class-template extends the halfedge topological-features of -the Dcel. It is parameterized by a halfedge base-type `HalfedgeBase` -and a data type `HData` used to extend the halfedge base-type. +The `Arr_extended_halfedge` class-template extends the halfedge topological-features of +the Dcel. It is parameterized by a halfedge base-type `HalfedgeBase` +and a data type `HData` used to extend the halfedge base-type. \cgalModels `ArrangementDcelHalfedge` -\sa `Arr_dcel_base` +\sa `Arr_dcel_base` */ template< typename HalfedgeBase, typename HData > class Arr_extended_halfedge : public HalfedgeBase { public: -/// \name Creation +/// \name Creation /// @{ /*! -assigns `he` with the contents of the `other` vertex. -*/ -void assign (const Self & other); +assigns `he` with the contents of the `other` vertex. +*/ +void assign (const Self & other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -obtains the auxiliary data (a non-const version, returning a reference -to a mutable data object is also available). -*/ -const HData & data () const; +obtains the auxiliary data (a non-const version, returning a reference +to a mutable data object is also available). +*/ +const HData & data () const; -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the auxiliary data. -*/ -void set_data (const HData & data); +sets the auxiliary data. +*/ +void set_data (const HData & data); /// @} @@ -157,48 +157,48 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -The `Arr_extended_vertex` class-template extends the vertex -topological-features of the Dcel. It is parameterized by a -vertex base-type `VertexBase` and a data type `VData` used to extend -the vertex base-type. +The `Arr_extended_vertex` class-template extends the vertex +topological-features of the Dcel. It is parameterized by a +vertex base-type `VertexBase` and a data type `VData` used to extend +the vertex base-type. \cgalModels `ArrangementDcelVertex` -\sa `Arr_dcel_base` +\sa `Arr_dcel_base` */ template< typename VertexBase, typename VData > class Arr_extended_vertex : public VertexBase { public: -/// \name Creation +/// \name Creation /// @{ /*! -assigns `v` with the contents of the `other` vertex. -*/ -void assign (const Self & other); +assigns `v` with the contents of the `other` vertex. +*/ +void assign (const Self & other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -obtains the auxiliary data (a non-const version, returning a reference -to a mutable data object is also available). -*/ -const VData & data () const; +obtains the auxiliary data (a non-const version, returning a reference +to a mutable data object is also available). +*/ +const VData & data () const; -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the auxiliary data. -*/ -void set_data (const VData & data); +sets the auxiliary data. +*/ +void set_data (const VData & data); /// @} @@ -210,34 +210,34 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2DCEL -The `Arr_face_extended_dcel` class-template extends the Dcel face-records, making it -possible to store extra (non-geometric) data with the arrangement faces. -The class should be instantiated by an `FData` type which represents the -extra data stored with each face. +The `Arr_face_extended_dcel` class-template extends the Dcel face-records, making it +possible to store extra (non-geometric) data with the arrangement faces. +The class should be instantiated by an `FData` type which represents the +extra data stored with each face. -Note that all types of Dcel features (namely vertex, halfedge and face) -are provided as template parameters. However, by default they are defined -as follows: +Note that all types of Dcel features (namely vertex, halfedge and face) +are provided as template parameters. However, by default they are defined +as follows: -
        +
        -`V` = - -`Arr_vertex_base` -
        -`H` = - -`Arr_halfedge_base` -
        -`F` = - -`Arr_face_base` +`V` = + +`Arr_vertex_base` +
        +`H` = + +`Arr_halfedge_base` +
        +`F` = + +`Arr_face_base` -
        +
        \cgalModels `ArrangementDcelWithRebind` -\sa `Arr_dcel_base` +\sa `Arr_dcel_base` */ template< typename Traits, typename FData, typename V, typename H, typename F > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h index cf9c15737023..ae70704f3b56 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h @@ -18,7 +18,7 @@ As new faces might be inserted into the attached arrangement, and existing faces might be removed, the notification mechanism is used to dynamically maintain the mapping of face handles to indices. - + \cgalModels DefaultConstructible \cgalModels CopyConstructible \cgalModels Assignable @@ -32,12 +32,12 @@ template< typename Arrangement > class Arr_face_index_map: public Arr_observer { public: -/// \name Types +/// \name Types /// @{ /*! the type of the attached arrangement. -*/ +*/ typedef Arrangement Arrangement_2; typedef boost::readable_property_map_tag category; @@ -58,9 +58,9 @@ The type of mapping of faces to indices. */ typedef Unique_hash_map Index_map; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! @@ -70,10 +70,10 @@ Arr_face_index_map(); /*! constructs a map and attaches it to the given arrangement `arr`. -*/ +*/ Arr_face_index_map(Arrangement_2& arr); -/// @} +/// @} }; /* end Arr_accessor */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h index a6d9e3ddbfbe..92490f47f2a1 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h @@ -4,48 +4,48 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2PointLocation -\anchor arr_reflm_pl +\anchor arr_reflm_pl -The `Arr_landmarks_point_location` class implements a Jump & Walk algorithm, where special -points, referred to as "landmarks", are chosen in a preprocessing stage, -their place in the arrangement is found, and they are inserted into a -data-structure that enables efficient nearest-neighbor search (a -Kd-tree). Given a query point, the nearest landmark is located and a -"walk" strategy is applied from the landmark to the query point. +The `Arr_landmarks_point_location` class implements a Jump & Walk algorithm, where special +points, referred to as "landmarks", are chosen in a preprocessing stage, +their place in the arrangement is found, and they are inserted into a +data-structure that enables efficient nearest-neighbor search (a +Kd-tree). Given a query point, the nearest landmark is located and a +"walk" strategy is applied from the landmark to the query point. -There are various strategies to select the landmark set in the -arrangement, where the strategy is determined by the -`Generator` template parameter. The following landmark-generator -classes are available: -
        -
        `Arr_landmarks_vertices_generator` -
        -The arrangement vertices are used as the landmarks set. +There are various strategies to select the landmark set in the +arrangement, where the strategy is determined by the +`Generator` template parameter. The following landmark-generator +classes are available: +
        +
        `Arr_landmarks_vertices_generator` -
        +The arrangement vertices are used as the landmarks set. -
        `Arr_random_landmarks_generator` -
        -\f$ n\f$ random points in the bounding box of the arrangement are chosen -as the landmarks set. +
        `Arr_random_landmarks_generator` -
        +\f$ n\f$ random points in the bounding box of the arrangement are chosen +as the landmarks set. -
        `Arr_halton_landmarks_generator` -
        -\f$ n\f$ Halton points in the bounding box of the arrangement are chosen -as the landmarks set. +
        `Arr_halton_landmarks_generator` -
        +\f$ n\f$ Halton points in the bounding box of the arrangement are chosen +as the landmarks set. -
        `Arr_middle_edges_landmarks_generator` -
        -The midpoint of each arrangement edge is computed, and the resulting -set of points is used as the landmarks set. This generator can be applied -only for arrangements of line segments. +
        `Arr_middle_edges_landmarks_generator` -
        +The midpoint of each arrangement edge is computed, and the resulting +set of points is used as the landmarks set. This generator can be applied +only for arrangements of line segments. -
        `Arr_grid_landmarks_generator` -
        -A set of \f$ n\f$ landmarks are chosen on a -\f$ \lceil \sqrt{n} \rceil \times \lceil \sqrt{n} \rceil\f$ -grid that covers the bounding box of the arrangement. -
        -The `Arr_landmarks_vertices_generator` class is the default generator -and used if no `Generator` parameter is specified. +
        `Arr_grid_landmarks_generator` -
        +A set of \f$ n\f$ landmarks are chosen on a +\f$ \lceil \sqrt{n} \rceil \times \lceil \sqrt{n} \rceil\f$ +grid that covers the bounding box of the arrangement. +
        +The `Arr_landmarks_vertices_generator` class is the default generator +and used if no `Generator` parameter is specified. -It is recommended to use the landmarks point-location strategy -when the application frequently issues point-location queries on a -rather static arrangement that the changes applied to it are mainly -insertions of curves and not deletions of them. +It is recommended to use the landmarks point-location strategy +when the application frequently issues point-location queries on a +rather static arrangement that the changes applied to it are mainly +insertions of curves and not deletions of them. \cgalModels `ArrangementPointLocation_2` \cgalModels `ArrangementVerticalRayShoot_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h index 67e4f64bcc5b..b1b230c0393b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h @@ -4,9 +4,9 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -This class is a traits class for \cgal arrangements, built on top of a -model of concept `CircularKernel`. It provides curves of type -`CGAL::Line_arc_2`. +This class is a traits class for \cgal arrangements, built on top of a +model of concept `CircularKernel`. It provides curves of type +`CGAL::Line_arc_2`. \cgalModels `ArrangementTraits_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h index 7be714de5723..a1f8b77ff7e7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h @@ -147,15 +147,15 @@ class Arr_linear_traits_2 { class Trim_2{ public: -/// \name Creation +/// \name Creation /// @{ /*! Trims the given x-monotone curve to an from src to tgt. -\ pre `src` and `tgt` lies on the curve -*/ +\ pre `src` and `tgt` lies on the curve +*/ -X_monotone_curve_2(const X_monotone_curve_2& xcv, +X_monotone_curve_2(const X_monotone_curve_2& xcv, const Point_2& src, const Point_2& tgt)const /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h index 831a82d1317b..1ef49902c8cf 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h @@ -4,14 +4,14 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2PointLocation -\anchor arr_refnaive_pl +\anchor arr_refnaive_pl -The `Arr_naive_point_location` class implements a naive algorithm that traverses -all the vertices and halfedges in the arrangement in search for an -answer to a point-location query. -The query time is therefore linear in the complexity of the arrangement. -Naturally, this point-location strategy could turn into a heavy -time-consuming process when applied to dense arrangements. +The `Arr_naive_point_location` class implements a naive algorithm that traverses +all the vertices and halfedges in the arrangement in search for an +answer to a point-location query. +The query time is therefore linear in the complexity of the arrangement. +Naturally, this point-location strategy could turn into a heavy +time-consuming process when applied to dense arrangements. \cgalModels `ArrangementPointLocation_2` \cgalModels `ArrangementVerticalRayShoot_2` @@ -20,7 +20,7 @@ time-consuming process when applied to dense arrangements. \sa `ArrangementVerticalRayShoot_2` \sa `CGAL::Arr_point_location_result` \sa `CGAL_ARR_POINT_LOCATION_VERSION` - + */ template< typename Arrangement > class Arr_naive_point_location { diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h index 5b4ab3d833a4..2a97525dc225 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h @@ -4,22 +4,22 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The traits class `Arr_non_caching_segment_basic_traits_2` is a model of the `ArrangementTraits_2` -concept that allow the construction and maintenance of arrangements of -sets of pairwise interior-disjoint line segments. It is templated with a -\cgal-Kernel model, and it is derived from it. This traits class is a -thin layer above the parameterized kernel. It inherits the `Point_2` -from the kernel and its `X_monotone_curve_2` type is defined as -`Kernel::Segment_2`. Most traits-class functor are inherited from the -kernel functor, and the traits class only supplies the necessary functors -that are not provided by the kernel. The kernel is parameterized with a -number type, which should support the arithmetic operations \f$ +\f$, \f$ -\f$ and -\f$ \times\f$ in an exact manner in order to avoid robustness problems. -Using `Cartesian` or `Cartesian` are possible -instantiations for the kernel. Using other (inexact) number types -(for example, instantiating the template with -`Simple_cartesian`) is also possible, at the user's own -risk. +The traits class `Arr_non_caching_segment_basic_traits_2` is a model of the `ArrangementTraits_2` +concept that allow the construction and maintenance of arrangements of +sets of pairwise interior-disjoint line segments. It is templated with a +\cgal-Kernel model, and it is derived from it. This traits class is a +thin layer above the parameterized kernel. It inherits the `Point_2` +from the kernel and its `X_monotone_curve_2` type is defined as +`Kernel::Segment_2`. Most traits-class functor are inherited from the +kernel functor, and the traits class only supplies the necessary functors +that are not provided by the kernel. The kernel is parameterized with a +number type, which should support the arithmetic operations \f$ +\f$, \f$ -\f$ and +\f$ \times\f$ in an exact manner in order to avoid robustness problems. +Using `Cartesian` or `Cartesian` are possible +instantiations for the kernel. Using other (inexact) number types +(for example, instantiating the template with +`Simple_cartesian`) is also possible, at the user's own +risk. \cgalModels `ArrangementLandmarkTraits_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h index 75866897f85e..c5b1ad7bf9b0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h @@ -4,39 +4,39 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses -The traits class `Arr_non_caching_segment_traits_2` is a model of the `ArrangementTraits_2` -concept that allows the construction and maintenance of arrangements of -line segments. It is parameterized with a \cgal-Kernel type, and it -is derived from it. This traits class is a thin layer above the -parameterized kernel. It inherits the `Point_2` from the kernel and its -`X_monotone_curve_2` and `Curve_2` types are both defined as -`Kernel::Segment_2`. Most traits-class functor are inherited from the -kernel functor, and the traits class only supplies the necessary functors -that are not provided by the kernel. The kernel is parameterized with a -number type, which should support exact rational arithmetic in order to -avoid robustness problems, although other number types could be used at the -user's own risk. - -The traits-class implementation is very simple, yet may lead to -a cascaded representation of intersection points with exponentially long -bit-lengths, especially if the kernel is parameterized with a number type -that does not perform normalization (e.g. `Quotient`). -The `Arr_segment_traits_2` traits class avoids this cascading -problem, and should be the default choice for implementing arrangements of -line segments. It is recommended to use `Arr_non_caching_segment_traits_2` only for very sparse -arrangements of huge sets of input segments. - -While `Arr_non_caching_segment_traits_2` models the concept -`ArrangementDirectionalXMonotoneTraits_2`, the implementation of -the `Are_mergeable_2` operation does not enforce the input curves -to have the same direction as a precondition. Moreover, `Arr_non_caching_segment_traits_2` -supports the merging of curves of opposite directions. +The traits class `Arr_non_caching_segment_traits_2` is a model of the `ArrangementTraits_2` +concept that allows the construction and maintenance of arrangements of +line segments. It is parameterized with a \cgal-Kernel type, and it +is derived from it. This traits class is a thin layer above the +parameterized kernel. It inherits the `Point_2` from the kernel and its +`X_monotone_curve_2` and `Curve_2` types are both defined as +`Kernel::Segment_2`. Most traits-class functor are inherited from the +kernel functor, and the traits class only supplies the necessary functors +that are not provided by the kernel. The kernel is parameterized with a +number type, which should support exact rational arithmetic in order to +avoid robustness problems, although other number types could be used at the +user's own risk. + +The traits-class implementation is very simple, yet may lead to +a cascaded representation of intersection points with exponentially long +bit-lengths, especially if the kernel is parameterized with a number type +that does not perform normalization (e.g. `Quotient`). +The `Arr_segment_traits_2` traits class avoids this cascading +problem, and should be the default choice for implementing arrangements of +line segments. It is recommended to use `Arr_non_caching_segment_traits_2` only for very sparse +arrangements of huge sets of input segments. + +While `Arr_non_caching_segment_traits_2` models the concept +`ArrangementDirectionalXMonotoneTraits_2`, the implementation of +the `Are_mergeable_2` operation does not enforce the input curves +to have the same direction as a precondition. Moreover, `Arr_non_caching_segment_traits_2` +supports the merging of curves of opposite directions. \cgalModels `ArrangementTraits_2` \cgalModels `ArrangementLandmarkTraits_2` \cgalModels `ArrangementDirectionalXMonotoneTraits_2` -\sa `Arr_segment_traits_2` +\sa `Arr_segment_traits_2` */ template< typename Kernel > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index 38b372ad59d6..f507357e38fa 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -4,534 +4,534 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Ref -\anchor arr_refarr_obs - -`Arr_observer` serves as an abstract base class for all observer -classes that are attached to an arrangement instance of type `Arrangement` -and receive notifications from the arrangement. -This base class handles the attachment of the -observer to a given arrangement instance or to the detachment of the -observer from this arrangement instance. It also gives a default empty -implementation to all notification functions that are invoked by the -arrangement to notify the observer on local or global changes it undergoes. -The notification functions are all virtual functions, so they can be -overridden by the concrete observer classes that inherit from -`Arr_observer`. - -In order to implement a concrete arrangement observer-class, one simply -needs to derive from `Arr_observer` and override the relevant -notification functions. For example, if only face-split events are of -interest, it is sufficient to override just `before_split_face()` -(or just `after_split_face()`). +\anchor arr_refarr_obs + +`Arr_observer` serves as an abstract base class for all observer +classes that are attached to an arrangement instance of type `Arrangement` +and receive notifications from the arrangement. +This base class handles the attachment of the +observer to a given arrangement instance or to the detachment of the +observer from this arrangement instance. It also gives a default empty +implementation to all notification functions that are invoked by the +arrangement to notify the observer on local or global changes it undergoes. +The notification functions are all virtual functions, so they can be +overridden by the concrete observer classes that inherit from +`Arr_observer`. + +In order to implement a concrete arrangement observer-class, one simply +needs to derive from `Arr_observer` and override the relevant +notification functions. For example, if only face-split events are of +interest, it is sufficient to override just `before_split_face()` +(or just `after_split_face()`). */ template< typename Arrangement > class Arr_observer { public: -/// \name Types +/// \name Types /// @{ /*! -the type of the associated arrangement. -*/ -typedef unspecified_type Arrangement_2; +the type of the associated arrangement. +*/ +typedef unspecified_type Arrangement_2; /*! -the point type. -*/ -typedef typename Arrangement_2::Point_2 Point_2; +the point type. +*/ +typedef typename Arrangement_2::Point_2 Point_2; /*! -the \f$ x\f$-monotone curve type. -*/ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; +the \f$ x\f$-monotone curve type. +*/ +typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; /*! -*/ -typedef typename Arrangement_2::Vertex_handle Vertex_handle; +*/ +typedef typename Arrangement_2::Vertex_handle Vertex_handle; /*! -*/ -typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; +*/ +typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; /*! -*/ -typedef typename Arrangement_2::Face_handle Face_handle; +*/ +typedef typename Arrangement_2::Face_handle Face_handle; /*! -represents the boundary of a connected component (CCB). -In particular, holes are represented by a circulator for their outer CCB. -*/ -typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; +represents the boundary of a connected component (CCB). +In particular, holes are represented by a circulator for their outer CCB. +*/ +typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -constructs an observer that is unattached to any arrangement instance. -*/ -Arr_observer(); +constructs an observer that is unattached to any arrangement instance. +*/ +Arr_observer(); /*! -constructs an observer and attaches it to the given arrangement -`arr`. -*/ -Arr_observer(Arrangement_2& arr); +constructs an observer and attaches it to the given arrangement +`arr`. +*/ +Arr_observer(Arrangement_2& arr); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -attaches the observer to the given arrangement `arr`. -*/ -void attach (Arrangement_2& arr); +attaches the observer to the given arrangement `arr`. +*/ +void attach (Arrangement_2& arr); /*! -detaches the observer from its arrangement. -*/ -void detach (); +detaches the observer from its arrangement. +*/ +void detach (); -/// @} +/// @} -/// \name Notifications on Global Arrangement Operations +/// \name Notifications on Global Arrangement Operations /// @{ /*! -issued just before the attached arrangement is assigned with the contents -of another arrangement `arr`. -*/ -virtual void before_assign (const Arrangement_2& arr); +issued just before the attached arrangement is assigned with the contents +of another arrangement `arr`. +*/ +virtual void before_assign (const Arrangement_2& arr); /*! -issued immediately after the attached arrangement has been assigned with -the contents of another arrangement. -*/ -virtual void after_assign (); +issued immediately after the attached arrangement has been assigned with +the contents of another arrangement. +*/ +virtual void after_assign (); /*! -issued just before the attached arrangement is cleared. -*/ -virtual void before_clear (); +issued just before the attached arrangement is cleared. +*/ +virtual void before_clear (); /*! -issued immediately after the attached arrangement has been cleared, so it -now consists only of a the unbounded face `uf`. -*/ -virtual void after_clear (Face_handle uf); +issued immediately after the attached arrangement has been cleared, so it +now consists only of a the unbounded face `uf`. +*/ +virtual void after_clear (Face_handle uf); /*! -issued just before a global function starts to modify the attached -arrangement. It is guaranteed that no queries (especially no -point-location queries) are issued until the termination of the global -function is indicated by `after_global_change()`. -*/ -virtual void before_global_change (); +issued just before a global function starts to modify the attached +arrangement. It is guaranteed that no queries (especially no +point-location queries) are issued until the termination of the global +function is indicated by `after_global_change()`. +*/ +virtual void before_global_change (); /*! -issued immediately after a global function has stopped modifying the -attached arrangement. -*/ -virtual void after_global_change (); +issued immediately after a global function has stopped modifying the +attached arrangement. +*/ +virtual void after_global_change (); -/// @} +/// @} -/// \name Notifications on Attachment or Detachment +/// \name Notifications on Attachment or Detachment /// @{ /*! -issued just before the observer is attached to the arrangement instance -`arr`. -*/ -virtual void before_attach (const Arrangement_2& arr); +issued just before the observer is attached to the arrangement instance +`arr`. +*/ +virtual void before_attach (const Arrangement_2& arr); /*! -issued immediately after the observer has been attached to an -arrangement instance. -*/ -virtual void after_attach (); +issued immediately after the observer has been attached to an +arrangement instance. +*/ +virtual void after_attach (); /*! -issued just before the observer is detached from its arrangement instance. -*/ -virtual void before_detach (); +issued just before the observer is detached from its arrangement instance. +*/ +virtual void before_detach (); /*! -issued immediately after the observer has been detached from its -arrangement instance. -*/ +issued immediately after the observer has been detached from its +arrangement instance. +*/ virtual void after_detach (); -/// @} +/// @} -/// \name Notifications on Local Changes in the Arrangement +/// \name Notifications on Local Changes in the Arrangement /// @{ /*! -issued just before a new vertex that corresponds to the point `p` -is created. -*/ -virtual void before_create_vertex (const Point_2& p); +issued just before a new vertex that corresponds to the point `p` +is created. +*/ +virtual void before_create_vertex (const Point_2& p); /*! -issued immediately after a new vertex `v` has been created. -Note that the vertex still has no incident edges and is not connected -to any other vertex. -*/ -virtual void after_create_vertex (Vertex_handle v); +issued immediately after a new vertex `v` has been created. +Note that the vertex still has no incident edges and is not connected +to any other vertex. +*/ +virtual void after_create_vertex (Vertex_handle v); /*! -issued just before a new vertex at infinity is created, `cv` is the -curve incident to the surface boundary, `ind` is the relevant curve-end, -`ps_x` is the boundary condition of the vertex in \f$ x\f$ and `ps_y` -is the boundary condition of the vertex in \f$ y\f$. -*/ -virtual void before_create_boundary_vertex (const X_monotone_curve_2& cv , -Arr_curve_end ind , -Arr_parameter_space ps_x , -Arr_parameter_space ps_y ); +issued just before a new vertex at infinity is created, `cv` is the +curve incident to the surface boundary, `ind` is the relevant curve-end, +`ps_x` is the boundary condition of the vertex in \f$ x\f$ and `ps_y` +is the boundary condition of the vertex in \f$ y\f$. +*/ +virtual void before_create_boundary_vertex (const X_monotone_curve_2& cv , +Arr_curve_end ind , +Arr_parameter_space ps_x , +Arr_parameter_space ps_y ); /*! -issued immediately after a new vertex `v` has been created. -Note that the vertex still has no incident edges and is not connected -to any other vertex. -*/ -virtual void after_create_boundary_vertex (Vertex_handle v); +issued immediately after a new vertex `v` has been created. +Note that the vertex still has no incident edges and is not connected +to any other vertex. +*/ +virtual void after_create_boundary_vertex (Vertex_handle v); /*! -issued just before a new edge that corresponds to the \f$ x\f$-monotone curve -`c` and connects the vertices `v1` and `v2` is created. -*/ -virtual void before_create_edge (const X_monotone_curve_2& c, -Vertex_handle v1, -Vertex_handle v2); +issued just before a new edge that corresponds to the \f$ x\f$-monotone curve +`c` and connects the vertices `v1` and `v2` is created. +*/ +virtual void before_create_edge (const X_monotone_curve_2& c, +Vertex_handle v1, +Vertex_handle v2); /*! -issued immediately after a new edge `e` has been created. -The halfedge that is sent to this function is always directed from -`v1` to `v2` (see above). -*/ -virtual void after_create_edge (Halfedge_handle e); +issued immediately after a new edge `e` has been created. +The halfedge that is sent to this function is always directed from +`v1` to `v2` (see above). +*/ +virtual void after_create_edge (Halfedge_handle e); /*! -issued just before a vertex `v` is modified to be associated with -the point `p`. -*/ -virtual void before_modify_vertex (Vertex_handle v, -const Point_2& p); +issued just before a vertex `v` is modified to be associated with +the point `p`. +*/ +virtual void before_modify_vertex (Vertex_handle v, +const Point_2& p); /*! -issued immediately after an existing vertex `v` has been modified. -*/ -virtual void after_modify_vertex (Vertex_handle v); +issued immediately after an existing vertex `v` has been modified. +*/ +virtual void after_modify_vertex (Vertex_handle v); /*! -issued just before an edge `e` is modified to be associated with -the \f$ x\f$-monotone curve `c`. -*/ -virtual void before_modify_edge (Halfedge_handle e, -const X_monotone_curve_2& c); +issued just before an edge `e` is modified to be associated with +the \f$ x\f$-monotone curve `c`. +*/ +virtual void before_modify_edge (Halfedge_handle e, +const X_monotone_curve_2& c); /*! -issued immediately after an existing edge `e` has been modified. -*/ -virtual void after_modify_edge (Halfedge_handle e); +issued immediately after an existing edge `e` has been modified. +*/ +virtual void after_modify_edge (Halfedge_handle e); /*! -issued just before an edge `e` is split into two edges that should -be associated with the \f$ x\f$-monotone curves `c1` and `c2`. The -vertex `v` corresponds to the split point, and will be used to -separate the two resulting edges. -*/ -virtual void before_split_edge (Halfedge_handle e, -Vertex_handle v, -const X_monotone_curve_2& c1, -const X_monotone_curve_2& c2); +issued just before an edge `e` is split into two edges that should +be associated with the \f$ x\f$-monotone curves `c1` and `c2`. The +vertex `v` corresponds to the split point, and will be used to +separate the two resulting edges. +*/ +virtual void before_split_edge (Halfedge_handle e, +Vertex_handle v, +const X_monotone_curve_2& c1, +const X_monotone_curve_2& c2); /*! -issued immediately after an existing edge has been split into the two -given edges `e1` and `e2`. -*/ -virtual void after_split_edge (Halfedge_handle e1, -Halfedge_handle e2); +issued immediately after an existing edge has been split into the two +given edges `e1` and `e2`. +*/ +virtual void after_split_edge (Halfedge_handle e1, +Halfedge_handle e2); /*! -issued just before a fictitious edge `e` is split into two. The -vertex at infinity `v` corresponds to the split point, and will be -used to separate the two resulting edges. -*/ -virtual void before_split_fictitious_edge (Halfedge_handle e, -Vertex_handle v); +issued just before a fictitious edge `e` is split into two. The +vertex at infinity `v` corresponds to the split point, and will be +used to separate the two resulting edges. +*/ +virtual void before_split_fictitious_edge (Halfedge_handle e, +Vertex_handle v); /*! -issued immediately after an existing fictitious edge has been split into -the two given fictitious edges `e1` and `e2`. -*/ -virtual void after_split_fictitious_edge (Halfedge_handle e1, -Halfedge_handle e2); +issued immediately after an existing fictitious edge has been split into +the two given fictitious edges `e1` and `e2`. +*/ +virtual void after_split_fictitious_edge (Halfedge_handle e1, +Halfedge_handle e2); /*! -issued just before a face `f` is split into two, as a result of -the insertion of the edge `e` into the arrangement. -*/ -virtual void before_split_face (Face_handle f, -Halfedge_handle e); +issued just before a face `f` is split into two, as a result of +the insertion of the edge `e` into the arrangement. +*/ +virtual void before_split_face (Face_handle f, +Halfedge_handle e); /*! -issued immediately after the existing face `f1` has been split, -such that a portion of it now forms a new face `f2`. The flag -`is_hole` designates whether `f2` forms a hole inside `f1`. -*/ -virtual void after_split_face (Face_handle f1, -Face_handle f2, -bool is_hole); +issued immediately after the existing face `f1` has been split, +such that a portion of it now forms a new face `f2`. The flag +`is_hole` designates whether `f2` forms a hole inside `f1`. +*/ +virtual void after_split_face (Face_handle f1, +Face_handle f2, +bool is_hole); /*! -issued just before outer ccb `h` inside a face `f` is split into -two, as a result of the removal of the edge `e` from the arrangement. -*/ -virtual void before_split_outer_ccb (Face_handle f, -Ccb_halfedge_circulator h, -Halfedge_handle e); +issued just before outer ccb `h` inside a face `f` is split into +two, as a result of the removal of the edge `e` from the arrangement. +*/ +virtual void before_split_outer_ccb (Face_handle f, +Ccb_halfedge_circulator h, +Halfedge_handle e); /*! -issued immediately after outer ccb the face `f` has been split, -resulting in the two holes `h1` and `h2`. -*/ -virtual void after_split_outer_ccb (Face_handle f, -Ccb_halfedge_circulator h1, -Ccb_halfedge_circulator h2); +issued immediately after outer ccb the face `f` has been split, +resulting in the two holes `h1` and `h2`. +*/ +virtual void after_split_outer_ccb (Face_handle f, +Ccb_halfedge_circulator h1, +Ccb_halfedge_circulator h2); /*! -issued just before inner ccb `h` inside a face `f` is split into -two, as a result of the removal of the edge `e` from the arrangement. -*/ -virtual void before_split_inner_ccb (Face_handle f, -Ccb_halfedge_circulator h, -Halfedge_handle e); +issued just before inner ccb `h` inside a face `f` is split into +two, as a result of the removal of the edge `e` from the arrangement. +*/ +virtual void before_split_inner_ccb (Face_handle f, +Ccb_halfedge_circulator h, +Halfedge_handle e); /*! -issued immediately after inner ccb the face `f` has been split, -resulting in the two holes `h1` and `h2`. -*/ -virtual void after_split_inner_ccb (Face_handle f, -Ccb_halfedge_circulator h1, -Ccb_halfedge_circulator h2); +issued immediately after inner ccb the face `f` has been split, +resulting in the two holes `h1` and `h2`. +*/ +virtual void after_split_inner_ccb (Face_handle f, +Ccb_halfedge_circulator h1, +Ccb_halfedge_circulator h2); /*! -issued just before the edge `e` is inserted as a new outer ccb inside -the face `f`. -*/ -virtual void before_add_outer_ccb (Face_handle f, -Halfedge_handle e); +issued just before the edge `e` is inserted as a new outer ccb inside +the face `f`. +*/ +virtual void before_add_outer_ccb (Face_handle f, +Halfedge_handle e); /*! -issued immediately after a new outer ccb `h` has been created. The -outer ccb always consists of a single pair of twin halfedges. -*/ -virtual void after_add_outer_ccb (Ccb_halfedge_circulator h); +issued immediately after a new outer ccb `h` has been created. The +outer ccb always consists of a single pair of twin halfedges. +*/ +virtual void after_add_outer_ccb (Ccb_halfedge_circulator h); /*! -issued just before the edge `e` is inserted as a new inner ccb inside -the face `f`. -*/ -virtual void before_add_inner_ccb (Face_handle f, -Halfedge_handle e); +issued just before the edge `e` is inserted as a new inner ccb inside +the face `f`. +*/ +virtual void before_add_inner_ccb (Face_handle f, +Halfedge_handle e); /*! -issued immediately after a new inner ccb `h` has been created. The -inner ccb always consists of a single pair of twin halfedges. -*/ -virtual void after_add_inner_ccb (Ccb_halfedge_circulator h); +issued immediately after a new inner ccb `h` has been created. The +inner ccb always consists of a single pair of twin halfedges. +*/ +virtual void after_add_inner_ccb (Ccb_halfedge_circulator h); /*! -issued just before the vertex `v` is inserted as an isolated -vertex inside the face `f`. -*/ -virtual void before_add_isolated_vertex (Face_handle f, -Vertex_handle v); +issued just before the vertex `v` is inserted as an isolated +vertex inside the face `f`. +*/ +virtual void before_add_isolated_vertex (Face_handle f, +Vertex_handle v); /*! -issued immediately after the vertex `v` has been set as an -isolated vertex. -*/ -virtual void after_add_isolated_vertex (Vertex_handle v); +issued immediately after the vertex `v` has been set as an +isolated vertex. +*/ +virtual void after_add_isolated_vertex (Vertex_handle v); /*! -issued just before the two edges `e1` and `e2` are merged to -form a single edge that will be associated with the \f$ x\f$-monotone curve -`c`. -*/ -virtual void before_merge_edge (Halfedge_handle e1, -Halfedge_handle e2, -const X_monotone_curve_2& c); +issued just before the two edges `e1` and `e2` are merged to +form a single edge that will be associated with the \f$ x\f$-monotone curve +`c`. +*/ +virtual void before_merge_edge (Halfedge_handle e1, +Halfedge_handle e2, +const X_monotone_curve_2& c); /*! -issued immediately after two edges have been merged to form the edge -`e`. -*/ -virtual void after_merge_edge (Halfedge_handle e); +issued immediately after two edges have been merged to form the edge +`e`. +*/ +virtual void after_merge_edge (Halfedge_handle e); /*! -issued just before the two fictitious edges `e1` and `e2` are -merged to form a single fictitious edge. -*/ -virtual void before_merge_fictitious_edge (Halfedge_handle e1, -Halfedge_handle e2); +issued just before the two fictitious edges `e1` and `e2` are +merged to form a single fictitious edge. +*/ +virtual void before_merge_fictitious_edge (Halfedge_handle e1, +Halfedge_handle e2); /*! -issued immediately after two fictitious edges have been merged to form -the fictitious edge `e`. -*/ -virtual void after_merge_fictitious_edge (Halfedge_handle e); +issued immediately after two fictitious edges have been merged to form +the fictitious edge `e`. +*/ +virtual void after_merge_fictitious_edge (Halfedge_handle e); /*! -issued just before the two edges `f1` and `f2` are merged to -form a single face, following the removal of the edge `e` from the -arrangement. -*/ -virtual void before_merge_face (Face_handle f1, -Face_handle f2, -Halfedge_handle e); +issued just before the two edges `f1` and `f2` are merged to +form a single face, following the removal of the edge `e` from the +arrangement. +*/ +virtual void before_merge_face (Face_handle f1, +Face_handle f2, +Halfedge_handle e); /*! -issued immediately after two faces have been merged to form the face -`f`. -*/ -virtual void after_merge_face (Face_handle f); +issued immediately after two faces have been merged to form the face +`f`. +*/ +virtual void after_merge_face (Face_handle f); /*! -issued just before two outer ccbs `h1` and `h2` inside the face -`f` are merged to form a single connected component, following the -insertion of the edge `e` into the arrangement. -*/ -virtual void before_merge_outer_ccb (Face_handle f, -Ccb_halfedge_circulator h1, -Ccb_halfedge_circulator h2, -Halfedge_handle e); +issued just before two outer ccbs `h1` and `h2` inside the face +`f` are merged to form a single connected component, following the +insertion of the edge `e` into the arrangement. +*/ +virtual void before_merge_outer_ccb (Face_handle f, +Ccb_halfedge_circulator h1, +Ccb_halfedge_circulator h2, +Halfedge_handle e); /*! -issued immediately after two outer ccbs have been merged to form a single -outer ccb `h` inside the face `f`. -*/ -virtual void after_merge_outer_ccb (Face_handle f, -Ccb_halfedge_circulator h); +issued immediately after two outer ccbs have been merged to form a single +outer ccb `h` inside the face `f`. +*/ +virtual void after_merge_outer_ccb (Face_handle f, +Ccb_halfedge_circulator h); /*! -issued just before two inner ccbs `h1` and `h2` inside the face -`f` are merged to form a single connected component, following the -insertion of the edge `e` into the arrangement. -*/ -virtual void before_merge_inner_ccb (Face_handle f, -Ccb_halfedge_circulator h1, -Ccb_halfedge_circulator h2, -Halfedge_handle e); +issued just before two inner ccbs `h1` and `h2` inside the face +`f` are merged to form a single connected component, following the +insertion of the edge `e` into the arrangement. +*/ +virtual void before_merge_inner_ccb (Face_handle f, +Ccb_halfedge_circulator h1, +Ccb_halfedge_circulator h2, +Halfedge_handle e); /*! -issued immediately after two inner ccbs have been merged to form a single -inner ccb `h` inside the face `f`. -*/ -virtual void after_merge_inner_ccb (Face_handle f, -Ccb_halfedge_circulator h); +issued immediately after two inner ccbs have been merged to form a single +inner ccb `h` inside the face `f`. +*/ +virtual void after_merge_inner_ccb (Face_handle f, +Ccb_halfedge_circulator h); /*! -issued just before the outer ccb `h` is moved from one face to another. -This can happen if the face `to_f` containing the outer ccb has just -been split from `from_f`. -*/ -virtual void before_move_outer_ccb (Face_handle from_f, -Face_handle to_f, -Ccb_halfedge_circulator h); +issued just before the outer ccb `h` is moved from one face to another. +This can happen if the face `to_f` containing the outer ccb has just +been split from `from_f`. +*/ +virtual void before_move_outer_ccb (Face_handle from_f, +Face_handle to_f, +Ccb_halfedge_circulator h); /*! -issued immediately after the outer ccb `h` has been moved to a new face. -*/ -virtual void after_move_outer_ccb (Ccb_halfedge_circulator h); +issued immediately after the outer ccb `h` has been moved to a new face. +*/ +virtual void after_move_outer_ccb (Ccb_halfedge_circulator h); /*! -issued just before the inner ccb `h` is moved from one face to another. -This can happen if the face `to_f` containing the inner ccb has just -been split from `from_f`. -*/ -virtual void before_move_inner_ccb (Face_handle from_f, -Face_handle to_f, -Ccb_halfedge_circulator h); +issued just before the inner ccb `h` is moved from one face to another. +This can happen if the face `to_f` containing the inner ccb has just +been split from `from_f`. +*/ +virtual void before_move_inner_ccb (Face_handle from_f, +Face_handle to_f, +Ccb_halfedge_circulator h); /*! -issued immediately after the inner ccb `h` has been moved to a new face. -*/ -virtual void after_move_inner_ccb (Ccb_halfedge_circulator h); +issued immediately after the inner ccb `h` has been moved to a new face. +*/ +virtual void after_move_inner_ccb (Ccb_halfedge_circulator h); /*! -issued just before the isolated vertex `v` is moved from one face -to another. -This can happen if the face `to_f` containing the isolated vertex -has just been split from `from_f`. -*/ -virtual void before_move_isolated_vertex (Face_handle from_f, -Face_handle to_f, -Vertex_handle v); +issued just before the isolated vertex `v` is moved from one face +to another. +This can happen if the face `to_f` containing the isolated vertex +has just been split from `from_f`. +*/ +virtual void before_move_isolated_vertex (Face_handle from_f, +Face_handle to_f, +Vertex_handle v); /*! -issued immediately after the isolated vertex `v` has been moved to a -new face. -*/ -virtual void after_move_isolated_vertex (Vertex_handle v); +issued immediately after the isolated vertex `v` has been moved to a +new face. +*/ +virtual void after_move_isolated_vertex (Vertex_handle v); /*! -issued just before the vertex `v` is removed from the arrangement. -*/ -virtual void before_remove_vertex (Vertex_handle v); +issued just before the vertex `v` is removed from the arrangement. +*/ +virtual void before_remove_vertex (Vertex_handle v); /*! -issued immediately after a vertex has been removed (and deleted) -from the arrangement. -*/ -virtual void after_remove_vertex (); +issued immediately after a vertex has been removed (and deleted) +from the arrangement. +*/ +virtual void after_remove_vertex (); /*! -issued just before the edge `e` is removed from the arrangement. -*/ -virtual void before_remove_edge (Halfedge_handle e); +issued just before the edge `e` is removed from the arrangement. +*/ +virtual void before_remove_edge (Halfedge_handle e); /*! -issued immediately after an edge has been removed (and deleted) -from the arrangement. -*/ -virtual void after_remove_edge (); +issued immediately after an edge has been removed (and deleted) +from the arrangement. +*/ +virtual void after_remove_edge (); /*! -issued just before the outer ccb `f` is removed from inside the -face `f`. -*/ -virtual void before_remove_outer_ccb (Face_handle f, -Ccb_halfedge_circulator h); +issued just before the outer ccb `f` is removed from inside the +face `f`. +*/ +virtual void before_remove_outer_ccb (Face_handle f, +Ccb_halfedge_circulator h); /*! -issued immediately after a outer ccb has been removed (and deleted) -from inside the face `f`. -*/ -virtual void after_remove_outer_ccb (Face_handle f); +issued immediately after a outer ccb has been removed (and deleted) +from inside the face `f`. +*/ +virtual void after_remove_outer_ccb (Face_handle f); /*! -issued just before the inner ccb `f` is removed from inside the -face `f`. -*/ -virtual void before_remove_inner_ccb (Face_handle f, -Ccb_halfedge_circulator h); +issued just before the inner ccb `f` is removed from inside the +face `f`. +*/ +virtual void before_remove_inner_ccb (Face_handle f, +Ccb_halfedge_circulator h); /*! -issued immediately after a inner ccb has been removed (and deleted) -from inside the face `f`. -*/ -virtual void after_remove_inner_ccb (Face_handle f); +issued immediately after a inner ccb has been removed (and deleted) +from inside the face `f`. +*/ +virtual void after_remove_inner_ccb (Face_handle f); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h index 5979b9b07c00..b773cddf170b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h @@ -4,53 +4,53 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses - The traits class `Arr_rational_function_traits_2` is a model of the `ArrangementTraits_2` - concept. It handles bounded and unbounded arcs of rational functions, + The traits class `Arr_rational_function_traits_2` is a model of the `ArrangementTraits_2` + concept. It handles bounded and unbounded arcs of rational functions, referred to as rational arcs (in particular, such an arc may correspond to the entire graph of a rational function). It supports bounded and unbounded arcs. Thus, it is also a model of the concept `ArrangementOpenBoundaryTraits_2`. The traits class enables - the construction and maintenance of arrangements of such arcs. - - A rational function \f$ y = \frac{P(x)}{Q(x)}\f$ is defined by two polynomials - \f$ P\f$ and \f$ Q\f$ of arbitrary degrees. - If \f$ Q(x) = 1\f$ then the function is a simple polynomial function. - Usually the domain is \f$ \mathbb{R}\f$ but the function may also be - restricted to a bounded interval \f$ [x_{\rm min}, x_{\rm max}]\f$ - or defined over a ray \f$ (-\infty, x_{\rm max}]\f$ or over \f$ [x_{\rm min}, \infty)\f$. - Rational functions are represented by the nested type `Curve_2`. - Note that a rational function may be not continuous since roots of \f$ Q\f$ induce - vertical asymptotes, which would contradict the notion of an \f$ x\f$-monotone curve - as it is introduced by the `ArrangementTraits_2` concept. - Thus, continuous portions of rational functions are represented by the nested - type `X_monotone_curve_2`, which is different from `Curve_2`. - Constructors for both classes are provided by the traits. - A `Curve_2` may be split up into several `X_monotone_curve_2` - using `Make_x_monotone_2`. - - The template parameter of the traits must be a model of the - concept `AlgebraicKernel_d_1`. - A rational function is then represented by two polynomials \f$ P\f$ and \f$ Q\f$ of type - `AlgebraicKernel_d_1::Polynomial_1`. - A point is represented by a rational function and its \f$ x\f$-coordinate, which is - of type `AlgebraicKernel_d_1::Algebraic_real_1`. - Note that an explicit representation of the \f$ y\f$-coordinate is only computed upon - request, which can be a rather costly operation. - - The constructed rational functions are cached by the traits class. - The cache is local to each traits class object. - It is therefore necessary to construct the curves using the constructor - objects provided by member functions of the traits class. - Moreover, a curve must only be used with its own traits. - The cache is automatically cleaned up from time to time. - The amortized clean up costs are constant. However, there is also a - separate member function that cleans up the cache on demand. - - While `Arr_rational_function_traits_2` models the concept - `ArrangementDirectionalXMonotoneTraits_2`, the implementation of - the `Are_mergeable_2` operation does not enforce the input curves - to have the same direction as a precondition. Moreover, `Arr_rational_function_traits_2` - supports the merging of curves of opposite directions. + the construction and maintenance of arrangements of such arcs. + + A rational function \f$ y = \frac{P(x)}{Q(x)}\f$ is defined by two polynomials + \f$ P\f$ and \f$ Q\f$ of arbitrary degrees. + If \f$ Q(x) = 1\f$ then the function is a simple polynomial function. + Usually the domain is \f$ \mathbb{R}\f$ but the function may also be + restricted to a bounded interval \f$ [x_{\rm min}, x_{\rm max}]\f$ + or defined over a ray \f$ (-\infty, x_{\rm max}]\f$ or over \f$ [x_{\rm min}, \infty)\f$. + Rational functions are represented by the nested type `Curve_2`. + Note that a rational function may be not continuous since roots of \f$ Q\f$ induce + vertical asymptotes, which would contradict the notion of an \f$ x\f$-monotone curve + as it is introduced by the `ArrangementTraits_2` concept. + Thus, continuous portions of rational functions are represented by the nested + type `X_monotone_curve_2`, which is different from `Curve_2`. + Constructors for both classes are provided by the traits. + A `Curve_2` may be split up into several `X_monotone_curve_2` + using `Make_x_monotone_2`. + + The template parameter of the traits must be a model of the + concept `AlgebraicKernel_d_1`. + A rational function is then represented by two polynomials \f$ P\f$ and \f$ Q\f$ of type + `AlgebraicKernel_d_1::Polynomial_1`. + A point is represented by a rational function and its \f$ x\f$-coordinate, which is + of type `AlgebraicKernel_d_1::Algebraic_real_1`. + Note that an explicit representation of the \f$ y\f$-coordinate is only computed upon + request, which can be a rather costly operation. + + The constructed rational functions are cached by the traits class. + The cache is local to each traits class object. + It is therefore necessary to construct the curves using the constructor + objects provided by member functions of the traits class. + Moreover, a curve must only be used with its own traits. + The cache is automatically cleaned up from time to time. + The amortized clean up costs are constant. However, there is also a + separate member function that cleans up the cache on demand. + + While `Arr_rational_function_traits_2` models the concept + `ArrangementDirectionalXMonotoneTraits_2`, the implementation of + the `Are_mergeable_2` operation does not enforce the input curves + to have the same direction as a precondition. Moreover, `Arr_rational_function_traits_2` + supports the merging of curves of opposite directions. \cgalModels `ArrangementTraits_2` \cgalModels `ArrangementDirectionalXMonotoneTraits_2` @@ -59,70 +59,70 @@ namespace CGAL { template< typename AlgebraicKernel_d_1 > class Arr_rational_function_traits_2 { public: - - /// \name Types + + /// \name Types /// @{ /*! - */ - typedef AlgebraicKernel_d_1 Algebraic_kernel_d_1; + */ + typedef AlgebraicKernel_d_1 Algebraic_kernel_d_1; /*! - */ - typedef AlgebraicKernel_d_1::Coefficient Coefficient; + */ + typedef AlgebraicKernel_d_1::Coefficient Coefficient; /*! - */ - typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; + */ + typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; /*! - */ - typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; + */ + typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; /*! - */ - typedef AlgebraicKernel_d_1::Bound Bound; + */ + typedef AlgebraicKernel_d_1::Bound Bound; - /// @} + /// @} - /// \name Creation + /// \name Creation /// @{ /*! - constructs an empty traits that uses the kernel pointed by `kernel` - for performing algebraic operations. - */ - Arr_rational_function_traits_2(const Algebraic_kernel_d_1* kernel); + constructs an empty traits that uses the kernel pointed by `kernel` + for performing algebraic operations. + */ + Arr_rational_function_traits_2(const Algebraic_kernel_d_1* kernel); - /// @} + /// @} - /// \name Operations + /// \name Operations /// @{ /*! - Returns an instance of `Construct_curve_2`. - */ - Construct_curve_2 construct_curve_2_object() const; + Returns an instance of `Construct_curve_2`. + */ + Construct_curve_2 construct_curve_2_object() const; /*! - Returns an instance of `Construct_x_monotone_curve_2`. - */ - Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object() const; + Returns an instance of `Construct_x_monotone_curve_2`. + */ + Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object() const; /*! - Deletes all curves from the cache that exist only there. - */ - void cleanup_cache() const; + Deletes all curves from the cache that exist only there. + */ + void cleanup_cache() const; /*! - Returns a pointer to the used algerbaic kernel object. - */ - const Algebraic_kernel_d_1* algebraic_kernel_d_1() const; + Returns a pointer to the used algerbaic kernel object. + */ + const Algebraic_kernel_d_1* algebraic_kernel_d_1() const; /// @} @@ -130,9 +130,9 @@ class Arr_rational_function_traits_2 { /*! -Functor to construct a `Curve_2`. To enable caching the class is not -default constructible and must be obtained via the function -`construct_curve_2_object()`, which is a member of the traits. +Functor to construct a `Curve_2`. To enable caching the class is not +default constructible and must be obtained via the function +`construct_curve_2_object()`, which is a member of the traits. \cgalModels `Assignable` \cgalModels `CopyConstructible` @@ -143,140 +143,140 @@ default constructible and must be obtained via the function class Construct_curve_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; /*! -*/ -typedef Arr_rational_function_traits_2::Curve_2 result_type; +*/ +typedef Arr_rational_function_traits_2::Curve_2 result_type; /*! -*/ -typedef Polynomial_1 argument_type; +*/ +typedef Polynomial_1 argument_type; /*! -*/ -typedef Polynomial_1 first_argument_type; +*/ +typedef Polynomial_1 first_argument_type; /*! -*/ -typedef Polynomial_1 second_argument_type; +*/ +typedef Polynomial_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Constructs a curve representing the polynomial function \f$ y = P(x)\f$. -*/ -Curve_2 operator()(Polynomial_1 P) const; +Constructs a curve representing the polynomial function \f$ y = P(x)\f$. +*/ +Curve_2 operator()(Polynomial_1 P) const; /*! -Constructs a curve representing the polynomial function \f$ y = P(x)\f$. -The function is defined over the interval \f$ [x,+\infty)\f$ if \f$ right\f$ is true -and \f$ (-\infty,x]\f$ otherwise. -*/ -Curve_2 operator()(Polynomial_1 P, const Algebraic_real_1& x, bool right) const; +Constructs a curve representing the polynomial function \f$ y = P(x)\f$. +The function is defined over the interval \f$ [x,+\infty)\f$ if \f$ right\f$ is true +and \f$ (-\infty,x]\f$ otherwise. +*/ +Curve_2 operator()(Polynomial_1 P, const Algebraic_real_1& x, bool right) const; /*! -Constructs a curve representing the polynomial function \f$ y = P(x)\f$. -The function is defined over the interval \f$ [lower,upper]\f$. -*/ -Curve_2 operator()(Polynomial_1 P, const Algebraic_real_1& lower, const Algebraic_real_1& upper) const; +Constructs a curve representing the polynomial function \f$ y = P(x)\f$. +The function is defined over the interval \f$ [lower,upper]\f$. +*/ +Curve_2 operator()(Polynomial_1 P, const Algebraic_real_1& lower, const Algebraic_real_1& upper) const; /*! -Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$. -*/ -Curve_2 operator()(Polynomial_1 P, Polynomial_1 Q) const; +Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$. +*/ +Curve_2 operator()(Polynomial_1 P, Polynomial_1 Q) const; /*! -Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$. -The function is defined over the interval \f$ I=[x,+\infty)\f$ if \f$ right\f$ is -true and \f$ I=(-\infty,x]\f$ otherwise. -*/ -Curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, const Algebraic_real_1& x, bool right) const; +Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$. +The function is defined over the interval \f$ I=[x,+\infty)\f$ if \f$ right\f$ is +true and \f$ I=(-\infty,x]\f$ otherwise. +*/ +Curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, const Algebraic_real_1& x, bool right) const; /*! -Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$. -The function is defined over the interval \f$ I=[lower,upper]\f$. -*/ -Curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, const Algebraic_real_1& lower, const Algebraic_real_1& upper) const; +Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$. +The function is defined over the interval \f$ I=[lower,upper]\f$. +*/ +Curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, const Algebraic_real_1& lower, const Algebraic_real_1& upper) const; /*! -Constructs a curve representing the polynomial function \f$ y = P(x)\f$, where -the coefficients of \f$ P\f$ are given in the range `[begin,end)`. -*/ -template -Curve_2 operator()(InputIterator begin, InputIterator end) const; +Constructs a curve representing the polynomial function \f$ y = P(x)\f$, where +the coefficients of \f$ P\f$ are given in the range `[begin,end)`. +*/ +template +Curve_2 operator()(InputIterator begin, InputIterator end) const; /*! -Constructs a curve representing the polynomial function \f$ y = P(x)\f$, where -the coefficients of \f$ P\f$ are given in the range `[begin,end)`. The -function is defined over the interval \f$ [x,+\infty)\f$ if \f$ right\f$ is true -and \f$ (-\infty,x]\f$ otherwise. -*/ -template -Curve_2 operator()(InputIterator begin, InputIterator end, -const Algebraic_real_1& x, bool right) const; +Constructs a curve representing the polynomial function \f$ y = P(x)\f$, where +the coefficients of \f$ P\f$ are given in the range `[begin,end)`. The +function is defined over the interval \f$ [x,+\infty)\f$ if \f$ right\f$ is true +and \f$ (-\infty,x]\f$ otherwise. +*/ +template +Curve_2 operator()(InputIterator begin, InputIterator end, +const Algebraic_real_1& x, bool right) const; /*! -Constructs a curve representing the polynomial function \f$ y = P(x)\f$, where -the coefficients of \f$ P\f$ are given in the range `[begin,end)`. The -function is defined over the interval \f$ [lower,upper]\f$. -*/ -template -Curve_2 operator()(InputIterator begin, InputIterator end, -const Algebraic_real_1& lower, -const Algebraic_real_1& upper) const; +Constructs a curve representing the polynomial function \f$ y = P(x)\f$, where +the coefficients of \f$ P\f$ are given in the range `[begin,end)`. The +function is defined over the interval \f$ [lower,upper]\f$. +*/ +template +Curve_2 operator()(InputIterator begin, InputIterator end, +const Algebraic_real_1& lower, +const Algebraic_real_1& upper) const; /*! -Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$, -where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the ranges -`[begin_numer,end_numer)` and `[begin_denom,end_denom)`, -respectively. -*/ -template -Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, -InputIterator begin_denom, InputIterator end_denom) const; +Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$, +where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the ranges +`[begin_numer,end_numer)` and `[begin_denom,end_denom)`, +respectively. +*/ +template +Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, +InputIterator begin_denom, InputIterator end_denom) const; /*! -Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$, -where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the ranges -`[begin_numer,end_numer)` and `[begin_denom,end_denom)`, -respectively. The function is defined over the interval \f$ I=[x,+\infty)\f$ -if \f$ right\f$ is true and \f$ I=(-\infty,x]\f$ otherwise. -*/ -template -Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, -InputIterator begin_denom, InputIterator end_denom, -const Algebraic_real_1& x, bool right) const; +Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$, +where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the ranges +`[begin_numer,end_numer)` and `[begin_denom,end_denom)`, +respectively. The function is defined over the interval \f$ I=[x,+\infty)\f$ +if \f$ right\f$ is true and \f$ I=(-\infty,x]\f$ otherwise. +*/ +template +Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, +InputIterator begin_denom, InputIterator end_denom, +const Algebraic_real_1& x, bool right) const; /*! -Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$, -where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the ranges -`[begin_numer,end_numer)` and `[begin_denom,end_denom)`, -respectively. The function is defined over the interval \f$ I=[lower,upper]\f$. -*/ -template -Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, -InputIterator begin_denom, InputIterator end_denom, -const Algebraic_real_1& lower, -const Algebraic_real_1& upper) const; +Constructs a curve representing the rational function \f$ y = P(x)/Q(x)\f$, +where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the ranges +`[begin_numer,end_numer)` and `[begin_denom,end_denom)`, +respectively. The function is defined over the interval \f$ I=[lower,upper]\f$. +*/ +template +Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, +InputIterator begin_denom, InputIterator end_denom, +const Algebraic_real_1& lower, +const Algebraic_real_1& upper) const; /// @} @@ -285,9 +285,9 @@ const Algebraic_real_1& upper) const; /*! -Functor to construct a `X_monotone_curve_2`. To enable caching the class -is not default constructible and must be obtained via the function -`construct_x_monotone_curve_2_object()`, which is a member of the traits. +Functor to construct a `X_monotone_curve_2`. To enable caching the class +is not default constructible and must be obtained via the function +`construct_x_monotone_curve_2_object()`, which is a member of the traits. \cgalModels `Assignable` \cgalModels `CopyConstructible` @@ -298,157 +298,157 @@ is not default constructible and must be obtained via the function class Construct_x_monotone_curve_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; /*! -*/ -typedef Arr_rational_function_traits_2::X_monotone_curve_2 result_type; +*/ +typedef Arr_rational_function_traits_2::X_monotone_curve_2 result_type; /*! -*/ -typedef Polynomial_1 argument_type; +*/ +typedef Polynomial_1 argument_type; /*! -*/ -typedef Polynomial_1 first_argument_type; +*/ +typedef Polynomial_1 first_argument_type; /*! -*/ -typedef Polynomial_1 second_argument_type; +*/ +typedef Polynomial_1 second_argument_type; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -Constructs an \f$ x\f$-monotone curve supported by the polynomial function -\f$ y = P(x)\f$. -*/ -X_monotone_curve_2 operator()(Polynomial_1 P) const; - -/*! -Constructs an \f$ x\f$-monotone curve supported by the polynomial function -\f$ y = P(x)\f$. The function is defined over the interval \f$ [x,+\infty)\f$ if -\f$ right\f$ is true and \f$ (-\infty,x]\f$ otherwise. -*/ -X_monotone_curve_2 operator()(Polynomial_1 P, -const Algebraic_real_1& x, -bool right) const; - -/*! -Constructs an \f$ x\f$-monotone curve supported by the polynomial function -\f$ y = P(x)\f$. The function is defined over the interval \f$ [lower,upper]\f$. -*/ -X_monotone_curve_2 operator()(Polynomial_1 P, -const Algebraic_real_1& lower, -const Algebraic_real_1& upper); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the rational function -\f$ y = P(x)/Q(x)\f$. -\pre \f$ Q\f$ has no real roots. -*/ -X_monotone_curve_2 operator()(Polynomial_1 P, Polynomial_1 Q); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the rational function -\f$ y = P(x)/Q(x)\f$. The function is defined over the interval \f$ I=[x,+\infty)\f$ -if \f$ right\f$ is true and \f$ I=(-\infty,x]\f$ otherwise. -\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. -*/ -X_monotone_curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, -const Algebraic_real_1& x, -bool right); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the rational function -\f$ y = P(x)/Q(x)\f$. The function is defined over the interval \f$ I=[lower,upper]\f$. -\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. -*/ -X_monotone_curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, -const Algebraic_real_1& lower, -const Algebraic_real_1& upper); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the polynomial function -\f$ y = P(x)\f$, where the coefficients of \f$ P\f$ are given in the range -`[begin,end)`. -*/ -template -X_monotone_curve_2 operator()(InputIterator begin, InputIterator end) const; - -/*! -Constructs an \f$ x\f$-monotone curve supported by the polynomial function -\f$ y = P(x)\f$, where the coefficients of \f$ P\f$ are given in the range -`[begin,end)`. The function is defined over the interval \f$ [x,+\infty)\f$ -if \f$ right\f$ is true and \f$ (-\infty,x]\f$ otherwise. -*/ -template -X_monotone_curve_2 operator()(InputIterator begin, InputIterator end, -const Algebraic_real_1& x, bool right) const; - -/*! -Constructs an \f$ x\f$-monotone curve supported by the polynomial function -\f$ y = P(x)\f$, where the coefficients of \f$ P\f$ are given in the range -`[begin,end)`. The function is defined over the interval -\f$ [lower,upper]\f$. -*/ -template -X_monotone_curve_2 operator()(InputIterator begin, InputIterator end -const Algebraic_real_1& lower, -const Algebraic_real_1& upper); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the rational function -\f$ y = P(x)/Q(x)\f$, where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the -ranges `[begin_numer,end_numer)` and `[begin_denom,end_denom)`, -respectively. -\pre \f$ Q\f$ has no real roots. -*/ -template -X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, -InputIterator begin_denom, InputIterator end_denom); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the rational function -\f$ y = P(x)/Q(x)\f$, where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the -ranges `[begin_numer,end_numer)` and `[begin_denom,end_denom)`, -respectively. The function is defined over the interval \f$ I=[x,+\infty)\f$ -if \f$ right\f$ is true and \f$ I=(-\infty,x]\f$ otherwise. -\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. -*/ -template -X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, -InputIterator begin_denom, InputIterator end_denom, -const Algebraic_real_1& x, bool right); const - -/*! -Constructs an \f$ x\f$-monotone curve supported by the rational function -\f$ y = P(x)/Q(x)\f$, where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the -ranges `[begin_numer,end_numer)` and `[begin_denom,end_denom)`, -respectively. The function is defined over the interval \f$ I=[lower,upper]\f$. -\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. -*/ -template -X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, -InputIterator begin_denom, InputIterator end_denom, -const Algebraic_real_1& lower, const Algebraic_real_1& upper); const +Constructs an \f$ x\f$-monotone curve supported by the polynomial function +\f$ y = P(x)\f$. +*/ +X_monotone_curve_2 operator()(Polynomial_1 P) const; + +/*! +Constructs an \f$ x\f$-monotone curve supported by the polynomial function +\f$ y = P(x)\f$. The function is defined over the interval \f$ [x,+\infty)\f$ if +\f$ right\f$ is true and \f$ (-\infty,x]\f$ otherwise. +*/ +X_monotone_curve_2 operator()(Polynomial_1 P, +const Algebraic_real_1& x, +bool right) const; + +/*! +Constructs an \f$ x\f$-monotone curve supported by the polynomial function +\f$ y = P(x)\f$. The function is defined over the interval \f$ [lower,upper]\f$. +*/ +X_monotone_curve_2 operator()(Polynomial_1 P, +const Algebraic_real_1& lower, +const Algebraic_real_1& upper); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the rational function +\f$ y = P(x)/Q(x)\f$. +\pre \f$ Q\f$ has no real roots. +*/ +X_monotone_curve_2 operator()(Polynomial_1 P, Polynomial_1 Q); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the rational function +\f$ y = P(x)/Q(x)\f$. The function is defined over the interval \f$ I=[x,+\infty)\f$ +if \f$ right\f$ is true and \f$ I=(-\infty,x]\f$ otherwise. +\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. +*/ +X_monotone_curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, +const Algebraic_real_1& x, +bool right); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the rational function +\f$ y = P(x)/Q(x)\f$. The function is defined over the interval \f$ I=[lower,upper]\f$. +\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. +*/ +X_monotone_curve_2 operator()(Polynomial_1 P, Polynomial_1 Q, +const Algebraic_real_1& lower, +const Algebraic_real_1& upper); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the polynomial function +\f$ y = P(x)\f$, where the coefficients of \f$ P\f$ are given in the range +`[begin,end)`. +*/ +template +X_monotone_curve_2 operator()(InputIterator begin, InputIterator end) const; + +/*! +Constructs an \f$ x\f$-monotone curve supported by the polynomial function +\f$ y = P(x)\f$, where the coefficients of \f$ P\f$ are given in the range +`[begin,end)`. The function is defined over the interval \f$ [x,+\infty)\f$ +if \f$ right\f$ is true and \f$ (-\infty,x]\f$ otherwise. +*/ +template +X_monotone_curve_2 operator()(InputIterator begin, InputIterator end, +const Algebraic_real_1& x, bool right) const; + +/*! +Constructs an \f$ x\f$-monotone curve supported by the polynomial function +\f$ y = P(x)\f$, where the coefficients of \f$ P\f$ are given in the range +`[begin,end)`. The function is defined over the interval +\f$ [lower,upper]\f$. +*/ +template +X_monotone_curve_2 operator()(InputIterator begin, InputIterator end +const Algebraic_real_1& lower, +const Algebraic_real_1& upper); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the rational function +\f$ y = P(x)/Q(x)\f$, where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the +ranges `[begin_numer,end_numer)` and `[begin_denom,end_denom)`, +respectively. +\pre \f$ Q\f$ has no real roots. +*/ +template +X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, +InputIterator begin_denom, InputIterator end_denom); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the rational function +\f$ y = P(x)/Q(x)\f$, where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the +ranges `[begin_numer,end_numer)` and `[begin_denom,end_denom)`, +respectively. The function is defined over the interval \f$ I=[x,+\infty)\f$ +if \f$ right\f$ is true and \f$ I=(-\infty,x]\f$ otherwise. +\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. +*/ +template +X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, +InputIterator begin_denom, InputIterator end_denom, +const Algebraic_real_1& x, bool right); const + +/*! +Constructs an \f$ x\f$-monotone curve supported by the rational function +\f$ y = P(x)/Q(x)\f$, where the coefficients of \f$ P\f$ and \f$ Q\f$ are given in the +ranges `[begin_numer,end_numer)` and `[begin_denom,end_denom)`, +respectively. The function is defined over the interval \f$ I=[lower,upper]\f$. +\pre \f$ Q\f$ has no real roots in the interior of \f$ I\f$. +*/ +template +X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, +InputIterator begin_denom, InputIterator end_denom, +const Algebraic_real_1& lower, const Algebraic_real_1& upper); const /// @} @@ -457,8 +457,8 @@ const Algebraic_real_1& lower, const Algebraic_real_1& upper); const /*! -The `Curve_2` class nested within the traits is used -to represent rational functions which may be restricted to a certain x-range. +The `Curve_2` class nested within the traits is used +to represent rational functions which may be restricted to a certain x-range. \cgalModels `ArrTraits::Curve_2` @@ -466,63 +466,63 @@ to represent rational functions which may be restricted to a certain x-range. class Curve_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the numerator of the supporting rational function. -*/ -const Polynomial_1& numerator () const; +returns the numerator of the supporting rational function. +*/ +const Polynomial_1& numerator () const; /*! -returns the denominator of the supporting rational function. -*/ -const Polynomial_1& denominator () const; +returns the denominator of the supporting rational function. +*/ +const Polynomial_1& denominator () const; /*! -returns whether çurve is continuous, namely whether it does not -contains any vertical asymptotes in its interior. -*/ -bool is_continuous() const; +returns whether çurve is continuous, namely whether it does not +contains any vertical asymptotes in its interior. +*/ +bool is_continuous() const; /*! -returns whether the \f$ x\f$-coordinate of çurve's left end is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space left_parameter_space_in_x () const; +returns whether the \f$ x\f$-coordinate of çurve's left end is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space left_parameter_space_in_x () const; /*! -returns whether the \f$ x\f$-coordinate of çurve's right end is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space right_parameter_space_in_x () const; +returns whether the \f$ x\f$-coordinate of çurve's right end is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space right_parameter_space_in_x () const; /*! -returns the \f$ x\f$-coordinate of the left end. -\pre left_boundary_in_x()==ARR_INTERIOR -*/ -Algebraic_real_1 left_x() const; +returns the \f$ x\f$-coordinate of the left end. +\pre left_boundary_in_x()==ARR_INTERIOR +*/ +Algebraic_real_1 left_x() const; /*! -returns the \f$ x\f$-coordinate of the right end. -\pre right_boundary_in_x()==ARR_INTERIOR -*/ -Algebraic_real_1 right_x() const; +returns the \f$ x\f$-coordinate of the right end. +\pre right_boundary_in_x()==ARR_INTERIOR +*/ +Algebraic_real_1 right_x() const; /// @} @@ -537,90 +537,90 @@ Algebraic_real_1 right_x() const; class Point_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; /*! -*/ -typedef AlgebraicKernel_d_1::Bound Bound; +*/ +typedef AlgebraicKernel_d_1::Bound Bound; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the numerator of the supporting rational function. -*/ -Polynomial_1 numerator () const; +returns the numerator of the supporting rational function. +*/ +Polynomial_1 numerator () const; /*! -returns the denominator of the supporting rational function. -*/ -Polynomial_1 denominator () const; +returns the denominator of the supporting rational function. +*/ +Polynomial_1 denominator () const; /*! -returns double-approximations of the x- and y-coordinates. -*/ -std::pair to_double() const; +returns double-approximations of the x- and y-coordinates. +*/ +std::pair to_double() const; /*! -returns the \f$ x\f$-coordinate of the point. -*/ -Algebraic_real_1 x() const; +returns the \f$ x\f$-coordinate of the point. +*/ +Algebraic_real_1 x() const; /*! -obtains the y-coordinates of the point. Attention: As described above, -points are not stored by their y-coordinate in `Algebraic_real_1` -representation. In fact, this representation must be computed on demand, and -might become quite costly for points defined by high-degree polynomials. -Therefore, it is recommended to avoid calls to this function as much as -possible. -*/ -Algebraic_real_1 y() const; +obtains the y-coordinates of the point. Attention: As described above, +points are not stored by their y-coordinate in `Algebraic_real_1` +representation. In fact, this representation must be computed on demand, and +might become quite costly for points defined by high-degree polynomials. +Therefore, it is recommended to avoid calls to this function as much as +possible. +*/ +Algebraic_real_1 y() const; /*! -Computes a pair \f$ p\f$ approximating the \f$ x\f$-coordinate with -respect to the given absolute precision \f$ a\f$. -\post \f$ p.first \leq x \leq p.second \f$ -\post \f$ p.second - p.first \leq2^{-a} \f$ -*/ -std::pair approximate_absolute_x(int a) const; +Computes a pair \f$ p\f$ approximating the \f$ x\f$-coordinate with +respect to the given absolute precision \f$ a\f$. +\post \f$ p.first \leq x \leq p.second \f$ +\post \f$ p.second - p.first \leq2^{-a} \f$ +*/ +std::pair approximate_absolute_x(int a) const; /*! -Computes a pair \f$ p\f$ approximating the \f$ y\f$-coordinate with -respect to the given absolute precision \f$ a\f$. -\post \f$ p.first \leq y \leq p.second \f$ -\post \f$ p.second - p.first \leq2^{-a} \f$ -*/ -std::pair approximate_absolute_y(int a) const; +Computes a pair \f$ p\f$ approximating the \f$ y\f$-coordinate with +respect to the given absolute precision \f$ a\f$. +\post \f$ p.first \leq y \leq p.second \f$ +\post \f$ p.second - p.first \leq2^{-a} \f$ +*/ +std::pair approximate_absolute_y(int a) const; /*! -Computes a pair \f$ p\f$ approximating the \f$ x\f$-coordinate with -respect to the given relative precision \f$ r\f$. -\post \f$ p.first \leq x \leq p.second \f$ -\post \f$ p.second - p.first \leq2^{-r}|x| \f$ -*/ -std::pair approximate_relative_x(int r) const; +Computes a pair \f$ p\f$ approximating the \f$ x\f$-coordinate with +respect to the given relative precision \f$ r\f$. +\post \f$ p.first \leq x \leq p.second \f$ +\post \f$ p.second - p.first \leq2^{-r}|x| \f$ +*/ +std::pair approximate_relative_x(int r) const; /*! -Computes a pair \f$ p\f$ approximating the \f$ y\f$-coordinate with -respect to the given relative precision \f$ r\f$. -\post \f$ p.first \leq y \leq p.second \f$ -\post \f$ p.second - p.first \leq2^{-r}|y| \f$ -*/ -std::pair approximate_relative_y(int r) const; +Computes a pair \f$ p\f$ approximating the \f$ y\f$-coordinate with +respect to the given relative precision \f$ r\f$. +\post \f$ p.first \leq y \leq p.second \f$ +\post \f$ p.second - p.first \leq2^{-r}|y| \f$ +*/ +std::pair approximate_relative_y(int r) const; /// @} @@ -629,9 +629,9 @@ std::pair approximate_relative_y(int r) const; /*! -The `X_monotone_curve_2` class nested within the traits is used -to represent \f$ x\f$-monotone parts of rational functions. In particular, such an \f$ x\f$-monotone curve -may not contain a vertical asymptote in its interior \f$ x\f$-range. +The `X_monotone_curve_2` class nested within the traits is used +to represent \f$ x\f$-monotone parts of rational functions. In particular, such an \f$ x\f$-monotone curve +may not contain a vertical asymptote in its interior \f$ x\f$-range. \cgalModels `ArrTraits::XMonotoneCurve_2` @@ -639,139 +639,139 @@ may not contain a vertical asymptote in its interior \f$ x\f$-range. class X_monotone_curve_2 { public: -/// \name Types +/// \name Types /// @{ /*! -*/ -typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; +*/ +typedef AlgebraicKernel_d_1::Polynomial_1 Polynomial_1; /*! -*/ -typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; +*/ +typedef AlgebraicKernel_d_1::Algebraic_real_1 Algebraic_real_1; /*! -*/ -typedef Arr_rational_function_traits_2::Point_2 Point_2; +*/ +typedef Arr_rational_function_traits_2::Point_2 Point_2; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the numerator of the supporting rational function. -*/ -const Polynomial_1& numerator () const; +returns the numerator of the supporting rational function. +*/ +const Polynomial_1& numerator () const; /*! -returns the denominator of the supporting rational function. -*/ -const Polynomial_1& denominator () const; +returns the denominator of the supporting rational function. +*/ +const Polynomial_1& denominator () const; /*! -returns whether the \f$ x\f$-coordinate of the source is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space source_parameter_space_in_x () const; +returns whether the \f$ x\f$-coordinate of the source is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space source_parameter_space_in_x () const; /*! -returns whether the \f$ y\f$-coordinate of the source is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space source_parameter_space_in_y () const; +returns whether the \f$ y\f$-coordinate of the source is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space source_parameter_space_in_y () const; /*! -returns the source point of the arc. -\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of the source point is finite. -*/ -const Point_2& source() const; +returns the source point of the arc. +\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of the source point is finite. +*/ +const Point_2& source() const; /*! -returns the \f$ x\f$-coordinate of the source point. -\pre The \f$ x\f$-coordinate of the source point is finite. -*/ -Algebraic_real_1 source_x() const; +returns the \f$ x\f$-coordinate of the source point. +\pre The \f$ x\f$-coordinate of the source point is finite. +*/ +Algebraic_real_1 source_x() const; /*! -returns whether the \f$ x\f$-coordinate of the target is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space target_parameter_space_in_x () const; +returns whether the \f$ x\f$-coordinate of the target is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space target_parameter_space_in_x () const; /*! -returns whether the \f$ y\f$-coordinate of the target is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space target_parameter_space_in_y () const; +returns whether the \f$ y\f$-coordinate of the target is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space target_parameter_space_in_y () const; /*! -returns the target point of the arc. -\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of the target point is finite. -*/ -const Point_2& target() const; +returns the target point of the arc. +\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of the target point is finite. +*/ +const Point_2& target() const; /*! -returns the \f$ x\f$-coordinate of the target point. -\pre The \f$ x\f$-coordinate of the target point is finite. -*/ -Algebraic_real_1 target_x() const; +returns the \f$ x\f$-coordinate of the target point. +\pre The \f$ x\f$-coordinate of the target point is finite. +*/ +Algebraic_real_1 target_x() const; /*! -returns whether the \f$ x\f$-coordinate of the left curve end is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space left_parameter_space_in_x () const; +returns whether the \f$ x\f$-coordinate of the left curve end is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space left_parameter_space_in_x () const; /*! -returns whether the \f$ y\f$-coordinate of the left curve end is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space left_parameter_space_in_y () const; +returns whether the \f$ y\f$-coordinate of the left curve end is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space left_parameter_space_in_y () const; /*! -returns the left point of the arc. -\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of the left point is finite. -*/ -const Point_2& left() const; +returns the left point of the arc. +\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of the left point is finite. +*/ +const Point_2& left() const; /*! -returns the \f$ x\f$-coordinate of the left point. -\pre The \f$ x\f$-coordinate of the left point is finite. -*/ -Algebraic_real_1 left_x() const; +returns the \f$ x\f$-coordinate of the left point. +\pre The \f$ x\f$-coordinate of the left point is finite. +*/ +Algebraic_real_1 left_x() const; /*! -returns whether the \f$ x\f$-coordinate of the right curve end is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space right_parameter_space_in_x () const; +returns whether the \f$ x\f$-coordinate of the right curve end is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space right_parameter_space_in_x () const; /*! -returns whether the \f$ y\f$-coordinate of the right curve end is finite or -whether it is \f$ \pm\infty\f$. -*/ -Arr_parameter_space right_parameter_space_in_y () const; +returns whether the \f$ y\f$-coordinate of the right curve end is finite or +whether it is \f$ \pm\infty\f$. +*/ +Arr_parameter_space right_parameter_space_in_y () const; /*! -returns the right point of the arc. -\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of The right point is finite. -*/ -const Point_2& right() const; +returns the right point of the arc. +\pre Both the \f$ x\f$- and \f$ y\f$-coordinates of The right point is finite. +*/ +const Point_2& right() const; /*! -returns the \f$ x\f$-coordinate of the right point. -\pre The \f$ x\f$-coordinate of the right point is finite. -*/ -Algebraic_real_1 right_x() const; +returns the \f$ x\f$-coordinate of the right point. +\pre The \f$ x\f$-coordinate of the right point is finite. +*/ +Algebraic_real_1 right_x() const; /*! -returns whether the curve is oriented from left to right. -*/ -bool is_left_to_right () const; +returns whether the curve is oriented from left to right. +*/ +bool is_left_to_right () const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h index fcdb042077bf..dc104a106194 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h @@ -66,15 +66,15 @@ class Arr_segment_traits_2 { Class Trim_2{ public: -/// \name Creation +/// \name Creation /// @{ /*! Trims the given x-monotone curve to an from src to tgt. -\ pre `src` and `tgt` lies on the curve -*/ +\ pre `src` and `tgt` lies on the curve +*/ -X_monotone_curve_2(const X_monotone_curve_2& xcv, +X_monotone_curve_2(const X_monotone_curve_2& xcv, const Point_2& src, const Point_2& tgt)const }/* end Arr_segment_traits_2::Trim_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h index 194ef8db56dc..054c1daff706 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h @@ -4,15 +4,15 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Tags -The categories `Left_side_category`, `Right_side_category`, -`Bottom_side_category`, and `Top_side_category`, -nested in any model of the `ArrangementBasicTraits_2`, must be -convertible to `Arr_oblivious_side_tag`. `Arr_oblivious_side_tag` is an empty construct used -for dispatching functions based on type of curves that induce the -arrangement. +The categories `Left_side_category`, `Right_side_category`, +`Bottom_side_category`, and `Top_side_category`, +nested in any model of the `ArrangementBasicTraits_2`, must be +convertible to `Arr_oblivious_side_tag`. `Arr_oblivious_side_tag` is an empty construct used +for dispatching functions based on type of curves that induce the +arrangement. -\sa `Arr_open_side_tag` -\sa `ArrangementBasicTraits_2` +\sa `Arr_open_side_tag` +\sa `ArrangementBasicTraits_2` */ @@ -26,18 +26,18 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Tags -All the four types `Left_side_category`, -`Right_side_category`, `Bottom_side_category`, -and `Top_side_category` nested in any model of the -concept `ArrangementOpenBoundaryTraits` must be convertible -to `Arr_open_side_tag`, which derives from `Arr_oblivious_side_tag`. It -implies that some curves are expected to approach the left, right, -bottom, or top sides of the open boundary of the parameter -space. `Arr_open_side_tag` is an empty construct used for dispatching -functions based on type of curves that induce the arrangement. - -\sa `Arr_oblivious_side_tag` -\sa `ArrangementOpenBoundaryTraits_2` +All the four types `Left_side_category`, +`Right_side_category`, `Bottom_side_category`, +and `Top_side_category` nested in any model of the +concept `ArrangementOpenBoundaryTraits` must be convertible +to `Arr_open_side_tag`, which derives from `Arr_oblivious_side_tag`. It +implies that some curves are expected to approach the left, right, +bottom, or top sides of the open boundary of the parameter +space. `Arr_open_side_tag` is an empty construct used for dispatching +functions based on type of curves that induce the arrangement. + +\sa `Arr_oblivious_side_tag` +\sa `ArrangementOpenBoundaryTraits_2` */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h index 1e018c044dfb..0027ec53409c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h @@ -4,27 +4,27 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2PointLocation -\anchor arr_reftrap_pl - -The `Arr_trapezoid_ric_point_location` class implements the incremental randomized algorithm -introduced by Mulmuley \cgalCite{m-fppa-90} as presented by -Seidel \cgalCite{s-sfira-91} (see also [\cgalCite{bkos-cgaa-00} Chapter 6). -It subdivides each arrangement face to pseudo-trapezoidal cells, each -of constant complexity, and constructs and maintains a linear-size search -structure on top of these cells, such that each query can be answered -in \f$ O(\log n)\f$ time, where \f$ n\f$ is the complexity of the arrangement. - -Constructing the search structures takes \f$ O(n \log n)\f$ expected time -and may require a small number of rebuilds \cgalCite{hkh-iiplgtds-12}. Therefore -attaching a trapezoidal point-location object to an existing arrangement -may incur some overhead in running times. In addition, the point-location -object needs to keep its auxiliary data structures up-to-date as the -arrangement goes through structural changes. It is therefore recommended -to use this point-location strategy for static arrangements (or arrangement -that do not alter frequently), and when the number of issued queries -is relatively large. - -This strategy supports arbitrary subdivisions, including unbounded ones. +\anchor arr_reftrap_pl + +The `Arr_trapezoid_ric_point_location` class implements the incremental randomized algorithm +introduced by Mulmuley \cgalCite{m-fppa-90} as presented by +Seidel \cgalCite{s-sfira-91} (see also [\cgalCite{bkos-cgaa-00} Chapter 6). +It subdivides each arrangement face to pseudo-trapezoidal cells, each +of constant complexity, and constructs and maintains a linear-size search +structure on top of these cells, such that each query can be answered +in \f$ O(\log n)\f$ time, where \f$ n\f$ is the complexity of the arrangement. + +Constructing the search structures takes \f$ O(n \log n)\f$ expected time +and may require a small number of rebuilds \cgalCite{hkh-iiplgtds-12}. Therefore +attaching a trapezoidal point-location object to an existing arrangement +may incur some overhead in running times. In addition, the point-location +object needs to keep its auxiliary data structures up-to-date as the +arrangement goes through structural changes. It is therefore recommended +to use this point-location strategy for static arrangements (or arrangement +that do not alter frequently), and when the number of issued queries +is relatively large. + +This strategy supports arbitrary subdivisions, including unbounded ones. \cgalModels `ArrangementPointLocation_2` \cgalModels `ArrangementVerticalRayShoot_2` @@ -39,28 +39,28 @@ template< typename Arrangement > class Arr_trapezoid_ric_point_location { public: -/// \name Creation +/// \name Creation /// @{ /*! -If with_guarantees is set to true, the construction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time. -*/ -Arr_trapezoid_ric_point_location (bool with_guarantees = true); +If with_guarantees is set to true, the construction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time. +*/ +Arr_trapezoid_ric_point_location (bool with_guarantees = true); /*! -Constructs a point location search structure for the given arrangement. If with_guarantees is set to true, the construction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time. -*/ -Arr_trapezoid_ric_point_location (const Arrangement& arr, bool with_guarantees = true); +Constructs a point location search structure for the given arrangement. If with_guarantees is set to true, the construction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time. +*/ +Arr_trapezoid_ric_point_location (const Arrangement& arr, bool with_guarantees = true); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -If with_guarantees is set to true, the structure will guarantee linear size and logarithmic query time, that is, this function may cause a reconstruction of the data structure. -*/ -void with_guarantees (bool with_guarantees); +If with_guarantees is set to true, the structure will guarantee linear size and logarithmic query time, that is, this function may cause a reconstruction of the data structure. +*/ +void with_guarantees (bool with_guarantees); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h index 0320001321b6..992a9862b9bb 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h @@ -18,7 +18,7 @@ As new vertices might be inserted into the attached arrangement, and existing vertices might be removed, the notification mechanism is used to dynamically maintain the mapping of vertex handles to indices. - + \cgalModels DefaultConstructible \cgalModels CopyConstructible \cgalModels Assignable @@ -32,12 +32,12 @@ template< typename Arrangement > class Arr_vertex_index_map: public Arr_observer { public: -/// \name Types +/// \name Types /// @{ /*! the type of the attached arrangement. -*/ +*/ typedef Arrangement Arrangement_2; typedef boost::readable_property_map_tag category; @@ -58,9 +58,9 @@ The type of mapping of vertices to indices. */ typedef Unique_hash_map Index_map; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! @@ -70,10 +70,10 @@ Arr_vertex_index_map(); /*! constructs a map and attaches it to the given arrangement `arr`. -*/ +*/ Arr_vertex_index_map(Arrangement_2& arr); -/// @} +/// @} }; /* end Arr_accessor */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h index e0f4dbb918c8..d2deb6868f44 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h @@ -3,49 +3,49 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Funcs -Produces the symbolic vertical decomposition of a -given arrangement, performing a batched vertical ray-shooting query from -all arrangement vertices, such that every vertex is associated with a pair -of objects, one corresponds to the arrangement feature that lies below it, -and the other corresponds to the feature that lies above it. -The output of this function can be readily used for inserting vertical walls -and physically decomposing the arrangement into pseudo-trapezoids. To do -this, it is convenient to process the vertices in an ascending -\f$ xy\f$-lexicographic order. The visible objects are therefore returned through -an output iterator, which pairs each finite arrangement vertex with the two -features it "sees", such that the vertices are given in ascending -\f$ xy\f$-lexicographic order. - -Produces the symbolic vertical decomposition of the `arr` arrangement. -More precisely, it performs a batched vertical ray-shooting query from all -arrangement vertices, such that every vertex is associated with a pair of -objects, one corresponding to the arrangement feature that lies below it, -while the other corresponds to the feature that lies above it. -The query results are returned through the output iterator, which pairs -each finite arrangement vertex with a pair of `Object`s, the first -represents the feature below the vertex, and the second represents the -feature that lies above it. Each `Object` may be one of the following: -
          -
        • `Halfedge_const_handle`, if the vertex is located above (or -below) an edge. The given halfedge is always directed from right to left. -In case there is no concrete edge below (or above) the vertex, and -the arrangement is unbounded, then the object returned is a -fictitious halfedge. -
        • `Face_const_handle`, in case there is no edge below (or above) -the vertex, and the arrangement is bounded. -
        • `Vertex_const_handle`, in case the vertex is located vertically -above (or below) another arrangement vertex. -
        • An empty object, in case the vertex is the top end-vertex of -a vertical edge, we define there is no feature below it. Similarly, if -it is the bottom end-vertex of a vertical edge, we define that there -is no feature above it. -
        -The function returns a past-the-end iterator for its output sequence. +Produces the symbolic vertical decomposition of a +given arrangement, performing a batched vertical ray-shooting query from +all arrangement vertices, such that every vertex is associated with a pair +of objects, one corresponds to the arrangement feature that lies below it, +and the other corresponds to the feature that lies above it. +The output of this function can be readily used for inserting vertical walls +and physically decomposing the arrangement into pseudo-trapezoids. To do +this, it is convenient to process the vertices in an ascending +\f$ xy\f$-lexicographic order. The visible objects are therefore returned through +an output iterator, which pairs each finite arrangement vertex with the two +features it "sees", such that the vertices are given in ascending +\f$ xy\f$-lexicographic order. + +Produces the symbolic vertical decomposition of the `arr` arrangement. +More precisely, it performs a batched vertical ray-shooting query from all +arrangement vertices, such that every vertex is associated with a pair of +objects, one corresponding to the arrangement feature that lies below it, +while the other corresponds to the feature that lies above it. +The query results are returned through the output iterator, which pairs +each finite arrangement vertex with a pair of `Object`s, the first +represents the feature below the vertex, and the second represents the +feature that lies above it. Each `Object` may be one of the following: +
          +
        • `Halfedge_const_handle`, if the vertex is located above (or +below) an edge. The given halfedge is always directed from right to left. +In case there is no concrete edge below (or above) the vertex, and +the arrangement is unbounded, then the object returned is a +fictitious halfedge. +
        • `Face_const_handle`, in case there is no edge below (or above) +the vertex, and the arrangement is bounded. +
        • `Vertex_const_handle`, in case the vertex is located vertically +above (or below) another arrangement vertex. +
        • An empty object, in case the vertex is the top end-vertex of +a vertical edge, we define there is no feature below it. Similarly, if +it is the bottom end-vertex of a vertical edge, we define that there +is no feature above it. +
        +The function returns a past-the-end iterator for its output sequence. \cgalHeading{Requirements} -`OutputIterator::value_type` must be -`pair >`. +`OutputIterator::value_type` must be +`pair >`. */ templateDcel) such that each Dcel vertex - is associated with a point of the plane and each edge is - associated with an \f$ x\f$-monotone curve whose interior is disjoint from all - other edges and vertices. Recall that an arrangement - edge is always comprised of a pair of twin Dcel halfedges. - - The `Arrangement_2` template has two parameters: -
          -
        • The `Traits` template-parameter should be instantiated with - a model of the `ArrangementBasicTraits_2` concept. The traits - class defines the types of \f$ x\f$-monotone curves and two-dimensional - points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and `ArrangementBasicTraits_2::Point_2`, - respectively, and supports basic geometric predicates on them. -
        • The `Dcel` template-parameter should be instantiated with - a class that is a model of the `ArrangementDcel` concept. The - value of this parameter is by default - `Arr_default_dcel`. -
        - The available traits classes and Dcel classes are described below. - - \sa `ArrangementDcel` - \sa `Arr_default_dcel` - \sa `ArrangementBasicTraits_2` - \sa `CGAL::overlay()` - \sa `CGAL::is_valid()` + \anchor arr_refarr + + An object `arr` of the class `Arrangement_2` represents the + planar subdivision induced by a set of \f$ x\f$-monotone curves and isolated + points into maximally connected cells. The arrangement is represented as + a doubly-connected edge-list (Dcel) such that each Dcel vertex + is associated with a point of the plane and each edge is + associated with an \f$ x\f$-monotone curve whose interior is disjoint from all + other edges and vertices. Recall that an arrangement + edge is always comprised of a pair of twin Dcel halfedges. + + The `Arrangement_2` template has two parameters: +
          +
        • The `Traits` template-parameter should be instantiated with + a model of the `ArrangementBasicTraits_2` concept. The traits + class defines the types of \f$ x\f$-monotone curves and two-dimensional + points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and `ArrangementBasicTraits_2::Point_2`, + respectively, and supports basic geometric predicates on them. +
        • The `Dcel` template-parameter should be instantiated with + a class that is a model of the `ArrangementDcel` concept. The + value of this parameter is by default + `Arr_default_dcel`. +
        + The available traits classes and Dcel classes are described below. + + \sa `ArrangementDcel` + \sa `Arr_default_dcel` + \sa `ArrangementBasicTraits_2` + \sa `CGAL::overlay()` + \sa `CGAL::is_valid()` Insertion Functions @@ -41,12 +41,12 @@ namespace CGAL { \sa `CGAL::insert_non_intersecting_curves()` \sa `CGAL::insert_point()` - Removal functions + Removal functions \sa `CGAL::remove_edge()` \sa `CGAL::remove_vertex()` - Input/output functions + Input/output functions \sa `PkgArrangementOnSurface2Read` \sa `PkgArrangementOnSurface2Write` @@ -56,112 +56,112 @@ template< typename Traits, typename Dcel > class Arrangement_2 { public: - /// \name Types + /// \name Types /// @{ /*! - a private type used as an abbreviation of the `Arrangement_2` type hereafter. - */ - typedef Arrangement_2 Self; + a private type used as an abbreviation of the `Arrangement_2` type hereafter. + */ + typedef Arrangement_2 Self; /*! - the traits class in use. - */ + the traits class in use. + */ typedef Traits Traits_2; /*! - the Dcel representation of the arrangement. - */ - typedef unspecified_type Dcel; + the Dcel representation of the arrangement. + */ + typedef unspecified_type Dcel; /*! - the point type, as defined by the traits class. - */ - typedef typename Traits_2::Point_2 Point_2; + the point type, as defined by the traits class. + */ + typedef typename Traits_2::Point_2 Point_2; /*! - the \f$ x\f$-monotone curve type, as defined by the traits class. - */ - typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; + the \f$ x\f$-monotone curve type, as defined by the traits class. + */ + typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; /*! - the size type (equivalent to `size_t`). - */ - typedef typename Dcel::Size Size; + the size type (equivalent to `size_t`). + */ + typedef typename Dcel::Size Size; /*! \ingroup PkgArrangementOnSurface2DCEL - An object \f$ v\f$ of the class `Vertex` represents an arrangement vertex, - that is - a \f$ 0\f$-dimensional cell, associated with a point on the plane. + An object \f$ v\f$ of the class `Vertex` represents an arrangement vertex, + that is - a \f$ 0\f$-dimensional cell, associated with a point on the plane. */ class Vertex : public Dcel::Vertex { public: - /// \name Creation + /// \name Creation /// @{ /*! - default constructor. - */ - Vertex(); + default constructor. + */ + Vertex(); - /// @} + /// @} - /// \name Access Functions - /// All non-const methods listed below also have `const` counterparts - /// that return constant handles, iterators or circulators: + /// \name Access Functions + /// All non-const methods listed below also have `const` counterparts + /// that return constant handles, iterators or circulators: /// @{ /*! - checks whether the vertex lies at infinity and not associated with - a point with bounded coordinates. - */ - bool is_at_open_boundary() const; + checks whether the vertex lies at infinity and not associated with + a point with bounded coordinates. + */ + bool is_at_open_boundary() const; /*! - checks whether the vertex is isolated (i.e., has no incident edges). - */ - bool is_isolated() const; + checks whether the vertex is isolated (i.e., has no incident edges). + */ + bool is_isolated() const; /*! - returns the number of edges incident to `v`. - */ - Size degree() const; + returns the number of edges incident to `v`. + */ + Size degree() const; /*! - returns a circulator circulator that allows going over the halfedges - incident to `v` (that have `v` as their target). - The edges are traversed in a clockwise direction around `v`. - \pre `v` is not an isolated vertex. - */ - Halfedge_around_vertex_circulator incident_halfedges(); + returns a circulator circulator that allows going over the halfedges + incident to `v` (that have `v` as their target). + The edges are traversed in a clockwise direction around `v`. + \pre `v` is not an isolated vertex. + */ + Halfedge_around_vertex_circulator incident_halfedges(); /*! - returns a handle to the face that contains `v` in its interior. - \pre `v` is an isolated vertex. - */ - Face_handle face(); + returns a handle to the face that contains `v` in its interior. + \pre `v` is an isolated vertex. + */ + Face_handle face(); /*! - returns the point associated with the vertex. - \pre `v` is not a vertex at infinity. - */ - const typename Traits::Point_2& point() const; + returns the point associated with the vertex. + \pre `v` is not a vertex at infinity. + */ + const typename Traits::Point_2& point() const; /*! - returns the placement of the \f$ x\f$-coordinate in the parameter space, - that is, either the left boundary-side, the interior, or the right - boundary-side. - */ - Arr_parameter_space parameter_space_in_x () const; + returns the placement of the \f$ x\f$-coordinate in the parameter space, + that is, either the left boundary-side, the interior, or the right + boundary-side. + */ + Arr_parameter_space parameter_space_in_x () const; /*! - returns the placement of the \f$ y\f$-coordinate in the parameter space, - that is, either the bottom boundary-side, the interior, or the top - boundary-side. - */ - Arr_parameter_space parameter_space_in_y () const; + returns the placement of the \f$ y\f$-coordinate in the parameter space, + that is, either the bottom boundary-side, the interior, or the top + boundary-side. + */ + Arr_parameter_space parameter_space_in_y () const; /// @} @@ -169,94 +169,94 @@ class Arrangement_2 { /*! \ingroup PkgArrangementOnSurface2DCEL - An object \f$ e\f$ of the class `Halfedge` represents a halfedge in the - arrangement. A halfedge is directed from its source vertex - to its target vertex, and has an incident face lying to - its left. Each halfedge has a twin halfedge directed in the - opposite direction, where the pair of twin halfedges form together - an arrangement edge, that is - a \f$ 1\f$-dimensional cell, associated - with planar \f$ x\f$-monotone curve. + An object \f$ e\f$ of the class `Halfedge` represents a halfedge in the + arrangement. A halfedge is directed from its source vertex + to its target vertex, and has an incident face lying to + its left. Each halfedge has a twin halfedge directed in the + opposite direction, where the pair of twin halfedges form together + an arrangement edge, that is - a \f$ 1\f$-dimensional cell, associated + with planar \f$ x\f$-monotone curve. - Halfedges are stored in doubly-connected lists and form chains. These - chains define the inner and outer boundaries of connected components. + Halfedges are stored in doubly-connected lists and form chains. These + chains define the inner and outer boundaries of connected components. */ class Halfedge : public Dcel::Halfedge { public: - /// \name Creation + /// \name Creation /// @{ /*! - default constructor. - */ - Halfedge(); + default constructor. + */ + Halfedge(); - /// @} + /// @} - /// \name Access Functions - /// All non-const methods listed below also have `const` counterparts - /// that return constant handles, iterators or circulators: + /// \name Access Functions + /// All non-const methods listed below also have `const` counterparts + /// that return constant handles, iterators or circulators: /// @{ /*! - returns whether the halfedge is fictitious (i.e., connects two vertices at - infinity and is not associated with a valid curve). - */ - bool is_fictitious () const; + returns whether the halfedge is fictitious (i.e., connects two vertices at + infinity and is not associated with a valid curve). + */ + bool is_fictitious () const; /*! - returns a handle for the source vertex of `e`. - */ - Vertex_handle source(); + returns a handle for the source vertex of `e`. + */ + Vertex_handle source(); /*! - returns a handle for the target vertex of `e`. - */ - Vertex_handle target(); + returns a handle for the target vertex of `e`. + */ + Vertex_handle target(); /*! - returns the direction of the halfedge: `ARR_LEFT_TO_RIGHT` if - `e`'s source vertex is lexicographically smaller than it - target (so the halfedge is directed from left to right), and - `ARR_RIGHT_TO_LEFT` if it is lexicographically larger than - the target (so the halfedge is directed from right to left). - */ - Arr_halfedge_direction direction() const; + returns the direction of the halfedge: `ARR_LEFT_TO_RIGHT` if + `e`'s source vertex is lexicographically smaller than it + target (so the halfedge is directed from left to right), and + `ARR_RIGHT_TO_LEFT` if it is lexicographically larger than + the target (so the halfedge is directed from right to left). + */ + Arr_halfedge_direction direction() const; /*! - returns the face that `e` is incident to (The face lies to - the left of `e`). - */ - Face_handle face(); + returns the face that `e` is incident to (The face lies to + the left of `e`). + */ + Face_handle face(); /*! - returns the twin halfedge. - */ - Halfedge_handle twin(); + returns the twin halfedge. + */ + Halfedge_handle twin(); /*! - returns `e`'s predecessor in the connected component it belongs to. - */ - Halfedge_handle prev(); + returns `e`'s predecessor in the connected component it belongs to. + */ + Halfedge_handle prev(); /*! - returns `e`'s successor in the connected component it belongs to. - */ - Halfedge_handle next(); + returns `e`'s successor in the connected component it belongs to. + */ + Halfedge_handle next(); /*! - returns a circulator that allows traversing the halfedges of the - connected component boundary (CCB) that contains `e`. - The circulator is initialized to point to `e`. - */ - Ccb_halfedge_circulator ccb(); + returns a circulator that allows traversing the halfedges of the + connected component boundary (CCB) that contains `e`. + The circulator is initialized to point to `e`. + */ + Ccb_halfedge_circulator ccb(); /*! - returns the \f$ x\f$-monotone curve associated with `e`. - \pre `e` is not a fictitious halfedge. - */ - const typename Traits::X_monotone_curve_2& curve() const; + returns the \f$ x\f$-monotone curve associated with `e`. + \pre `e` is not a fictitious halfedge. + */ + const typename Traits::X_monotone_curve_2& curve() const; /// @} @@ -265,90 +265,90 @@ class Arrangement_2 { /*! \ingroup PkgArrangementOnSurface2DCEL - An object of the class `Face` represents an arrangement face, - namely, a \f$ 2\f$-dimensional arrangement cell. An arrangement that supports - only bounded curves contains exactly one unbounded face, and a - number of bounded faces. An arrangement that supports also unbounded - curves has one or more unbounded faces. Such an arrangement has also - exactly one fictitious face, which does not correspond to a real - two-dimensional cell of the arrangement (and thus it is ignored in - counting the number of faces of the arrangement.) - Each bounded face has an outer boundary comprising a halfedge chain - winding in counterclockwise orientation around it. Each unbounded face of - an arrangement that has a fictitious face also has a boundary comprising - a counterclockwise halfedge-chain. The edges on the boundary of a face - incident to the fictitious face are fictitious, as they do not correspond - to real curves. A face may also contain holes, which are defined by - clockwise-oriented halfedge chains, and isolated vertices. + An object of the class `Face` represents an arrangement face, + namely, a \f$ 2\f$-dimensional arrangement cell. An arrangement that supports + only bounded curves contains exactly one unbounded face, and a + number of bounded faces. An arrangement that supports also unbounded + curves has one or more unbounded faces. Such an arrangement has also + exactly one fictitious face, which does not correspond to a real + two-dimensional cell of the arrangement (and thus it is ignored in + counting the number of faces of the arrangement.) + Each bounded face has an outer boundary comprising a halfedge chain + winding in counterclockwise orientation around it. Each unbounded face of + an arrangement that has a fictitious face also has a boundary comprising + a counterclockwise halfedge-chain. The edges on the boundary of a face + incident to the fictitious face are fictitious, as they do not correspond + to real curves. A face may also contain holes, which are defined by + clockwise-oriented halfedge chains, and isolated vertices. */ class Face : public Dcel::Face { public: - /// \name Creation + /// \name Creation /// @{ /*! - default constructor. - */ - Face(); + default constructor. + */ + Face(); - /// @} + /// @} - /// \name Access Functions - /// All non-const methods listed below also have `const` counterparts - /// that return constant handles, iterators or circulators: + /// \name Access Functions + /// All non-const methods listed below also have `const` counterparts + /// that return constant handles, iterators or circulators: /// @{ /*! - returns a Boolean indicating whether this is the fictitious face, - which contain the entire arrangement (and does not have an outer CCB). - An arrangement that supports only bounded curves does not have a - fictitious face at all. - */ - bool is_fictitious () const; + returns a Boolean indicating whether this is the fictitious face, + which contain the entire arrangement (and does not have an outer CCB). + An arrangement that supports only bounded curves does not have a + fictitious face at all. + */ + bool is_fictitious () const; /*! - returns a Boolean indicating whether the face is unbounded. - */ - bool is_unbounded() const; + returns a Boolean indicating whether the face is unbounded. + */ + bool is_unbounded() const; /*! - returns a Boolean indicating whether the face has an outer CCB. - (The fictitious face and the unbounded face of an arrangement that - does not have a fictitious face do not have outer CCBs.) - */ - bool has_outer_ccb() const; + returns a Boolean indicating whether the face has an outer CCB. + (The fictitious face and the unbounded face of an arrangement that + does not have a fictitious face do not have outer CCBs.) + */ + bool has_outer_ccb() const; /*! - returns a circulator that enables traversing the outer boundary of - `f`. The edges along the CCB are traversed in a counterclockwise - direction. - \pre The face `f` has an outer CCB. - */ - Ccb_halfedge_circulator outer_ccb(); + returns a circulator that enables traversing the outer boundary of + `f`. The edges along the CCB are traversed in a counterclockwise + direction. + \pre The face `f` has an outer CCB. + */ + Ccb_halfedge_circulator outer_ccb(); /*! - returns an iterator for traversing all the holes (inner CCBs) of - `f`. - */ - Hole_iterator holes_begin(); + returns an iterator for traversing all the holes (inner CCBs) of + `f`. + */ + Hole_iterator holes_begin(); /*! - returns a past-the-end iterator for the holes of `f`. - */ - Hole_iterator holes_end(); + returns a past-the-end iterator for the holes of `f`. + */ + Hole_iterator holes_end(); /*! - returns an iterator for traversing all the isolated vertices - contained in the interior of `f`. - */ - Isolated_vertex_iterator isolated_vertices_begin(); + returns an iterator for traversing all the isolated vertices + contained in the interior of `f`. + */ + Isolated_vertex_iterator isolated_vertices_begin(); /*! - returns a past-the-end iterator for the isolated vertices - contained inside `f`. - */ - Isolated_vertex_iterator isolated_vertices_end(); + returns a past-the-end iterator for the isolated vertices + contained inside `f`. + */ + Isolated_vertex_iterator isolated_vertices_end(); /// @} @@ -357,11 +357,11 @@ class Arrangement_2 { /// @} -/*! \name +/*! \name The following handles, iterators, and circulators all have respective constant counterparts (for example, in addition to `Vertex_iterator` -the type `Vertex_const_iterator` is also defined). See \cgalCite{cgal:ms-strg-96} +the type `Vertex_const_iterator` is also defined). See \cgalCite{cgal:ms-strg-96} for a discussion of constant versus mutable iterator types. The mutable types are assignable to their constant counterparts. `Vertex_iterator`, `Halfedge_iterator`, and @@ -372,215 +372,215 @@ iterators can be passed as well. All handles are model of `LessThanComparable` and `Hashable`, that is they can be used as keys in containers such as `std::map` -and `boost::unordered_map`. +and `boost::unordered_map`. */ /// @{ /*! - a handle for an arrangement vertex. - */ - typedef unspecified_type Vertex_handle; + a handle for an arrangement vertex. + */ + typedef unspecified_type Vertex_handle; /*! - a handle for a halfedge. - The halfedge and its twin form together an arrangement edge. - */ - typedef unspecified_type Halfedge_handle; + a handle for a halfedge. + The halfedge and its twin form together an arrangement edge. + */ + typedef unspecified_type Halfedge_handle; /*! - a handle for an arrangement face. - */ - typedef unspecified_type Face_handle; + a handle for an arrangement face. + */ + typedef unspecified_type Face_handle; /*! - a bidirectional iterator over the - vertices of the arrangement. Its value-type is `Vertex`. - */ - typedef unspecified_type Vertex_iterator; + a bidirectional iterator over the + vertices of the arrangement. Its value-type is `Vertex`. + */ + typedef unspecified_type Vertex_iterator; /*! - a bidirectional iterator over the - halfedges of the arrangement. Its value-type is `Halfedge`. - */ - typedef unspecified_type Halfedge_iterator; + a bidirectional iterator over the + halfedges of the arrangement. Its value-type is `Halfedge`. + */ + typedef unspecified_type Halfedge_iterator; /*! - a bidirectional iterator over the - edges of the arrangement. (That is, it skips every other halfedge.) - Its value-type is `Halfedge`. - */ - typedef unspecified_type Edge_iterator; + a bidirectional iterator over the + edges of the arrangement. (That is, it skips every other halfedge.) + Its value-type is `Halfedge`. + */ + typedef unspecified_type Edge_iterator; /*! - a bidirectional iterator over the - faces of arrangement. Its value-type is `Face`. - */ - typedef unspecified_type Face_iterator; + a bidirectional iterator over the + faces of arrangement. Its value-type is `Face`. + */ + typedef unspecified_type Face_iterator; /*! - a bidirectional iterator over the - unbounded faces of arrangement. Its value-type is `Face`. - */ - typedef unspecified_type Unbounded_face_iterator; + a bidirectional iterator over the + unbounded faces of arrangement. Its value-type is `Face`. + */ + typedef unspecified_type Unbounded_face_iterator; /*! - a bidirectional circulator - over the halfedges that have a given vertex as their target. - Its value-type is `Halfedge`. - */ - typedef unspecified_type Halfedge_around_vertex_circulator; + a bidirectional circulator + over the halfedges that have a given vertex as their target. + Its value-type is `Halfedge`. + */ + typedef unspecified_type Halfedge_around_vertex_circulator; /*! - a bidirectional circulator over the - halfedges of a CCB (connected component of the boundary). - Its value-type is `Halfedge`. Each - bounded face has a single CCB representing it outer boundary, and may - have several inner CCBs representing its holes. - */ - typedef unspecified_type Ccb_halfedge_circulator; + a bidirectional circulator over the + halfedges of a CCB (connected component of the boundary). + Its value-type is `Halfedge`. Each + bounded face has a single CCB representing it outer boundary, and may + have several inner CCBs representing its holes. + */ + typedef unspecified_type Ccb_halfedge_circulator; /*! - a bidirectional iterator over the holes - (i.e., inner CCBs) contained inside a given face. - Its value type is `Ccb_halfedge_circulator`. - */ - typedef unspecified_type Hole_iterator; + a bidirectional iterator over the holes + (i.e., inner CCBs) contained inside a given face. + Its value type is `Ccb_halfedge_circulator`. + */ + typedef unspecified_type Hole_iterator; /*! - a bidirectional iterator over the - isolated vertices contained inside a given face. - Its value type is `Vertex`. - */ - typedef unspecified_type Isolated_vertex_iterator; + a bidirectional iterator over the + isolated vertices contained inside a given face. + Its value type is `Vertex`. + */ + typedef unspecified_type Isolated_vertex_iterator; - /// @} + /// @} - /// \name Creation + /// \name Creation /// @{ /*! - constructs an empty arrangement containing one unbounded face, - which corresponds to the entire plane. - */ - Arrangement_2(); + constructs an empty arrangement containing one unbounded face, + which corresponds to the entire plane. + */ + Arrangement_2(); /*! - copy constructor. - */ - Arrangement_2(const Self& other); + copy constructor. + */ + Arrangement_2(const Self& other); /*! - constructs an empty arrangement that uses the given `traits` - instance for performing the geometric predicates. - */ - Arrangement_2(const Traits_2 *traits); + constructs an empty arrangement that uses the given `traits` + instance for performing the geometric predicates. + */ + Arrangement_2(const Traits_2 *traits); - /// @} + /// @} - /// \name Assignment Methods + /// \name Assignment Methods /// @{ /*! - assignment operator. - */ - Self& operator= (other); + assignment operator. + */ + Self& operator= (other); /*! - assigns the contents of another arrangement. - */ - void assign (const Self& other); + assigns the contents of another arrangement. + */ + void assign (const Self& other); /*! - clears the arrangement. - */ - void clear (); + clears the arrangement. + */ + void clear (); - /// @} + /// @} - /// \name Access Functions + /// \name Access Functions /// @{ /*! - returns the traits object used by the arrangement instance. - A `const` version is also available. - */ - Traits_2* get_traits(); + returns the traits object used by the arrangement instance. + A `const` version is also available. + */ + Traits_2* get_traits(); /*! - determines whether the arrangement is empty (contains only the unbounded - face, with no vertices or edges). - */ - bool is_empty() const; + determines whether the arrangement is empty (contains only the unbounded + face, with no vertices or edges). + */ + bool is_empty() const; /// @} /*! \name Accessing the Arrangement Vertices -All `_begin()` and `_end()` methods listed below also have `const` counterparts, +All `_begin()` and `_end()` methods listed below also have `const` counterparts, returning constant iterators instead of mutable ones. */ /// @{ /*! - returns the number of vertices in the arrangement. - */ - Size number_of_vertices() const; + returns the number of vertices in the arrangement. + */ + Size number_of_vertices() const; /*! - returns the total number of isolated vertices in the arrangement. - */ - Size number_of_isolated_vertices() const; + returns the total number of isolated vertices in the arrangement. + */ + Size number_of_isolated_vertices() const; /*! - returns the begin-iterator of the vertices in the arrangement. - */ - Vertex_iterator vertices_begin(); + returns the begin-iterator of the vertices in the arrangement. + */ + Vertex_iterator vertices_begin(); /*! - returns the past-the-end iterator of the vertices in the arrangement. - */ - Vertex_iterator vertices_end(); + returns the past-the-end iterator of the vertices in the arrangement. + */ + Vertex_iterator vertices_end(); /*! returns a range over handles of the arrangement vertices . */ unspecified_type vertex_handles(); /*! - returns the number of arrangement vertices that lie at infinity and - are not associated with valid points. Such vertices are not considered + returns the number of arrangement vertices that lie at infinity and + are not associated with valid points. Such vertices are not considered to be regular arrangement vertices and `arr.number_of_vertices()` - does not count them. - */ - Size number_of_vertices_at_infinity() const; + does not count them. + */ + Size number_of_vertices_at_infinity() const; /// @} /*! \name Accessing the Arrangement Halfedges -All `_begin()` and `_end()` methods listed below also have `const` counterparts, +All `_begin()` and `_end()` methods listed below also have `const` counterparts, returning constant iterators instead of mutable ones. */ /// @{ /*! - returns the number of halfedges in the arrangement. - */ - Size number_of_halfedges() const; + returns the number of halfedges in the arrangement. + */ + Size number_of_halfedges() const; /*! - returns the begin-iterator of the halfedges in the arrangement. - */ - Halfedge_iterator halfedges_begin(); + returns the begin-iterator of the halfedges in the arrangement. + */ + Halfedge_iterator halfedges_begin(); /*! - returns the past-the-end iterator of the halfedges in the arrangement. - */ - Halfedge_iterator halfedges_end(); + returns the past-the-end iterator of the halfedges in the arrangement. + */ + Halfedge_iterator halfedges_end(); /*! returns a range over handles of the arrangement halfedges . @@ -588,20 +588,20 @@ returning constant iterators instead of mutable ones. unspecified_type halfedge_handles(); /*! - returns the number of edges in the arrangement (equivalent to - `arr.number_of_halfedges() / 2`). - */ - Size number_of_edges() const; + returns the number of edges in the arrangement (equivalent to + `arr.number_of_halfedges() / 2`). + */ + Size number_of_edges() const; /*! - returns the begin-iterator of the edges in the arrangement. - */ - Edge_iterator edges_begin(); + returns the begin-iterator of the edges in the arrangement. + */ + Edge_iterator edges_begin(); /*! - returns the past-the-end iterator of the edges in the arrangement. - */ - Edge_iterator edges_end(); + returns the past-the-end iterator of the edges in the arrangement. + */ + Edge_iterator edges_end(); /*! returns a range over handles of the arrangement edges . @@ -612,33 +612,33 @@ returning constant iterators instead of mutable ones. /*! \name Accessing the Arrangement Faces -All `_begin()` and `_end()` methods listed below also have `const` counterparts, +All `_begin()` and `_end()` methods listed below also have `const` counterparts, returning constant iterators instead of mutable ones. */ /// @{ /*! - returns a handle for an unbounded face of the arrangement. - In case the arrangement comprises only bounded curves, there is a single - unbounded face and the function returns a handle to it. Otherwise, a - handle to an arbitrary unbounded face is returned. - */ - Face_handle unbounded_face(); + returns a handle for an unbounded face of the arrangement. + In case the arrangement comprises only bounded curves, there is a single + unbounded face and the function returns a handle to it. Otherwise, a + handle to an arbitrary unbounded face is returned. + */ + Face_handle unbounded_face(); /*! - returns the number of faces in the arrangement. - */ - Size number_of_faces() const; + returns the number of faces in the arrangement. + */ + Size number_of_faces() const; /*! - returns the begin-iterator of the faces in the arrangement. - */ - Face_iterator faces_begin(); + returns the begin-iterator of the faces in the arrangement. + */ + Face_iterator faces_begin(); /*! - returns the past-the-end iterator of the faces in the arrangement. - */ - Face_iterator faces_end(); + returns the past-the-end iterator of the faces in the arrangement. + */ + Face_iterator faces_end(); /*! returns a range over handles of the arrangement faces . @@ -646,34 +646,34 @@ returning constant iterators instead of mutable ones. unspecified_type face_handles(); /*! - returns the number of unbounded faces in the arrangement. + returns the number of unbounded faces in the arrangement. Note `arr.number_of_faces()` also counts the unbounded faces of the arrangement. - */ - Size number_of_unbounded_faces() const; + */ + Size number_of_unbounded_faces() const; /*! - returns the begin-iterator of the unbounded faces in the arrangement. - */ - Unbounded_face_iterator unbounded_faces_begin(); + returns the begin-iterator of the unbounded faces in the arrangement. + */ + Unbounded_face_iterator unbounded_faces_begin(); /*! - returns the past-the-end iterator of the unbounded faces in the - arrangement. - */ - Unbounded_face_iterator unbounded_faces_end(); + returns the past-the-end iterator of the unbounded faces in the + arrangement. + */ + Unbounded_face_iterator unbounded_faces_end(); /*! - returns a handle to the fictitious face of the arrangement. - If the arrangement is not unbounded, there is no fictitious - face. In this case the result is not deterministic. A const - version is also available. - */ - Face_handle fictitious_face(); + returns a handle to the fictitious face of the arrangement. + If the arrangement is not unbounded, there is no fictitious + face. In this case the result is not deterministic. A const + version is also available. + */ + Face_handle fictitious_face(); - /// @} + /// @} -/*! \name Casting Away Constness +/*! \name Casting Away Constness It is sometimes necessary to convert a constant (non-mutable) handle to a mutable handle. For example, the result of a point-location query is @@ -681,226 +681,226 @@ a non-mutable handle for the arrangement cell containing the query point. Assume that the query point lies on an edge, so we obtain a `Halfedge_const_handle`; if we wish to use this handle and remove the edge, we first need to cast away its "constness". - + */ /// @{ /*! - casts the given constant vertex handle to an equivalent mutable handle. - */ - Vertex_handle non_const_handle (Vertex_const_handle v); + casts the given constant vertex handle to an equivalent mutable handle. + */ + Vertex_handle non_const_handle (Vertex_const_handle v); /*! - casts the given constant halfedge handle to an equivalent mutable handle. - */ - Halfedge_handle non_const_handle (Halfedge_const_handle e); + casts the given constant halfedge handle to an equivalent mutable handle. + */ + Halfedge_handle non_const_handle (Halfedge_const_handle e); /*! - casts the given constant face handle to an equivalent mutable handle. - */ - Face_handle non_const_handle (Face_const_handle f); + casts the given constant face handle to an equivalent mutable handle. + */ + Face_handle non_const_handle (Face_const_handle f); - /// @} + /// @} /// \name Specialized Insertion Methods /// @{ /*! - inserts the point `p` into the arrangement as an isolated vertex in - the interior of the face `f` and returns a handle for the newly - created vertex. - \pre `p` lies in the interior of the face `f`. - */ - Vertex_handle insert_in_face_interior (const Point_2& p, - Face_handle f); - - /*! - inserts the curve `c` that is entirely contained in the interior - of a given face `f`. If `c` is a bounded curve two new vertices - that correspond to `c`'s endpoints are created and connected with a - newly created halfedge pair, which forms a new hole (inner component) - in the face `f`. If `c` is unbounded, at least one of the two - vertices that represents its end lies at infinity, and its creation - modifies the outer boundary of `f`. - The function returns a handle for one of the new halfedges - corresponding to the inserted curve, directed in lexicographic - increasing order (from left to right). - \pre `c` lies entirely in the interior of the face `f` and is disjoint from all existing arrangement vertices and edges (in particular, both its endpoints are not already associated with existing arrangement vertices). - \pre In case `c` is an unbounded curve, `f` must be an unbounded face. - */ - Halfedge_handle insert_in_face_interior - (const X_monotone_curve_2& c, - Face_handle f); - - /*! - inserts the curve `c` into the arrangement, such that its left - endpoint corresponds to a given arrangement vertex. As a result, a new - vertex that correspond to `c`'s right endpoint is created and - connected to `v` with a newly created halfedge pair. If `c` has - an unbounded right end, the new vertex lies at infinity and the - unbounded face that contains the interior of the curve is split. - The function returns a handle for one of the new halfedges corresponding - to the inserted curve, directed towards the newly created vertex - - that is, directed in lexicographic increasing order (from left to right). - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `v` is associated with the left endpoint of `c`. - \pre The right endpoint of `c` is not already associated with an existing arrangement vertex. - */ - Halfedge_handle insert_from_left_vertex - (const X_monotone_curve_2& c, - Vertex_handle v); - - /*! - inserts the curve `c` into the arrangement, such that its right - endpoint corresponds to a given arrangement vertex. As a result, a new - vertex that correspond to `c`'s left endpoint is created and - connected to `v` with a newly created halfedge pair. If `c` has - an unbounded left end, the new vertex lies at infinity and the - unbounded face that contains the interior of the curve is split. - The function returns a handle for one of the new halfedges corresponding - to the inserted curve, directed to the newly created vertex - - that is, directed in lexicographic decreasing order (from right to left). - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `v` is associated with the right endpoint of `c`. - \pre The left endpoint of `c` is not already associated with an existing arrangement vertex. - */ - Halfedge_handle insert_from_right_vertex - (const X_monotone_curve_2& c, - Vertex_handle v); - - /*! - inserts the curve `c` into the arrangement, such that both `c`'s - endpoints correspond to existing arrangement vertices, given by `v1` - and `v2`. The function creates a new halfedge pair that connects the - two vertices, and returns a handle for the halfedge directed from `v1` - to `v2`. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `c` must not be an unbounded curve. - \pre `v1` and `v2` are associated with `c`'s endpoints. - \pre If `v1` and `v2` are already connected by an edge, this edge represents an \f$ x\f$-monotone curve that is interior-disjoint from `c`). - */ - Halfedge_handle insert_at_vertices (const X_monotone_curve_2& c, - Vertex_handle v1, - Vertex_handle v2); - - /*! - inserts an unbounded curve `c` into the arrangement, such that `c` - is entirely contained within a single unbounded face of the arrangement. - `fict_pred1` specifies the fictitious halfedge that should contain the - vertex at infinity that corresponds to the unbounded end of `c`. If - both ends of `c` are unbounded, `fict_pred1` indicated the place - for its left end and `fict_pred2` indicated a place for its right end. - The function returns a handle for one of the new halfedges directed - (lexicographically) from left to right. - \pre `c` is an unbounded curve disjoint from all existing arrangement vertices and edges. - \pre `fict_pred1` (and `fict_pred2`) are fictitious halfedges that contains the unbounded end(s) of `c`. If both halfedges are given they must be both incident to the same unbounded face. - */ - Halfedge_handle insert_in_face_interior - (const X_monotone_curve_2& c, - Halfedge_handle fict_pred1, - Halfedge_handle fict_pred2 = Halfedge_handle()); - - /*! - inserts the curve `c` into the arrangement, such that its left - endpoint corresponds to a given arrangement vertex. This vertex is the - target vertex of the halfedge `pred`, such that `c` is inserted - to the circular list of halfedges around `pred->target()` right - between `pred` and its successor. The function returns a handle for - one of the new halfedges directed (lexicographically) from left to right. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `pred->target()` is associated with the left endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. - \pre The right endpoint of `c` is not already associated with an existing arrangement vertex. - */ - Halfedge_handle insert_from_left_vertex - (const X_monotone_curve_2& c, - Halfedge_handle pred); - - /*! - inserts an unbounded curve `c` into the arrangement, such that its left - endpoint is bounded and corresponds to a given arrangement vertex. This - vertex is the target vertex of the halfedge `pred`, such that `c` - is inserted to the circular list of halfedges around `pred->target()` - right between `pred` and its successor. Similarly, `fict_pred` - specifies the fictitious halfedge that should contain the vertex at infinity - that corresponds to the unbounded right end of `c`. - The function returns a handle for one of the new halfedges directed - (lexicographically) from left to right. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. `c` must have a bounded left endpoint and an unbounded right end. - \pre `pred->target()` is associated with the left endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. - \pre `fict_pred` is a fictitious halfedge that contains the unbounded right end of `c`. - */ - Halfedge_handle insert_from_left_vertex - (const X_monotone_curve_2& c, - Halfedge_handle pred, - Halfedge_handle fict_pred); - - /*! - inserts the curve `c` into the arrangement, such that its right - endpoint corresponds to a given arrangement vertex. This vertex is the - target vertex of the halfedge `pred`, such that `c` is inserted - to the circular list of halfedges around `pred->target()` right - between `pred` and its successor. The function returns a handle for - one of the new halfedges directed (lexicographically) from right to left. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `pred->target()` is associated with the right endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. - \pre The left endpoint of `c` is not already associated with an existing arrangement vertex. - */ - Halfedge_handle insert_from_right_vertex - (const X_monotone_curve_2& c, - Halfedge_handle pred); - - /*! - inserts an unbounded curve `c` into the arrangement, such that its right - endpoint is bounded and corresponds to a given arrangement vertex. This - vertex is the target vertex of the halfedge `pred`, such that `c` - is inserted to the circular list of halfedges around `pred->target()` - right between `pred` and its successor. Similarly, `fict_pred` - specifies the fictitious halfedge that should contain the vertex at infinity - that corresponds to the unbounded left end of `c`. - The function returns a handle for one of the new halfedges directed - (lexicographically) from right to left. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. `c` must have a bounded right endpoint and an unbounded left end. - \pre `pred->target()` is associated with the right endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. - \pre `fict_pred` is a fictitious halfedge that contains the unbounded left end of `c`. - */ - Halfedge_handle insert_from_right_vertex - (const X_monotone_curve_2& c, - Halfedge_handle pred, - Halfedge_handle fict_pred); - - /*! - inserts the curve `c` into the arrangement, such that both `c`'s - endpoints correspond to existing arrangement vertices, given by - `pred1->target()` and `v2`. The function creates a new halfedge - pair that connects the two vertices (where the corresponding halfedge is - inserted right between `pred1` and its successor around `pred1`'s - target vertex) and returns a handle for the halfedge directed from - `pred1->target()` to `v2`. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `pred1->target()` and `v2` are associated with `c`'s endpoints. - \pre If `pred1->target` and `v2` are already connected by an edge, this edge represents an \f$ x\f$-monotone curve that is interior-disjoint from `c`). - */ - Halfedge_handle insert_at_vertices (const X_monotone_curve_2& c, - Halfedge_handle pred1, - Vertex_handle v2); - - /*! - inserts the curve `c` into the arrangement, such that both `c`'s - endpoints correspond to existing arrangement vertices, given by - `pred1->target()` and `pred2->target()`. The function creates a - new halfedge pair that connects the two vertices (with `pred1` and - `pred2` indicate the exact place for these halfedges around the two - target vertices) and returns a handle for the halfedge directed from - `pred1->target()` to `pred2->target()`. - \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. - \pre `pred1->target()` and `pred2->target()` are associated with `c`'s endpoints. - \pre If `pred1->target` and `pred2->target()` are already connected by an edge, this edge represents an \f$ x\f$-monotone curve that is interior-disjoint from `c`). - */ - Halfedge_handle insert_at_vertices (const X_monotone_curve_2& c, - Halfedge_handle pred1, - Halfedge_handle pred2); + inserts the point `p` into the arrangement as an isolated vertex in + the interior of the face `f` and returns a handle for the newly + created vertex. + \pre `p` lies in the interior of the face `f`. + */ + Vertex_handle insert_in_face_interior (const Point_2& p, + Face_handle f); + + /*! + inserts the curve `c` that is entirely contained in the interior + of a given face `f`. If `c` is a bounded curve two new vertices + that correspond to `c`'s endpoints are created and connected with a + newly created halfedge pair, which forms a new hole (inner component) + in the face `f`. If `c` is unbounded, at least one of the two + vertices that represents its end lies at infinity, and its creation + modifies the outer boundary of `f`. + The function returns a handle for one of the new halfedges + corresponding to the inserted curve, directed in lexicographic + increasing order (from left to right). + \pre `c` lies entirely in the interior of the face `f` and is disjoint from all existing arrangement vertices and edges (in particular, both its endpoints are not already associated with existing arrangement vertices). + \pre In case `c` is an unbounded curve, `f` must be an unbounded face. + */ + Halfedge_handle insert_in_face_interior + (const X_monotone_curve_2& c, + Face_handle f); + + /*! + inserts the curve `c` into the arrangement, such that its left + endpoint corresponds to a given arrangement vertex. As a result, a new + vertex that correspond to `c`'s right endpoint is created and + connected to `v` with a newly created halfedge pair. If `c` has + an unbounded right end, the new vertex lies at infinity and the + unbounded face that contains the interior of the curve is split. + The function returns a handle for one of the new halfedges corresponding + to the inserted curve, directed towards the newly created vertex - + that is, directed in lexicographic increasing order (from left to right). + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `v` is associated with the left endpoint of `c`. + \pre The right endpoint of `c` is not already associated with an existing arrangement vertex. + */ + Halfedge_handle insert_from_left_vertex + (const X_monotone_curve_2& c, + Vertex_handle v); + + /*! + inserts the curve `c` into the arrangement, such that its right + endpoint corresponds to a given arrangement vertex. As a result, a new + vertex that correspond to `c`'s left endpoint is created and + connected to `v` with a newly created halfedge pair. If `c` has + an unbounded left end, the new vertex lies at infinity and the + unbounded face that contains the interior of the curve is split. + The function returns a handle for one of the new halfedges corresponding + to the inserted curve, directed to the newly created vertex - + that is, directed in lexicographic decreasing order (from right to left). + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `v` is associated with the right endpoint of `c`. + \pre The left endpoint of `c` is not already associated with an existing arrangement vertex. + */ + Halfedge_handle insert_from_right_vertex + (const X_monotone_curve_2& c, + Vertex_handle v); + + /*! + inserts the curve `c` into the arrangement, such that both `c`'s + endpoints correspond to existing arrangement vertices, given by `v1` + and `v2`. The function creates a new halfedge pair that connects the + two vertices, and returns a handle for the halfedge directed from `v1` + to `v2`. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `c` must not be an unbounded curve. + \pre `v1` and `v2` are associated with `c`'s endpoints. + \pre If `v1` and `v2` are already connected by an edge, this edge represents an \f$ x\f$-monotone curve that is interior-disjoint from `c`). + */ + Halfedge_handle insert_at_vertices (const X_monotone_curve_2& c, + Vertex_handle v1, + Vertex_handle v2); + + /*! + inserts an unbounded curve `c` into the arrangement, such that `c` + is entirely contained within a single unbounded face of the arrangement. + `fict_pred1` specifies the fictitious halfedge that should contain the + vertex at infinity that corresponds to the unbounded end of `c`. If + both ends of `c` are unbounded, `fict_pred1` indicated the place + for its left end and `fict_pred2` indicated a place for its right end. + The function returns a handle for one of the new halfedges directed + (lexicographically) from left to right. + \pre `c` is an unbounded curve disjoint from all existing arrangement vertices and edges. + \pre `fict_pred1` (and `fict_pred2`) are fictitious halfedges that contains the unbounded end(s) of `c`. If both halfedges are given they must be both incident to the same unbounded face. + */ + Halfedge_handle insert_in_face_interior + (const X_monotone_curve_2& c, + Halfedge_handle fict_pred1, + Halfedge_handle fict_pred2 = Halfedge_handle()); + + /*! + inserts the curve `c` into the arrangement, such that its left + endpoint corresponds to a given arrangement vertex. This vertex is the + target vertex of the halfedge `pred`, such that `c` is inserted + to the circular list of halfedges around `pred->target()` right + between `pred` and its successor. The function returns a handle for + one of the new halfedges directed (lexicographically) from left to right. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `pred->target()` is associated with the left endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. + \pre The right endpoint of `c` is not already associated with an existing arrangement vertex. + */ + Halfedge_handle insert_from_left_vertex + (const X_monotone_curve_2& c, + Halfedge_handle pred); + + /*! + inserts an unbounded curve `c` into the arrangement, such that its left + endpoint is bounded and corresponds to a given arrangement vertex. This + vertex is the target vertex of the halfedge `pred`, such that `c` + is inserted to the circular list of halfedges around `pred->target()` + right between `pred` and its successor. Similarly, `fict_pred` + specifies the fictitious halfedge that should contain the vertex at infinity + that corresponds to the unbounded right end of `c`. + The function returns a handle for one of the new halfedges directed + (lexicographically) from left to right. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. `c` must have a bounded left endpoint and an unbounded right end. + \pre `pred->target()` is associated with the left endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. + \pre `fict_pred` is a fictitious halfedge that contains the unbounded right end of `c`. + */ + Halfedge_handle insert_from_left_vertex + (const X_monotone_curve_2& c, + Halfedge_handle pred, + Halfedge_handle fict_pred); + + /*! + inserts the curve `c` into the arrangement, such that its right + endpoint corresponds to a given arrangement vertex. This vertex is the + target vertex of the halfedge `pred`, such that `c` is inserted + to the circular list of halfedges around `pred->target()` right + between `pred` and its successor. The function returns a handle for + one of the new halfedges directed (lexicographically) from right to left. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `pred->target()` is associated with the right endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. + \pre The left endpoint of `c` is not already associated with an existing arrangement vertex. + */ + Halfedge_handle insert_from_right_vertex + (const X_monotone_curve_2& c, + Halfedge_handle pred); + + /*! + inserts an unbounded curve `c` into the arrangement, such that its right + endpoint is bounded and corresponds to a given arrangement vertex. This + vertex is the target vertex of the halfedge `pred`, such that `c` + is inserted to the circular list of halfedges around `pred->target()` + right between `pred` and its successor. Similarly, `fict_pred` + specifies the fictitious halfedge that should contain the vertex at infinity + that corresponds to the unbounded left end of `c`. + The function returns a handle for one of the new halfedges directed + (lexicographically) from right to left. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. `c` must have a bounded right endpoint and an unbounded left end. + \pre `pred->target()` is associated with the right endpoint of `c`, and `c` should be inserted after `pred` in a clockwise order around this vertex. + \pre `fict_pred` is a fictitious halfedge that contains the unbounded left end of `c`. + */ + Halfedge_handle insert_from_right_vertex + (const X_monotone_curve_2& c, + Halfedge_handle pred, + Halfedge_handle fict_pred); + + /*! + inserts the curve `c` into the arrangement, such that both `c`'s + endpoints correspond to existing arrangement vertices, given by + `pred1->target()` and `v2`. The function creates a new halfedge + pair that connects the two vertices (where the corresponding halfedge is + inserted right between `pred1` and its successor around `pred1`'s + target vertex) and returns a handle for the halfedge directed from + `pred1->target()` to `v2`. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `pred1->target()` and `v2` are associated with `c`'s endpoints. + \pre If `pred1->target` and `v2` are already connected by an edge, this edge represents an \f$ x\f$-monotone curve that is interior-disjoint from `c`). + */ + Halfedge_handle insert_at_vertices (const X_monotone_curve_2& c, + Halfedge_handle pred1, + Vertex_handle v2); + + /*! + inserts the curve `c` into the arrangement, such that both `c`'s + endpoints correspond to existing arrangement vertices, given by + `pred1->target()` and `pred2->target()`. The function creates a + new halfedge pair that connects the two vertices (with `pred1` and + `pred2` indicate the exact place for these halfedges around the two + target vertices) and returns a handle for the halfedge directed from + `pred1->target()` to `pred2->target()`. + \pre The interior of `c` is disjoint from all existing arrangement vertices and edges. + \pre `pred1->target()` and `pred2->target()` are associated with `c`'s endpoints. + \pre If `pred1->target` and `pred2->target()` are already connected by an edge, this edge represents an \f$ x\f$-monotone curve that is interior-disjoint from `c`). + */ + Halfedge_handle insert_at_vertices (const X_monotone_curve_2& c, + Halfedge_handle pred1, + Halfedge_handle pred2); /// @} @@ -910,82 +910,82 @@ edge, we first need to cast away its "constness". /// @{ /*! - sets `p` to be the point associated with the vertex `v`. - The function returns a handle for the modified vertex (same as `v`). - \pre `v` is not a vertex at infinity and `p` is geometrically equivalent to the point currently associated with `v`. - */ - Vertex_handle modify_vertex (Vertex_handle v, - const Point_2& p); - - /*! - removes the isolated vertex `v` from the arrangement. The function - returns the face `f` that used to contain the isolated vertex. - \pre `v` is an isolated vertex (has no incident edges). - */ - Face_handle remove_isolated_vertex (Vertex_handle v); - - /*! - sets `c` to be the \f$ x\f$-monotone curve associated with the edge `e`. - The function returns a handle for the modified edge (same as `e`). - \pre `c` is geometrically equivalent to the curve currently associated with `e`. - */ - Halfedge_handle modify_edge (Halfedge_handle e, - const X_monotone_curve_2& c); - - /*! - splits the edge `e` into two edges (more precisely, into two halfedge - pairs), associated with the given subcurves `c1` and `c2`, and - creates a vertex that corresponds to the split point. - The function returns a handle for the halfedge, whose source is the same - as `e->source()` and whose target vertex is the split point. - \pre Either `c1`'s left endpoint and `c2`'s right endpoint correspond to `e`'s end-vertices such that `c1`'s right endpoint and `c2`'s left endpoint are equal and define the split point - or vice-versa (with change of roles between `c1` and `c2`). - */ - Halfedge_handle split_edge (Halfedge_handle e, - const X_monotone_curve_2& c1, - const X_monotone_curve_2& c2); - - /*! - merges the edges represented by `e1` and `e2` into - a single edge, associated with the given merged curve `c`. - Denote `e1`'s end-vertices as \f$ u_1\f$ and \f$ v\f$, while `e2`'s - end-vertices are denoted \f$ u_2\f$ and \f$ v\f$. The function removes the - common vertex \f$ v\f$ returns a handle for one of the merged halfedges, - directed from \f$ u_1\f$ to \f$ u_2\f$. - \pre `e1` and `e2` share a common end-vertex, such that the two other end-vertices of the two edges are associated with `c`'s endpoints. - */ - Halfedge_handle merge_edge (Halfedge_handle e1, - Halfedge_handle e2, - const X_monotone_curve_2& c); - - /*! - removes the edge `e` from the arrangement. Since the `e` may - be the only edge incident to its source vertex (or its target vertex), - this vertex can be removed as well. The flags `remove_source` and - `remove_target` indicate whether the endpoints of `e` should be - removed, or whether they should be left as isolated vertices in the - arrangement. - If the operation causes two faces to merge, the merged face is returned. - Otherwise, the face to which the edge was incident is returned. - */ - Face_handle remove_edge (Halfedge_handle e, - bool remove_source = true, - bool remove_target = true); - - /// @} - - /// \name Miscellaneous + sets `p` to be the point associated with the vertex `v`. + The function returns a handle for the modified vertex (same as `v`). + \pre `v` is not a vertex at infinity and `p` is geometrically equivalent to the point currently associated with `v`. + */ + Vertex_handle modify_vertex (Vertex_handle v, + const Point_2& p); + + /*! + removes the isolated vertex `v` from the arrangement. The function + returns the face `f` that used to contain the isolated vertex. + \pre `v` is an isolated vertex (has no incident edges). + */ + Face_handle remove_isolated_vertex (Vertex_handle v); + + /*! + sets `c` to be the \f$ x\f$-monotone curve associated with the edge `e`. + The function returns a handle for the modified edge (same as `e`). + \pre `c` is geometrically equivalent to the curve currently associated with `e`. + */ + Halfedge_handle modify_edge (Halfedge_handle e, + const X_monotone_curve_2& c); + + /*! + splits the edge `e` into two edges (more precisely, into two halfedge + pairs), associated with the given subcurves `c1` and `c2`, and + creates a vertex that corresponds to the split point. + The function returns a handle for the halfedge, whose source is the same + as `e->source()` and whose target vertex is the split point. + \pre Either `c1`'s left endpoint and `c2`'s right endpoint correspond to `e`'s end-vertices such that `c1`'s right endpoint and `c2`'s left endpoint are equal and define the split point - or vice-versa (with change of roles between `c1` and `c2`). + */ + Halfedge_handle split_edge (Halfedge_handle e, + const X_monotone_curve_2& c1, + const X_monotone_curve_2& c2); + + /*! + merges the edges represented by `e1` and `e2` into + a single edge, associated with the given merged curve `c`. + Denote `e1`'s end-vertices as \f$ u_1\f$ and \f$ v\f$, while `e2`'s + end-vertices are denoted \f$ u_2\f$ and \f$ v\f$. The function removes the + common vertex \f$ v\f$ returns a handle for one of the merged halfedges, + directed from \f$ u_1\f$ to \f$ u_2\f$. + \pre `e1` and `e2` share a common end-vertex, such that the two other end-vertices of the two edges are associated with `c`'s endpoints. + */ + Halfedge_handle merge_edge (Halfedge_handle e1, + Halfedge_handle e2, + const X_monotone_curve_2& c); + + /*! + removes the edge `e` from the arrangement. Since the `e` may + be the only edge incident to its source vertex (or its target vertex), + this vertex can be removed as well. The flags `remove_source` and + `remove_target` indicate whether the endpoints of `e` should be + removed, or whether they should be left as isolated vertices in the + arrangement. + If the operation causes two faces to merge, the merged face is returned. + Otherwise, the face to which the edge was incident is returned. + */ + Face_handle remove_edge (Halfedge_handle e, + bool remove_source = true, + bool remove_target = true); + + /// @} + + /// \name Miscellaneous /// @{ /*! - returns `true` if `arr` represents a valid instance of - `Arrangement_2`. In particular, the functions checks the topological - structure of the arrangement and assures that it is valid. In addition, - the function performs several simple geometric tests to ensure the - validity of some of the geometric properties of the arrangement. Namely, - it checks that all arrangement vertices are associated with distinct - points, and that the halfedges around every vertex are ordered clockwise. - */ - bool is_valid () const; + returns `true` if `arr` represents a valid instance of + `Arrangement_2`. In particular, the functions checks the topological + structure of the arrangement and assures that it is valid. In addition, + the function performs several simple geometric tests to ensure the + validity of some of the geometric properties of the arrangement. Namely, + it checks that all arrangement vertices are associated with distinct + points, and that the halfedges around every vertex are ordered clockwise. + */ + bool is_valid () const; /// @} @@ -1010,7 +1010,7 @@ namespace CGAL { instantiated `Traits` class must model the `ArrangementTraits_2` concept. That is, it should define the `Curve_2` type, and support its subdivision into \f$ x\f$-monotone - subcurves (and perhaps isolated points). + subcurves (and perhaps isolated points).
      • The point-location object `pl`, must model the `ArrangementPointLocation_2` concept.
      @@ -1067,82 +1067,82 @@ void insert (Arrangement_2& arr, /*! \ingroup PkgArrangementOnSurface2Funcs - Checks if a given curve or \f$ x\f$-monotone - curve intersects an existing arrangement's edges or vertices. + Checks if a given curve or \f$ x\f$-monotone + curve intersects an existing arrangement's edges or vertices. - If the give curve is not an \f$ x\f$-monotone curve then the function - subdivides the given curve into \f$ x\f$-monotone subcurves and isolated - vertices . Each subcurve is in turn checked for intersection. - The function uses the zone algorithm to check if the curve intersects - the arrangement. First, the curve's left endpoint is located. Then, - its zone is computed starting from its left endpoint location. The - zone computation terminates when an intersection with an arrangement's - edge/vertex is found or when the right endpoint is reached. + If the give curve is not an \f$ x\f$-monotone curve then the function + subdivides the given curve into \f$ x\f$-monotone subcurves and isolated + vertices . Each subcurve is in turn checked for intersection. + The function uses the zone algorithm to check if the curve intersects + the arrangement. First, the curve's left endpoint is located. Then, + its zone is computed starting from its left endpoint location. The + zone computation terminates when an intersection with an arrangement's + edge/vertex is found or when the right endpoint is reached. - A given point-location object is used for locating the left endpoint - of the given curve in the existing arrangement. By default, the function - uses the "walk along line" point-location strategy - namely an - instance of the class - `Arr_walk_along_line_point_location >`. + A given point-location object is used for locating the left endpoint + of the given curve in the existing arrangement. By default, the function + uses the "walk along line" point-location strategy - namely an + instance of the class + `Arr_walk_along_line_point_location >`. - Checks if the given curve or \f$ x\f$-monotone curve `c` intersects - edges or vertices of the existing arrangement `arr`. - \pre If provided, `pl` must be attached to the given arrangement `arr`. + Checks if the given curve or \f$ x\f$-monotone curve `c` intersects + edges or vertices of the existing arrangement `arr`. + \pre If provided, `pl` must be attached to the given arrangement `arr`. \cgalHeading{Requirements} -
        -
      • If `c` is \f$ x\f$-monotone then the instantiated `GeomTraits` - class must model the `ArrangementXMonotoneTraits_2` concept. If - `c` is a curve then the instantiated `GeomTraits` class must - model the `ArrangementTraits_2` concept. That is, it should - define the `Curve_2` type, and support its subdivision into - \f$ x\f$-monotone subcurves (and perhaps isolated points). -
      • The point-location object `pl`, must model the - `ArrangementPointLocation_2` concept. -
      +
        +
      • If `c` is \f$ x\f$-monotone then the instantiated `GeomTraits` + class must model the `ArrangementXMonotoneTraits_2` concept. If + `c` is a curve then the instantiated `GeomTraits` class must + model the `ArrangementTraits_2` concept. That is, it should + define the `Curve_2` type, and support its subdivision into + \f$ x\f$-monotone subcurves (and perhaps isolated points). +
      • The point-location object `pl`, must model the + `ArrangementPointLocation_2` concept. +
      */ -template bool do_intersect ( - Arrangement_on_surface_2& arr, + Arrangement_on_surface_2& arr, const Curve& c, const PointLocation& pl); /*! \ingroup PkgArrangementOnSurface2Funcs - Inserts a given \f$ x\f$-monotone curve into a given - arrangement, where the interior of the given curve is disjoint from all - existing arrangement vertices and edges. Under this assumption, it is - possible to locate the endpoints of the given curve in the arrangement, - and use one of the specialized insertion member-functions of the - arrangement according to the results. The insertion operations creates a - single new edge, that is, two twin halfedges, and the function returns a - handle for the one directed lexicographically in increasing order (from - left to right). + Inserts a given \f$ x\f$-monotone curve into a given + arrangement, where the interior of the given curve is disjoint from all + existing arrangement vertices and edges. Under this assumption, it is + possible to locate the endpoints of the given curve in the arrangement, + and use one of the specialized insertion member-functions of the + arrangement according to the results. The insertion operations creates a + single new edge, that is, two twin halfedges, and the function returns a + handle for the one directed lexicographically in increasing order (from + left to right). - A given point-location object is used for answering the two point-location - queries on the given curve endpoints. By default, the function uses the - "walk along line" point-location strategy - namely, an instance of the - class `Arr_walk_along_line_point_location >`. + A given point-location object is used for answering the two point-location + queries on the given curve endpoints. By default, the function uses the + "walk along line" point-location strategy - namely, an instance of the + class `Arr_walk_along_line_point_location >`. - \pre If provided, `pl` must be attached to the given arrangement `arr`. + \pre If provided, `pl` must be attached to the given arrangement `arr`. \cgalHeading{Requirements} -
        -
      • The instantiated `Traits` class must model the restricted - `ArrangementBasicTraits_2` concept, as no intersections are computed. -
      • The point-location object `pl` must model the - `ArrangementPointLocation_2` concept. -
      +
        +
      • The instantiated `Traits` class must model the restricted + `ArrangementBasicTraits_2` concept, as no intersections are computed. +
      • The point-location object `pl` must model the + `ArrangementPointLocation_2` concept. +
      */ template -typename Arrangement_2::Halfedge_handle +typename Arrangement_2::Halfedge_handle insert_non_intersecting_curve (Arrangement_2& arr, const typename Traits::X_monotone_curve_2& xc, const PointLocation& pl = walk_pl); @@ -1151,19 +1151,19 @@ insert_non_intersecting_curve (Arrangement_2& arr, /*! \ingroup PkgArrangementOnSurface2Funcs - Inserts a set of \f$ x\f$-monotone curves in a given - range into a given arrangement. The insertion is performed in an aggregated - manner, using the sweep-line algorithm. The input curves should be pairwise - disjoint in their interior and pairwise interior-disjoint from all existing - arrangement vertices and edges. + Inserts a set of \f$ x\f$-monotone curves in a given + range into a given arrangement. The insertion is performed in an aggregated + manner, using the sweep-line algorithm. The input curves should be pairwise + disjoint in their interior and pairwise interior-disjoint from all existing + arrangement vertices and edges. \cgalHeading{Requirements} -
        -
      • The instantiated `Traits` class must model the - `ArrangementBasicTraits_2` concept, as no intersections are computed. -
      • `InputIterator::value_type` must be `Traits::X_monotone_curve_2` -
      +
        +
      • The instantiated `Traits` class must model the + `ArrangementBasicTraits_2` concept, as no intersections are computed. +
      • `InputIterator::value_type` must be `Traits::X_monotone_curve_2` +
      */ template @@ -1174,31 +1174,31 @@ void insert_non_intersecting_curves(Arrangement_2& arr, /*! \ingroup PkgArrangementOnSurface2Funcs - Inserts a given point into a given arrangement. - It uses a given point-location object to locate the given - point in the given arrangement. If the point conincides with an existing - vertex, there is nothing left to do; if it lies on an edge, the edge is - split at the point. Otherwise, the point is contained inside a face, and is - inserted as an isolated vertex inside this face. - By default, the function uses the "walk along line" point-location - strategy - namely, an instance of the class - `Arr_walk_along_line_point_location >`. - In either case, the function returns a handle for the vertex associated - with the point. + Inserts a given point into a given arrangement. + It uses a given point-location object to locate the given + point in the given arrangement. If the point conincides with an existing + vertex, there is nothing left to do; if it lies on an edge, the edge is + split at the point. Otherwise, the point is contained inside a face, and is + inserted as an isolated vertex inside this face. + By default, the function uses the "walk along line" point-location + strategy - namely, an instance of the class + `Arr_walk_along_line_point_location >`. + In either case, the function returns a handle for the vertex associated + with the point. - \pre If provided, `pl` must be attached to the given arrangement `arr`. + \pre If provided, `pl` must be attached to the given arrangement `arr`. \cgalHeading{Requirements} -
        -
      • The instantiated `Traits` class must model the - `ArrangementXMonotoneTraits_2` concept. Not all expressions listed - by this concept are required. In fact the traits class must model the - `ArrangementBasicTraits_2` concept, and support the splitting - functionality. -
      • The point-location object `pl`, must model the - `ArrangementPointLocation_2` concept. -
      +
        +
      • The instantiated `Traits` class must model the + `ArrangementXMonotoneTraits_2` concept. Not all expressions listed + by this concept are required. In fact the traits class must model the + `ArrangementBasicTraits_2` concept, and support the splitting + functionality. +
      • The point-location object `pl`, must model the + `ArrangementPointLocation_2` concept. +
      */ template& arr, /*! \ingroup PkgArrangementOnSurface2Funcs - Checks the validity of a given arrangement. + Checks the validity of a given arrangement. - Invokes the member function `arr.is_valid()` to verify the - topological correctness of the arrangement. Then it performs additional - validity tests. It checks that all \f$ x\f$-monotone curves associated with - arrangement edges are pairwise disjoint in their interior. Then it makes - sure that all holes and all isolated vertices are located within the - proper arrangement faces. Note that the test carried out by this - function may take a considerable amount of time; it is recommended to be - used only for debugging purposes. + Invokes the member function `arr.is_valid()` to verify the + topological correctness of the arrangement. Then it performs additional + validity tests. It checks that all \f$ x\f$-monotone curves associated with + arrangement edges are pairwise disjoint in their interior. Then it makes + sure that all holes and all isolated vertices are located within the + proper arrangement faces. Note that the test carried out by this + function may take a considerable amount of time; it is recommended to be + used only for debugging purposes. \cgalHeading{Requirements} - The instantiated traits class must model the concept - `ArranagmentXMonotoneTraits_2`. + The instantiated traits class must model the concept + `ArranagmentXMonotoneTraits_2`. */ template @@ -1236,27 +1236,27 @@ bool is_valid (const Arrangement_2& arr); /*! \ingroup PkgArrangementOnSurface2Funcs - Removes an edge given by one of the twin halfedges - that forms it, from a given arrangement. Once the edge is removed, if the - vertices associated with its endpoints become isolated, they are removed as - well. The call `remove_edge(arr, e)` is equivalent to the call - `arr.remove_edge (e, true, true)`. However, this free function requires - that `Traits` be a model of the refined concept - `ArrangementXMonotoneTraits_2`, which requires merge operations - on \f$ x\f$-monotone curves. If one of the end-vertices of the given edge - becomes redundant after the edge is removed (see `remove_vertex()` - for the definition of a redundant vertex), it is removed, and its - incident edges are merged. - If the edge-removal operation causes two faces to merge, the merged face - is returned. Otherwise, the face to which the edge was incident before the - removal is returned. + Removes an edge given by one of the twin halfedges + that forms it, from a given arrangement. Once the edge is removed, if the + vertices associated with its endpoints become isolated, they are removed as + well. The call `remove_edge(arr, e)` is equivalent to the call + `arr.remove_edge (e, true, true)`. However, this free function requires + that `Traits` be a model of the refined concept + `ArrangementXMonotoneTraits_2`, which requires merge operations + on \f$ x\f$-monotone curves. If one of the end-vertices of the given edge + becomes redundant after the edge is removed (see `remove_vertex()` + for the definition of a redundant vertex), it is removed, and its + incident edges are merged. + If the edge-removal operation causes two faces to merge, the merged face + is returned. Otherwise, the face to which the edge was incident before the + removal is returned. \cgalHeading{Requirements} -
        -
      • The instantiated traits class must model the concept - `ArrangementXMonotoneTraits_2`. -
      +
        +
      • The instantiated traits class must model the concept + `ArrangementXMonotoneTraits_2`. +
      */ template @@ -1268,23 +1268,23 @@ remove_edge (Arrangement_2& arr, /*! \ingroup PkgArrangementOnSurface2Funcs - Attempts to removed a given vertex from a given - arrangement. The vertex can be removed if it is either an isolated vertex, - (and has no incident edge,) or if it is a redundant vertex. That - is, it has exactly two incident edges, whose associated curves can be - merged to form a single \f$ x\f$-monotone curve. - The function returns a boolean value that indicates whether it succeeded - removing the vertex from the arrangement. + Attempts to removed a given vertex from a given + arrangement. The vertex can be removed if it is either an isolated vertex, + (and has no incident edge,) or if it is a redundant vertex. That + is, it has exactly two incident edges, whose associated curves can be + merged to form a single \f$ x\f$-monotone curve. + The function returns a boolean value that indicates whether it succeeded + removing the vertex from the arrangement. \cgalHeading{Requirements} -
        -
      • The instantiated `Traits` class must model the - `ArrangementXMonotoneTraits_2` concept. Not all expressions listed - by this concept are required. In fact the traits class must model the - `ArrangementBasicTraits_2` concept and support the merging - functionality. -
      +
        +
      • The instantiated `Traits` class must model the + `ArrangementXMonotoneTraits_2` concept. Not all expressions listed + by this concept are required. In fact the traits class must model the + `ArrangementBasicTraits_2` concept and support the merging + functionality. +
      */ template bool remove_vertex (Arrangement_2& arr, @@ -1293,35 +1293,35 @@ bool remove_vertex (Arrangement_2& arr, /*! \ingroup PkgArrangementOnSurface2Funcs - Compute the zone of the given \f$ x\f$-monotone - curve in the existing arrangement. Meaning, it output the - arrangement's vertices, edges and faces that the \f$ x\f$-monotone curve - intersects. The order of the objects is the order that they are - discovered when traversing the \f$ x\f$-monotone curve from left to right. + Compute the zone of the given \f$ x\f$-monotone + curve in the existing arrangement. Meaning, it output the + arrangement's vertices, edges and faces that the \f$ x\f$-monotone curve + intersects. The order of the objects is the order that they are + discovered when traversing the \f$ x\f$-monotone curve from left to right. - A given point-location object is used for answering point-location queries - during the insertion process. By default, the function uses the - "walk along line" point-location strategy - namely an instance of the - class `Arr_walk_along_line_point_location >`. + A given point-location object is used for answering point-location queries + during the insertion process. By default, the function uses the + "walk along line" point-location strategy - namely an instance of the + class `Arr_walk_along_line_point_location >`. - Compute the zone of the given \f$ x\f$-monotone curve `c` in the - arrangement `arr`. - \pre If provided, `pl` must be attached to the given arrangement `arr`. + Compute the zone of the given \f$ x\f$-monotone curve `c` in the + arrangement `arr`. + \pre If provided, `pl` must be attached to the given arrangement `arr`. \cgalHeading{Requirements} -
        -
      • The instantiated `GeomTraits` class must model the - `ArrangementXMonotoneTraits_2` concept. -
      • The point-location object `pl`, must model the - `ArrangementPointLocation_2` concept. -
      +
        +
      • The instantiated `GeomTraits` class must model the + `ArrangementXMonotoneTraits_2` concept. +
      • The point-location object `pl`, must model the + `ArrangementPointLocation_2` concept. +
      */ -template OutputIterator zone ( - Arrangement_on_surface_2& arr, + Arrangement_on_surface_2& arr, const typename GeomTraits::X_monotone_curve_2& c, OutputIterator oi, const PointLocation& pl); diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h index 7c05c5c9ddc7..46ca16249c6f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h @@ -4,86 +4,86 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Ref -\anchor arr_refarr_with_hist - -An object `arr` of the class `Arrangement_with_history_2` represents the -planar subdivision induced by a set of input curves \f$ \cal C\f$. -The arrangement is represented as a doubly-connected edge-list (Dcel). -As is the case for the `Arrangement_2`, each Dcel -vertex is associated with a point and each edge is associated with an -\f$ x\f$-monotone curve whose interior is disjoint from all other edges and -vertices. Each such \f$ x\f$-monotone curve is a subcurve of some -\f$ C \in \cal C\f$ - or may represent an overlap among several curves -in \f$ \cal C\f$. - -The `Arrangement_with_history_2` class-template extends the `Arrangement_2` -class-template by keeping an additional container of input curves -representing \f$ \cal C\f$, and by maintaining a cross-mapping between these -curves and the arrangement edges they induce. This way it is possible -to determine the inducing curve(s) of each arrangement edge. This mapping -also allows the traversal of input curves, and the traversal of edges -induced by each curve. - -The `Arrangement_with_history_2` template has two parameters: -
        -
      • The `Traits` template-parameter should be instantiated with -a model of the `ArrangementTraits_2` concept. The traits -class defines the `Curve_2` type, which represents an input curve. -It also defines the types of \f$ x\f$-monotone curves and two-dimensional -points, namely `ArrangementTraits_2::X_monotone_curve_2` and `ArrangementTraits_2::Point_2`, -respectively, and supports basic geometric predicates on them. -
      • The `Dcel` template-parameter should be instantiated with -a class that is a model of the `ArrangementDcelWithRebind` concept. The -value of this parameter is by default -`Arr_default_dcel`. -
      - -\sa `ArrangementDcel` -\sa `Arr_default_dcel` -\sa `ArrangementTraits_2` -\sa `Arrangement_2` -\sa `insertion functions` -\sa `removal functions` -\sa `overlaying arrangements` +\anchor arr_refarr_with_hist + +An object `arr` of the class `Arrangement_with_history_2` represents the +planar subdivision induced by a set of input curves \f$ \cal C\f$. +The arrangement is represented as a doubly-connected edge-list (Dcel). +As is the case for the `Arrangement_2`, each Dcel +vertex is associated with a point and each edge is associated with an +\f$ x\f$-monotone curve whose interior is disjoint from all other edges and +vertices. Each such \f$ x\f$-monotone curve is a subcurve of some +\f$ C \in \cal C\f$ - or may represent an overlap among several curves +in \f$ \cal C\f$. + +The `Arrangement_with_history_2` class-template extends the `Arrangement_2` +class-template by keeping an additional container of input curves +representing \f$ \cal C\f$, and by maintaining a cross-mapping between these +curves and the arrangement edges they induce. This way it is possible +to determine the inducing curve(s) of each arrangement edge. This mapping +also allows the traversal of input curves, and the traversal of edges +induced by each curve. + +The `Arrangement_with_history_2` template has two parameters: +
        +
      • The `Traits` template-parameter should be instantiated with +a model of the `ArrangementTraits_2` concept. The traits +class defines the `Curve_2` type, which represents an input curve. +It also defines the types of \f$ x\f$-monotone curves and two-dimensional +points, namely `ArrangementTraits_2::X_monotone_curve_2` and `ArrangementTraits_2::Point_2`, +respectively, and supports basic geometric predicates on them. +
      • The `Dcel` template-parameter should be instantiated with +a class that is a model of the `ArrangementDcelWithRebind` concept. The +value of this parameter is by default +`Arr_default_dcel`. +
      + +\sa `ArrangementDcel` +\sa `Arr_default_dcel` +\sa `ArrangementTraits_2` +\sa `Arrangement_2` +\sa `insertion functions` +\sa `removal functions` +\sa `overlaying arrangements` */ template< typename Traits, typename Dcel > class Arrangement_with_history_2 : public Arrangement_2 { public: -/// \name Types +/// \name Types /// @{ /*! -a private type used as an abbreviation of the `Arrangement_with_history_2` type hereafter. -*/ -typedef Arrangement_with_history_2 Self; +a private type used as an abbreviation of the `Arrangement_with_history_2` type hereafter. +*/ +typedef Arrangement_with_history_2 Self; /*! -the traits class in use. -*/ -typedef unspecified_type Traits_2; +the traits class in use. +*/ +typedef unspecified_type Traits_2; /*! -the Dcel representation of the arrangement. -*/ -typedef unspecified_type Dcel; +the Dcel representation of the arrangement. +*/ +typedef unspecified_type Dcel; /*! -the point type, as defined by the traits class. -*/ -typedef typename Traits_2::Point_2 Point_2; +the point type, as defined by the traits class. +*/ +typedef typename Traits_2::Point_2 Point_2; /*! -the \f$ x\f$-monotone curve type, as defined by the traits class. -*/ -typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; +the \f$ x\f$-monotone curve type, as defined by the traits class. +*/ +typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; /*! -the curve type, as defined by the traits class. -*/ -typedef typename Traits_2::Curve_2 Curve_2; +the curve type, as defined by the traits class. +*/ +typedef typename Traits_2::Curve_2 Curve_2; /// @} @@ -97,73 +97,73 @@ In addition, the nested types `Vertex`, `Halfedge` and `Face` are defined, as we /*! -a handle for an input curve. -*/ -typedef unspecified_type Curve_handle; +a handle for an input curve. +*/ +typedef unspecified_type Curve_handle; /*! -a bidirectional iterator over the -curves that induce the arrangement. Its value-type is -`Curve_2`. -*/ -typedef unspecified_type Curve_iterator; +a bidirectional iterator over the +curves that induce the arrangement. Its value-type is +`Curve_2`. +*/ +typedef unspecified_type Curve_iterator; /*! -an iterator over the edges induced by an input curve. -Its value type is `Halfedge_handle`. -*/ -typedef unspecified_type Induced_edge_iterator; +an iterator over the edges induced by an input curve. +Its value type is `Halfedge_handle`. +*/ +typedef unspecified_type Induced_edge_iterator; /*! -an iterator for the curves that originate a given arrangement edge. -Its value type is `Curve_handle`. -*/ -typedef unspecified_type Originating_curve_iterator; +an iterator for the curves that originate a given arrangement edge. +Its value type is `Curve_handle`. +*/ +typedef unspecified_type Originating_curve_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -constructs an empty arrangement containing one unbounded face, -which corresponds to the -whole plane. -*/ -Arrangement_with_history_2(); +constructs an empty arrangement containing one unbounded face, +which corresponds to the +whole plane. +*/ +Arrangement_with_history_2(); /*! -copy constructor. -*/ -Arrangement_with_history_2(const Self& other); +copy constructor. +*/ +Arrangement_with_history_2(const Self& other); /*! -constructs an empty arrangement that uses the given `traits` -instance for performing the geometric predicates. -*/ -Arrangement_with_history_2(Traits_2 *traits); +constructs an empty arrangement that uses the given `traits` +instance for performing the geometric predicates. +*/ +Arrangement_with_history_2(Traits_2 *traits); -/// @} +/// @} -/// \name Assignment Methods +/// \name Assignment Methods /// @{ /*! -assignment operator. -*/ -Self& operator= (other); +assignment operator. +*/ +Self& operator= (other); /*! -assigns the contents of another arrangement. -*/ -void assign (const Self& other); +assigns the contents of another arrangement. +*/ +void assign (const Self& other); /*! -clears the arrangement. -*/ -void clear (); +clears the arrangement. +*/ +void clear (); -/// @} +/// @} /*! \name Access Functions for Input Curves @@ -173,58 +173,58 @@ See the `Arrangement_2` reference pages for the full list. /// @{ /*! -returns the number of input curves that induce the arrangement. -*/ -Size number_of_curves() const; +returns the number of input curves that induce the arrangement. +*/ +Size number_of_curves() const; /*! -returns the begin-iterator of the curves inducing the arrangement. -*/ -Curve_iterator curves_begin(); +returns the begin-iterator of the curves inducing the arrangement. +*/ +Curve_iterator curves_begin(); /*! -returns the past-the-end iterator of the curves inducing the arrangement. -*/ -Curve_iterator curves_end(); +returns the past-the-end iterator of the curves inducing the arrangement. +*/ +Curve_iterator curves_end(); /*! -returns the number of arrangement edges induced by the curve `ch`. -*/ -Size number_of_induced_edges (Curve_handle ch) const; +returns the number of arrangement edges induced by the curve `ch`. +*/ +Size number_of_induced_edges (Curve_handle ch) const; /*! -returns the begin-iterator of the edges induced by the curve `ch`. -*/ -Induced_edge_iterator -induced_edges_begin (Curve_handle ch) const; +returns the begin-iterator of the edges induced by the curve `ch`. +*/ +Induced_edge_iterator +induced_edges_begin (Curve_handle ch) const; /*! -returns the past-the-end iterator of the edges induced by the curve `ch`. -*/ -Induced_edge_iterator -induced_edges_end (Curve_handle ch) const; +returns the past-the-end iterator of the edges induced by the curve `ch`. +*/ +Induced_edge_iterator +induced_edges_end (Curve_handle ch) const; /*! -returns the number of input curves that originate the edge `e`. -*/ -Size number_of_originating_curves (Halfedge_handle e) const; +returns the number of input curves that originate the edge `e`. +*/ +Size number_of_originating_curves (Halfedge_handle e) const; /*! -returns the begin-iterator of the curves originating the edge `e`. -*/ -Originating_curve_iterator -originating_curves_begin (Halfedge_handle e) const; +returns the begin-iterator of the curves originating the edge `e`. +*/ +Originating_curve_iterator +originating_curves_begin (Halfedge_handle e) const; /*! -returns the past-the-end iterator of the curves originating the edge -`e`. -*/ -Originating_curve_iterator -originating_curves_end (Halfedge_handle e) const; +returns the past-the-end iterator of the curves originating the edge +`e`. +*/ +Originating_curve_iterator +originating_curves_end (Halfedge_handle e) const; -/// @} +/// @} -/*! \name Modifying Arrangement Edges +/*! \name Modifying Arrangement Edges The following functions override their counterparts in the `Arrangement_2` class, as they also maintain the cross-relationships @@ -237,37 +237,37 @@ for modifying arrangement vertices /// @{ /*! -splits the edge `e` into two edges (more precisely, into two halfedge -pairs), at a given split point `p`. -The function returns a handle for the halfedge whose source is the same -as `e->source()` and whose target vertex is the split point. -\pre `p` lies in the interior of the curve associated with `e`. -*/ -Halfedge_handle split_edge (Halfedge_handle e, -const Point_2& p); - -/*! -merges the edges represented by `e1` and `e2` into -a single edge. -The function returns a handle for one of the merged halfedges. -\pre `e1` and `e2` share a common end-vertex, of degree \f$ 2\f$, and the \f$ x\f$-monotone curves associated with `e1` and `e2` are mergeable into a single \f$ x\f$-monotone curves. -*/ -Halfedge_handle merge_edge (Halfedge_handle e1, -Halfedge_handle e2); - -/*! -removes the edge `e` from the arrangement. Since the `e` may -be the only edge incident to its source vertex (or its target vertex), -this vertex can be removed as well. The flags `remove_source` and -`remove_target` indicate whether the endpoints of `e` should be -removed, or whether they should be left as isolated vertices in the -arrangement. -If the operation causes two faces to merge, the merged face is returned. -Otherwise, the face to which the edge was incident is returned. -*/ -Face_handle remove_edge(Halfedge_handle e, -bool remove_source = true, -bool remove_target = true); +splits the edge `e` into two edges (more precisely, into two halfedge +pairs), at a given split point `p`. +The function returns a handle for the halfedge whose source is the same +as `e->source()` and whose target vertex is the split point. +\pre `p` lies in the interior of the curve associated with `e`. +*/ +Halfedge_handle split_edge (Halfedge_handle e, +const Point_2& p); + +/*! +merges the edges represented by `e1` and `e2` into +a single edge. +The function returns a handle for one of the merged halfedges. +\pre `e1` and `e2` share a common end-vertex, of degree \f$ 2\f$, and the \f$ x\f$-monotone curves associated with `e1` and `e2` are mergeable into a single \f$ x\f$-monotone curves. +*/ +Halfedge_handle merge_edge (Halfedge_handle e1, +Halfedge_handle e2); + +/*! +removes the edge `e` from the arrangement. Since the `e` may +be the only edge incident to its source vertex (or its target vertex), +this vertex can be removed as well. The flags `remove_source` and +`remove_target` indicate whether the endpoints of `e` should be +removed, or whether they should be left as isolated vertices in the +arrangement. +If the operation causes two faces to merge, the merged face is returned. +Otherwise, the face to which the edge was incident is returned. +*/ +Face_handle remove_edge(Halfedge_handle e, +bool remove_source = true, +bool remove_target = true); /// @} @@ -310,11 +310,11 @@ void insert(Arrangement_with_history_2& arr, /*! \ingroup PkgArrangementOnSurface2Funcs -Removes a given curve from a given arrangement. +Removes a given curve from a given arrangement. -The curve is specified by its handle `ch`, from -the arrangement `arr`, by deleting all the edges it induces. The -function returns the number of deleted edges. +The curve is specified by its handle `ch`, from +the arrangement `arr`, by deleting all the edges it induces. The +function returns the number of deleted edges. */ template diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h index 413b1cd5c3f6..bcdfd59968de 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h @@ -18,7 +18,7 @@ using a specific input format. \sa `PkgArrangementOnSurface2Write` - + \sa `PkgArrangementOnSurface2op_left_shift` \sa `PkgArrangementOnSurface2op_right_shift` */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h index 1ac867b5ce25..aa00f86e82d6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h @@ -4,26 +4,26 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2IO -`Arr_extended_dcel_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an `Arrangement` -instance using a simple text format. The `Arrangement` class should be -instantiated with a Dcel class which in turn instantiates the -`Arr_extended_dcel` template with the `VertexData`, `HalfedgeData` and -`FaceData` types. -The formatter supports reading and writing the data objects attached to the -arrangement vertices, halfedges and faces. - -The `Arr_extended_dcel_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types -defined by the `Arrangement` template-parameter, as well as the `VertexData`, -`HalfedgeData` and `FaceData` types, can all be written to an input stream using -the `<<` operator and read from an input stream using the `>>` operator. +`Arr_extended_dcel_text_formatter` defines the format of an arrangement in an input or output stream +(typically a file stream), thus enabling reading and writing an `Arrangement` +instance using a simple text format. The `Arrangement` class should be +instantiated with a Dcel class which in turn instantiates the +`Arr_extended_dcel` template with the `VertexData`, `HalfedgeData` and +`FaceData` types. +The formatter supports reading and writing the data objects attached to the +arrangement vertices, halfedges and faces. + +The `Arr_extended_dcel_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types +defined by the `Arrangement` template-parameter, as well as the `VertexData`, +`HalfedgeData` and `FaceData` types, can all be written to an input stream using +the `<<` operator and read from an input stream using the `>>` operator. \cgalModels `ArrangementInputFormatter` \cgalModels `ArrangementOutputFormatter` -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` -\sa `Arr_extended_dcel` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` +\sa `Arr_extended_dcel` */ template< typename Arrangement > @@ -38,24 +38,24 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2IO -`Arr_face_extended_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an `Arrangement` -instance using a simple text format. The `Arrangement` class should be -instantiated with a Dcel class which in turn instantiates the -`Arr_face_extended_dcel` template with a `FaceData` type. -The formatter supports reading and writing the data objects attached to the -arrangement faces as well. +`Arr_face_extended_text_formatter` defines the format of an arrangement in an input or output stream +(typically a file stream), thus enabling reading and writing an `Arrangement` +instance using a simple text format. The `Arrangement` class should be +instantiated with a Dcel class which in turn instantiates the +`Arr_face_extended_dcel` template with a `FaceData` type. +The formatter supports reading and writing the data objects attached to the +arrangement faces as well. -The `Arr_face_extended_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types -defined by the `Arrangement` template-parameter and that the `FaceData` type -can all be written to an input stream using the `<<` operator and read from an input stream using the `>>` operator. +The `Arr_face_extended_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types +defined by the `Arrangement` template-parameter and that the `FaceData` type +can all be written to an input stream using the `<<` operator and read from an input stream using the `>>` operator. \cgalModels `ArrangementInputFormatter` \cgalModels `ArrangementOutputFormatter` -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` -\sa `Arr_face_extended_dcel` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` +\sa `Arr_face_extended_dcel` */ template< typename Arrangement > @@ -70,22 +70,22 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2IO -`Arr_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an `Arrangement` -instance using a simple text format. The arrangement is assumed to store no auxiliary -data with its Dcel records (and if there are such records they will not be written -or read by the formatter). +`Arr_text_formatter` defines the format of an arrangement in an input or output stream +(typically a file stream), thus enabling reading and writing an `Arrangement` +instance using a simple text format. The arrangement is assumed to store no auxiliary +data with its Dcel records (and if there are such records they will not be written +or read by the formatter). -The `Arr_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types -defined by the `Arrangement` template-parameter can both be written to an input -stream using the `<<` operator and read from an input stream using the `>>` -operator. +The `Arr_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types +defined by the `Arrangement` template-parameter can both be written to an input +stream using the `<<` operator and read from an input stream using the `>>` +operator. \cgalModels `ArrangementInputFormatter` \cgalModels `ArrangementOutputFormatter` -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` */ template< typename Arrangement > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h index 4f6deac2550f..47caa509bcc8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Read -Reads the arrangement-with-history object `arr` from the given +Reads the arrangement-with-history object `arr` from the given input stream `is` using a specific input format defined by \"formatter\". @@ -25,7 +25,7 @@ template& arr, std::ostream& os, WithHistoryFormatter& formatter); - + /*! \ingroup PkgArrangementOnSurface2op_left_shift Inserts the arrangement-with-history object `arr` into the output diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h index 2e0043870492..9c02ec33400c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h @@ -4,22 +4,22 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2IO -`Arr_with_history_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an -arrangement-with-history instance using a simple text format. +`Arr_with_history_text_formatter` defines the format of an arrangement in an input or output stream +(typically a file stream), thus enabling reading and writing an +arrangement-with-history instance using a simple text format. -The `ArrFormatter` parameter servers as a base class for -`Arr_with_history_text_formatter` and must be a model of the `ArrangementInputFormatter` -and the `ArrangementOutputFormatter` concepts. It is used to read or write -the base arrangement, while the derived class is responsible for reading and -writing the set of curves inducing the arrangement and maintaining the -relations between these curves and the edges they induce. +The `ArrFormatter` parameter servers as a base class for +`Arr_with_history_text_formatter` and must be a model of the `ArrangementInputFormatter` +and the `ArrangementOutputFormatter` concepts. It is used to read or write +the base arrangement, while the derived class is responsible for reading and +writing the set of curves inducing the arrangement and maintaining the +relations between these curves and the edges they induce. \cgalModels `ArrangementWithHistoryInputFormatter` \cgalModels `ArrangementWithHistoryOutputFormatter` -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` */ template< typename ArrFormatter > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h index febcd691b527..2446aeeeab80 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementLandmarkTraits_2::Approximate_2 +\cgalHasModel ArrangementLandmarkTraits_2::Approximate_2 */ @@ -17,11 +17,11 @@ class Approximate_2 { /// @{ /*! -returns an approximation of `p`'s \f$ x\f$-coordinate (if `i == 0`), -or of `p`'s \f$ y\f$-coordinate (if `i == 1`). -*/ -Approximate_number_type operator()( ArrTraits::Point_2 p, -int i); +returns an approximation of `p`'s \f$ x\f$-coordinate (if `i == 0`), +or of `p`'s \f$ y\f$-coordinate (if `i == 1`). +*/ +Approximate_number_type operator()( ArrTraits::Point_2 p, +int i); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h index 4cc4209c9ee7..54ffee04bd67 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementXMonotoneTraits_2::Are_mergeable_2 +\cgalHasModel ArrangementXMonotoneTraits_2::Are_mergeable_2 */ @@ -17,14 +17,14 @@ class AreMergeable_2 { /// @{ /*! -accepts two \f$ x\f$-monotone curves `xc1` and `xc2` and determines -whether they can be merged to form a single \f$ x\f$-monotone curve. -`xc1` and `xc2` are mergeable if their underlying curves are -identical, they share a common endpoint, and they do not bend to form -a non-\f$ x\f$-monotone curve. -*/ -bool operator()(ArrTraits::X_monotone_curve_2 xc1, -ArrTraits::X_monotone_curve_2 xc2); +accepts two \f$ x\f$-monotone curves `xc1` and `xc2` and determines +whether they can be merged to form a single \f$ x\f$-monotone curve. +`xc1` and `xc2` are mergeable if their underlying curves are +identical, they share a common endpoint, and they do not bend to form +a non-\f$ x\f$-monotone curve. +*/ +bool operator()(ArrTraits::X_monotone_curve_2 xc1, +ArrTraits::X_monotone_curve_2 xc2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h index f0ee218e830a..140dff0dd150 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableFunctor +\cgalRefines AdaptableFunctor -\cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_x_at_limit_2 +\cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_x_at_limit_2 */ @@ -17,50 +17,50 @@ class CompareXAtLimit_2 { /// @{ /*! -Given a point `p`, an \f$ x\f$-monotone curve `xcv`, and an -enumeration `ce` that specifies either the minimum or the -maximum end of the curve where the curve has a vertical asymptote, -compares the \f$ x\f$-coordinate of `p` and the \f$ x\f$-coordinate of the -limit of the curve at its specificed end. The variable `xcv` -identifies the parametric curve \f$ C(t) = (X(t),Y(t))\f$ defined over an -open or half-open interval with endpoints \f$ 0\f$ and \f$ 1\f$. The -enumeration `ce` identifies an open end \f$ d \in\{0,1\}\f$ of \f$ C\f$. -Formally, compares the \f$ x\f$-coordinate of `p` and -\f$ \lim_{t \rightarrow d} X(t)\f$. Returns `SMALLER`, `EQUAL`, or -`LARGER` accordingly. -\pre `parameter_space_in_y_2`(`xcv`, `ce`) \f$ \neq\f$ `ARR_INTERIOR`. -\pre If the parameter space is unbounded, \f$ C\f$ has a vertical asymptote at its \f$ d\f$-end; that is, `parameter_space_in_x_2`(`xcv`, `ce`) = `ARR_INTERIOR`. -*/ -Comparison_result operator()(const ArrTraits::Point_2& p, -const ArrTraits::X_monotone_curve_2& xcv, -Arr_curve_end ce); +Given a point `p`, an \f$ x\f$-monotone curve `xcv`, and an +enumeration `ce` that specifies either the minimum or the +maximum end of the curve where the curve has a vertical asymptote, +compares the \f$ x\f$-coordinate of `p` and the \f$ x\f$-coordinate of the +limit of the curve at its specificed end. The variable `xcv` +identifies the parametric curve \f$ C(t) = (X(t),Y(t))\f$ defined over an +open or half-open interval with endpoints \f$ 0\f$ and \f$ 1\f$. The +enumeration `ce` identifies an open end \f$ d \in\{0,1\}\f$ of \f$ C\f$. +Formally, compares the \f$ x\f$-coordinate of `p` and +\f$ \lim_{t \rightarrow d} X(t)\f$. Returns `SMALLER`, `EQUAL`, or +`LARGER` accordingly. +\pre `parameter_space_in_y_2`(`xcv`, `ce`) \f$ \neq\f$ `ARR_INTERIOR`. +\pre If the parameter space is unbounded, \f$ C\f$ has a vertical asymptote at its \f$ d\f$-end; that is, `parameter_space_in_x_2`(`xcv`, `ce`) = `ARR_INTERIOR`. +*/ +Comparison_result operator()(const ArrTraits::Point_2& p, +const ArrTraits::X_monotone_curve_2& xcv, +Arr_curve_end ce); /*! -Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and two -indices `ce1` and `ce2` that specify either the minimum -or the maximum ends of `xcv1` and `xcv2`, respectively, -where the curves have vertical asymptotes, compares the -\f$ x\f$-coordinates of the limits of the curves at their specificed -ends. The variables `xcv1` and `xcv2` identify the -parametric curves \f$ C_1(t) = (X_1(t),Y_1(t))\f$ and -\f$ C_2(t) = (X_2(t),Y_2(t))\f$, respectively, defined over open or -half-open intervals with endpoints \f$ 0\f$ and \f$ 1\f$. The indices -`ce1` and `ce2` identify open ends \f$ d_1 \in\{0,1\}\f$ and -\f$ d_2 \in\{0,1\}\f$ of \f$ C_1\f$ and \f$ C_2\f$, respectively. Formally, -compares \f$ \lim_{t \rightarrow d_1} X_1(t)\f$ and -\f$ \lim_{t \rightarrow d_2} X_2(t)\f$. Returns `SMALLER`, `EQUAL`, -or `LARGER` accordingly. -\pre `parameter_space_in_y_2`(`xcv1`, `ce1`) \f$ \neq\f$ `ARR_INTERIOR`. -\pre `parameter_space_in_y_2`(`xcv2`, `ce2`) \f$ \neq\f$ `ARR_INTERIOR`. -\pre If the parameter space is unbounded, \f$ C_1\f$ has a vertical asymptote at its respective end; that is, -`parameter_space_in_x_2`(`xcv1`, `ce1`) = `ARR_INTERIOR`. -\pre If the parameter space is unbounded, \f$ C_2\f$ has a vertical asymptote at its respective end; that is, -`parameter_space_in_x_2`(`xcv2`, `ce2`) = `ARR_INTERIOR`. -*/ -Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, -Arr_curve_end ce1, -const ArrTraits::X_monotone_curve_2& xcv2, -Arr_curve_end ce2); +Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and two +indices `ce1` and `ce2` that specify either the minimum +or the maximum ends of `xcv1` and `xcv2`, respectively, +where the curves have vertical asymptotes, compares the +\f$ x\f$-coordinates of the limits of the curves at their specificed +ends. The variables `xcv1` and `xcv2` identify the +parametric curves \f$ C_1(t) = (X_1(t),Y_1(t))\f$ and +\f$ C_2(t) = (X_2(t),Y_2(t))\f$, respectively, defined over open or +half-open intervals with endpoints \f$ 0\f$ and \f$ 1\f$. The indices +`ce1` and `ce2` identify open ends \f$ d_1 \in\{0,1\}\f$ and +\f$ d_2 \in\{0,1\}\f$ of \f$ C_1\f$ and \f$ C_2\f$, respectively. Formally, +compares \f$ \lim_{t \rightarrow d_1} X_1(t)\f$ and +\f$ \lim_{t \rightarrow d_2} X_2(t)\f$. Returns `SMALLER`, `EQUAL`, +or `LARGER` accordingly. +\pre `parameter_space_in_y_2`(`xcv1`, `ce1`) \f$ \neq\f$ `ARR_INTERIOR`. +\pre `parameter_space_in_y_2`(`xcv2`, `ce2`) \f$ \neq\f$ `ARR_INTERIOR`. +\pre If the parameter space is unbounded, \f$ C_1\f$ has a vertical asymptote at its respective end; that is, +`parameter_space_in_x_2`(`xcv1`, `ce1`) = `ARR_INTERIOR`. +\pre If the parameter space is unbounded, \f$ C_2\f$ has a vertical asymptote at its respective end; that is, +`parameter_space_in_x_2`(`xcv2`, `ce2`) = `ARR_INTERIOR`. +*/ +Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, +Arr_curve_end ce1, +const ArrTraits::X_monotone_curve_2& xcv2, +Arr_curve_end ce2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h index d31605b41341..63fcae897710 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableTernaryFunction +\cgalRefines AdaptableTernaryFunction -\cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_x_near_limit_2 +\cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_x_near_limit_2 */ @@ -17,26 +17,26 @@ class CompareXNearLimit_2 { /// @{ /*! -Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and an -enumeration `ce` that specifies either the minimum ends or the -maximum ends of the curves where the curves have a vertical -asymptote, compares the \f$ x\f$-coordinate of the curves near their -respective ends. Returns `SMALLER`, `EQUAL`, or `LARGER` -accordingly. More precisely, compares the \f$ x\f$-coordinates of the -horizontal projection of a point \f$ p\f$ onto `xcv1` and `xcv2`. -If `xcv1` and `xcv2` approach the bottom boundary-side, \f$ p\f$ -is located far to the bottom, such that the result is invariant -under a translation of \f$ p\f$ farther to the bottom. If `xcv1` -and `xcv2` approach the top boundary-side, \f$ p\f$ is located far -to the top in a similar manner. -\pre The \f$ x\f$-coordinates of the limits of the curves at their respective ends are equal. That is, -`compare_x_at_limit_2`(`xcv1`, `xcv2`, `ce`) = `EQUAL`. -\pre `parameter_space_in_y_2`(`xcv1`, `ce`) = `parameter_space_in_y_2`(`xcv2`, `ce`). -\pre `parameter_space_in_y_2`(`xcv1`, `ce`) \f$ \neq\f$ `ARR_INTERIOR`. -*/ -Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, -const ArrTraits::X_monotone_curve_2& xcv2, -Arr_curve_end ce); +Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and an +enumeration `ce` that specifies either the minimum ends or the +maximum ends of the curves where the curves have a vertical +asymptote, compares the \f$ x\f$-coordinate of the curves near their +respective ends. Returns `SMALLER`, `EQUAL`, or `LARGER` +accordingly. More precisely, compares the \f$ x\f$-coordinates of the +horizontal projection of a point \f$ p\f$ onto `xcv1` and `xcv2`. +If `xcv1` and `xcv2` approach the bottom boundary-side, \f$ p\f$ +is located far to the bottom, such that the result is invariant +under a translation of \f$ p\f$ farther to the bottom. If `xcv1` +and `xcv2` approach the top boundary-side, \f$ p\f$ is located far +to the top in a similar manner. +\pre The \f$ x\f$-coordinates of the limits of the curves at their respective ends are equal. That is, +`compare_x_at_limit_2`(`xcv1`, `xcv2`, `ce`) = `EQUAL`. +\pre `parameter_space_in_y_2`(`xcv1`, `ce`) = `parameter_space_in_y_2`(`xcv2`, `ce`). +\pre `parameter_space_in_y_2`(`xcv1`, `ce`) \f$ \neq\f$ `ARR_INTERIOR`. +*/ +Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, +const ArrTraits::X_monotone_curve_2& xcv2, +Arr_curve_end ce); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h index 42b5df88346e..a58267805b67 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableBinaryFunction +\cgalRefines AdaptableBinaryFunction -\cgalHasModel ArrangementBasicTraits_2::Compare_x_2 +\cgalHasModel ArrangementBasicTraits_2::Compare_x_2 */ @@ -17,11 +17,11 @@ class CompareX_2 { /// @{ /*! -returns `SMALLER`, `EQUAL`, or `LARGER` -according to the \f$ x\f$-ordering of points `p1` and `p2`. -*/ -Comparison_result operator()(ArrTraits::Point_2 p1, -ArrTraits::Point_2 p2); +returns `SMALLER`, `EQUAL`, or `LARGER` +according to the \f$ x\f$-ordering of points `p1` and `p2`. +*/ +Comparison_result operator()(ArrTraits::Point_2 p1, +ArrTraits::Point_2 p2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h index cd8d99eb7b10..b9f5e695f177 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h @@ -5,7 +5,7 @@ namespace ArrTraits { \cgalRefines AdaptableBinaryFunction -\cgalHasModel ArrangementBasicTraits_2::Compare_xy_2 +\cgalHasModel ArrangementBasicTraits_2::Compare_xy_2 */ @@ -17,11 +17,11 @@ class CompareXy_2 { /// @{ /*! -returns `SMALLER`, `EQUAL`, or `LARGER` according -to the lexicographic \f$ xy\f$-order of the points `p1` and `p2`. -*/ -Comparison_result operator()(ArrTraits::Point_2 p1, -ArrTraits::Point_2 p2); +returns `SMALLER`, `EQUAL`, or `LARGER` according +to the lexicographic \f$ xy\f$-order of the points `p1` and `p2`. +*/ +Comparison_result operator()(ArrTraits::Point_2 p1, +ArrTraits::Point_2 p2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h index 345a6ca33210..fdb937c936a5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableTernaryFunction +\cgalRefines AdaptableTernaryFunction -\cgalHasModel ArrangementBasicTraits_2::Compare_y_at_x_left_2 +\cgalHasModel ArrangementBasicTraits_2::Compare_y_at_x_left_2 */ @@ -17,15 +17,15 @@ class CompareYAtXLeft_2 { /// @{ /*! -accepts two \f$ x\f$-monotone curves `xc1` and `xc2` -that have a common right endpoint `p`, and returns `SMALLER, EQUAL` or `LARGER` according to the relative position of the two -curves immediately to the left of \f$ p\f$. Note that in case one of the -\f$ x\f$-monotone curves is a vertical segment (emanating downward from -`p`), it is always considered to be below the other curve. -*/ -Comparison_result operator()(ArrTraits::X_monotone_curve_2 xc1, -ArrTraits::X_monotone_curve_2 xc2, -ArrTraits::Point_2 p); +accepts two \f$ x\f$-monotone curves `xc1` and `xc2` +that have a common right endpoint `p`, and returns `SMALLER, EQUAL` or `LARGER` according to the relative position of the two +curves immediately to the left of \f$ p\f$. Note that in case one of the +\f$ x\f$-monotone curves is a vertical segment (emanating downward from +`p`), it is always considered to be below the other curve. +*/ +Comparison_result operator()(ArrTraits::X_monotone_curve_2 xc1, +ArrTraits::X_monotone_curve_2 xc2, +ArrTraits::Point_2 p); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h index 07f072fc2592..7110f652d0fd 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableTernaryFunction +\cgalRefines AdaptableTernaryFunction -\cgalHasModel ArrangementBasicTraits_2::Compare_y_at_x_right_2 +\cgalHasModel ArrangementBasicTraits_2::Compare_y_at_x_right_2 */ @@ -17,15 +17,15 @@ class CompareYAtXRight_2 { /// @{ /*! -accepts two \f$ x\f$-monotone curves `xc1` and `xc2` -that have a common left endpoint `p`, and returns `SMALLER, EQUAL` or `LARGER` according to the relative position of the two -curves immediately to the right of \f$ p\f$. Note that in case one of the -\f$ x\f$-monotone curves is a vertical segment emanating upward from -`p`, it is always considered to be above the other curve. -*/ -Comparison_result operator()(ArrTraits::X_monotone_curve_2 xc1, -ArrTraits::X_monotone_curve_2 xc2, -ArrTraits::Point_2 p); +accepts two \f$ x\f$-monotone curves `xc1` and `xc2` +that have a common left endpoint `p`, and returns `SMALLER, EQUAL` or `LARGER` according to the relative position of the two +curves immediately to the right of \f$ p\f$. Note that in case one of the +\f$ x\f$-monotone curves is a vertical segment emanating upward from +`p`, it is always considered to be above the other curve. +*/ +Comparison_result operator()(ArrTraits::X_monotone_curve_2 xc1, +ArrTraits::X_monotone_curve_2 xc2, +ArrTraits::Point_2 p); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h index 408e62f4a968..9d1cbf54df68 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableBinaryFunction +\cgalRefines AdaptableBinaryFunction -\cgalHasModel ArrangementBasicTraits_2::Compare_y_at_x_2 +\cgalHasModel ArrangementBasicTraits_2::Compare_y_at_x_2 */ @@ -17,12 +17,12 @@ class CompareYAtX_2 { /// @{ /*! -compares the \f$ y\f$-coordinates of `p` and the vertical -projection of `p` on `xc`, and returns `SMALLER`, `EQUAL`, -or `LARGER` according to the result. -*/ -Comparison_result operator()(ArrTraits::Point_2 p, -ArrTraits::X_monotone_curve_2 xc); +compares the \f$ y\f$-coordinates of `p` and the vertical +projection of `p` on `xc`, and returns `SMALLER`, `EQUAL`, +or `LARGER` according to the result. +*/ +Comparison_result operator()(ArrTraits::Point_2 p, +ArrTraits::X_monotone_curve_2 xc); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h index cea0b16d712c..bb8a75e9cb84 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableTernaryFunction +\cgalRefines AdaptableTernaryFunction -\cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_y_near_boundary_2 +\cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_y_near_boundary_2 */ @@ -17,26 +17,26 @@ class CompareYNearBoundary_2 { /// @{ /*! -Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and an -enumeration `ce` that specifies either the minimum or the maximum -ends of the curves, compares the \f$ y\f$-coordinate of the curves near -their respective ends. Returns `SMALLER`, `EQUAL`, or -`LARGER` accordingly. More precisely, compares the -\f$ y\f$-coordinates of the vertical projection of a point \f$ p\f$ onto -predicate `Parameter_space_in_x_2` evaluates to -`ARR_LEFT_BOUNDARY` when applied to `xcv1` and `ce` and -when applied to `xcv2` and `ce`. In this case \f$ p\f$ is -located far to the left, such that the result is invariant under -a translation of \f$ p\f$ farther to the left. If `ce` is -evaluates to `ARR_RIGHT_BOUNDARY` when applied to `xcv1` and -`ce` and when applied to `xcv2` and `ce`. In that case -\f$ p\f$ is located far to the right in a similar manner. -\pre `parameter_space_in_x_2`(`xcv2`, `ce`) = `parameter_space_in_x_2`(`xcv1`, `ce`). -\pre `parameter_space_in_x_2`(`xcv1`, `ce`) \f$ \neq\f$ `ARR_INTERIOR`. -*/ -Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, -const ArrTraits::X_monotone_curve_2& xcv2, -Arr_curve_end ce); +Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and an +enumeration `ce` that specifies either the minimum or the maximum +ends of the curves, compares the \f$ y\f$-coordinate of the curves near +their respective ends. Returns `SMALLER`, `EQUAL`, or +`LARGER` accordingly. More precisely, compares the +\f$ y\f$-coordinates of the vertical projection of a point \f$ p\f$ onto +predicate `Parameter_space_in_x_2` evaluates to +`ARR_LEFT_BOUNDARY` when applied to `xcv1` and `ce` and +when applied to `xcv2` and `ce`. In this case \f$ p\f$ is +located far to the left, such that the result is invariant under +a translation of \f$ p\f$ farther to the left. If `ce` is +evaluates to `ARR_RIGHT_BOUNDARY` when applied to `xcv1` and +`ce` and when applied to `xcv2` and `ce`. In that case +\f$ p\f$ is located far to the right in a similar manner. +\pre `parameter_space_in_x_2`(`xcv2`, `ce`) = `parameter_space_in_x_2`(`xcv1`, `ce`). +\pre `parameter_space_in_x_2`(`xcv1`, `ce`) \f$ \neq\f$ `ARR_INTERIOR`. +*/ +Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, +const ArrTraits::X_monotone_curve_2& xcv2, +Arr_curve_end ce); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h index 629396f95634..097d9c0492ac 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableUnaryFunction +\cgalRefines AdaptableUnaryFunction -\cgalHasModel ArrangementBasicTraits_2::Construct_max_vertex_2 +\cgalHasModel ArrangementBasicTraits_2::Construct_max_vertex_2 */ @@ -17,9 +17,9 @@ class ConstructMaxVertex_2 { /// @{ /*! -returns the lexicographically larger (right) endpoint of `xc`. -*/ -ArrTraits::Point_2 operator()(ArrTraits::X_monotone_curve_2 xc); +returns the lexicographically larger (right) endpoint of `xc`. +*/ +ArrTraits::Point_2 operator()(ArrTraits::X_monotone_curve_2 xc); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h index 7bd2ddee785f..69512f345230 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableUnaryFunction +\cgalRefines AdaptableUnaryFunction -\cgalHasModel ArrangementBasicTraits_2::Construct_min_vertex_2 +\cgalHasModel ArrangementBasicTraits_2::Construct_min_vertex_2 */ @@ -17,9 +17,9 @@ class ConstructMinVertex_2 { /// @{ /*! -returns the lexicographically smaller (left) endpoint of `xc`. -*/ -ArrTraits::Point_2 operator()(ArrTraits::X_monotone_curve_2 xc); +returns the lexicographically smaller (left) endpoint of `xc`. +*/ +ArrTraits::Point_2 operator()(ArrTraits::X_monotone_curve_2 xc); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h index 0ba63096c36e..d21ce37a0021 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementLandmarkTraits_2::Construct_x_monotone_curve_2 +\cgalHasModel ArrangementLandmarkTraits_2::Construct_x_monotone_curve_2 */ @@ -17,11 +17,11 @@ class ConstructXMonotoneCurve_2 { /// @{ /*! -returns an \f$ x\f$-monotone curve connecting `p1` and `p2` (i.e., the -two input points are its endpoints). -*/ -ArrTraits::X_monotone_curve_2 operator() ( ArrTraits::Point_2 p1, -ArrTraits::Point_2 p2); +returns an \f$ x\f$-monotone curve connecting `p1` and `p2` (i.e., the +two input points are its endpoints). +*/ +ArrTraits::X_monotone_curve_2 operator() ( ArrTraits::Point_2 p1, +ArrTraits::Point_2 p2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h index f1688c897449..73364b75ab86 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h @@ -3,12 +3,12 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsGeometricObjects \cgalConcept -represents a general planar curve. +represents a general planar curve. \cgalRefines DefaultConstructible \cgalRefines CopyConstructible \cgalRefines Assignable -\cgalHasModel ArrangementTraits_2::Curve_2 +\cgalHasModel ArrangementTraits_2::Curve_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h index 6c3362ddc533..11b97256bfba 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableBinaryFunction +\cgalRefines AdaptableBinaryFunction -\cgalHasModel ArrangementBasicTraits_2::Equal_2 +\cgalHasModel ArrangementBasicTraits_2::Equal_2 */ @@ -17,17 +17,17 @@ class Equal_2 { /// @{ /*! -determines whether `p1` and `p2` are geometrically -equivalent. -*/ -bool operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2); +determines whether `p1` and `p2` are geometrically +equivalent. +*/ +bool operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2); /*! -determines whether `xc1` and `xc2` are -geometrically equivalent (have the same graph). -*/ -bool operator()(ArrTraits::X_monotone_curve_2 xc1, -ArrTraits::X_monotone_curve_2 xc2); +determines whether `xc1` and `xc2` are +geometrically equivalent (have the same graph). +*/ +bool operator()(ArrTraits::X_monotone_curve_2 xc1, +ArrTraits::X_monotone_curve_2 xc2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h index 0c73d061273e..3af9a1068775 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementXMonotoneTraits_2::Intersect_2 +\cgalHasModel ArrangementXMonotoneTraits_2::Intersect_2 */ @@ -17,20 +17,20 @@ class Intersect_2 { /// @{ /*! -computes the intersections of `xc1` and `xc2` and -inserts them in an ascending lexicographic \f$ xy\f$-order into the -output iterator `oi`. The value-type of `Output_iterator` is -`CGAL::Object`, where each `Object` wraps either a -`pair` object, which -represents an intersection point with its multiplicity (in case the -multiplicity is undefined or unknown, it should be set to \f$ 0\f$) or an -`ArrTraits::X_monotone_curve_2` object, representing an -overlapping subcurve of `xc1` and `xc2`. The operator -returns a past-the-end iterator for the output sequence. -*/ -Output_iterator operator()(ArrTraits::X_monotone_curve_2 xc1, -ArrTraits::X_monotone_curve_2 xc2, -Output_iterator& oi); +computes the intersections of `xc1` and `xc2` and +inserts them in an ascending lexicographic \f$ xy\f$-order into the +output iterator `oi`. The value-type of `Output_iterator` is +`CGAL::Object`, where each `Object` wraps either a +`pair` object, which +represents an intersection point with its multiplicity (in case the +multiplicity is undefined or unknown, it should be set to \f$ 0\f$) or an +`ArrTraits::X_monotone_curve_2` object, representing an +overlapping subcurve of `xc1` and `xc2`. The operator +returns a past-the-end iterator for the output sequence. +*/ +Output_iterator operator()(ArrTraits::X_monotone_curve_2 xc1, +ArrTraits::X_monotone_curve_2 xc2, +Output_iterator& oi); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h index 31f0655630e4..5bcf977b561a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableUnaryFunction +\cgalRefines AdaptableUnaryFunction -\cgalHasModel ArrangementBasicTraits_2::Is_vertical_2 +\cgalHasModel ArrangementBasicTraits_2::Is_vertical_2 */ @@ -17,9 +17,9 @@ class IsVertical_2 { /// @{ /*! -determines whether `xc` is a vertical segment. -*/ -bool operator()(ArrTraits::X_monotone_curve_2 xc); +determines whether `xc` is a vertical segment. +*/ +bool operator()(ArrTraits::X_monotone_curve_2 xc); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h index 508d65ba14e3..2bed5f23a612 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementTraits_2::Make_x_monotone_2 +\cgalHasModel ArrangementTraits_2::Make_x_monotone_2 */ @@ -17,17 +17,17 @@ class MakeXMonotone_2 { /// @{ /*! -subdivides the input curve `c` into \f$ x\f$-monotone subcurves and -isolated points, and inserts the results into a container through the -given output iterator. The value type of `OutputIterator` is -`CGAL::Object`, where each `Object` wraps either an -`ArrTraits::X_monotone_curve_2` object or a `ArrTraits::Point_2` -object. The operator returns a past-the-end iterator for the output -sequence. -*/ -template -OutputIterator operator()( ArrTraits::Curve_2 c, -OutputIterator oi); +subdivides the input curve `c` into \f$ x\f$-monotone subcurves and +isolated points, and inserts the results into a container through the +given output iterator. The value type of `OutputIterator` is +`CGAL::Object`, where each `Object` wraps either an +`ArrTraits::X_monotone_curve_2` object or a `ArrTraits::Point_2` +object. The operator returns a past-the-end iterator for the output +sequence. +*/ +template +OutputIterator operator()( ArrTraits::Curve_2 c, +OutputIterator oi); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h index 88ad38a680dc..77fde78fa27d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementXMonotoneTraits_2::Merge_2 +\cgalHasModel ArrangementXMonotoneTraits_2::Merge_2 */ @@ -17,13 +17,13 @@ class Merge_2 { /// @{ /*! -accepts two mergeable \f$ x\f$-monotone curves `xc1` and `xc2` -and asigns `xc` with the merged curve. -\pre `are_mergeable_2`(`xc1`, `xc2`) is true. -*/ -void merge(ArrTraits::X_monotone_curve_2 xc1, -ArrTraits::X_monotone_curve_2 xc2, -ArrTraits::X_monotone_curve_2& xc); +accepts two mergeable \f$ x\f$-monotone curves `xc1` and `xc2` +and asigns `xc` with the merged curve. +\pre `are_mergeable_2`(`xc1`, `xc2`) is true. +*/ +void merge(ArrTraits::X_monotone_curve_2 xc1, +ArrTraits::X_monotone_curve_2 xc2, +ArrTraits::X_monotone_curve_2& xc); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h index 6655ac19aab4..36fb9f9b8b96 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableBinaryFunction +\cgalRefines AdaptableBinaryFunction -\cgalHasModel ArrangementOpenBoundaryTraits_2::Parameter_space_in_x_2 +\cgalHasModel ArrangementOpenBoundaryTraits_2::Parameter_space_in_x_2 */ @@ -18,21 +18,21 @@ class ParameterSpaceInX_2 { /*! -Given an \f$ x\f$-monotone curve `xcv` and an enumeration `ce` -that specifies either the minimum or the maximum end of the curve, -determines the location of the curve end along the \f$ x\f$-dimension. -The variable `xcv` identifies the parametric curve -\f$ C(t) = (X(t),Y(t))\f$ defined over an open or half-open interval with -endpoints \f$ 0\f$ and \f$ 1\f$. The enumeration `ce` identifies an open -end \f$ d \in\{0,1\}\f$ of \f$ C\f$. Formally, determines whether -\f$ \lim_{t \rightarrow d} X(t)\f$ evaluates to \f$ b_l\f$, \f$ b_r\f$, or a value -in between, where \f$ b_l\f$ and \f$ b_r\f$ are the \f$ x\f$-coordinates of the -left and right boundaries of the parameter space, respectively. -Returns `ARR_LEFT_BOUNDARY`, `ARR_RIGHT_BOUNDARY`, or -`ARR_INTERIOR`, accordingly. -*/ -Arr_parameter_space operator()(const ArrTraits::X_monotone_curve_2& xcv, -Arr_curve_end ce); +Given an \f$ x\f$-monotone curve `xcv` and an enumeration `ce` +that specifies either the minimum or the maximum end of the curve, +determines the location of the curve end along the \f$ x\f$-dimension. +The variable `xcv` identifies the parametric curve +\f$ C(t) = (X(t),Y(t))\f$ defined over an open or half-open interval with +endpoints \f$ 0\f$ and \f$ 1\f$. The enumeration `ce` identifies an open +end \f$ d \in\{0,1\}\f$ of \f$ C\f$. Formally, determines whether +\f$ \lim_{t \rightarrow d} X(t)\f$ evaluates to \f$ b_l\f$, \f$ b_r\f$, or a value +in between, where \f$ b_l\f$ and \f$ b_r\f$ are the \f$ x\f$-coordinates of the +left and right boundaries of the parameter space, respectively. +Returns `ARR_LEFT_BOUNDARY`, `ARR_RIGHT_BOUNDARY`, or +`ARR_INTERIOR`, accordingly. +*/ +Arr_parameter_space operator()(const ArrTraits::X_monotone_curve_2& xcv, +Arr_curve_end ce); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h index f80e3738499d..4a3ebf679e64 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines AdaptableBinaryFunction +\cgalRefines AdaptableBinaryFunction -\cgalHasModel ArrangementOpenBoundaryTraits_2::Parameter_space_in_y_2 +\cgalHasModel ArrangementOpenBoundaryTraits_2::Parameter_space_in_y_2 */ @@ -17,23 +17,23 @@ class ParameterSpaceInY_2 { /// @{ /*! -Given an \f$ x\f$-monotone curve `xcv` and an enumeration `ce` -that specifies either the minimum or the maximum end of the curve, -determines the location of the curve end along the \f$ y\f$-dimension. -The variable `xcv` identifies the parametric curve -\f$ C(t) = (X(t),Y(t))\f$ defined over an open or half-open interval with -endpoints \f$ 0\f$ and \f$ 1\f$. The enumeration `ce` identifies an open -end \f$ d \in\{0,1\}\f$ of \f$ C\f$. Formally, determines whether -\f$ \lim_{t \rightarrow d} Y(t)\f$ evaluates to \f$ b_b\f$, \f$ b_t\f$, or a value -in between, where \f$ b_b\f$ and \f$ b_t\f$ are the \f$ y\f$-coordinates of the -bottom and top boundaries of the parameter space, respectively. -Returns `ARR_BOTTOM_BOUNDARY`, `ARR_TOP_BOUNDARY`, or -`ARR_INTERIOR`, accordingly. -\post If `ArrTraits::Bottom_side_category` is not convertible to `Arr_open_side_tag` then the result is not `ARR_BOTTOM_BOUNDARY`. -\post If `ArrTraits::Top_side_category` is not convertible to `Arr_open_side_tag` then the result is not `ARR_TOP_BOUNDARY`. -*/ -Arr_parameter_space operator()(const ArrTraits::X_monotone_curve_2& xcv, -Arr_curve_end ce); +Given an \f$ x\f$-monotone curve `xcv` and an enumeration `ce` +that specifies either the minimum or the maximum end of the curve, +determines the location of the curve end along the \f$ y\f$-dimension. +The variable `xcv` identifies the parametric curve +\f$ C(t) = (X(t),Y(t))\f$ defined over an open or half-open interval with +endpoints \f$ 0\f$ and \f$ 1\f$. The enumeration `ce` identifies an open +end \f$ d \in\{0,1\}\f$ of \f$ C\f$. Formally, determines whether +\f$ \lim_{t \rightarrow d} Y(t)\f$ evaluates to \f$ b_b\f$, \f$ b_t\f$, or a value +in between, where \f$ b_b\f$ and \f$ b_t\f$ are the \f$ y\f$-coordinates of the +bottom and top boundaries of the parameter space, respectively. +Returns `ARR_BOTTOM_BOUNDARY`, `ARR_TOP_BOUNDARY`, or +`ARR_INTERIOR`, accordingly. +\post If `ArrTraits::Bottom_side_category` is not convertible to `Arr_open_side_tag` then the result is not `ARR_BOTTOM_BOUNDARY`. +\post If `ArrTraits::Top_side_category` is not convertible to `Arr_open_side_tag` then the result is not `ARR_TOP_BOUNDARY`. +*/ +Arr_parameter_space operator()(const ArrTraits::X_monotone_curve_2& xcv, +Arr_curve_end ce); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h index 883e692b7164..bffe1b7647ed 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h @@ -3,13 +3,13 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsGeometricObjects \cgalConcept -Represents a point in the plane. +Represents a point in the plane. \cgalRefines DefaultConstructible \cgalRefines CopyConstructible -\cgalRefines Assignable +\cgalRefines Assignable -\cgalHasModel ArrangementBasicTraits_2::Point_2 +\cgalHasModel ArrangementBasicTraits_2::Point_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h index f6ba2f33ce79..d690500b9402 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h @@ -3,9 +3,9 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept -\cgalRefines Functor +\cgalRefines Functor -\cgalHasModel ArrangementXMonotoneTraits_2::Split_2 +\cgalHasModel ArrangementXMonotoneTraits_2::Split_2 */ @@ -17,15 +17,15 @@ class Split_2 { /// @{ /*! -accepts an input curve `xc` and a split point `p` in its -interior. It splits `xc` at the split point into two subcurves `xc1` -and `xc2`, such that `p` is `xc1`'s right endpoint and -`xc2`'s left endpoint. -*/ -void operator()(ArrTraits::X_monotone_curve_2 xc, -ArrTraits::Point_2 p, -ArrTraits::X_monotone_curve_2& xc1, -ArrTraits::X_monotone_curve_2& xc2); +accepts an input curve `xc` and a split point `p` in its +interior. It splits `xc` at the split point into two subcurves `xc1` +and `xc2`, such that `p` is `xc1`'s right endpoint and +`xc2`'s left endpoint. +*/ +void operator()(ArrTraits::X_monotone_curve_2 xc, +ArrTraits::Point_2 p, +ArrTraits::X_monotone_curve_2& xc1, +ArrTraits::X_monotone_curve_2& xc2); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h index f7ebd4589411..3935aa034e5c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h @@ -3,13 +3,13 @@ namespace ArrTraits { \ingroup PkgArrangementOnSurface2ConceptsGeometricObjects \cgalConcept -Represents a planar (weakly) \f$ x\f$-monotone curve. +Represents a planar (weakly) \f$ x\f$-monotone curve. \cgalRefines DefaultConstructible \cgalRefines CopyConstructible -\cgalRefines Assignable +\cgalRefines Assignable -\cgalHasModel ArrangementBasicTraits_2::X_monotone_curve_2 +\cgalHasModel ArrangementBasicTraits_2::X_monotone_curve_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h index fc7a2064e0c1..8c64c3a73cdc 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h @@ -3,201 +3,201 @@ \ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept -The concept `ArrangementBasicTraits_2` defines the minimal set of geometric -predicates needed for the construction and maintenance of objects of the -class `Arrangement_2`, as well as performing simple queries (such as -point-location queries) on such arrangements. - -A model of this concept must define nested `Point_2` and -`X_monotone_curve_2` types, which represent planar points and -continuous \f$ x\f$-monotone curves (a vertical segment is also considered to be -weakly \f$ x\f$-monotone), respectively. The \f$ x\f$-monotone curves are assumed -to be pairwise disjoint in their interiors, so they do not intersect -except at their endpoints. - -The `X_monotone_curve_2` curves of an arrangement are confined to an -iso-rectangular area called the parameter space. The iso-rectangule can -be unbounded, open, or closed. The set of predicates provided by a model -the concept `ArrangementBasicTraits_2` is sufficient for constructing arrangements of -\f$ x\f$-monotone curves that do not reach or approach the boundary of the -parameter space. The nature of the input curves, whether they are -expected to reach or approach the left, right, bottom, or top side of the -boundary of the parameter space, are conveyed through the definition of -four additional nested types, namely `Left_side_category`, -`Right_side_category`, `Bottom_side_category`, and -`Top_side_category`. Each such type must be convertible to the type -`Arr_oblivious_side_tag`. +The concept `ArrangementBasicTraits_2` defines the minimal set of geometric +predicates needed for the construction and maintenance of objects of the +class `Arrangement_2`, as well as performing simple queries (such as +point-location queries) on such arrangements. + +A model of this concept must define nested `Point_2` and +`X_monotone_curve_2` types, which represent planar points and +continuous \f$ x\f$-monotone curves (a vertical segment is also considered to be +weakly \f$ x\f$-monotone), respectively. The \f$ x\f$-monotone curves are assumed +to be pairwise disjoint in their interiors, so they do not intersect +except at their endpoints. + +The `X_monotone_curve_2` curves of an arrangement are confined to an +iso-rectangular area called the parameter space. The iso-rectangule can +be unbounded, open, or closed. The set of predicates provided by a model +the concept `ArrangementBasicTraits_2` is sufficient for constructing arrangements of +\f$ x\f$-monotone curves that do not reach or approach the boundary of the +parameter space. The nature of the input curves, whether they are +expected to reach or approach the left, right, bottom, or top side of the +boundary of the parameter space, are conveyed through the definition of +four additional nested types, namely `Left_side_category`, +`Right_side_category`, `Bottom_side_category`, and +`Top_side_category`. Each such type must be convertible to the type +`Arr_oblivious_side_tag`. \cgalRefines DefaultConstructible \cgalRefines CopyConstructible -\cgalRefines Assignable +\cgalRefines Assignable \cgalHasModel `CGAL::Arr_segment_traits_2` -\cgalHasModel `CGAL::Arr_non_caching_segment_basic_traits_2` -\cgalHasModel `CGAL::Arr_non_caching_segment_traits_2` -\cgalHasModel `CGAL::Arr_linear_traits_2` -\cgalHasModel `CGAL::Arr_polyline_traits_2` -\cgalHasModel `CGAL::Arr_circle_segment_traits_2` -\cgalHasModel `CGAL::Arr_line_arc_traits_2` -\cgalHasModel `CGAL::Arr_circular_arc_traits_2` -\cgalHasModel `CGAL::Arr_circular_line_arc_traits_2` -\cgalHasModel `CGAL::Arr_conic_traits_2` -\cgalHasModel `CGAL::Arr_rational_function_traits_2` -\cgalHasModel `CGAL::Arr_Bezier_curve_traits_2` -\cgalHasModel `CGAL::Arr_algebraic_segment_traits_2` -\cgalHasModel `CGAL::Arr_curve_data_traits_2` -\cgalHasModel `CGAL::Arr_consolidated_curve_data_traits_2` +\cgalHasModel `CGAL::Arr_non_caching_segment_basic_traits_2` +\cgalHasModel `CGAL::Arr_non_caching_segment_traits_2` +\cgalHasModel `CGAL::Arr_linear_traits_2` +\cgalHasModel `CGAL::Arr_polyline_traits_2` +\cgalHasModel `CGAL::Arr_circle_segment_traits_2` +\cgalHasModel `CGAL::Arr_line_arc_traits_2` +\cgalHasModel `CGAL::Arr_circular_arc_traits_2` +\cgalHasModel `CGAL::Arr_circular_line_arc_traits_2` +\cgalHasModel `CGAL::Arr_conic_traits_2` +\cgalHasModel `CGAL::Arr_rational_function_traits_2` +\cgalHasModel `CGAL::Arr_Bezier_curve_traits_2` +\cgalHasModel `CGAL::Arr_algebraic_segment_traits_2` +\cgalHasModel `CGAL::Arr_curve_data_traits_2` +\cgalHasModel `CGAL::Arr_consolidated_curve_data_traits_2` */ class ArrangementBasicTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -models the concept `ArrTraits::Point_2`. -*/ -typedef unspecified_type Point_2; +models the concept `ArrTraits::Point_2`. +*/ +typedef unspecified_type Point_2; /*! -models the concept `ArrTraits::XMonotoneCurve_2`. -*/ -typedef unspecified_type X_monotone_curve_2; +models the concept `ArrTraits::XMonotoneCurve_2`. +*/ +typedef unspecified_type X_monotone_curve_2; -/// @} +/// @} -/// \name Categories +/// \name Categories /// @{ /*! -indicates whether the nested functor `Compare_at_x_left_2` is -provided. -*/ -typedef unspecified_type Has_left_category; +indicates whether the nested functor `Compare_at_x_left_2` is +provided. +*/ +typedef unspecified_type Has_left_category; /*! -Must be convertible to `Arr_oblivious_side_tag`. -*/ -typedef unspecified_type Left_side_category; +Must be convertible to `Arr_oblivious_side_tag`. +*/ +typedef unspecified_type Left_side_category; /*! -Must be convertible to `Arr_oblivious_side_tag`. -*/ -typedef unspecified_type Bottom_side_category; +Must be convertible to `Arr_oblivious_side_tag`. +*/ +typedef unspecified_type Bottom_side_category; /*! -Must be convertible to `Arr_oblivious_side_tag`. -*/ -typedef unspecified_type Top_side_category; +Must be convertible to `Arr_oblivious_side_tag`. +*/ +typedef unspecified_type Top_side_category; /*! -Must be convertible to `Arr_oblivious_side_tag`. -*/ -typedef unspecified_type Right_side_category; +Must be convertible to `Arr_oblivious_side_tag`. +*/ +typedef unspecified_type Right_side_category; -/// @} +/// @} -/// \name Functor Types +/// \name Functor Types /// @{ /*! -models the concept `ArrTraits::CompareX_2`. -*/ -typedef unspecified_type Compare_x_2; +models the concept `ArrTraits::CompareX_2`. +*/ +typedef unspecified_type Compare_x_2; /*! -models the concept `ArrTraits::CompareXy_2`. -*/ -typedef unspecified_type Compare_xy_2; +models the concept `ArrTraits::CompareXy_2`. +*/ +typedef unspecified_type Compare_xy_2; /*! -models the concept `ArrTraits::ConstructMinVertex_2`. -*/ -typedef unspecified_type Construct_min_vertex_2; +models the concept `ArrTraits::ConstructMinVertex_2`. +*/ +typedef unspecified_type Construct_min_vertex_2; /*! -models the concept `ArrTraits::ConstructMaxVertex_2`. -*/ -typedef unspecified_type Construct_max_vertex_2; +models the concept `ArrTraits::ConstructMaxVertex_2`. +*/ +typedef unspecified_type Construct_max_vertex_2; /*! -models the concept `ArrTraits::IsVertical_2`. -*/ -typedef unspecified_type Is_vertical_2; +models the concept `ArrTraits::IsVertical_2`. +*/ +typedef unspecified_type Is_vertical_2; /*! -models the concept `ArrTraits::CompareYAtX_2`. -*/ -typedef unspecified_type Compare_y_at_x_2; +models the concept `ArrTraits::CompareYAtX_2`. +*/ +typedef unspecified_type Compare_y_at_x_2; /*! -models the concept `ArrTraits::CompareYAtXLeft_2`. -Required only if the `Has_left_category` category is convertible to -`Tag_true`. -*/ -typedef unspecified_type Compare_y_at_x_left_2; +models the concept `ArrTraits::CompareYAtXLeft_2`. +Required only if the `Has_left_category` category is convertible to +`Tag_true`. +*/ +typedef unspecified_type Compare_y_at_x_left_2; /*! -models the concept `ArrTraits::CompareYAtXRight_2`. -*/ -typedef unspecified_type Compare_y_at_x_right_2; +models the concept `ArrTraits::CompareYAtXRight_2`. +*/ +typedef unspecified_type Compare_y_at_x_right_2; /*! -models the concept `ArrTraits::Equal_2`. -*/ -typedef unspecified_type Equal_2; +models the concept `ArrTraits::Equal_2`. +*/ +typedef unspecified_type Equal_2; -/// @} +/// @} -/// \name Accessing Functor Objects +/// \name Accessing Functor Objects /// @{ /*! -*/ -Compare_x_2 compare_x_2_object() const; +*/ +Compare_x_2 compare_x_2_object() const; /*! -*/ -Compare_xy_2 compare_xy_2_object() const; +*/ +Compare_xy_2 compare_xy_2_object() const; /*! -*/ -Construct_min_vertex_2 construct_min_vertex_2_object() const; +*/ +Construct_min_vertex_2 construct_min_vertex_2_object() const; /*! -*/ -Construct_max_vertex_2 construct_max_vertex_2_object() const; +*/ +Construct_max_vertex_2 construct_max_vertex_2_object() const; /*! -*/ -Is_vertical_2 is_vertical_2_object() const; +*/ +Is_vertical_2 is_vertical_2_object() const; /*! -*/ -Compare_y_at_x_2 compare_y_at_x_2_object() const; +*/ +Compare_y_at_x_2 compare_y_at_x_2_object() const; /*! -*/ -Compare_y_at_x_left_2 compare_y_at_x_left_2_object() const; +*/ +Compare_y_at_x_left_2 compare_y_at_x_left_2_object() const; /*! -*/ -Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const; +*/ +Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const; /*! -*/ -Equal_2 equal_2_object() const; +*/ +Equal_2 equal_2_object() const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h index 63c367491726..16ee1ffbc1a7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h @@ -3,165 +3,165 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -A doubly-connected edge-list (Dcel for short) data-structure. It consists -of three containers of records: vertices \f$ V\f$, halfedges \f$ E\f$, and faces \f$ F\f$. -It maintains the incidence relation among them. The halfedges are ordered -in pairs sometimes referred to as twins, such that each halfedge pair -represent an edge. - -A model of the `ArrangementDcel` concept must provide the following types and -operations. (In addition to the requirements here, the local types -`Vertex`,`Halfedge`, `Face` -`Hole` and `Isolated_vertex` -must be models of the concepts -`ArrangementDcelVertex`, -`ArrangementDcelHalfedge`, -`ArrangementDcelFace`, -`ArrangementDcelHole`, and -`ArrangementDcelIsolatedVertex` respectively.) - -\cgalHasModel `CGAL::Arr_dcel_base` -\cgalHasModel `CGAL::Arr_default_dcel` -\cgalHasModel `CGAL::Arr_face_extended_dcel` -\cgalHasModel `CGAL::Arr_extended_dcel` - -\sa `ArrangementDcelVertex` -\sa `ArrangementDcelHalfedge` -\sa `ArrangementDcelFace` -\sa `ArrangementDcelHole` -\sa `ArrangementDcelIsolatedVertex` +A doubly-connected edge-list (Dcel for short) data-structure. It consists +of three containers of records: vertices \f$ V\f$, halfedges \f$ E\f$, and faces \f$ F\f$. +It maintains the incidence relation among them. The halfedges are ordered +in pairs sometimes referred to as twins, such that each halfedge pair +represent an edge. + +A model of the `ArrangementDcel` concept must provide the following types and +operations. (In addition to the requirements here, the local types +`Vertex`,`Halfedge`, `Face` +`Hole` and `Isolated_vertex` +must be models of the concepts +`ArrangementDcelVertex`, +`ArrangementDcelHalfedge`, +`ArrangementDcelFace`, +`ArrangementDcelHole`, and +`ArrangementDcelIsolatedVertex` respectively.) + +\cgalHasModel `CGAL::Arr_dcel_base` +\cgalHasModel `CGAL::Arr_default_dcel` +\cgalHasModel `CGAL::Arr_face_extended_dcel` +\cgalHasModel `CGAL::Arr_extended_dcel` + +\sa `ArrangementDcelVertex` +\sa `ArrangementDcelHalfedge` +\sa `ArrangementDcelFace` +\sa `ArrangementDcelHole` +\sa `ArrangementDcelIsolatedVertex` */ class ArrangementDcel { public: -/// \name Types +/// \name Types /// @{ /*! -the vertex type. -*/ -typedef unspecified_type Vertex; +the vertex type. +*/ +typedef unspecified_type Vertex; /*! -the halfedge type. -*/ -typedef unspecified_type Halfedge; +the halfedge type. +*/ +typedef unspecified_type Halfedge; /*! -the face type. -*/ -typedef unspecified_type Face; +the face type. +*/ +typedef unspecified_type Face; /*! -the hole type. -*/ -typedef unspecified_type Hole; +the hole type. +*/ +typedef unspecified_type Hole; /*! -the isolated vertex type. -*/ -typedef unspecified_type Isolated_vertex; +the isolated vertex type. +*/ +typedef unspecified_type Isolated_vertex; /*! -used to represent size values (e.g., `size_t`). -*/ -typedef unspecified_type Size; +used to represent size values (e.g., `size_t`). +*/ +typedef unspecified_type Size; /*! -a bidirectional iterator over the vertices. Its value-type is -`Vertex`. -*/ -typedef unspecified_type Vertex_iterator; +a bidirectional iterator over the vertices. Its value-type is +`Vertex`. +*/ +typedef unspecified_type Vertex_iterator; /*! -a bidirectional iterator over the vertices. Its value-type is -`Vertex`. -*/ -typedef unspecified_type Vertex_const_iterator; +a bidirectional iterator over the vertices. Its value-type is +`Vertex`. +*/ +typedef unspecified_type Vertex_const_iterator; /*! -a bidirectional iterator over the halfedges. Its value-type is -`Halfedge`. -*/ -typedef unspecified_type Halfedge_iterator; +a bidirectional iterator over the halfedges. Its value-type is +`Halfedge`. +*/ +typedef unspecified_type Halfedge_iterator; /*! -a bidirectional iterator over the halfedges. Its value-type is -`Halfedge`. -*/ -typedef unspecified_type Halfedge_const_iterator; +a bidirectional iterator over the halfedges. Its value-type is +`Halfedge`. +*/ +typedef unspecified_type Halfedge_const_iterator; /*! -a bidirectional iterator over the faces. Its value-type is `Face`. -*/ -typedef unspecified_type Face_iterator; +a bidirectional iterator over the faces. Its value-type is `Face`. +*/ +typedef unspecified_type Face_iterator; /*! -a bidirectional iterator over the faces. Its value-type is `Face`. -*/ -typedef unspecified_type Face_const_iterator; +a bidirectional iterator over the faces. Its value-type is `Face`. +*/ +typedef unspecified_type Face_const_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -constructs an empty Dcel with one unbounded face. -*/ -Arr_dcel(); +constructs an empty Dcel with one unbounded face. +*/ +Arr_dcel(); /*! -assigns the contents of the `other` Dcel whose unbounded face -is given by `uf`, to `dcel`. The function returns a pointer to -the unbounded face of `dcel` after the assignment. -*/ -Face* assign (const Self& other, const Face *uf); +assigns the contents of the `other` Dcel whose unbounded face +is given by `uf`, to `dcel`. The function returns a pointer to +the unbounded face of `dcel` after the assignment. +*/ +Face* assign (const Self& other, const Face *uf); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the number of vertices. -*/ -Size size_of_vertices() const; +returns the number of vertices. +*/ +Size size_of_vertices() const; /*! -returns the number of halfedges (always even). -*/ -Size size_of_halfedges() const; +returns the number of halfedges (always even). +*/ +Size size_of_halfedges() const; /*! -returns the number of faces. -*/ -Size size_of_faces() const; +returns the number of faces. +*/ +Size size_of_faces() const; /*! -returns the number of holes (the number of connected components). -*/ -Size size_of_holes() const; +returns the number of holes (the number of connected components). +*/ +Size size_of_holes() const; /*! -returns the number of isolated vertices. -*/ -Size size_of_isolated_vertices() const; +returns the number of isolated vertices. +*/ +Size size_of_isolated_vertices() const; /*! -returns a begin-iterator of the vertices in `dcel`. -*/ -Vertex_iterator vertices_begin(); +returns a begin-iterator of the vertices in `dcel`. +*/ +Vertex_iterator vertices_begin(); /*! -returns a past-the-end iterator of the vertices in `dcel`. -*/ -Vertex_iterator vertices_end(); +returns a past-the-end iterator of the vertices in `dcel`. +*/ +Vertex_iterator vertices_end(); /*! returns a range over handles of the vertices in `dcel`. @@ -169,14 +169,14 @@ returns a range over handles of the vertices in `dcel`. unspecified_type vertex_handles(); /*! -returns a begin-iterator of the vertices in `dcel`. -*/ -Vertex_const_iterator vertices_begin() const; +returns a begin-iterator of the vertices in `dcel`. +*/ +Vertex_const_iterator vertices_begin() const; /*! -returns a past-the-end iterator of the vertices in `dcel`. -*/ -Vertex_const_iterator vertices_end() const; +returns a past-the-end iterator of the vertices in `dcel`. +*/ +Vertex_const_iterator vertices_end() const; /*! returns a const range (model of `ConstRange`) over handles of the vertices in `dcel`. @@ -184,14 +184,14 @@ returns a const range (model of `ConstRange`) over handles of the vertices in `d unspecified_type vertex_handles() const; /*! -returns a begin-iterator of the halfedges in `dcel`. -*/ -Halfedge_iterator halfedges_begin(); +returns a begin-iterator of the halfedges in `dcel`. +*/ +Halfedge_iterator halfedges_begin(); /*! -returns a past-the-end iterator of the halfedges in `dcel`. -*/ -Halfedge_iterator halfedges_end(); +returns a past-the-end iterator of the halfedges in `dcel`. +*/ +Halfedge_iterator halfedges_end(); /*! returns a range over handles of the halfedges in `dcel`. @@ -199,14 +199,14 @@ returns a range over handles of the halfedges in `dcel`. unspecified_type halfedge_handles(); /*! -returns a begin-iterator of the halfedges in `dcel`. -*/ -Halfedge_const_iterator halfedges_begin() const; +returns a begin-iterator of the halfedges in `dcel`. +*/ +Halfedge_const_iterator halfedges_begin() const; /*! -returns a past-the-end iterator of the halfedges in `dcel`. -*/ -Halfedge_const_iterator halfedges_end() const; +returns a past-the-end iterator of the halfedges in `dcel`. +*/ +Halfedge_const_iterator halfedges_end() const; /*! returns a const range (model of `ConstRange`) over handles of the halfedges in `dcel`. @@ -214,14 +214,14 @@ returns a const range (model of `ConstRange`) over handles of the halfedges in ` unspecified_type halfedge_handles() const; /*! -returns a begin-iterator of the faces in `dcel`. -*/ -Face_iterator faces_begin(); +returns a begin-iterator of the faces in `dcel`. +*/ +Face_iterator faces_begin(); /*! -returns a past-the-end iterator of the faces in `dcel`. -*/ -Face_iterator faces_end(); +returns a past-the-end iterator of the faces in `dcel`. +*/ +Face_iterator faces_end(); /*! returns a range over handles of the faces in `dcel`. @@ -229,23 +229,23 @@ returns a range over handles of the faces in `dcel`. unspecified_type face_handles(); /*! -returns a begin-iterator of the faces in `dcel`. -*/ -Face_const_iterator faces_begin() const; +returns a begin-iterator of the faces in `dcel`. +*/ +Face_const_iterator faces_begin() const; /*! -returns a past-the-end iterator of the faces in `dcel`. -*/ -Face_const_iterator faces_end() const; +returns a past-the-end iterator of the faces in `dcel`. +*/ +Face_const_iterator faces_end() const; /*! returns a const range (model of `ConstRange`) over handles of the faces in `dcel`. */ unspecified_type face_handles() const; -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// The following operations allocate a new element of the respective /// type. Halfedges are always allocated in pairs of opposite /// halfedges. The halfedges and their opposite pointers are @@ -253,54 +253,54 @@ unspecified_type face_handles() const; /// @{ /*! -creates a new vertex. -*/ -Vertex* new_vertex(); +creates a new vertex. +*/ +Vertex* new_vertex(); /*! -creates a new pair of twin halfedges. -*/ -Halfedge* new_edge(); +creates a new pair of twin halfedges. +*/ +Halfedge* new_edge(); /*! -creates a new face. -*/ -Face* new_face(); +creates a new face. +*/ +Face* new_face(); /*! -creates a new hole record. -*/ -Hole* new_hole(); +creates a new hole record. +*/ +Hole* new_hole(); /*! -creates a new isolated vertex record. -*/ -Isolated_vertex* new_isolated_vertex(); +creates a new isolated vertex record. +*/ +Isolated_vertex* new_isolated_vertex(); /*! -deletes the vertex `v`. -*/ -void delete_vertex(Vertex* v); +deletes the vertex `v`. +*/ +void delete_vertex(Vertex* v); /*! -deletes the halfedge `e` as well as its twin. -*/ -void delete_edge(Halfedge* e); +deletes the halfedge `e` as well as its twin. +*/ +void delete_edge(Halfedge* e); /*! -deletes the face `f`. -*/ -void delete_face(Face* f); +deletes the face `f`. +*/ +void delete_face(Face* f); /*! -deletes the hole `ho`. -*/ -void delete_hole(Hole* ho); +deletes the hole `ho`. +*/ +void delete_hole(Hole* ho); /*! -deletes the isolated vertex `iv`. -*/ -void delete_isolated_vertex(Isolated_vertex* iv); +deletes the isolated vertex `iv`. +*/ +void delete_isolated_vertex(Isolated_vertex* iv); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h index f39f30562d7b..b13dcc720c08 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h @@ -3,145 +3,145 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -A face record in a Dcel data structure. A face may either be unbounded, -otherwise it has an incident halfedge along the chain defining its outer -boundary. A face may also contain holes and isolated vertices in its -interior. +A face record in a Dcel data structure. A face may either be unbounded, +otherwise it has an incident halfedge along the chain defining its outer +boundary. A face may also contain holes and isolated vertices in its +interior. -\sa `ArrangementDcel` -\sa `ArrangementDcelVertex` -\sa `ArrangementDcelHalfedge` +\sa `ArrangementDcel` +\sa `ArrangementDcelVertex` +\sa `ArrangementDcelHalfedge` */ class ArrangementDcelFace { public: -/// \name Types +/// \name Types /// The non-mutable iterators `Hole_const_iterator`, and `Isolated_vertex_const_iterator` are also defined. /// @{ /*! -the corresponding Dcel vertex type. -*/ -typedef unspecified_type Vertex; +the corresponding Dcel vertex type. +*/ +typedef unspecified_type Vertex; /*! -the corresponding Dcel halfedge type. -*/ -typedef unspecified_type Halfedge; +the corresponding Dcel halfedge type. +*/ +typedef unspecified_type Halfedge; /*! -a bidirectional iterator over the holes in -inside the face. Its value-type is `Halfedge*`. -*/ -typedef unspecified_type Hole_iterator; +a bidirectional iterator over the holes in +inside the face. Its value-type is `Halfedge*`. +*/ +typedef unspecified_type Hole_iterator; /*! -a bidirectional iterator over the -isolated vertices in inside the face. Its value-type is `Vertex*`. -*/ -typedef unspecified_type Isolated_vertex_iterator; +a bidirectional iterator over the +isolated vertices in inside the face. Its value-type is `Vertex*`. +*/ +typedef unspecified_type Isolated_vertex_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_dcel_face(); +default constructor. +*/ +Arr_dcel_face(); /*! -assigns `f` with the contents of the `other` face. -*/ -void assign (const Self& other); +assigns `f` with the contents of the `other` face. +*/ +void assign (const Self& other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// All functions below also have `const` counterparts, returning /// non-mutable pointers or iterators: /// @{ /*! -returns whether the face is unbounded. -*/ -bool is_unbounded() const; +returns whether the face is unbounded. +*/ +bool is_unbounded() const; /*! -returns an incident halfedge along the outer boundary of the face. -If `f` has no outer boundary, the function returns `nullptr`. -*/ -Halfedge* halfedge(); +returns an incident halfedge along the outer boundary of the face. +If `f` has no outer boundary, the function returns `nullptr`. +*/ +Halfedge* halfedge(); /*! -returns the number of holes inside `f`. -*/ -size_t number_of_holes() const; +returns the number of holes inside `f`. +*/ +size_t number_of_holes() const; /*! -returns a begin-iterator for the holes inside `f`. -*/ -Hole_iterator holes_begin(); +returns a begin-iterator for the holes inside `f`. +*/ +Hole_iterator holes_begin(); /*! -returns a past-the-end iterator for the holes inside `f`. -*/ -Hole_iterator holes_end(); +returns a past-the-end iterator for the holes inside `f`. +*/ +Hole_iterator holes_end(); /*! -returns the number of isolated vertices inside `f`. -*/ -size_t number_of_isolated_vertices() const; +returns the number of isolated vertices inside `f`. +*/ +size_t number_of_isolated_vertices() const; /*! -returns a begin-iterator for the isolated vertices inside `f`. -*/ -Isolated_vertex_iterator isolated_vertices_begin(); +returns a begin-iterator for the isolated vertices inside `f`. +*/ +Isolated_vertex_iterator isolated_vertices_begin(); /*! -returns a past-the-end iterator for the isolated vertices inside -`f`. -*/ -Isolated_vertex_iterator isolated_vertices_end(); +returns a past-the-end iterator for the isolated vertices inside +`f`. +*/ +Isolated_vertex_iterator isolated_vertices_end(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the face as unbounded (if `flag` is `true`), or as a bounded -face (if it is `false`). -*/ -void set_unbounded (bool flag); +sets the face as unbounded (if `flag` is `true`), or as a bounded +face (if it is `false`). +*/ +void set_unbounded (bool flag); /*! -sets the incident halfedge. -*/ -void set_halfedge (Halfedge* e); +sets the incident halfedge. +*/ +void set_halfedge (Halfedge* e); /*! -adds `e` as a hole inside `f`. -*/ -void add_hole (Halfedge* e); +adds `e` as a hole inside `f`. +*/ +void add_hole (Halfedge* e); /*! -removes the hole that `it` points to from inside `f`. -*/ -void erase_hole (Hole_iterator it); +removes the hole that `it` points to from inside `f`. +*/ +void erase_hole (Hole_iterator it); /*! -adds `v` as an isolated vertex inside `f`. -*/ -void add_isolated_vertex (Vertex* v); +adds `v` as an isolated vertex inside `f`. +*/ +void add_isolated_vertex (Vertex* v); /*! -removes the isolated vertex that `it` points to from inside `f`. -*/ -void erase_isolated_vertex (Isolated_vertex_iterator it); +removes the isolated vertex that `it` points to from inside `f`. +*/ +void erase_isolated_vertex (Isolated_vertex_iterator it); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h index 87d84acd8e9e..83083ef54997 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h @@ -3,85 +3,85 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -A halfedge record in a Dcel data structure. Two halfedges with opposite -directions always form an edge (a halfedge pair). The halfedges form together -chains, defining the boundaries of connected components, such that all -halfedges along a chain have the same incident face. Note that the chain the -halfedge belongs to may form the outer boundary of a bounded face (an outer -CCB) or the boundary of a hole inside a face (an inner CCB). - -An edge is always associated with a curve, but the halfedge records only -store a pointer to the associated curve, and the actual curve objects -are stored elsewhere. Two opposite halfedges are always associated with -the same curve. - -\sa `ArrangementDcel` -\sa `ArrangementDcelVertex` -\sa `ArrangementDcelFace` -\sa `ArrangementDcelHole` +A halfedge record in a Dcel data structure. Two halfedges with opposite +directions always form an edge (a halfedge pair). The halfedges form together +chains, defining the boundaries of connected components, such that all +halfedges along a chain have the same incident face. Note that the chain the +halfedge belongs to may form the outer boundary of a bounded face (an outer +CCB) or the boundary of a hole inside a face (an inner CCB). + +An edge is always associated with a curve, but the halfedge records only +store a pointer to the associated curve, and the actual curve objects +are stored elsewhere. Two opposite halfedges are always associated with +the same curve. + +\sa `ArrangementDcel` +\sa `ArrangementDcelVertex` +\sa `ArrangementDcelFace` +\sa `ArrangementDcelHole` */ class ArrangementDcelHalfedge { public: -/// \name Types +/// \name Types /// @{ /*! -the corresponding Dcel vertex type. -*/ -typedef unspecified_type Vertex; +the corresponding Dcel vertex type. +*/ +typedef unspecified_type Vertex; /*! -the corresponding Dcel face type. -*/ -typedef unspecified_type Face; +the corresponding Dcel face type. +*/ +typedef unspecified_type Face; /*! -the corresponding Dcel hole type. -*/ -typedef unspecified_type Hole; +the corresponding Dcel hole type. +*/ +typedef unspecified_type Hole; /*! -the curve type associated with the edge. -*/ -typedef unspecified_type X_monotone_curve; +the curve type associated with the edge. +*/ +typedef unspecified_type X_monotone_curve; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_dcel_halfedge(); +default constructor. +*/ +Arr_dcel_halfedge(); /*! -assigns `e` with the contents of the `other` halfedge. -*/ -void assign (const Self& other); +assigns `e` with the contents of the `other` halfedge. +*/ +void assign (const Self& other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns `ARR_LEFT_TO_RIGHT` if `e`'s source vertex is -lexicographically smaller than it target, and -`ARR_RIGHT_TO_LEFT` if it is lexicographically larger than -the target. -*/ -Arr_halfedge_direction direction() const; +returns `ARR_LEFT_TO_RIGHT` if `e`'s source vertex is +lexicographically smaller than it target, and +`ARR_RIGHT_TO_LEFT` if it is lexicographically larger than +the target. +*/ +Arr_halfedge_direction direction() const; /*! -determines whether the `e` lies on an outer CCB of a bounded face, -or on an inner CCB (a hole inside a face). The function returns `true` -if `e` lies on a hole. -*/ -bool is_on_hole() const; +determines whether the `e` lies on an outer CCB of a bounded face, +or on an inner CCB (a hole inside a face). The function returns `true` +if `e` lies on a hole. +*/ +bool is_on_hole() const; /// @} @@ -90,98 +90,98 @@ bool is_on_hole() const; /// @{ /*! -returns the twin halfedge. -*/ -Halfedge* opposite(); +returns the twin halfedge. +*/ +Halfedge* opposite(); /*! -returns the previous halfedge along the chain. -*/ -Halfedge* prev(); +returns the previous halfedge along the chain. +*/ +Halfedge* prev(); /*! -returns the next halfedge along the chain. -*/ -Halfedge* next(); +returns the next halfedge along the chain. +*/ +Halfedge* next(); /*! -returns the target vertex. -*/ -Vertex* vertex(); +returns the target vertex. +*/ +Vertex* vertex(); /*! -returns the incident face. -\pre `e` lies on the outer boundary of this face. -*/ -Face* face(); +returns the incident face. +\pre `e` lies on the outer boundary of this face. +*/ +Face* face(); /*! -returns the hole (inner CCB) `e` belongs to. -\pre `e` lies on a hole inside its incident face. -*/ -Hole* hole(); +returns the hole (inner CCB) `e` belongs to. +\pre `e` lies on a hole inside its incident face. +*/ +Hole* hole(); /*! -returns whether the vertex is not associated with a valid curve. -*/ -bool has_null_curve() const; +returns whether the vertex is not associated with a valid curve. +*/ +bool has_null_curve() const; /*! -returns the associated curve. -\pre `e` is associated with a valid curve. -*/ -X_monotone_curve& curve(); +returns the associated curve. +\pre `e` is associated with a valid curve. +*/ +X_monotone_curve& curve(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the opposite halfedge. -*/ -void set_opposite (Halfedge* opp); +sets the opposite halfedge. +*/ +void set_opposite (Halfedge* opp); /*! -sets the lexicographical order between `e`'s source and target -vertices to be `dir`. -The direction of the opposite halfedge is also set to the -opposite direction. -*/ -void set_direction (Arr_halfedge_direction dir); +sets the lexicographical order between `e`'s source and target +vertices to be `dir`. +The direction of the opposite halfedge is also set to the +opposite direction. +*/ +void set_direction (Arr_halfedge_direction dir); /*! -sets the previous halfedge of `e` along the chain, -and updates the cross-pointer `prev->next()`. -*/ -void set_prev (Halfedge* prev); +sets the previous halfedge of `e` along the chain, +and updates the cross-pointer `prev->next()`. +*/ +void set_prev (Halfedge* prev); /*! -sets the next halfedge of `e` along the chain, -and updates the cross-pointer `next->prev()`. -*/ -void set_next (Halfedge* next); +sets the next halfedge of `e` along the chain, +and updates the cross-pointer `next->prev()`. +*/ +void set_next (Halfedge* next); /*! -sets the target vertex. -*/ -void set_vertex (Vertex* v); +sets the target vertex. +*/ +void set_vertex (Vertex* v); /*! -sets the incident face, marking that `e` lies on the outer CCB -of the face `f`. -*/ -void set_face (Face* f); +sets the incident face, marking that `e` lies on the outer CCB +of the face `f`. +*/ +void set_face (Face* f); /*! -sets the incident hole, marking that `e` lies on an inner CCB. -*/ -void set_hole (Hole* ho); +sets the incident hole, marking that `e` lies on an inner CCB. +*/ +void set_hole (Hole* ho); /*! -sets the associated curve of `e` and its opposite halfedge. -*/ -void set_curve (X_monotone_curve* c); +sets the associated curve of `e` and its opposite halfedge. +*/ +void set_curve (X_monotone_curve* c); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h index 9e629686a6cd..9b2b7563a29b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h @@ -3,71 +3,71 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -A hole record in a Dcel data structure, which stores the face that contains -the hole in its interior, along with an iterator for the hole in the holes' -container of this face. +A hole record in a Dcel data structure, which stores the face that contains +the hole in its interior, along with an iterator for the hole in the holes' +container of this face. -\sa `ArrangementDcel` -\sa `ArrangementDcelFace` +\sa `ArrangementDcel` +\sa `ArrangementDcelFace` */ class ArrangementDcelHole { public: -/// \name Types +/// \name Types /// @{ /*! -the corresponding Dcel face type. -*/ -typedef unspecified_type Face; +the corresponding Dcel face type. +*/ +typedef unspecified_type Face; /*! -*/ -typedef Face::Hole_iterator Hole_iterator; +*/ +typedef Face::Hole_iterator Hole_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_dcel_hole(); +default constructor. +*/ +Arr_dcel_hole(); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// All functions below also have `const` counterparts, returning non-mutable pointers or iterators: /// @{ /*! -returns the incident face, which contains `ho` in its interior. -*/ -Face* face (); +returns the incident face, which contains `ho` in its interior. +*/ +Face* face (); /*! -returns an iterator for the hole. -*/ -Hole_iterator iterator(); +returns an iterator for the hole. +*/ +Hole_iterator iterator(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the incident face. -*/ -void set_face (Face* f); +sets the incident face. +*/ +void set_face (Face* f); /*! -sets the hole iterator. -*/ -void set_iterator (Hole_iterator it); +sets the hole iterator. +*/ +void set_iterator (Hole_iterator it); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h index 8d0a84e227d2..c0665b13bc46 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h @@ -3,73 +3,73 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -An isolated vertex-information record in a Dcel data structure, which stores -the face that contains the isolated vertex in its interior, along with an -iterator for the isolated vertex in the isolated vertices' container of this -face. +An isolated vertex-information record in a Dcel data structure, which stores +the face that contains the isolated vertex in its interior, along with an +iterator for the isolated vertex in the isolated vertices' container of this +face. -\sa `ArrangementDcel` -\sa `ArrangementDcelFace` +\sa `ArrangementDcel` +\sa `ArrangementDcelFace` */ class ArrangementDcelIsolatedVertex { public: -/// \name Types +/// \name Types /// @{ /*! -the corresponding Dcel face type. -*/ -typedef unspecified_type Face; +the corresponding Dcel face type. +*/ +typedef unspecified_type Face; /*! -*/ -typedef Face::Isolated_vertex_iterator Isolated_vertex_iterator; +*/ +typedef Face::Isolated_vertex_iterator Isolated_vertex_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_dcel_isolated_vertex(); +default constructor. +*/ +Arr_dcel_isolated_vertex(); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// All functions below also have `const` counterparts, returning /// non-mutable pointers or iterators: /// @{ /*! -returns the incident face, which contains `iv` in its interior. -*/ -Face* face (); +returns the incident face, which contains `iv` in its interior. +*/ +Face* face (); /*! -returns an iterator for the isolated vertex. -*/ -Isolated_vertex_iterator iterator(); +returns an iterator for the isolated vertex. +*/ +Isolated_vertex_iterator iterator(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the incident face. -*/ -void set_face (Face* f); +sets the incident face. +*/ +void set_face (Face* f); /*! -sets the isolated vertex iterator. -*/ -void set_iterator (Isolated_vertex_iterator it); +sets the isolated vertex iterator. +*/ +void set_iterator (Isolated_vertex_iterator it); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h index a78a11eb1a2b..f837d8ee00f6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h @@ -3,136 +3,136 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -A vertex record in a Dcel data structure. A vertex is always associated -with a point. However, the vertex record only stores a pointer to the -associated point, and the actual `Point` object is stored elsewhere. +A vertex record in a Dcel data structure. A vertex is always associated +with a point. However, the vertex record only stores a pointer to the +associated point, and the actual `Point` object is stored elsewhere. -A vertex usually has several halfedges incident to it, such that it is -possible to access one of these halfedges directly and to traverse all -incident halfedges around the vertex. However, the Dcel may also contain -isolated vertices that have no incident halfedges. In this case, the vertex -stores an isolated vertex-information record, indicating the face that -contains this vertex in its interior. +A vertex usually has several halfedges incident to it, such that it is +possible to access one of these halfedges directly and to traverse all +incident halfedges around the vertex. However, the Dcel may also contain +isolated vertices that have no incident halfedges. In this case, the vertex +stores an isolated vertex-information record, indicating the face that +contains this vertex in its interior. -\sa `ArrangementDcel` -\sa `ArrangementDcelHalfedge` -\sa `ArrangementDcelIsolatedVertex` +\sa `ArrangementDcel` +\sa `ArrangementDcelHalfedge` +\sa `ArrangementDcelIsolatedVertex` */ class ArrangementDcelVertex { public: -/// \name Types +/// \name Types /// @{ /*! -the corresponding Dcel halfedge type. -*/ -typedef unspecified_type Halfedge; +the corresponding Dcel halfedge type. +*/ +typedef unspecified_type Halfedge; /*! -the corresponding Dcel isolated -vertex-information type. -*/ -typedef unspecified_type Isolated_vertex; +the corresponding Dcel isolated +vertex-information type. +*/ +typedef unspecified_type Isolated_vertex; /*! -the point type associated with the vertex. -*/ -typedef unspecified_type Point; +the point type associated with the vertex. +*/ +typedef unspecified_type Point; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_dcel_vertex(); +default constructor. +*/ +Arr_dcel_vertex(); /*! -assigns `v` with the contents of the `other` vertex. -*/ -void assign (const Self& other); +assigns `v` with the contents of the `other` vertex. +*/ +void assign (const Self& other); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// All functions below also have `const` counterparts, returning /// non-mutable pointers or references: /// @{ /*! -returns whether the vertex is isolated (has no incident halfedges). -*/ -bool is_isolated() const; +returns whether the vertex is isolated (has no incident halfedges). +*/ +bool is_isolated() const; /*! -returns an incident halfedge that has `v` as its target. -\pre `v` is not an isolated vertex. -*/ -Halfedge* halfedge(); +returns an incident halfedge that has `v` as its target. +\pre `v` is not an isolated vertex. +*/ +Halfedge* halfedge(); /*! -returns the isolated vertex-information record. -\pre `v` is an isolated vertex. -*/ -Isolated_vertex* isolated_vertex(); +returns the isolated vertex-information record. +\pre `v` is an isolated vertex. +*/ +Isolated_vertex* isolated_vertex(); /*! -returns whether the vertex is not associated with a valid point (i.e.\ it -lies at infinity). -*/ -bool has_null_point () const; +returns whether the vertex is not associated with a valid point (i.e.\ it +lies at infinity). +*/ +bool has_null_point () const; /*! -returns the associated point. -\pre `v`() is associated with a valid point. -*/ -Point& point(); +returns the associated point. +\pre `v`() is associated with a valid point. +*/ +Point& point(); /*! -returns the placement of the \f$ x\f$-coordinate in the parameter space, -that is, either the left boundary-side, the interior, or the right -boundary-side. -*/ -Arr_parameter_space parameter_space_in_x () const; +returns the placement of the \f$ x\f$-coordinate in the parameter space, +that is, either the left boundary-side, the interior, or the right +boundary-side. +*/ +Arr_parameter_space parameter_space_in_x () const; /*! -returns the placement of the \f$ y\f$-coordinate in the parameter space, -that is, either the bottom boundary-side, the interior, or the top -boundary-side. -*/ -Arr_parameter_space parameter_space_in_y () const; +returns the placement of the \f$ y\f$-coordinate in the parameter space, +that is, either the bottom boundary-side, the interior, or the top +boundary-side. +*/ +Arr_parameter_space parameter_space_in_y () const; -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -sets the incident halfedge, marking `v` as a regular vertex. -*/ -void set_halfedge (Halfedge* e); +sets the incident halfedge, marking `v` as a regular vertex. +*/ +void set_halfedge (Halfedge* e); /*! -sets the isolated vertex-information record, marking `v` -as an isolated vertex. -*/ -void set_isolated_vertex (Isolated_vertex* iv); +sets the isolated vertex-information record, marking `v` +as an isolated vertex. +*/ +void set_isolated_vertex (Isolated_vertex* iv); /*! -sets the associated point. -*/ -void set_point (Point* p); +sets the associated point. +*/ +void set_point (Point* p); /*! -sets `v` as a vertex on a boundary side. -\pre Either `inf_x` or `inf_y` is not `ARR_INTERIOR`. -*/ -void set_boundary (Arr_parameter_space inf_x, Arr_parameter_space inf_y); +sets `v` as a vertex on a boundary side. +\pre Either `inf_x` or `inf_y` is not `ARR_INTERIOR`. +*/ +void set_boundary (Arr_parameter_space inf_x, Arr_parameter_space inf_y); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h index fa8b7abdae54..da1306eba609 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h @@ -3,45 +3,45 @@ \ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept -The concept `ArrangementDcelWithRebind` refines the `ArrangementDcel` concept by adding -a policy clone idiom in form of a rebind struct-template. +The concept `ArrangementDcelWithRebind` refines the `ArrangementDcel` concept by adding +a policy clone idiom in form of a rebind struct-template. -Instantiate a dcel class with many different possible types without ad-hoc limitations on type of the dcel classes. +Instantiate a dcel class with many different possible types without ad-hoc limitations on type of the dcel classes. -\cgalRefines `ArrangementDcel` +\cgalRefines `ArrangementDcel` -\cgalHasModel `CGAL::Arr_default_dcel` -\cgalHasModel `CGAL::Arr_face_extended_dcel` -\cgalHasModel `CGAL::Arr_extended_dcel` +\cgalHasModel `CGAL::Arr_default_dcel` +\cgalHasModel `CGAL::Arr_face_extended_dcel` +\cgalHasModel `CGAL::Arr_extended_dcel` */ class ArrangementDcelWithRebind { public: -/// \name Types +/// \name Types /// @{ /*! -allows the instantiation of a model of the base concept -`ArrangementDcel` with a different possible geometry-traits -class without ad-hoc limitations on it. +allows the instantiation of a model of the base concept +`ArrangementDcel` with a different possible geometry-traits +class without ad-hoc limitations on it. -Following the standard clone policy, the rebind struct-template must -have a nested type named `other` that defines the type of the -model replica. -*/ -typedef unspecified_type template rebind; +Following the standard clone policy, the rebind struct-template must +have a nested type named `other` that defines the type of the +model replica. +*/ +typedef unspecified_type template rebind; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -constructs an empty Dcel with one unbouned face. -*/ -Arr_dcel(); +constructs an empty Dcel with one unbouned face. +*/ +Arr_dcel(); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h index e39ee8c95e5c..0f81d72c079d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h @@ -3,255 +3,255 @@ \ingroup PkgArrangementOnSurface2Concepts \cgalConcept -A model for the `ArrangementInputFormatter` concept supports a set of functions that enable -reading an arrangement from an input stream using a specific format. +A model for the `ArrangementInputFormatter` concept supports a set of functions that enable +reading an arrangement from an input stream using a specific format. -\cgalHasModel `CGAL::Arr_text_formatter` -\cgalHasModel `CGAL::Arr_face_extended_text_formatter` -\cgalHasModel `CGAL::Arr_extended_dcel_text_formatter` +\cgalHasModel `CGAL::Arr_text_formatter` +\cgalHasModel `CGAL::Arr_face_extended_text_formatter` +\cgalHasModel `CGAL::Arr_extended_dcel_text_formatter` */ class ArrangementInputFormatter { public: -/// \name Types +/// \name Types /// @{ /*! -the type of arrangement to input. -*/ -typedef unspecified_type Arrangement_2; +the type of arrangement to input. +*/ +typedef unspecified_type Arrangement_2; /*! -the point type. -*/ -typedef typename Arrangement_2::Point_2 Point_2; +the point type. +*/ +typedef typename Arrangement_2::Point_2 Point_2; /*! -the \f$ x\f$-monotone curve type. -*/ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; +the \f$ x\f$-monotone curve type. +*/ +typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; /*! -*/ -typedef typename Arrangement_2::Size Size; +*/ +typedef typename Arrangement_2::Size Size; /*! -*/ -typedef typename Arrangement_2::Vertex_handle Vertex_handle; +*/ +typedef typename Arrangement_2::Vertex_handle Vertex_handle; /*! -*/ -typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; +*/ +typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; /*! -*/ -typedef typename Arrangement_2::Face_handle Face_handle; +*/ +typedef typename Arrangement_2::Face_handle Face_handle; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_in_formatter(); +default constructor. +*/ +Arr_in_formatter(); /*! -constructs a formatter that reads from `is`. -*/ -Arr_in_formatter (std::istream& is); +constructs a formatter that reads from `is`. +*/ +Arr_in_formatter (std::istream& is); /*! -directs `inf` to read from `is`. -*/ -void set_in (std::istream& is); +directs `inf` to read from `is`. +*/ +void set_in (std::istream& is); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the stream that `inf` reads from. -\pre `inf` is directed to a valid output stream. -*/ -std::istream& in (); +returns the stream that `inf` reads from. +\pre `inf` is directed to a valid output stream. +*/ +std::istream& in (); -/// @} +/// @} -/// \name Formatted Input Functions +/// \name Formatted Input Functions /// @{ /*! -reads a message indicating the beginning of the arrangement. -*/ -void read_arrangement_begin (); +reads a message indicating the beginning of the arrangement. +*/ +void read_arrangement_begin (); /*! -reads a message indicating the end of the arrangement. -*/ -void read_arrangement_end (); +reads a message indicating the end of the arrangement. +*/ +void read_arrangement_end (); /*! -reads a size value, which is supposed to be preceded by the given label. -*/ -Size read_size (const char *label = nullptr); +reads a size value, which is supposed to be preceded by the given label. +*/ +Size read_size (const char *label = nullptr); /*! -reads a message indicating the beginning of the vertex records. -*/ -void read_vertices_begin(); +reads a message indicating the beginning of the vertex records. +*/ +void read_vertices_begin(); /*! -reads a message indicating the end of the vertex records. -*/ -void read_vertices_end(); +reads a message indicating the end of the vertex records. +*/ +void read_vertices_end(); /*! -reads a message indicating the beginning of the edge records. -*/ -void read_edges_begin(); +reads a message indicating the beginning of the edge records. +*/ +void read_edges_begin(); /*! -reads a message indicating the end of the edge records. -*/ -void read_edges_end(); +reads a message indicating the end of the edge records. +*/ +void read_edges_end(); /*! -reads a message indicating the beginning of the face records. -*/ -void read_faces_begin(); +reads a message indicating the beginning of the face records. +*/ +void read_faces_begin(); /*! -reads a message indicating the end of the face records. -*/ -void read_faces_end(); +reads a message indicating the end of the face records. +*/ +void read_faces_end(); /*! -reads a message indicating the beginning of a single vertex record. -*/ -void read_vertex_begin(); +reads a message indicating the beginning of a single vertex record. +*/ +void read_vertex_begin(); /*! -reads a message indicating the end of a single vertex record. -*/ -void read_vertex_end(); +reads a message indicating the end of a single vertex record. +*/ +void read_vertex_end(); /*! -reads and returns a vertex index. -*/ -std::size_t read_vertex_index (); +reads and returns a vertex index. +*/ +std::size_t read_vertex_index (); /*! -reads a point. -*/ -void read_point (Point_2& p); +reads a point. +*/ +void read_point (Point_2& p); /*! -reads an auxiliary vertex-data object and associates it with the vertex `v`. -*/ -void read_vertex_data (Vertex_handle v); +reads an auxiliary vertex-data object and associates it with the vertex `v`. +*/ +void read_vertex_data (Vertex_handle v); /*! -reads a message indicating the beginning of a single edge record. -*/ -void read_edge_begin(); +reads a message indicating the beginning of a single edge record. +*/ +void read_edge_begin(); /*! -reads a message indicating the end of a single edge record. -*/ -void read_edge_end(); +reads a message indicating the end of a single edge record. +*/ +void read_edge_end(); /*! -reads and returns halfedge index. -*/ -std::size_t read_halfedge_index (); +reads and returns halfedge index. +*/ +std::size_t read_halfedge_index (); /*! -reads an \f$ x\f$-monotone curve. -*/ -void read_x_monotone_curve (X_monotone_curve_2& c); +reads an \f$ x\f$-monotone curve. +*/ +void read_x_monotone_curve (X_monotone_curve_2& c); /*! -reads an auxiliary halfedge-data object and associates it with the halfedge `he`. -*/ -void read_halfegde_data (Halfedge_handle he); +reads an auxiliary halfedge-data object and associates it with the halfedge `he`. +*/ +void read_halfegde_data (Halfedge_handle he); /*! -reads a message indicating the beginning of a single face record. -*/ -void read_face_begin(); +reads a message indicating the beginning of a single face record. +*/ +void read_face_begin(); /*! -reads a message indicating the end of a single face record. -*/ -void read_face_end(); +reads a message indicating the end of a single face record. +*/ +void read_face_end(); /*! -reads a message indicating the beginning of the outer CCB of the current face. -*/ -void read_outer_ccb_begin(); +reads a message indicating the beginning of the outer CCB of the current face. +*/ +void read_outer_ccb_begin(); /*! -reads a message indicating the end of the outer CCB of the current face. -*/ -void read_outer_ccb_end(); +reads a message indicating the end of the outer CCB of the current face. +*/ +void read_outer_ccb_end(); /*! -reads a message indicating the beginning of the container of holes inside the -current face. -*/ -void read_holes_begin(); +reads a message indicating the beginning of the container of holes inside the +current face. +*/ +void read_holes_begin(); /*! -reads a message indicating the end of the container of holes inside the -current face. -*/ -void read_holes_end(); +reads a message indicating the end of the container of holes inside the +current face. +*/ +void read_holes_end(); /*! -reads a message indicating the beginning of an inner CCB of the current face. -*/ -void read_inner_ccb_begin(); +reads a message indicating the beginning of an inner CCB of the current face. +*/ +void read_inner_ccb_begin(); /*! -reads a message indicating the end of an inner CCB of the current face. -*/ -void read_inner_ccb_end(); +reads a message indicating the end of an inner CCB of the current face. +*/ +void read_inner_ccb_end(); /*! -reads a message indicating the beginning a connected component boundary. -*/ -void read_ccb_halfedges_begin(); +reads a message indicating the beginning a connected component boundary. +*/ +void read_ccb_halfedges_begin(); /*! -reads a message indicating the end of a connected component boundary. -*/ -void read_ccb_halfedges_end(); +reads a message indicating the end of a connected component boundary. +*/ +void read_ccb_halfedges_end(); /*! -reads a message indicating the beginning of the container of isolated vertices -inside the current face. -*/ -void read_isolated_vertices_begin(); +reads a message indicating the beginning of the container of isolated vertices +inside the current face. +*/ +void read_isolated_vertices_begin(); /*! -reads a message indicating the end of the container of isolated vertices inside -the current face. -*/ -void read_isolated_vertices_end(); +reads a message indicating the end of the container of isolated vertices inside +the current face. +*/ +void read_isolated_vertices_end(); /*! -reads an auxiliary face-data object and associates it with the face `f`. -*/ -void read_face_data (Face_handle f); +reads an auxiliary face-data object and associates it with the face `f`. +*/ +void read_face_data (Face_handle f); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h index a1366fb094fd..3a2977d46bba 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h @@ -3,163 +3,163 @@ \ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept -Several predicates are required to handle \f$ x\f$-monotone curves that -approach infinity and thus approach the boundary of the parameter -space. These predicates are sufficient to handle not only curves -embedded in an unbounded parameter space, but also curves embedded -in a bounded parameter space with open boundaries. Models of the -concept `ArrangementOpenBoundaryTraits_2` handle curves that approach the boundary of a -parameter space. This concept refines the concept -`ArrangementBasicTraits_2`. The arrangement template -instantiated with a traits class that models this concept can handle -\f$ x\f$-monotone curves that are unbounded in any direction. The concept -`ArrangementOpenBoundaryTraits_2`, nontheless, also supports planar \f$ x\f$-monotone curves -that reach the boundary of an open yet bounded parameter space. - -An \f$ x\f$-monotone curve may be closed, in which case its endpoints -are representable as `Point_2` objects, or open at the -boundary of the parameter space. It can have one open end and one -closed end (e.g., a ray). The nature of the \f$ x\f$-monotone curves, -whether they are expected to be closed or not at any one of the four -boundary-sides, is conveyed through the definition of the four nested -types `Left_side_category`, `Right_side_category`, -`Bottom_side_category`, and `Top_side_category`. If some curves -handled by a model of the concept `ArrangementOpenBoundaryTraits_2` are expected to be open -on the left, the nested type `Left_side_category` must be convertible -to `CGAL::Arr_open_side_tag`. Similarly, if some curves handled by the -concept are expected to be open on the right, open at the bottom, or -open at the top, the corresponding nested type must be convertible to -`CGAL::Arr_open_side_tag`. A model of the concept `ArrangementOpenBoundaryTraits_2` must have -all the four categories convertible to -`CGAL::Arr_open_side_tag`.\cgalFootnote{We intend to introduce more concepts that require only a subset of the categories to be convertible to `Arr_open_side_tag`.} In this case the Dcel of the arrangement -instantiated with the model is initialized with an implicit bounding -rectangle. When the parameter space is bounded, it is the exact -geometric embedding of the implicit bounding rectangle. - -\cgalRefines `ArrangementBasicTraits_2` +Several predicates are required to handle \f$ x\f$-monotone curves that +approach infinity and thus approach the boundary of the parameter +space. These predicates are sufficient to handle not only curves +embedded in an unbounded parameter space, but also curves embedded +in a bounded parameter space with open boundaries. Models of the +concept `ArrangementOpenBoundaryTraits_2` handle curves that approach the boundary of a +parameter space. This concept refines the concept +`ArrangementBasicTraits_2`. The arrangement template +instantiated with a traits class that models this concept can handle +\f$ x\f$-monotone curves that are unbounded in any direction. The concept +`ArrangementOpenBoundaryTraits_2`, nontheless, also supports planar \f$ x\f$-monotone curves +that reach the boundary of an open yet bounded parameter space. + +An \f$ x\f$-monotone curve may be closed, in which case its endpoints +are representable as `Point_2` objects, or open at the +boundary of the parameter space. It can have one open end and one +closed end (e.g., a ray). The nature of the \f$ x\f$-monotone curves, +whether they are expected to be closed or not at any one of the four +boundary-sides, is conveyed through the definition of the four nested +types `Left_side_category`, `Right_side_category`, +`Bottom_side_category`, and `Top_side_category`. If some curves +handled by a model of the concept `ArrangementOpenBoundaryTraits_2` are expected to be open +on the left, the nested type `Left_side_category` must be convertible +to `CGAL::Arr_open_side_tag`. Similarly, if some curves handled by the +concept are expected to be open on the right, open at the bottom, or +open at the top, the corresponding nested type must be convertible to +`CGAL::Arr_open_side_tag`. A model of the concept `ArrangementOpenBoundaryTraits_2` must have +all the four categories convertible to +`CGAL::Arr_open_side_tag`.\cgalFootnote{We intend to introduce more concepts that require only a subset of the categories to be convertible to `Arr_open_side_tag`.} In this case the Dcel of the arrangement +instantiated with the model is initialized with an implicit bounding +rectangle. When the parameter space is bounded, it is the exact +geometric embedding of the implicit bounding rectangle. + +\cgalRefines `ArrangementBasicTraits_2` \cgalHasModel `CGAL::Arr_linear_traits_2` -\cgalHasModel `CGAL::Arr_rational_function_traits_2` -\cgalHasModel `CGAL::Arr_algebraic_segment_traits_2` -\cgalHasModel `CGAL::Arr_curve_data_traits_2` -\cgalHasModel `CGAL::Arr_consolidated_curve_data_traits_2` +\cgalHasModel `CGAL::Arr_rational_function_traits_2` +\cgalHasModel `CGAL::Arr_algebraic_segment_traits_2` +\cgalHasModel `CGAL::Arr_curve_data_traits_2` +\cgalHasModel `CGAL::Arr_consolidated_curve_data_traits_2` -\sa `ArrangementBasicTraits_2` -\sa `ArrangementXMonotoneTraits_2` -\sa `ArrangementLandmarkTraits_2` -\sa `ArrangementTraits_2` +\sa `ArrangementBasicTraits_2` +\sa `ArrangementXMonotoneTraits_2` +\sa `ArrangementLandmarkTraits_2` +\sa `ArrangementTraits_2` */ class ArrangementOpenBoundaryTraits_2 { public: -/// \name Categories +/// \name Categories /// @{ /*! -Must be convertible to either `CGAL::Arr_oblivious_side_tag` or -`CGAL::Arr_open_side_tag`. -*/ -typedef unspecified_type Left_side_category; +Must be convertible to either `CGAL::Arr_oblivious_side_tag` or +`CGAL::Arr_open_side_tag`. +*/ +typedef unspecified_type Left_side_category; /*! -Must be convertible to either `CGAL::Arr_oblivious_side_tag` or -`CGAL::Arr_open_side_tag`. -*/ -typedef unspecified_type Bottom_side_category; +Must be convertible to either `CGAL::Arr_oblivious_side_tag` or +`CGAL::Arr_open_side_tag`. +*/ +typedef unspecified_type Bottom_side_category; /*! -Must be convertible to either `CGAL::Arr_oblivious_side_tag` or -`CGAL::Arr_open_side_tag`. -*/ -typedef unspecified_type Top_side_category; +Must be convertible to either `CGAL::Arr_oblivious_side_tag` or +`CGAL::Arr_open_side_tag`. +*/ +typedef unspecified_type Top_side_category; /*! -Must be convertible to either `CGAL::Arr_oblivious_side_tag` or -`CGAL::Arr_open_side_tag`. -*/ -typedef unspecified_type Right_side_category; +Must be convertible to either `CGAL::Arr_oblivious_side_tag` or +`CGAL::Arr_open_side_tag`. +*/ +typedef unspecified_type Right_side_category; -/// @} +/// @} -/// \name Functor Types +/// \name Functor Types /// @{ /*! -models the concept `ArrTraits::ParameterSpaceInX_2`. -Required only if the traits class supports unbounded curves that -approach the left or the right sides (the `Left_side_category` -or the `Right_side_category` categories are convertible to -`CGAL::Arr_open_side_tag`). -*/ -typedef unspecified_type Parameter_space_in_x_2; +models the concept `ArrTraits::ParameterSpaceInX_2`. +Required only if the traits class supports unbounded curves that +approach the left or the right sides (the `Left_side_category` +or the `Right_side_category` categories are convertible to +`CGAL::Arr_open_side_tag`). +*/ +typedef unspecified_type Parameter_space_in_x_2; /*! -models the concept `ArrTraits::CompareYNearBoundary_2`. -Required only if the traits class supports unbounded curves that -approach the left or the right sides (the `Left_side_category` -or the `Right_side_category` categories are convertible to -`CGAL::Arr_open_side_tag`). -*/ -typedef unspecified_type Compare_y_near_boundary_2; +models the concept `ArrTraits::CompareYNearBoundary_2`. +Required only if the traits class supports unbounded curves that +approach the left or the right sides (the `Left_side_category` +or the `Right_side_category` categories are convertible to +`CGAL::Arr_open_side_tag`). +*/ +typedef unspecified_type Compare_y_near_boundary_2; /*! -models the concept `ArrTraits::ParameterSpaceInY_2`. -Required only if the traits class supports unbounded curves that -approach the bottom or the top sides (the `Bottom_side_category` -or the `Top_side_category` categories are convertible to -`CGAL::Arr_open_side_tag`). -*/ -typedef unspecified_type Parameter_space_in_y_2; +models the concept `ArrTraits::ParameterSpaceInY_2`. +Required only if the traits class supports unbounded curves that +approach the bottom or the top sides (the `Bottom_side_category` +or the `Top_side_category` categories are convertible to +`CGAL::Arr_open_side_tag`). +*/ +typedef unspecified_type Parameter_space_in_y_2; /*! -models the concept `ArrTraits::CompareXAtLimit_2`. -Required only if the traits class supports unbounded curves that -approach the bottom or the top sides (the `Bottom_side_category` -or the `Top_side_category` categories are convertible to -`CGAL::Arr_open_side_tag`). -*/ -typedef unspecified_type Compare_x_at_limit_2; +models the concept `ArrTraits::CompareXAtLimit_2`. +Required only if the traits class supports unbounded curves that +approach the bottom or the top sides (the `Bottom_side_category` +or the `Top_side_category` categories are convertible to +`CGAL::Arr_open_side_tag`). +*/ +typedef unspecified_type Compare_x_at_limit_2; /*! -models the concept `ArrTraits::CompareXNearLimit_2`. -Required only if the traits class supports unbounded curves that -approach the bottom or the top sides (the `Bottom_side_category` -or the `Top_side_category` categories are convertible to -`CGAL::Arr_open_side_tag`). -*/ -typedef unspecified_type Compare_x_near_limit_2; +models the concept `ArrTraits::CompareXNearLimit_2`. +Required only if the traits class supports unbounded curves that +approach the bottom or the top sides (the `Bottom_side_category` +or the `Top_side_category` categories are convertible to +`CGAL::Arr_open_side_tag`). +*/ +typedef unspecified_type Compare_x_near_limit_2; -/// @} +/// @} -/// \name Accessing Functor Objects +/// \name Accessing Functor Objects /// @{ /*! -*/ -Parameter_space_in_x_2 parameter_space_in_x_2_object() const; +*/ +Parameter_space_in_x_2 parameter_space_in_x_2_object() const; /*! -*/ -Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const; +*/ +Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const; /*! -*/ -Parameter_space_in_y_2 parameter_space_in_y_2_object() const; +*/ +Parameter_space_in_y_2 parameter_space_in_y_2_object() const; /*! -*/ -Compare_x_at_limit_2 compare_x_at_limit_2_object() const; +*/ +Compare_x_at_limit_2 compare_x_at_limit_2_object() const; /*! -*/ -Compare_x_near_limit_2 compare_x_near_limit_2_object() const; +*/ +Compare_x_near_limit_2 compare_x_near_limit_2_object() const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h index 032065377183..80a41f1e98ec 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h @@ -3,245 +3,245 @@ \ingroup PkgArrangementOnSurface2Concepts \cgalConcept -A model for the `ArrangementOutputFormatter` concept supports a set of functions that enable -writing an arrangement to an output stream using a specific format. +A model for the `ArrangementOutputFormatter` concept supports a set of functions that enable +writing an arrangement to an output stream using a specific format. -\cgalHasModel `CGAL::Arr_text_formatter` -\cgalHasModel `CGAL::Arr_face_extended_text_formatter` -\cgalHasModel `CGAL::Arr_extended_dcel_text_formatter` +\cgalHasModel `CGAL::Arr_text_formatter` +\cgalHasModel `CGAL::Arr_face_extended_text_formatter` +\cgalHasModel `CGAL::Arr_extended_dcel_text_formatter` */ class ArrangementOutputFormatter { public: -/// \name Types +/// \name Types /// @{ /*! -the type of arrangement to output. -*/ -typedef unspecified_type Arrangement_2; +the type of arrangement to output. +*/ +typedef unspecified_type Arrangement_2; /*! -the point type. -*/ -typedef typename Arrangement_2::Point_2 Point_2; +the point type. +*/ +typedef typename Arrangement_2::Point_2 Point_2; /*! -the \f$ x\f$-monotone curve type. -*/ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; +the \f$ x\f$-monotone curve type. +*/ +typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; /*! -*/ -typedef typename Arrangement_2::Size Size; +*/ +typedef typename Arrangement_2::Size Size; /*! -*/ -typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; +*/ +typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; /*! -*/ -typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; +*/ +typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; /*! -*/ -typedef typename Arrangement_2::Face_const_handle Face_const_handle; +*/ +typedef typename Arrangement_2::Face_const_handle Face_const_handle; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -Arr_out_formatter(); +default constructor. +*/ +Arr_out_formatter(); /*! -constructs a formatter that writes to `os`. -*/ -Arr_out_formatter (std::ostream& os); +constructs a formatter that writes to `os`. +*/ +Arr_out_formatter (std::ostream& os); /*! -directs `outf` to write to `os`. -*/ -void set_out (std::ostream& os); +directs `outf` to write to `os`. +*/ +void set_out (std::ostream& os); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the stream that `outf` writes to. -\pre `outf` is directed to a valid output stream. -*/ -std::ostream& out (); +returns the stream that `outf` writes to. +\pre `outf` is directed to a valid output stream. +*/ +std::ostream& out (); -/// @} +/// @} -/// \name Formatted Output Functions +/// \name Formatted Output Functions /// @{ /*! -writes a message indicating the beginning of the arrangement. -*/ -void write_arrangement_begin (); +writes a message indicating the beginning of the arrangement. +*/ +void write_arrangement_begin (); /*! -writes a message indicating the end of the arrangement. -*/ -void write_arrangement_end (); +writes a message indicating the end of the arrangement. +*/ +void write_arrangement_end (); /*! -writes a size value, preceded by a given label. -*/ -void write_size (const char *label, Size size); +writes a size value, preceded by a given label. +*/ +void write_size (const char *label, Size size); /*! -writes a message indicating the beginning of the vertex records. -*/ -void write_vertices_begin(); +writes a message indicating the beginning of the vertex records. +*/ +void write_vertices_begin(); /*! -writes a message indicating the end of the vertex records. -*/ -void write_vertices_end(); +writes a message indicating the end of the vertex records. +*/ +void write_vertices_end(); /*! -writes a message indicating the beginning of the edge records. -*/ -void write_edges_begin(); +writes a message indicating the beginning of the edge records. +*/ +void write_edges_begin(); /*! -writes a message indicating the end of the edge records. -*/ -void write_edges_end(); +writes a message indicating the end of the edge records. +*/ +void write_edges_end(); /*! -writes a message indicating the beginning of the face records. -*/ -void write_faces_begin(); +writes a message indicating the beginning of the face records. +*/ +void write_faces_begin(); /*! -writes a message indicating the end of the face records. -*/ -void write_faces_end(); +writes a message indicating the end of the face records. +*/ +void write_faces_end(); /*! -writes a message indicating the beginning of a single vertex record. -*/ -void write_vertex_begin(); +writes a message indicating the beginning of a single vertex record. +*/ +void write_vertex_begin(); /*! -writes a message indicating the end of a single vertex record. -*/ -void write_vertex_end(); +writes a message indicating the end of a single vertex record. +*/ +void write_vertex_end(); /*! -writes a vertex index. -*/ -void write_vertex_index (std::size_t idx); +writes a vertex index. +*/ +void write_vertex_index (std::size_t idx); /*! -writes a point. -*/ -void write_point (const Point_2& p); +writes a point. +*/ +void write_point (const Point_2& p); /*! -writes the auxiliary data associated with the vertex. -*/ -void write_vertex_data (Vertex_const_handle v); +writes the auxiliary data associated with the vertex. +*/ +void write_vertex_data (Vertex_const_handle v); /*! -writes a message indicating the beginning of a single edge record. -*/ -void write_edge_begin(); +writes a message indicating the beginning of a single edge record. +*/ +void write_edge_begin(); /*! -writes a message indicating the end of a single edge record. -*/ -void write_edge_end(); +writes a message indicating the end of a single edge record. +*/ +void write_edge_end(); /*! -writes a halfedge index. -*/ -void write_halfedge_index (std::size_t idx); +writes a halfedge index. +*/ +void write_halfedge_index (std::size_t idx); /*! -writes an \f$ x\f$-monotone curve. -*/ -void write_x_monotone_curve (const X_monotone_curve_2& c); +writes an \f$ x\f$-monotone curve. +*/ +void write_x_monotone_curve (const X_monotone_curve_2& c); /*! -writes the auxiliary data associated with the halfedge. -*/ -void write_halfegde_data (Halfedge_const_handle he); +writes the auxiliary data associated with the halfedge. +*/ +void write_halfegde_data (Halfedge_const_handle he); /*! -writes a message indicating the beginning of a single face record. -*/ -void write_face_begin(); +writes a message indicating the beginning of a single face record. +*/ +void write_face_begin(); /*! -writes a message indicating the end of a single face record. -*/ -void write_face_end(); +writes a message indicating the end of a single face record. +*/ +void write_face_end(); /*! -writes a message indicating the beginning of the outer CCB of the current face. -*/ -void write_outer_ccb_begin(); +writes a message indicating the beginning of the outer CCB of the current face. +*/ +void write_outer_ccb_begin(); /*! -writes a message indicating the end of the outer CCB of the current face. -*/ -void write_outer_ccb_end(); +writes a message indicating the end of the outer CCB of the current face. +*/ +void write_outer_ccb_end(); /*! -writes a message indicating the beginning of the container of holes inside the -current face. -*/ -void write_holes_begin(); +writes a message indicating the beginning of the container of holes inside the +current face. +*/ +void write_holes_begin(); /*! -writes a message indicating the end of the container of holes inside the -current face. -*/ -void write_holes_end(); +writes a message indicating the end of the container of holes inside the +current face. +*/ +void write_holes_end(); /*! -writes a message indicating the beginning a connected component's boundary. -*/ -void write_ccb_halfedges_begin(); +writes a message indicating the beginning a connected component's boundary. +*/ +void write_ccb_halfedges_begin(); /*! -writes a message indicating the end of a connected component's boundary. -*/ -void write_ccb_halfedges_end(); +writes a message indicating the end of a connected component's boundary. +*/ +void write_ccb_halfedges_end(); /*! -writes a message indicating the beginning of the container of isolated vertices -inside the current face. -*/ -void write_isolated_vertices_begin(); +writes a message indicating the beginning of the container of isolated vertices +inside the current face. +*/ +void write_isolated_vertices_begin(); /*! -writes a message indicating the end of the container of isolated vertices inside -the current face. -*/ -void write_isolated_vertices_end(); +writes a message indicating the end of the container of isolated vertices inside +the current face. +*/ +void write_isolated_vertices_end(); /*! -writes the auxiliary data associated with the face. -*/ -void write_face_data (Face_const_handle f); +writes the auxiliary data associated with the face. +*/ +void write_face_data (Face_const_handle f); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h index 1dbaba871b86..c2f6a0437f2c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h @@ -20,10 +20,10 @@ the old style without any overhead, the macro `CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any \cgal header is included. -\cgalHasModel `CGAL::Arr_naive_point_location` -\cgalHasModel `CGAL::Arr_walk_along_line_point_location` -\cgalHasModel `CGAL::Arr_trapezoid_ric_point_location` -\cgalHasModel `CGAL::Arr_landmarks_point_location` +\cgalHasModel `CGAL::Arr_naive_point_location` +\cgalHasModel `CGAL::Arr_walk_along_line_point_location` +\cgalHasModel `CGAL::Arr_trapezoid_ric_point_location` +\cgalHasModel `CGAL::Arr_landmarks_point_location` \sa `CGAL::Arr_naive_point_location` \sa `CGAL::Arr_walk_along_line_point_location` @@ -37,71 +37,71 @@ the old style without any overhead, the macro class ArrangementPointLocation_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the associated arrangement type. -*/ -typedef unspecified_type Arrangement_2; +the associated arrangement type. +*/ +typedef unspecified_type Arrangement_2; /*! -equivalent to `Arrangement_2::Point_2`. -*/ -typedef unspecified_type Point_2; +equivalent to `Arrangement_2::Point_2`. +*/ +typedef unspecified_type Point_2; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -ArrangementPointLocation_2(); +default constructor. +*/ +ArrangementPointLocation_2(); /*! -constructs a point-location object `pl` attached to the given -arrangement `arr`. -*/ -ArrangementPointLocation_2 (const Arrangement_2& arr); +constructs a point-location object `pl` attached to the given +arrangement `arr`. +*/ +ArrangementPointLocation_2 (const Arrangement_2& arr); -/// @} +/// @} -/// \name Query Functions +/// \name Query Functions /// @{ /*! -locates the arrangement cell that contains the query point `q` +locates the arrangement cell that contains the query point `q` and returns a discriminated union container of the following bounded types: -
        -
      • `Arrangement_2::Face_const_handle`, in case `q` is -contained inside an arrangement face; -
      • `Arrangement_2::Halfedge_const_handle`, in case `q` lies -on an arrangement edge; -
      • `Arrangement_2::Vertex_const_handle`, in case `q` coincides -with an arrangement vertex. -
      -\pre `pl` is attached to a valid arrangement object. -*/ +
        +
      • `Arrangement_2::Face_const_handle`, in case `q` is +contained inside an arrangement face; +
      • `Arrangement_2::Halfedge_const_handle`, in case `q` lies +on an arrangement edge; +
      • `Arrangement_2::Vertex_const_handle`, in case `q` coincides +with an arrangement vertex. +
      +\pre `pl` is attached to a valid arrangement object. +*/ Arr_point_location_result::Type locate(const Point_2& q) const; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -attaches `pl` to the given arrangement `arr`. -*/ -void attach (const Arrangement_2& arr); +attaches `pl` to the given arrangement `arr`. +*/ +void attach (const Arrangement_2& arr); /*! -detaches `pl` from the arrangement it is currently attached to. -*/ -void detach (); +detaches `pl` from the arrangement it is currently attached to. +*/ +void detach (); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h index 0a2db8165430..da63fe4a11e3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h @@ -3,32 +3,32 @@ \ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept -The concept `ArrangementTraits_2` allows the construction of arrangement -of general planar curves. Models of this concept are used -by the free \link PkgArrangementOnSurface2Insert `CGAL::insert()` \endlink functions of the arrangement package and -by the `CGAL::Arrangement_with_history_2` class. - -A model of this concept must define the nested `Curve_2` type, which -represents a general planar curve that is not necessarily \f$ x\f$-monotone -and is not necessarily connected. Such curves are eventually subdivided into -\f$ x\f$-monotone subcurves and isolated points (represented by the `Point_2` -and `X_monotone_curve_2` types, defined in the basic traits concept). - -A model of the concept `ArrangementTraits_2` that handles arbitrary curves, -which are always \f$ x\f$-monotone, such as a traits class that handles -linear curves may define the nested types `Curve_2` and -`X_monotone_curve_2` to be of equivalent types. Moreover, defining -them as of equivalent types is advantageous, as it enables a generic -simple implementation of the nested Functor -`Make_x_monotone_2`. - -On the other hand, a model of the `ArrangementTraits_2` concept that handles -arbitrary curves, which may be not \f$ x\f$-monotone must define the -`Curve_2` and `X_monotone_curve_2` nested types to be of -different types to allow proper dispatching of the free functions -that accept such curves, such as `intsert()`. - -\cgalRefines `ArrangementXMonotoneTraits_2` +The concept `ArrangementTraits_2` allows the construction of arrangement +of general planar curves. Models of this concept are used +by the free \link PkgArrangementOnSurface2Insert `CGAL::insert()` \endlink functions of the arrangement package and +by the `CGAL::Arrangement_with_history_2` class. + +A model of this concept must define the nested `Curve_2` type, which +represents a general planar curve that is not necessarily \f$ x\f$-monotone +and is not necessarily connected. Such curves are eventually subdivided into +\f$ x\f$-monotone subcurves and isolated points (represented by the `Point_2` +and `X_monotone_curve_2` types, defined in the basic traits concept). + +A model of the concept `ArrangementTraits_2` that handles arbitrary curves, +which are always \f$ x\f$-monotone, such as a traits class that handles +linear curves may define the nested types `Curve_2` and +`X_monotone_curve_2` to be of equivalent types. Moreover, defining +them as of equivalent types is advantageous, as it enables a generic +simple implementation of the nested Functor +`Make_x_monotone_2`. + +On the other hand, a model of the `ArrangementTraits_2` concept that handles +arbitrary curves, which may be not \f$ x\f$-monotone must define the +`Curve_2` and `X_monotone_curve_2` nested types to be of +different types to allow proper dispatching of the free functions +that accept such curves, such as `intsert()`. + +\cgalRefines `ArrangementXMonotoneTraits_2` \cgalHasModel `CGAL::Arr_segment_traits_2` \cgalHasModel `CGAL::Arr_non_caching_segment_traits_2` @@ -45,42 +45,42 @@ that accept such curves, such as `intsert()`. \cgalHasModel `CGAL::Arr_curve_data_traits_2` \cgalHasModel `CGAL::Arr_consolidated_curve_data_traits_2` -\sa `ArrangementBasicTraits_2` -\sa `ArrangementXMonotoneTraits_2` -\sa `ArrangementLandmarkTraits_2` +\sa `ArrangementBasicTraits_2` +\sa `ArrangementXMonotoneTraits_2` +\sa `ArrangementLandmarkTraits_2` */ class ArrangementTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -models the concept `ArrTraits::Curve_2`. -*/ -typedef unspecified_type Curve_2; +models the concept `ArrTraits::Curve_2`. +*/ +typedef unspecified_type Curve_2; -/// @} +/// @} -/// \name Functor Types +/// \name Functor Types /// @{ /*! -models the concept `ArrTraits::MakeXMonotone_2`. -*/ -typedef unspecified_type Make_x_monotone_2; +models the concept `ArrTraits::MakeXMonotone_2`. +*/ +typedef unspecified_type Make_x_monotone_2; -/// @} +/// @} -/// \name Accessing Functor Objects +/// \name Accessing Functor Objects /// @{ /*! -*/ -Make_x_monotone_2 make_x_monotone_2_object() const; +*/ +Make_x_monotone_2 make_x_monotone_2_object() const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h index b7cc4a71ab2d..4a1febdc2d23 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h @@ -7,7 +7,7 @@ A model of the `ArrangementVerticalRayShoot_2` concept can answer vertical ray-s queries on an arrangement attached to it. Namely, given a `Arrangement_2::Point_2` object, representing a point in the plane, it returns the arrangement feature (edge or vertex) that lies -strictly above it (or below it). By "strictly" we mean that if the +strictly above it (or below it). By "strictly" we mean that if the query point lies on an arrangement edge (or on an arrangement vertex) this edge will not be the query result, but the feature lying above or below it. (An exception to this rule is the degenerate case @@ -28,10 +28,10 @@ is recommended. To enable the old style without any overhead, the macro `CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any \cgal header is included. -\cgalHasModel `CGAL::Arr_naive_point_location` -\cgalHasModel `CGAL::Arr_walk_along_line_point_location` -\cgalHasModel `CGAL::Arr_trapezoid_ric_point_location` -\cgalHasModel `CGAL::Arr_landmarks_point_location` +\cgalHasModel `CGAL::Arr_naive_point_location` +\cgalHasModel `CGAL::Arr_walk_along_line_point_location` +\cgalHasModel `CGAL::Arr_trapezoid_ric_point_location` +\cgalHasModel `CGAL::Arr_landmarks_point_location` \sa `CGAL::Arr_naive_point_location` \sa `CGAL::Arr_walk_along_line_point_location` @@ -44,90 +44,90 @@ is recommended. To enable the old style without any overhead, the macro class ArrangementVerticalRayShoot_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the associated arrangement type. -*/ -typedef unspecified_type Arrangement_2; +the associated arrangement type. +*/ +typedef unspecified_type Arrangement_2; /*! -equivalent to `Arrangement_2::Point_2`. -*/ -typedef unspecified_type Point_2; +equivalent to `Arrangement_2::Point_2`. +*/ +typedef unspecified_type Point_2; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -ArrangementVerticalRayShoot_2(); +default constructor. +*/ +ArrangementVerticalRayShoot_2(); /*! -constructs a ray-shooting object `rs` attached to the given -arrangement `arr`. -*/ -ArrangementVerticalRayShoot_2 (const Arrangement_2& arr); +constructs a ray-shooting object `rs` attached to the given +arrangement `arr`. +*/ +ArrangementVerticalRayShoot_2 (const Arrangement_2& arr); -/// @} +/// @} -/// \name Query Functions +/// \name Query Functions /// @{ /*! -locates the arrangement feature that is first hit by an upward-directed -vertical ray emanating from the query point `q`, +locates the arrangement feature that is first hit by an upward-directed +vertical ray emanating from the query point `q`, and returns a handle for this feature. The function returns a discriminated union container of the following bounded types: -
        -
      • `Arrangement_2::Halfedge_const_handle`, in case the vertical -ray hits an arrangement edge; -
      • `Arrangement_2::Vertex_const_handle`, in case the vertical -ray hits an arrangement vertex. -
      • `Arrangement_2::Face_const_handle` for the unbounded arrangement -face, in case `q` lies above the upper envelope of the -arrangement. -
      -\pre `rs` is attached to a valid arrangement instance. -*/ +
        +
      • `Arrangement_2::Halfedge_const_handle`, in case the vertical +ray hits an arrangement edge; +
      • `Arrangement_2::Vertex_const_handle`, in case the vertical +ray hits an arrangement vertex. +
      • `Arrangement_2::Face_const_handle` for the unbounded arrangement +face, in case `q` lies above the upper envelope of the +arrangement. +
      +\pre `rs` is attached to a valid arrangement instance. +*/ Arr_point_location_result::Type ray_shoot_up(const Point_2& q) const; /*! -locates the arrangement feature that is first hit by a downward-directed -vertical ray emanating from the query point `q`, +locates the arrangement feature that is first hit by a downward-directed +vertical ray emanating from the query point `q`, and returns a handle for this feature. The function returns a discriminated union container of the following bounded types: -
        -
      • `Arrangement_2::Halfedge_const_handle`, in case the vertical -ray hits an arrangement edge; -
      • `Arrangement_2::Vertex_const_handle`, in case the vertical -ray hits an arrangement vertex. -
      • `Arrangement_2::Face_const_handle` for the unbounded arrangement -face, in case `q` lies below the lower envelope of the -arrangement. -
      -\pre `rs` is attached to a valid arrangement instance. -*/ +
        +
      • `Arrangement_2::Halfedge_const_handle`, in case the vertical +ray hits an arrangement edge; +
      • `Arrangement_2::Vertex_const_handle`, in case the vertical +ray hits an arrangement vertex. +
      • `Arrangement_2::Face_const_handle` for the unbounded arrangement +face, in case `q` lies below the lower envelope of the +arrangement. +
      +\pre `rs` is attached to a valid arrangement instance. +*/ Arr_point_location_result::Type ray_shoot_down (const Point_2& q) const; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -attaches `rs` to the given arrangement `arr`. -*/ -void attach (const Arrangement_2& arr); +attaches `rs` to the given arrangement `arr`. +*/ +void attach (const Arrangement_2& arr); /*! -detaches `rs` from the arrangement it is currently attached to. -*/ -void detach (); +detaches `rs` from the arrangement it is currently attached to. +*/ +void detach (); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h index b2fdf82fe33e..0e9a09101c42 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h @@ -3,11 +3,11 @@ \ingroup PkgArrangementOnSurface2Concepts \cgalConcept -A model for the `ArrangementWithHistoryInputFormatter` concept supports a set of functions that enable -reading an arrangement-with-history instance from an input stream using a -specific format. +A model for the `ArrangementWithHistoryInputFormatter` concept supports a set of functions that enable +reading an arrangement-with-history instance from an input stream using a +specific format. -\cgalRefines `ArrangementInputFormatter` +\cgalRefines `ArrangementInputFormatter` \cgalHasModel `CGAL::Arr_with_history_text_formatter` @@ -16,59 +16,59 @@ specific format. class ArrangementWithHistoryInputFormatter { public: -/// \name Types +/// \name Types /// @{ /*! -the type of arrangement to input. -*/ -typedef unspecified_type Arr_with_history_2; +the type of arrangement to input. +*/ +typedef unspecified_type Arr_with_history_2; /*! -the inducing curve type. -*/ -typedef typename Arrangement_2::Curve_2 Curve_2; +the inducing curve type. +*/ +typedef typename Arrangement_2::Curve_2 Curve_2; -/// @} +/// @} -/// \name Formatted Input Functions +/// \name Formatted Input Functions /// @{ /*! -reads a message indicating the beginning of the inducing curves. -*/ -void read_curves_begin(); +reads a message indicating the beginning of the inducing curves. +*/ +void read_curves_begin(); /*! -reads a message indicating the end of the inducing curves. -*/ -void read_curves_end(); +reads a message indicating the end of the inducing curves. +*/ +void read_curves_end(); /*! -reads a message indicating the beginning of a single curve record. -*/ -void read_curve_begin(); +reads a message indicating the beginning of a single curve record. +*/ +void read_curve_begin(); /*! -reads a message indicating the end of a single curve record. -*/ -void read_curve_end(); +reads a message indicating the end of a single curve record. +*/ +void read_curve_end(); /*! -reads a curve. -*/ -void read_curve (Curve_2& c); +reads a curve. +*/ +void read_curve (Curve_2& c); /*! -reads a message indicating the beginning of the set of edges -induced by the current curve. -*/ -void read_induced_edges_begin(); +reads a message indicating the beginning of the set of edges +induced by the current curve. +*/ +void read_induced_edges_begin(); /*! -reads a message indicating the end of the induced edges set. -*/ -void read_induced_edges_end(); +reads a message indicating the end of the induced edges set. +*/ +void read_induced_edges_end(); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h index f917b232cd4b..3241f955cd53 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h @@ -3,11 +3,11 @@ \ingroup PkgArrangementOnSurface2Concepts \cgalConcept -A model for the `ArrangementWithHistoryOutputFormatter` concept supports a set of functions that enable -writing an arrangement-with-history instance to an output stream using a -specific format. +A model for the `ArrangementWithHistoryOutputFormatter` concept supports a set of functions that enable +writing an arrangement-with-history instance to an output stream using a +specific format. -\cgalRefines `ArrangementOutputFormatter` +\cgalRefines `ArrangementOutputFormatter` \cgalHasModel `CGAL::Arr_with_history_text_formatter` @@ -16,59 +16,59 @@ specific format. class ArrangementWithHistoryOutputFormatter { public: -/// \name Types +/// \name Types /// @{ /*! -the type of arrangement to output. -*/ -typedef unspecified_type Arr_with_history_2; +the type of arrangement to output. +*/ +typedef unspecified_type Arr_with_history_2; /*! -the inducing curve type. -*/ -typedef typename Arrangement_2::Curve_2 Curve_2; +the inducing curve type. +*/ +typedef typename Arrangement_2::Curve_2 Curve_2; -/// @} +/// @} -/// \name Formatted Output Functions +/// \name Formatted Output Functions /// @{ /*! -writes a message indicating the beginning of the inducing curves. -*/ -void write_curves_begin(); +writes a message indicating the beginning of the inducing curves. +*/ +void write_curves_begin(); /*! -writes a message indicating the end of the inducing curves. -*/ -void write_curves_end(); +writes a message indicating the end of the inducing curves. +*/ +void write_curves_end(); /*! -writes a message indicating the beginning of a single curve record. -*/ -void write_curve_begin(); +writes a message indicating the beginning of a single curve record. +*/ +void write_curve_begin(); /*! -writes a message indicating the end of a single curve record. -*/ -void write_curve_end(); +writes a message indicating the end of a single curve record. +*/ +void write_curve_end(); /*! -writes a curve. -*/ -void write_curve (const Curve_2& c); +writes a curve. +*/ +void write_curve (const Curve_2& c); /*! -writes a message indicating the beginning of the set of edges -induced by the current curve. -*/ -void write_induced_edges_begin(); +writes a message indicating the beginning of the set of edges +induced by the current curve. +*/ +void write_induced_edges_begin(); /*! -writes a message indicating the end of the induced edges set. -*/ -void write_induced_edges_end(); +writes a message indicating the end of the induced edges set. +*/ +void write_induced_edges_end(); /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h index e8a6830b7009..e796bbc3b0bb 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h @@ -3,20 +3,20 @@ \ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept -The concept `ArrangementXMonotoneTraits_2` refines the basic arrangement-traits concept. -A model of this concept is able to handle \f$ x\f$-monotone curves that -intersect in their interior (and points that coincide with curve -interiors). This is necessary for constructing arrangements of sets of -intersecting \f$ x\f$-monotone curves. +The concept `ArrangementXMonotoneTraits_2` refines the basic arrangement-traits concept. +A model of this concept is able to handle \f$ x\f$-monotone curves that +intersect in their interior (and points that coincide with curve +interiors). This is necessary for constructing arrangements of sets of +intersecting \f$ x\f$-monotone curves. -As the resulting structure, represented by the `Arrangement_2` class, -stores pairwise interior-disjoint curves, the input curves are split at -the intersection points before being inserted into the arrangement. -A model of this refined concept therefore needs to compute the intersections -(and possibly overlaps) between two \f$ x\f$-monotone curves and to support -curve splitting. +As the resulting structure, represented by the `Arrangement_2` class, +stores pairwise interior-disjoint curves, the input curves are split at +the intersection points before being inserted into the arrangement. +A model of this refined concept therefore needs to compute the intersections +(and possibly overlaps) between two \f$ x\f$-monotone curves and to support +curve splitting. -\cgalRefines `ArrangementBasicTraits_2` +\cgalRefines `ArrangementBasicTraits_2` \cgalHasModel `CGAL::Arr_segment_traits_2` \cgalHasModel `CGAL::Arr_non_caching_segment_traits_2` @@ -33,46 +33,46 @@ curve splitting. \cgalHasModel `CGAL::Arr_curve_data_traits_2` \cgalHasModel `CGAL::Arr_consolidated_curve_data_traits_2` -\sa `ArrangementBasicTraits_2` +\sa `ArrangementBasicTraits_2` */ class ArrangementXMonotoneTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the multiplicity type. -*/ -typedef unspecified_type Multiplicity; +the multiplicity type. +*/ +typedef unspecified_type Multiplicity; -/// @} +/// @} -/// \name Tags +/// \name Tags /// @{ /*! -indicates whether the nested functors `Are_mergeable_2` and -`Merge_2` are provided. -*/ -typedef unspecified_type Has_merge_category; +indicates whether the nested functors `Are_mergeable_2` and +`Merge_2` are provided. +*/ +typedef unspecified_type Has_merge_category; -/// @} +/// @} -/// \name Functor Types +/// \name Functor Types /// @{ /*! -models the concept `ArrTraits::Intersect_2`. -*/ -typedef unspecified_type Intersect_2; +models the concept `ArrTraits::Intersect_2`. +*/ +typedef unspecified_type Intersect_2; /*! -models the concept `ArrTraits::Split_2`. -*/ -typedef unspecified_type Split_2; +models the concept `ArrTraits::Split_2`. +*/ +typedef unspecified_type Split_2; /// @} @@ -83,32 +83,32 @@ typedef unspecified_type Split_2; /// @{ /*! -models the concept `ArrTraits::AreMergeable_2`. +models the concept `ArrTraits::AreMergeable_2`. -*/ -typedef unspecified_type Are_mergeable_2; +*/ +typedef unspecified_type Are_mergeable_2; /*! -models the concept `ArrTraits::Merge_2`. -*/ -typedef unspecified_type Merge_2; +models the concept `ArrTraits::Merge_2`. +*/ +typedef unspecified_type Merge_2; -/// @} +/// @} -/// \name Accessing Functor Objects +/// \name Accessing Functor Objects /// @{ /*! -*/ -Intersect_2 intersect_2_object() const; +*/ +Intersect_2 intersect_2_object() const; /*! -*/ -Split_2 split_2_object() const; +*/ +Split_2 split_2_object() const; /// @} @@ -120,13 +120,13 @@ Split_2 split_2_object() const; /*! -*/ -Are_mergeable_2 are_mergeable_2_object() const; +*/ +Are_mergeable_2 are_mergeable_2_object() const; /*! -*/ -Merge_2 merge_2_object() const; +*/ +Merge_2 merge_2_object() const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h index 5dff9f56683c..4647f40b1804 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h @@ -3,73 +3,73 @@ \ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept -A model for the `OverlayTraits` should be able to operate on records (namely, -vertices, halfedges and faces) of two input Dcel classes, named -`Dcel_A` and `Dcel_B`, and construct the records of an output Dcel class, referred to as `Dcel_R`. +A model for the `OverlayTraits` should be able to operate on records (namely, +vertices, halfedges and faces) of two input Dcel classes, named +`Dcel_A` and `Dcel_B`, and construct the records of an output Dcel class, referred to as `Dcel_R`. -Models for the concept are used by the global `overlay()` function to -maintain the auxiliary data stored with the Dcel records of the resulting -overlaid arrangement, based on the contents of the input records. +Models for the concept are used by the global `overlay()` function to +maintain the auxiliary data stored with the Dcel records of the resulting +overlaid arrangement, based on the contents of the input records. -\cgalHasModel `CGAL::Arr_default_overlay_traits` -\cgalHasModel `CGAL::Arr_face_overlay_traits` +\cgalHasModel `CGAL::Arr_default_overlay_traits` +\cgalHasModel `CGAL::Arr_face_overlay_traits` -\sa `overlay` +\sa `overlay` */ class OverlayTraits { public: -/// \name Types +/// \name Types /// @{ /*! -a constant handle a vertex in `Dcel_A`. -*/ -typedef unspecified_type Vertex_handle_A; +a constant handle a vertex in `Dcel_A`. +*/ +typedef unspecified_type Vertex_handle_A; /*! -a constant handle to a halfedge in `Dcel_A`. -*/ -typedef unspecified_type Halfedge_handle_A; +a constant handle to a halfedge in `Dcel_A`. +*/ +typedef unspecified_type Halfedge_handle_A; /*! -a constant handle to a face `Dcel_A`. -*/ -typedef unspecified_type Face_handle_A; +a constant handle to a face `Dcel_A`. +*/ +typedef unspecified_type Face_handle_A; /*! -a constant handle to a vertex in `Dcel_B`. -*/ -typedef unspecified_type Vertex_handle_B; +a constant handle to a vertex in `Dcel_B`. +*/ +typedef unspecified_type Vertex_handle_B; /*! -a constant handle to a halfedge in `Dcel_B`. -*/ -typedef unspecified_type Halfedge_handle_B; +a constant handle to a halfedge in `Dcel_B`. +*/ +typedef unspecified_type Halfedge_handle_B; /*! -a constant handle to a face in `Dcel_B`. -*/ -typedef unspecified_type Face_handle_B; +a constant handle to a face in `Dcel_B`. +*/ +typedef unspecified_type Face_handle_B; /*! -a handle to a vertex in `Dcel_R`. -*/ -typedef unspecified_type Vertex_handle_R; +a handle to a vertex in `Dcel_R`. +*/ +typedef unspecified_type Vertex_handle_R; /*! -a handle to a halfedge in `Dcel_R`. -*/ -typedef unspecified_type Halfedge_handle_R; +a handle to a halfedge in `Dcel_R`. +*/ +typedef unspecified_type Halfedge_handle_R; /*! -a handle to a faces in `Dcel_R`. -*/ -typedef unspecified_type Face_handle_R; +a handle to a faces in `Dcel_R`. +*/ +typedef unspecified_type Face_handle_R; -/// @} +/// @} /// \name Vertex Creation /// Whenever a vertex in the overlaid arrangement is created, one of @@ -78,52 +78,52 @@ typedef unspecified_type Face_handle_R; /// @{ /*! -constructs the vertex `v` induced by the coinciding vertices -`v1` and `v2`. -*/ -void create_vertex (Vertex_handle_A v1, -Vertex_handle_B v2, -Vertex_handle_R v) const; +constructs the vertex `v` induced by the coinciding vertices +`v1` and `v2`. +*/ +void create_vertex (Vertex_handle_A v1, +Vertex_handle_B v2, +Vertex_handle_R v) const; /*! -constructs the vertex `v` induced by the vertex `v1` that lies on -the halfedge `e2`. -*/ -void create_vertex (Vertex_handle_A v1, -Halfedge_handle_B e2, -Vertex_handle_R v) const; +constructs the vertex `v` induced by the vertex `v1` that lies on +the halfedge `e2`. +*/ +void create_vertex (Vertex_handle_A v1, +Halfedge_handle_B e2, +Vertex_handle_R v) const; /*! -constructs the vertex `v` induced by the vertex `v1` that lies -inside the face `f2`. -*/ -void create_vertex (Vertex_handle_A v1, -Face_handle_B f2, -Vertex_handle_R v) const; +constructs the vertex `v` induced by the vertex `v1` that lies +inside the face `f2`. +*/ +void create_vertex (Vertex_handle_A v1, +Face_handle_B f2, +Vertex_handle_R v) const; /*! -constructs the vertex `v` induced by the vertex `v2` that lies on -the halfedge `e1`. -*/ -void create_vertex (Halfedge_handle_A e1, -Vertex_handle_B v2, -Vertex_handle_R v) const; +constructs the vertex `v` induced by the vertex `v2` that lies on +the halfedge `e1`. +*/ +void create_vertex (Halfedge_handle_A e1, +Vertex_handle_B v2, +Vertex_handle_R v) const; /*! -constructs the vertex `v` induced by the vertex `v2` that lies -inside the face `f1`. -*/ -void create_vertex (Face_handle_A f1, -Vertex_handle_B v2, -Vertex_handle_R v) const; +constructs the vertex `v` induced by the vertex `v2` that lies +inside the face `f1`. +*/ +void create_vertex (Face_handle_A f1, +Vertex_handle_B v2, +Vertex_handle_R v) const; /*! -constructs the vertex `v` induced by the intersection of the -halfedges `e1` and `e2`. -*/ -void create_vertex (Halfedge_handle_A e1, -Halfedge_handle_B e2, -Vertex_handle_R v) const; +constructs the vertex `v` induced by the intersection of the +halfedges `e1` and `e2`. +*/ +void create_vertex (Halfedge_handle_A e1, +Halfedge_handle_B e2, +Vertex_handle_R v) const; /// @} /// \name Edge Creation @@ -139,28 +139,28 @@ Vertex_handle_R v) const; /// @{ /*! -constructs the halfedge `e` induced by an overlap between the -halfedges `e1` and `e2`. -*/ -void create_edge (Halfedge_handle_A e1, -Halfedge_handle_B e2, -Halfedge_handle_R e) const; +constructs the halfedge `e` induced by an overlap between the +halfedges `e1` and `e2`. +*/ +void create_edge (Halfedge_handle_A e1, +Halfedge_handle_B e2, +Halfedge_handle_R e) const; /*! -constructs the halfedge `e` induced by the halfedge `e1` that lies -inside the face `f2`. -*/ -void create_edge (Halfedge_handle_A e1, -Face_handle_B f2, -Halfedge_handle_R e) const; +constructs the halfedge `e` induced by the halfedge `e1` that lies +inside the face `f2`. +*/ +void create_edge (Halfedge_handle_A e1, +Face_handle_B f2, +Halfedge_handle_R e) const; /*! -constructs the halfedge `e` induced by the halfedge `e2` that lies -inside the face `f1`. -*/ -void create_edge (Face_handle_A f1, -Halfedge_handle_B e2, -Halfedge_handle_R e) const; +constructs the halfedge `e` induced by the halfedge `e2` that lies +inside the face `f1`. +*/ +void create_edge (Face_handle_A f1, +Halfedge_handle_B e2, +Halfedge_handle_R e) const; /// @} /// \name Face Creation /// The following function is invoked whenever a new face is @@ -170,12 +170,12 @@ Halfedge_handle_R e) const; /// @{ /*! -constructs the face `f` induced by the an overlap between the -faces `f1` and `f2`. -*/ -void create_face (Face_handle_A f1, -Face_handle_B f2, -Face_handle_R f) const; +constructs the face `f` induced by the an overlap between the +faces `f1` and `f2`. +*/ +void create_face (Face_handle_A f1, +Face_handle_B f2, +Face_handle_R f) const; /// @} diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp index 493ff967489a..032633182adc 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp @@ -7,7 +7,7 @@ #include int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else @@ -48,7 +48,7 @@ int main (int argc, char *argv[]) std::list curves; Bezier_curve_2 B; unsigned int k; - + in_file >> n_curves; for (k = 0; k < n_curves; k++) { // Read the current curve (specified by its control points). @@ -65,7 +65,7 @@ int main (int argc, char *argv[]) // Print the arrangement size. std::cout << "The arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; return 0; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt index 5f226853d873..86ff8829a381 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp index d0a1897c3bb5..d6680e4e8c19 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp @@ -4,8 +4,8 @@ #if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI)) int main () { - std::cout << "Sorry, this example needs CORE, LEDA, or GMP+MPFI ..." - << std::endl; + std::cout << "Sorry, this example needs CORE, LEDA, or GMP+MPFI ..." + << std::endl; return 0; } #else @@ -35,14 +35,14 @@ int main() { CGAL::set_pretty_mode(std::cout); Arr_traits_2 arr_traits; - + // Functor to create a curve from a Polynomial_2 Arr_traits_2::Construct_curve_2 construct_curve = arr_traits.construct_curve_2_object(); Polynomial_2 x = CGAL::shift(Polynomial_2(1),1,0); Polynomial_2 y = CGAL::shift(Polynomial_2(1),1,1); - + Arrangement_2 arr(&arr_traits); // Construct an (unbounded line) with equation 3x-5y+2=0 @@ -74,9 +74,9 @@ int main() { // Print the arrangement size. std::cout << "The arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; - + return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp index 11ac25e33825..96bcc9c17869 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp @@ -6,7 +6,7 @@ int main () { std::cout << "Sorry, this example needs CORE, LEDA, or GMP+MPFI ..." - << std::endl; + << std::endl; return 0; } #else @@ -114,7 +114,7 @@ int main() { (CGAL::make_object(construct_point(Integer(1),Integer(5)))); isolated_points.push_back (CGAL::make_object(construct_point(Algebraic_real_1(-1), - Algebraic_real_1(5)))); + Algebraic_real_1(5)))); CGAL::insert(arr,isolated_points.begin(), isolated_points.end()); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp index 6e98d4b3cafd..3fcd81f3c373 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp @@ -7,7 +7,7 @@ #include int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else @@ -28,7 +28,7 @@ typedef Rat_kernel::Point_2 Rat_point_2; typedef Rat_kernel::Segment_2 Rat_segment_2; typedef Rat_kernel::Circle_2 Rat_circle_2; typedef CGAL::Cartesian Alg_kernel; -typedef CGAL::Arr_conic_traits_2 Traits_2; typedef Traits_2::Point_2 Point_2; @@ -56,7 +56,7 @@ int main () Point_2 ps2 (-Rational(1,2), Rational(1,2)); Point_2 pt2 (Rational(1,2), Rational(1,2)); Conic_arc_2 cv2 (circ2, CGAL::COUNTERCLOCKWISE, ps2, pt2); - + insert (arr, cv2, pl); // Print the resulting arrangement. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp index 145525ffe2f7..2e3f988e00ce 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp @@ -6,7 +6,7 @@ #include int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else @@ -47,7 +47,7 @@ int main () // phi=36.87 degree (such that sin(phi) = 0.6, cos(phi) = 0.8), // yielding: 58x^2 + 72y^2 - 48xy - 360 = 0. Conic_arc_2 c2 (58, 72, -48, 0, 0, -360); - + insert (arr, c2); // Insert the segment (1, 1) -- (0, -3). @@ -97,13 +97,13 @@ int main () Point_2 ps7 (4, 3); Point_2 pt7 (4, 2); Conic_arc_2 c7 (circ7, CGAL::CLOCKWISE, ps7, pt7); - + insert (arr, c7); // Print out the size of the resulting arrangement. std::cout << "The arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; return 0; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp index b59825dc0562..bd2ca2530426 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp @@ -26,7 +26,7 @@ int main () S1[0] = Segment_2 (Point_2 (1, 2.5), Point_2 (4, 5)); S1[1] = Segment_2 (Point_2 (1, 2.5), Point_2 (6, 2.5)); - S1[2] = Segment_2 (Point_2 (1, 2.5), Point_2 (4, 0)); + S1[2] = Segment_2 (Point_2 (1, 2.5), Point_2 (4, 0)); S1[3] = Segment_2 (Point_2 (4, 5), Point_2 (6, 2.5)); S1[4] = Segment_2 (Point_2 (4, 0), Point_2 (6, 2.5)); @@ -51,7 +51,7 @@ int main () // Print the size of the arrangement. std::cout << "The arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp index 4174c2b66f70..0540c6525d99 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp @@ -25,7 +25,7 @@ int main() Segment_2 s1(Point_2(1, 0), Point_2(2, 4)); Segment_2 s2(Point_2(5, 0), Point_2(5, 5)); - Segment_2 s3(Point_2(1, 0), Point_2(5, 3)); + Segment_2 s3(Point_2(1, 0), Point_2(5, 3)); Segment_2 s4(Point_2(0, 2), Point_2(6, 0)); Segment_2 s5(Point_2(3, 0), Point_2(5, 5)); @@ -45,7 +45,7 @@ int main() // the boundary of the face that contains it. Point_2 q(4, 1); Walk_pl::result_type obj = pl.locate(q); - + Arrangement_2::Face_const_handle f; CGAL_assertion_code(bool success =) CGAL::assign(f, obj); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp index 382d20dc1e48..34a901089876 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp @@ -70,15 +70,15 @@ int main () std::cout << "The initial arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; // Now remove a portion of the vertical segment. remove_edge (arr, e_vert); - + std::cout << "The final arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; return 0; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp index 8c8bc346185d..7c6617f530fe 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp @@ -71,7 +71,7 @@ int main () insert (arr2, Segment_2 (Point_2(4, 4), Point_2(-4, 4))); insert (arr2, Segment_2 (Point_2(-4, 4), Point_2(-4, -4))); - // Give the unbounded face the index 1, and the bounded face the index 2. + // Give the unbounded face the index 1, and the bounded face the index 2. CGAL_assertion (arr2.number_of_faces() == 2); ArrangementB_2::Face_iterator fit; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example.cpp index 7c38931cd324..e15aedf04416 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example.cpp @@ -35,6 +35,6 @@ int main () point_location_query (landmarks_pl, Point_2(3, 2)); // q4 point_location_query (landmarks_pl, Point_2(5, 2)); // q5 point_location_query (landmarks_pl, Point_2(1, 0)); // q6 - + return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h index 522b9f7b5fc1..d096b3241d36 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h @@ -53,7 +53,7 @@ print_point_location const Vertex_const_handle* v; const Halfedge_const_handle* e; const Face_const_handle* f; - + std::cout << "The point (" << q << ") is located "; if ( ( f = boost::get(&obj) ) ) // located inside a face std::cout << "inside " @@ -98,7 +98,7 @@ void vertical_ray_shooting_query(const VerticalRayShoot& vrs, // Perform the point-location query. typename Vertical_ray_shooting::result_type obj = vrs.ray_shoot_up(q); - + // Print the result. typedef typename Vertical_ray_shooting::Arrangement_2 Arrangement_2; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; @@ -108,7 +108,7 @@ void vertical_ray_shooting_query(const VerticalRayShoot& vrs, const Vertex_const_handle* v; const Halfedge_const_handle* e; const Face_const_handle* f; - + std::cout << "Shooting up from (" << q << ") : "; if ( (v = boost::get(&obj)) ) // we hit a vertex @@ -128,7 +128,7 @@ void vertical_ray_shooting_query(const VerticalRayShoot& vrs, // the vertical ray-shooting examples. // The function assumes that the arrangement is of line segments with integer // coordinates. -// +// template void construct_segments_arr(Arrangement_& arr) { diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp index f254838bd5b6..dad71a199675 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp @@ -37,7 +37,7 @@ int main (int argc, char *argv[]) // // source and target of segment #2. // : : : : // // source and target of segment #n. - + std::list segments; unsigned int n; @@ -55,7 +55,7 @@ int main (int argc, char *argv[]) Arrangement_2 arr; CGAL::Timer timer; - std::cout << "Performing aggregated insertion of " + std::cout << "Performing aggregated insertion of " << n << " segments." << std::endl; timer.start(); @@ -64,11 +64,11 @@ int main (int argc, char *argv[]) // Print the arrangement dimensions. std::cout << "V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl; + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << std::endl; + + std::cout << "Construction took " << timer.time() + << " seconds." << std::endl; - std::cout << "Construction took " << timer.time() - << " seconds." << std::endl; - return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp index fc5dc5aff14d..1dfd35593be0 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp @@ -55,7 +55,7 @@ int main (int argc, char *argv[]) Arrangement_2 arr; CGAL::Timer timer; - std::cout << "Performing aggregated insertion of " + std::cout << "Performing aggregated insertion of " << n << " segments." << std::endl; timer.start(); @@ -64,11 +64,11 @@ int main (int argc, char *argv[]) // Print the arrangement dimensions. std::cout << "V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl; + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << std::endl; + + std::cout << "Construction took " << timer.time() + << " seconds." << std::endl; - std::cout << "Construction took " << timer.time() - << " seconds." << std::endl; - return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp index 1f7922be2045..8b1e47def30f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp @@ -7,7 +7,7 @@ #include int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } @@ -19,7 +19,7 @@ int main () #include // Arrangement typedef CORE::BigInt Number_type; -typedef CGAL::Algebraic_kernel_d_1 AK1; +typedef CGAL::Algebraic_kernel_d_1 AK1; typedef CGAL::Arr_rational_function_traits_2 Traits_2; typedef Traits_2::Polynomial_1 Polynomial_1; @@ -34,14 +34,14 @@ int main () // create a polynomial representing x .-) Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); - // Traits class object - Traits_2 traits; + // Traits class object + Traits_2 traits; Traits_2::Construct_x_monotone_curve_2 construct_arc - = traits.construct_x_monotone_curve_2_object(); + = traits.construct_x_monotone_curve_2_object(); - // container storing all arcs + // container storing all arcs std::vector arcs; - + // Create an arc supported by the polynomial y = x^4 - 6x^2 + 8, // defined over the interval [-2.1, 2.1]: Polynomial_1 P1 = x*x*x*x - 6*x*x + 8; @@ -53,19 +53,19 @@ int main () // defined over the interval [-3, 3]: Polynomial_1 P2 = x; Polynomial_1 Q2 = 1+x*x; - + arcs.push_back(construct_arc(P2, Q2, Alg_real_1(-3), Alg_real_1(3))); // Create an arc supported by the parabola y = 8 - x^2, // defined over the interval [-2, 3]: - Polynomial_1 P3 = 8 - x*x; + Polynomial_1 P3 = 8 - x*x; arcs.push_back(construct_arc(P3, Alg_real_1(-2), Alg_real_1(3))); - + // Create an arc supported by the line y = -2x, // defined over the interval [-3, 0]: Polynomial_1 P4 = -2*x; arcs.push_back(construct_arc(P4, Alg_real_1(-3), Alg_real_1(0))); - + // Construct the arrangement of the four arcs. // Print the arcs. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp index 341de80a5624..3b9f7e391c25 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp @@ -7,7 +7,7 @@ #include int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } @@ -21,7 +21,7 @@ int main () typedef CORE::BigInt Integer; typedef CORE::BigRat Rational; -typedef CGAL::Algebraic_kernel_d_1 AK1; +typedef CGAL::Algebraic_kernel_d_1 AK1; typedef CGAL::Arr_rational_function_traits_2 Traits_2; typedef std::vector Rat_vec; @@ -33,14 +33,14 @@ int main () { CGAL::set_pretty_mode(std::cout); // for nice printouts. - // Traits class object - Traits_2 traits; + // Traits class object + Traits_2 traits; Traits_2::Construct_x_monotone_curve_2 construct_arc - = traits.construct_x_monotone_curve_2_object(); + = traits.construct_x_monotone_curve_2_object(); - // container storing all arcs + // container storing all arcs std::vector arcs; - + // Create an arc supported by the function y = 0.1x^4 - 0.6x^2 + 0.8 / 0.1, // defined over the interval [-2.1, 2.1]: Rat_vec P1,Q1; @@ -49,9 +49,9 @@ int main () P1.push_back(Rational(-6,10)); P1.push_back(Rational(0)); P1.push_back(Rational(1,10)); - + Q1.push_back(Rational(1,10)); - + Alg_real_1 l(Traits_2::Algebraic_kernel_d_1::Bound(-2.1)); Alg_real_1 r(Traits_2::Algebraic_kernel_d_1::Bound(2.1)); arcs.push_back(construct_arc(P1.begin(), P1.end(), Q1.begin(), Q1.end(), l, r)); @@ -61,11 +61,11 @@ int main () Rat_vec P2,Q2; P2.push_back(Rational(0)); P2.push_back(Rational(1,10)); - + Q2.push_back(Rational(1,10)); Q2.push_back(Rational(0)); Q2.push_back(Rational(1,10)); - + arcs.push_back(construct_arc(P2.begin(), P2.end(), Q2.begin(), Q2.end(), Alg_real_1(-3), Alg_real_1(3))); @@ -77,10 +77,10 @@ int main () P3.push_back(Rational(-1,10)); Q3.push_back(Rational(1,10)); - + arcs.push_back(construct_arc(P3.begin(), P3.end(), Q3.begin(), Q3.end(), Alg_real_1(-2), Alg_real_1(3))); - + // Create an arc supported by the line y = -0.2x / 0.1, // defined over the interval [-3, 0]: Rat_vec P4,Q4; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp index 607ba79f2b8d..29569d04520b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp @@ -21,7 +21,7 @@ int main () { // Construct the arrangement of five intersecting segments. Arrangement_2 arr; - + std::list arcs; arcs.push_back(X_monotone_curve_2(Point_2(1, 0, 0), Point_2(0, 1, 0))); @@ -34,7 +34,7 @@ int main () arcs.push_back(X_monotone_curve_2(Point_2(-1, 0, 0), Point_2(0, -1, 0))); arcs.push_back(X_monotone_curve_2(Point_2(0, 0, -1), Point_2(1, 0, 0))); arcs.push_back(X_monotone_curve_2(Point_2(0, 1, 0), Point_2(0, 0, -1))); - + #if 0 // insert_non_intersecting_curves (arr, arcs.begin(), arcs.end()); // insert_x_monotone_curves (arr, arcs.begin(), arcs.end()); @@ -50,7 +50,7 @@ int main () // Print the size of the arrangement. std::cout << "The arrangement size:" << std::endl << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; return 0; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp index b07df073f55e..89e254899d84 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp @@ -35,12 +35,12 @@ int main () insert(arr1, segments.begin(), segments.end()); std::cout << traits << std::endl; traits.clear_counters(); - + // Construct an arrangement using incremental insertion: Arrangement_2 arr2(&traits); insert(arr2, s1); insert(arr2, s2); std::cout << traits << std::endl; - + return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp index ac4a28e625bd..932db693d764 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp @@ -17,7 +17,7 @@ typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; typedef CGAL::Arrangement_2 Arrangement_2; typedef Arrangement_2::Vertex_handle Vertex_handle; typedef Arrangement_2::Halfedge_handle Halfedge_handle; - + int main () { Arrangement_2 arr; @@ -30,7 +30,7 @@ int main () X_monotone_curve_2 c1_left = Ray_2 (Point_2 (0, 0), Point_2 (-1, 0)); X_monotone_curve_2 c1_right = Ray_2 (Point_2 (0, 0), Point_2 (1, 0)); - + e1 = arr.split_edge (e1, c1_left, c1_right); Vertex_handle v = e1->target(); @@ -57,8 +57,8 @@ int main () << " V = " << arr.number_of_vertices() << " (plus " << arr.number_of_vertices_at_infinity() << " at infinity)" - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << " (" << arr.number_of_unbounded_faces() << " unbounded)" << std::endl << std::endl; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp index 946a1698648a..1f30067dd0d6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp @@ -7,7 +7,7 @@ #include int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } @@ -18,8 +18,8 @@ int main () #include // Traits #include // Arrangement -typedef CORE::BigInt Number_type; -typedef CGAL::Algebraic_kernel_d_1 AK1; +typedef CORE::BigInt Number_type; +typedef CGAL::Algebraic_kernel_d_1 AK1; typedef CGAL::Arr_rational_function_traits_2 Traits_2; typedef Traits_2::Polynomial_1 Polynomial_1; @@ -30,21 +30,21 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main () { CGAL::set_pretty_mode(std::cout); // for nice printouts. - - // Traits class object - AK1 ak1; + + // Traits class object + AK1 ak1; Traits_2 traits(&ak1); - - // constructor for rational functions - Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); - + + // constructor for rational functions + Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); + // a polynomial representing x .-) Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); - - // container storing all arcs + + // container storing all arcs std::vector arcs; - + // Create the rational functions (y = 1 / x), and (y = -1 / x). Polynomial_1 P1(1); Polynomial_1 minusP1(-P1); @@ -54,8 +54,8 @@ int main () // Create a bounded segments of the parabolas (y = -4*x^2 + 3) and // (y = 4*x^2 - 3), defined over [-sqrt(3)/2, sqrt(3)/2]. - Polynomial_1 P2 = -4*x*x+3; - Polynomial_1 minusP2 = -P2; + Polynomial_1 P2 = -4*x*x+3; + Polynomial_1 minusP2 = -P2; std::vector > roots; // [-sqrt(3)/2, sqrt(3)/2] @@ -81,8 +81,8 @@ int main () << " V = " << arr.number_of_vertices() << " (plus " << arr.number_of_vertices_at_infinity() << " at infinity)" - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << " (" << arr.number_of_unbounded_faces() << " unbounded)" << std::endl << std::endl; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h index a115d2b2dbc3..0397cd07f67c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -144,7 +144,7 @@ class Arr_accessor { Arr_traits_basic_adaptor_2 Traits_adaptor_2; - const Traits_adaptor_2* m_traits = + const Traits_adaptor_2* m_traits = static_cast (p_arr->geometry_traits()); Arr_curve_end ind = ARR_MIN_END; @@ -197,8 +197,8 @@ class Arr_accessor { * Compute the distance (in halfedges) between two halfedges. * \param e1 A handle for the source halfedge. * \param e2 A handle for the destination halfedge. - * \return In case e1 and e2 belong to the same connected component, the - * function returns number of boundary halfedges between the two + * \return In case e1 and e2 belong to the same connected component, the + * function returns number of boundary halfedges between the two * halfedges. Otherwise, it returns (-1). */ int halfedge_distance(Halfedge_const_handle e1, @@ -207,7 +207,7 @@ class Arr_accessor { // If the two halfedges do not belong to the same component, return (-1). const DHalfedge* he1 = p_arr->_halfedge(e1); const DHalfedge* he2 = p_arr->_halfedge(e2); - + if (he1 == he2) return (0); const DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : nullptr; @@ -299,7 +299,7 @@ class Arr_accessor { CGAL_assertion(v != nullptr); return (p_arr->_handle_for (v)); } - + /*! * Create a new boundary vertex. * \param cv The curve incident to the boundary. @@ -378,7 +378,7 @@ class Arr_accessor { * In case a new face has been created, it is given as the incident * face of this halfedge. */ - Halfedge_handle insert_at_vertices_ex(Halfedge_handle he_to, + Halfedge_handle insert_at_vertices_ex(Halfedge_handle he_to, const X_monotone_curve_2& cv, Arr_halfedge_direction cv_dir, Halfedge_handle he_away, @@ -412,7 +412,7 @@ class Arr_accessor { */ Halfedge_handle insert_from_vertex_ex(Halfedge_handle he_to, const X_monotone_curve_2& cv, - Arr_halfedge_direction cv_dir, + Arr_halfedge_direction cv_dir, Vertex_handle v) { DVertex* p_v = p_arr->_vertex(v); @@ -448,7 +448,7 @@ class Arr_accessor { */ Halfedge_handle insert_in_face_interior_ex(Face_handle f, const X_monotone_curve_2& cv, - Arr_halfedge_direction cv_dir, + Arr_halfedge_direction cv_dir, Vertex_handle v1, Vertex_handle v2) { @@ -478,7 +478,7 @@ class Arr_accessor { CGAL_assertion(he != nullptr); return (p_arr->_handle_for (he)); - + } /*! @@ -488,7 +488,7 @@ class Arr_accessor { */ void insert_isolated_vertex(Face_handle f, Vertex_handle v) { p_arr->_insert_isolated_vertex(p_arr->_face (f), p_arr->_vertex(v)); } - + /*! * Relocate all holes and isolated vertices to their proper position, * immediately after a face has split due to the insertion of a new halfedge. @@ -534,7 +534,7 @@ class Arr_accessor { p_arr->_move_inner_ccb(p_arr->_face(from_face), p_arr->_face(to_face), p_arr->_halfedge(ccb)); } - + /*! * Move an isolated vertex from one face to another. * \param from_face The source face. @@ -571,7 +571,7 @@ class Arr_accessor { p_arr->_modify_vertex(p_arr->_vertex(v), p); return v; } - + /*! * Modify the x-monotone curve associated with a given edge. The curve may be * geometrically different than the one currently associated with the edge. @@ -585,7 +585,7 @@ class Arr_accessor { p_arr->_modify_edge(p_arr->_halfedge (e), cv); return e; } - + /*! * Split a given edge into two at a given point, and associate the given * x-monotone curves with the split edges. @@ -599,7 +599,7 @@ class Arr_accessor { * source of e, and whose target is the split point. */ Halfedge_handle split_edge_ex(Halfedge_handle e, const Point_2& p, - const X_monotone_curve_2& cv1, + const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2) { DHalfedge* he = p_arr->_split_edge (p_arr->_halfedge(e), p, cv1, cv2); @@ -641,7 +641,7 @@ class Arr_accessor { Halfedge_handle split_fictitious_edge(Halfedge_handle e, Vertex_handle v) { CGAL_precondition(e->is_fictitious()); - DHalfedge* he = + DHalfedge* he = p_arr->topology_traits()->split_fictitious_edge(p_arr->_halfedge(e), p_arr->_vertex(v)); return (p_arr->_handle_for(he)); @@ -654,7 +654,7 @@ class Arr_accessor { * becomes isolated (true by default). * \param remove_target Should the target vertex of e be removed if it * becomes isolated (true by default). - * \pre In case the removal causes the creation of a new hole, e should + * \pre In case the removal causes the creation of a new hole, e should * point at this hole. * \return A handle for the remaining face. */ @@ -713,20 +713,20 @@ class Arr_accessor { /*! Get an iterator for the first valid arrangement vertex. */ Valid_vertex_iterator valid_vertices_begin() - { + { return (Valid_vertex_iterator (p_arr->topology_traits()->dcel().vertices_begin(), p_arr->topology_traits()->dcel().vertices_end(), - Is_valid_vertex (p_arr->topology_traits()))); + Is_valid_vertex (p_arr->topology_traits()))); } /*! Get a past-the-end iterator for the valid arrangement vertices. */ Valid_vertex_iterator valid_vertices_end() - { + { return (Valid_vertex_iterator (p_arr->topology_traits()->dcel().vertices_end(), p_arr->topology_traits()->dcel().vertices_end(), - Is_valid_vertex (p_arr->topology_traits()))); + Is_valid_vertex (p_arr->topology_traits()))); } /*! Get the number of valid arrangement vertices. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index db803497c3f3..5a3384145d2a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Michael Kerber // @@ -30,26 +30,26 @@ namespace CGAL { -template< class Coefficient_ > +template< class Coefficient_ > class Arr_algebraic_segment_traits_2 { - + public: enum Site_of_point { POINT_IN_INTERIOR = 0, MIN_ENDPOINT = -1, MAX_ENDPOINT = 1 }; - + // Template argument - + typedef Coefficient_ Coefficient; - + // 'derivation' typedef CGAL::Algebraic_kernel_d_1< Coefficient > Algebraic_kernel_d_1; - typedef CGAL::Algebraic_curve_kernel_2< Algebraic_kernel_d_1 > + typedef CGAL::Algebraic_curve_kernel_2< Algebraic_kernel_d_1 > Algebraic_kernel_d_2; - + typedef CGAL::Curved_kernel_via_analysis_2< Algebraic_kernel_d_2 > CKvA_2; typedef CGAL::Arr_algebraic_segment_traits_2 Self; @@ -64,18 +64,18 @@ class Arr_algebraic_segment_traits_2 { // Assignement operator const Self& operator= (const Self& s) {return s;} - + // public types - + typedef typename Algebraic_kernel_d_2::Algebraic_real_1 Algebraic_real_1; typedef typename Algebraic_kernel_d_2::Bound Bound; typedef typename Algebraic_kernel_d_2::Polynomial_2 Polynomial_2; /// public types for ArrangementTraits_2 - + typedef typename Algebraic_kernel_d_2::Curve_analysis_2 Curve_2; - + typedef typename CKvA_2::Arc_2 X_monotone_curve_2; typedef typename CKvA_2::Point_2 Point_2; @@ -83,7 +83,7 @@ class Arr_algebraic_segment_traits_2 { typedef typename CKvA_2::Has_left_category Has_left_category; typedef typename CKvA_2::Has_merge_category Has_merge_category; - typedef typename CKvA_2::Has_do_intersect_category + typedef typename CKvA_2::Has_do_intersect_category Has_do_intersect_category; typedef typename CKvA_2::Left_side_category Left_side_category; @@ -118,7 +118,7 @@ class Arr_algebraic_segment_traits_2 { return CKvA_2::instance().parameter_space_in_y_2_object(); } - typedef typename CKvA_2::Compare_y_near_boundary_2 + typedef typename CKvA_2::Compare_y_near_boundary_2 Compare_y_near_boundary_2; Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const { return CKvA_2::instance().compare_y_near_boundary_2_object(); @@ -153,7 +153,7 @@ class Arr_algebraic_segment_traits_2 { Construct_opposite_2 construct_opposite_2_object() const { return CKvA_2::instance().construct_opposite_2_object(); } - + typedef typename CKvA_2::Is_vertical_2 Is_vertical_2; Is_vertical_2 is_vertical_2_object() const { return CKvA_2::instance().is_vertical_2_object(); @@ -173,7 +173,7 @@ class Arr_algebraic_segment_traits_2 { Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const { return CKvA_2::instance().compare_y_at_x_right_2_object(); } - + typedef typename CKvA_2::Intersect_2 Intersect_2; Intersect_2 intersect_2_object() const { return CKvA_2::instance().intersect_2_object(); @@ -211,11 +211,11 @@ class Arr_algebraic_segment_traits_2 { return Construct_point_2(&CKvA_2::instance()); } - - class Construct_x_monotone_segment_2 : public + + class Construct_x_monotone_segment_2 : public CGAL::internal::Curved_kernel_via_analysis_2_Functors:: Curved_kernel_via_analysis_2_functor_base< CKvA_2 > { - + public: typedef CGAL::internal::Curved_kernel_via_analysis_2_Functors:: @@ -232,7 +232,7 @@ class Arr_algebraic_segment_traits_2 { branch_numbers_and_vertical(Curve_2 cv, Point_2 p) const { Equal_2 equal = this->_ckva()->equal_2_object(); - + Algebraic_real_1 x = p.x(); int no; bool is_event; @@ -257,7 +257,7 @@ class Arr_algebraic_segment_traits_2 { // abbrevation for convenience bool is_one_one(Curve_2 cv, Point_2 p) const { - std::pair,bool> branches + std::pair,bool> branches = branch_numbers_and_vertical(cv,p); return branches.first.first==1 && branches.first.second==1 && !branches.second; @@ -265,28 +265,28 @@ class Arr_algebraic_segment_traits_2 { } template OutputIterator - x_monotone_segment (Curve_2 cv, - Point_2 p, + x_monotone_segment (Curve_2 cv, + Point_2 p, boost::optional start, boost::optional end, OutputIterator out) const { - + //CGAL_assertion(is_one_one(cv,p)); std::list segs; - Is_on_2 on_arc + Is_on_2 on_arc = this->_ckva()->is_on_2_object(); - Construct_min_vertex_2 left + Construct_min_vertex_2 left = this->_ckva()->construct_min_vertex_2_object(); - Construct_max_vertex_2 right + Construct_max_vertex_2 right = this->_ckva()->construct_max_vertex_2_object(); Equal_2 equal = this->_ckva()->equal_2_object(); std::vector arcs; - this->_ckva()->make_x_monotone_2_object() + this->_ckva()->make_x_monotone_2_object() (cv,std::back_inserter(arcs)); - typename std::vector::const_iterator + typename std::vector::const_iterator it = arcs.begin(),helper; X_monotone_curve_2 it_seg; CGAL::assign(it_seg,*it); @@ -298,10 +298,10 @@ class Arr_algebraic_segment_traits_2 { it++; CGAL::assign(it_seg,*it); } - + bool left_on_arc = start && on_arc(start.get(),it_seg); bool right_on_arc = end && on_arc(end.get(),it_seg); - + if( left_on_arc && right_on_arc ) { segs.push_back(it_seg.trim(start.get(),end.get())); } @@ -328,14 +328,14 @@ class Arr_algebraic_segment_traits_2 { segs.push_back(split1); } } - } + } if( (!left_on_arc) && (!right_on_arc)) { segs.push_back(it_seg); } helper=it; // for later usage - + if(! left_on_arc) { - + Point_2 point_it; while(true) { if(it_seg.is_finite(CGAL::ARR_MIN_END) && @@ -390,16 +390,16 @@ class Arr_algebraic_segment_traits_2 { } } } - + std::copy(segs.begin(),segs.end(),out); return out; - + } public: - + template OutputIterator - operator() (Curve_2 cv, + operator() (Curve_2 cv, Point_2 p, Site_of_point site_of_p, OutputIterator out) const { @@ -408,7 +408,7 @@ class Arr_algebraic_segment_traits_2 { } else if(site_of_p==MIN_ENDPOINT) { return x_monotone_segment(cv, p, - boost::optional(p), + boost::optional(p), boost::none, out); } @@ -416,18 +416,18 @@ class Arr_algebraic_segment_traits_2 { return x_monotone_segment(cv, p, boost::none, - boost::optional(p), + boost::optional(p), out); } template OutputIterator - operator() (Curve_2 cv, + operator() (Curve_2 cv, Point_2 end_left, Point_2 end_right, OutputIterator out) const { - - + + CGAL_assertion((branch_numbers_and_vertical(cv,end_left). first.second==1 && @@ -449,19 +449,19 @@ class Arr_algebraic_segment_traits_2 { (branch_numbers_and_vertical(cv,end_right). first.first==0 && branch_numbers_and_vertical(cv,end_right).second)) { - Compare_x_2 equal_x + Compare_x_2 equal_x = this->_ckva()->compare_x_2_object(); ) CGAL_assertion(equal_x(end_left,end_right)==CGAL::EQUAL); CGAL_assertion_code(}); - - + + if( (branch_numbers_and_vertical(cv,end_left). first.second==0 && branch_numbers_and_vertical(cv,end_left).second) || (branch_numbers_and_vertical(cv,end_left). first.second==1 && !branch_numbers_and_vertical(cv,end_left).second)) { - + return x_monotone_segment (cv, end_left, @@ -479,71 +479,71 @@ class Arr_algebraic_segment_traits_2 { } template OutputIterator - operator() (Point_2 p, Point_2 q, OutputIterator out) { - bool same_x=(this->_ckva()->compare_x_2_object()(p,q)==CGAL::EQUAL); - if(same_x) { + operator() (Point_2 p, Point_2 q, OutputIterator out) { + bool same_x=(this->_ckva()->compare_x_2_object()(p,q)==CGAL::EQUAL); + if(same_x) { Algebraic_real_1 x = p.x(); Polynomial_2 f = Polynomial_2(x.polynomial()); - Curve_2 cv - = this->_ckva()->kernel().construct_curve_2_object() (f); + Curve_2 cv + = this->_ckva()->kernel().construct_curve_2_object() (f); *out++=typename CKvA_2::Arc_2(p,q,cv); - return out; - } - Algebraic_real_1 px - =this->_ckva()->kernel().compute_x_2_object()(p.xy()), - py=this->_ckva()->kernel().compute_y_2_object()(p.xy()), - qx=this->_ckva()->kernel().compute_x_2_object()(q.xy()), - qy=this->_ckva()->kernel().compute_y_2_object()(q.xy()); - bool p_rat=px.is_rational() && py.is_rational(); - bool q_rat=qx.is_rational() && qy.is_rational(); - if(p_rat && q_rat) { - typedef typename Algebraic_real_1::Rational Rational; - Rational pxr=px.rational(), pyr=py.rational(), - qxr=qx.rational(), qyr=qy.rational(); - typedef CGAL::Fraction_traits FT; - typename FT::Decompose decompose; - typedef typename FT::Numerator_type Numerator; - typedef typename FT::Denominator_type Denominator; - Rational term_at_y=qxr-pxr, term_at_x=-qyr+pyr, - term_at_1=pxr*qyr-pyr*qxr; - Denominator denom_curr; - Numerator term_at_y_int, term_at_x_int, term_at_1_int; - decompose(term_at_y, term_at_y_int, denom_curr); - term_at_x=term_at_x*denom_curr; - term_at_1=term_at_1*denom_curr; - decompose(term_at_x,term_at_x_int,denom_curr); - term_at_y_int=term_at_y_int*denom_curr; - term_at_1=term_at_1*denom_curr; - decompose(term_at_1,term_at_1_int,denom_curr); - term_at_y_int=term_at_y_int*denom_curr; - term_at_x_int=term_at_x_int*denom_curr; - typedef typename CGAL::Polynomial_traits_d - ::Coefficient_type Polynomial_1; - Polynomial_2 pol(Polynomial_1(term_at_1_int,term_at_x_int), - Polynomial_1(term_at_y_int)); - Curve_2 curve=this->_ckva()->kernel().construct_curve_2_object() - (pol); - - CGAL_assertion(this->_ckva()->is_on_2_object()(p,curve)); - CGAL_assertion(this->_ckva()->is_on_2_object()(q,curve)); - return this->operator()(curve,p,q,out); - } - CGAL_precondition(same_x || (p_rat && q_rat)); - return out; - } + return out; + } + Algebraic_real_1 px + =this->_ckva()->kernel().compute_x_2_object()(p.xy()), + py=this->_ckva()->kernel().compute_y_2_object()(p.xy()), + qx=this->_ckva()->kernel().compute_x_2_object()(q.xy()), + qy=this->_ckva()->kernel().compute_y_2_object()(q.xy()); + bool p_rat=px.is_rational() && py.is_rational(); + bool q_rat=qx.is_rational() && qy.is_rational(); + if(p_rat && q_rat) { + typedef typename Algebraic_real_1::Rational Rational; + Rational pxr=px.rational(), pyr=py.rational(), + qxr=qx.rational(), qyr=qy.rational(); + typedef CGAL::Fraction_traits FT; + typename FT::Decompose decompose; + typedef typename FT::Numerator_type Numerator; + typedef typename FT::Denominator_type Denominator; + Rational term_at_y=qxr-pxr, term_at_x=-qyr+pyr, + term_at_1=pxr*qyr-pyr*qxr; + Denominator denom_curr; + Numerator term_at_y_int, term_at_x_int, term_at_1_int; + decompose(term_at_y, term_at_y_int, denom_curr); + term_at_x=term_at_x*denom_curr; + term_at_1=term_at_1*denom_curr; + decompose(term_at_x,term_at_x_int,denom_curr); + term_at_y_int=term_at_y_int*denom_curr; + term_at_1=term_at_1*denom_curr; + decompose(term_at_1,term_at_1_int,denom_curr); + term_at_y_int=term_at_y_int*denom_curr; + term_at_x_int=term_at_x_int*denom_curr; + typedef typename CGAL::Polynomial_traits_d + ::Coefficient_type Polynomial_1; + Polynomial_2 pol(Polynomial_1(term_at_1_int,term_at_x_int), + Polynomial_1(term_at_y_int)); + Curve_2 curve=this->_ckva()->kernel().construct_curve_2_object() + (pol); + + CGAL_assertion(this->_ckva()->is_on_2_object()(p,curve)); + CGAL_assertion(this->_ckva()->is_on_2_object()(q,curve)); + return this->operator()(curve,p,q,out); + } + CGAL_precondition(same_x || (p_rat && q_rat)); + return out; + } }; - - Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() + + Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const { return Construct_x_monotone_segment_2(&CKvA_2::instance()); } /* - - class Construct_vertical_segment_2 : public + + class Construct_vertical_segment_2 : public CGAL::internal::Curved_kernel_via_analysis_2_Functors:: Curved_kernel_via_analysis_2_functor_base< CKvA_2 > { - + public: typedef CGAL::internal::Curved_kernel_via_analysis_2_Functors:: @@ -557,12 +557,12 @@ class Arr_algebraic_segment_traits_2 { X_monotone_curve_2 operator() (Point_2 p, Point_2 q) { Algebraic_real_1 x = p.x(); Polynomial_2 f = Polynomial_2(x.polynomial()); - Curve_2 cv + Curve_2 cv = this->_ckva()->kernel().construct_curve_2_object() (f); return typename CKvA_2::Arc_2(p,q,cv); } - + template OutputIterator operator() (Point_2 p, Site_of_point site_of_p) const { @@ -577,17 +577,17 @@ class Arr_algebraic_segment_traits_2 { } CGAL_assertion(site_of_p==MAX_ENDPOINT); return typename CKvA_2::Arc_2(p,ARR_MAX_END,cv); - + } }; Construct_vertical_segment_2 construct_vertical_segment_2_object() const { return Construct_vertical_segment_2(&CKvA_2::instance()); } - -*/ - class Construct_curve_2 : public +*/ + + class Construct_curve_2 : public CGAL::internal::Curved_kernel_via_analysis_2_Functors:: Curved_kernel_via_analysis_2_functor_base< CKvA_2 > { @@ -608,44 +608,44 @@ class Arr_algebraic_segment_traits_2 { } - - + + /* // additional functionality (for not introducing a "general" arc) class Connect_points_2 { - + template< class OutputIterator > - OutputIterator operator() (Curve_2, Point_2, Point_2, ..., + OutputIterator operator() (Curve_2, Point_2, Point_2, ..., OutputIterator) { - + while (false || true) { *oi++ = X_monotone_curve_2(...); } - + return oi; } template< class OutputIterator > OutputIterator operator() (Curve_2, Point_2, Point_2, int, ..., OutputIterator) { - - + + while (false || true) { *oi++ = X_monotone_curve_2(...); } - + return oi; } }; */ - + }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h index 6c206d52e07d..dc8dc0d5e781 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h @@ -311,24 +311,24 @@ class Arr_circle_segment_traits_2 { if ((CGAL::compare (cv1.left().x(),cv1.right().x()) == EQUAL) && (CGAL::compare (cv2.left().x(),cv2.right().x()) == EQUAL)) - { //both cv1 and cv2 are vertical + { //both cv1 and cv2 are vertical CGAL_precondition (!(cv1.left()).equals(p) && !(cv2.left()).equals(p)); - } - else if ((CGAL::compare (cv1.left().x(),cv1.right().x()) != EQUAL) && + } + else if ((CGAL::compare (cv1.left().x(),cv1.right().x()) != EQUAL) && (CGAL::compare (cv2.left().x(),cv2.right().x()) == EQUAL)) - { //only cv1 is vertical + { //only cv1 is vertical CGAL_precondition (!(cv1.left()).equals(p)); - } - else if ((CGAL::compare (cv1.left().x(),cv1.right().x()) == EQUAL) && + } + else if ((CGAL::compare (cv1.left().x(),cv1.right().x()) == EQUAL) && (CGAL::compare (cv2.left().x(),cv2.right().x()) != EQUAL)) - { //only cv2 is vertical + { //only cv2 is vertical CGAL_precondition (!(cv2.left()).equals(p)); - } - else - { //both cv1 and cv2 are non vertical + } + else + { //both cv1 and cv2 are non vertical CGAL_precondition (CGAL::compare (cv1.left().x(),p.x()) == SMALLER && CGAL::compare (cv2.left().x(),p.x()) == SMALLER); - } + } // Compare the two curves immediately to the left of p: return (cv1.compare_to_left (cv2, p)); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h index ee916540e2ad..a7d968445232 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_CIRCULAR_KERNEL_CIRCULAR_ARC_TRAITS_2_H @@ -36,7 +36,7 @@ namespace CGAL { namespace internal{ -template +template class Non_x_monotonic_Circular_arc_2 : public CircularKernel::Circular_arc_2 { @@ -46,21 +46,21 @@ class Non_x_monotonic_Circular_arc_2 typedef typename CircularKernel::Circle_2 Circle_2; typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; - + typedef typename CircularKernel::Circular_arc_2 Base; - + public: Non_x_monotonic_Circular_arc_2(): Base(){} Non_x_monotonic_Circular_arc_2(const Circle_2 &c): Base(c){} // Not Documented - Non_x_monotonic_Circular_arc_2(const Circle_2 &support, + Non_x_monotonic_Circular_arc_2(const Circle_2 &support, const Line_2 &l1, const bool b_l1, const Line_2 &l2, const bool b_l2) : Base(support,l1,b_l1,l2,b_l2){} // Not Documented - Non_x_monotonic_Circular_arc_2(const Circle_2 &c, + Non_x_monotonic_Circular_arc_2(const Circle_2 &c, const Circle_2 &c1, const bool b_1, const Circle_2 &c2, const bool b_2) : Base(c,c1,b_1,c2,b_2) @@ -71,7 +71,7 @@ class Non_x_monotonic_Circular_arc_2 const Point_2 &end) : Base(start,middle,end) {} - + Non_x_monotonic_Circular_arc_2(const Circle_2 &support, const Circular_arc_point_2 &begin, const Circular_arc_point_2 &end) @@ -83,13 +83,13 @@ class Non_x_monotonic_Circular_arc_2 const FT &bulge) : Base(start,end,bulge) {} - + Non_x_monotonic_Circular_arc_2(const Base& a) : Base(a) {} -}; - +}; + } //namespace internal - -// Traits class for CGAL::Arrangement_2 (and similar) based on a + +// Traits class for CGAL::Arrangement_2 (and similar) based on a // CircularKernel. template < typename CircularKernel > @@ -106,10 +106,10 @@ class Arr_circular_arc_traits_2 { typedef typename CircularKernel::Circular_arc_point_2 Point; typedef typename CircularKernel::Circular_arc_point_2 Point_2; - typedef unsigned int Multiplicity; + typedef unsigned int Multiplicity; typedef CGAL::Tag_false Has_left_category; - typedef CGAL::Tag_false Has_merge_category; + typedef CGAL::Tag_false Has_merge_category; typedef CGAL::Tag_false Has_do_intersect_category; typedef Arr_oblivious_side_tag Left_side_category; @@ -124,26 +124,26 @@ class Arr_circular_arc_traits_2 { typedef typename CircularKernel::Compare_xy_2 Compare_xy_2; typedef typename CircularKernel::Compare_y_at_x_2 Compare_y_at_x_2; typedef typename CircularKernel::Compare_y_to_right_2 Compare_y_at_x_right_2; - typedef typename CircularKernel::Construct_circular_max_vertex_2 + typedef typename CircularKernel::Construct_circular_max_vertex_2 Construct_max_vertex_2; - typedef typename CircularKernel::Construct_circular_min_vertex_2 + typedef typename CircularKernel::Construct_circular_min_vertex_2 Construct_min_vertex_2; typedef typename CircularKernel::Equal_2 Equal_2; typedef typename CircularKernel::Make_x_monotone_2 Make_x_monotone_2; typedef typename CircularKernel::Split_2 Split_2; typedef typename CircularKernel::Intersect_2 Intersect_2; typedef typename CircularKernel::Is_vertical_2 Is_vertical_2; - + Compare_x_2 compare_x_2_object() const { return ck.compare_x_2_object(); } Compare_xy_2 compare_xy_2_object() const { return ck.compare_xy_2_object(); } - Compare_y_at_x_2 compare_y_at_x_2_object() const + Compare_y_at_x_2 compare_y_at_x_2_object() const { return ck.compare_y_at_x_2_object(); } - Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const + Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const { return ck.compare_y_to_right_2_object(); } Equal_2 equal_2_object() const @@ -157,13 +157,13 @@ class Arr_circular_arc_traits_2 { Intersect_2 intersect_2_object() const { return ck.intersect_2_object(); } - + Construct_max_vertex_2 construct_max_vertex_2_object() const { return ck.construct_circular_max_vertex_2_object(); } - + Construct_min_vertex_2 construct_min_vertex_2_object() const { return ck.construct_circular_min_vertex_2_object(); } - + Is_vertical_2 is_vertical_2_object() const { return ck.is_vertical_2_object(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index 99b368e52d27..654f86e3e306 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion, Julien Hazebrouck // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_CIRCULAR_KERNEL_VARIANT_TRAITS_2_H @@ -43,25 +43,25 @@ namespace CGAL { // returns an Object(Variant(Line/Circular_arc)). // Do nothing for Object(Endpoint). template - OutputIterator - object_to_object_variant(const std::vector& res1, - OutputIterator res2) - { - for(std::vector::const_iterator it = res1.begin(); - it != res1.end(); ++it ){ - if(const Arc1 *arc = CGAL::object_cast< Arc1 >(&*it)){ - boost::variant< Arc1, Arc2 > v = *arc; - *res2++ = make_object(v); - } - else if (const Arc2 *line = CGAL::object_cast< Arc2 >(&*it)){ - boost::variant< Arc1, Arc2 > v = *line; - *res2++ = make_object(v); - } - else{ - *res2++ = *it; - } + OutputIterator + object_to_object_variant(const std::vector& res1, + OutputIterator res2) + { + for(std::vector::const_iterator it = res1.begin(); + it != res1.end(); ++it ){ + if(const Arc1 *arc = CGAL::object_cast< Arc1 >(&*it)){ + boost::variant< Arc1, Arc2 > v = *arc; + *res2++ = make_object(v); + } + else if (const Arc2 *line = CGAL::object_cast< Arc2 >(&*it)){ + boost::variant< Arc1, Arc2 > v = *line; + *res2++ = make_object(v); + } + else{ + *res2++ = *it; + } } - return res2; + return res2; } @@ -69,58 +69,58 @@ namespace CGAL { class In_x_range_2 { public: - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; typedef bool result_type; - + result_type - operator()(const boost::variant< Arc1, Arc2 > &a, - const Circular_arc_point_2 &p) const - { - if ( const Arc1* arc1 = boost::get( &a ) ){ - return CircularKernel().in_x_range_2_object()(*arc1, p); - } - else { - const Arc2* arc2 = boost::get( &a ); - return CircularKernel().in_x_range_2_object()(*arc2, p); - } + operator()(const boost::variant< Arc1, Arc2 > &a, + const Circular_arc_point_2 &p) const + { + if ( const Arc1* arc1 = boost::get( &a ) ){ + return CircularKernel().in_x_range_2_object()(*arc1, p); + } + else { + const Arc2* arc2 = boost::get( &a ); + return CircularKernel().in_x_range_2_object()(*arc2, p); + } } }; - + template class Compare_y_to_right_2 { public: typedef CGAL::Comparison_result result_type; - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; - + result_type - operator()(const boost::variant< Arc1, Arc2 > &a1, - const boost::variant< Arc1, Arc2 > &a2, - const Circular_arc_point_2 &p) const - { - if ( const Arc1* arc1 = boost::get( &a1 ) ){ - if ( const Arc1* arc2 = boost::get( &a2 ) ){ - return CircularKernel() - .compare_y_to_right_2_object()(*arc1, *arc2, p); - } - else { - const Arc2* arc2e = boost::get( &a2 ); - return CircularKernel() - .compare_y_to_right_2_object()(*arc1, *arc2e, p); - } - } - const Arc2* arc1 = boost::get( &a1 ); - if ( const Arc1* arc2 = boost::get( &a2 ) ){ - return CircularKernel() - .compare_y_to_right_2_object()(*arc1, *arc2, p); - } - const Arc2* arc2e = boost::get( &a2 ); - return CircularKernel() - .compare_y_to_right_2_object()(*arc1, *arc2e, p); - } + operator()(const boost::variant< Arc1, Arc2 > &a1, + const boost::variant< Arc1, Arc2 > &a2, + const Circular_arc_point_2 &p) const + { + if ( const Arc1* arc1 = boost::get( &a1 ) ){ + if ( const Arc1* arc2 = boost::get( &a2 ) ){ + return CircularKernel() + .compare_y_to_right_2_object()(*arc1, *arc2, p); + } + else { + const Arc2* arc2e = boost::get( &a2 ); + return CircularKernel() + .compare_y_to_right_2_object()(*arc1, *arc2e, p); + } + } + const Arc2* arc1 = boost::get( &a1 ); + if ( const Arc1* arc2 = boost::get( &a2 ) ){ + return CircularKernel() + .compare_y_to_right_2_object()(*arc1, *arc2, p); + } + const Arc2* arc2e = boost::get( &a2 ); + return CircularKernel() + .compare_y_to_right_2_object()(*arc1, *arc2e, p); + } }; @@ -134,33 +134,33 @@ namespace CGAL { bool operator()(const T &a0, const T &a1) const { - return CircularKernel().equal_2_object()(a0,a1); + return CircularKernel().equal_2_object()(a0,a1); } - template < typename T1, typename T2 > + template < typename T1, typename T2 > bool operator()(const T1 &, const T2 &) const { - return false; + return false; } }; - + template class Equal_2 -#ifndef CGAL_CFG_MATCHING_BUG_6 - : public +#ifndef CGAL_CFG_MATCHING_BUG_6 + : public CircularKernel::Equal_2 #endif { public: typedef boost::variant< Arc1, Arc2 > Curve_2; typedef bool result_type; -#ifndef CGAL_CFG_MATCHING_BUG_6 +#ifndef CGAL_CFG_MATCHING_BUG_6 using CircularKernel::Equal_2::operator(); -#else - typedef typename CircularKernel::Circular_arc_point_2 +#else + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; typedef typename CircularKernel::Line_arc_2 Line_arc_2; typedef typename CircularKernel::Circular_arc_2 Circular_arc_2; @@ -170,7 +170,7 @@ namespace CGAL { operator() (const Circular_arc_point_2 &p0, const Circular_arc_point_2 &p1) const { return CK_Equal_2()(p0, p1); } - + result_type operator() (const Circular_arc_2 &a0, const Circular_arc_2 &a1) const { return CK_Equal_2()(a0, a1); } @@ -186,40 +186,40 @@ namespace CGAL { result_type operator() ( const Circular_arc_2 &a0, const Line_arc_2 &a1) const { return false; } - + #endif result_type operator()(const Curve_2 &a0, const Curve_2 &a1) const { - return boost::apply_visitor - ( Variant_Equal_2(), a0, a1 ); + return boost::apply_visitor + ( Variant_Equal_2(), a0, a1 ); } - + }; - + template class Compare_y_at_x_2 { public: - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; typedef CGAL::Comparison_result result_type; result_type operator() (const Circular_arc_point_2 &p, const boost::variant< Arc1, Arc2 > &A1) const - { - if ( const Arc1* arc1 = boost::get( &A1 ) ){ - return CircularKernel().compare_y_at_x_2_object()(p, *arc1); - } - else { - const Arc2* arc2 = boost::get( &A1 ); - return CircularKernel().compare_y_at_x_2_object()(p, *arc2); - } + { + if ( const Arc1* arc1 = boost::get( &A1 ) ){ + return CircularKernel().compare_y_at_x_2_object()(p, *arc1); + } + else { + const Arc2* arc2 = boost::get( &A1 ); + return CircularKernel().compare_y_at_x_2_object()(p, *arc2); + } } }; @@ -231,33 +231,33 @@ namespace CGAL { bool operator()(const T &a0, const T &a1) const { - return CircularKernel().do_overlap_2_object()(a0, a1); + return CircularKernel().do_overlap_2_object()(a0, a1); } - template < typename T1, typename T2 > + template < typename T1, typename T2 > bool operator()(const T1 &, const T2 &) const { - return false; + return false; } }; - + template class Do_overlap_2 { public: - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; typedef bool result_type; result_type operator()(const boost::variant< Arc1, Arc2 > &A0, const boost::variant< Arc1, Arc2 > &A1) const - { - return boost::apply_visitor - ( Variant_Do_overlap_2(), A0, A1 ); - } + { + return boost::apply_visitor + ( Variant_Do_overlap_2(), A0, A1 ); + } }; @@ -265,7 +265,7 @@ namespace CGAL { class Make_x_monotone_2 { public: - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; template < class OutputIterator,class Not_X_Monotone > @@ -273,135 +273,135 @@ namespace CGAL { operator()(const boost::variant &A, OutputIterator res) const { if ( const Arc1* arc1 = boost::get( &A ) ){ - std::vector container; - CircularKernel() - .make_x_monotone_2_object()(*arc1,std::back_inserter(container)); - return object_to_object_variant - (container, res); - } - else { - const Arc2* arc2 = boost::get( &A ); - std::vector container; - CircularKernel() - .make_x_monotone_2_object()(*arc2,std::back_inserter(container)); - return object_to_object_variant + std::vector container; + CircularKernel() + .make_x_monotone_2_object()(*arc1,std::back_inserter(container)); + return object_to_object_variant + (container, res); + } + else { + const Arc2* arc2 = boost::get( &A ); + std::vector container; + CircularKernel() + .make_x_monotone_2_object()(*arc2,std::back_inserter(container)); + return object_to_object_variant (container, res); - } + } } }; - + template class Intersect_2 { public: - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; - + template < class OutputIterator > - OutputIterator - operator()(const boost::variant< Arc1, Arc2 > &c1, - const boost::variant< Arc1, Arc2 > &c2, - OutputIterator res) const - { - if ( const Arc1* arc1 = boost::get( &c1 ) ){ - if ( const Arc1* arc2 = boost::get( &c2 ) ){ - std::vector container; - CircularKernel() - .intersect_2_object()(*arc1,*arc2,std::back_inserter(container)); - return object_to_object_variant - (container, res); - } - else if ( const Arc2* arc2 = boost::get( &c2 ) ){ - std::vector container; - CircularKernel() - .intersect_2_object()(*arc1,*arc2,std::back_inserter(container)); - return object_to_object_variant - (container, res); - } - } - else { - const Arc2* arc1e = boost::get( &c1 ); - if ( const Arc1* arc2 = boost::get( &c2 ) ){ - std::vector container; - CircularKernel() - .intersect_2_object()(*arc1e,*arc2,std::back_inserter(container)); - return object_to_object_variant + OutputIterator + operator()(const boost::variant< Arc1, Arc2 > &c1, + const boost::variant< Arc1, Arc2 > &c2, + OutputIterator res) const + { + if ( const Arc1* arc1 = boost::get( &c1 ) ){ + if ( const Arc1* arc2 = boost::get( &c2 ) ){ + std::vector container; + CircularKernel() + .intersect_2_object()(*arc1,*arc2,std::back_inserter(container)); + return object_to_object_variant + (container, res); + } + else if ( const Arc2* arc2 = boost::get( &c2 ) ){ + std::vector container; + CircularKernel() + .intersect_2_object()(*arc1,*arc2,std::back_inserter(container)); + return object_to_object_variant (container, res); - } - const Arc2* arc2 = boost::get( &c2 ); - std::vector container; - CircularKernel() - .intersect_2_object()(*arc1e,*arc2,std::back_inserter(container)); - return object_to_object_variant + } + } + else { + const Arc2* arc1e = boost::get( &c1 ); + if ( const Arc1* arc2 = boost::get( &c2 ) ){ + std::vector container; + CircularKernel() + .intersect_2_object()(*arc1e,*arc2,std::back_inserter(container)); + return object_to_object_variant + (container, res); + } + const Arc2* arc2 = boost::get( &c2 ); + std::vector container; + CircularKernel() + .intersect_2_object()(*arc1e,*arc2,std::back_inserter(container)); + return object_to_object_variant (container, res); - } - CGAL_error(); - return res;//for no warning + } + CGAL_error(); + return res;//for no warning } - + }; - + template class Split_2 { public: - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; typedef void result_type; result_type - operator()(const boost::variant< Arc1, Arc2 > &A, - const Circular_arc_point_2 &p, - boost::variant< Arc1, Arc2 > &ca1, - boost::variant< Arc1, Arc2 > &ca2) const - { - // TODO : optimize by extracting the references from the variants ? - if ( const Arc1* arc1 = boost::get( &A ) ){ - Arc1 carc1; - Arc1 carc2; - CircularKernel().split_2_object()(*arc1, p, carc1, carc2); - ca1 = carc1; - ca2 = carc2; - return ; - - } - else{ - const Arc2* arc2 = boost::get( &A ); - Arc2 cline1; - Arc2 cline2; - CircularKernel().split_2_object()(*arc2, p, cline1, cline2); - ca1 = cline1; - ca2 = cline2; - return ; - - } + operator()(const boost::variant< Arc1, Arc2 > &A, + const Circular_arc_point_2 &p, + boost::variant< Arc1, Arc2 > &ca1, + boost::variant< Arc1, Arc2 > &ca2) const + { + // TODO : optimize by extracting the references from the variants ? + if ( const Arc1* arc1 = boost::get( &A ) ){ + Arc1 carc1; + Arc1 carc2; + CircularKernel().split_2_object()(*arc1, p, carc1, carc2); + ca1 = carc1; + ca2 = carc2; + return ; + + } + else{ + const Arc2* arc2 = boost::get( &A ); + Arc2 cline1; + Arc2 cline2; + CircularKernel().split_2_object()(*arc2, p, cline1, cline2); + ca1 = cline1; + ca2 = cline2; + return ; + + } } }; template - class Variant_Construct_min_vertex_2 + class Variant_Construct_min_vertex_2 : public boost::static_visitor { - typedef typename CircularKernel::Circular_arc_point_2 - Circular_arc_point_2; - + typedef typename CircularKernel::Circular_arc_point_2 + Circular_arc_point_2; + public : - + typedef Circular_arc_point_2 result_type; //typedef const result_type& qualified_result_type; - + template < typename T > //typename boost::remove_reference::type - Circular_arc_point_2 + Circular_arc_point_2 operator()(const T &a) const { - //CGAL_kernel_precondition(CircularKernel().compare_xy_2_object()(a.left(), a.right())==CGAL::SMALLER); - return CircularKernel().construct_circular_min_vertex_2_object()(a); + //CGAL_kernel_precondition(CircularKernel().compare_xy_2_object()(a.left(), a.right())==CGAL::SMALLER); + return CircularKernel().construct_circular_min_vertex_2_object()(a); } }; @@ -410,16 +410,16 @@ namespace CGAL { { typedef typename CircularKernel::Circular_arc_point_2 Point_2; public: - + typedef Point_2 result_type; //typedef const result_type& qualified_result_type; - - //typename boost::remove_reference::type + + //typename boost::remove_reference::type result_type operator() (const boost::variant< Arc1, Arc2 > & cv) const { - return boost::apply_visitor - ( Variant_Construct_min_vertex_2(), cv ); + return boost::apply_visitor + ( Variant_Construct_min_vertex_2(), cv ); } }; @@ -429,28 +429,28 @@ namespace CGAL { template class Variant_Construct_max_vertex_2 - : public boost::static_visitor + : public boost::static_visitor { - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; - + public : - + typedef Circular_arc_point_2 result_type; //typedef const result_type& qualified_result_type; - + template < typename T > //typename boost::remove_reference::type - Circular_arc_point_2 + Circular_arc_point_2 operator()(const T &a) const { - //CGAL_kernel_precondition(CircularKernel().compare_xy_2_object()(a.left(), a.right())==CGAL::SMALLER); - return (CircularKernel().construct_circular_max_vertex_2_object()(a)); + //CGAL_kernel_precondition(CircularKernel().compare_xy_2_object()(a.left(), a.right())==CGAL::SMALLER); + return (CircularKernel().construct_circular_max_vertex_2_object()(a)); } }; - + template class Construct_max_vertex_2//: public Has_qrt { @@ -462,14 +462,14 @@ namespace CGAL { * \return The right endpoint. */ typedef Point_2 result_type; - //typedef const result_type& qualified_result_type; - + //typedef const result_type& qualified_result_type; + //typename boost::remove_reference::type result_type operator() (const boost::variant< Arc1, Arc2 > & cv) const { - return boost::apply_visitor - ( Variant_Construct_max_vertex_2(), cv ); + return boost::apply_visitor + ( Variant_Construct_max_vertex_2(), cv ); } }; @@ -483,7 +483,7 @@ namespace CGAL { bool operator()(const T &a) const { - return CircularKernel().is_vertical_2_object()(a); + return CircularKernel().is_vertical_2_object()(a); } }; @@ -495,13 +495,13 @@ namespace CGAL { bool operator() (const boost::variant< Arc1, Arc2 >& cv) const { - return boost::apply_visitor - ( Variant_Is_vertical_2(), cv ); + return boost::apply_visitor + ( Variant_Is_vertical_2(), cv ); } }; } - + // a empty class used to have different types between Curve_2 and X_monotone_curve_2 // in Arr_circular_line_arc_traits_2. @@ -510,7 +510,7 @@ namespace CGAL { inline std::ostream& operator << (std::ostream& os, const Not_X_Monotone&) {return os;} } - + /// Traits class for CGAL::Arrangement_2 (and similar) based on a CircularKernel. template < typename CircularKernel> @@ -520,73 +520,73 @@ namespace CGAL { typedef typename CircularKernel::Line_arc_2 Arc1; typedef typename CircularKernel::Circular_arc_2 Arc2; - + public: - + typedef CircularKernel Kernel; - typedef typename CircularKernel::Circular_arc_point_2 + typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; typedef typename CircularKernel::Circular_arc_point_2 Point; typedef typename CircularKernel::Circular_arc_point_2 Point_2; - typedef unsigned int Multiplicity; - + typedef unsigned int Multiplicity; + typedef CGAL::Tag_false Has_left_category; - typedef CGAL::Tag_false Has_merge_category; + typedef CGAL::Tag_false Has_merge_category; typedef CGAL::Tag_false Has_do_intersect_category; typedef Arr_oblivious_side_tag Left_side_category; typedef Arr_oblivious_side_tag Bottom_side_category; typedef Arr_oblivious_side_tag Top_side_category; typedef Arr_oblivious_side_tag Right_side_category; - + typedef internal_Argt_traits::Not_X_Monotone Not_X_Monotone; - + typedef boost::variant< Arc1, Arc2, Not_X_Monotone > Curve_2; typedef boost::variant< Arc1, Arc2 > X_monotone_curve_2; private: CircularKernel ck; public: - + Arr_circular_line_arc_traits_2(const CircularKernel &k = CircularKernel()) : ck(k) {} typedef typename CircularKernel::Compare_x_2 Compare_x_2; typedef typename CircularKernel::Compare_xy_2 Compare_xy_2; - typedef typename - VariantFunctors::Construct_min_vertex_2 + typedef typename + VariantFunctors::Construct_min_vertex_2 Construct_min_vertex_2; - typedef - VariantFunctors::Construct_max_vertex_2 + typedef + VariantFunctors::Construct_max_vertex_2 Construct_max_vertex_2; - typedef VariantFunctors::Is_vertical_2 + typedef VariantFunctors::Is_vertical_2 Is_vertical_2; - typedef VariantFunctors::Compare_y_at_x_2 + typedef VariantFunctors::Compare_y_at_x_2 Compare_y_at_x_2; typedef VariantFunctors::Compare_y_to_right_2 - Compare_y_at_x_right_2; + Compare_y_at_x_right_2; typedef VariantFunctors::Equal_2 Equal_2; - typedef VariantFunctors::Make_x_monotone_2 + typedef VariantFunctors::Make_x_monotone_2 Make_x_monotone_2; - typedef VariantFunctors::Split_2 + typedef VariantFunctors::Split_2 Split_2; - typedef VariantFunctors::Intersect_2 + typedef VariantFunctors::Intersect_2 Intersect_2; - + Compare_x_2 compare_x_2_object() const { return ck.compare_x_2_object(); } Compare_xy_2 compare_xy_2_object() const { return ck.compare_xy_2_object(); } - Compare_y_at_x_2 compare_y_at_x_2_object() const + Compare_y_at_x_2 compare_y_at_x_2_object() const { return Compare_y_at_x_2(); } - Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const + Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const { return Compare_y_at_x_right_2(); } Equal_2 equal_2_object() const diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h index a7080aa1a445..f1640b280b0e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h @@ -270,18 +270,18 @@ class Arr_conic_traits_2 } else { - CGAL_precondition (x_res != SMALLER); - - if ((x_res = ker.compare_x_2_object() (p, cv.right())) == EQUAL) - { - q = cv.right(); - } - else - { - CGAL_precondition (x_res != LARGER); - - q = cv.point_at_x (p); - } + CGAL_precondition (x_res != SMALLER); + + if ((x_res = ker.compare_x_2_object() (p, cv.right())) == EQUAL) + { + q = cv.right(); + } + else + { + CGAL_precondition (x_res != LARGER); + + q = cv.point_at_x (p); + } } // Compare p with the a point of the curve with the same x coordinate. @@ -731,9 +731,9 @@ class Arr_conic_traits_2 CGAL_precondition (i == 0 || i == 1); if (i == 0) - return (CGAL::to_double(p.x())); + return (CGAL::to_double(p.x())); else - return (CGAL::to_double(p.y())); + return (CGAL::to_double(p.y())); } }; @@ -787,7 +787,7 @@ class Arr_conic_traits_2 if (cv.is_directed_right()) return (SMALLER); else - return (LARGER); + return (LARGER); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_consolidated_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_consolidated_curve_data_traits_2.h index 70a3e0a7acff..66c3c8f76199 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_consolidated_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_consolidated_curve_data_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -44,14 +44,14 @@ namespace CGAL { template class Arr_consolidated_curve_data_traits_2 : public Arr_curve_data_traits_2, + _Unique_list, _Consolidate_unique_lists, Data_> { private: typedef Arr_curve_data_traits_2, + _Unique_list, _Consolidate_unique_lists, Data_> Base; @@ -71,7 +71,7 @@ class Arr_consolidated_curve_data_traits_2 : typedef typename Base_traits_2::Multiplicity Multiplicity; typedef typename Base_traits_2::Has_left_category Has_left_category; - + typedef typename Base_traits_2::Has_merge_category Base_has_merge_category; typedef Tag_true Has_merge_category; typedef typename Base_traits_2::Has_do_intersect_category diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h index 64609205794a..877444cb066f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Ron Wein // Efi Fogel diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h index 5e51b9ff1075..ca98dc7ec5f0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Baruch Zukerman @@ -28,14 +28,14 @@ namespace CGAL { /*! \class * The default arrangement DCEL class. - * The Traits parameters corresponds to a geometric traits class, which + * The Traits parameters corresponds to a geometric traits class, which * defines the Point_2 and X_monotone_curve_2 types. */ template class Arr_default_dcel : public Arr_dcel_base, - Arr_halfedge_base, - Arr_face_base> + Arr_halfedge_base, + Arr_face_base> { public: @@ -61,4 +61,4 @@ class Arr_default_dcel : #include -#endif +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h index d9561ab7407c..f70b4dcb1fb0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h @@ -54,7 +54,7 @@ class Arr_default_overlay_traits : * Overlay_face_data. */ template + typename OverlayFaceData_> class Arr_face_overlay_traits : public _Arr_default_overlay_traits_base diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_enums.h b/Arrangement_on_surface_2/include/CGAL/Arr_enums.h index f0948d3834bb..9c52c3b5800d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_enums.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_enums.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s): Ron Wein // Efi Fogel @@ -42,7 +42,7 @@ inline OutputStream& operator<<( OutputStream& os, const Arr_curve_end& ce) { - + switch(ce) { case CGAL::ARR_MIN_END: os << "ARR_MIN_END"; @@ -74,7 +74,7 @@ inline OutputStream& operator<<( OutputStream& os, const Arr_halfedge_direction& dir) { - + switch(dir) { case CGAL::ARR_LEFT_TO_RIGHT: os << "ARR_LEFT_TO_RIGHT"; @@ -107,7 +107,7 @@ inline OutputStream& operator<<( OutputStream& os, const Arr_boundary_type& bt) { - + switch(bt) { case CGAL::ARR_OPEN: os << "ARR_OPEN"; @@ -154,7 +154,7 @@ inline OutputStream& operator<<( OutputStream& os, const Arr_parameter_space& ps) { - + switch (::CGAL::get_mode(os)) { case ::CGAL::IO::PRETTY: switch(ps) { @@ -183,7 +183,7 @@ OutputStream& operator<<( default: os << static_cast< int >(ps); } - + return os; } @@ -200,9 +200,9 @@ InputStream& operator>>( int i; is >> i; ps = static_cast< Arr_parameter_space >(i); - + return is; - + } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h index c400c45ce46e..c2e25828ee7d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -169,19 +169,19 @@ class Arr_extended_face : public FaceBase_ /*! \class * A DCEL class whose faces are extended with an auxiliary data field. - * The Traits parameter corresponds to a geometric traits class, which + * The Traits parameter corresponds to a geometric traits class, which * defines the Point_2 and X_monotone_curve_2 types. * The FaceData parameter specifies the object type stored with each face. */ template , - class HalfedgeBase_ = - Arr_halfedge_base, - class FaceBase_ = Arr_face_base> + class VertexBase_ = Arr_vertex_base, + class HalfedgeBase_ = + Arr_halfedge_base, + class FaceBase_ = Arr_face_base> class Arr_face_extended_dcel : public Arr_dcel_base > + HalfedgeBase_, + Arr_extended_face > { public: @@ -199,14 +199,14 @@ class Arr_face_extended_dcel : typedef typename HalfedgeBase_::template rebind Rebind_halfedge; typedef typename Rebind_halfedge::other Halfedge_base; - + public: typedef Arr_face_extended_dcel other; + Face_data, + Vertex_base, + Halfedge_base, + FaceBase_> other; }; /*! Default constructor. */ @@ -220,21 +220,21 @@ class Arr_face_extended_dcel : /*! \class * A DCEL class whose features are extended with auxiliary data fields. - * The Traits parameter corresponds to a geometric traits class, which + * The Traits parameter corresponds to a geometric traits class, which * defines the Point_2 and X_monotone_curve_2 types. * The VertexData, HalfedgeData and FaceData parameter specify the object types * stored with each vertex, halfegde and face, respectively. */ template , - class HalfedgeBase_ = - Arr_halfedge_base, - class FaceBase_ = Arr_face_base> + typename VertexData_, typename HalfedgeData_, typename FaceData_, + class VertexBase_ = Arr_vertex_base, + class HalfedgeBase_ = + Arr_halfedge_base, + class FaceBase_ = Arr_face_base> class Arr_extended_dcel : public Arr_dcel_base, - Arr_extended_halfedge, - Arr_extended_face > + Arr_extended_halfedge, + Arr_extended_face > { public: @@ -254,16 +254,16 @@ class Arr_extended_dcel : typedef typename HalfedgeBase_::template rebind Rebind_halfedge; typedef typename Rebind_halfedge::other Halfedge_base; - + public: typedef Arr_extended_dcel other; + Vertex_data, + Halfedge_data, + Face_data, + Vertex_base, + Halfedge_base, + FaceBase_> other; }; /*! Default constructor. */ @@ -279,4 +279,4 @@ class Arr_extended_dcel : #include -#endif +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h index 0c3eb865d222..1e03af5e1c6c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -188,15 +188,15 @@ class Arr_face_index_map : public Arr_observer virtual void before_merge_face (Face_handle /* f1 */, Face_handle f2, typename - Arrangement_2::Halfedge_handle /* e */) + Arrangement_2::Halfedge_handle /* e */) { // Update the number of faces. n_faces--; - + // Reduce memory consumption in case the number of faces has // drastically decreased. - if (2*n_faces+1 < rev_map.size() && - rev_map.size() / 2 >= MIN_REV_MAP_SIZE) + if (2*n_faces+1 < rev_map.size() && + rev_map.size() / 2 >= MIN_REV_MAP_SIZE) { rev_map.resize (rev_map.size() / 2); } @@ -207,7 +207,7 @@ class Arr_face_index_map : public Arr_observer if (index == n_faces) return; - + Face_handle last_f = rev_map[n_faces]; index_map[last_f] = index; rev_map[index] = last_f; @@ -220,13 +220,13 @@ class Arr_face_index_map : public Arr_observer //@} private: - + /*! Initialize the map for the given arrangement. */ void _init () { // Get the number of faces and allocate the reverse map accordingly. n_faces = static_cast(this->arrangement()->number_of_faces()); - + if (n_faces < MIN_REV_MAP_SIZE) rev_map.resize (MIN_REV_MAP_SIZE); else @@ -235,13 +235,13 @@ class Arr_face_index_map : public Arr_observer // Clear the current mapping. index_map.clear(); - // Create the initial mapping. + // Create the initial mapping. typename Arrangement_2::Face_iterator fit; Face_handle fh; unsigned int index = 0; for (fit = this->arrangement()->faces_begin(); - fit != this->arrangement()->faces_end(); ++fit, ++index) + fit != this->arrangement()->faces_end(); ++fit, ++index) { // Map the current face to the current index. fh = fit; @@ -250,7 +250,7 @@ class Arr_face_index_map : public Arr_observer } return; - } + } }; @@ -263,8 +263,8 @@ class Arr_face_index_map : public Arr_observer */ template unsigned int get (const CGAL::Arr_face_index_map& index_map, - typename Arrangement::Face_handle f) -{ + typename Arrangement::Face_handle f) +{ return (index_map[f]); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h index dd5e835bb313..9ff95ad4b08f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_partition_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_partition_traits_2.h index 0c4d544725f1..967989024aad 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_partition_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_partition_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ophir Setter @@ -19,13 +19,13 @@ #include /*! \file - * The partition traits class for geodesic arcs on the sphere enables - * the partition of geodesic polygons to convex polygons. It models the + * The partition traits class for geodesic arcs on the sphere enables + * the partition of geodesic polygons to convex polygons. It models the * concept YMonotonePartitionTraits_2. * This partition of geodesic polygons is garenteed to work only for polygons - * that are contained in a hemisphere and that do not intersect one of the - * boundaries. - * For larger polygons there is a chance that at least one steiner point may + * that are contained in a hemisphere and that do not intersect one of the + * boundaries. + * For larger polygons there is a chance that at least one steiner point may * have to be added; see manuscript by Prof. Dan Halperin from 2008. * PAY ATTENTION TO THE FACT THAT WE REVERSE THE ROLES OF X AND Y SO IT WILL * BE EASIER TO IMPLEMENT A MODEL FOR YMonotonePartitionTraits_2 (actually @@ -42,31 +42,31 @@ namespace CGAL { template ::Point_2> > -class Arr_geodesic_arc_on_sphere_partition_traits_2 +class Arr_geodesic_arc_on_sphere_partition_traits_2 : public Arr_geodesic_arc_on_sphere_traits_2< T_Kernel > { private: typedef Arr_geodesic_arc_on_sphere_partition_traits_2< T_Kernel > Self; typedef Arr_geodesic_arc_on_sphere_traits_2< T_Kernel > Base; - + public: - + /// \name PartitionTraits_2 concept //@{ - + typedef typename Base::Point_2 Point_2; - - /*! Class to represent polygon. Contain Vertex_const_iterator and access + + /*! Class to represent polygon. Contain Vertex_const_iterator and access * functions. */ class Polygon_2 : public Container_P { public: typedef typename Container_P::const_iterator Vertex_const_iterator; - + Vertex_const_iterator vertices_begin() const - { return this->begin();} - + { return this->begin();} + Vertex_const_iterator vertices_end() const { return this->end();} }; @@ -78,13 +78,13 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: /*! Constructor * \param traits the traits (in case it has state) */ Less_xy_2(const Self * traits) : m_traits(traits) {} - + /*! Compare two points lexigoraphically: by x, then by y. * We actually reversing the order, so x <--> y. * \param p1 the first enpoint directional point. @@ -99,10 +99,10 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { CGAL_precondition(p1.is_no_boundary()); CGAL_precondition(p2.is_no_boundary()); - + // compare y and then x (reverse the order of x and y). Comparison_result res = m_traits->compare_y(p1, p2); - if (res == EQUAL) + if (res == EQUAL) return m_traits->compare_x(p1, p2) == SMALLER; return res == SMALLER; // return m_traits->compare_xy(p1, p2) == SMALLER; @@ -118,7 +118,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: /*! Constructor @@ -141,14 +141,14 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { CGAL_precondition(p1.is_no_boundary()); CGAL_precondition(p2.is_no_boundary()); - + // compare x and then y (reverse the order of x and y). return m_traits->compare_xy(p1, p2) == SMALLER; } }; Less_yx_2 less_yx_2_object() const { return Less_yx_2(this); } - + /*! A functor that checks orientation of three points. */ @@ -157,7 +157,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: /*! Constructor @@ -167,13 +167,13 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 /*! Checks the orientation between three points. * We actually reversing the order, so x <--> y. - * \param p + * \param p * \param q - * \param r - * \return CGAL::LEFT_TURN - r lies to the "left" of the oriented line l + * \param r + * \return CGAL::LEFT_TURN - r lies to the "left" of the oriented line l * defined by p and q (do not forget that x <--> y. * CGAL::RIGHT_TURN - r lies to the "right" of l - * CGAL::COLLINEAR - r lies on l. + * CGAL::COLLINEAR - r lies on l. * \pre p does not lie on the boundary. * \pre q does not lie on the boundary. * \pre r does not lie on the boundary. @@ -187,16 +187,16 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 CGAL_precondition(p.is_no_boundary()); CGAL_precondition(q.is_no_boundary()); CGAL_precondition(r.is_no_boundary()); - - // the orientation is determined by the relative position of r with + + // the orientation is determined by the relative position of r with // respect to the plane that contains p and q. - typename Base::Vector_3 normal = + typename Base::Vector_3 normal = m_traits->construct_cross_product_vector_3_object() (p.vector(), q.vector()); Oriented_side res = CGAL::sign(normal * r.vector()); - return (res == ON_NEGATIVE_SIDE) ? RIGHT_TURN : + return (res == ON_NEGATIVE_SIDE) ? RIGHT_TURN : ((res == ON_POSITIVE_SIDE) ? LEFT_TURN : COLLINEAR); } }; @@ -210,7 +210,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { protected: const Self * m_traits; - + public: Left_turn_2 (const Self * traits) : m_traits(traits) {} @@ -228,7 +228,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 * be used here as compare_y_2. * */ typedef typename Base::Compare_x_2 Compare_y_2; - + Compare_y_2 compare_y_2_object() const {return Base::compare_x_2_object(); } @@ -239,14 +239,14 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: - + /*! Constructor * \param traits the traits (in case it has state) */ Compare_x_2(const Self * traits) : m_traits(traits) {} - + /*! Compare two points by y coordinate. * We actually reversing the order, so x <--> y. @@ -262,25 +262,25 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { CGAL_precondition(p1.is_no_boundary()); CGAL_precondition(p2.is_no_boundary()); - + // compare y and then x (reverse the order of x and y). return m_traits->compare_y(p1, p2); } }; Compare_x_2 compare_x_2_object() const { return Compare_x_2(this); } - + //@} - + /// \name ConvexPartitionIsValidTraits_2 concept /// For now, we have a stub implementation. I am not sure how easy it is /// to create the real implementation. //@{ - struct Is_convex_2 + struct Is_convex_2 { template Is_convex_2(T) {} - + template bool operator ()(InputIterator first, InputIterator beyond) const { return true; } @@ -288,7 +288,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 Is_convex_2 is_convex_2_object() const { return Is_convex_2(); } - struct Is_valid + struct Is_valid { template Is_valid(T) {} @@ -298,9 +298,9 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 }; // Is_valid is_valid_object() const { return Is_valid(); } - + //@} - + }; @@ -314,10 +314,10 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 // // This file is part of CGAL (www.cgal.org). // -// $URL$ +// $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ophir Setter @@ -326,13 +326,13 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 #define CGAL_ARR_GEODESIC_ARC_ON_SPHERE_PARTITION_TRAITS_2_H /*! \file - * The partition traits class for geodesic arcs on the sphere enables - * the partition of geodesic polygons to convex polygons. It models the + * The partition traits class for geodesic arcs on the sphere enables + * the partition of geodesic polygons to convex polygons. It models the * concept YMonotonePartitionTraits_2. * This partition of geodesic polygons is garenteed to work only for polygons - * that are contained in a hemisphere and that do not intersect one of the - * boundaries. - * For larger polygons there is a chance that at least one steiner point may + * that are contained in a hemisphere and that do not intersect one of the + * boundaries. + * For larger polygons there is a chance that at least one steiner point may * have to be added; see manuscript by Prof. Dan Halperin from 2008. * PAY ATTENTION TO THE FACT THAT WE REVERSE THE ROLES OF X AND Y SO IT WILL * BE EASIER TO IMPLEMENT A MODEL FOR YMonotonePartitionTraits_2 (actually @@ -349,35 +349,35 @@ namespace CGAL { template ::Point_2> > -class Arr_geodesic_arc_on_sphere_partition_traits_2 +class Arr_geodesic_arc_on_sphere_partition_traits_2 : public Arr_geodesic_arc_on_sphere_traits_2< T_Kernel > { private: typedef Arr_geodesic_arc_on_sphere_partition_traits_2< T_Kernel > Self; typedef Arr_geodesic_arc_on_sphere_traits_2< T_Kernel > Base; - + public: - + /// \name PartitionTraits_2 concept //@{ - + typedef typename Base::Point_2 Point_2; - - /*! Class to represent polygon. Contain Vertex_const_iterator and access + + /*! Class to represent polygon. Contain Vertex_const_iterator and access * functions. */ class Polygon_2 : public Container_P { public: typedef typename Container_P::const_iterator Vertex_const_iterator; - + Vertex_const_iterator vertices_begin() const - { return this->begin();} - + { return this->begin();} + Vertex_const_iterator vertices_end() const { return this->end();} }; - + /*! A functor that compares two points lexigoraphically: by x, then by y. */ class Less_xy_2 @@ -385,14 +385,14 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: /*! Constructor * \param traits the traits (in case it has state) */ Less_xy_2(const Self * traits) : m_traits(traits) {} - + /*! Compare two points lexigoraphically: by x, then by y. * We actually reversing the order, so x <--> y. * \param p1 the first enpoint directional point. @@ -407,10 +407,10 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { CGAL_precondition(p1.is_no_boundary()); CGAL_precondition(p2.is_no_boundary()); - + // compare y and then x (reverse the order of x and y). Comparison_result res = m_traits->compare_y(p1, p2); - if (res == EQUAL) + if (res == EQUAL) return compare_x(p1, p2) == SMALLER; return res == SMALLER; // return m_traits->compare_xy(p1, p2) == SMALLER; @@ -426,7 +426,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: /*! Constructor @@ -448,14 +448,14 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { CGAL_precondition(p1.is_no_boundary()); CGAL_precondition(p2.is_no_boundary()); - + // compare x and then y (reverse the order of x and y). return m_traits->compare_xy(p1, p2) == SMALLER; } }; Less_yx_2 less_yx_2_object() const { return Less_yx_2(this); } - + /*! A functor that checks orientation of three points. */ @@ -464,9 +464,9 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: - + /*! Constructor * \param traits the traits (in case it has state) */ @@ -474,13 +474,13 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 /*! Checks the orientation between three points. * We actually reversing the order, so x <--> y. - * \param p + * \param p * \param q - * \param r - * \return CGAL::LEFT_TURN - r lies to the "left" of the oriented line l + * \param r + * \return CGAL::LEFT_TURN - r lies to the "left" of the oriented line l * defined by p and q (do not forget that x <--> y. * CGAL::RIGHT_TURN - r lies to the "right" of l - * CGAL::COLLINEAR - r lies on l. + * CGAL::COLLINEAR - r lies on l. * \pre p does not lie on the boundary. * \pre q does not lie on the boundary. * \pre r does not lie on the boundary. @@ -494,16 +494,16 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 CGAL_precondition(p.is_no_boundary()); CGAL_precondition(q.is_no_boundary()); CGAL_precondition(r.is_no_boundary()); - - // the orientation is determined by the relative position of r with + + // the orientation is determined by the relative position of r with // respect to the plane that contains p and q. - typename Base::Vector_3 normal = + typename Base::Vector_3 normal = m_traits->construct_cross_product_vector_3_object() (p.vector(), q.vector()); Oriented_side res = m_traits->oriented_side(normal, r); - return (res == ON_NEGATIVE_SIDE) ? RIGHT_TURN : + return (res == ON_NEGATIVE_SIDE) ? RIGHT_TURN : ((res == ON_POSITIVE_SIDE) ? LEFT_TURN : COLLINEAR); } }; @@ -517,7 +517,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { protected: const Self * m_traits; - + public: Left_turn_2 (const Self * traits) : m_traits(traits) {} @@ -536,7 +536,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 * be used here as compare_y_2. */ typedef typename Base::Compare_x_2 Compare_y_2; - + Compare_y_2 compare_y_2_object() const {return Base::compare_x_2_object(); } /*! A functor that compares two points by x coordinate. @@ -546,7 +546,7 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 protected: /*! The traits (in case it has state) */ const Self * m_traits; - + public: /*! Constructor @@ -568,22 +568,22 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 { CGAL_precondition(p1.is_no_boundary()); CGAL_precondition(p2.is_no_boundary()); - + // compare y and then x (reverse the order of x and y). return m_traits->compare_y(p1, p2); } }; Compare_x_2 compare_x_2_object() const { return Compare_x_2(this); } - + //@} - + /// \name ConvexPartitionIsValidTraits_2 concept /// For now, we have a stub implementation. I am not sure how easy it is /// to create the real implementation. //@{ - class Is_convex_2 + class Is_convex_2 { template bool operator ()(InputIterator first, InputIterator beyond) const @@ -591,9 +591,9 @@ class Arr_geodesic_arc_on_sphere_partition_traits_2 }; Is_convex_2 is_convex_2_object() const { return Is_convex_2(); } - + //@} - + }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index f25210183a86..8dff925bff6b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -110,7 +110,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public T_Kernel { #elif (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_8_Y_6) CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, -8, 6); - + #elif (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_11_Y_7) CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, -11, 7); #else @@ -2872,14 +2872,14 @@ class Arr_geodesic_arc_on_sphere_3 : /*! Copy constructor * \param other the other arc */ -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Arr_geodesic_arc_on_sphere_3 (const Arr_geodesic_arc_on_sphere_3& other) : Base(other) { m_is_x_monotone = other.m_is_x_monotone; } #endif - + /*! Constructor * \param src the source point of the arc * \param trg the target point of the arc diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h index 7141873d6f45..ebfc5cef09b9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Efi Fogel @@ -53,7 +53,7 @@ class Arr_plane_3 { /*! The z coefficient */ FT m_c; - + public: /*! Default Constructor */ Arr_plane_3() : m_a(0), m_b(0), m_c(0) {} @@ -90,7 +90,7 @@ class Arr_plane_3 { /*! Obtain the z coefficient */ const FT & c() const { return m_c; } - + /*! Obtain the i-th coefficient of the plane * \param i the index of the coefficient * \return the i-th coefficient @@ -125,8 +125,8 @@ class Arr_plane_3 { { Kernel kernel; typename Kernel::Plane_3 base_plane(m_a, m_b, m_c, 0); - Vector_3 v1 = kernel.construct_base_vector_3_object()(base_plane, 1); - Vector_3 v2 = kernel.construct_base_vector_3_object()(base_plane, 2); + Vector_3 v1 = kernel.construct_base_vector_3_object()(base_plane, 1); + Vector_3 v2 = kernel.construct_base_vector_3_object()(base_plane, 2); Vector_3 v3 = kernel.construct_orthogonal_vector_3_object()(base_plane); FT denom = v2[1]*v3[0]*v1[2] - v2[0]*v3[1]*v1[2] + v3[2]*v2[0]*v1[1] + @@ -135,7 +135,7 @@ class Arr_plane_3 { v2[0]*v3[1]*p[2] - v3[2]*v2[0]*p[1] - v2[2]*v3[1]*p[0]) / denom; FT y = (v1[1]*v3[2]*p[0] - v1[1]*v3[0]*p[2] - v3[1]*p[0]*v1[2] + v3[1]*v1[0]*p[2] + p[1]*v3[0]*v1[2] - p[1]*v3[2]*v1[0]) / denom; - + return Point_2(x, y); } @@ -155,7 +155,7 @@ class Arr_plane_3 { std::cout << "(a, b, c): " << a() << "," << b() << "," << c() << std::endl; #endif - + if (i == 0) { CGAL_assertion(m_a != 0); FT y = p_2.x(); @@ -268,7 +268,7 @@ inline std::ostream & operator<<(std::ostream & os, { os << plane[0] << ", " << plane[1] << ", " << plane[2]; return os; -} +} } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h index 1278c0837e4a..761710d8a890 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Iddo Hanniel // Ron Wein @@ -22,8 +22,8 @@ */ #include -#include -#include +#include +#include #include #include @@ -37,7 +37,7 @@ namespace CGAL { * equals B(t) for some point t_min <= t <= t_max. We also store a bounding * polynomial for the point (obtain by de Casteljau's algorithm). */ -template +template struct _Bez_point_bound { /*! \enum Type @@ -75,7 +75,7 @@ struct _Bez_point_bound /*! Constructor with parameters. */ _Bez_point_bound (Type _type, const Control_points& _ctrl, - const NT& _t_min, const NT& _t_max, + const NT& _t_min, const NT& _t_max, bool _can_refine) : type (_type), ctrl (_ctrl), @@ -87,7 +87,7 @@ struct _Bez_point_bound /*! \struct _Bez_point_bbox * A bounding box for a point on a Bezier curve. */ -template +template struct _Bez_point_bbox { typedef Kernel_ Kernel; @@ -107,7 +107,7 @@ struct _Bez_point_bbox /*! Constructor with parameters. */ _Bez_point_bbox (const NT& _min_x, const NT& _max_x, - const NT& _min_y, const NT& _max_y) : + const NT& _min_y, const NT& _max_y) : min_x(_min_x), max_x(_max_x), min_y(_min_y), max_y(_max_y) {} @@ -379,7 +379,7 @@ class Bezier_bounding_rational_traits const NT& t_max2 = in_pt.bound2.t_max; bool can_refine2 = can_refine (cp2, t_min2, t_max2); - if (! can_refine1 || ! can_refine2) + if (! can_refine1 || ! can_refine2) { // Failed in the bounded approach - stop the subdivision and indicate // that the subdivision has failed. @@ -398,7 +398,7 @@ class Bezier_bounding_rational_traits std::back_inserter(cp1a), std::front_inserter(cp1b)); - Control_points cp2a, cp2b; + Control_points cp2a, cp2b; const NT t_mid2 = (t_min2 + t_max2) / 2; bisect_control_polygon_2 (cp2.begin(), cp2.end(), @@ -411,7 +411,7 @@ class Bezier_bounding_rational_traits const bool can_refine_pt_cp1b = can_refine (cp1b, t_mid1, t_max1); const bool can_refine_pt_cp2a = can_refine (cp2a, t_min2, t_mid2); const bool can_refine_pt_cp2b = can_refine (cp2b, t_mid2, t_max2); - + if (! can_refine_pt_cp1a || ! can_refine_pt_cp1b || ! can_refine_pt_cp2a || ! can_refine_pt_cp2b) { @@ -752,10 +752,10 @@ class Bezier_bounding_rational_traits } // Set the bounding box. - bez_bbox.min_x = min_x->x(); - bez_bbox.max_x = max_x->x(); - bez_bbox.min_y = min_y->y(); - bez_bbox.max_y = max_y->y(); + bez_bbox.min_x = min_x->x(); + bez_bbox.max_x = max_x->x(); + bez_bbox.min_y = min_y->y(); + bez_bbox.max_y = max_y->y(); return; } //@} @@ -780,7 +780,7 @@ class Bezier_bounding_rational_traits // set as the "reference" comparison result. typename Control_points::const_iterator pt_curr = cp.begin(); typename Control_points::const_iterator pt_end = cp.end(); - typename Control_points::const_iterator pt_next = pt_curr; + typename Control_points::const_iterator pt_next = pt_curr; ++pt_next; while (pt_next != pt_end) @@ -895,7 +895,7 @@ class Bezier_bounding_rational_traits updated_span = true; } } - else + else { // Check if we need to update the maximal vector in the span. if (f_orientation (f_construct_point (ORIGIN, v), @@ -944,14 +944,14 @@ class Bezier_bounding_rational_traits const Direction_2 dir_r1 = f_construct_direction (v_max1); const Direction_2 dir_l2 = f_construct_direction (v_min2); const Direction_2 dir_r2 = f_construct_direction (v_max2); - + //use the directions to test equality of spans if ( f_equal (dir_l1, dir_l2) && f_equal (dir_r1, dir_r2)) //spans are identical - return (true); + return (true); if ( f_equal (dir_l1, dir_r1) && f_equal (dir_r2, dir_l2) && f_equal (dir_l1, -dir_l2)) //spans are identical but opposite - return (true); - + return (true); + // Check whether any of the vectors of the second span (or their // opposite vectors) is between the vectors of the first span. if (! f_equal (dir_l1, dir_r1) && @@ -1135,11 +1135,11 @@ class Bezier_bounding_rational_traits std::set& iept_params, std::list& ipts) { - // Check if we got to subdivision termination criteria. + // Check if we got to subdivision termination criteria. const bool can_refine1 = can_refine (cp1, t_min1, t_max1); const bool can_refine2 = can_refine (cp2, t_min2, t_max2);; - if (! can_refine1 || ! can_refine2) + if (! can_refine1 || ! can_refine2) { // It is not possible to further refine the approximation, so we stop // the recursive subdivision, and construct an output intersection point @@ -1239,10 +1239,10 @@ class Bezier_bounding_rational_traits const Oriented_side or_2b_s1 = f_oriented_side (skew2b, s1); const Oriented_side or_2b_t1 = f_oriented_side (skew2b, t1); - const bool s1_t1_are_opposite = + const bool s1_t1_are_opposite = ((or_2a_s1 == CGAL::opposite (or_2a_t1)) && (or_2b_s1 == CGAL:: opposite (or_2b_t1)) - ) || + ) || ( skew2a==skew2b && or_2a_s1!=or_2a_t1 ); const Oriented_side or_1a_s2 = f_oriented_side (skew1a, s2); @@ -1253,10 +1253,10 @@ class Bezier_bounding_rational_traits const bool s2_t2_are_opposite = ((or_1a_s2 == CGAL::opposite (or_1a_t2)) && - (or_1b_s2 == CGAL::opposite (or_1b_t2)))|| + (or_1b_s2 == CGAL::opposite (or_1b_t2)))|| ( skew1a==skew1b && or_1a_s2!=or_1a_t2 ); - if (s1_t1_are_opposite && s2_t2_are_opposite) + if (s1_t1_are_opposite && s2_t2_are_opposite) { // Construct a finer bounding box for the intersection point from // the intersection of the two skewed bounding boxes. @@ -1273,7 +1273,7 @@ class Bezier_bounding_rational_traits aux_vec.push_back(p); res = f_intersect (skew1a, skew2b); - if (! assign(p, res)) + if (! assign(p, res)) { CGAL_error(); } @@ -1287,7 +1287,7 @@ class Bezier_bounding_rational_traits aux_vec.push_back(p); res = f_intersect (skew1b, skew2b); - if (!assign(p, res)) + if (!assign(p, res)) { CGAL_error(); } @@ -1313,7 +1313,7 @@ class Bezier_bounding_rational_traits // Apply de Casteljau's algorithm and bisect both bounding polylines. Control_points cp1a, cp1b; const NT t_mid1 = (t_min1 + t_max1) / 2; - + bisect_control_polygon_2 (cp1.begin(), cp1.end(), std::back_inserter(cp1a), std::front_inserter(cp1b)); @@ -1357,13 +1357,13 @@ class Bezier_bounding_rational_traits ipts); _compute_intersection_points (cp1a, t_min1, t_mid1, - cp2b, t_mid2, t_max2, + cp2b, t_mid2, t_max2, spans_overlap, iept_params, ipts); _compute_intersection_points (cp1b, t_mid1, t_max1, - cp2a, t_min2, t_mid2, + cp2a, t_min2, t_mid2, spans_overlap, iept_params, ipts); @@ -1393,7 +1393,7 @@ class Bezier_bounding_rational_traits { // \todo Handle the special case of degree two curves. - // Check if we got to subdivision termination criteria. + // Check if we got to subdivision termination criteria. if (! can_refine (cp, t_min, t_max)) { // It is not possible to further refine the approximation, so we stop diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_cache.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_cache.h index 9969d9f52a6a..87a104c032fd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_cache.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_cache.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -78,7 +78,7 @@ template class _Bezier_cache typename Intersection_list::const_iterator Intersection_iter; //@} - + private: typedef std::map::get_vertical_tangencies // such that X'(t) = 0, and store them in the cache. Vertical_tangency_list& vert_tang_list = vert_tang_map[id]; const Polynomial& polyX_der = nt_traits.derive (polyX); - + nt_traits.compute_polynomial_roots (polyX_der, 0, 1, std::back_inserter(vert_tang_list)); return (vert_tang_list); @@ -414,7 +414,7 @@ _Bezier_cache::get_intersections // s-values and t-values reported lie in the range [0,1]. We have // to pair them together. Note that the numbers of s-values and t-values //can be different as a s-value in [0,1] may correspond to a t-values - //outside this range. To make the pairing correct, we choose the one with + //outside this range. To make the pairing correct, we choose the one with //less values and look amongst other values the correct one (thus the swapt below). // Compute all points on (X_1, Y_1) that match an s-value from the list. @@ -463,7 +463,7 @@ _Bezier_cache::get_intersections bool swapt=pts1.size() > pts2.size(); if (swapt) std::swap(pts1_ptr,pts2_ptr); - + for (pit1 = pts1_ptr->begin(); pit1 != pts1_ptr->end(); ++pit1) { // Construct a vector of distances from the current point to all other @@ -479,9 +479,9 @@ _Bezier_cache::get_intersections dist_vec[k] = Distance_iter (dx*dx + dy*dy, pit2); } - + // Sort the vector according to the distances from *pit1. - std::sort (dist_vec.begin(), dist_vec.end(), + std::sort (dist_vec.begin(), dist_vec.end(), Less_distance_iter()); // Go over the vector entries, starting from the most distant from *pit1 @@ -534,7 +534,7 @@ _Bezier_cache::get_intersections // Check that s- and t-values both lie in the legal range of [0,1]. CGAL_assertion(CGAL::sign (s) != NEGATIVE && CGAL::compare (s, one) != LARGER && CGAL::sign (t) != NEGATIVE && CGAL::compare (t, one) != LARGER); - + if (!swapt) info.first.push_back (Intersection_point_2 (s, t,pit1->x, pit1->y)); else @@ -614,7 +614,7 @@ bool _Bezier_cache::_intersection_params // Consruct the bivariate polynomial that corresponds to Equation II. const int degY_2 = nt_traits.degree (polyY_2); std::vector coeffsY_st (degY_2 < 0 ? 1 : (degY_2 + 1)); - + for (k = degY_2; k >= 0; k--) { coeff = nt_traits.get_coefficient (polyY_2, k) * normY_1; @@ -684,9 +684,9 @@ void _Bezier_cache::_self_intersection_params // Consruct the bivariate polynomial that corresponds to Equation II. const int degY = nt_traits.degree (polyY); CGAL_assertion(degY > 0); - if (degY <= 0) return; //no self intersection if Y is constant + if (degY <= 0) return; //no self intersection if Y is constant std::vector coeffsY_st (degY); - + coeffs = new Integer [degY]; for (i = 0; i < degY; i++) @@ -732,25 +732,25 @@ _Bezier_cache::_compute_resultant std::vector > mat (dim); std::vector exp_fact (dim); - + for (i = 0; i < dim; i++) { mat[i].resize (dim); exp_fact[i] = 0; - + for (j = 0; j < dim; j++) mat[i][j] = zero_poly; } - + // Initialize it with copies of the two bivariate polynomials. for (i = 0; i < n; i++) for (j = 0; j <= m; ++j) mat[i][i + j] = bp1[j]; - + for (i = 0; i < m; i++) for (j = 0; j <= n;++j) mat[n + i][i + j] = bp2[j]; - + // Perform Gaussian elimination on the Sylvester matrix. The goal is to // reach an upper-triangular matrix, whose diagonal elements are mat[0][0] // to mat[dim-1][dim-1], such that the determinant of the original matrix @@ -780,7 +780,7 @@ _Bezier_cache::_compute_resultant // If the current diagonal value is a zero polynomial, try to replace // the current i'th row with a row with a higher index k, such that // mat[k][i] is not a zero polynomial. - + found_row = false; for (k = i + 1; k < dim; k++) { @@ -790,7 +790,7 @@ _Bezier_cache::_compute_resultant break; } } - + if (found_row) { // Swap the i'th and the k'th rows (note that we start from the i'th @@ -802,7 +802,7 @@ _Bezier_cache::_compute_resultant mat[i][j] = mat[k][j]; mat[k][j] = value; } - + // Swapping two rows should change the sign of the determinant. // We therefore swap the sign of the normalization factor. sign_fact = -sign_fact; @@ -814,7 +814,7 @@ _Bezier_cache::_compute_resultant return (mat[i][i]); } } - + // Zero the whole i'th column of the following rows. for (k = i + 1; k < dim; k++) { @@ -822,12 +822,12 @@ _Bezier_cache::_compute_resultant { value = mat[k][i]; mat[k][i] = zero_poly; - + for (j = i + 1; j < dim; j++) { - mat[k][j] = mat[k][j] * mat[i][i] - mat[i][j] * value; + mat[k][j] = mat[k][j] * mat[i][i] - mat[i][j] * value; } - + // We multiplied the current row by the i'th diagonal entry, thus // multipling the determinant value by it. We therefore increment // the exponent of mat[i][i] in the normalization factor. @@ -841,7 +841,7 @@ _Bezier_cache::_compute_resultant const Integer sgn (sign_fact); Polynomial det_factor = nt_traits.construct_polynomial (&sgn, 0); Polynomial diag_prod = mat[dim - 1][dim - 1]; - + CGAL_assertion (exp_fact [dim - 1] == 0); for (i = 0; i+2 <= dim; ++i) { @@ -856,20 +856,20 @@ _Bezier_cache::_compute_resultant { diag_prod *= mat[i][i]; } - + for (j = 0; j < exp_fact[i]; j++) det_factor *= mat[i][i]; } - + // In case of a trivial normalization factor, just return the product // of diagonal elements. if (nt_traits.degree(det_factor) == 0) return (diag_prod); - + // Divide the product of diagonal elements by the normalization factor // and obtain the determinant (note that we should have no remainder). Polynomial det, rem; - + det = nt_traits.divide (diag_prod, det_factor, rem); CGAL_assertion (nt_traits.degree(rem) < 0); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h index b124ee22ce82..62312301940d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Iddo Hanniel @@ -45,7 +45,7 @@ template class _Bezier_point_2_rep { - friend class _Bezier_point_2; public: @@ -66,7 +66,7 @@ class _Bezier_point_2_rep typedef _Bezier_point_2_rep Self; + Bounding_traits> Self; private: @@ -144,7 +144,7 @@ class _Bezier_point_2_rep } /*! Destructor. */ - ~Originator() + ~Originator() { if (p_t != nullptr) delete p_t; @@ -205,7 +205,7 @@ class _Bezier_point_2_rep return (p_t != nullptr); } - /*! + /*! * Get the algebraic parameter. * \pre The parameter value is available. */ @@ -216,13 +216,13 @@ class _Bezier_point_2_rep } /*! - * Set the parameter value. + * Set the parameter value. * \pre The parameter value is not yet set. */ void set_parameter (const Algebraic& t) { CGAL_precondition (p_t == nullptr); - + p_t = new Algebraic (t); // Update the Bez_point_bound by converting t to an interval of doubles @@ -266,7 +266,7 @@ class _Bezier_point_2_rep /*! Constructor given control points an a t-range. */ Subcurve (const Control_points& _ctrl, - const BoundNT& _tmin, + const BoundNT& _tmin, const BoundNT& _tmax) : ctrl (_ctrl), t_min (_tmin), @@ -274,7 +274,7 @@ class _Bezier_point_2_rep {} /*! Constructor given a t-range. */ - Subcurve (const BoundNT& _tmin, + Subcurve (const BoundNT& _tmin, const BoundNT& _tmax) : t_min (_tmin), t_max (_tmax) @@ -326,7 +326,7 @@ class _Bezier_point_2_rep * \param x The exact x-coordinate. * \param y The exact y-coordinate. */ - _Bezier_point_2_rep (const Algebraic& x, const Algebraic& y, bool) : + _Bezier_point_2_rep (const Algebraic& x, const Algebraic& y, bool) : p_rat_x (nullptr), p_rat_y (nullptr) { @@ -335,9 +335,9 @@ class _Bezier_point_2_rep // Initialize the bounding box. Nt_traits nt_traits; - const std::pair& x_bnd = + const std::pair& x_bnd = nt_traits.double_interval (x); - const std::pair& y_bnd = + const std::pair& y_bnd = nt_traits.double_interval (y); _bbox.min_x = x_bnd.first; @@ -433,7 +433,7 @@ class _Bezier_point_2_rep p_alg_y = new Algebraic (*(pt.p_alg_y)); if (pt.p_rat_y != nullptr) p_rat_y = new Rational (*(pt.p_rat_y)); - + _origs = pt._origs; _bbox = pt._bbox; @@ -476,12 +476,12 @@ class _Bezier_point_2_rep * Determines the vertical position of the point with respect to an * x-monotone subcurve, given by its control polygon. * \param cp The control polygon of the subcurve. - * \param t_min Defines the smallest parameter value of the subcurve. - * \param t_max Defines the largest parameter value of the subcurve. + * \param t_min Defines the smallest parameter value of the subcurve. + * \param t_max Defines the largest parameter value of the subcurve. * \return SMALLER if the point is located below the curve; * LARGER if the point is located above the curve; * EQUAL if we cannot determine its precise position. - */ + */ Comparison_result vertical_position (const Control_points& cp, const BoundNT& t_min, const BoundNT& t_max); @@ -507,7 +507,7 @@ class _Bezier_point_2_rep void _make_exact (Bezier_cache& cache); }; -template class _Bezier_point_2 : public Handle_for<_Bezier_point_2_rep (_rep()); - + return (rep._refine()); } @@ -715,7 +715,7 @@ class _Bezier_point_2 : void fit_to_bbox () const { Bpt_rep& rep = const_cast (_rep()); - + return (rep._fit_to_bbox()); } @@ -738,7 +738,7 @@ class _Bezier_point_2 : * \return The comparison result; */ Comparison_result compare_x (const Self& pt, - Bezier_cache& cache) const + Bezier_cache& cache) const { if (this->identical (pt)) return (EQUAL); @@ -758,7 +758,7 @@ class _Bezier_point_2 : * \return The comparison result; */ Comparison_result compare_xy (const Self& pt, - Bezier_cache& cache) const + Bezier_cache& cache) const { if (this->identical (pt)) return EQUAL; @@ -776,12 +776,12 @@ class _Bezier_point_2 : CGAL_assertion (this->identical (pt)); } - + return (res); } /*! - * Determine if the two points are equal. + * Determine if the two points are equal. */ bool equals (const Self& pt, Bezier_cache& cache) const @@ -793,8 +793,8 @@ class _Bezier_point_2 : * Determines the vertical position of the point with respect to an * x-monotone subcurve, given by its control polygon. * \param cp The control polygon of the subcurve. - * \param t_min Defines the smallest parameter value of the subcurve. - * \param t_max Defines the largest parameter value of the subcurve. + * \param t_min Defines the smallest parameter value of the subcurve. + * \param t_max Defines the largest parameter value of the subcurve. * \return SMALLER if the point is located below the curve; * LARGER if the point is located above the curve; * EQUAL if we cannot determine its precise position. @@ -925,9 +925,9 @@ class _Bezier_point_2 : } /*! Get the bounding box of the point. */ - void get_bbox (typename Bounding_traits::NT& min_x, - typename Bounding_traits::NT& min_y, - typename Bounding_traits::NT& max_x, + void get_bbox (typename Bounding_traits::NT& min_x, + typename Bounding_traits::NT& min_y, + typename Bounding_traits::NT& max_x, typename Bounding_traits::NT& max_y) const { min_x = _rep()._bbox.min_x; @@ -955,10 +955,10 @@ class _Bezier_point_2 : /*! * Exporter for Bezier points. */ -template -std::ostream& -operator<< (std::ostream& os, +std::ostream& +operator<< (std::ostream& os, const _Bezier_point_2 & pt) { @@ -969,9 +969,9 @@ operator<< (std::ostream& os, else { typename Bounding_traits::NT min_x, min_y, max_x, max_y; - + pt.get_bbox(min_x, min_y, max_x, max_y); - os << '~' << CGAL::to_double ((min_x + max_x) / 2) + os << '~' << CGAL::to_double ((min_x + max_x) / 2) << " ~" << CGAL::to_double ((min_y + max_y) / 2); } @@ -1061,16 +1061,16 @@ _Bezier_point_2_rep::_Bezier_point_2_rep // Set the point coordinates. const Alg_point_2 p = B (t0); - + p_alg_x = new Algebraic (p.x()); p_alg_y = new Algebraic (p.y()); - + // Set the bounding box for this point, by converting x, y to two ranges // of doubles. Nt_traits nt_traits; - const std::pair& x_bnd = + const std::pair& x_bnd = nt_traits.double_interval (*p_alg_x); - const std::pair& y_bnd = + const std::pair& y_bnd = nt_traits.double_interval (*p_alg_y); _bbox.min_x = x_bnd.first; @@ -1096,16 +1096,16 @@ _Bezier_point_2_rep::_Bezier_point_2_rep // Set the point coordinates. const Alg_point_2 p = B (t0); - + p_alg_x = new Algebraic (p.x()); p_alg_y = new Algebraic (p.y()); - + // Set the bounding box for this point, by converting x, y to two ranges // of doubles. Nt_traits nt_traits; - const std::pair& x_bnd = + const std::pair& x_bnd = nt_traits.double_interval (*p_alg_x); - const std::pair& y_bnd = + const std::pair& y_bnd = nt_traits.double_interval (*p_alg_y); _bbox.min_x = x_bnd.first; @@ -1138,7 +1138,7 @@ _Bezier_point_2_rep::compare_x // Compare the x-ranges of the bounding boxes. if (CGAL::compare (_bbox.max_x, pt._bbox.min_x) == SMALLER) return (SMALLER); - + if (CGAL::compare (_bbox.min_x, pt._bbox.max_x) == LARGER) return (LARGER); @@ -1174,7 +1174,7 @@ _Bezier_point_2_rep::compare_x { if (can_refine1) can_refine1 = this->_refine(); - + if (! can_refine1) this->_make_exact (cache); } @@ -1187,7 +1187,7 @@ _Bezier_point_2_rep::compare_x { if (can_refine2) can_refine2 = pt._refine(); - + if (! can_refine2) pt._make_exact (cache); } @@ -1318,7 +1318,7 @@ _Bezier_point_2_rep::vertical_position bisect_control_polygon_2 (iter->ctrl.begin(), iter->ctrl.end(), std::back_inserter(scv_left.ctrl), std::front_inserter(scv_right.ctrl)); - + subcurves.insert (iter, scv_left); subcurves.insert (iter, scv_right); subcurves.erase(iter++); @@ -1340,7 +1340,7 @@ _Bezier_point_2_rep::vertical_position // If we got here without entering one of the clauses above, // then iter has not been incremented yet. - ++iter; + ++iter; } // If we reached here without splitting a subcurve, then we have a @@ -1415,7 +1415,7 @@ bool _Bezier_point_2_rep::_refine () return (true); } - + if (orig1.point_bound().type == Bez_point_bound::INTERSECTION_PT) { CGAL_assertion(_origs.size() == 2); @@ -1536,7 +1536,7 @@ void _Bezier_point_2_rep::_fit_to_bbox () template void _Bezier_point_2_rep::_make_exact (Bezier_cache& cache) -{ +{ if (is_exact()) return; @@ -1571,7 +1571,7 @@ void _Bezier_point_2_rep::_make_exact Originator& orig = const_cast (*org_it); orig.set_parameter (*vt_it); - + // Evaluate the curve at the given parameter value. const Alg_point_2& p = org_it->curve() (*vt_it); @@ -1580,9 +1580,9 @@ void _Bezier_point_2_rep::_make_exact // Update the bounding box. Nt_traits nt_traits; - const std::pair& x_bnd = + const std::pair& x_bnd = nt_traits.double_interval (*p_alg_x); - const std::pair& y_bnd = + const std::pair& y_bnd = nt_traits.double_interval (*p_alg_y); _bbox.min_x = x_bnd.first; @@ -1632,9 +1632,9 @@ void _Bezier_point_2_rep::_make_exact orig2.curve().y_norm(), do_ovlp); typename Bezier_cache::Intersection_iter intr_it; - + CGAL_assertion (! do_ovlp); - + // Look for a parameter pair within the ranges of the bounding intervals. const Algebraic s_min = nt_traits.convert (orig1.point_bound().t_min); const Algebraic s_max = nt_traits.convert (orig1.point_bound().t_max); @@ -1657,9 +1657,9 @@ void _Bezier_point_2_rep::_make_exact p_alg_y = new Algebraic (intr_it->y); // Update the bounding box. - const std::pair& x_bnd = + const std::pair& x_bnd = nt_traits.double_interval (*p_alg_x); - const std::pair& y_bnd = + const std::pair& y_bnd = nt_traits.double_interval (*p_alg_y); _bbox.min_x = x_bnd.first; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index 83fd8de8e6ba..f1bdb72d62bd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -101,7 +101,7 @@ class _One_root_point_2 : {} _One_root_point_2& operator=(const _One_root_point_2&)=default; - + /*! Constructor of a point with one-root coefficients. This constructor of a point can also be used with rational coefficients thanks to convertor of CoordNT. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h index dc019585325d..96dee434f9a2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h @@ -454,10 +454,10 @@ class _Conic_arc_2 * \pre No three points are collinear. */ _Conic_arc_2 (const Rat_point_2& p1, - const Rat_point_2& p2, - const Rat_point_2& p3, - const Rat_point_2& p4, - const Rat_point_2& p5) : + const Rat_point_2& p2, + const Rat_point_2& p3, + const Rat_point_2& p4, + const Rat_point_2& p5) : _extra_data_P(nullptr) { // Make sure that no three points are collinear. @@ -515,13 +515,13 @@ class _Conic_arc_2 { _orient = COUNTERCLOCKWISE; CGAL_precondition (orient_f(p1, p3, p5) == LEFT_TURN && - orient_f(p1, p4, p5) == LEFT_TURN); + orient_f(p1, p4, p5) == LEFT_TURN); } else { _orient = CLOCKWISE; CGAL_precondition (orient_f(p1, p3, p5) != LEFT_TURN && - orient_f(p1, p4, p5) != LEFT_TURN); + orient_f(p1, p4, p5) != LEFT_TURN); } // Set the arc properties (no need to compute the orientation). @@ -530,15 +530,15 @@ class _Conic_arc_2 // Make sure that all midpoints are strictly between the // source and the target. Point_2 mp2 = Point_2 (nt_traits.convert (p2.x()), - nt_traits.convert (p2.y())); + nt_traits.convert (p2.y())); Point_2 mp3 = Point_2 (nt_traits.convert (p3.x()), - nt_traits.convert (p3.y())); + nt_traits.convert (p3.y())); Point_2 mp4 = Point_2 (nt_traits.convert (p4.x()), - nt_traits.convert (p4.y())); + nt_traits.convert (p4.y())); if (! _is_strictly_between_endpoints (mp2) || - ! _is_strictly_between_endpoints (mp3) || - ! _is_strictly_between_endpoints (mp4)) + ! _is_strictly_between_endpoints (mp3) || + ! _is_strictly_between_endpoints (mp4)) { _info = 0; // Inalvid arc. } @@ -556,14 +556,14 @@ class _Conic_arc_2 * (or the target) will be selected. */ _Conic_arc_2 (const Rational& r, const Rational& s, const Rational& t, - const Rational& u, const Rational& v, const Rational& w, - const Orientation& orient, - const Point_2& app_source, - const Rational& r_1, const Rational& s_1, const Rational& t_1, - const Rational& u_1, const Rational& v_1, const Rational& w_1, - const Point_2& app_target, - const Rational& r_2, const Rational& s_2, const Rational& t_2, - const Rational& u_2, const Rational& v_2, const Rational& w_2): + const Rational& u, const Rational& v, const Rational& w, + const Orientation& orient, + const Point_2& app_source, + const Rational& r_1, const Rational& s_1, const Rational& t_1, + const Rational& u_1, const Rational& v_1, const Rational& w_1, + const Point_2& app_target, + const Rational& r_2, const Rational& s_2, const Rational& t_2, + const Rational& u_2, const Rational& v_2, const Rational& w_2): _orient(orient), _extra_data_P(nullptr) { @@ -584,8 +584,8 @@ class _Conic_arc_2 base_coeffs); if (CGAL::sign (base_coeffs[0]) == ZERO && - CGAL::sign (base_coeffs[1]) == ZERO && - CGAL::sign (base_coeffs[2]) == ZERO) + CGAL::sign (base_coeffs[1]) == ZERO && + CGAL::sign (base_coeffs[2]) == ZERO) { deg_base = 1; } @@ -621,115 +621,115 @@ class _Conic_arc_2 aux_rat_coeffs[5] = (k == 1) ? w_1 : w_2; nt_traits.convert_coefficients (aux_rat_coeffs, aux_rat_coeffs + 6, - aux_coeffs); + aux_coeffs); if (CGAL::sign (aux_coeffs[0]) == ZERO && - CGAL::sign (aux_coeffs[1]) == ZERO && - CGAL::sign (aux_coeffs[2]) == ZERO) + CGAL::sign (aux_coeffs[1]) == ZERO && + CGAL::sign (aux_coeffs[2]) == ZERO) { - deg_aux = 1; + deg_aux = 1; } else { - deg_aux = 2; + deg_aux = 2; } // Compute the x- and y-coordinates of intersection points of the base // conic and the k'th auxiliary conic. n_xs = _compute_resultant_roots (nt_traits, - base_coeffs[0], base_coeffs[1], - base_coeffs[2], - base_coeffs[3], base_coeffs[4], - base_coeffs[5], - deg_base, - aux_coeffs[0], aux_coeffs[1], - aux_coeffs[2], - aux_coeffs[3], aux_coeffs[4], - aux_coeffs[5], - deg_aux, - xs); + base_coeffs[0], base_coeffs[1], + base_coeffs[2], + base_coeffs[3], base_coeffs[4], + base_coeffs[5], + deg_base, + aux_coeffs[0], aux_coeffs[1], + aux_coeffs[2], + aux_coeffs[3], aux_coeffs[4], + aux_coeffs[5], + deg_aux, + xs); n_ys = _compute_resultant_roots (nt_traits, - base_coeffs[1], base_coeffs[0], - base_coeffs[2], - base_coeffs[4], base_coeffs[3], - base_coeffs[5], - deg_base, - aux_coeffs[1], aux_coeffs[0], - aux_coeffs[2], - aux_coeffs[4], aux_coeffs[3], - aux_coeffs[5], - deg_aux, - ys); + base_coeffs[1], base_coeffs[0], + base_coeffs[2], + base_coeffs[4], base_coeffs[3], + base_coeffs[5], + deg_base, + aux_coeffs[1], aux_coeffs[0], + aux_coeffs[2], + aux_coeffs[4], aux_coeffs[3], + aux_coeffs[5], + deg_aux, + ys); // Find the intersection point which is nearest the given approximation // and set it as the endpoint. found = false; for (i = 0; i < n_xs; i++) { - for (j = 0; j < n_ys; j++) - { - // Check if the point (xs[i], ys[j]) lies on both conics. - val = nt_traits.convert(base_coeffs[0]) * xs[i]*xs[i] + - nt_traits.convert(base_coeffs[1]) * ys[j]*ys[j] + - nt_traits.convert(base_coeffs[2]) * xs[i]*ys[j] + - nt_traits.convert(base_coeffs[3]) * xs[i] + + for (j = 0; j < n_ys; j++) + { + // Check if the point (xs[i], ys[j]) lies on both conics. + val = nt_traits.convert(base_coeffs[0]) * xs[i]*xs[i] + + nt_traits.convert(base_coeffs[1]) * ys[j]*ys[j] + + nt_traits.convert(base_coeffs[2]) * xs[i]*ys[j] + + nt_traits.convert(base_coeffs[3]) * xs[i] + nt_traits.convert(base_coeffs[4]) * ys[j] + - nt_traits.convert(base_coeffs[5]); + nt_traits.convert(base_coeffs[5]); - if (CGAL::sign (val) != ZERO) - continue; + if (CGAL::sign (val) != ZERO) + continue; - val = nt_traits.convert(aux_coeffs[0]) * xs[i]*xs[i] + - nt_traits.convert(aux_coeffs[1]) * ys[j]*ys[j] + - nt_traits.convert(aux_coeffs[2]) * xs[i]*ys[j] + - nt_traits.convert(aux_coeffs[3]) * xs[i] + + val = nt_traits.convert(aux_coeffs[0]) * xs[i]*xs[i] + + nt_traits.convert(aux_coeffs[1]) * ys[j]*ys[j] + + nt_traits.convert(aux_coeffs[2]) * xs[i]*ys[j] + + nt_traits.convert(aux_coeffs[3]) * xs[i] + nt_traits.convert(aux_coeffs[4]) * ys[j] + - nt_traits.convert(aux_coeffs[5]); - - if (CGAL::sign (val) == ZERO) - { - // Compute the distance of (xs[i], ys[j]) from the approximated - // endpoint. - if (k == 1) - { - dx = CGAL::to_double (xs[i] - app_source.x()); - dy = CGAL::to_double (ys[j] - app_source.y()); - } - else - { - dx = CGAL::to_double (xs[i] - app_target.x()); - dy = CGAL::to_double (ys[j] - app_target.y()); - } - - curr_dist = dx*dx + dy*dy; - - // Update the endpoint if (xs[i], ys[j]) is the nearest pair so - // far. - if (! found || curr_dist < min_dist) - { - if (k == 1) - _source = Point_2 (xs[i], ys[j]); - else - _target = Point_2 (xs[i], ys[j]); - - min_dist = curr_dist; - found = true; - } - } - } + nt_traits.convert(aux_coeffs[5]); + + if (CGAL::sign (val) == ZERO) + { + // Compute the distance of (xs[i], ys[j]) from the approximated + // endpoint. + if (k == 1) + { + dx = CGAL::to_double (xs[i] - app_source.x()); + dy = CGAL::to_double (ys[j] - app_source.y()); + } + else + { + dx = CGAL::to_double (xs[i] - app_target.x()); + dy = CGAL::to_double (ys[j] - app_target.y()); + } + + curr_dist = dx*dx + dy*dy; + + // Update the endpoint if (xs[i], ys[j]) is the nearest pair so + // far. + if (! found || curr_dist < min_dist) + { + if (k == 1) + _source = Point_2 (xs[i], ys[j]); + else + _target = Point_2 (xs[i], ys[j]); + + min_dist = curr_dist; + found = true; + } + } + } } if (! found) { - _info = 0; // Invalid arc. - return; + _info = 0; // Invalid arc. + return; } } // Make sure that the source and the target are not the same. if (Alg_kernel().compare_xy_2_object() (_source, - _target) == EQUAL) + _target) == EQUAL) { _info = 0; // Invalid arc. return; @@ -1189,7 +1189,7 @@ class _Conic_arc_2 // Make sure both endpoint lie on the supporting conic. if (! _is_on_supporting_conic (_source) || - ! _is_on_supporting_conic (_target)) + ! _is_on_supporting_conic (_target)) { _info = 0; // Invalid arc. return; @@ -1199,8 +1199,8 @@ class _Conic_arc_2 // Check whether we have a degree 2 curve. if ((CGAL::sign (_r) != ZERO || - CGAL::sign (_s) != ZERO || - CGAL::sign (_t) != ZERO)) + CGAL::sign (_s) != ZERO || + CGAL::sign (_t) != ZERO)) { if (_orient == COLLINEAR) { @@ -1440,7 +1440,7 @@ class _Conic_arc_2 CGAL_assertion (_extra_data_P->side != ZERO); CGAL_assertion (_extra_data_P->side == _sign_of_extra_data(_target.x(), - _target.y())); + _target.y())); return; } @@ -1459,7 +1459,7 @@ class _Conic_arc_2 * \return The sign of (a*x + b*y + c). */ Sign _sign_of_extra_data (const Algebraic& px, - const Algebraic& py) const + const Algebraic& py) const { CGAL_assertion (_extra_data_P != nullptr); @@ -1483,10 +1483,10 @@ class _Conic_arc_2 // The point must satisfy: r*x^2 + s*y^2 + t*xy + u*x + v*y + w = 0. Nt_traits nt_traits; const Algebraic val = (nt_traits.convert(_r)*p.x() + - nt_traits.convert(_t)*p.y() + - nt_traits.convert(_u)) * p.x() + + nt_traits.convert(_t)*p.y() + + nt_traits.convert(_u)) * p.x() + (nt_traits.convert(_s)*p.y() + - nt_traits.convert(_v)) * p.y() + + nt_traits.convert(_v)) * p.y() + nt_traits.convert(_w); return (CGAL::sign (val) == ZERO); @@ -1578,7 +1578,7 @@ class _Conic_arc_2 // If p is not in the (open) x-range (or y-range) of the segment, it // cannot be contained in the segment. if (res1 == EQUAL || res2 == EQUAL || res1 == res2) - return (false); + return (false); // Perform an orientation test: This is crucial for segment of line // pairs, as we want to make sure that p lies on the same line as the @@ -1622,9 +1622,9 @@ class _Conic_arc_2 Nt_traits nt_traits; xs_end = nt_traits.solve_quadratic_equation (_t*_t - _four*_r*_s, - _two*_t*_v - _four*_s*_u, - _v*_v - _four*_s*_w, - xs); + _two*_t*_v - _four*_s*_u, + _v*_v - _four*_s*_w, + xs); n_xs = static_cast(xs_end - xs); // Find the y-coordinates of the vertical tangency points. @@ -1707,9 +1707,9 @@ class _Conic_arc_2 Nt_traits nt_traits; ys_end = nt_traits.solve_quadratic_equation (_t*_t - _four*_r*_s, - _two*_t*_u - _four*_r*_v, - _u*_u - _four*_r*_w, - ys); + _two*_t*_u - _four*_r*_v, + _u*_u - _four*_r*_w, + ys); n = static_cast(ys_end - ys); // Compute the x coordinates and construct the horizontal tangency points. @@ -1787,7 +1787,7 @@ class _Conic_arc_2 if (CGAL::sign(A) == ZERO) { if (CGAL::sign(B) == ZERO) - return (0); + return (0); x_minus = x_plus = -C / B; return (1); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_intersections_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_intersections_2.h index 73813cd5c00c..79049ca39770 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_intersections_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_intersections_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -53,19 +53,19 @@ int const typename Nt_traits::Integer& w2, const int& deg2, typename Nt_traits::Algebraic *xs) -{ +{ if (deg1 == 2 && deg2 == 1) { // If necessary, swap roles between the two curves, so that the first // curve always has the minimal degree. return (_compute_resultant_roots (nt_traits, - r2, s2, t2, u2, v2, w2, - deg2, - r1, s1, t1, u1, v1, w1, - deg1, - xs)); + r2, s2, t2, u2, v2, w2, + deg2, + r1, s1, t1, u1, v1, w1, + deg1, + xs)); } - + // Act according to the degree of the first conic curve. const typename Nt_traits::Integer _two = 2; typename Nt_traits::Integer c[5]; @@ -81,7 +81,7 @@ int xs[0] = nt_traits.convert(-w1) / nt_traits.convert(u1); return (1); } - + // We can write the first curve as: y = -(u1*x + w1) / v1. if (deg2 == 1) { @@ -91,8 +91,8 @@ int c[0] = v1*w2 - w1*v2; if (CGAL::sign (c[1]) == ZERO) - // The two lines are parallel: - return (0); + // The two lines are parallel: + return (0); xs[0] = nt_traits.convert(-c[0]) / nt_traits.convert(c[1]); return (1); @@ -103,9 +103,9 @@ int c[2] = u1*u1*s2 - u1*v1*t2 + v1*v1*r2; c[1] = _two*u1*w1*s2 - u1*v1*v2 - v1*w1*t2 + v1*v1*u2; c[0] = w1*w1*s2 - v1*w1*v2 + v1*v1*w2; - + xs_end = nt_traits.solve_quadratic_equation (c[2], c[1], c[0], - xs); + xs); return static_cast(xs_end - xs); } @@ -122,7 +122,7 @@ int c[2] = t1*u2 - t2*u1 + r2*v1 - r1*v2; c[1] = t1*w2 - t2*w1 + u2*v1 - u1*v2; c[0] = v1*w2 - v2*w1; - + degree = 3; } else @@ -137,11 +137,11 @@ int c[3] = -t2*r1*v1*s2 - u2*t1*t2*s1 - v2*r1*t1*s2 - r2*t1*v2*s1 - _two*s1*s2*r1*u2 - t2*u1*t1*s2 + u2*t1*t1*s2 - - r2*v1*t2*s1 + u1*t2*t2*s1 + _two*v2*r1*t2*s1 + _two*u2*r2*s1*s1 + + r2*v1*t2*s1 + u1*t2*t2*s1 + _two*v2*r1*t2*s1 + _two*u2*r2*s1*s1 + _two*r2*v1*t1*s2 + _two*u1*r1*s2*s2 - _two*s1*s2*u1*r2; - + c[2] = -r2*v1*v2*s1 + u2*u2*s1*s1 + _two*w2*r2*s1*s1 + - _two*u2*v1*t1*s2 - u2*v1*t2*s1 + w2*t1*t1*s2 - _two*s1*s2*u1*u2 - + _two*u2*v1*t1*s2 - u2*v1*t2*s1 + w2*t1*t1*s2 - _two*s1*s2*u1*u2 - w2*t1*t2*s1 + v2*v2*r1*s1 + u1*u1*s2*s2 - v2*r1*v1*s2 + _two*w1*r1*s2*s2 - u2*t1*v2*s1 - t2*u1*v1*s2 - _two*s1*s2*r1*w2 - _two*s1*s2*w1*r2 + r2*v1*v1*s2 + w1*t2*t2*s1 - v2*u1*t1*s2 - @@ -149,21 +149,21 @@ int c[1] = _two*w2*u2*s1*s1 + _two*w2*v1*t1*s2 - w2*v1*t2*s1 + _two*v2*w1*t2*s1 + _two*w1*u1*s2*s2 - v2*u1*v1*s2 - _two*s1*s2*u1*w2 - - v2*w1*t1*s2 + u2*v1*v1*s2 - t2*w1*v1*s2 - w2*t1*v2*s1 + + v2*w1*t1*s2 + u2*v1*v1*s2 - t2*w1*v1*s2 - w2*t1*v2*s1 + v2*v2*u1*s1 - u2*v1*v2*s1 - _two*s1*s2*w1*u2; - + c[0] = s2*v1*v1*w2 - s1*v2*v1*w2 - s2*v1*w1*v2 + s2*s2*w1*w1 - _two*s1*s2*w1*w2 + s1*w1*v2*v2 + s1*s1*w2*w2; degree = 4; } - + // Compute the roots of the resultant polynomial. - typename Nt_traits::Polynomial poly = + typename Nt_traits::Polynomial poly = nt_traits.construct_polynomial (c, degree); xs_end = nt_traits.compute_polynomial_roots (poly, - xs); + xs); return static_cast(xs_end - xs); } @@ -181,16 +181,16 @@ template int _compute_resultant_roots (Nt_traits& nt_traits, const typename Nt_traits::Algebraic& r, - const typename Nt_traits::Algebraic& s, - const typename Nt_traits::Algebraic& t, - const typename Nt_traits::Algebraic& u, - const typename Nt_traits::Algebraic& v, - const typename Nt_traits::Algebraic& w, - const int& deg1, - const typename Nt_traits::Algebraic& A, - const typename Nt_traits::Algebraic& B, - const typename Nt_traits::Algebraic& C, - typename Nt_traits::Algebraic *xs) + const typename Nt_traits::Algebraic& s, + const typename Nt_traits::Algebraic& t, + const typename Nt_traits::Algebraic& u, + const typename Nt_traits::Algebraic& v, + const typename Nt_traits::Algebraic& w, + const int& deg1, + const typename Nt_traits::Algebraic& A, + const typename Nt_traits::Algebraic& B, + const typename Nt_traits::Algebraic& C, + typename Nt_traits::Algebraic *xs) { if (deg1 == 1) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_point_2.h index 03217915d6d7..737610bc86d7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_point_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -26,7 +26,7 @@ namespace CGAL { /*! - * \class A class that stores additional information with the point's + * \class A class that stores additional information with the point's * coordinates, namely the conic IDs of the generating curves. */ template @@ -37,7 +37,7 @@ class _Conic_point_2 : public Alg_kernel_::Point_2 typedef Alg_kernel_ Alg_kernel; typedef typename Alg_kernel::Point_2 Base; typedef _Conic_point_2 Self; - + typedef typename Alg_kernel::FT Algebraic; /*! \class @@ -68,7 +68,7 @@ class _Conic_point_2 : public Alg_kernel_::Point_2 { return (index != 0); } - + /*! Equality operator. */ bool operator== (const Conic_id& id) const { @@ -93,7 +93,7 @@ class _Conic_point_2 : public Alg_kernel_::Point_2 return (index > id.index); } }; - + private: typedef std::list Ids_container; @@ -117,9 +117,9 @@ class _Conic_point_2 : public Alg_kernel_::Point_2 {} /*! Constructor with homegeneous coordinates. */ - _Conic_point_2 (const Algebraic& hx, - const Algebraic& hy, - const Algebraic& hz) : + _Conic_point_2 (const Algebraic& hx, + const Algebraic& hy, + const Algebraic& hz) : Base (hx, hy, hz) {} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h index 741d93ab7453..6fc3ecce08c5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h @@ -1290,7 +1290,7 @@ class _Conic_x_monotone_arc_2 : private Conic_arc_ // greater than the source point), or to the left. Alg_kernel ker; Comparison_result dir_res = ker.compare_xy_2_object() (this->_source, - this->_target); + this->_target); CGAL_assertion (dir_res != EQUAL); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Consolidated_curve_data_aux.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Consolidated_curve_data_aux.h index 6822156e6c95..41564af33a6b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Consolidated_curve_data_aux.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Consolidated_curve_data_aux.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -37,7 +37,7 @@ class _Unique_list typedef typename std::list::const_iterator const_iterator; private: - + std::list m_list; public: @@ -122,9 +122,9 @@ class _Unique_list } return (iter); } - + /*! - * Insert an object into the list. + * Insert an object into the list. * \param data The data object. * \return (true) if the data object has been successfully inserted; * (false) otherwise (if it already exists). @@ -137,9 +137,9 @@ class _Unique_list m_list.push_back (data); return (true); } - + /*! - * Erase an object from the list. + * Erase an object from the list. * \param data The data object. * \return (true) if the data object has been successfully erased; * (false) otherwise (if it is not in the list). diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Curve_data_aux.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Curve_data_aux.h index 8932bc2b77f0..f56a49ac9539 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Curve_data_aux.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Curve_data_aux.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -61,11 +61,11 @@ class _Curve_data_ex : public BaseCurveType /*! Default constructor. */ _Curve_data_ex () {} - + /*! * Construct an extended curve from a base curve. * \param cv The base curve. - */ + */ _Curve_data_ex (const BaseCurveType& cv) : BaseCurveType (cv) {} @@ -74,7 +74,7 @@ class _Curve_data_ex : public BaseCurveType * Construct an extended curve from a base curve and a data object. * \param cv The base curve. * \param data The data object. - */ + */ _Curve_data_ex (const BaseCurveType& cv, const Data& data) : BaseCurveType (cv), m_data (data) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/One_root_number.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/One_root_number.h index e17781738420..47e72487c4f4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/One_root_number.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/One_root_number.h @@ -6,11 +6,11 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Baruch Zukerman - + #ifndef CGAL_ONE_ROOT_NUMBER_H #define CGAL_ONE_ROOT_NUMBER_H @@ -20,7 +20,7 @@ /*! \file * Header file for the One_root_number class. */ -#include +#include namespace CGAL { @@ -214,7 +214,7 @@ std::pair to_interval (const _One_root_number& x) const CGAL::Interval_nt alpha_in = to_interval(x.alpha()); const CGAL::Interval_nt beta_in = to_interval(x.beta()); const CGAL::Interval_nt gamma_in = to_interval(x.gamma()); - const CGAL::Interval_nt& x_in = alpha_in + + const CGAL::Interval_nt& x_in = alpha_in + (beta_in * CGAL::sqrt(gamma_in)); return (std::make_pair (x_in.inf(), x_in.sup())); @@ -250,7 +250,7 @@ _One_root_number operator- (const NT& val, * Multiply a rational number and a one-root number. */ template -_One_root_number operator* (const NT& val, +_One_root_number operator* (const NT& val, const _One_root_number& x) { if (x.is_rational()) @@ -279,7 +279,7 @@ _One_root_number operator/ (const NT& val, // -------------- = --------------------- // a + b*sqrt(c) a^2 - b^2 * c // - NT denom = x.alpha()*x.alpha() - x.beta()*x.beta() * x.gamma(); + NT denom = x.alpha()*x.alpha() - x.beta()*x.beta() * x.gamma(); CGAL_precondition (CGAL::sign(denom) != ZERO); @@ -297,7 +297,7 @@ double to_double (const _One_root_number& x) return (CGAL::to_double(x.alpha())); return (CGAL::to_double(x.alpha()) + - CGAL::to_double(x.beta()) * std::sqrt(CGAL::to_double(x.gamma()))); + CGAL::to_double(x.beta()) * std::sqrt(CGAL::to_double(x.gamma()))); } /*! @@ -327,7 +327,7 @@ CGAL::Sign sign (const _One_root_number& x) if (FL) { // Try to filter the sign computation using interval arithmetic. - const std::pair& x_in = CGAL::to_interval (x); + const std::pair& x_in = CGAL::to_interval (x); if (x_in.first > 0) return (CGAL::POSITIVE); @@ -352,9 +352,9 @@ CGAL::Comparison_result compare (const NT& val, if (FL) { // Try to filter the comparison using interval arithmetic. - const std::pair& x_in = CGAL::to_interval (val); - const std::pair& y_in = CGAL::to_interval (x); - + const std::pair& x_in = CGAL::to_interval (val); + const std::pair& y_in = CGAL::to_interval (x); + if (x_in.second < y_in.first) return (SMALLER); else if (x_in.first > y_in.second) @@ -385,8 +385,8 @@ CGAL::Comparison_result compare (const _One_root_number& x, if (FL) { // Try to filter the comparison using interval arithmetic. - const std::pair& x_in = CGAL::to_interval (x); - const std::pair& y_in = CGAL::to_interval (val); + const std::pair& x_in = CGAL::to_interval (x); + const std::pair& y_in = CGAL::to_interval (val); if (x_in.second < y_in.first) return (SMALLER); @@ -420,9 +420,9 @@ CGAL::Comparison_result compare (const _One_root_number& x, if (FL) { // Try to filter the comparison using interval arithmetic. - const std::pair& x_in = CGAL::to_interval (x); - const std::pair& y_in = CGAL::to_interval (y); - + const std::pair& x_in = CGAL::to_interval (x); + const std::pair& y_in = CGAL::to_interval (y); + if (x_in.second < y_in.first) return (SMALLER); else if (x_in.first > y_in.second) @@ -439,7 +439,7 @@ CGAL::Comparison_result compare (const _One_root_number& x, const NT y_sqr = y.beta()*y.beta() * y.gamma(); Comparison_result right_res = CGAL::compare (y_sqr, x_sqr); CGAL::Sign sign_right = ZERO; - + if (right_res == LARGER) { // Take the sign of b2: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h index 5cea074b2682..f5db0ebbad71 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -35,14 +35,14 @@ namespace CGAL { * N(x) * * where D and N are polynomial with integer (or rational) coefficients. - * The class is templated with two parameters: + * The class is templated with two parameters: * Alg_kernel A geometric kernel, where Alg_kernel::FT is the number type * for the coordinates of arrangement vertices, which are algebraic * numbers (defined by Nt_traits::Algebraic). * Nt_traits A traits class for performing various operations on the integer, * rational and algebraic types. * This class serves as the base for the classes _Rational_arc_2 (a general, - * not necessarily continuous arc) and _Continuous_rational_arc_2 (a + * not necessarily continuous arc) and _Continuous_rational_arc_2 (a * continuous portion of a rational function). */ template @@ -53,7 +53,7 @@ class _Base_rational_arc_2 typedef Alg_kernel_ Alg_kernel; typedef Nt_traits_ Nt_traits; typedef _Base_rational_arc_2 Self; - + typedef typename Alg_kernel::FT Algebraic; typedef typename Alg_kernel::Point_2 Point_2; @@ -86,12 +86,12 @@ class _Base_rational_arc_2 IS_CONTINUOUS = 512, IS_VALID = 1024 }; - + Polynomial _numer; // The polynomial in the numerator. Polynomial _denom; // The polynomial in the denominator. Point_2 _ps; // The source point. Point_2 _pt; // The target point. - int _info; // A set of Boolean flags. + int _info; // A set of Boolean flags. public: @@ -132,7 +132,7 @@ class _Base_rational_arc_2 denom_coeffs [0] = p_factor; _denom = nt_traits.construct_polynomial (denom_coeffs, 0); - + // Check whether the end points lie at y = -oo or at y = +oo. const int deg_num = nt_traits.degree (_numer); CGAL::Sign lead_sign; @@ -165,11 +165,11 @@ class _Base_rational_arc_2 { // In the case of a constant polynomial it is possible to set a finite // y-coordinate for the source and target points. - Integer lead_coeff = (deg_num < 0) ? Integer(0) : + Integer lead_coeff = (deg_num < 0) ? Integer(0) : nt_traits.get_coefficient (_numer, deg_num); - _ps = _pt = Point_2 (Algebraic(), - nt_traits.convert (lead_coeff) / + _ps = _pt = Point_2 (Algebraic(), + nt_traits.convert (lead_coeff) / nt_traits.convert (p_factor)); } @@ -218,9 +218,9 @@ class _Base_rational_arc_2 _denom = nt_traits.construct_polynomial (denom_coeffs, 0); // Set the source point. - _ps = Point_2 (x_s, nt_traits.evaluate_at (_numer, x_s) / + _ps = Point_2 (x_s, nt_traits.evaluate_at (_numer, x_s) / nt_traits.convert(p_factor)); - + // Check whether the target point lies at y = -oo or at y = +oo. const int deg_num = nt_traits.degree (_numer); CGAL::Sign lead_sign; @@ -254,10 +254,10 @@ class _Base_rational_arc_2 { // In the case of a constant polynomial it is possible to set a finite // y-coordinate for the target point. - Integer lead_coeff = (deg_num < 0) ? Integer(0) : + Integer lead_coeff = (deg_num < 0) ? Integer(0) : nt_traits.get_coefficient (_numer, deg_num); - _pt = Point_2 (Algebraic(), nt_traits.convert (lead_coeff) / + _pt = Point_2 (Algebraic(), nt_traits.convert (lead_coeff) / nt_traits.convert (p_factor)); } @@ -301,17 +301,17 @@ class _Base_rational_arc_2 denom_coeffs [0] = p_factor; _denom = nt_traits.construct_polynomial (denom_coeffs, 0); - + // Set the endpoints. - _ps = Point_2 (x_s, nt_traits.evaluate_at (_numer, x_s) / + _ps = Point_2 (x_s, nt_traits.evaluate_at (_numer, x_s) / nt_traits.convert (p_factor)); - _pt = Point_2 (x_t, nt_traits.evaluate_at (_numer, x_t) / + _pt = Point_2 (x_t, nt_traits.evaluate_at (_numer, x_t) / nt_traits.convert (p_factor)); // Mark that the arc is continuous and valid. _info = (_info | IS_CONTINUOUS); _info = (_info | IS_VALID); - } + } /*! * Constructor of a polynomial function, defined by y = p(x)/q(x) for any x. @@ -329,7 +329,7 @@ class _Base_rational_arc_2 // Set the numerator and denominator polynomials. Nt_traits nt_traits; - const bool valid = + const bool valid = nt_traits.construct_polynomials (&(pcoeffs[0]), pcoeffs.size() - 1, &(qcoeffs[0]), qcoeffs.size() - 1, _numer, _denom); @@ -395,7 +395,7 @@ class _Base_rational_arc_2 // Set the numerator and denominator polynomials. Nt_traits nt_traits; - const bool valid = + const bool valid = nt_traits.construct_polynomials (&(pcoeffs[0]), pcoeffs.size() - 1, &(qcoeffs[0]), qcoeffs.size() - 1, _numer, _denom); @@ -417,7 +417,7 @@ class _Base_rational_arc_2 { // The y-coodinate is unbounded, but we can set its sign. _ps = Point_2 (x_s, 0); - + std::pair signs = _analyze_near_pole (x_s); const CGAL::Sign sign_s = (dir_right ? signs.second : signs.first); @@ -460,9 +460,9 @@ class _Base_rational_arc_2 _info = ( _info | ( this->_is_continuous() ? (IS_CONTINUOUS | IS_VALID) : IS_VALID ) ); } - + /*! - * Constructor of a bounded rational arc, defined by y = p(x)/q(x), + * Constructor of a bounded rational arc, defined by y = p(x)/q(x), * where: x_min <= x <= x_max. * \param pcoeffs The rational coefficients of the polynomial p(x). * \param qcoeffs The rational coefficients of the polynomial q(x). @@ -486,7 +486,7 @@ class _Base_rational_arc_2 // Set the numerator and denominator polynomials. Nt_traits nt_traits; - const bool valid = + const bool valid = nt_traits.construct_polynomials (&(pcoeffs[0]), pcoeffs.size() - 1, &(qcoeffs[0]), qcoeffs.size() - 1, _numer, _denom); @@ -529,7 +529,7 @@ class _Base_rational_arc_2 { // The y-coodinate is unbounded, but we can set its sign. _pt = Point_2 (x_t, 0); - + std::pair signs = _analyze_near_pole (x_t); const CGAL::Sign sign_t = ((_info & IS_DIRECTED_RIGHT) != 0) ? signs.first : signs.second; @@ -811,7 +811,7 @@ class _Base_rational_arc_2 Nt_traits nt_traits; Algebraic y = nt_traits.evaluate_at (_numer, p.x()) / nt_traits.evaluate_at (_denom, p.x()); - + // Compare the resulting y-coordinate with y(p): return (CGAL::compare (p.y(), y)); } @@ -977,7 +977,7 @@ class _Base_rational_arc_2 const Algebraic val_q1 = CGAL::abs (nt_traits.evaluate_at (norm_q1, x1)); const Algebraic val_q2 = CGAL::abs (nt_traits.evaluate_at (norm_q2, x1)); Comparison_result val_res = CGAL::compare (val_q1, val_q2); - + if (val_res != EQUAL) { if (ind1 == ARR_MIN_END) @@ -990,7 +990,7 @@ class _Base_rational_arc_2 // Both arcs are defined to the same side (left or right) of the vertical // asymptote. If one is defined at y = -oo and the other at y = +oo, we // preform a "lexicographic" comparison. - const Arr_parameter_space inf_y1 = + const Arr_parameter_space inf_y1 = (ind1 == ARR_MIN_END ? left_infinite_in_y() : right_infinite_in_y()); const Arr_parameter_space inf_y2 = (ind2 == ARR_MIN_END) ? arc.left_infinite_in_y() : arc.right_infinite_in_y(); @@ -1005,7 +1005,7 @@ class _Base_rational_arc_2 // curve ends by considering their comparison result. const Algebraic val_p1 = nt_traits.evaluate_at (_numer, x1); const Algebraic val_p2 = nt_traits.evaluate_at (arc._numer, x1); - + val_res = CGAL::compare (val_p1, val_p2); if (val_res == EQUAL) @@ -1022,7 +1022,7 @@ class _Base_rational_arc_2 } /*! - * Compare the slopes of the arc with another given arc at their given + * Compare the slopes of the arc with another given arc at their given * intersection point. * \param cv The given arc. * \param p The intersection point. @@ -1089,10 +1089,10 @@ class _Base_rational_arc_2 pden2 *= pden2; } - // Compute the two derivative values and compare them. - d1 = nt_traits.evaluate_at (pnum1, _x) / + // Compute the two derivative values and compare them. + d1 = nt_traits.evaluate_at (pnum1, _x) / nt_traits.evaluate_at (pden1, _x); - d2 = nt_traits.evaluate_at (pnum2, _x) / + d2 = nt_traits.evaluate_at (pnum2, _x) / nt_traits.evaluate_at (pden2, _x); res = CGAL::compare (d1, d2); @@ -1136,7 +1136,7 @@ class _Base_rational_arc_2 // First compare the signs of the two denominator polynomials at x = -oo. const CGAL::Sign sign1 = _sign_at_minus_infinity (_denom); const CGAL::Sign sign2 = _sign_at_minus_infinity (arc._denom); - + CGAL_assertion (sign1 != CGAL::ZERO && sign2 != CGAL::ZERO); const bool flip_res = (sign1 != sign2); @@ -1147,7 +1147,7 @@ class _Base_rational_arc_2 // // It is clear that we should look at the sign of the polynomial // p1(x)*q2(x) - p2(x)*q1(x) at x = -oo. - const CGAL::Sign sign_ip = _sign_at_minus_infinity (_numer*arc._denom - + const CGAL::Sign sign_ip = _sign_at_minus_infinity (_numer*arc._denom - arc._numer*_denom); if (sign_ip == CGAL::ZERO) @@ -1192,7 +1192,7 @@ class _Base_rational_arc_2 // First compare the signs of the two denominator polynomials at x = +oo. const CGAL::Sign sign1 = _sign_at_plus_infinity (_denom); const CGAL::Sign sign2 = _sign_at_plus_infinity (arc._denom); - + CGAL_assertion (sign1 != CGAL::ZERO && sign2 != CGAL::ZERO); const bool flip_res = (sign1 != sign2); @@ -1337,7 +1337,7 @@ class _Base_rational_arc_2 if ((_info & IS_CONTINUOUS) != 0) arc._info = (arc._info | IS_CONTINUOUS); - + return (arc); } @@ -1345,7 +1345,7 @@ class _Base_rational_arc_2 * Print the rational arc. */ std::ostream& print (std::ostream& os) const - { + { // Print y as a rational function of x. os << "y = ("; _print_polynomial (os, _numer, 'x'); @@ -1355,7 +1355,7 @@ class _Base_rational_arc_2 // Print the definition range. Arr_parameter_space inf_x = source_infinite_in_x(); - if (inf_x == ARR_LEFT_BOUNDARY) + if (inf_x == ARR_LEFT_BOUNDARY) os << "(-oo"; else if (inf_x == ARR_RIGHT_BOUNDARY) os << "(+oo"; @@ -1363,11 +1363,11 @@ class _Base_rational_arc_2 os << '(' << source_x(); else os << '[' << source().x(); - + os << ", "; inf_x = target_infinite_in_x(); - if (inf_x == ARR_LEFT_BOUNDARY) + if (inf_x == ARR_LEFT_BOUNDARY) os << "-oo)"; else if (inf_x == ARR_RIGHT_BOUNDARY) os << "+oo)"; @@ -1413,29 +1413,29 @@ class _Base_rational_arc_2 if (res1 == SMALLER) return (false); - + if (res1 == EQUAL) { eq_src = true; return (true); } } - + // Compare to the right endpoint (the target in this case). if ((_info & TRG_AT_X_PLUS_INFTY) != 0) return (true); const Comparison_result res2 = CGAL::compare (x, _pt.x()); - + if (res2 == LARGER) return (false); - + if (res2 == EQUAL) eq_trg = true; return (true); } - + // Compare to the left endpoint (the target in this case). if ((_info & TRG_AT_X_MINUS_INFTY) != 0) { @@ -1447,26 +1447,26 @@ class _Base_rational_arc_2 if (res1 == SMALLER) return (false); - + if (res1 == EQUAL) { eq_trg = true; return (true); } } - + // Compare to the right endpoint (the source in this case). if ((_info & SRC_AT_X_PLUS_INFTY) != 0) return (true); const Comparison_result res2 = CGAL::compare (x, _ps.x()); - + if (res2 == LARGER) return (false); - + if (res2 == EQUAL) eq_src = true; - + return (true); } @@ -1520,7 +1520,7 @@ class _Base_rational_arc_2 // Get the leading coefficient. Its sign is the sign of the polynomial // at x = -oo if the degree is even, and the opposite sign if it is odd. - const CGAL::Sign lead_sign = + const CGAL::Sign lead_sign = CGAL::sign (nt_traits.get_coefficient (poly, degree)); CGAL_assertion (lead_sign != CGAL::ZERO); @@ -1572,7 +1572,7 @@ class _Base_rational_arc_2 // Get the leading coefficients. Integer p_lead = nt_traits.get_coefficient (P, deg_p); Integer q_lead = nt_traits.get_coefficient (Q, deg_q); - + if (deg_p == deg_q) { // We have a horizontal asymptote. @@ -1612,7 +1612,7 @@ class _Base_rational_arc_2 // Get the leading coefficients. Integer p_lead = nt_traits.get_coefficient (P, deg_p); Integer q_lead = nt_traits.get_coefficient (Q, deg_q); - + if (deg_p == deg_q) { // We have a horizontal asymptote. @@ -1802,7 +1802,7 @@ class _Base_rational_arc_2 */ template std::ostream& -operator<< (std::ostream& os, +operator<< (std::ostream& os, const _Base_rational_arc_2& arc) { return (arc.print (os)); @@ -1821,7 +1821,7 @@ class _Continuous_rational_arc_2 : typedef Nt_traits_ Nt_traits; typedef _Base_rational_arc_2 Base; typedef _Continuous_rational_arc_2 Self; - + typedef typename Base::Algebraic Algebraic; typedef typename Base::Point_2 Point_2; @@ -1926,9 +1926,9 @@ class _Continuous_rational_arc_2 : this->set_invalid(); } } - + /*! - * Constructor of a bounded rational arc, defined by y = p(x)/q(x), + * Constructor of a bounded rational arc, defined by y = p(x)/q(x), * where: x_min <= x <= x_max. * \param pcoeffs The rational coefficients of the polynomial p(x). * \param qcoeffs The rational coefficients of the polynomial q(x). @@ -1953,7 +1953,7 @@ class _Continuous_rational_arc_2 : /// \name Constructions of points and curves. //@{ - + /*! * Compute the intersections with the given arc. * \param arc The given intersecting arc. @@ -1973,9 +1973,9 @@ class _Continuous_rational_arc_2 : // Get the left and right endpoints of (*this) and their information // bits. - const Point_2& left1 = (this->is_directed_right() ? + const Point_2& left1 = (this->is_directed_right() ? this->_ps : this->_pt); - const Point_2& right1 = (this->is_directed_right() ? + const Point_2& right1 = (this->is_directed_right() ? this->_pt : this->_ps); int info_left1, info_right1; @@ -2101,9 +2101,9 @@ class _Continuous_rational_arc_2 : { // We have a single overlapping point. Just make sure this point // is not at y = -/+ oo. - if (info_left && + if (info_left && (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0 && - info_right && + info_right && (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0) { Intersection_point_2 ip (p_left, 0); @@ -2125,7 +2125,7 @@ class _Continuous_rational_arc_2 : overlap_arc._pt = p_right; overlap_arc._info = ((info_left) | (info_right << 4) | - this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | + this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | this->IS_VALID); *oi = make_object (overlap_arc); @@ -2133,7 +2133,7 @@ class _Continuous_rational_arc_2 : return (oi); } - + // We wish to find the intersection points between: // // y = p1(x)/q1(x) and y = p2(x)/q2(x) @@ -2141,7 +2141,7 @@ class _Continuous_rational_arc_2 : // It is clear that the x-coordinates of the intersection points are // the roots of the polynomial: ip(x) = p1(x)*q2(x) - p2(x)*q1(x). Nt_traits nt_traits; - Polynomial ipoly = this->_numer * arc._denom - + Polynomial ipoly = this->_numer * arc._denom - arc._numer * this->_denom; std::list xs; typename std::list::const_iterator x_iter; @@ -2163,7 +2163,7 @@ class _Continuous_rational_arc_2 : nt_traits.evaluate_at (this->_denom, *x_iter)); this->compare_slopes (arc, p, mult); - + // Output the intersection point: Intersection_point_2 ip (p, mult); @@ -2440,9 +2440,9 @@ class _Rational_arc_2 : public _Base_rational_arc_2 const Algebraic& x_s, bool dir_right) : Base (pcoeffs, qcoeffs, x_s, dir_right) {} - + /*! - * Constructor of a bounded rational arc, defined by y = p(x)/q(x), + * Constructor of a bounded rational arc, defined by y = p(x)/q(x), * where: x_min <= x <= x_max. * \param pcoeffs The rational coefficients of the polynomial p(x). * \param qcoeffs The rational coefficients of the polynomial q(x). diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Segment_assertions.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Segment_assertions.h index c584faee8135..4e0e3e7a3463 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Segment_assertions.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Segment_assertions.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/de_Casteljau_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/de_Casteljau_2.h index 62cdb5827c06..caf0e8eacfc0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/de_Casteljau_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/de_Casteljau_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Iddo Hanniel @@ -185,7 +185,7 @@ typename InputIterator::value_type de_Casteljau_2 // The first control point goes to the (front of) the right subcurve, // while the last control point goes to the (back of) the left subcurve. - const _NT comp_t0 = _NT(1) - t0; + const _NT comp_t0 = _NT(1) - t0; unsigned int last_index = n_pts - 1; *left_ctrl_pts = vec[0]; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h index 6bee2d24a199..b48cad3da36a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h @@ -10,9 +10,9 @@ // Author(s) : Monique Teillaud, Sylvain Pion, Julien Hazebrouck // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_CIRCULAR_KERNEL_LINE_ARC_TRAITS_2_H @@ -38,7 +38,7 @@ namespace CGAL { -// Traits class for CGAL::Arrangement_2 (and similar) based on a +// Traits class for CGAL::Arrangement_2 (and similar) based on a // CircularKernel. template < typename CircularKernel > @@ -51,13 +51,13 @@ class Arr_line_arc_traits_2 { typedef CircularKernel Kernel; typedef typename CircularKernel::Line_arc_2 Curve_2; typedef typename CircularKernel::Line_arc_2 X_monotone_curve_2; - typedef unsigned int Multiplicity; + typedef unsigned int Multiplicity; typedef typename CircularKernel::Circular_arc_point_2 Point; typedef typename CircularKernel::Circular_arc_point_2 Point_2; typedef CGAL::Tag_false Has_left_category; - typedef CGAL::Tag_false Has_merge_category; + typedef CGAL::Tag_false Has_merge_category; typedef CGAL::Tag_false Has_do_intersect_category; typedef Arr_oblivious_side_tag Left_side_category; @@ -75,9 +75,9 @@ class Arr_line_arc_traits_2 { typedef typename CircularKernel::Equal_2 Equal_2; typedef typename CircularKernel::Make_x_monotone_2 Make_x_monotone_2; typedef typename CircularKernel::Split_2 Split_2; - typedef typename CircularKernel::Construct_circular_min_vertex_2 + typedef typename CircularKernel::Construct_circular_min_vertex_2 Construct_min_vertex_2; - typedef typename CircularKernel::Construct_circular_max_vertex_2 + typedef typename CircularKernel::Construct_circular_max_vertex_2 Construct_max_vertex_2; typedef typename CircularKernel::Is_vertical_2 Is_vertical_2; typedef typename CircularKernel::Intersect_2 Intersect_2; @@ -88,10 +88,10 @@ class Arr_line_arc_traits_2 { Compare_xy_2 compare_xy_2_object() const { return ck.compare_xy_2_object(); } - Compare_y_at_x_2 compare_y_at_x_2_object() const + Compare_y_at_x_2 compare_y_at_x_2_object() const { return ck.compare_y_at_x_2_object(); } - Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const + Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const { return ck.compare_y_to_right_2_object(); } Equal_2 equal_2_object() const diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h index bc8b716ed7d0..4c7c690b3bdc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Eyal Flato) @@ -58,22 +58,22 @@ class Arr_naive_point_location { typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; // Data members: - const Arrangement_2* p_arr; // The associated arrangement. + const Arrangement_2* p_arr; // The associated arrangement. const Traits_adaptor_2* geom_traits; // Its associated geometry traits. const Topology_traits* top_traits; // Its associated topology traits. template Result_type make_result(T t) const { return Result::make_result(t); } inline Result_type default_result() const { return Result::default_result(); } - + public: /*! Default constructor. */ - Arr_naive_point_location() : + Arr_naive_point_location() : p_arr(nullptr), geom_traits(nullptr), top_traits(nullptr) {} - + /*! Constructor given an arrangement. */ Arr_naive_point_location(const Arrangement_2& arr) : p_arr(&arr) { @@ -82,7 +82,7 @@ class Arr_naive_point_location { } /*! Attach an arrangement object. */ - void attach(const Arrangement_2& arr) + void attach(const Arrangement_2& arr) { p_arr = &arr; geom_traits = static_cast(p_arr->geometry_traits()); @@ -96,7 +96,7 @@ class Arr_naive_point_location { geom_traits = nullptr; top_traits = nullptr; } - + /*! * Locate the arrangement feature containing the given point. * \param p The query point. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h index 12b5a3ca6689..ac2220a2b5fc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h @@ -250,9 +250,9 @@ class Arr_non_caching_segment_basic_traits_2 : public T_Kernel CGAL_precondition (i == 0 || i == 1); if (i == 0) - return (CGAL::to_double(p.x())); + return (CGAL::to_double(p.x())); else - return (CGAL::to_double(p.y())); + return (CGAL::to_double(p.y())); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h index dfde3d3630a5..28adfdab9b87 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -43,7 +43,7 @@ class Arr_observer typedef typename Arrangement_2::Vertex_handle Vertex_handle; typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; typedef typename Arrangement_2::Face_handle Face_handle; - typedef typename Arrangement_2::Ccb_halfedge_circulator + typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; private: @@ -99,7 +99,7 @@ class Arr_observer } /*! - * Attach the observer to an arrangement. + * Attach the observer to an arrangement. * \pre The observer is not already attached to an arrangement. */ void attach (Arrangement_2& arr) @@ -140,7 +140,7 @@ class Arr_observer // that the oberver is not attached to an arrangement. p_arr->_unregister_observer (this); p_arr = nullptr; - + // Notify the concrete oberver that the detachment took place. after_detach(); @@ -151,7 +151,7 @@ class Arr_observer /// \name Notification functions on global arrangement operations. //@{ - /*! + /*! * Notification before the arrangement is assigned with another * arrangement. * \param arr The arrangement to be copied. @@ -188,7 +188,7 @@ class Arr_observer /// \name Notification functions on observer attachment or detachment. //@{ - /*! + /*! * Notification before the observer is attached to an arrangement. * \param arr The arrangement we are about to attach the observer to. */ @@ -201,7 +201,7 @@ class Arr_observer virtual void after_attach () {} - /*! + /*! * Notification before the observer is detached from the arrangement. */ virtual void before_detach () diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h index 87de5d4527c1..328ca973b3c3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Eric Berberich diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h index 82d04dc3ffd0..103f47c670c7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h @@ -411,7 +411,7 @@ class Arr_batched_point_location_traits_2 Compare_y_at_x_right_2 compare_y_at_x_right_2_object () const { return (Compare_y_at_x_right_2 - (m_base_traits->compare_y_at_x_right_2_object())); + (m_base_traits->compare_y_at_x_right_2_object())); } /*! A functor that checks whether two points and two x-monotone curves are @@ -442,7 +442,7 @@ class Arr_batched_point_location_traits_2 public: /*! Check if two curves are the same. */ bool operator() (const X_monotone_curve_2& xcv1, - const X_monotone_curve_2& xcv2) const + const X_monotone_curve_2& xcv2) const { if (xcv1.halfedge_handle() == xcv2.halfedge_handle() && xcv1.halfedge_handle() != invalid_he) @@ -923,7 +923,7 @@ class Arr_batched_point_location_traits_2 { return m_base->compare_x_near_boundary_2_object()(xcv1.base(), xcv2.base(), - ce); + ce); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index 53965aa6622c..eb9679a8883b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -18,7 +18,7 @@ /*! \file - * Member-function definitions for the + * Member-function definitions for the * Arr_landmarks_point_location class. */ @@ -31,7 +31,7 @@ template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location::locate(const Point_2& p) const { - // If the arrangement is empty, return its initial (empty and + // If the arrangement is empty, return its initial (empty and // non-fictitious) face. if (p_arr->number_of_vertices() == 0) { CGAL_assertion(p_arr->number_of_faces() == 1); @@ -39,9 +39,9 @@ Arr_landmarks_point_location::locate(const Point_2& p) const return make_result(fh); } // Use the generator and to find the closest landmark to the query point. - result_type lm_location_obj; + result_type lm_location_obj; const Point_2& landmark_point = lm_gen->closest_landmark(p, lm_location_obj); - + // If the query point and the landmark point are equal, return the landmark. if (m_traits->equal_2_object()(landmark_point, p)) return lm_location_obj; @@ -63,7 +63,7 @@ Arr_landmarks_point_location::locate(const Point_2& p) const else if ( ( fh = Result().template assign(lm_location_obj) ) ) out_obj = _walk_from_face(*fh, landmark_point, p, crossed_edges); else CGAL_error_msg("lm_location_obj of an unknown type."); - + if ( ( fh = Result().template assign(out_obj) ) ) { // If we reached here, we did not locate the query point in any of the // holes inside the current face, so we conclude it is contained in this @@ -187,12 +187,12 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, //----------------------------------------------------------------------------- // Locate an edge around a given vertex that is the predecessor of the curve // connecting the vertex to the query point in a clockwise order. -// +// template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location:: _find_face_around_vertex(Vertex_const_handle vh, - const Point_2& p, + const Point_2& p, bool& new_vertex) const { new_vertex = false; @@ -289,7 +289,7 @@ _find_face_around_vertex(Vertex_const_handle vh, } // Check whether p lies on the curve associated with the edge. - if (m_traits->is_in_x_range_2_object()(curr->curve(), p) && + if (m_traits->is_in_x_range_2_object()(curr->curve(), p) && m_traits->compare_y_at_x_2_object()(p, curr->curve()) == EQUAL) { // p is located on the interior of the edge. @@ -385,7 +385,7 @@ _walk_from_edge(Halfedge_const_handle eh, // incident to the face that is most likely to contain p. res = m_traits->compare_y_at_x_2_object()(p, cv); - switch (res) { + switch (res) { case EQUAL: // The edge contains p in its interior: return make_result(eh); @@ -428,7 +428,7 @@ _walk_from_edge(Halfedge_const_handle eh, } //----------------------------------------------------------------------------- -// In case the arrangement's curve contained in the segment +// In case the arrangement's curve contained in the segment // from the nearest landmark to the query point // template @@ -477,7 +477,7 @@ _walk_from_face(Face_const_handle face, { // Construct an x-monotone curve connecting the nearest landmark point np // to the query point p and check which CCB intersects this segment. - X_monotone_curve_2 seg = + X_monotone_curve_2 seg = m_traits->construct_x_monotone_curve_2_object()(np, p); const bool p_is_left = (m_traits->compare_xy_2_object()(np, p) == LARGER); @@ -603,7 +603,7 @@ _intersection_with_ccb(Ccb_halfedge_const_circulator circ, is_target = false; // Go over the CCB. - typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = + typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = m_traits->is_in_x_range_2_object(); Ccb_halfedge_const_circulator curr = circ , temp_circ; const Halfedge_const_handle invalid_he; @@ -653,7 +653,7 @@ _intersection_with_ccb(Ccb_halfedge_const_circulator circ, if (is_on_edge) return _in_case_p_is_on_edge(he,crossed_edges,p,is_target); - if ((!curr->target()->is_at_open_boundary()) && + if ((!curr->target()->is_at_open_boundary()) && is_in_x_range(seg, curr->target()->point())) { // if the target point of curr is located on seg @@ -669,7 +669,7 @@ _intersection_with_ccb(Ccb_halfedge_const_circulator circ, { // if the source point of curr is located on seg // we should walk from it to the query point - if (m_traits->compare_y_at_x_2_object() + if (m_traits->compare_y_at_x_2_object() (curr->source()->point() , seg) == EQUAL) { new_vertex = curr->source(); @@ -756,7 +756,7 @@ _have_odd_intersections(const X_monotone_curve_2& cv, bool& cv_and_seg_overlap, bool& cv_is_contained_in_seg) const { - typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = + typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = m_traits->is_in_x_range_2_object(); p_on_curve = false; cv_and_seg_overlap = false; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h index 0ef681e73d21..2be9d949aee2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h @@ -40,7 +40,7 @@ class Arr_middle_edges_landmarks_generator : public Arr_landmarks_generator_base { public: - typedef Arrangement_ Arrangement_2; + typedef Arrangement_ Arrangement_2; typedef Nearest_neighbor_ Nearest_neighbor; private: @@ -51,21 +51,21 @@ class Arr_middle_edges_landmarks_generator : public: typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; + typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::Face_handle Face_handle; + typedef typename Arrangement_2::Vertex_handle Vertex_handle; + typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + typedef typename Arrangement_2::Face_handle Face_handle; typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; typedef typename Base::NN_Points_set NN_Points_set; typedef typename Base::NN_Point_2 NN_Point_2; - typedef typename Geometry_traits_2::Point_2 Point_2; - typedef std::vector Points_set; + typedef typename Geometry_traits_2::Point_2 Point_2; + typedef std::vector Points_set; typedef typename Base::PL_result_type PL_result_type; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h index 1d8c24f00cd8..71059ab2be40 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Idit Haran // Ron Wein // Efi Fogel @@ -104,7 +104,7 @@ class Arr_landmarks_nearest_neighbor { bool operator== (const NN_Point_2& nnp) const { return (m_vec[0] == nnp.m_vec[0] && m_vec[1] == nnp.m_vec[1]); } - bool operator!= (const NN_Point_2& nnp) const + bool operator!= (const NN_Point_2& nnp) const { return (m_vec[0] != nnp.m_vec[0] || m_vec[1] != nnp.m_vec[1]); } }; @@ -115,7 +115,7 @@ class Arr_landmarks_nearest_neighbor { struct Construct_coord_iterator { typedef const Approximate_number_type* result_type; - + /*! Get an iterator for the approximate coordinates. */ const Approximate_number_type* operator()(const NN_Point_2& nnp) const { return (nnp.begin()); } @@ -137,9 +137,9 @@ class Arr_landmarks_nearest_neighbor { Tree* m_tree; // The search tree. bool m_is_empty; // Is the search tree empty. -public: +public: bool is_empty() const { return m_is_empty; } - + private: typedef Arr_landmarks_nearest_neighbor Self; @@ -182,7 +182,7 @@ class Arr_landmarks_nearest_neighbor { } /*! Clear the search tree. */ - void clear() + void clear() { if (m_tree != nullptr) delete m_tree; @@ -210,7 +210,7 @@ class Arr_landmarks_nearest_neighbor { // For some reason search.begin()->first fails const NN_Point_2& nearest_p = (*(search.begin())).first; - obj = nearest_p.object(); + obj = nearest_p.object(); return nearest_p.point(); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h index 4f8971188d7f..256a599ad224 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Eyal Flato) @@ -46,9 +46,9 @@ Arr_naive_point_location::locate(const Point_2& p) const // Go over arrangement halfedges and check whether one of them contains // the query point in its interior. - typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = + typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = geom_traits->is_in_x_range_2_object(); - typename Traits_adaptor_2::Compare_y_at_x_2 compare_y_at_x = + typename Traits_adaptor_2::Compare_y_at_x_2 compare_y_at_x = geom_traits->compare_y_at_x_2_object(); typename Arrangement_2::Edge_const_iterator eit; Halfedge_const_handle hh; @@ -66,10 +66,10 @@ Arr_naive_point_location::locate(const Point_2& p) const Face_const_handle fh; Face_const_handle f_inner; const Face_const_handle invalid_f; - + for (fit = p_arr->faces_begin(); fit != p_arr->faces_end(); ++fit) { fh = fit; - + if (top_traits->is_in_face(&(*fh), p, nullptr)) { // The current face contains p in its interior. if (f_inner == invalid_f || diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h index 81845eab0507..3687874efca9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Idit Haran @@ -24,9 +24,9 @@ #define CGAL_TRAP_DEBUG #ifdef CGAL_TRG_DEBUG - #define CGAL_TRAP_PRINT_DEBUG(expr) std::cout << expr << std::endl + #define CGAL_TRAP_PRINT_DEBUG(expr) std::cout << expr << std::endl #else - #define CGAL_TRAP_PRINT_DEBUG(expr) + #define CGAL_TRAP_PRINT_DEBUG(expr) #endif namespace CGAL { @@ -42,20 +42,20 @@ Arr_trapezoid_ric_point_location::locate(const Point_2& p) const //there are different internal compiler errors if we // typedef the Locate_type - typename TD::Locate_type td_lt; + typename TD::Locate_type td_lt; Td_map_item& tr = td.locate(p,td_lt); CGAL_TRAP_PRINT_DEBUG("after td.locate"); // treat special case, where trapezoid is unbounded. - // for then get_parent() is not defined + // for then get_parent() is not defined if (td_lt==TD::UNBOUNDED_TRAPEZOID) { CGAL_TRAP_PRINT_DEBUG("UNBOUNDED_TRAPEZOID"); Face_const_handle ubf = _get_unbounded_face(tr, p, Are_all_sides_oblivious_category()); - + //check isolated vertices Isolated_vertex_const_iterator iso_verts_it; for (iso_verts_it = ubf->isolated_vertices_begin(); @@ -87,12 +87,12 @@ Arr_trapezoid_ric_point_location::locate(const Point_2& p) const Td_active_edge& e (boost::get(tr)); Halfedge_const_handle h = e.halfedge(); CGAL_TRAP_PRINT_DEBUG("CURVE"); - if ( m_traits->is_in_x_range_2_object()(h->curve(),p) && + if ( m_traits->is_in_x_range_2_object()(h->curve(),p) && m_traits->compare_y_at_x_2_object()(p,h->curve()) == EQUAL) return make_result(h); else { //ixx - std::cerr << "curve is: "<< h->curve() <<" point is: "<< p <curve() <<" point is: "<< p <::locate(const Point_2& p) const Td_active_trapezoid t (boost::get(tr)); Halfedge_const_handle h = t.top(); CGAL_TRAP_PRINT_DEBUG("TRAPEZOID"); - bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) + bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) && (m_traits->compare_y_at_x_2_object() (p, h->curve()) == LARGER) ; bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT); @@ -134,14 +134,14 @@ Arr_trapezoid_ric_point_location::locate(const Point_2& p) const } CGAL_TRAP_PRINT_DEBUG("EMPTY"); - return default_result(); + return default_result(); } /*! gets the unbounded face that contains the point when the trapezoid is unbounded - */ + */ template -typename Arr_trapezoid_ric_point_location::Face_const_handle +typename Arr_trapezoid_ric_point_location::Face_const_handle Arr_trapezoid_ric_point_location:: _get_unbounded_face(const Td_map_item& /* item */, const Point_2& /* p */, Arr_all_sides_oblivious_tag) const @@ -153,9 +153,9 @@ _get_unbounded_face(const Td_map_item& /* item */, const Point_2& /* p */, /*! gets the unbounded face that contains the point when the trapezoid * is unbounded - */ + */ template -typename Arr_trapezoid_ric_point_location::Face_const_handle +typename Arr_trapezoid_ric_point_location::Face_const_handle Arr_trapezoid_ric_point_location:: _get_unbounded_face(const Td_map_item& item,const Point_2& p, Arr_not_all_sides_oblivious_tag) const @@ -175,11 +175,11 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, } else if (!tr.is_on_left_boundary()) { //if top & bottom edges are not defined but the left() curve end is defined - + //there are different internal compiler errors if we // typedef the Locate_type - typename TD::Locate_type td_lt; - + typename TD::Locate_type td_lt; + //locate the degenerate trapezoid containing tr.left() Td_map_item& left_v_item = td.locate(tr.left(),td_lt); CGAL_assertion(td_lt == TD::POINT); @@ -194,7 +194,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, he = v.cw_he(); } //cw_he() holds the "smallest" curve clockwise starting from 12 o'clock - + CGAL_assertion_code(Halfedge_const_handle invalid_he); CGAL_assertion(he != invalid_he); @@ -207,12 +207,12 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, else if (!tr.is_on_right_boundary()) { //if top, bottom, left edges are not defined but the right() curve end // is defined - + //there are different internal compiler errors if we // typedef the Locate_type - typename TD::Locate_type td_lt; - - //locate the degenerate trapezoid of tr.right(). + typename TD::Locate_type td_lt; + + //locate the degenerate trapezoid of tr.right(). Td_map_item& right_v_item = td.locate(tr.right(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; @@ -225,19 +225,19 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, v(boost::get(right_v_item)); he = v.cw_he(); } - //its cw_he() holds the "smallest" curve clockwise starting from + //its cw_he() holds the "smallest" curve clockwise starting from // 12 o'clock - + CGAL_assertion_code(Halfedge_handle invalid_he); CGAL_assertion(he != invalid_he); //the Halfedge_handle source is right_ee. // this way the face on it's left is the desired one - + //MICHAL: maybe add a verification that the above occures return he->face(); } - + //else, on all boundaries (top, bottom, left, right - are not defined), // this is the only trapezoid in the map return this->arrangement()->unbounded_faces_begin(); @@ -256,12 +256,12 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const //trying to workaround internal compiler error typename TD::Locate_type td_lt; Halfedge_const_handle invalid_he; - + Td_map_item& item = td.vertical_ray_shoot(p, td_lt, shoot_up); // treat special case, where trapezoid is unbounded. if (td_lt==TD::UNBOUNDED_TRAPEZOID) - { + { return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up, item)); } @@ -278,7 +278,7 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const { Td_active_edge& e (boost::get(item)); Halfedge_const_handle h = e.halfedge(); - + if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) || (!shoot_up && h->direction() == ARR_RIGHT_TO_LEFT)) { @@ -291,8 +291,8 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const { Td_active_trapezoid trpz (boost::get(item)); Halfedge_const_handle h = (shoot_up) ? trpz.top() : trpz.bottom(); - - bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) + + bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) && (m_traits->compare_y_at_x_2_object() (p, h->curve()) == LARGER) ; bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT); @@ -315,12 +315,12 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const // In vertical ray shoot, when the closest halfedge is found (or unbounded // face) we check the isolated vertices inside the face to check whether there // is an isolated vertex right above/below the query point. -// +// template typename Arr_trapezoid_ric_point_location::result_type Arr_trapezoid_ric_point_location:: -_check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, - const Point_2& p, +_check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, + const Point_2& p, bool shoot_up, const Td_map_item& tr) const { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_triangulation_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_triangulation_pl_impl.h index ad3f7d2a76ed..5dffa9bbccfc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_triangulation_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_triangulation_pl_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Idit Haran #ifndef CGAL_ARR_TRIANGULATION_POINT_LOCATION_FUNCTIONS_H @@ -23,9 +23,9 @@ //#define CGAL_TRG_DEBUG #ifdef CGAL_TRG_DEBUG - #define CGAL_TRG_PRINT_DEBUG(expr) std::cout << expr << std::endl + #define CGAL_TRG_PRINT_DEBUG(expr) std::cout << expr << std::endl #else - #define CGAL_TRG_PRINT_DEBUG(expr) + #define CGAL_TRG_PRINT_DEBUG(expr) #endif namespace CGAL { @@ -85,20 +85,20 @@ Arr_triangulation_point_location::locate (const Point_2& p) const case CDT::EDGE: { CGAL_TRG_PRINT_DEBUG("locate type = edge"<
    • vertex(0)->info(); + Vertex_const_handle v0 = fh->vertex(0)->info(); Vertex_const_handle v1 = fh->vertex(1)->info(); Vertex_const_handle v2 = fh->vertex(2)->info(); //the vertices should not be isolated, since we do not insert the - //isolated vertices as points in the triangulation, only edges - // (and thus vertices inceident to this edge). - //in the future it is possible to add isolated vertices to the + //isolated vertices as points in the triangulation, only edges + // (and thus vertices inceident to this edge). + //in the future it is possible to add isolated vertices to the // triangulation, and then, when found, take its incident_face CGAL_assertion(!v0->is_isolated()); CGAL_assertion(!v1->is_isolated()); @@ -142,13 +142,13 @@ Arr_triangulation_point_location::locate (const Point_2& p) const if (v2->is_isolated()) return make_result(v2->face()); //find the face in the pm correspond to the 3 vertices - Halfedge_around_vertex_const_circulator havc0 = v0->incident_halfedges(); + Halfedge_around_vertex_const_circulator havc0 = v0->incident_halfedges(); Halfedge_around_vertex_const_circulator havc0_done (havc0); - Halfedge_around_vertex_const_circulator havc1 = v1->incident_halfedges(); + Halfedge_around_vertex_const_circulator havc1 = v1->incident_halfedges(); Halfedge_around_vertex_const_circulator havc1_done (havc1); - Halfedge_around_vertex_const_circulator havc2 = v2->incident_halfedges(); + Halfedge_around_vertex_const_circulator havc2 = v2->incident_halfedges(); Halfedge_around_vertex_const_circulator havc2_done (havc2); //loop to find face @@ -156,9 +156,9 @@ Arr_triangulation_point_location::locate (const Point_2& p) const bool found_unbounded = false; do { //get face from halfedge - Face_const_handle f0 = (*havc0).face(); + Face_const_handle f0 = (*havc0).face(); do { - Face_const_handle f1 = (*havc1).face(); + Face_const_handle f1 = (*havc1).face(); if (f0 == f1) { CGAL_TRG_PRINT_DEBUG("f0 == f1"); do { @@ -182,7 +182,7 @@ Arr_triangulation_point_location::locate (const Point_2& p) const std::cerr<< "NOT GOOD - face not found" << std::endl; //debug - print some more info std::cout << "p = "<< p <arrangement()->edges_begin(); - for (eit = this->arrangement()->edges_begin(); + for (eit = this->arrangement()->edges_begin(); eit != this->arrangement()->edges_end(); eit++) { //get vertices from edge diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h index b920a7bbffaa..c8971c5d1ebc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Oren Nechushtan @@ -105,7 +105,7 @@ Arr_walk_along_line_point_location::locate(const Point_2& p) const // Shoot up. closest_he = _first_around_vertex(closest_he->target(), true); } - + // Move inside the faces that constitute the hole, the first one // being incident face of the twin of closest halfedge found so far. CGAL_assertion (face != closest_he->twin()->face()); @@ -439,7 +439,7 @@ _is_in_connected_component (const Point_2& p, // As far as we know, we are not on an edge. is_on_edge = false; closest_to_target = false; - + // Set the results for comparison acording to the ray direction. const Comparison_result point_above_under = (shoot_up ? SMALLER : LARGER); const Comparison_result curve_above_under = (shoot_up ? LARGER : SMALLER); @@ -509,11 +509,11 @@ _is_in_connected_component (const Point_2& p, { // Check if the current vertical curve contains the query point in its // iterior. - const Comparison_result res1 = + const Comparison_result res1 = top_traits->compare_xy(p, &(*(first->source()))); const Comparison_result res2 = top_traits->compare_xy(p, &(*(first->target()))); - + if (res1 != res2) { if (! ((res1 == EQUAL && res2 == curve_above_under) || (res1 == curve_above_under && res2 == EQUAL))) @@ -642,12 +642,12 @@ _is_in_connected_component (const Point_2& p, { if (closest_he->direction() == ARR_LEFT_TO_RIGHT) { // Both curves extend to the right from a common point. - y_res = compare_y_at_x_right(closest_he->curve(), curr->curve(), + y_res = compare_y_at_x_right(closest_he->curve(), curr->curve(), closest_he->source()->point()); } else { // Both curves extend to the left from a common point. - y_res = compare_y_at_x_left(closest_he->curve(), curr->curve(), + y_res = compare_y_at_x_left(closest_he->curve(), curr->curve(), closest_he->source()->point()); } } @@ -659,12 +659,12 @@ _is_in_connected_component (const Point_2& p, { if (closest_he->direction() == ARR_LEFT_TO_RIGHT) { // Both curves extend to the left from a common point. - y_res = compare_y_at_x_left(closest_he->curve(), curr->curve(), + y_res = compare_y_at_x_left(closest_he->curve(), curr->curve(), closest_he->target()->point()); } else { // Both curves extend to the right from a common point. - y_res = compare_y_at_x_right(closest_he->curve(), curr->curve(), + y_res = compare_y_at_x_right(closest_he->curve(), curr->curve(), closest_he->target()->point()); } } @@ -706,7 +706,7 @@ _is_in_connected_component (const Point_2& p, while ((! next_non_vert->is_fictitious() && is_vertical(next_non_vert->curve())) || (next_non_vert->is_fictitious() && - next_non_vert->source()->parameter_space_in_x() != + next_non_vert->source()->parameter_space_in_x() != next_non_vert->target()->parameter_space_in_x())); // In case the source of the current curve and the target of @@ -755,7 +755,7 @@ _is_in_connected_component (const Point_2& p, { closest_he = curr; closest_in_ccb = true; - closest_to_target = + closest_to_target = ((shoot_up && curr->direction() == ARR_RIGHT_TO_LEFT) || (! shoot_up && curr->direction() == ARR_LEFT_TO_RIGHT)); } @@ -793,7 +793,7 @@ _first_around_vertex (Vertex_const_handle v, bool shoot_up) const Halfedge_const_handle lowest_left; Halfedge_const_handle top_right; - typename Arrangement_2::Halfedge_around_vertex_const_circulator first = + typename Arrangement_2::Halfedge_around_vertex_const_circulator first = v->incident_halfedges(); typename Arrangement_2::Halfedge_around_vertex_const_circulator curr = first; @@ -807,7 +807,7 @@ _first_around_vertex (Vertex_const_handle v, bool shoot_up) const (! curr->is_fictitious() && (lowest_left->is_fictitious() || compare_y_at_x_left (curr->curve(), - lowest_left->curve(), + lowest_left->curve(), v->point()) == SMALLER))) { lowest_left = curr; @@ -820,7 +820,7 @@ _first_around_vertex (Vertex_const_handle v, bool shoot_up) const (! curr->is_fictitious() && (top_right->is_fictitious() || compare_y_at_x_right (curr->curve(), - top_right->curve(), + top_right->curve(), v->point()) == LARGER))) { top_right = curr; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h index 8a291ab5e4e5..e7202ffe9357 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h @@ -6,9 +6,9 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Oren Nechushtan +// +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_X_TRAPEZOID_H @@ -38,24 +38,24 @@ namespace CGAL { * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) * and two curve-ends(left,right). * Trapezoids are represented as two curve-ends called right and left and - * two halfedges called top and bottom. The curve-ends (points) lie on the - * right and left boundaries of the trapezoid respectively and the halfedges + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges * bound the trapezoid from above and below. - * There exist degenerate trapezoids called infinite trapezoid; this happens + * There exist degenerate trapezoids called infinite trapezoid; this happens * when one of the four sides is on the parameter space boundary. * Trapezoids are created as active and become inactive when Remove() member * function called. * Each trapezoid has at most four neighbouring trapezoids. - * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an * edge-end (end point). */ template class Td_X_trapezoid : public Handle { public: - + //type of trapezoid type - enum Type + enum Type { TD_TRAPEZOID, TD_EDGE, @@ -64,7 +64,7 @@ class Td_X_trapezoid : public Handle //type of traits class typedef Td_traits_ Traits; - + //type of point (Point_2) typedef typename Traits::Point Point; @@ -76,13 +76,13 @@ class Td_X_trapezoid : public Handle //type of Halfedge_const_handle (trapezoid edge) typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; - + //type of Vertex_const_handle (trapezoid vertex) typedef typename Traits::Vertex_const_handle Vertex_const_handle; //type of Trapezoid (Self) typedef typename Traits::X_trapezoid Self; - + //type of Trapezoid parameter space // Ninetuple which represents the Trapezoid: // - for regular & edge trapezoids or active point trapezoids: @@ -92,21 +92,21 @@ class Td_X_trapezoid : public Handle // type flag + on boundaries flags, // left-bottom neighbor trapezoid, left-top neighbor trapezoid, // right-bottom neighbor trapezoid, right-top neighbor trapezoid - typedef Td_ninetuple, + typedef Td_ninetuple, boost::variant, boost::variant >, - Halfedge_const_handle, + Halfedge_const_handle, unsigned char, Self*, Self*, Self*, Self*> Trpz_parameter_space; - + //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - + //type of Around point circulator typedef typename TD::Around_point_circulator Around_point_circulator; - + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; @@ -117,7 +117,7 @@ class Td_X_trapezoid : public Handle //friend class declarations: friend class Trapezoidal_decomposition_2; - + #ifdef CGAL_PM_FRIEND_CLASS #if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) friend class Trapezoidal_decomposition_2::Around_point_circulator; @@ -131,20 +131,20 @@ class Td_X_trapezoid : public Handle friend class Trapezoidal_decomposition_2::Around_point_circulator; friend class Trapezoidal_decomposition_2::In_face_iterator; #endif - + #else friend class Around_point_circulator; friend class In_face_iterator; #endif #endif - - - + + + private: - + Trpz_parameter_space* ptr() const { return (Trpz_parameter_space*)(PTR); } - - + + #ifndef CGAL_TD_DEBUG #ifdef CGAL_PM_FRIEND_CLASS protected: @@ -154,9 +154,9 @@ class Td_X_trapezoid : public Handle #else //CGAL_TD_DEBUG public: #endif //CGAL_TD_DEBUG - + Dag_node* m_dag_node; //pointer to the search structure (DAG) node - + /*! Initialize the trapezoid's neighbours. */ CGAL_TD_INLINE void init_neighbours(Self* lb_ = 0, Self* lt_ = 0, Self* rb_ = 0, Self* rt_ = 0) @@ -168,34 +168,34 @@ class Td_X_trapezoid : public Handle } /*! Set the DAG node. */ - CGAL_TD_INLINE void set_dag_node(Dag_node* p) + CGAL_TD_INLINE void set_dag_node(Dag_node* p) { m_dag_node = p; - + #ifdef CGAL_TD_DEBUG - + CGAL_assertion(!p || **p == *this); - -#endif - + +#endif + } - + /*! Set the trapezoid's left (Vertex_const_handle). */ - CGAL_TD_INLINE void set_left(Vertex_const_handle v) + CGAL_TD_INLINE void set_left(Vertex_const_handle v) { CGAL_precondition(is_active()); ptr()->e0 = v; } - + /*! Set the trapezoid's right (Vertex_const_handle). */ - CGAL_TD_INLINE void set_right(Vertex_const_handle v) + CGAL_TD_INLINE void set_right(Vertex_const_handle v) { CGAL_precondition(is_active()); ptr()->e1 = v; } - + /*! Set the trapezoid's bottom (Halfedge_const_handle). */ - CGAL_TD_INLINE void set_bottom(Halfedge_const_handle he) + CGAL_TD_INLINE void set_bottom(Halfedge_const_handle he) { CGAL_precondition(is_active()); if (!is_on_bottom_boundary() && @@ -208,9 +208,9 @@ class Td_X_trapezoid : public Handle ptr()->e2 = he; } } - + /*! Set the trapezoid's top (Halfedge_const_handle). */ - CGAL_TD_INLINE void set_top(Halfedge_const_handle he) + CGAL_TD_INLINE void set_top(Halfedge_const_handle he) { CGAL_precondition(is_active()); if (!is_on_top_boundary() && @@ -223,7 +223,7 @@ class Td_X_trapezoid : public Handle ptr()->e3 = he; } } - + CGAL_TD_INLINE void update_removed_trpz() { CGAL_precondition(is_active()); @@ -234,27 +234,27 @@ class Td_X_trapezoid : public Handle set_curve_for_rem_he(top()->curve()); return; } - + //else if (type() == TD_VERTEX) - + Curve_end v_ce(left()->curve_end()); ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(v_ce.cv())); //CGAL_assertion(boost::get>( &(ptr()->e2)) != nullptr); - + ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END; - + if (!is_on_boundaries()) { //if the trapezoid respresents an inner vertex ptr()->e0 = left()->point(); } } - + /*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */ CGAL_TD_INLINE void set_curve_for_rem_he(const X_monotone_curve_2& cv) { CGAL_precondition (type() == TD_EDGE); - + ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(cv)); } @@ -264,57 +264,57 @@ class Td_X_trapezoid : public Handle ptr()->e4 &= ~CGAL_TD_TYPE_MASK; ptr()->e4 |= obj_type; } - + /*! Set is on left boundary flag. */ - CGAL_TD_INLINE void set_is_on_left_boundary(bool b) + CGAL_TD_INLINE void set_is_on_left_boundary(bool b) { if (b) ptr()->e4 |= CGAL_TD_ON_LEFT_BOUNDARY; else ptr()->e4 &= ~CGAL_TD_ON_LEFT_BOUNDARY; } - + /*! Set is on right boundary flag. */ - CGAL_TD_INLINE void set_is_on_right_boundary(bool b) + CGAL_TD_INLINE void set_is_on_right_boundary(bool b) { if (b) ptr()->e4 |= CGAL_TD_ON_RIGHT_BOUNDARY; else ptr()->e4 &= ~CGAL_TD_ON_RIGHT_BOUNDARY; } - + /*! Set is on bottom boundary flag. */ - CGAL_TD_INLINE void set_is_on_bottom_boundary(bool b) + CGAL_TD_INLINE void set_is_on_bottom_boundary(bool b) { if (b) ptr()->e4 |= CGAL_TD_ON_BOTTOM_BOUNDARY; else ptr()->e4 &= ~CGAL_TD_ON_BOTTOM_BOUNDARY; } - + /*! Set is on top boundary flag. */ - CGAL_TD_INLINE void set_is_on_top_boundary(bool b) + CGAL_TD_INLINE void set_is_on_top_boundary(bool b) { if (b) ptr()->e4 |= CGAL_TD_ON_TOP_BOUNDARY; else ptr()->e4 &= ~CGAL_TD_ON_TOP_BOUNDARY; } - + /*! Set left bottom neighbour. */ CGAL_TD_INLINE void set_lb(Self* lb) { ptr()->e5 = lb; } - + /*! Set left top neighbour. */ CGAL_TD_INLINE void set_lt(Self* lt) { ptr()->e6 = lt; } - + /*! Set right bottom neighbour. */ CGAL_TD_INLINE void set_rb(Self* rb) { ptr()->e7 = rb; } - + /*! Set right top neighbour. */ CGAL_TD_INLINE void set_rt(Self* rt) { ptr()->e8 = rt; } public: - + /// \name Constructors. //@{ @@ -333,7 +333,7 @@ class Td_X_trapezoid : public Handle m_dag_node = 0; } - + /*! Constructor given Vertex & Halfedge handles. */ Td_X_trapezoid (Vertex_const_handle l, Vertex_const_handle r, Halfedge_const_handle b, Halfedge_const_handle t, @@ -343,7 +343,7 @@ class Td_X_trapezoid : public Handle Self* rb = 0, Self* rt = 0, Dag_node* node = 0) { - + //build the type flag unsigned char type_flag = 0; if (tp == TD_TRAPEZOID) @@ -357,7 +357,7 @@ class Td_X_trapezoid : public Handle (l, r, b, t, type_flag | boundness_flag, lb, lt, rb, rt); m_dag_node = node; } - + /*! Constructor given Pointers to Vertex & Halfedge handles. */ Td_X_trapezoid (Vertex_const_handle* l, Vertex_const_handle* r , Halfedge_const_handle* b, Halfedge_const_handle* t, @@ -376,33 +376,33 @@ class Td_X_trapezoid : public Handle b ? *b : Traits::he_at_bottom_infinity(), t ? *t : Traits::he_at_top_infinity(), (type_flag | - (on_left_bndry ? CGAL_TD_ON_LEFT_BOUNDARY : 0) | - (on_right_bndry ? CGAL_TD_ON_RIGHT_BOUNDARY : 0) | - (on_bottom_bndry ? CGAL_TD_ON_BOTTOM_BOUNDARY : 0) | + (on_left_bndry ? CGAL_TD_ON_LEFT_BOUNDARY : 0) | + (on_right_bndry ? CGAL_TD_ON_RIGHT_BOUNDARY : 0) | + (on_bottom_bndry ? CGAL_TD_ON_BOTTOM_BOUNDARY : 0) | (on_top_bndry ? CGAL_TD_ON_TOP_BOUNDARY : 0) ), - lb, lt, rb, rt); + lb, lt, rb, rt); m_dag_node = node; } - + /*! Copy constructor. */ Td_X_trapezoid (const Self& tr) : Handle(tr) { m_dag_node = tr.m_dag_node; } - + //@} - + /// \name Operator overloading. //@{ - /*! Assignment operator. - * operator= should not copy m_dag_node (or otherwise update + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update * Dag_node::replace) */ CGAL_TD_INLINE Self& operator= (const Self& t2) { - Handle::operator=(t2); - return *this; + Handle::operator=(t2); + return *this; } /*! Operator==. */ @@ -423,12 +423,12 @@ class Td_X_trapezoid : public Handle /// \name Access methods. //@{ - CGAL_TD_INLINE Self& self() + CGAL_TD_INLINE Self& self() { return *this; } - - CGAL_TD_INLINE const Self& self() const + + CGAL_TD_INLINE const Self& self() const { return *this; } @@ -442,17 +442,17 @@ class Td_X_trapezoid : public Handle /*! Access trapezoid left. */ CGAL_TD_INLINE Vertex_const_handle left_unsafe() const { - CGAL_precondition(is_active()); + CGAL_precondition(is_active()); CGAL_assertion(boost::get(&(ptr()->e0)) != nullptr); return boost::get(ptr()->e0); } - /*! Access trapezoid left. + /*! Access trapezoid left. * filters out the infinite case which returns predefined dummy values */ CGAL_TD_INLINE Vertex_const_handle left() const { - CGAL_precondition(is_active()); + CGAL_precondition(is_active()); if (is_on_left_boundary() && is_on_bottom_boundary() && is_on_top_boundary()) { @@ -465,17 +465,17 @@ class Td_X_trapezoid : public Handle /*! Access trapezoid right. */ CGAL_TD_INLINE Vertex_const_handle right_unsafe() const { - CGAL_precondition(is_active()); + CGAL_precondition(is_active()); CGAL_assertion(boost::get(&(ptr()->e1)) != nullptr); return boost::get(ptr()->e1); } - /*! Access trapezoid right. + /*! Access trapezoid right. * filters out the infinite case which returns predefined dummy values */ CGAL_TD_INLINE Vertex_const_handle right () const { - CGAL_precondition(is_active()); + CGAL_precondition(is_active()); if (is_on_right_boundary() && is_on_bottom_boundary() && is_on_top_boundary()) { @@ -484,55 +484,55 @@ class Td_X_trapezoid : public Handle //else return right_unsafe(); } - + /*! Access trapezoid bottom. */ CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const { - CGAL_precondition(is_active()); + CGAL_precondition(is_active()); CGAL_assertion(boost::get(&(ptr()->e2)) != nullptr); return boost::get(ptr()->e2); } - - /*! Access trapezoid bottom. + + /*! Access trapezoid bottom. * filters out the infinite case which returns predefined dummy values */ CGAL_TD_INLINE Halfedge_const_handle bottom () const { - CGAL_precondition(is_active()); - return !is_on_bottom_boundary() ? + CGAL_precondition(is_active()); + return !is_on_bottom_boundary() ? bottom_unsafe() : Traits::he_at_bottom_infinity(); } /*! Access trapezoid top. */ CGAL_TD_INLINE Halfedge_const_handle top_unsafe () const { - CGAL_precondition(is_active()); + CGAL_precondition(is_active()); return ptr()->e3; } - - /*! Access trapezoid top. + + /*! Access trapezoid top. * filters out the infinite case which returns predefined dummy values */ CGAL_TD_INLINE Halfedge_const_handle top () const { - CGAL_precondition(is_active()); - return !is_on_top_boundary() ? + CGAL_precondition(is_active()); + return !is_on_top_boundary() ? top_unsafe() : Traits::he_at_top_infinity(); } - CGAL_TD_INLINE Point point_for_inner_rem_vtx() const + CGAL_TD_INLINE Point point_for_inner_rem_vtx() const { - CGAL_precondition(!is_active()); + CGAL_precondition(!is_active()); CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(!is_on_boundaries()); CGAL_assertion(boost::get( &(ptr()->e0)) != nullptr); return boost::get( ptr()->e0 ); } - - CGAL_TD_INLINE std::pair curve_end_pair_for_boundary_rem_vtx() const + + CGAL_TD_INLINE std::pair curve_end_pair_for_boundary_rem_vtx() const { - CGAL_precondition(!is_active()); + CGAL_precondition(!is_active()); CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(is_on_boundaries()); @@ -540,17 +540,17 @@ class Td_X_trapezoid : public Handle CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); - - Arr_curve_end ce = + + Arr_curve_end ce = (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? ARR_MIN_END : ARR_MAX_END; - + return std::make_pair(cv_ptr, ce); } - CGAL_TD_INLINE Curve_end curve_end_for_boundary_rem_vtx() const + CGAL_TD_INLINE Curve_end curve_end_for_boundary_rem_vtx() const { - CGAL_precondition(!is_active()); + CGAL_precondition(!is_active()); CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(is_on_boundaries()); @@ -558,35 +558,35 @@ class Td_X_trapezoid : public Handle CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); - - Arr_curve_end ce = + + Arr_curve_end ce = (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? ARR_MIN_END : ARR_MAX_END; - + return Curve_end(*cv_ptr, ce); } - CGAL_TD_INLINE Curve_end curve_end_for_rem_vtx() const + CGAL_TD_INLINE Curve_end curve_end_for_rem_vtx() const { - CGAL_precondition(!is_active()); + CGAL_precondition(!is_active()); CGAL_precondition(type() == TD_VERTEX); CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); - - Arr_curve_end ce = + + Arr_curve_end ce = (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? ARR_MIN_END : ARR_MAX_END; - + return Curve_end(*cv_ptr, ce); } - CGAL_TD_INLINE X_monotone_curve_2& curve_for_rem_he() const + CGAL_TD_INLINE X_monotone_curve_2& curve_for_rem_he() const { - CGAL_precondition(!is_active() && type() == TD_EDGE); - + CGAL_precondition(!is_active() && type() == TD_EDGE); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); @@ -594,7 +594,7 @@ class Td_X_trapezoid : public Handle } /*! Access trapezoid type. */ - CGAL_TD_INLINE Type type() const + CGAL_TD_INLINE Type type() const { switch(ptr()->e4 & CGAL_TD_TYPE_MASK) { @@ -607,95 +607,95 @@ class Td_X_trapezoid : public Handle default: CGAL_assertion(false); return TD_TRAPEZOID; - } + } } /*! Access trapezoid type flag. */ - CGAL_TD_INLINE unsigned char type_flag() const + CGAL_TD_INLINE unsigned char type_flag() const { return (ptr()->e4 & CGAL_TD_TYPE_MASK); } - + /*! Access on boundaries flag. */ - CGAL_TD_INLINE unsigned char on_boundaries_flag() const + CGAL_TD_INLINE unsigned char on_boundaries_flag() const { return (ptr()->e4 & CGAL_TD_ON_ALL_BOUNDARIES); } - + /*! Access is on left boundary. */ - CGAL_TD_INLINE bool is_on_left_boundary() const - { + CGAL_TD_INLINE bool is_on_left_boundary() const + { return (ptr()->e4 & CGAL_TD_ON_LEFT_BOUNDARY) != 0; } /*! Access is on right boundary. */ - CGAL_TD_INLINE bool is_on_right_boundary() const + CGAL_TD_INLINE bool is_on_right_boundary() const { return (ptr()->e4 & CGAL_TD_ON_RIGHT_BOUNDARY) != 0; } /*! Access is on bottom boundary. */ - CGAL_TD_INLINE bool is_on_bottom_boundary() const + CGAL_TD_INLINE bool is_on_bottom_boundary() const { return (ptr()->e4 & CGAL_TD_ON_BOTTOM_BOUNDARY) != 0; } /*! Access is on top boundary. */ - CGAL_TD_INLINE bool is_on_top_boundary() const + CGAL_TD_INLINE bool is_on_top_boundary() const { return (ptr()->e4 & CGAL_TD_ON_TOP_BOUNDARY) != 0; } - + /*! Access is on at least one boundary. */ CGAL_TD_INLINE bool is_on_boundaries() const - { + { return (ptr()->e4 & CGAL_TD_ON_ALL_BOUNDARIES) != 0; } - + /*! Access left bottom neighbour. */ Self* lb() const { return ptr()->e5; } - + /*! Access left top neighbour. */ Self* lt() const { return ptr()->e6; } - + /*! Access right bottom neighbour. */ Self* rb() const { return ptr()->e7; } - + /*! Access right top neighbour. */ Self* rt() const { return ptr()->e8; } - + /*! Access DAG node. */ Dag_node* dag_node() const {return m_dag_node;} - - + + //@} - + /*! is trapezoid active */ - bool is_active() const + bool is_active() const { return rb()!= - (Self*)CGAL_TD_DELETE_SIGNATURE; + (Self*)CGAL_TD_DELETE_SIGNATURE; } - + /*! Removing this trapezoid (defining it as in-active) */ CGAL_TD_INLINE void remove(Dag_node* left=0) { CGAL_precondition(is_active()); - + // update vertex/edge trapezoid parameters after remove if (type() != TD_TRAPEZOID) update_removed_trpz(); - + // mark trapezoid as deleted, set_rb((Self*)CGAL_TD_DELETE_SIGNATURE); - + if (type() == TD_VERTEX) curve_end_for_rem_vtx(); - + // resets left son in data structure depending on input. if (left) m_dag_node->set_left_child(*left); - } + } /* Merge this trapezoid with the input trapezoid. Precondition: @@ -709,7 +709,7 @@ class Td_X_trapezoid : public Handle CGAL_TD_INLINE void merge_trapezoid( Self& right) { //precondition: both are of type trapezoid - CGAL_precondition((type() == TD_TRAPEZOID) && + CGAL_precondition((type() == TD_TRAPEZOID) && (right.type() == TD_TRAPEZOID)); //precondition: both are active CGAL_precondition(is_active() && right.is_active()); @@ -719,25 +719,25 @@ class Td_X_trapezoid : public Handle bool on_right_boundary = right.is_on_right_boundary(); *this = Self (!is_on_left_boundary() ? & left() : 0, - !on_right_boundary ? &right.right() : 0, - !is_on_bottom_boundary() ? &bottom() : 0, - !is_on_top_boundary() ? &top() : 0, + !on_right_boundary ? &right.right() : 0, + !is_on_bottom_boundary() ? &bottom() : 0, + !is_on_top_boundary() ? &top() : 0, CGAL_TD_TRAPEZOID, is_on_left_boundary(), on_right_boundary, is_on_bottom_boundary(), is_on_top_boundary(), - lb(),lt(), - right.rb(), - right.rt()); + lb(),lt(), + right.rb(), + right.rt()); if (rb()) rb()->set_lb(this); if (rt()) rt()->set_lt(this); - + CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary()); } - + #ifdef CGAL_TD_DEBUG //MICHAL: This method should not compile!! bool is_valid(const Traits* traits) const @@ -764,7 +764,7 @@ class Td_X_trapezoid : public Handle CGAL_warning(!CGAL_POINT_IS_LEFT_LOW(right(),left())); return false; } - + if (!is_on_bottom_boundary()) { if (is_on_left_boundary() || is_on_right_boundary()) @@ -774,7 +774,7 @@ class Td_X_trapezoid : public Handle CGAL_warning(!(is_on_left_boundary() ||is_on_right_boundary())); return false; } - + b = CGAL_IS_IN_X_RANGE(bottom(),left()); if (b) { t = CGAL_CURVE_COMPARE_Y_AT_X(left(), bottom()); @@ -788,7 +788,7 @@ class Td_X_trapezoid : public Handle CGAL_warning(t != SMALLER); return false; } - + b=CGAL_IS_IN_X_RANGE(bottom(),right()); if (b) { t = CGAL_CURVE_COMPARE_Y_AT_X(right(), bottom()); @@ -812,7 +812,7 @@ class Td_X_trapezoid : public Handle CGAL_warning(!(is_on_left_boundary() || is_on_right_boundary())); return false; } - + b=CGAL_IS_IN_X_RANGE(top(),left()); if (b) { t = CGAL_CURVE_COMPARE_Y_AT_X(left(), top()); @@ -826,7 +826,7 @@ class Td_X_trapezoid : public Handle CGAL_warning(t != LARGER); return false; } - + b=CGAL_IS_IN_X_RANGE(top(),right()); if (b) { t = CGAL_CURVE_COMPARE_Y_AT_X(right(), top()); @@ -843,9 +843,9 @@ class Td_X_trapezoid : public Handle } if (!traits->is_degenerate(*this)) { - if (rt() && + if (rt() && (! is_top_curve_equal(*rt(), traits)) || - lt() && + lt() && (! is_top_curve_equal(*lt(), traits)) || rb() && (! is_bottom_curve_equal(*rb(), traits)) || @@ -903,7 +903,7 @@ class Td_X_trapezoid : public Handle { /* if the trapezoid is degenerate, the left() and right() points should be on the top() and bottom() curves. - In any case none of the geometric boundaries should + In any case none of the geometric boundaries should be unbounded */ if (is_on_bottom_boundary()|| is_on_top_boundary()|| @@ -1048,7 +1048,7 @@ class Td_X_trapezoid : public Handle } return true; } - + CGAL_TD_INLINE void debug() const // instantiate ptr functions. { ptr(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index de584fcfb689..61259f33547b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Oren Nechushtan +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_ACTIVE_EDGE_H @@ -37,25 +37,25 @@ namespace CGAL { * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) * and two curve-ends(left,right). * Trapezoids are represented as two curve-ends called right and left and - * two halfedges called top and bottom. The curve-ends (points) lie on the - * right and left boundaries of the trapezoid respectively and the halfedges + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges * bound the trapezoid from above and below. - * There exist degenerate trapezoids called infinite trapezoid; this happens + * There exist degenerate trapezoids called infinite trapezoid; this happens * when one of the four sides is on the parameter space boundary. * Trapezoids are created as active and become inactive when Remove() member * function called. * Each trapezoid has at most four neighbouring trapezoids. - * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an * edge-end (end point). */ template class Td_active_edge : public Handle { public: - + //type of traits class typedef Td_traits_ Traits; - + //type of point (Point_2) typedef typename Traits::Point Point; @@ -67,7 +67,7 @@ class Td_active_edge : public Handle //type of Halfedge_const_handle (trapezoid edge) typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; - + //type of Vertex_const_handle (trapezoid vertex) typedef typename Traits::Vertex_const_handle Vertex_const_handle; @@ -75,10 +75,10 @@ class Td_active_edge : public Handle typedef typename Traits::Td_active_edge Self; typedef typename Traits::Td_map_item Td_map_item; - + //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; @@ -90,7 +90,7 @@ class Td_active_edge : public Handle friend class Trapezoidal_decomposition_2; friend struct internal::Non_recursive_td_map_item_destructor; - + #ifdef CGAL_PM_FRIEND_CLASS #if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) friend class Trapezoidal_decomposition_2::In_face_iterator; @@ -101,7 +101,7 @@ class Td_active_edge : public Handle #else friend class Trapezoidal_decomposition_2::In_face_iterator; #endif - + #else friend class In_face_iterator; #endif @@ -124,7 +124,7 @@ class Td_active_edge : public Handle Dag_node* _p_node) : he(_he),next(_next),p_node(_p_node) { } - + ~Data() { } protected: @@ -132,12 +132,12 @@ class Td_active_edge : public Handle Td_map_item next; Dag_node* p_node; }; - + private: - + Data* ptr() const { return (Data*)(PTR); } - - + + #ifndef CGAL_TD_DEBUG #ifdef CGAL_PM_FRIEND_CLASS protected: @@ -147,9 +147,9 @@ class Td_active_edge : public Handle #else //CGAL_TD_DEBUG public: #endif //CGAL_TD_DEBUG - + //Dag_node* m_dag_node; //pointer to the search structure (DAG) node - + /*! Initialize the trapezoid's neighbours. */ inline void init_neighbours(boost::optional next) { @@ -157,21 +157,21 @@ class Td_active_edge : public Handle } /*! Set the DAG node. */ - CGAL_TD_INLINE void set_dag_node(Dag_node* p) + CGAL_TD_INLINE void set_dag_node(Dag_node* p) { ptr()->p_node = p; //m_dag_node = p; - + //#ifdef CGAL_TD_DEBUG -// +// // CGAL_assertion(!p || **p == *this); -// -//#endif - +// +//#endif + } - + ///*! Set the trapezoid's bottom (Halfedge_const_handle). */ - CGAL_TD_INLINE void set_halfedge(Halfedge_const_handle he) + CGAL_TD_INLINE void set_halfedge(Halfedge_const_handle he) { if (halfedge() != Traits::empty_he_handle() && halfedge()->direction() != he->direction()) @@ -183,17 +183,17 @@ class Td_active_edge : public Handle ptr()->he = he; } } - + /*! Set next edge fragment. */ inline void set_next( const Td_map_item& next) { ptr()->next = next; } public: - + /// \name Constructors. //@{ Td_active_edge () { - + PTR = new Data (Traits::empty_he_handle(), Td_map_item(0), nullptr); //m_dag_node = nullptr; @@ -203,31 +203,31 @@ class Td_active_edge : public Handle Dag_node* node = 0, boost::optional next = boost::none) { - + PTR = new Data(he, (next) ? *next : Td_map_item(0), node); //m_dag_node = node; } - - + + /*! Copy constructor. */ Td_active_edge(const Self& tr) : Handle(tr) { // m_dag_node = tr.m_dag_node; } - + //@} - + /// \name Operator overloading. //@{ - /*! Assignment operator. - * operator= should not copy m_dag_node (or otherwise update + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update * Dag_node::replace) */ CGAL_TD_INLINE Self& operator= (const Self& t2) { - Handle::operator=(t2); - return *this; + Handle::operator=(t2); + return *this; } /*! Operator==. */ @@ -248,12 +248,12 @@ class Td_active_edge : public Handle /// \name Access methods. //@{ - CGAL_TD_INLINE Self& self() + CGAL_TD_INLINE Self& self() { return *this; } - - CGAL_TD_INLINE const Self& self() const + + CGAL_TD_INLINE const Self& self() const { return *this; } @@ -272,20 +272,20 @@ class Td_active_edge : public Handle /*! Access next edge fragment. */ Td_map_item& next() const { return ptr()->next; } - + /*! Access DAG node. */ Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;} - + bool is_last_reference() const { return this->refs()==1; } - + //@} - - - - + + + + }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index 3af1e0d7a272..8b92b739626e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Oren Nechushtan +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_ACTIVE_TRAPEZOID_H @@ -39,10 +39,10 @@ namespace CGAL { * Implementation of an active trapezoid as two halfedges(top,bottom) * and two vertices(left,right). * Trapezoids are represented as two vertices called right and left and - * two halfedges called top and bottom. The curve-ends (points) lie on the - * right and left boundaries of the trapezoid respectively and the halfedges + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges * bound the trapezoid from above and below. - * There exist degenerate trapezoids called infinite trapezoid; this happens + * There exist degenerate trapezoids called infinite trapezoid; this happens * when one of the four sides is on the parameter space boundary. * Each trapezoid has at most four neighbouring trapezoids. */ @@ -50,10 +50,10 @@ template class Td_active_trapezoid : public Handle { public: - + //type of traits class typedef Td_traits_ Traits; - + //type of point (Point_2) typedef typename Traits::Point Point; @@ -65,7 +65,7 @@ class Td_active_trapezoid : public Handle //type of Halfedge_const_handle (trapezoid edge) typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; - + //type of Vertex_const_handle (trapezoid vertex) typedef typename Traits::Vertex_const_handle Vertex_const_handle; @@ -73,10 +73,10 @@ class Td_active_trapezoid : public Handle typedef typename Traits::Td_active_trapezoid Self; typedef typename Traits::Td_map_item Td_map_item; - + //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; @@ -87,7 +87,7 @@ class Td_active_trapezoid : public Handle friend class Trapezoidal_decomposition_2; friend struct internal::Non_recursive_td_map_item_destructor; - + #ifdef CGAL_PM_FRIEND_CLASS #if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) friend class Trapezoidal_decomposition_2::In_face_iterator; @@ -98,12 +98,12 @@ class Td_active_trapezoid : public Handle #else friend class Trapezoidal_decomposition_2::In_face_iterator; #endif - + #else friend class In_face_iterator; #endif #endif - + protected: /*! \class @@ -115,7 +115,7 @@ class Td_active_trapezoid : public Handle public: //c'tors - Data (Vertex_const_handle _left_v, + Data (Vertex_const_handle _left_v, Vertex_const_handle _right_v, Halfedge_const_handle _bottom_he, Halfedge_const_handle _top_he, @@ -127,25 +127,25 @@ class Td_active_trapezoid : public Handle : left_v(_left_v),right_v(_right_v),bottom_he(_bottom_he),top_he(_top_he), lb(_lb),lt(_lt),rb(_rb),rt(_rt),p_node(_p_node) { } - + ~Data() { } protected: - Vertex_const_handle left_v; + Vertex_const_handle left_v; Vertex_const_handle right_v; Halfedge_const_handle bottom_he; Halfedge_const_handle top_he; Td_map_item lb; Td_map_item lt; - Td_map_item rb; + Td_map_item rb; Td_map_item rt; Dag_node* p_node; }; - + private: - + Data* ptr() const { return (Data*)(PTR); } - + public: ~Td_active_trapezoid(){ @@ -154,7 +154,7 @@ class Td_active_trapezoid : public Handle } private: - + #ifndef CGAL_TD_DEBUG #ifdef CGAL_PM_FRIEND_CLASS @@ -165,9 +165,9 @@ class Td_active_trapezoid : public Handle #else //CGAL_TD_DEBUG public: #endif //CGAL_TD_DEBUG - + //Dag_node* m_dag_node; //pointer to the search structure (DAG) node - + /*! Initialize the trapezoid's neighbours. */ inline void init_neighbours(boost::optional lb, boost::optional lt, boost::optional rb, boost::optional rt) @@ -179,74 +179,74 @@ class Td_active_trapezoid : public Handle } /*! Set the DAG node. */ - inline void set_dag_node(Dag_node* p) + inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; // m_dag_node = p; -// +// //#ifdef CGAL_TD_DEBUG -// +// // CGAL_assertion(!p || **p == *this); -// -//#endif - +// +//#endif + } - + /*! Set the trapezoid's left (Vertex_const_handle). */ - inline void set_left(Vertex_const_handle v) + inline void set_left(Vertex_const_handle v) { - ptr()->left_v = v; + ptr()->left_v = v; } - + /*! Set the trapezoid's right (Vertex_const_handle). */ - inline void set_right(Vertex_const_handle v) + inline void set_right(Vertex_const_handle v) { - ptr()->right_v = v; + ptr()->right_v = v; } - + /*! Set the trapezoid's bottom (Halfedge_const_handle). */ - inline void set_bottom(Halfedge_const_handle he) + inline void set_bottom(Halfedge_const_handle he) { if (!is_on_bottom_boundary() && bottom()->direction() != he->direction()) { - ptr()->bottom_he = he->twin(); + ptr()->bottom_he = he->twin(); } else { - ptr()->bottom_he = he; + ptr()->bottom_he = he; } } - + /*! Set the trapezoid's top (Halfedge_const_handle). */ - inline void set_top(Halfedge_const_handle he) + inline void set_top(Halfedge_const_handle he) { if (!is_on_top_boundary() && top()->direction() != he->direction()) { - ptr()->top_he = he->twin(); + ptr()->top_he = he->twin(); } else { - ptr()->top_he = he; + ptr()->top_he = he; } } - - + + /*! Set left bottom neighbour. */ inline void set_lb(const Td_map_item& lb) { ptr()->lb = lb; } - + /*! Set left top neighbour. */ inline void set_lt(const Td_map_item& lt) { ptr()->lt = lt; } - + /*! Set right bottom neighbour. */ inline void set_rb(const Td_map_item& rb) { ptr()->rb = rb; } - + /*! Set right top neighbour. */ inline void set_rt(const Td_map_item& rt) { ptr()->rt = rt; } public: - + /// \name Constructors. //@{ @@ -261,16 +261,16 @@ class Td_active_trapezoid : public Handle Traits::empty_he_handle(), Traits::empty_he_handle(), Td_map_item(0), Td_map_item(0) , Td_map_item(0) , Td_map_item(0), nullptr); - + //m_dag_node = 0; } - /*! Constructor given Vertex & Halfedge handles. */ + /*! Constructor given Vertex & Halfedge handles. */ Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r, Halfedge_const_handle b, Halfedge_const_handle t, - boost::optional lb = boost::none, + boost::optional lb = boost::none, boost::optional lt = boost::none, - boost::optional rb = boost::none, + boost::optional rb = boost::none, boost::optional rt = boost::none, Dag_node* node = 0) { @@ -278,27 +278,27 @@ class Td_active_trapezoid : public Handle (rb) ? *rb : Td_map_item(0), (rt) ? *rt : Td_map_item(0), node); //m_dag_node = node; } - - + + /*! Copy constructor. */ Td_active_trapezoid (const Self& tr) : Handle(tr) { //m_dag_node = tr.m_dag_node; } - + //@} - + /// \name Operator overloading. //@{ - /*! Assignment operator. - * operator= should not copy m_dag_node (or otherwise update + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update * Dag_node::replace) */ inline Self& operator= (const Self& t2) { - Handle::operator=(t2); - return *this; + Handle::operator=(t2); + return *this; } /*! Operator==. */ @@ -319,12 +319,12 @@ class Td_active_trapezoid : public Handle /// \name Access methods. //@{ - inline Self& self() + inline Self& self() { return *this; } - inline const Self& self() const + inline const Self& self() const { return *this; } @@ -335,7 +335,7 @@ class Td_active_trapezoid : public Handle return (unsigned long) PTR; } - /*! Access trapezoid left. + /*! Access trapezoid left. * filters out the infinite case which returns predefined dummy values */ inline Vertex_const_handle left() const @@ -343,76 +343,76 @@ class Td_active_trapezoid : public Handle return ptr()->left_v; } - /*! Access trapezoid right. + /*! Access trapezoid right. * filters out the infinite case which returns predefined dummy values */ inline Vertex_const_handle right () const { - return ptr()->right_v; + return ptr()->right_v; } - - /*! Access trapezoid bottom. + + /*! Access trapezoid bottom. * filters out the infinite case which returns predefined dummy values */ inline Halfedge_const_handle bottom () const { - return ptr()->bottom_he; + return ptr()->bottom_he; } - - /*! Access trapezoid top. + + /*! Access trapezoid top. * filters out the infinite case which returns predefined dummy values */ inline Halfedge_const_handle top () const { - return ptr()->top_he; + return ptr()->top_he; } /*! Access is on left boundary. */ - inline bool is_on_left_boundary() const - { + inline bool is_on_left_boundary() const + { return (left() == Traits::empty_vtx_handle()); } /*! Access is on right boundary. */ - inline bool is_on_right_boundary() const + inline bool is_on_right_boundary() const { return (right() == Traits::empty_vtx_handle()); } /*! Access is on bottom boundary. */ - inline bool is_on_bottom_boundary() const + inline bool is_on_bottom_boundary() const { return (bottom() == Traits::empty_he_handle()); } /*! Access is on top boundary. */ - inline bool is_on_top_boundary() const + inline bool is_on_top_boundary() const { return (top() == Traits::empty_he_handle()); } - + /*! Access is on at least one boundary. */ inline bool is_on_boundaries() const - { - return (is_on_left_boundary() || is_on_right_boundary() || + { + return (is_on_left_boundary() || is_on_right_boundary() || is_on_bottom_boundary() || is_on_top_boundary() ); } - + /*! Access left bottom neighbour. */ Td_map_item& lb() const { return ptr()->lb; } - + /*! Access left top neighbour. */ Td_map_item& lt() const { return ptr()->lt; } - + /*! Access right bottom neighbour. */ Td_map_item& rb() const { return ptr()->rb; } - + /*! Access right top neighbour. */ Td_map_item& rt() const { return ptr()->rt; } - + /*! Access DAG node. */ Dag_node* dag_node() const {return ptr()->p_node; } - + bool is_last_reference() const { return this->refs()==1; @@ -430,10 +430,10 @@ class Td_active_trapezoid : public Handle { internal::Non_recursive_td_map_item_destructor(*this); } - + //@} - - + + // Merge this trapezoid with the input trapezoid. // Precondition: // Both trapezoids are active and have the same bounding edges from @@ -455,19 +455,19 @@ class Td_active_trapezoid : public Handle ptr()->top_he = top(); ptr()->lb = lb(); ptr()->lt = lt(); - ptr()->rb = right.rb(); + ptr()->rb = right.rb(); ptr()->rt = right.rt(); - + Td_map_item item (*this); if (ptr()->rb.which() != 0) { - Self tr(boost::get(rb())); - tr.set_lb(item); + Self tr(boost::get(rb())); + tr.set_lb(item); } if (ptr()->rt.which() != 0) { - Self tr(boost::get(rt())); + Self tr(boost::get(rt())); tr.set_lt(item); } CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary()); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag.h index bce133bfc963..f8a47536c857 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Iddo Hanniel // Oren Nechushtan @@ -46,7 +46,7 @@ class Td_dag_base : public Handle public: Td_dag_base() {init();} Td_dag_base(const Td_dag_base & x) : Handle(x) {} - Td_dag_base & operator=(const Td_dag_base & x) + Td_dag_base & operator=(const Td_dag_base & x) {Handle::operator=(x); return *this; } bool operator!() const { return PTR == 0; } }; @@ -68,29 +68,29 @@ class Td_dag : public Td_dag_base using Td_dag_handle::operator!; #endif -protected: +protected: class node : public Rep { friend class Td_dag; public: - node(const T& e,unsigned long _depth=0) : + node(const T& e,unsigned long _depth=0) : data(e),leftPtr(),rightPtr(),depth_(_depth){} - node(const T& e, const Td_dag_handle& left, - const Td_dag_handle& right,unsigned long _depth=0) : + node(const T& e, const Td_dag_handle& left, + const Td_dag_handle& right,unsigned long _depth=0) : data(e),leftPtr(left),rightPtr(right),depth_(_depth){} - // node(const T& e) : data(e),leftPtr(),rightPtr(){} - // node(const T& e, const Td_dag_handle& left, + // node(const T& e) : data(e),leftPtr(),rightPtr(){} + // node(const T& e, const Td_dag_handle& left, // const Td_dag_handle& right) : data(e),leftPtr(left),rightPtr(right) {} ~node(){} bool is_inner_node() const {return !!leftPtr && !!rightPtr;} bool visited() const {return visited_;} protected: - T data; // information stored in node + T data; // information stored in node Td_dag_handle leftPtr,rightPtr; mutable unsigned long depth_; mutable bool visited_; }; - + public: /* -------constructors destructors -----*/ Td_dag(){} @@ -106,7 +106,7 @@ class Td_dag : public Td_dag_base { CGAL_precondition(!operator!()); return *(const Self*)&ptr()->leftPtr; - + } const Self& right() const { @@ -131,7 +131,7 @@ class Td_dag : public Td_dag_base { return data_ptr(); } - bool is_inner_node() const + bool is_inner_node() const {return !operator!() && ptr()->is_inner_node();} unsigned long size() const { @@ -152,9 +152,9 @@ class Td_dag : public Td_dag_base return !operator==(b); } /* dynamic management ---------*/ - + /* description: - Shallow copy */ + Shallow copy */ Self& operator=(const Self& b) { Handle::operator=(b); @@ -198,14 +198,14 @@ class Td_dag : public Td_dag_base { if (!operator!()) { - // create dummy Td_dag + // create dummy Td_dag T tmp; Self dummy(tmp); - // detach right son,redirect to dummy + // detach right son,redirect to dummy set_right(dummy); - // set right son pointer to 0 + // set right son pointer to 0 ptr()->rightPtr.PTR=0; - // delete dummy Td_dag + // delete dummy Td_dag delete dummy.ptr(); } } @@ -229,7 +229,7 @@ class Td_dag : public Td_dag_base CGAL_precondition(!operator!()); ptr()->leftPtr=left; if (left.depth()depth_=depth()+1; - left.rebalance_depth(); + left.rebalance_depth(); // does nothing if right is a leaf } void set_right(const Self& right) @@ -237,7 +237,7 @@ class Td_dag : public Td_dag_base CGAL_precondition(!operator!()); ptr()->rightPtr=right; if (right.depth()depth_=depth()+1; - right.rebalance_depth(); + right.rebalance_depth(); // does nothing if right is a leaf } void replace(const T& data,const Self& left,const Self& right) @@ -292,7 +292,7 @@ class Td_dag : public Td_dag_base } } #endif - + template Container& filter(Container& c,const Predicate& pr) const { @@ -310,8 +310,8 @@ class Td_dag : public Td_dag_base protected: void rebalance_depth() const { - if (is_inner_node()) - { + if (is_inner_node()) + { unsigned long depth_=depth(); if (left().depth() } } } - + unsigned long recursive_size() const { if (!operator!() && !ptr()->visited()) @@ -345,7 +345,7 @@ class Td_dag : public Td_dag_base { if (!operator!() && !ptr()->visited()) { - if (pr(operator*())) + if (pr(operator*())) c.insert(c.end(),operator*()); visit_one(); left().recursive_filter(c,pr); @@ -354,13 +354,13 @@ class Td_dag : public Td_dag_base return c; } #if 0 - template - Container& recursive_hash_filter(Container& c, const Predicate& ptr) const + template + Container& recursive_hash_filter(Container& c, const Predicate& ptr) const /* Generate a copy of the Dag filtered according to the predicate */ { if (!operator!() && !ptr()->visited()) { - if (pr(operator*())) + if (pr(operator*())) c.insert(pair<&operator*(), new X_trapezoid(operator*())); // The hash links between the old trapezoid to the new one. visit_one(); @@ -374,8 +374,8 @@ class Td_dag : public Td_dag_base node* ptr() const {return (node*)PTR;} }; -template -std::ostream& write(std::ostream& out, +template +std::ostream& write(std::ostream& out, const Td_dag& t, const Traits& traits) { @@ -406,7 +406,7 @@ std::ostream& write(std::ostream& out, return out ; } -template std::ostream& operator<<(std::ostream& out, +template std::ostream& operator<<(std::ostream& out, const Td_dag& t) { CGAL_STATIC_THREAD_LOCAL_VARIABLE(int, depth,0); @@ -437,10 +437,10 @@ template std::ostream& operator<<(std::ostream& out, #endif -/* +/* tech notes: The code is Handle designed. - left(),right() are designed to cope with Handle(Handle& x) + left(),right() are designed to cope with Handle(Handle& x) precondition x.PTR!=0 operator=() performs shallow copy operator*() returns data type diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h index 1193f9f1ac3a..bb57f7c6d1c7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Oren Nechushtan +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_INACTIVE_EDGE_H @@ -37,25 +37,25 @@ namespace CGAL { * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) * and two curve-ends(left,right). * Trapezoids are represented as two curve-ends called right and left and - * two halfedges called top and bottom. The curve-ends (points) lie on the - * right and left boundaries of the trapezoid respectively and the halfedges + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges * bound the trapezoid from above and below. - * There exist degenerate trapezoids called infinite trapezoid; this happens + * There exist degenerate trapezoids called infinite trapezoid; this happens * when one of the four sides is on the parameter space boundary. * Trapezoids are created as active and become inactive when Remove() member * function called. * Each trapezoid has at most four neighbouring trapezoids. - * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an * edge-end (end point). */ template class Td_inactive_edge : public Handle { public: - + //type of traits class typedef Td_traits_ Traits; - + //type of point (Point_2) typedef typename Traits::Point Point; @@ -67,18 +67,18 @@ class Td_inactive_edge : public Handle //type of Halfedge_const_handle (trapezoid edge) typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; - + //type of Vertex_const_handle (trapezoid vertex) typedef typename Traits::Vertex_const_handle Vertex_const_handle; //type of Td_inactive_edge (Self) typedef typename Traits::Td_inactive_edge Self; - + typedef typename Traits::Td_map_item Td_map_item; //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; @@ -89,7 +89,7 @@ class Td_inactive_edge : public Handle //friend class declarations: friend class Trapezoidal_decomposition_2; - + #ifdef CGAL_PM_FRIEND_CLASS #if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) friend class Trapezoidal_decomposition_2::In_face_iterator; @@ -100,12 +100,12 @@ class Td_inactive_edge : public Handle #else friend class Trapezoidal_decomposition_2::In_face_iterator; #endif - + #else friend class In_face_iterator; #endif #endif - + /*! \class * Inner class Data derived from Rep class */ @@ -118,19 +118,19 @@ class Td_inactive_edge : public Handle Data (boost::shared_ptr& _cv, Dag_node* _p_node) : cv(_cv), p_node(_p_node) //, lb(_lb),lt(_lt),rb(_rb),rt(_rt) { } - + ~Data() { } protected: - boost::shared_ptr cv; + boost::shared_ptr cv; Dag_node* p_node; - }; - + }; + private: - + Data* ptr() const { return (Data*)(PTR); } - - + + #ifndef CGAL_TD_DEBUG #ifdef CGAL_PM_FRIEND_CLASS protected: @@ -142,19 +142,19 @@ class Td_inactive_edge : public Handle #endif //CGAL_TD_DEBUG /*! Set the DAG node. */ - inline void set_dag_node(Dag_node* p) + inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; } - + /*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */ CGAL_TD_INLINE void set_curve(boost::shared_ptr& cv) { - ptr()->cv = cv; + ptr()->cv = cv; } - + public: - + /// \name Constructors. //@{ @@ -163,25 +163,25 @@ class Td_inactive_edge : public Handle { PTR = new Data(cv,node); } - + /*! Copy constructor. */ Td_inactive_edge (const Self& tr) : Handle(tr) { } - + //@} - + /// \name Operator overloading. //@{ - /*! Assignment operator. - * operator= should not copy m_dag_node (or otherwise update + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update * Dag_node::replace) */ inline Self& operator= (const Self& t2) { - Handle::operator=(t2); - return *this; + Handle::operator=(t2); + return *this; } /*! Operator==. */ @@ -202,12 +202,12 @@ class Td_inactive_edge : public Handle /// \name Access methods. //@{ - inline Self& self() + inline Self& self() { return *this; } - - inline const Self& self() const + + inline const Self& self() const { return *this; } @@ -218,7 +218,7 @@ class Td_inactive_edge : public Handle return (unsigned long) PTR; } - inline X_monotone_curve_2& curve() const + inline X_monotone_curve_2& curve() const { X_monotone_curve_2* cv_ptr = (ptr()->cv).get(); CGAL_assertion(cv_ptr != nullptr); @@ -227,12 +227,12 @@ class Td_inactive_edge : public Handle /*! Access DAG node. */ Dag_node* dag_node() const {return ptr()->p_node; } - - + + //@} - - - + + + }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h index f69a9e5684c3..03ca8d563c78 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Oren Nechushtan +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_INACTIVE_FICTITIOUS_VERTEX_H @@ -36,25 +36,25 @@ namespace CGAL { * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) * and two curve-ends(left,right). * Trapezoids are represented as two curve-ends called right and left and - * two halfedges called top and bottom. The curve-ends (points) lie on the - * right and left boundaries of the trapezoid respectively and the halfedges + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges * bound the trapezoid from above and below. - * There exist degenerate trapezoids called infinite trapezoid; this happens + * There exist degenerate trapezoids called infinite trapezoid; this happens * when one of the four sides is on the parameter space boundary. * Trapezoids are created as active and become inactive when Remove() member * function called. * Each trapezoid has at most four neighbouring trapezoids. - * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an * edge-end (end point). */ template class Td_inactive_fictitious_vertex : public Handle { public: - + //type of traits class typedef Td_traits_ Traits; - + //type of point (Point_2) typedef typename Traits::Point Point; @@ -66,12 +66,12 @@ class Td_inactive_fictitious_vertex : public Handle //type of Halfedge_const_handle (trapezoid edge) typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; - + //type of Vertex_const_handle (trapezoid vertex) typedef typename Traits::Vertex_const_handle Vertex_const_handle; //type of Halfedge_around_vertex_const_circulator - typedef typename Traits::Halfedge_around_vertex_const_circulator + typedef typename Traits::Halfedge_around_vertex_const_circulator Halfedge_around_vertex_const_circulator; //type of Td_inactive_fictitious_vertex (Self) @@ -81,7 +81,7 @@ class Td_inactive_fictitious_vertex : public Handle //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; @@ -92,7 +92,7 @@ class Td_inactive_fictitious_vertex : public Handle //friend class declarations: friend class Trapezoidal_decomposition_2; - + #ifdef CGAL_PM_FRIEND_CLASS #if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) friend class Trapezoidal_decomposition_2::In_face_iterator; @@ -103,12 +103,12 @@ class Td_inactive_fictitious_vertex : public Handle #else friend class Trapezoidal_decomposition_2::In_face_iterator; #endif - + #else friend class In_face_iterator; #endif #endif - + /*! \class * Inner class Data derived from Rep class */ @@ -118,27 +118,27 @@ class Td_inactive_fictitious_vertex : public Handle public: //c'tors - Data (const X_monotone_curve_2& _cv, - Arr_curve_end _ce, - Dag_node* _p_node): cv(_cv),ce(_ce),p_node(_p_node) + Data (const X_monotone_curve_2& _cv, + Arr_curve_end _ce, + Dag_node* _p_node): cv(_cv),ce(_ce),p_node(_p_node) { } - + ~Data() { } protected: - X_monotone_curve_2 cv; + X_monotone_curve_2 cv; Arr_curve_end ce; Dag_node* p_node; }; - + private: - + Data* ptr() const { return (Data*)(PTR); } - - Curve_end vtx_to_ce(Vertex_const_handle v) const + + Curve_end vtx_to_ce(Vertex_const_handle v) const { //the circulator is of incoming halfedges - Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); + Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); //if the vertex is associated with a point on the bounded coords, // we can take any incident halfedge. o/w if the vertex lies at infinity, // it has 2 fictitious incident halfedges @@ -146,7 +146,7 @@ class Td_inactive_fictitious_vertex : public Handle if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; return Curve_end(he->curve(), - (he->direction() == ARR_RIGHT_TO_LEFT)? + (he->direction() == ARR_RIGHT_TO_LEFT)? ARR_MIN_END : ARR_MAX_END); } @@ -159,24 +159,24 @@ class Td_inactive_fictitious_vertex : public Handle #else //CGAL_TD_DEBUG public: #endif //CGAL_TD_DEBUG - + /*! Set the DAG node. */ - inline void set_dag_node(Dag_node* p) + inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; } - + inline void set_curve_end(Vertex_const_handle v_before_rem) { Curve_end v_ce(vtx_to_ce(v_before_rem)); ptr()->cv(v_ce.cv()); ptr()->ce(v_ce.ce()); } - - + + public: - + /// \name Constructors. //@{ @@ -184,30 +184,30 @@ class Td_inactive_fictitious_vertex : public Handle Td_inactive_fictitious_vertex (Vertex_const_handle v_before_rem, Dag_node* node = nullptr) { Curve_end v_ce(vtx_to_ce(v_before_rem)); - + PTR = new Data( v_ce.cv(), v_ce.ce(), node); - + } - + /*! Copy constructor. */ Td_inactive_fictitious_vertex (const Self& tr) : Handle(tr) { - + } - + //@} - + /// \name Operator overloading. //@{ - /*! Assignment operator. - * operator= should not copy m_dag_node (or otherwise update + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update * Dag_node::replace) */ inline Self& operator= (const Self& t2) { - Handle::operator=(t2); - return *this; + Handle::operator=(t2); + return *this; } /*! Operator==. */ @@ -228,12 +228,12 @@ class Td_inactive_fictitious_vertex : public Handle /// \name Access methods. //@{ - inline Self& self() + inline Self& self() { return *this; } - - inline const Self& self() const + + inline const Self& self() const { return *this; } @@ -244,24 +244,24 @@ class Td_inactive_fictitious_vertex : public Handle return (unsigned long) PTR; } - - inline Curve_end curve_end() const + + inline Curve_end curve_end() const { return Curve_end(ptr()->cv, ptr()->ce); } - + /*! Access DAG node. */ - Dag_node* dag_node() const + Dag_node* dag_node() const { - return ptr()->p_node; - } - - + return ptr()->p_node; + } + + //@} - - - + + + }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h index 11a3b64bc57a..1c498b5608a1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Oren Nechushtan +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_INACTIVE_TRAPEZOID_H @@ -34,7 +34,7 @@ namespace CGAL { /*! \class */ -class Td_inactive_trapezoid +class Td_inactive_trapezoid { public: /*! Operator==. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h index a76d926594fc..409a6f576ee8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h @@ -7,7 +7,7 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Oren Nechushtan +// Author(s) : Oren Nechushtan // updated by: Michal Balas #ifndef CGAL_TD_INACTIVE_VERTEX_H @@ -36,25 +36,25 @@ namespace CGAL { * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) * and two curve-ends(left,right). * Trapezoids are represented as two curve-ends called right and left and - * two halfedges called top and bottom. The curve-ends (points) lie on the - * right and left boundaries of the trapezoid respectively and the halfedges + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges * bound the trapezoid from above and below. - * There exist degenerate trapezoids called infinite trapezoid; this happens + * There exist degenerate trapezoids called infinite trapezoid; this happens * when one of the four sides is on the parameter space boundary. * Trapezoids are created as active and become inactive when Remove() member * function called. * Each trapezoid has at most four neighbouring trapezoids. - * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an * edge-end (end point). */ template class Td_inactive_vertex : public Handle { public: - + //type of traits class typedef Td_traits_ Traits; - + //type of point (Point_2) typedef typename Traits::Point Point; @@ -66,18 +66,18 @@ class Td_inactive_vertex : public Handle //type of Halfedge_const_handle (trapezoid edge) typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; - + //type of Vertex_const_handle (trapezoid vertex) typedef typename Traits::Vertex_const_handle Vertex_const_handle; //type of Td_inactive_vertex (Self) typedef typename Traits::Td_inactive_vertex Self; - + typedef typename Traits::Td_map_item Td_map_item; //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; @@ -88,7 +88,7 @@ class Td_inactive_vertex : public Handle //friend class declarations: friend class Trapezoidal_decomposition_2; - + #ifdef CGAL_PM_FRIEND_CLASS #if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) friend class Trapezoidal_decomposition_2::In_face_iterator; @@ -99,12 +99,12 @@ class Td_inactive_vertex : public Handle #else friend class Trapezoidal_decomposition_2::In_face_iterator; #endif - + #else friend class In_face_iterator; #endif #endif - + /*! \class * Inner class Data derived from Rep class */ @@ -116,20 +116,20 @@ class Td_inactive_vertex : public Handle //c'tors Data (Point _p, Dag_node* _p_node): p(_p),p_node(_p_node) { } - + ~Data() { } protected: - Point p; + Point p; Dag_node* p_node; }; - - + + private: - + Data* ptr() const { return (Data*)(PTR); } - - + + #ifndef CGAL_TD_DEBUG #ifdef CGAL_PM_FRIEND_CLASS protected: @@ -139,15 +139,15 @@ class Td_inactive_vertex : public Handle #else //CGAL_TD_DEBUG public: #endif //CGAL_TD_DEBUG - + /*! Set the DAG node. */ - inline void set_dag_node(Dag_node* p) + inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; } - - + + inline void set_point(Vertex_const_handle v_before_rem) { ptr()->p = v_before_rem->point(); @@ -155,7 +155,7 @@ class Td_inactive_vertex : public Handle public: - + /// \name Constructors. //@{ @@ -164,26 +164,26 @@ class Td_inactive_vertex : public Handle { PTR = new Data(v_before_rem->point(), node); } - - + + /*! Copy constructor. */ Td_inactive_vertex (const Self& tr) : Handle(tr) { } - + //@} - + /// \name Operator overloading. //@{ - /*! Assignment operator. - * operator= should not copy m_dag_node (or otherwise update + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update * Dag_node::replace) */ inline Self& operator= (const Self& t2) { - Handle::operator=(t2); - return *this; + Handle::operator=(t2); + return *this; } /*! Operator==. */ @@ -204,12 +204,12 @@ class Td_inactive_vertex : public Handle /// \name Access methods. //@{ - inline Self& self() + inline Self& self() { return *this; } - - inline const Self& self() const + + inline const Self& self() const { return *this; } @@ -220,21 +220,21 @@ class Td_inactive_vertex : public Handle return (unsigned long) PTR; } - inline Point& point() const + inline Point& point() const { return ptr()->p; } - + /*! Access DAG node. */ - Dag_node* dag_node() const + Dag_node* dag_node() const { - return ptr()->p_node; + return ptr()->p_node; } - - + + //@} - - + + }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_ninetuple.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_ninetuple.h index 9caf1d158ef9..13587e7d8a78 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_ninetuple.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_ninetuple.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Oren Nechushtan // Iddo Hanniel @@ -32,11 +32,11 @@ class Td_ninetuple : public Rep F6 e6; F7 e7; F8 e8; - + Td_ninetuple() {} Td_ninetuple(const F0 & a0, const F1 & a1, const F2 & a2, const F3 & a3, - const F4 & a4, const F5 & a5, const F6 & a6, const F7 & a7, + const F4 & a4, const F5 & a5, const F6 & a6, const F7 & a7, const F8 & a8) : e0(a0),e1(a1),e2(a2),e3(a3),e4(a4),e5(a5),e6(a6),e7(a7),e8(a8) {} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h index 084a260d7ba1..fed4ec6d7291 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h @@ -6,10 +6,10 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Oren Nechushtan -// Iddo Hanniel +// +// Author(s) : Oren Nechushtan +// Iddo Hanniel #ifndef CGAL_TD_PREDICATES_H #define CGAL_TD_PREDICATES_H @@ -36,7 +36,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2; ////MICHAL: not in use //template -//struct Td_active_non_degenerate_trapezoid : +//struct Td_active_non_degenerate_trapezoid : //public CGAL::cpp98::unary_function //{ // Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {} @@ -64,7 +64,7 @@ struct Td_active_edge_item: template struct Td_map_item_handle_less : public CGAL::cpp98::binary_function<_Tp, _Tp, bool> { - bool operator()(const _Tp& __x, const _Tp& __y) const { + bool operator()(const _Tp& __x, const _Tp& __y) const { return __x->id() < __y->id(); } }; /* Return if two trapezoids are the same */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h index bdd8d802ae3e..71a47adb3299 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h @@ -6,9 +6,9 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Oren Nechushtan +// +// Author(s) : Oren Nechushtan #ifndef CGAL_TD_TRAITS_H #define CGAL_TD_TRAITS_H @@ -26,13 +26,13 @@ namespace CGAL { -template +template class Td_traits : public Pm_traits_ { public: //type of td map items type - enum Type + enum Type { NIL = 0, TD_ACTIVE_TRAPEZOID, @@ -46,15 +46,15 @@ class Td_traits : public Pm_traits_ }; //! type of base class - typedef Pm_traits_ Traits_base; - - //! type of X_monotone_curve_2 - typedef typename Traits_base::X_monotone_curve_2 - X_monotone_curve_2; - + typedef Pm_traits_ Traits_base; + + //! type of X_monotone_curve_2 + typedef typename Traits_base::X_monotone_curve_2 + X_monotone_curve_2; + //! type of Arrangement_on_surface_2 typedef Arrangement_ Arrangement_on_surface_2; - + //!type of Halfedge_handle typedef typename Arrangement_on_surface_2::Halfedge_handle Halfedge_handle; @@ -65,21 +65,21 @@ class Td_traits : public Pm_traits_ typedef typename Arrangement_on_surface_2::Vertex_const_handle Vertex_const_handle; //!type of Halfedge_around_vertex_const_circulator - typedef typename + typedef typename Arrangement_on_surface_2::Halfedge_around_vertex_const_circulator Halfedge_around_vertex_const_circulator; //!type of side tags - typedef typename Arrangement_on_surface_2::Left_side_category + typedef typename Arrangement_on_surface_2::Left_side_category Left_side_category; - typedef typename Arrangement_on_surface_2::Bottom_side_category + typedef typename Arrangement_on_surface_2::Bottom_side_category Bottom_side_category; - typedef typename Arrangement_on_surface_2::Top_side_category + typedef typename Arrangement_on_surface_2::Top_side_category Top_side_category; - typedef typename Arrangement_on_surface_2::Right_side_category + typedef typename Arrangement_on_surface_2::Right_side_category Right_side_category; //! myself - typedef Td_traits + typedef Td_traits Self; //! type of point typedef typename Traits_base::Point_2 Point; @@ -89,7 +89,7 @@ class Td_traits : public Pm_traits_ //! type of Td_inactive_trapezoid typedef CGAL::Td_inactive_trapezoid Td_inactive_trapezoid; - + typedef int Td_nothing; //! type of Td_active_edge @@ -102,14 +102,14 @@ class Td_traits : public Pm_traits_ typedef CGAL::Td_active_vertex Td_active_vertex; //! type of Td_active_fictitious_vertex - typedef CGAL::Td_active_fictitious_vertex + typedef CGAL::Td_active_fictitious_vertex Td_active_fictitious_vertex; //! type of Td_inactive_vertex typedef CGAL::Td_inactive_vertex Td_inactive_vertex; //! type of Td_inactive_fictitious_vertex - typedef CGAL::Td_inactive_fictitious_vertex + typedef CGAL::Td_inactive_fictitious_vertex Td_inactive_fictitious_vertex; //! type of td map item (Td_halfedge, Td_vertex or Td_trapezoid) @@ -122,37 +122,37 @@ class Td_traits : public Pm_traits_ //! type of Curve end pair typedef std::pair Curve_end_pair; - - //!Curve_end class represents an X_monotone_curve_2 end + + //!Curve_end class represents an X_monotone_curve_2 end // (could be a point or an unbounded curve end) // holds a pointer to the X_monotone_curve_2 and an indicator for the end (min/max) class Curve_end { protected: - + //! pair of pointer to the X_monotone_curve_2 and an indicator - // for ARR_MIN_END or ARR_MAX_END + // for ARR_MIN_END or ARR_MAX_END Curve_end_pair m_pair; - + public: - //Constructor based on a Curve_end_pair - Curve_end(Curve_end_pair pr) : m_pair(pr) + //Constructor based on a Curve_end_pair + Curve_end(Curve_end_pair pr) : m_pair(pr) { } //Constructor based on a Curve & a Curve-end - //Curve_end(const X_monotone_curve_2& cv, Arr_curve_end ce) : m_cv(cv), m_ce(ce) - Curve_end(const X_monotone_curve_2& cv, Arr_curve_end ce) - : m_pair(std::make_pair(&cv,ce)) + //Curve_end(const X_monotone_curve_2& cv, Arr_curve_end ce) : m_cv(cv), m_ce(ce) + Curve_end(const X_monotone_curve_2& cv, Arr_curve_end ce) + : m_pair(std::make_pair(&cv,ce)) { } //Constructor based on a Halfedge & a Curve-end - //Curve_end(Halfedge_const_handle he, Arr_curve_end ce) : m_cv(he->curve()), m_ce(ce) - Curve_end(Halfedge_const_handle he, Arr_curve_end ce) - : m_pair(std::make_pair(&(he->curve()),ce)) + //Curve_end(Halfedge_const_handle he, Arr_curve_end ce) : m_cv(he->curve()), m_ce(ce) + Curve_end(Halfedge_const_handle he, Arr_curve_end ce) + : m_pair(std::make_pair(&(he->curve()),ce)) { } - + //access the X-monotone curve const X_monotone_curve_2& cv() const { return *(m_pair.first); } @@ -181,13 +181,13 @@ class Td_traits : public Pm_traits_ //! Allow its functor obtaining function calling the private constructor. friend class Td_traits; - + public: - + /*! * Compare the x-coordinates of two edge ends. - * \param ee1 The first edge end - * \param ee2 The second edge end + * \param ee1 The first edge end + * \param ee2 The second edge end * \return LARGER if x(ee1) > x(ee2); * SMALLER if x(ee1) < x(ee2); * EQUAL if x(ee1) = x(ee2). @@ -195,13 +195,13 @@ class Td_traits : public Pm_traits_ Comparison_result operator() (const Curve_end& ce1, const Curve_end& ce2) const { - Arr_parameter_space ce1_x_prm_spc = + Arr_parameter_space ce1_x_prm_spc = m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()); - Arr_parameter_space ce1_y_prm_spc = + Arr_parameter_space ce1_y_prm_spc = m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()); - Arr_parameter_space ce2_x_prm_spc = + Arr_parameter_space ce2_x_prm_spc = m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()); - Arr_parameter_space ce2_y_prm_spc = + Arr_parameter_space ce2_y_prm_spc = m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()); bool is_ce1_interior = (( ce1_x_prm_spc == ARR_INTERIOR) && @@ -228,7 +228,7 @@ class Td_traits : public Pm_traits_ m_traits->construct_min_vertex_2_object()(ce1.cv()) : m_traits->construct_max_vertex_2_object()(ce1.cv()) ), ce2); - + //if only ce2 is interior if (is_ce2_interior) return operator() @@ -236,17 +236,17 @@ class Td_traits : public Pm_traits_ ((ce2.ce() == ARR_MIN_END) ? m_traits->construct_min_vertex_2_object()(ce2.cv()) : m_traits->construct_max_vertex_2_object()(ce2.cv()) )); - + //both are not interior: - //if both are x-interior + //if both are x-interior // (then both are NOT y-interior, since both are not interior) if ( (ce1_x_prm_spc == ARR_INTERIOR) && (ce2_x_prm_spc == ARR_INTERIOR) ) { //both ce1 and ce2 are not y prm spc interior Comparison_result res = m_traits->compare_x_at_limit_2_object() - (ce1.cv(),ce1.ce(), + (ce1.cv(),ce1.ce(), ce2.cv(),ce2.ce()); if (res != EQUAL) return res; @@ -258,8 +258,8 @@ class Td_traits : public Pm_traits_ return (ce1_y_prm_spc == ARR_BOTTOM_BOUNDARY) ? SMALLER : LARGER; //if the Curve end is not the same the one with the MAX is smaller - if (ce1.ce() != ce2.ce()) - return (ce1.ce() == ARR_MIN_END) ? LARGER : SMALLER; + if (ce1.ce() != ce2.ce()) + return (ce1.ce() == ARR_MIN_END) ? LARGER : SMALLER; //both have the same Curve end return (m_traits->compare_x_near_limit_2_object() @@ -268,7 +268,7 @@ class Td_traits : public Pm_traits_ //not both are x-interior - //set ind value according to the location : + //set ind value according to the location : // left-bndry = -1 // interior = 0 // right-bndry = 1 @@ -281,7 +281,7 @@ class Td_traits : public Pm_traits_ int ind2 = (ce2_x_prm_spc == ARR_INTERIOR)? 0 : ((ce2_x_prm_spc == ARR_LEFT_BOUNDARY) ? -1 : 1 ); - + int res = ind1 - ind2; if (res == 0) return EQUAL; @@ -299,8 +299,8 @@ class Td_traits : public Pm_traits_ Comparison_result operator() (const Point& p, const Curve_end& ce) const { - bool is_ce_interior = - ((m_traits->parameter_space_in_x_2_object() + bool is_ce_interior = + ((m_traits->parameter_space_in_x_2_object() (ce.cv(),ce.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object() (ce.cv(),ce.ce()) == ARR_INTERIOR)); @@ -315,15 +315,15 @@ class Td_traits : public Pm_traits_ m_traits->construct_max_vertex_2_object()(ce.cv()) )); } - //if curve end is x-interior but not y-interior + //if curve end is x-interior but not y-interior if (m_traits->parameter_space_in_x_2_object() - (ce.cv(),ce.ce()) == ARR_INTERIOR) + (ce.cv(),ce.ce()) == ARR_INTERIOR) { //if curve end y prm space is not interior return (m_traits->compare_x_at_limit_2_object() (p,ce.cv(),ce.ce())); } - + //if curve end is on the left or right boundaries if (m_traits->parameter_space_in_x_2_object() (ce.cv(),ce.ce()) == ARR_LEFT_BOUNDARY) @@ -349,7 +349,7 @@ class Td_traits : public Pm_traits_ return res; return (res == LARGER) ? SMALLER : LARGER; } - + }; /*! Obtain a Compare_y_at_x_2 functor object. */ @@ -368,7 +368,7 @@ class Td_traits : public Pm_traits_ { protected: - + typedef Td_traits Traits; /*! The traits (in case it has state) */ @@ -384,11 +384,11 @@ class Td_traits : public Pm_traits_ //! Allow its functor obtaining function calling the private constructor. friend class Td_traits; - + public: - + /*! - * Return the location of the given curve end with respect to the input + * Return the location of the given curve end with respect to the input * Halfedge_const_handle. * \param ce1 The curve end. * \param he The Halfedge_const_handle. @@ -424,25 +424,25 @@ class Td_traits : public Pm_traits_ && (m_traits->compare_curve_end_x_2_object() (ce1, Curve_end(cv2, ARR_MAX_END)) != LARGER)); - + //get the curve end parameter space in x & y - Arr_parameter_space ce1_x_prm_spc = + Arr_parameter_space ce1_x_prm_spc = m_traits->parameter_space_in_x_2_object()(ce1.cv(), ce1.ce()); - Arr_parameter_space ce1_y_prm_spc = + Arr_parameter_space ce1_y_prm_spc = m_traits->parameter_space_in_y_2_object()(ce1.cv(), ce1.ce()); if (ce1_x_prm_spc != ARR_INTERIOR) { - //assuming that the edge end is on the same boundary according to + //assuming that the edge end is on the same boundary according to // the precondition. - //comparing the curve that contains the given + //comparing the curve that contains the given // edge end and the curve cv2 return m_traits->compare_y_near_boundary_2_object() (ce1.cv(), cv2, ce1.ce()); } - + //if ce1_x_prm_spc == ARR_INTERIOR if (ce1_y_prm_spc == ARR_INTERIOR) { @@ -453,9 +453,9 @@ class Td_traits : public Pm_traits_ m_traits->construct_max_vertex_2_object()(ce1.cv()) ), cv2); } - + //ce1 is an end point of a curve with a vertical asymptote. - + //if the other curve is also vertical or has a vertical asymptote // at the x value of ep @@ -471,17 +471,17 @@ class Td_traits : public Pm_traits_ (cv2, ARR_MAX_END) == ce1_y_prm_spc) && (m_traits->compare_curve_end_x_2_object() (ce1, Curve_end(cv2, ARR_MAX_END)) == EQUAL)) ) - { + { return EQUAL; } if (ce1_y_prm_spc == ARR_TOP_BOUNDARY) return LARGER; else //if ce1_y_prm_spc == ARR_BOTTOM_BOUNDARY return SMALLER; - - + + } - + }; /*! Obtain a Compare_y_at_x_2 functor object. */ @@ -492,11 +492,11 @@ class Td_traits : public Pm_traits_ - class Equal_curve_end_2 + class Equal_curve_end_2 { protected: typedef Td_traits Traits; - + /*! The traits (in case it has state) */ const Traits* m_traits; const Traits_base* m_traits_base; //MICHAL: rational-upd @@ -514,19 +514,19 @@ class Td_traits : public Pm_traits_ friend class Td_traits; public: - + bool operator() (const Curve_end& ce1, const Curve_end& ce2) const { //Kernel kernel; //MICHAL: rational-upd - bool is_ce1_interior = - ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) + bool is_ce1_interior = + ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) == ARR_INTERIOR)); - bool is_ce2_interior = - ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) + bool is_ce2_interior = + ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) == ARR_INTERIOR)); @@ -541,10 +541,10 @@ class Td_traits : public Pm_traits_ m_traits->construct_min_vertex_2_object()(ce2.cv()) : m_traits->construct_max_vertex_2_object()(ce2.cv()) )); } - - + + //at least one of the edge ends is on the parameter space boundaries - + //if not both are on the boundaries return false if (is_ce1_interior || is_ce2_interior) return false; @@ -552,7 +552,7 @@ class Td_traits : public Pm_traits_ //both are on the boundaries - so compare the edge ends return ( m_traits->compare_curve_end_xy_2_object()(ce1,ce2) == EQUAL); } - + bool operator() (const Point& p1, const Point& p2) const { @@ -564,21 +564,21 @@ class Td_traits : public Pm_traits_ { return operator()(p, ce); } - + bool operator() (const Point& p, const Curve_end& ce) const { - bool is_ce_interior = - ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) + bool is_ce_interior = + ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce.cv(),ce.ce()) == ARR_INTERIOR)); //if ce is on the parameter space boundaries - return false // since p is interior - if (!is_ce_interior) + if (!is_ce_interior) return false; - + //else - if ce is interior return m_traits_base->equal_2_object() ( p, @@ -586,7 +586,7 @@ class Td_traits : public Pm_traits_ m_traits->construct_min_vertex_2_object()(ce.cv()) : m_traits->construct_max_vertex_2_object()(ce.cv()) )); } - + }; /*! Obtain an Equal_curve_end_2 functor object. */ @@ -596,7 +596,7 @@ class Td_traits : public Pm_traits_ } /*! A functor that compares the coordinates of two edge ends */ - class Compare_curve_end_xy_2 + class Compare_curve_end_xy_2 { protected: typedef Td_traits Traits; @@ -620,40 +620,40 @@ class Td_traits : public Pm_traits_ * Compare two edge ends lexigoraphically: by x, then by y. * \param cv1, cv1_end The first cv end. * \param cv2, cv2_end The second cv end. - * \return LARGER if x(cv1-end) > x(cv2-end), + * \return LARGER if x(cv1-end) > x(cv2-end), * or if x(cv1-end) = x(cv2-end) and y(cv1-end) > y(cv2-end); - * SMALLER if x(cv1-end) < x(cv2-end), + * SMALLER if x(cv1-end) < x(cv2-end), * or if x(cv1-end) = x(cv2-end) and y(cv1-end) < y(cv2-end); * EQUAL if the two cv ends are equal. */ Comparison_result operator() (const Curve_end& ce1, const Curve_end& ce2) const { - Comparison_result res; - - bool is_ce1_interior = - ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) + Comparison_result res; + + bool is_ce1_interior = + ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) == ARR_INTERIOR)); - bool is_ce2_interior = - ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) + bool is_ce2_interior = + ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) == ARR_INTERIOR)); - - bool is_ce1_vertical = - ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) + + bool is_ce1_vertical = + ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) != ARR_INTERIOR)); - bool is_ce2_vertical = - ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) + bool is_ce2_vertical = + ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) != ARR_INTERIOR)); - //if the edge ends are parameter space interior on both x & y + //if the edge ends are parameter space interior on both x & y if ( is_ce1_interior && is_ce2_interior ) { return m_traits->compare_xy_2_object() @@ -664,13 +664,13 @@ class Td_traits : public Pm_traits_ m_traits->construct_min_vertex_2_object()(ce2.cv()) : m_traits->construct_max_vertex_2_object()(ce2.cv()) )); } - + //at least one curve end is on the parameter space boundaries: - + //if the first curve end is interior if ( is_ce1_interior ) { - + //if the second curve end is of a curve with a vertical asymptote: // x prm spc is interior, y prm spc is not interior if ( is_ce2_vertical) @@ -684,7 +684,7 @@ class Td_traits : public Pm_traits_ if (res != EQUAL) return res; - else + else return (m_traits->parameter_space_in_y_2_object() (ce2.cv(),ce2.ce()) == ARR_TOP_BOUNDARY) ? SMALLER : LARGER; } @@ -710,11 +710,11 @@ class Td_traits : public Pm_traits_ m_traits->construct_min_vertex_2_object()( ce2.cv()) : m_traits->construct_max_vertex_2_object()( ce2.cv()) ), ce1.cv(), ce1.ce()); - //need to return the opposite because the function received - // the curve ends in a reverse order + //need to return the opposite because the function received + // the curve ends in a reverse order if (res != EQUAL) return (res == SMALLER) ? LARGER : SMALLER; - else + else return (m_traits->parameter_space_in_y_2_object() (ce1.cv(),ce1.ce()) == ARR_TOP_BOUNDARY) ? LARGER : SMALLER; } @@ -724,7 +724,7 @@ class Td_traits : public Pm_traits_ // boundaries. the comparison is simply by the x-coord return (ce1.ce() == ARR_MIN_END) ? SMALLER : LARGER; } - + } //both curve ends are not interior @@ -733,7 +733,7 @@ class Td_traits : public Pm_traits_ if ( is_ce1_vertical && is_ce2_vertical ) { Comparison_result res = m_traits->compare_x_at_limit_2_object() - (ce1.cv(),ce1.ce(), + (ce1.cv(),ce1.ce(), ce2.cv(),ce2.ce()); if (res != EQUAL) @@ -742,9 +742,9 @@ class Td_traits : public Pm_traits_ //res == EQUAL //if equal - need to compare near limit - Arr_parameter_space ce1_y_prm_spc = + Arr_parameter_space ce1_y_prm_spc = m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) ; - Arr_parameter_space ce2_y_prm_spc = + Arr_parameter_space ce2_y_prm_spc = m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) ; //if param space in y is not the same (one is top and one is bottom) @@ -753,7 +753,7 @@ class Td_traits : public Pm_traits_ return (ce1_y_prm_spc == ARR_BOTTOM_BOUNDARY) ? SMALLER : LARGER; //if the Curve end is not the same, the one with the MAX is smaller - if (ce1.ce() != ce2.ce()) + if (ce1.ce() != ce2.ce()) return (ce1.ce() == ARR_MIN_END) ? LARGER : SMALLER; //both have the same Curve end @@ -762,12 +762,12 @@ class Td_traits : public Pm_traits_ } //if only the first curve end is of a curve with a vertical asymptote - if ( is_ce1_vertical ) + if ( is_ce1_vertical ) { return (ce2.ce() == ARR_MIN_END) ? LARGER : SMALLER; } //if only the second curve end is of a curve with a vertical asymptote - if ( is_ce2_vertical ) + if ( is_ce2_vertical ) { return (ce1.ce() == ARR_MIN_END) ? SMALLER : LARGER; } @@ -775,45 +775,45 @@ class Td_traits : public Pm_traits_ //both curve ends are not of curves with a vertical asymptote: //if not both on left or both on right boundaries - if (ce1.ce() != ce2.ce()) + if (ce1.ce() != ce2.ce()) { return (ce1.ce() == ARR_MIN_END) ? SMALLER : LARGER; } - + //both on the same boundary, need to compare the y near the boundary // (ce1.ce() == ce2.ce()) return m_traits->compare_y_near_boundary_2_object() - (ce1.cv(), ce2.cv(), ce1.ce()); + (ce1.cv(), ce2.cv(), ce1.ce()); } /*! * Compare a point and a curve end lexigoraphically: by x, then by y. * \param cv1, cv1_end The first cv end. * \param cv2, cv2_end The second cv end. - * \return LARGER if x(p) > x(cv2-end), + * \return LARGER if x(p) > x(cv2-end), * or if x(p) = x(cv2-end) and y(p) > y(cv2-end); - * SMALLER if x(p) < x(cv2-end), + * SMALLER if x(p) < x(cv2-end), * or if x(p) = x(cv2-end) and y(p) < y(cv2-end); * EQUAL if the point and the cv end are equal. */ Comparison_result operator() (const Point& p, const Curve_end& ce) const { - Comparison_result res; - - bool is_ce_interior = - ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) + Comparison_result res; + + bool is_ce_interior = + ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce.cv(),ce.ce()) == ARR_INTERIOR)); - - bool is_ce_vertical = - ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) + + bool is_ce_vertical = + ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) == ARR_INTERIOR) && (m_traits->parameter_space_in_y_2_object()(ce.cv(),ce.ce()) != ARR_INTERIOR)); - //if the edge end is parameter space interior on both x & y + //if the edge end is parameter space interior on both x & y if ( is_ce_interior) { return m_traits->compare_xy_2_object() @@ -822,9 +822,9 @@ class Td_traits : public Pm_traits_ m_traits->construct_min_vertex_2_object()(ce.cv()) : m_traits->construct_max_vertex_2_object()(ce.cv()) )); } - + // edge end is on the parameter space boundaries: - + //if edge end is of a vertical line: // x prm spc is interior, y prm spc is not interior if ( is_ce_vertical) @@ -834,7 +834,7 @@ class Td_traits : public Pm_traits_ if (res != EQUAL) return res; - else + else return (m_traits->parameter_space_in_y_2_object() (ce.cv(), ce.ce()) == ARR_TOP_BOUNDARY) ? SMALLER : LARGER; } @@ -845,7 +845,7 @@ class Td_traits : public Pm_traits_ return (ce.ce() == ARR_MIN_END) ? LARGER : SMALLER; } } - + Comparison_result operator() (const Curve_end& ce, const Point& p) const { @@ -855,7 +855,7 @@ class Td_traits : public Pm_traits_ return (res == SMALLER) ? LARGER : SMALLER; } - + Comparison_result operator() (const Point& p1, const Point& p2) const { @@ -873,17 +873,17 @@ class Td_traits : public Pm_traits_ // Td_traits class ctors and dtor - + Td_traits(const Traits_base& t) : Traits_base(t) { } - Td_traits() + Td_traits() { } ~Td_traits(void) { } - + public: /* note: @@ -893,71 +893,71 @@ class Td_traits : public Pm_traits_ /* returns true if bottom halfedges of input are the same */ inline bool is_trpz_bottom_equal(Td_map_item& left_item, - Td_map_item& right_item) const + Td_map_item& right_item) const { CGAL_precondition(is_active(left_item) && is_active(right_item)); CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item)); - + Td_active_trapezoid left (boost::get(left_item)); Td_active_trapezoid right(boost::get(right_item)); if (left.is_on_bottom_boundary()) return (right.is_on_bottom_boundary()); - - if (right.is_on_bottom_boundary()) + + if (right.is_on_bottom_boundary()) return (false); - - return (left.bottom() == right.bottom() || - left.bottom()->twin() == right.bottom()); + + return (left.bottom() == right.bottom() || + left.bottom()->twin() == right.bottom()); } /* returns true if top halfedges of input are the same */ inline bool is_trpz_top_equal(Td_map_item& left_item, - Td_map_item& right_item) const + Td_map_item& right_item) const { CGAL_precondition(is_active(left_item) && is_active(right_item)); CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item)); - + Td_active_trapezoid left (boost::get(left_item)); Td_active_trapezoid right(boost::get(right_item)); - if (left.is_on_top_boundary()) + if (left.is_on_top_boundary()) return (right.is_on_top_boundary()); - - if (right.is_on_top_boundary()) + + if (right.is_on_top_boundary()) return (false); - - return (left.top() == right.top() || left.top()->twin() == right.top()); + + return (left.top() == right.top() || left.top()->twin() == right.top()); } /* returns true if bottom halfedges of input are the same */ inline bool is_trapezoids_bottom_equal(const Td_active_trapezoid& left, - const Td_active_trapezoid& right) const + const Td_active_trapezoid& right) const { if (left.is_on_bottom_boundary()) return (right.is_on_bottom_boundary()); - - if (right.is_on_bottom_boundary()) + + if (right.is_on_bottom_boundary()) return (false); - - return (left.bottom() == right.bottom() || - left.bottom()->twin() == right.bottom()); + + return (left.bottom() == right.bottom() || + left.bottom()->twin() == right.bottom()); } /* returns true if top halfedges of input are the same */ inline bool is_trapezoids_top_equal(const Td_active_trapezoid& left, - const Td_active_trapezoid& right) const + const Td_active_trapezoid& right) const { - if (left.is_on_top_boundary()) + if (left.is_on_top_boundary()) return (right.is_on_top_boundary()); - - if (right.is_on_top_boundary()) + + if (right.is_on_top_boundary()) return (false); - - return (left.top() == right.top() || left.top()->twin() == right.top()); + + return (left.top() == right.top() || left.top()->twin() == right.top()); } - //returns true if the trapezoid is a curve + //returns true if the trapezoid is a curve bool is_empty_item(const Td_map_item& tr) const { return (tr.which() == 0); @@ -974,7 +974,7 @@ class Td_traits : public Pm_traits_ default: return false; } - } + } //returns true if the map item is a vertex bool is_td_vertex(const Td_map_item& tr) const @@ -991,7 +991,7 @@ class Td_traits : public Pm_traits_ } } - //returns true if the map item is an edge + //returns true if the map item is an edge bool is_td_edge(const Td_map_item& tr) const { switch (tr.which()) @@ -1004,7 +1004,7 @@ class Td_traits : public Pm_traits_ } } - //returns true if the map item is an edge + //returns true if the map item is an edge bool is_td_trapezoid(const Td_map_item& tr) const { switch (tr.which()) @@ -1017,7 +1017,7 @@ class Td_traits : public Pm_traits_ } } - //returns true if the trapezoid is a curve + //returns true if the trapezoid is a curve bool is_fictitious_vertex(const Td_map_item& tr) const { switch (tr.which()) @@ -1030,7 +1030,7 @@ class Td_traits : public Pm_traits_ } } - //returns true if the trapezoid is a curve + //returns true if the trapezoid is a curve bool is_active(const Td_map_item& tr) const { switch (tr.which()) @@ -1045,7 +1045,7 @@ class Td_traits : public Pm_traits_ } } - //returns true if the trapezoid is vertical + //returns true if the trapezoid is vertical bool is_vertical(Td_map_item& item) const { CGAL_precondition(is_td_edge(item)); @@ -1057,16 +1057,16 @@ class Td_traits : public Pm_traits_ return (this->compare_curve_end_x_2_object() (Curve_end(he,ARR_MIN_END), Curve_end(he,ARR_MAX_END))== EQUAL); } - - /* returns whether given edge end is inside the given trapezoid using + + /* returns whether given edge end is inside the given trapezoid using lexicographic order */ bool is_inside (Td_map_item& item, const Curve_end& ce) const { CGAL_precondition( is_active(item) ); CGAL_precondition( is_td_trapezoid(item) ); Td_active_trapezoid tr (boost::get(item)); - - return + + return ( tr.is_on_left_boundary() || (compare_curve_end_xy_2_object() (vtx_to_ce(tr.left()),ce) == SMALLER) ) && @@ -1079,7 +1079,7 @@ class Td_traits : public Pm_traits_ (compare_curve_end_y_at_x_2_object()(ce, tr.top()) == SMALLER) ); } - /*! returns true if the end point is inside the closure of the trapezoid + /*! returns true if the end point is inside the closure of the trapezoid (inlcude all boundaries) */ bool is_in_closure (const Td_active_trapezoid& tr, const Curve_end& ce ) const { @@ -1092,24 +1092,24 @@ class Td_traits : public Pm_traits_ (ce,vtx_to_ce(tr.right())) != LARGER)) ) { // test bottom side - if (!tr.is_on_bottom_boundary() && - compare_curve_end_y_at_x_2_object()(ce,tr.bottom()) == SMALLER ) + if (!tr.is_on_bottom_boundary() && + compare_curve_end_y_at_x_2_object()(ce,tr.bottom()) == SMALLER ) { return false; } - + // test top side - if (!tr.is_on_top_boundary() && - compare_curve_end_y_at_x_2_object()(ce,tr.top()) == LARGER) + if (!tr.is_on_top_boundary() && + compare_curve_end_y_at_x_2_object()(ce,tr.top()) == LARGER) { return false; } - + return true; } return false; - } - /*! returns true if the end point is inside the closure of the trapezoid + } + /*! returns true if the end point is inside the closure of the trapezoid (inlcude all boundaries) */ bool is_in_closure (const Td_active_edge& e, const Curve_end& ce ) const { @@ -1125,7 +1125,7 @@ class Td_traits : public Pm_traits_ Curve_end vtx_to_ce(Vertex_const_handle v) const { //the circulator is of incoming halfedges - Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); + Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); //if the vertex is associated with a point on the bounded coords, // we can take any incident halfedge. o/w if the vertex lies at infinity, // it has 2 fictitious incident halfedges @@ -1133,10 +1133,10 @@ class Td_traits : public Pm_traits_ if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; return Curve_end(he->curve(), - (he->direction() == ARR_RIGHT_TO_LEFT)? + (he->direction() == ARR_RIGHT_TO_LEFT)? ARR_MIN_END : ARR_MAX_END); } - + public: static Vertex_const_handle empty_vtx_handle() { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h index 2aaa714dfde7..3e7115a08ff8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h @@ -6,9 +6,9 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// // -// Author(s) : Oren Nechushtan +// +// Author(s) : Oren Nechushtan #ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_IOSTREAM_H #define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_IOSTREAM_H @@ -23,8 +23,8 @@ namespace CGAL { template < class Traits> std::ostream& operator<<( - std::ostream &out, - const typename Trapezoidal_decomposition_2::In_face_iterator& it) + std::ostream &out, + const typename Trapezoidal_decomposition_2::In_face_iterator& it) { out << "In_face_iterator("; if (it.operator->()) out << *it; else out <<"end"; @@ -33,21 +33,21 @@ std::ostream& operator<<( template < class Traits> std::ostream& write( - std::ostream &out,const Trapezoidal_decomposition_2& td) + std::ostream &out,const Trapezoidal_decomposition_2& td) { return out << td; } template < class Traits> std::ostream& operator<<( - std::ostream &out,const Trapezoidal_decomposition_2& td) + std::ostream &out,const Trapezoidal_decomposition_2& td) { return write(out,td.dag_root(),td.get_traits()); } template < class Traits> std::ostream& write(std::ostream &out,const Td_X_trapezoid& t, - const Traits& traits,bool validate=true) + const Traits& traits,bool validate=true) { typedef Trapezoidal_decomposition_2 TD; typedef Td_X_trapezoid X_trapezoid; @@ -65,11 +65,11 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid& t, out << ","; if (!t.is_on_top_boundary()) out << t.top(); else out << "+oo"; out << ",neighbours(" << std::flush; - + // debug neighbours equivalence relation int max_size=4+1; int null_size=2,size=null_size,i,j; - + X_trapezoid* value[] = { 0, @@ -92,17 +92,17 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid& t, for (j=null_size;j<=max_size;j++) { for (i=0;i& t, out << name[j]; // identify neighbours if (traits.is_td_vertex(t) && value[j]) - out << "=" << value[j]->top(); + out << "=" << value[j]->top(); } out << ")" << std::flush; - + if (t.is_active()) { if (traits.is_td_trapezoid(t)) - { - if (t.is_unbounded()) - { - out << ",U="; - if (t.is_on_left_boundary()) out << ")"; - if (t.is_on_bottom_boundary()) { - if (t.is_on_top_boundary()) - out << "/\\/"; - else - out << "/\\"; - } - else if (t.is_on_top_boundary()) out << "\\/"; - if (t.is_on_right_boundary()) out << "("; - } - else - out << ",T"; - } + { + if (t.is_unbounded()) + { + out << ",U="; + if (t.is_on_left_boundary()) out << ")"; + if (t.is_on_bottom_boundary()) { + if (t.is_on_top_boundary()) + out << "/\\/"; + else + out << "/\\"; + } + else if (t.is_on_top_boundary()) out << "\\/"; + if (t.is_on_right_boundary()) out << "("; + } + else + out << ",T"; + } else if (traits.is_td_edge(t)) - out << ",C"; + out << ",C"; else // if (t.is_degenerate_point()) - out << ",P"; + out << ",P"; } else out << ",D"; - - /* Calling t.is_valid requires the traits to be initialized with the proper + + /* Calling t.is_valid requires the traits to be initialized with the proper bounding box */ if (validate) { if (t.is_valid(&traits)) - out << ",+"; + out << ",+"; else - out << ",-"; + out << ",-"; } - + out << ")" << std::flush; - + return out; } @@ -178,11 +178,11 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) out << ","; if (!t.is_on_top_boundary()) out << t.top(); else out << "+oo"; out << ",neighbours(" << std::flush; - + // debug neighbours equivalence relation int max_size=4+1; int null_size=2,size=null_size,i,j; - + X_trapezoid* value[] = { 0, @@ -205,17 +205,17 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) for (j=null_size;j<=max_size;j++) { for (i=0;i& t) out << name[j]; // identify neighbours if (traits.is_td_vertex(t) && value[j]) - out << "=" << value[j]->top(); + out << "=" << value[j]->top(); out << " "; } out << ")" << std::flush; - + if (t.is_active()) { if (traits.is_td_trapezoid(t)) - { - if (t.is_unbounded()) - { - out << ",U"; - if (t.is_on_left_boundary()) - out << (char) 174; - if (t.is_on_bottom_boundary()) - out << (char) 25; - if (t.is_on_top_boundary()) - out << (char) 24; - if (t.is_on_right_boundary()) - out << (char) 175; - } - else - out << ",T"; - } + { + if (t.is_unbounded()) + { + out << ",U"; + if (t.is_on_left_boundary()) + out << (char) 174; + if (t.is_on_bottom_boundary()) + out << (char) 25; + if (t.is_on_top_boundary()) + out << (char) 24; + if (t.is_on_right_boundary()) + out << (char) 175; + } + else + out << ",T"; + } else if (traits.is_td_edge(t)) - out << ",C"; + out << ",C"; else // if (t.is_degenerate_point()) - out << ",P"; + out << ",P"; } else out << ",D"; - - /* Calling t.is_valid requires the traits to be initialized with the proper + + /* Calling t.is_valid requires the traits to be initialized with the proper bounding box if (traits) { @@ -264,9 +264,9 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) else out << ",-"; } - */ + */ out << ")" << std::flush; - + return out; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h index 2b5b8451ec01..a6eca6682edb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Oren Nechushtan // Iddo Hanniel @@ -34,13 +34,13 @@ //#define CGAL_TD_ON_RIGHT_BOUNDARY 0x8 //#define CGAL_TD_ON_BOTTOM_BOUNDARY 0x10 //#define CGAL_TD_ON_TOP_BOUNDARY 0x20 -//#define CGAL_TD_ON_ALL_BOUNDARIES -// (CGAL_TD_ON_LEFT_BOUNDARY | CGAL_TD_ON_RIGHT_BOUNDARY | +//#define CGAL_TD_ON_ALL_BOUNDARIES +// (CGAL_TD_ON_LEFT_BOUNDARY | CGAL_TD_ON_RIGHT_BOUNDARY | // CGAL_TD_ON_BOTTOM_BOUNDARY| CGAL_TD_ON_TOP_BOUNDARY) //#define CGAL_TD_INTERIOR 0 // //#define CGAL_TD_CV_MIN_END 0 -//#define CGAL_TD_CV_MAX_END 0x1 +//#define CGAL_TD_CV_MAX_END 0x1 #define CGAL_TD_DEFAULT_DEPTH_THRESHOLD 60 #define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12 diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h index 7f8694223b52..f3a101db437f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h @@ -45,12 +45,12 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 typedef AlgebraicKernelD_1 Algebraic_kernel_d_1; typedef Base_rational_arc_ds_1 Base; - + typedef CGAL::Arr_rational_arc::Rational_function Rational_function; typedef CGAL::Arr_rational_arc::Rational_function_pair Rational_function_pair; - + typedef typename Base::Algebraic_real_1 Algebraic_real_1; typedef typename Algebraic_kernel_d_1::Bound Bound; typedef typename Base::Integer Integer ; @@ -61,13 +61,13 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 typedef typename Get_arithmetic_kernel::Arithmetic_kernel AK; - typedef typename AK::Bigfloat_interval BFI; + typedef typename AK::Bigfloat_interval BFI; typedef Bigfloat_interval_traits BFI_traits; typedef CGAL::Polynomial BFI_polynomial; typedef CGAL::Polynomial_traits_d BFI_polynomial_traits; - - typedef typename Base::FT_rat_1 FT_rat_1; + + typedef typename Base::FT_rat_1 FT_rat_1; typedef typename Base::Polynomial_traits_1 Polynomial_traits_1; typedef CGAL::Arr_rational_arc::Cache @@ -86,9 +86,9 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 { _rational_function = other._rational_function; _x_coordinate = other._x_coordinate; - } + } } - + //assignment oparator Algebraic_point_2_rep& operator=(const Algebraic_point_2_rep& other) { @@ -113,17 +113,17 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 return rat_func_pair.compare_f_g_at(_x_coordinate); } - Algebraic_real_1& x() + Algebraic_real_1& x() { return _x_coordinate; } - const Algebraic_real_1& x() const + const Algebraic_real_1& x() const { return _x_coordinate; } - const Rational_function& rational_function() const + const Rational_function& rational_function() const { return _rational_function; } @@ -138,7 +138,7 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 //converting the defining polynomial of x and the rational function to //bivariate polynomials Polynomial_2 f(_algebraic_kernel.compute_polynomial_1_object()(_x_coordinate)); - + Polynomial_2 y(CGAL::shift(Polynomial_2(1),1)); Polynomial_2 g(_rational_function.numer() - y * _rational_function.denom()); @@ -146,7 +146,7 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 g=CGAL::swap(g, 0, 1); //swap x and y in the polynomial g //compute the resultant in x (polynomial in y) Polynomial_1 r(CGAL::resultant(f,g)); - + //solve for all roots of resultant std::list roots; _algebraic_kernel.solve_1_object()(r, false, std::back_inserter(roots)); @@ -160,7 +160,7 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 y_bounds(this->approximate_absolute_y(error_bound,initial_precision)); while (CGAL::compare(roots.front(),y_bounds.first) == SMALLER) roots.pop_front(); - + while (CGAL::compare(y_bounds.second,roots.back()) == SMALLER) roots.pop_back(); @@ -187,29 +187,29 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 return approximate_absolute_y(a,precision); } std::pair approximate_relative_x( int r) const - { + { return _algebraic_kernel.approximate_relative_1_object()(_x_coordinate,r); } std::pair approximate_relative_y( int r) const { // return zero if y is zero (the code below would not terminate) - // moreover approx relative is actually not well defined + // moreover approx relative is actually not well defined if(_rational_function.sign_at(_x_coordinate)==CGAL::ZERO) return std::make_pair(Bound(0),Bound(0)); - + typename BFI_traits::Set_precision set_precision; typename BFI_polynomial_traits::Evaluate evaluate; - + typedef typename BFI_traits::Bound BF; long precision = 16; set_precision(precision); BF eps = CGAL::ipower(BF(1)/2,r); - - while (true){ + + while (true){ set_precision(precision); BFI x_bfi(convert_to_bfi(_x_coordinate)); - + BFI_polynomial numer_bfi(convert_to_bfi_extended(_rational_function.numer())); BFI_polynomial @@ -217,12 +217,12 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 BFI y_numer_bfi(evaluate(numer_bfi,x_bfi)); BFI y_denom_bfi(evaluate(denom_bfi,x_bfi)); - + if (CGAL::zero_in(y_denom_bfi) == false) { BFI y_bfi(y_numer_bfi/y_denom_bfi); - - if (CGAL::compare( + + if (CGAL::compare( CGAL::width(y_bfi), CGAL::lower(CGAL::abs(y_bfi)) * eps) == SMALLER) @@ -247,11 +247,11 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 os << double_p.second; os << ")"; break; - + case ::CGAL::IO::BINARY: std::cerr << "BINARY format not yet implemented" << std::endl; break; - + default: // ASCII os <<"x = " << _x_coordinate<<" "; @@ -261,7 +261,7 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 Base::print_polynomial(os, _rational_function.denom(), 'x'); os << ")"; } - + return os; } private: @@ -269,9 +269,9 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 { typename BFI_traits::Set_precision set_precision; typename BFI_polynomial_traits::Evaluate evaluate; - + typedef typename BFI_traits::Bound BF; - + BF eps = CGAL::ipower(BF(1)/2,a); while (true) { @@ -283,7 +283,7 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 BFI y_numer_bfi(evaluate(numer_bfi,x_bfi)); BFI y_denom_bfi(evaluate(denom_bfi,x_bfi)); - + if (CGAL::zero_in(y_denom_bfi) == false) { BFI y_bfi(y_numer_bfi/y_denom_bfi); @@ -291,7 +291,7 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 return std::make_pair( Bound(CGAL::lower(y_bfi)), Bound(CGAL::upper(y_bfi))); - + } else precision*=2; } @@ -302,10 +302,10 @@ class Algebraic_point_2_rep : public Base_rational_arc_ds_1 CGAL::Coercion_traits:: Arithmetic_kernel::Bigfloat_interval>::Type - convert_to_bfi_extended(const NTX& x) + convert_to_bfi_extended(const NTX& x) { typedef typename Get_arithmetic_kernel::Arithmetic_kernel AK; - typedef typename AK::Bigfloat_interval BFI; + typedef typename AK::Bigfloat_interval BFI; typedef CGAL::Coercion_traits CT; return typename CT::Cast()(x); } @@ -333,7 +333,7 @@ template class Algebraic_point_2 : public Handle_with_policy > { - + public: typedef Algebraic_kernel_ Algebraic_kernel_d_1; typedef Handle_with_policy > @@ -345,7 +345,7 @@ class Algebraic_point_2 : typedef typename Rep::Rational_function Rational_function; typedef typename Rep::Bound Bound; typedef typename Rep::Cache Cache; - typedef typename Rep::Polynomial_1 Polynomial_1; + typedef typename Rep::Polynomial_1 Polynomial_1; private: static Self& get_default_instance() @@ -355,14 +355,14 @@ class Algebraic_point_2 : CGAL_STATIC_THREAD_LOCAL_VARIABLE(Poly, numer,0); CGAL_STATIC_THREAD_LOCAL_VARIABLE(Poly, denom, 1); CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Rational_function, rational_function, numer, denom, &kernel); - + CGAL_STATIC_THREAD_LOCAL_VARIABLE(Algebraic_real_1, x_coordinate,kernel.construct_algebraic_real_1_object()(Rational(0))); - - CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Self, default_instance, rational_function, x_coordinate); - + + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Self, default_instance, rational_function, x_coordinate); + return default_instance; - /*static Self x = Self(Rational(0),Rational(0),_cache); + /*static Self x = Self(Rational(0),Rational(0),_cache); return x; */ } @@ -370,7 +370,7 @@ class Algebraic_point_2 : explicit Algebraic_point_2(const Rational_function& rational_function, const Algebraic_real_1& x_coordinate) : Base(rational_function,x_coordinate) {} - + Algebraic_point_2() : Base(static_cast (get_default_instance())) {} @@ -384,7 +384,7 @@ class Algebraic_point_2 : const Polynomial_1& numerator() const { return this->ptr()->numerator(); } const Polynomial_1& denominator() const { return this->ptr()->denominator(); } - + Algebraic_real_1& x() { if (this->is_shared()) @@ -392,12 +392,12 @@ class Algebraic_point_2 : return this->ptr()->x(); } - const Algebraic_real_1& x() const + const Algebraic_real_1& x() const { return this->ptr()->x(); } - const Rational_function& rational_function() const + const Rational_function& rational_function() const { return this->ptr()->rational_function(); } @@ -423,7 +423,7 @@ class Algebraic_point_2 : } std::pair approximate_relative_x( int r) const - { + { return this->ptr()->approximate_relative_x(r); } @@ -447,6 +447,6 @@ std::ostream& operator<<(std::ostream& os, } } //namespace Arr_rational_arc -} //namespace CGAL { +} //namespace CGAL { #endif //CGAL_ALBERAIC_POINT_D_1_H diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h index b547cd96f367..d101f4c04207 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h @@ -41,20 +41,20 @@ class Base_rational_arc_ds_1 //typedef typename Algebraic_kernel::Multiplicity_type Multiplicity; typedef unsigned int Multiplicity; typedef typename Algebraic_kernel::Coefficient Coefficient; - + typedef typename Get_arithmetic_kernel::Arithmetic_kernel Arithmetic_kernel; - typedef typename Arithmetic_kernel::Rational Rational; + typedef typename Arithmetic_kernel::Rational Rational; typedef typename Arithmetic_kernel::Integer Integer; typedef typename Algebraic_kernel::Algebraic_real_1 Algebraic_real_1; - + typedef typename Algebraic_kernel::Polynomial_1 Polynomial_1; typedef Polynomial_traits_d Polynomial_traits_1; typedef Fraction_traits FT_rat_1; typedef typename Algebraic_kernel::Solve_1 Solve_1; typedef typename Algebraic_kernel::Bound Bound; typedef Algebraic_structure_traits AT_poly; - + typedef Polynomial Poly_rat_1; typedef Polynomial_traits_d PT_rat_1; typedef Fraction_traits FT_poly_rat_1; @@ -68,17 +68,17 @@ class Base_rational_arc_ds_1 typename FT_poly_rat_1::Numerator_type>::value)); public: - + //--------------------------------------------------------------------- // Print a polynomial nicely. static std::ostream& print_polynomial(std::ostream& os, const Polynomial_1& poly, - char var) + char var) { // Get the degree. const int deg = CGAL::degree(poly); - + Integer coeff; CGAL::Sign sgn; int k; @@ -90,10 +90,10 @@ class Base_rational_arc_ds_1 } for (k = deg; k >= 0; k--) - { + { //coeff = pt::Get_coefficient()(poly, k); coeff = CGAL::get_coefficient(poly, k); - + if (k == deg) os << coeff; else if ((sgn = CGAL::sign (coeff)) == POSITIVE) @@ -102,7 +102,7 @@ class Base_rational_arc_ds_1 os << " - " << -coeff; else continue; - + if (k > 1) os << '*' << var << '^' << k; else if (k == 1) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h index 2233c0697cc2..35c5a3febc74 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h @@ -25,7 +25,7 @@ namespace CGAL { namespace Arr_rational_arc { //------------------- -//Cache +//Cache //------------------- template class Cache : public Base_rational_arc_ds_1 @@ -34,7 +34,7 @@ class Cache : public Base_rational_arc_ds_1 typedef AlgebraicKernel_d_1 Algebraic_kernel_d_1; typedef Base_rational_arc_ds_1 Base; typedef Cache Self; - + typedef typename Base::Polynomial_1 Polynomial_1; typedef typename Base::Rational Rational; typedef typename Base::Algebraic_real_1 Algebraic_real_1; @@ -117,15 +117,15 @@ class Cache : public Base_rational_arc_ds_1 ++iter1) { if (iter1->second.is_shared()) - { + { Rational_function_key key = iter1->first; //construct new instance Rational_function f(iter1->second.numer(), iter1->second.denom(), _ak_ptr); - _rat_func_map.insert(std::make_pair(key,f)); + _rat_func_map.insert(std::make_pair(key,f)); } } - + //copy rational function pair map typename Rational_function_canonicalized_pair_map::const_iterator iter2; for ( iter2 = other.rat_pair_map().begin(); @@ -138,7 +138,7 @@ class Cache : public Base_rational_arc_ds_1 //construct new instance Rational_function_canonicalized_pair p(iter2->second.f(), iter2->second.g(), _ak_ptr); - _rat_pair_map.insert(std::make_pair(key,p)); + _rat_pair_map.insert(std::make_pair(key,p)); } } @@ -152,7 +152,7 @@ class Cache : public Base_rational_arc_ds_1 { return _rat_pair_map; } - + const Rational_function& get_rational_function(const Polynomial_1& numer, const Polynomial_1& denom) const { @@ -175,9 +175,9 @@ class Cache : public Base_rational_arc_ds_1 //then insert the new element Rational_function f(numer,denom,_ak_ptr); typename Rational_function_map::iterator it2 = - _rat_func_map.insert(it,std::make_pair(key,f)); - return it2->second; - } + _rat_func_map.insert(it,std::make_pair(key,f)); + return it2->second; + } } const Rational_function& get_rational_function( const Rational& rat) const { @@ -192,23 +192,23 @@ class Cache : public Base_rational_arc_ds_1 return get_rational_function (numer_poly,denom_poly); } - const Rational_function_pair get_rational_pair(const Rational_function& f, + const Rational_function_pair get_rational_pair(const Rational_function& f, const Rational_function& g) const { CGAL_precondition (_ak_ptr != nullptr); CGAL_precondition(!(f==g)); Rational_function_canonicalized_pair_key key = get_key(f,g); - bool is_opposite = (f.id() < g.id()) ? false : true ; + bool is_opposite = (f.id() < g.id()) ? false : true ; //look if element exists in cache already typename Rational_function_canonicalized_pair_map::iterator it = _rat_pair_map.lower_bound(key); - + if(it != _rat_pair_map.end() && !(_rat_pair_map.key_comp()(key, it->first))) { return (Rational_function_pair(it->second,is_opposite)); } - else //element does not exist, + else //element does not exist, { //first check if to clean up cache if (_rat_pair_map.size() > _rat_pair_map_watermark) @@ -216,7 +216,7 @@ class Cache : public Base_rational_arc_ds_1 //create it & insert to cache Rational_function_canonicalized_pair p(f, g, _ak_ptr); - std::pair res = + std::pair res = _rat_pair_map.insert(std::make_pair(key,p)); return (Rational_function_pair(res.first->second,is_opposite)); } @@ -229,7 +229,7 @@ class Cache : public Base_rational_arc_ds_1 } private: Rational_function_key get_key(const Polynomial_1& numer, - const Polynomial_1& denom) const + const Polynomial_1& denom) const { return Rational_function_key(numer, denom); } @@ -248,9 +248,9 @@ class Cache : public Base_rational_arc_ds_1 } - void rat_func_map_clean_up() const - { - + void rat_func_map_clean_up() const + { + //find eraseable rational functions std::vector eraseable; typename Rational_function_map::iterator iter1; @@ -277,7 +277,7 @@ class Cache : public Base_rational_arc_ds_1 typename Rational_function_map::size_type(128))); return; } - void rat_pair_map_clean_up() const + void rat_pair_map_clean_up() const { //find eraseable rational functions std::vector eraseable; @@ -300,7 +300,7 @@ class Cache : public Base_rational_arc_ds_1 } //re-set watermark - _rat_pair_map_watermark = + _rat_pair_map_watermark = static_cast((std::max)(2* _rat_pair_map.size(), typename Rational_function_canonicalized_pair_map::size_type(128))); } @@ -312,7 +312,7 @@ class Cache : public Base_rational_arc_ds_1 mutable unsigned int _rat_pair_map_watermark; mutable Algebraic_kernel_d_1* _ak_ptr; }; //Cache - + } //namespace Arr_rational_arc } //namespace CGAL { #endif //CGAL_RATIONAL_ARC_CACHE diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h index bfa0eda851fa..e2010a578ec5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h @@ -48,11 +48,11 @@ namespace Arr_rational_arc { // Denominator(x) // // where Numerator and Denominator are polynomial with integer (or rational) coefficients. -// The class is templated with two parameters: +// The class is templated with two parameters: // Algebraic_kernel: An algebraic kernel for the intersection points of the curves // // This class serves as the base for the classes: -// Rational_arc_d_1 (a general, not necessarily continuous arc) +// Rational_arc_d_1 (a general, not necessarily continuous arc) // Continuous_rational_arc_d_1 (a continuous portion of a rational function). //--------------------------------------------------------------------------// @@ -79,13 +79,13 @@ class Base_rational_arc_d_1 typedef typename Base_rational_arc_ds_1::Coefficient Coefficient; typedef typename Base_rational_arc_ds_1::Arithmetic_kernel Arithmetic_kernel; - typedef typename Base_rational_arc_ds_1::Rational Rational; + typedef typename Base_rational_arc_ds_1::Rational Rational; typedef typename Base_rational_arc_ds_1::Integer Integer; typedef typename Base_rational_arc_ds_1::Algebraic_real_1 Algebraic_real_1; typedef typename Base_rational_arc_ds_1::Algebraic_vector Algebraic_vector; typedef typename Base_rational_arc_ds_1::Multiplicity_vector Multiplicity_vector; - + typedef std::vector Rat_vector; typedef Polynomial_traits_d Polynomial_traits_1; @@ -93,13 +93,13 @@ class Base_rational_arc_d_1 typedef typename Base_rational_arc_ds_1::Solve_1 Solve_1; typedef typename Algebraic_kernel::Bound Bound; typedef Algebraic_structure_traits AT_poly; - + typedef Polynomial Poly_rat_1; typedef Polynomial_traits_d PT_rat_1; typedef Fraction_traits FT_poly_rat_1; typedef Algebraic_point_2 Point_2; - + CGAL_static_assertion((boost::is_same::value)); CGAL_static_assertion((boost::is_same::value)); @@ -116,7 +116,7 @@ class Base_rational_arc_d_1 { return cache.get_rational_function(rat); } - const Rational_function_pair get_rational_pair(const Rational_function& f, + const Rational_function_pair get_rational_pair(const Rational_function& f, const Rational_function& g, const Cache& cache) const { @@ -150,11 +150,11 @@ class Base_rational_arc_d_1 IS_CONTINUOUS = 512, IS_VALID = 1024 }; - - Rational_function _f; // The rational function + + Rational_function _f; // The rational function Algebraic_point_2 _ps; // The source point. Algebraic_point_2 _pt; // The target point. - int _info; // A set of Boolean flags. + int _info; // A set of Boolean flags. public: //------------ @@ -166,11 +166,11 @@ class Base_rational_arc_d_1 Base_rational_arc_d_1() : _info(0) {} - + //--------------------------------------------------------------------------- // Constructor of a whole polynomial curve defined by pcoeffs - the rational // coefficients of the polynomial p(x). - + Base_rational_arc_d_1(const Polynomial_1& P, const Cache& cache) : _info(0) { @@ -186,14 +186,14 @@ class Base_rational_arc_d_1 pcoeffs.end())); Integer denom_int; typename FT_poly_rat_1::Decompose()(num_rat, _numer, denom_int); - + _init(_numer,denom_int,cache); } void _init(const Polynomial_1& P,const Integer& Q_int,const Cache& cache) { CGAL_precondition(!CGAL::is_zero(Q_int)); - //set rational function + //set rational function Polynomial_1 Q= typename Polynomial_traits_1::Construct_polynomial()(Q_int); _f = get_rational_function(P, Q, cache); @@ -207,18 +207,18 @@ class Base_rational_arc_d_1 const int deg_num(CGAL::degree(P)); Integer lead_coeff(CGAL::leading_coefficient(Q)); CGAL::Sign lead_sign(CGAL::sign(lead_coeff)); - + if (deg_num > 0) { // Check if the degree is even or odd and check the sign of the leading // coefficient of the polynomial. - + CGAL_assertion(lead_sign != CGAL::ZERO); if (deg_num % 2 == 0) { // Polynomial of an even degree. - if (lead_sign == CGAL::NEGATIVE) + if (lead_sign == CGAL::NEGATIVE) _info = (_info | SRC_AT_Y_MINUS_INFTY | TRG_AT_Y_MINUS_INFTY); else _info = (_info | SRC_AT_Y_PLUS_INFTY | TRG_AT_Y_PLUS_INFTY); @@ -246,10 +246,10 @@ class Base_rational_arc_d_1 _info = (_info | IS_CONTINUOUS); _info = (_info | IS_VALID); - } + } //--------------------------------------------------------------------------- - //Constructor of a polynomial ray, defined by y = p(x), + //Constructor of a polynomial ray, defined by y = p(x), //for x_s <= x if the ray is directed to the right, or //for x_s >= x if it is directed to the left. //param pcoeffs The rational coefficients of the polynomial p(x). @@ -274,7 +274,7 @@ class Base_rational_arc_d_1 pcoeffs.end())); Integer denom_int; typename FT_poly_rat_1::Decompose()(num_rat, _numer, denom_int); - + _init(_numer, denom_int, x_s, dir_right, cache); } @@ -282,7 +282,7 @@ class Base_rational_arc_d_1 const Algebraic_real_1& x_s, bool dir_right,const Cache& cache) { CGAL_precondition(!CGAL::is_zero(Q_int)); - //set rational function + //set rational function Polynomial_1 Q = typename Polynomial_traits_1::Construct_polynomial()(Q_int); _f = get_rational_function(P,Q,cache); @@ -334,7 +334,7 @@ class Base_rational_arc_d_1 // In the case of a constant polynomial it is possible to set a finite // y-coordinate for the target point. // x coordinate is 0 although in practice is +-oo - _pt = Algebraic_point_2(get_rational_function(P, Q, cache), + _pt = Algebraic_point_2(get_rational_function(P, Q, cache), Algebraic_real_1()); } @@ -362,23 +362,23 @@ class Base_rational_arc_d_1 const Algebraic_real_1& x_s,const Algebraic_real_1& x_t, const Cache& cache): _info(0) - { + { // Set the numerator & denominator polynomials. Polynomial_1 _numer; Poly_rat_1 num_rat(typename PT_rat_1::Construct_polynomial()(pcoeffs.begin(), pcoeffs.end())); Integer denom_int; typename FT_poly_rat_1::Decompose()(num_rat, _numer, denom_int); - + _init(_numer, denom_int, x_s, x_t, cache); - } + } void _init(const Polynomial_1& P,const Integer& Q_int, const Algebraic_real_1& x_s,const Algebraic_real_1& x_t, const Cache& cache) { CGAL_precondition(!CGAL::is_zero(Q_int)); - //set rational function + //set rational function Polynomial_1 Q = typename Polynomial_traits_1::Construct_polynomial()(Q_int); _f = get_rational_function(P, Q, cache); @@ -393,7 +393,7 @@ class Base_rational_arc_d_1 // Set the endpoints. _ps=Algebraic_point_2(_f,x_s); _pt=Algebraic_point_2(_f,x_t); - + // Mark that the arc is continuous and valid. _info = (_info | IS_CONTINUOUS); _info = (_info | IS_VALID); @@ -431,16 +431,16 @@ class Base_rational_arc_d_1 _init(_numer,_denom,cache); } - void _init(const Polynomial_1& P_, const Polynomial_1& Q_, const Cache& cache) + void _init(const Polynomial_1& P_, const Polynomial_1& Q_, const Cache& cache) { CGAL_precondition(!CGAL::is_zero(Q_)); - //set rational function + //set rational function // Set the numerator & denominator polynomials. Polynomial_1 P; Polynomial_1 Q; _canonicalize(P_, Q_, P, Q); - + _f = get_rational_function(P, Q, cache); // Mark that the endpoints of the rational functions are unbounded (the @@ -449,7 +449,7 @@ class Base_rational_arc_d_1 _info = (_info | TRG_AT_X_PLUS_INFTY); _info = (_info | IS_DIRECTED_RIGHT); - + // Analyze the bahaviour of the rational function at x = -oo (the source). Algebraic_real_1 y0; const Arr_parameter_space inf_s = _analyze_at_minus_infinity(P, Q, y0); @@ -478,7 +478,7 @@ class Base_rational_arc_d_1 //--------------------------------------------------------------------------- //Constructor of a ray of a rational function, defined by y = p(x)/q(x), - //for x_s <= x if the ray is directed to the right, or + //for x_s <= x if the ray is directed to the right, or //for x_s >= x if the ray is directed to the left. //param pcoeffs The rational coefficients of the polynomial p(x). //param qcoeffs The rational coefficients of the polynomial q(x). @@ -517,10 +517,10 @@ class Base_rational_arc_d_1 void _init(const Polynomial_1& P_, const Polynomial_1& Q_, const Algebraic_real_1& x_s, bool dir_right, - const Cache& cache) + const Cache& cache) { CGAL_precondition(!CGAL::is_zero(Q_)); - //set rational function + //set rational function Polynomial_1 P; Polynomial_1 Q; _canonicalize(P_,Q_,P,Q); @@ -538,7 +538,7 @@ class Base_rational_arc_d_1 } - //The source point has a bounded x-coordinate. + //The source point has a bounded x-coordinate. _ps = Algebraic_point_2(_f, x_s); //check if the source point lies next to a pole. if (typename Algebraic_kernel::Sign_at_1()(Q, x_s) != CGAL::ZERO) @@ -569,8 +569,8 @@ class Base_rational_arc_d_1 // The target point is at x = -oo. inf_t =_analyze_at_minus_infinity(P, Q, y0); } - - if (inf_t == ARR_BOTTOM_BOUNDARY) + + if (inf_t == ARR_BOTTOM_BOUNDARY) _info = (_info | TRG_AT_Y_MINUS_INFTY); else if (inf_t == ARR_TOP_BOUNDARY) _info = (_info | TRG_AT_Y_PLUS_INFTY); @@ -625,7 +625,7 @@ class Base_rational_arc_d_1 const Cache& cache) { CGAL_precondition(!CGAL::is_zero(Q_)); - //set rational function + //set rational function Polynomial_1 P; Polynomial_1 Q; _canonicalize(P_, Q_, P, Q); @@ -653,7 +653,7 @@ class Base_rational_arc_d_1 std::pair signs = _analyze_near_pole(x_s); const CGAL::Sign sign_s = ((_info & IS_DIRECTED_RIGHT) != 0) ? signs.second : signs.first; - + if (sign_s == CGAL::NEGATIVE) _info = (_info | SRC_AT_Y_MINUS_INFTY); else @@ -692,7 +692,7 @@ class Base_rational_arc_d_1 //----------------------------- // Accessing the arc properties //----------------------------- - + //----------------------------------------------------------------- //Get the numerator polynomial of the underlying rational function. const Polynomial_1& numerator() const @@ -918,7 +918,7 @@ class Base_rational_arc_d_1 // ARR_INTERIOR; // Algebraic_real_1 left,right; // if (left_parameter_space == ARR_INTERIOR) -// left = +// left = // (left_parameter_space_in_x()!= ARR_INTERIOR) ? arc.left_x(): // (arc.left_parameter_space_in_x()!= ARR_INTERIOR) ? left_x() : // (arc.left_x() < left_x()) ? left_x() : @@ -930,7 +930,7 @@ class Base_rational_arc_d_1 // arc.right_x(); // if (left > right) // return false; - + // //check if the base functions are equal // if (_has_same_base (arc)) // return true; @@ -938,15 +938,15 @@ class Base_rational_arc_d_1 // get_rational_function(arc._numer,arc._denom)); // return rat_pair.is_intersecting_in_range(left_parameter_space,left,right_parameter_space,right); // } - + //-------------------------------------------------------- - //Split the arc into two at a given pole. - //The function returns the sub-arc to the left of the pole + //Split the arc into two at a given pole. + //The function returns the sub-arc to the left of the pole //and sets (*this) to be the right sub-arc. //param x0 The x-coordinate of the pole. //precondition x0 lies in the interior of the arc. //return The sub-arc to the left of the pole. - + Self split_at_pole(const Algebraic_real_1& x0) { // Analyze the behaviour of the function near the given pole. @@ -986,7 +986,7 @@ class Base_rational_arc_d_1 c1._info = (c1._info | SRC_AT_Y_MINUS_INFTY); else c1._info = (c1._info | SRC_AT_Y_PLUS_INFTY); - + this->_pt = p0; this->_info = (this->_info & ~TRG_INFO_BITS); if (sign_right == CGAL::NEGATIVE) @@ -1000,11 +1000,11 @@ class Base_rational_arc_d_1 return (c1); } - + //--------------- //name Predicates //--------------- - + //--------------------------------------------------------------------------- //Get the relative position of the point with respect to the rational arc. @@ -1028,7 +1028,7 @@ class Base_rational_arc_d_1 return rat_pair.compare_f_g_at(p.x()); } //--------------------------------------------------------------------------- - //Compare the x-coordinate of a vertical asymptote of the arc + //Compare the x-coordinate of a vertical asymptote of the arc //(one of its ends) and the given point. Comparison_result compare_end(Arr_curve_end ce, const Algebraic_point_2& p) const @@ -1061,7 +1061,7 @@ class Base_rational_arc_d_1 return ((ce == ARR_MIN_END) ? LARGER : SMALLER); } - + //------------------------------------------------------------------ //Compare the x-coordinate of a vertical asymptotes of the two arcs. //approaching from the same direction @@ -1095,7 +1095,7 @@ class Base_rational_arc_d_1 if (_has_same_base(arc)) return CGAL::EQUAL; Rational_function_pair rat_pair = get_rational_pair(_f,arc._f,cache); - + CGAL::Comparison_result comp_f_g_y = rat_pair.compare_f_g_at(x,ce == ARR_MAX_END ? CGAL::NEGATIVE : CGAL::POSITIVE); @@ -1112,8 +1112,8 @@ class Base_rational_arc_d_1 } //------------------------------------------------------------------ - //Compare the x-coordinate of a vertical asymptotes of the two arcs. - Comparison_result compare_ends(Arr_curve_end ind1,const Self& arc, + //Compare the x-coordinate of a vertical asymptotes of the two arcs. + Comparison_result compare_ends(Arr_curve_end ind1,const Self& arc, Arr_curve_end ind2, const Cache& cache) const { // Get the x-coordinates of the first vertical asymptote. @@ -1179,13 +1179,13 @@ class Base_rational_arc_d_1 if (_has_same_base(arc)) return CGAL::EQUAL; Rational_function_pair rat_pair = get_rational_pair(_f,arc._f,cache); - + CGAL::Comparison_result comp_f_g_y = rat_pair.compare_f_g_at(x1, ind1 == ARR_MAX_END ? CGAL::NEGATIVE : CGAL::POSITIVE); if( ind1 == ARR_MAX_END) { - CGAL_postcondition(ind2 == ARR_MAX_END); + CGAL_postcondition(ind2 == ARR_MAX_END); CGAL_postcondition(right_parameter_space_in_y() == arc.right_parameter_space_in_y()); return (right_parameter_space_in_y() == ARR_BOTTOM_BOUNDARY) ? @@ -1193,7 +1193,7 @@ class Base_rational_arc_d_1 } else { - CGAL_postcondition(ind2 == ARR_MIN_END); + CGAL_postcondition(ind2 == ARR_MIN_END); CGAL_postcondition(left_parameter_space_in_y() == arc.left_parameter_space_in_y()); return (left_parameter_space_in_y() == ARR_BOTTOM_BOUNDARY) ? @@ -1202,7 +1202,7 @@ class Base_rational_arc_d_1 } //------------------------------------------------------------------ - // Compare the slopes of the arc with another given arc + // Compare the slopes of the arc with another given arc // at their given intersection point. // param cv The given arc. // param p The intersection point. @@ -1215,7 +1215,7 @@ class Base_rational_arc_d_1 // deleted!!! //------------------------------------------------------------------ - // Compare the two arcs at a given intersection point + // Compare the two arcs at a given intersection point // param arc The given arc // param p The intersection point // param to_left to check to the left or to the right of intersection point @@ -1370,8 +1370,8 @@ class Base_rational_arc_d_1 left_parameter_space_in_y() == ARR_INTERIOR && arc.right_parameter_space_in_x() == ARR_INTERIOR && arc.right_parameter_space_in_y() == ARR_INTERIOR && - //CGAL::equal(left_x(), arc.right_x()))); - (left_x() == arc.right_x()))); + //CGAL::equal(left_x(), arc.right_x()))); + (left_x() == arc.right_x()))); } //------------------------------------ //Constructions of points and curves @@ -1401,16 +1401,16 @@ class Base_rational_arc_d_1 if ((_info & IS_CONTINUOUS) != 0) arc._info = (arc._info | IS_CONTINUOUS); - + return (arc); } //------------------------ // Print the rational arc. std::ostream& print(std::ostream& os) const - { + { // Print y as a rational function of x. - os << "y = ("; + os << "y = ("; Base_rational_arc_ds_1::print_polynomial(os, this->numerator(), 'x'); os << ") / ("; Base_rational_arc_ds_1::print_polynomial(os, this->denominator(), 'x'); @@ -1418,7 +1418,7 @@ class Base_rational_arc_d_1 // Print the definition range. Arr_parameter_space inf_x = source_parameter_space_in_x(); - if (inf_x == ARR_LEFT_BOUNDARY) + if (inf_x == ARR_LEFT_BOUNDARY) os << "(-oo"; else if (inf_x == ARR_RIGHT_BOUNDARY) os << "(+oo"; @@ -1430,7 +1430,7 @@ class Base_rational_arc_d_1 os << ", "; inf_x = target_boundary_in_x(); - if (inf_x == ARR_LEFT_BOUNDARY) + if (inf_x == ARR_LEFT_BOUNDARY) os << "-oo)"; else if (inf_x == ARR_RIGHT_BOUNDARY) os << "+oo)"; @@ -1444,7 +1444,7 @@ class Base_rational_arc_d_1 protected: - + //------------------------------- //Auxiliary (protected) functions. //------------------------------- @@ -1475,7 +1475,7 @@ class Base_rational_arc_d_1 } return; } - + //-------------------------------------------------------------------------- // Check if the given x-value is in the x-range of the arc. // param x The x-value. @@ -1483,7 +1483,7 @@ class Base_rational_arc_d_1 // source point. // param eq_trg Output: Is this value equal to the x-coordinate of the // target point. - + bool _is_in_x_range(const Algebraic_real_1& x, bool& eq_src, bool& eq_trg) const { @@ -1503,29 +1503,29 @@ class Base_rational_arc_d_1 if (res1 == SMALLER) return false; - + if (res1 == EQUAL) { eq_src = true; return true; } } - + // Compare to the right endpoint (the target in this case). if ((_info & TRG_AT_X_PLUS_INFTY) != 0) return true; const Comparison_result res2 = CGAL::compare(x, _pt.x()); - + if (res2 == LARGER) return false; - + if (res2 == EQUAL) eq_trg = true; return true; } - + // Compare to the left endpoint (the target in this case). if ((_info & TRG_AT_X_MINUS_INFTY) != 0) { @@ -1537,31 +1537,31 @@ class Base_rational_arc_d_1 if (res1 == SMALLER) return false; - + if (res1 == EQUAL) { eq_trg = true; return true; } } - + // Compare to the right endpoint (the source in this case). if ((_info & SRC_AT_X_PLUS_INFTY) != 0) return true; const Comparison_result res2 = CGAL::compare(x, _ps.x()); - + if (res2 == LARGER) return false; - + if (res2 == EQUAL) eq_src = true; - + return true; } //---------------------------------------------------------- - // Check if the given x-value is in the x-range of the arc, + // Check if the given x-value is in the x-range of the arc, // excluding its open ends. bool _is_in_true_x_range(const Algebraic_real_1& x) const { @@ -1582,12 +1582,12 @@ class Base_rational_arc_d_1 // If we reached here, the value is in the true x-range of the arc. return true; } - + //------------------------------------------------------------------------ // Check if the underlying rational function is the same in the given arc. // param arc The given arc. // return true if arc's underlying rational function is the same - // as of *this; + // as of *this; // false otherwise. bool _has_same_base(const Self& arc) const @@ -1602,10 +1602,10 @@ class Base_rational_arc_d_1 // { // bool same_source(true); // bool same_target(true); - // if ( (this->source_parameter_space_in_x () == ARR_INTERIOR) && + // if ( (this->source_parameter_space_in_x () == ARR_INTERIOR) && // (this->source_parameter_space_in_y () == ARR_INTERIOR) ) // same_source = (this->source() == arc.source()); - // if ( (this->target_boundary_in_x () == ARR_INTERIOR) && + // if ( (this->target_boundary_in_x () == ARR_INTERIOR) && // (this->target_boundary_in_y () == ARR_INTERIOR) ) // same_target = (this->target() == arc.target()); // return (same_source && same_target); @@ -1674,7 +1674,7 @@ class Base_rational_arc_d_1 // Get the leading coefficients. Integer p_lead(CGAL::leading_coefficient(P)); Integer q_lead(CGAL::leading_coefficient(Q)); - + if (deg_p == deg_q) { // We have a horizontal asymptote. @@ -1705,11 +1705,11 @@ class Base_rational_arc_d_1 bool eq_src, eq_trg; typename std::list::const_iterator x_iter; - //solve for roots without caring for multiplicity + //solve for roots without caring for multiplicity //hence the usage of the bool var std::copy(_f.poles().begin(),_f.poles().end(),std::back_inserter (q_roots)); - + // Go over the roots and check whether they lie in the x-range of the arc. for (x_iter = q_roots.begin(); x_iter != q_roots.end(); ++x_iter) { @@ -1735,7 +1735,7 @@ class Base_rational_arc_d_1 } //--------------------------------------------------------------------- - // Check whether the arc is continuous. + // Check whether the arc is continuous. bool _is_continuous() { // Compute the roots of the denominator polynomial, and make sure @@ -1771,7 +1771,7 @@ class Base_rational_arc_d_1 //{ // // Get the degree. // const int deg = CGAL::degree(poly); - // + // // Integer coeff; // CGAL::Sign sgn; // int k; @@ -1783,7 +1783,7 @@ class Base_rational_arc_d_1 // } // for (k = deg; k >= 0; k--) - // { + // { // //coeff = pt::Get_coefficient()(poly, k); // coeff = CGAL::get_coefficient(poly, k); // @@ -1795,7 +1795,7 @@ class Base_rational_arc_d_1 // os << " - " << -coeff; // else // continue; - // + // // if (k > 1) // os << '*' << var << '^' << k; // else if (k == 1) @@ -1810,7 +1810,7 @@ class Base_rational_arc_d_1 //------------------------------- //! Exporter for rational arcs. template -std::ostream& operator<<(std::ostream& os, +std::ostream& operator<<(std::ostream& os, const Base_rational_arc_d_1 & arc) { return (arc.print(os)); @@ -1829,12 +1829,12 @@ class Continuous_rational_arc_d_1: public: typedef Algebraic_kernel_ Algebraic_kernel; - + typedef Continuous_rational_arc_d_1 Self; typedef Base_rational_arc_d_1 Base; typedef typename Base::Integer Integer; - typedef typename Base::Rational Rational; + typedef typename Base::Rational Rational; typedef typename Base::Algebraic_real_1 Algebraic_real_1; typedef typename Base::Algebraic_point_2 Algebraic_point_2; typedef typename Base::Polynomial_1 Polynomial_1; @@ -1893,13 +1893,13 @@ class Continuous_rational_arc_d_1: * or to the left (to -oo). */ Continuous_rational_arc_d_1(const Polynomial_1& P, - const Algebraic_real_1& x_s, + const Algebraic_real_1& x_s, bool dir_right, const Cache& cache) : Base(P, x_s, dir_right,cache) {} Continuous_rational_arc_d_1(const Rat_vector& pcoeffs, - const Algebraic_real_1& x_s, + const Algebraic_real_1& x_s, bool dir_right, const Cache& cache) : Base(pcoeffs, x_s, dir_right,cache) {} @@ -1990,7 +1990,7 @@ class Continuous_rational_arc_d_1: } /*! - * Constructor of a bounded rational arc, defined by y = p(x)/q(x), + * Constructor of a bounded rational arc, defined by y = p(x)/q(x), * where: x_min <= x <= x_max. * \param pcoeffs The rational coefficients of the polynomial p(x). * \param qcoeffs The rational coefficients of the polynomial q(x). @@ -2028,7 +2028,7 @@ class Continuous_rational_arc_d_1: /// \name Constructions of points and curves. //@{ - + /*! * Compute the intersections with the given arc. * \param arc The given intersecting arc. @@ -2050,12 +2050,12 @@ class Continuous_rational_arc_d_1: } if (this->_has_same_base(arc)) - { + { // Get the left and right endpoints of (*this) and their information // bits. - const Algebraic_point_2& left1 = (this->is_directed_right() ? + const Algebraic_point_2& left1 = (this->is_directed_right() ? this->_ps : this->_pt); - const Algebraic_point_2& right1 = (this->is_directed_right() ? + const Algebraic_point_2& right1 = (this->is_directed_right() ? this->_pt : this->_ps); int info_left1, info_right1; @@ -2135,7 +2135,7 @@ class Continuous_rational_arc_d_1: Arr_parameter_space inf_r2 = arc.right_parameter_space_in_x(); Algebraic_point_2 p_right; int info_right; - + if (inf_r1 == ARR_INTERIOR && inf_r2 == ARR_INTERIOR) { // Let p_right be the rightmost of the two right endpoints. @@ -2182,9 +2182,9 @@ class Continuous_rational_arc_d_1: { // We have a single overlapping point. Just make sure this point // is not at y = -/+ oo. - if (info_left && + if (info_left && (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0 && - info_right && + info_right && (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0) { Intersection_point_2 ip(p_left, 0); @@ -2205,13 +2205,13 @@ class Continuous_rational_arc_d_1: overlap_arc._pt = p_right; overlap_arc._info = ((info_left) | (info_right << 4) | - this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | + this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | this->IS_VALID); *oi++ = make_object(overlap_arc); return (oi); } - + // We wish to find the intersection points between: // // y = p1(x)/q1(x) and y = p2(x)/q2(x) @@ -2221,7 +2221,7 @@ class Continuous_rational_arc_d_1: Rational_function_pair rat_pair = this->get_rational_pair(this->_f, arc._f, cache); - + typename Algebraic_vector::const_iterator x_iter; typename Multiplicity_vector::const_iterator m_iter; @@ -2247,7 +2247,7 @@ class Continuous_rational_arc_d_1: return (oi); } - + /*! * Split the arc into two at a given split point. * \param p The split point. @@ -2321,7 +2321,7 @@ class Continuous_rational_arc_d_1: this->_info = (this->_info | this->TRG_AT_X_MINUS_INFTY); else if (arc.right_parameter_space_in_x() == ARR_RIGHT_BOUNDARY) this->_info = (this->_info | this->TRG_AT_X_PLUS_INFTY); - + if (arc.right_parameter_space_in_y() == ARR_BOTTOM_BOUNDARY) this->_info = (this->_info | this->TRG_AT_Y_MINUS_INFTY); else if (arc.right_parameter_space_in_y() == ARR_TOP_BOUNDARY) @@ -2410,7 +2410,7 @@ class Continuous_rational_arc_d_1: } //@} - + }; //*! \class Rational_arc_2 @@ -2422,19 +2422,19 @@ class Rational_arc_d_1 : public Base_rational_arc_d_1 { public: typedef Algebraic_kernel_ Algebraic_kernel; - + typedef Rational_arc_d_1 Self; typedef Base_rational_arc_d_1 Base; typedef Continuous_rational_arc_d_1 Continuous_arc; typedef typename Base::Integer Integer; - typedef typename Base::Rational Rational; + typedef typename Base::Rational Rational; typedef typename Base::Algebraic_real_1 Algebraic_real_1; typedef typename Base::Algebraic_point_2 Algebraic_point_2; typedef typename Base::Polynomial_1 Polynomial_1; - + typedef typename Base::Rat_vector Rat_vector; - + typedef typename Base::Cache Cache; /// \name Constrcution methods. @@ -2468,12 +2468,12 @@ class Rational_arc_d_1 : public Base_rational_arc_d_1 * \param dir_right Is the ray directed to the right (to +oo) * or to the left (to -oo). */ - Rational_arc_d_1(const Polynomial_1& P, const Algebraic_real_1& x_s, + Rational_arc_d_1(const Polynomial_1& P, const Algebraic_real_1& x_s, bool dir_right, const Cache& cache) : Base(P, x_s, dir_right,cache) {} - Rational_arc_d_1(const Rat_vector& pcoeffs, const Algebraic_real_1& x_s, + Rational_arc_d_1(const Rat_vector& pcoeffs, const Algebraic_real_1& x_s, bool dir_right, const Cache& cache) : Base(pcoeffs, x_s, dir_right,cache) {} @@ -2486,12 +2486,12 @@ class Rational_arc_d_1 : public Base_rational_arc_d_1 * \param x_t The x-coordinate of the target point. * \pre The two x-coordinates must not be equal. */ - Rational_arc_d_1(const Polynomial_1& P, const Algebraic_real_1& x_s, + Rational_arc_d_1(const Polynomial_1& P, const Algebraic_real_1& x_s, const Algebraic_real_1& x_t, const Cache& cache) : Base(P, x_s, x_t, cache) {} - Rational_arc_d_1(const Rat_vector& pcoeffs, const Algebraic_real_1& x_s, + Rational_arc_d_1(const Rat_vector& pcoeffs, const Algebraic_real_1& x_s, const Algebraic_real_1& x_t,const Cache& cache) : Base(pcoeffs, x_s, x_t, cache) {} @@ -2529,9 +2529,9 @@ class Rational_arc_d_1 : public Base_rational_arc_d_1 const Algebraic_real_1& x_s, bool dir_right, const Cache& cache) : Base(pcoeffs, qcoeffs, x_s, dir_right, cache) {} - + /*! - * Constructor of a bounded rational arc, defined by y = p(x)/q(x), + * Constructor of a bounded rational arc, defined by y = p(x)/q(x), * where: x_min <= x <= x_max. * \param pcoeffs The rational coefficients of the polynomial p(x). * \param qcoeffs The rational coefficients of the polynomial q(x). diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h index a680f2627f05..c066532a0f45 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h @@ -36,24 +36,24 @@ class Rational_function_rep : public Base_rational_arc_ds_1 typedef typename Base::Multiplicity_vector Multiplicity_vector; typedef typename Base::Root_multiplicity_vector Root_multiplicity_vector; typedef typename Base::Solve_1 Solve_1; - + public: Rational_function_rep() : _ak_ptr(nullptr){} Rational_function_rep(const Polynomial_1& numer, - const Polynomial_1& denom, + const Polynomial_1& denom, Algebraic_kernel_d_1* ak_ptr): _numer(numer), _denom(denom),_ak_ptr(ak_ptr) { initialize(); } - + CGAL::Sign sign_at (const Algebraic_real_1& x, CGAL::Sign epsilon = CGAL::ZERO) const { - //find interval + //find interval typename Algebraic_vector::const_iterator iter = std::lower_bound(_event_roots.begin(), _event_roots.end(),x); - + //case of a value larger than largest root if (iter == _event_roots.end()) return (_sign.back()); @@ -61,11 +61,11 @@ class Rational_function_rep : public Base_rational_arc_ds_1 typename Algebraic_vector::iterator::difference_type dist = iter - _event_roots.begin(); - //if x is not a root, ignore epsilons + //if x is not a root, ignore epsilons if (*iter != x) return (_sign[dist]); - //x is a root + //x is a root if (epsilon == CGAL::ZERO) return (CGAL::EQUAL); else if (epsilon == CGAL::NEGATIVE) @@ -104,7 +104,7 @@ class Rational_function_rep : public Base_rational_arc_ds_1 { return _pole_multiplicities; } - + private: void initialize() { @@ -127,7 +127,7 @@ class Rational_function_rep : public Base_rational_arc_ds_1 rm_poles_vec.size(); typename Root_multiplicity_vector::size_type num_of_intersections = rm_intersctions_vec.size(); - + _poles.reserve(num_of_poles); _pole_multiplicities.reserve(num_of_poles); @@ -135,7 +135,7 @@ class Rational_function_rep : public Base_rational_arc_ds_1 _pole_multiplicities.reserve(num_of_poles + num_of_intersections); //initialize poles - for ( typename Root_multiplicity_vector::iterator it = rm_poles_vec.begin(); + for ( typename Root_multiplicity_vector::iterator it = rm_poles_vec.begin(); it != rm_poles_vec.end() ; ++it) { @@ -164,8 +164,8 @@ class Rational_function_rep : public Base_rational_arc_ds_1 _sign.push_back(curr_sign); typename Multiplicity_vector::iterator it2; - for (it2 = _event_multiplicities.begin(); - it2 != _event_multiplicities.end(); + for (it2 = _event_multiplicities.begin(); + it2 != _event_multiplicities.end(); ++it2) { if (*it2 % 2 == 1) @@ -184,7 +184,7 @@ class Rational_function_rep : public Base_rational_arc_ds_1 std::vector _sign; //function's sign in the corresponding interval induced by _event_roots (if no roots then only one value) mutable Algebraic_kernel_d_1* _ak_ptr; -};//Rational_function_rep +};//Rational_function_rep template < class Algebraic_kernel_ > class Rational_function: @@ -206,12 +206,12 @@ class Rational_function: static Self& get_default_instance() { CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Algebraic_kernel_d_1, kernel); - CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Self, x, Polynomial_1(0), Polynomial_1(1), &kernel); - return x; - } + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Self, x, Polynomial_1(0), Polynomial_1(1), &kernel); + return x; + } public: Rational_function(const Polynomial_1& numer, - const Polynomial_1& denom, + const Polynomial_1& denom, Algebraic_kernel_d_1* ak_ptr) : Base(numer,denom,ak_ptr) {} @@ -224,7 +224,7 @@ class Rational_function: : Base(static_cast (r)) {} Self& operator=(const Self&)=default; - + CGAL::Sign sign_at(const Algebraic_real_1& x, CGAL::Sign epsilon = CGAL::ZERO) const { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h index 44ba81a0fdce..a2823eada87c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h @@ -43,25 +43,25 @@ class Rational_function_canonicalized_pair_rep: typedef typename Base::Solve_1 Solve_1; typedef typename Base::Bound Bound; typedef typename Base::Coefficient Coefficient; - + public: - Rational_function_canonicalized_pair_rep(const Rational_function& f, + Rational_function_canonicalized_pair_rep(const Rational_function& f, const Rational_function& g, Algebraic_kernel_d_1* ak_ptr) :_f(f),_g(g),_ak_ptr(ak_ptr) { CGAL_precondition(_ak_ptr != nullptr); //canonicalized representation - if ( !(f.id() < g.id()) ) + if ( !(f.id() < g.id()) ) std::swap(_f,_g); _resultant = (_f.numer() * _g.denom() - _f.denom() * _g.numer()); //f and g are not the same... CGAL_precondition(CGAL::is_zero(_resultant) == false); - - Solve_1 solve_1(_ak_ptr->solve_1_object()); + + Solve_1 solve_1(_ak_ptr->solve_1_object()); Root_multiplicity_vector rm_vec; - + #if 1 solve_1(_resultant,std::back_inserter(rm_vec)); #else @@ -81,9 +81,9 @@ class Rational_function_canonicalized_pair_rep: _roots.reserve(rm_vec.size()); _multiplicities.reserve(rm_vec.size()); - + for (typename Root_multiplicity_vector::iterator it = rm_vec.begin(); - it != rm_vec.end() ; + it != rm_vec.end() ; ++it) { _roots.push_back(it->first); @@ -100,7 +100,7 @@ class Rational_function_canonicalized_pair_rep: std::merge(tmp.begin(), tmp.end(), _roots.begin(), _roots.end(), std::back_inserter(_event_roots)); - + //remove duplicate entries typename Algebraic_vector::iterator new_end,old_end; new_end = std::unique(_event_roots.begin(), old_end=_event_roots.end()); @@ -128,16 +128,16 @@ class Rational_function_canonicalized_pair_rep: _g.pole_multiplicities().begin(); typename Algebraic_vector ::const_iterator it_r_root = _roots.begin(); typename Multiplicity_vector::const_iterator it_r_mult = - _multiplicities.begin() ; - while ( (it_f_pole != _f.poles().end()) || - (it_g_pole != _g.poles().end()) || + _multiplicities.begin() ; + while ( (it_f_pole != _f.poles().end()) || + (it_g_pole != _g.poles().end()) || (it_r_root != _roots.end())) { //std::cout << "_f._poles.size() " << _f._poles.size() < tmp_is_above = compute_is_above_explicitly(); ); - CGAL_postcondition(_is_above == tmp_is_above); + CGAL_postcondition(_is_above == tmp_is_above); } Comparison_result compare_f_g_at(const Algebraic_real_1& x, CGAL::Sign epsilon = CGAL::ZERO) const { - //f and g must be different + //f and g must be different CGAL_precondition(!CGAL::is_zero(_resultant)); - //find interval + //find interval typename Algebraic_vector::const_iterator iter = std::lower_bound(_event_roots.begin(), _event_roots.end(),x); - + //case of a value larger than largest root if (iter == _event_roots.end()) return (_is_above.back() ? CGAL:: LARGER : CGAL::SMALLER); @@ -226,12 +226,12 @@ class Rational_function_canonicalized_pair_rep: typename Algebraic_vector::iterator::difference_type dist = iter - _event_roots.begin(); - //if x is not a root, ignore epsilons + //if x is not a root, ignore epsilons if (*iter != x){ return (_is_above[dist] ? CGAL:: LARGER : CGAL::SMALLER); } - //x is a root + //x is a root if (epsilon == CGAL::ZERO){ CGAL_precondition(_f.poles().end() == std::find(_f.poles().begin(), _f.poles().end(),x)); @@ -239,7 +239,7 @@ class Rational_function_canonicalized_pair_rep: std::find(_g.poles().begin(), _g.poles().end(),x)); return (CGAL::EQUAL); } - + if (epsilon == CGAL::NEGATIVE) return (_is_above[dist] ? CGAL:: LARGER : CGAL::SMALLER); else // CGAL::POSITIVE @@ -249,7 +249,7 @@ class Rational_function_canonicalized_pair_rep: { CGAL_precondition((boundary == ARR_LEFT_BOUNDARY) || (boundary == ARR_RIGHT_BOUNDARY) ); - + //f and g are the same... if (CGAL::is_zero(_resultant)) return CGAL::EQUAL; @@ -270,32 +270,32 @@ class Rational_function_canonicalized_pair_rep: //get left index typename Algebraic_vector::const_iterator left_index = - (left_parameter_space == ARR_LEFT_BOUNDARY) ? + (left_parameter_space == ARR_LEFT_BOUNDARY) ? _event_roots.begin(): std::lower_bound(_event_roots.begin(), _event_roots.end(),left); //check if intersect at left index - if (*left_index == left) + if (*left_index == left) return true; //get right index typename Algebraic_vector::const_iterator right_index = - (right_parameter_space == ARR_RIGHT_BOUNDARY) ? + (right_parameter_space == ARR_RIGHT_BOUNDARY) ? _event_roots.begin(): std::lower_bound(_event_roots.begin(), _event_roots.end(),right); //check if intersect at right index - if (*right_index == right) + if (*right_index == right) return true; - + //check if indices are the same return (left_index == right_index); } - const Rational_function& f() const + const Rational_function& f() const { return _f; } - const Rational_function& g() const + const Rational_function& g() const { return _g; } @@ -315,7 +315,7 @@ class Rational_function_canonicalized_pair_rep: { bool r = _get_is_above_near_minus_infinity(); CGAL_postcondition(r == __get_is_above_near_minus_infinity()); - return r; + return r; } bool _get_is_above_near_minus_infinity() @@ -337,8 +337,8 @@ class Rational_function_canonicalized_pair_rep: (sign == CGAL::POSITIVE) ? false : (_f.sign_near_minus_infinity() == CGAL::POSITIVE); // _g == zero; } - - //both have the same degree difference, + + //both have the same degree difference, //check who's leading coeeficient ratio is larger Coefficient lead_coeff_ratio = CGAL::abs(CGAL::leading_coefficient(_f.numer())) * @@ -374,11 +374,11 @@ class Rational_function_canonicalized_pair_rep: // // numer_f * denom _g - numer_f * denom _g //f-g= -------------------------------------- at b - // denom _f * denom _g + // denom _f * denom _g //TODO: unnescecary construction of real Algebraic_real_1 x(_ak_ptr->construct_algebraic_real_1_object()(b)); - + CGAL::Sign numer = _ak_ptr->sign_at_1_object()(_resultant, x); CGAL::Sign denom_f = _ak_ptr->sign_at_1_object()(_f.denom(),x); CGAL::Sign denom_g = _ak_ptr->sign_at_1_object()(_g.denom(),x); @@ -395,22 +395,22 @@ class Rational_function_canonicalized_pair_rep: if (_event_roots.size()== 0) { Bound b = 1; //all bound are legal, choose 1 for simplicity - tmp_is_above.push_back(is_above_at(b)); + tmp_is_above.push_back(is_above_at(b)); return tmp_is_above; } - - tmp_is_above.reserve(_event_roots.size()+1); + + tmp_is_above.reserve(_event_roots.size()+1); //left boundary Bound b = (_ak_ptr->approximate_relative_1_object() (_event_roots.front(),0)).first - 1; //lower bound of first root - tmp_is_above.push_back(is_above_at(b)); - + tmp_is_above.push_back(is_above_at(b)); + //mid intervals typename Algebraic_vector::size_type i; for (i = 0; i < _event_roots.size()-1; ++i) { b = _ak_ptr->bound_between_1_object()(_event_roots[i],_event_roots[i+1]); - tmp_is_above.push_back(is_above_at(b)); + tmp_is_above.push_back(is_above_at(b)); } //right boundary @@ -418,8 +418,8 @@ class Rational_function_canonicalized_pair_rep: tmp_is_above.push_back(is_above_at(b)); return tmp_is_above; } - -private: + +private: Rational_function _f,_g; Polynomial_1 _resultant; Algebraic_vector _roots; @@ -450,7 +450,7 @@ class Rational_function_canonicalized_pair: typedef typename Rep::Multiplicity_vector Multiplicity_vector; typedef typename Rep::Root_multiplicity_vector Root_multiplicity_vector; - Rational_function_canonicalized_pair(const Rational_function& f, + Rational_function_canonicalized_pair(const Rational_function& f, const Rational_function& g, Algebraic_kernel_d_1* ak_ptr) : Base(f, g, ak_ptr) {} @@ -477,13 +477,13 @@ class Rational_function_canonicalized_pair: return this->ptr()->is_intersecting_in_range(left_parameter_space, left, right_parameter_space, right); } - - const Rational_function& f() const + + const Rational_function& f() const { return this->ptr()->f(); } - - const Rational_function& g() const + + const Rational_function& g() const { return this->ptr()->g(); } @@ -500,6 +500,6 @@ class Rational_function_canonicalized_pair: }; //Rational_function_canonicalized_pair } //namespace Arr_rational_arc -} //namespace CGAL { +} //namespace CGAL { #endif //CGAL_RATIONAL_FUNCTION_CANONICALIZED_PAIR_H diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_ordered_pair.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_ordered_pair.h index e7073b7b955c..6c10eb96cab0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_ordered_pair.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_ordered_pair.h @@ -42,13 +42,13 @@ class Rational_function_ordered_pair: typedef typename Base::Multiplicity Multiplicity; typedef typename Base::Multiplicity_vector Multiplicity_vector; typedef typename Base::Root_multiplicity_vector Root_multiplicity_vector; - + public: Rational_function_ordered_pair(const Rational_function_pair& rat_pair, bool is_opposite = false) : _rat_pair(rat_pair), _is_opposite(is_opposite) {} - + Comparison_result compare_f_g_at(const Algebraic_real_1& x, CGAL::Sign epsilon = CGAL::ZERO) { @@ -89,13 +89,13 @@ class Rational_function_ordered_pair: return _rat_pair.multiplicities(); } -private: +private: const Rational_function_pair& _rat_pair; bool _is_opposite; }; // Rational_function_ordered_pair } //namespace Arr_rational_arc -} //namespace CGAL { +} //namespace CGAL { #endif //CGAL_RATIONAL_FUNCTION_ORDERED_PAIR_H diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_pair.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_pair.h index 188d878d568b..516daf95b82c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_pair.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_pair.h @@ -42,24 +42,24 @@ class Rational_function_pair: typedef typename Base::Multiplicity Multiplicity; typedef typename Base::Multiplicity_vector Multiplicity_vector; typedef typename Base::Root_multiplicity_vector Root_multiplicity_vector; - + public: Rational_function_pair(const Rational_function_canonicalized_pair& rat_pair, bool is_opposite = false) : _rat_pair(rat_pair), _is_opposite(is_opposite) {} - + Comparison_result compare_f_g_at(const Algebraic_real_1& x , CGAL::Sign epsilon = CGAL::ZERO) { Comparison_result cr = _rat_pair.compare_f_g_at(x,epsilon); - return (_is_opposite) ? -cr : cr ; + return (_is_opposite) ? -cr : cr ; } Comparison_result compare_f_g_at(Arr_parameter_space boundary) { Comparison_result cr = _rat_pair.compare_f_g_at(boundary); - return (_is_opposite) ? -cr : cr ; + return (_is_opposite) ? -cr : cr ; } bool is_intersecting_in_range(const Arr_parameter_space left_parameter_space, @@ -81,13 +81,13 @@ class Rational_function_pair: return _rat_pair.multiplicities(); } -private: +private: const Rational_function_canonicalized_pair& _rat_pair; bool _is_opposite; }; // Rational_function_pair } //namespace Arr_rational_arc -} //namespace CGAL { +} //namespace CGAL { #endif //CGAL_RATIONAL_FUNCTION_ORDERED_PAIR_H diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h index 7abbae49ac69..9334a3c98bff 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h @@ -26,14 +26,14 @@ template class Singleton { public: - static T* instance() + static T* instance() { - if(!m_pInstance) + if(!m_pInstance) m_pInstance = new T; CGAL_assertion(m_pInstance !=nullptr); return m_pInstance; } - + static void DestroyInstance() { delete m_pInstance; @@ -49,5 +49,5 @@ class Singleton template T* Singleton::m_pInstance=nullptr; } // namespace Arr_rational_arc -} //namespace CGAL { +} //namespace CGAL { #endif // CGAL_SINGLETON_H_ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h index 44a353d039cc..bff77f5f588b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h @@ -34,20 +34,20 @@ namespace CGAL { * A traits class for maintaining an arrangement of bounded arcs (segments) of * rational functions of arbitrary degree. * - * The class is templated with two parameters: + * The class is templated with two parameters: * Alg_kernel A geometric kernel, where Alg_kernel::FT is the number type * for the coordinates of arrangement vertices, which are algebraic * numbers (defined by Nt_traits::Algebraic). * Nt_traits A traits class for performing various operations on the integer, - * rational and algebraic types. + * rational and algebraic types. */ - + template class Arr_rational_function_traits_2 { public: typedef AlgebraicKernel_d_1 Algebraic_kernel_d_1; - + typedef Arr_rational_function_traits_2 Self; typedef Arr_rational_arc::Base_rational_arc_ds_1 @@ -68,18 +68,18 @@ class Arr_rational_function_traits_2 typedef typename Base_curve_2::Rat_vector Rat_vector; typedef typename Base_rational_arc_ds_1::Integer Integer; - typedef typename Base_rational_arc_ds_1::Rational Rational; - typedef typename Base_rational_arc_ds_1::Polynomial_1 Polynomial_1; - typedef typename Base_rational_arc_ds_1::Coefficient Coefficient; + typedef typename Base_rational_arc_ds_1::Rational Rational; + typedef typename Base_rational_arc_ds_1::Polynomial_1 Polynomial_1; + typedef typename Base_rational_arc_ds_1::Coefficient Coefficient; - typedef typename Base_rational_arc_ds_1::FT_rat_1 FT_rat_1; + typedef typename Base_rational_arc_ds_1::FT_rat_1 FT_rat_1; typedef typename Base_rational_arc_ds_1::Polynomial_traits_1 Polynomial_traits_1; - - typedef typename Algebraic_kernel_d_1::Bound Bound; + + typedef typename Algebraic_kernel_d_1::Bound Bound; typedef Bound - Approximate_number_type; - + Approximate_number_type; + typedef CGAL::Arr_rational_arc::Rational_function Rational_function; typedef CGAL::Arr_rational_arc::Cache Cache; @@ -107,7 +107,7 @@ class Arr_rational_function_traits_2 bool delete_ak_internal_flag() const { return delete_ak; - } + } // Algebraic_kernel_d_1& algebraic_kernel_d_1() {return _ak;} public: @@ -139,7 +139,7 @@ class Arr_rational_function_traits_2 if (delete_ak) _ak_ptr = new Algebraic_kernel_d_1(*other.algebraic_kernel_d_1()); else - _ak_ptr = other.algebraic_kernel_d_1(); + _ak_ptr = other.algebraic_kernel_d_1(); //copy cache _cache.initialize(other.cache(), _ak_ptr); @@ -167,9 +167,9 @@ class Arr_rational_function_traits_2 Construct_x_monotone_curve_2(const Traits* traits) : _traits(traits) {} friend class Arr_rational_function_traits_2; - + public: - typedef typename Base_rational_arc_ds_1::Polynomial_1 Polynomial_1; + typedef typename Base_rational_arc_ds_1::Polynomial_1 Polynomial_1; typedef typename Base_rational_arc_ds_1::Algebraic_real_1 Algebraic_real_1; typedef Arr_rational_arc::Continuous_rational_arc_d_1 @@ -178,7 +178,7 @@ class Arr_rational_function_traits_2 typedef Polynomial_1 first_argument_type; typedef Polynomial_1 second_argument_type; typedef X_monotone_curve_2 result_type; - + X_monotone_curve_2 operator()( const Polynomial_1& P) const { return X_monotone_curve_2(P, _traits->cache()); @@ -224,7 +224,7 @@ class Arr_rational_function_traits_2 } X_monotone_curve_2 operator()(const Polynomial_1& P, - const Polynomial_1& Q) const + const Polynomial_1& Q) const { return X_monotone_curve_2(P, Q, _traits->cache()); } @@ -233,7 +233,7 @@ class Arr_rational_function_traits_2 X_monotone_curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, InputIterator begin_denom, - InputIterator end_denom) const + InputIterator end_denom) const { Rat_vector rat_vec_numer(begin_numer,end_numer); Rat_vector rat_vec_denom(begin_denom,end_denom); @@ -305,9 +305,9 @@ class Arr_rational_function_traits_2 Construct_curve_2(const Traits* traits) : _traits(traits) {} friend class Arr_rational_function_traits_2; - + public: - typedef typename Base_rational_arc_ds_1::Polynomial_1 Polynomial_1; + typedef typename Base_rational_arc_ds_1::Polynomial_1 Polynomial_1; typedef typename Base_rational_arc_ds_1::Algebraic_real_1 Algebraic_real_1; typedef Arr_rational_arc::Rational_arc_d_1 @@ -316,7 +316,7 @@ class Arr_rational_function_traits_2 typedef Polynomial_1 first_argument_type; typedef Polynomial_1 second_argument_type; typedef Curve_2 result_type; - + Curve_2 operator()(const Polynomial_1& P) const { return Curve_2(P, _traits->cache()); @@ -359,14 +359,14 @@ class Arr_rational_function_traits_2 return Curve_2(rat_vec, x_s, x_t, _traits->cache()); } - Curve_2 operator()(const Polynomial_1& P, const Polynomial_1& Q) const + Curve_2 operator()(const Polynomial_1& P, const Polynomial_1& Q) const { return Curve_2(P, Q, _traits->cache()); } template Curve_2 operator()(InputIterator begin_numer, InputIterator end_numer, - InputIterator begin_denom, InputIterator end_denom) const + InputIterator begin_denom, InputIterator end_denom) const { Rat_vector rat_vec_numer(begin_numer, end_numer); Rat_vector rat_vec_denom(begin_denom, end_denom); @@ -430,26 +430,26 @@ class Arr_rational_function_traits_2 Construct_point_2(const Traits* traits) : _traits(traits) {} friend class Arr_rational_function_traits_2; - + public: Point_2 operator()(const Rational_function& rational_function, const Algebraic_real_1& x_coordinate) - { + { return Point_2(rational_function, x_coordinate); } Point_2 operator()(const Rational& x, const Rational& y) - { + { Integer y_numer,y_denom; typename FT_rat_1::Decompose()(y,y_numer,y_denom); - + return Point_2(_traits->cache().get_rational_function(Rational(y_numer, y_denom)), _traits->algebraic_kernel_d_1()-> construct_algebraic_real_1_object()(x)); } Point_2 operator()(const Algebraic_real_1& x, const Rational& y) - { + { Integer y_numer; Integer y_denom; typename FT_rat_1::Decompose()(y, y_numer, y_denom); @@ -473,17 +473,17 @@ class Arr_rational_function_traits_2 // Construct_vertical_segment(Cache& cache) : _cache(cache) {} // Vertical_segment operator()(const Point_2& p) const -// { +// { // return Vertical_segment(p); // } // Vertical_segment operator()(const Point_2& p, bool is_directed_up) const -// { +// { // return Vertical_segment(p, is_directed_up); // } // Vertical_segment operator()(const Point_2& p1,const Point_2& p2) const -// { +// { // return Vertical_segment(p1, p2, _cache); // } // }; //Construct_vertical_segment @@ -498,7 +498,7 @@ class Arr_rational_function_traits_2 //------------------------ //--------------------------------------------------------------- - //A functor that compares the x-coordinates of two points + //A functor that compares the x-coordinates of two points class Compare_x_2 { public: @@ -549,7 +549,7 @@ class Arr_rational_function_traits_2 * SMALLER if x(p1) < x(p2), or if x(p1) = x(p2) and y(p1) < y(p2); * EQUAL if the two points are equal. */ - Comparison_result operator()(const Point_2& p1, const Point_2& p2) const + Comparison_result operator()(const Point_2& p1, const Point_2& p2) const { return p1.compare_xy_2(p2, _traits->cache()); } @@ -741,7 +741,7 @@ class Arr_rational_function_traits_2 cv2.right_parameter_space_in_y() != ARR_INTERIOR || (p.x() < cv2.right().x()))); - + // Compare the two arcs. return cv1.compare_at_intersection (cv2,p,false,_cache); } @@ -768,7 +768,7 @@ class Arr_rational_function_traits_2 Equal_2(const Traits* traits) : _traits(traits) {} friend class Arr_rational_function_traits_2; - + public: /*! * Check if the two x-monotone curves are the same (have the same graph). @@ -814,7 +814,7 @@ class Arr_rational_function_traits_2 public: /*! - * Cut the given conic curve (or conic arc) into x-monotone subcurves + * Cut the given conic curve (or conic arc) into x-monotone subcurves * and insert them to the given output iterator. * \param cv The curve. * \param oi The output iterator, whose value-type is Object. The returned @@ -822,7 +822,7 @@ class Arr_rational_function_traits_2 * \return The past-the-end iterator. */ template - OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const + OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { // Make the rational arc continuous. std::list arcs; @@ -942,7 +942,7 @@ class Arr_rational_function_traits_2 /*! The traits (in case it has state) */ const Traits* m_traits; - + /*! Constructor * \param traits the traits (in case it has state) */ @@ -1015,7 +1015,7 @@ class Arr_rational_function_traits_2 /*! Obtain a Parameter_space_in_x_2 function object */ Parameter_space_in_x_2 parameter_space_in_x_2_object() const { return Parameter_space_in_x_2(); } - + /*! A function object that obtains the parameter space of a geometric * entity along the y-axis */ @@ -1074,7 +1074,7 @@ class Arr_rational_function_traits_2 * \return the comparison result: * SMALLER - x(p) < x(xc, ce); * EQUAL - x(p) = x(xc, ce); - * LARGER - x(p) > x(xc, ce). + * LARGER - x(p) > x(xc, ce). * \pre p lies in the interior of the parameter space. * \pre the ce end of the line xcv lies on a boundary. */ @@ -1083,9 +1083,9 @@ class Arr_rational_function_traits_2 Arr_curve_end ce) const { Comparison_result r = xcv.compare_end(ce, p); - if (r == EQUAL) - return EQUAL; - return (r == NEGATIVE) ? POSITIVE : NEGATIVE ; + if (r == EQUAL) + return EQUAL; + return (r == NEGATIVE) ? POSITIVE : NEGATIVE ; } /*! Compare the x-coordinates of 2 arcs ends near the boundary of the @@ -1117,12 +1117,12 @@ class Arr_rational_function_traits_2 /*! Obtain a Compare_x_near_boundary_2 function object */ Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const { return Compare_x_near_boundary_2(); } - + /*! A function object that compares the y-coordinates of arc ends near the * boundary of the parameter space. */ - class Compare_y_near_boundary_2 + class Compare_y_near_boundary_2 { private: Cache& _cache; @@ -1152,7 +1152,7 @@ class Arr_rational_function_traits_2 Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const { return Compare_y_near_boundary_2(_cache); } - + /*! A function object that compares at limit */ //new functor @@ -1160,11 +1160,11 @@ class Arr_rational_function_traits_2 { public: /*! Compares the x coordinate of p with the curve end - * of xcv that is defined by ce at its limit. + * of xcv that is defined by ce at its limit. * Returns SMALLER, EQUAL, or LARGER accordingly. */ Comparison_result operator()(const Point_2& p, - const X_monotone_curve_2& xcv, + const X_monotone_curve_2& xcv, Arr_curve_end ce) { CGAL_precondition(Parameter_space_in_x_2()(xcv,ce) == ARR_INTERIOR); @@ -1172,14 +1172,14 @@ class Arr_rational_function_traits_2 return CGAL::compare(p.x(), (ce == ARR_MIN_END) ? xcv.left_x() : xcv.right_x()); } - /*! Compares the curve end of xcv1 that is defined by ce1 + /*! Compares the curve end of xcv1 that is defined by ce1 * with the curve end of xcv2 that is defined by ce2 - * at their limits in x. + * at their limits in x. * Returns SMALLER, EQUAL, or LARGER accordingly. */ - Comparison_result operator()(const X_monotone_curve_2& xcv1, + Comparison_result operator()(const X_monotone_curve_2& xcv1, Arr_curve_end ce1, - const X_monotone_curve_2& xcv2, + const X_monotone_curve_2& xcv2, Arr_curve_end ce2) { CGAL_precondition(Parameter_space_in_x_2()(xcv1,ce1) == ARR_INTERIOR); @@ -1197,10 +1197,10 @@ class Arr_rational_function_traits_2 Compare_x_at_limit_2 compare_x_at_limit_2_object() const { return Compare_x_at_limit_2(); } //@} - + /// \name Functor definitions for the Boolean set-operation traits. //@{ - + //new functor class Compare_x_near_limit_2 { @@ -1209,13 +1209,13 @@ class Arr_rational_function_traits_2 public: Compare_x_near_limit_2(Cache& cache) : _cache(cache) {} - /*! Compares the curve end of xcv1 that is defined by ce1 + /*! Compares the curve end of xcv1 that is defined by ce1 * with the curve end of xcv2 that is defined by ce2 - * at their limits in x. + * at their limits in x. * Returns SMALLER, EQUAL, or LARGER accordingly. */ - Comparison_result operator()( const X_monotone_curve_2& xcv1, - const X_monotone_curve_2& xcv2, + Comparison_result operator()( const X_monotone_curve_2& xcv1, + const X_monotone_curve_2& xcv2, Arr_curve_end ce) const { return xcv1.compare_near_end(xcv2,ce,_cache); @@ -1278,23 +1278,23 @@ class Arr_rational_function_traits_2 class Approximate_2{ Approximate_number_type approx_x(const Point_2& p){ return Approximate_number_type(p.x().lower()); - } + } Approximate_number_type approx_y(const Point_2& p){ typedef typename Algebraic_kernel_d_1::Polynomial_1 Polynomial_1; - typename CGAL::Coercion_traits::Cast cast; + typename CGAL::Coercion_traits::Cast cast; return cast(p.rational_function().numer()).evaluate(p.x().lower())/ cast(p.rational_function().denom()).evaluate(p.x().lower()); } public: Approximate_number_type operator()(const Point_2& p, int i){ - if(i==0) return approx_x(p); + if(i==0) return approx_x(p); if(i==1) return approx_y(p); CGAL_assertion(false); return Approximate_number_type(0); } }; - + Approximate_2 approximate_2_object() const { return Approximate_2(); } void cleanup_cache() const diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h index e7a5ecb726c8..cac0d12eb09b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Eyal Flato) @@ -67,7 +67,7 @@ class Arr_simple_point_location { typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; // Data members: - const Arrangement_2* m_arr; // The associated arrangement. + const Arrangement_2* m_arr; // The associated arrangement. const Traits_adaptor_2* m_geom_traits; // Its associated geometry traits. const Topology_traits* m_topol_traits; // Its associated topology traits. @@ -78,7 +78,7 @@ class Arr_simple_point_location { inline bool optional_empty(const boost::optional& t) const { return (!t); } inline const Result_type& optional_assign(const boost::optional& t) const { return *t; } #endif - + template Result_type make_result(T t) const { return Result::make_result(t); } inline Optional_result_type make_optional_result() const { return Result::empty_optional_result(); } @@ -86,12 +86,12 @@ class Arr_simple_point_location { public: /*! Default constructor. */ - Arr_simple_point_location() : + Arr_simple_point_location() : m_arr(nullptr), m_geom_traits(nullptr), m_topol_traits(nullptr) {} - + /*! Constructor given an arrangement. */ Arr_simple_point_location(const Arrangement_2& arr) : m_arr(&arr) @@ -102,7 +102,7 @@ class Arr_simple_point_location { } /*! Attach an arrangement object. */ - void attach(const Arrangement_2& arr) + void attach(const Arrangement_2& arr) { m_arr = &arr; m_geom_traits = @@ -117,7 +117,7 @@ class Arr_simple_point_location { m_geom_traits = nullptr; m_topol_traits = nullptr; } - + /*! * Locate the arrangement feature containing the given point. * \param p The query point. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_on_sphere_transformation.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_on_sphere_transformation.h index eb84c1375d08..bdb8f33c95f1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_on_sphere_transformation.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_on_sphere_transformation.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Naama mayer #ifndef CGAL_ARR_ON_SPHERE_TRANSFORMATION_H @@ -22,10 +22,10 @@ namespace CGAL { template class Arr_on_sphere_transformation { - void rotate_face(Arrangement & arr, Face_Handle f1, Face_handle f2) - { + void rotate_face(Arrangement & arr, Face_Handle f1, Face_handle f2) + { - } + } }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h index d427de4fc793..30d021610460 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h @@ -708,7 +708,7 @@ class Arr_polyhedral_sgm : // template // void minkowski_sum(SgmIterator begin, SgmIterator end) // { - //typename SgmIterator::value_type* sgm1 = *begin++; + //typename SgmIterator::value_type* sgm1 = *begin++; // typename SgmIterator::value_type* sgm2 = *begin; // minkowski_sum(sgm1, sgm2); // } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_arr_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_arr_dcel.h index 2748e2c8d9a5..e491479ff038 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_arr_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_arr_dcel.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s): Efi Fogel // Naama mayer @@ -38,11 +38,11 @@ class Arr_polyhedral_sgm_arr_halfedge : /*! A mask of the ids of the original arrangements that contributed the * halfedge while performing the minkowski sum. * \todo This should be made optional. It is relevant only if the polytope - * is the result of a Minkowski sum operation, and it is needed only by the + * is the result of a Minkowski sum operation, and it is needed only by the * drawing routines. */ unsigned int m_arr_mask; - + public: /*! Constructor */ Arr_polyhedral_sgm_arr_halfedge() : m_arr_mask(0x0) {} @@ -82,7 +82,7 @@ class Arr_polyhedral_sgm_arr_face : public CGAL::Arr_face_base { public: /*! Constructor */ Arr_polyhedral_sgm_arr_face() : m_is_set(false) { } - + /*! Set the 3D point of the original polyhedron */ void set_point(const Point_3 & point) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_initializer_visitor.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_initializer_visitor.h index 1f56d5285096..3aacafcc047f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_initializer_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_initializer_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Efi Fogel @@ -37,7 +37,7 @@ class Arr_polyhedral_sgm_initializer_visitor { /*! Destructor */ virtual ~Arr_polyhedral_sgm_initializer_visitor() {} - + /*! Pass information from a polyhedron vertex to its dual - a sgm-face */ virtual void update_dual_vertex(Polyhedron_vertex_const_handle /*src*/, Sgm_face_handle /*trg*/) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_overlay.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_overlay.h index 448f4e3e0e6b..12f39c086140 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_overlay.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_overlay.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Efi Fogel #ifndef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_H @@ -27,7 +27,7 @@ class Arr_polyhedral_sgm_overlay { private: typedef typename Sgm::Point_3 Point_3; typedef typename Sgm::Vector_3 Vector_3; - + public: typedef typename Sgm::Face_handle Face_handle; typedef typename Sgm::Vertex_handle Vertex_handle; @@ -37,12 +37,12 @@ class Arr_polyhedral_sgm_overlay { typedef typename Sgm::Vertex_const_handle Vertex_const_handle; typedef typename Sgm::Halfedge_const_handle Halfedge_const_handle; - typedef typename Sgm::Ccb_halfedge_const_circulator + typedef typename Sgm::Ccb_halfedge_const_circulator Ccb_halfedge_const_circulator; typedef typename Sgm::Halfedge_around_vertex_const_circulator Arr_halfedge_around_vertex_const_circulator; - + /*! 1 */ void create_face(Face_const_handle f1, Face_const_handle f2, Face_handle f) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_traits.h index f290d953bcf0..a09c7661722c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Efi Fogel diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_transformation.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_transformation.h index ec7bb51ebef8..05ebbc15e61f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_transformation.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_transformation.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Naama mayer @@ -28,7 +28,7 @@ class Arr_polyhedral_sgm_transformation typedef typename Arrangement::Face_handle Face_handle; void rotate_face(Face_handle f, const Transformation_3 & aff) - { + { //Transform all the vertices of the original polyhedron. f->set_point(aff.transform(f->point())); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h index f28d01bad53f..d7d20809e103 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s): Efi Fogel // Naama mayer @@ -60,7 +60,7 @@ class Sgm_normalizer { /*! Normalize the coordinates of the given point, but in fact does * nothing. * \param p the point which coordinates are to be normalized - */ + */ void operator()(Point_2 &) {} }; @@ -113,7 +113,7 @@ class Arr_sgm_initializer { /*! Destructor */ virtual ~Arr_sgm_initializer() {} - + /*! Insert a great arc whose angle is less than Pi and is represented by two * normals into the SGM. Each normal defines an end point of the greate arc. * \param normal1 represents the source normal. @@ -138,7 +138,7 @@ class Arr_sgm_initializer { oi = traits->make_x_monotone_2_object()(cv, oi); return oi; } - + /*! Insert a great arc whose angle is less than Pi and is represented by two * normals into the SGM. Each normal defines an end point of the greate arc. * \param normal1 represents the source normal. @@ -172,7 +172,7 @@ class Arr_sgm_initializer { std::cout << "1.b. insert_from_vertex(" << *xc << ")" << std::endl; #endif *oi++ = (xc->is_directed_right()) ? - m_sgm.insert_from_left_vertex(*xc, he->target()) : + m_sgm.insert_from_left_vertex(*xc, he->target()) : m_sgm.insert_from_right_vertex(*xc, he->target()); return oi; } @@ -227,7 +227,7 @@ class Arr_sgm_initializer { * represented by normal1 toward the endpoint represented by normal2 */ template - OutputIterator insert(const Vector_3 & normal1, + OutputIterator insert(const Vector_3 & normal1, const Vector_3 & normal2, Vertex_handle vertex2, OutputIterator oi) { @@ -333,14 +333,14 @@ class Arr_spherical_gaussian_map_3 : { private: typedef Arr_spherical_gaussian_map_3 Self; - + public: typedef T_Traits Traits; typedef Traits Geometry_traits_2; - - typedef Arrangement_on_surface_2 > > - Base; + + typedef Arrangement_on_surface_2 > > + Base; /*! Parameter-less Constructor */ Arr_spherical_gaussian_map_3() { } @@ -362,7 +362,7 @@ class Arr_spherical_gaussian_map_3 : { CGAL_error_msg( "Not implemented yet!"); } - + /*! returns true if the representation is empty */ bool is_empty() const { @@ -380,7 +380,7 @@ class Arr_spherical_gaussian_map_3 : return vh->degree(); } #endif - + /*! Print statistics */ void print_stat() { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h index 793f97441b10..1cf5b88058cb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Naama mayer @@ -34,10 +34,10 @@ void Arr_transform_on_sphere(Arrangement & arr, { typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; typedef typename Arrangement::Topology_traits Topology_traits; - + typedef typename Geometry_traits_2::Curve_2 Curve_2; typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; - + typedef typename Arrangement::Vertex_handle Vertex_handle; typedef typename Arrangement::Halfedge_handle Halfedge_handle; typedef typename Arrangement::Face_handle Face_handle; @@ -49,31 +49,31 @@ void Arr_transform_on_sphere(Arrangement & arr, Topology_traits * topol_traits = arr.topology_traits(); Arr_accessor m_arr_access(arr); - - // Preprocessing loop - merge all the edges that were splited + + // Preprocessing loop - merge all the edges that were splited // (meaning have a common endpoint that lies on the boundary and their degree // is 2) on the identification curve. for (Vertex_handle vi1 = arr.vertices_begin() ; vi1 != arr.vertices_end() ;) - { + { Vertex_handle v_temp = vi1; ++vi1; - + Arr_parameter_space bx = geom_traits->parameter_space_in_x_2_object()(v_temp->point()); Arr_parameter_space by = geom_traits->parameter_space_in_y_2_object()(v_temp->point()); - + // use vertex->parameter_space_in_x() != interior || vertex->parameter_space_in_y() != interior) if ((bx != ARR_INTERIOR || by != ARR_INTERIOR) && (v_temp->degree() == 2)) { Curve_2 merged_cv; - Halfedge_around_vertex_circulator havc = v_temp->incident_halfedges(); + Halfedge_around_vertex_circulator havc = v_temp->incident_halfedges(); Halfedge_around_vertex_circulator havc_next = havc; ++havc_next; // Compare the normals bool normal_eq1 = havc->curve().normal() == - havc_next->twin()->curve().normal(); + havc_next->twin()->curve().normal(); // Compare the points bool point_eq1 = havc->target()->point() == havc_next->twin()->source()->point(); @@ -85,7 +85,7 @@ void Arr_transform_on_sphere(Arrangement & arr, if (havc->source()->point() == havc->curve().source()) { merged_cv = Curve_2(havc->source()->point(), - havc_next->twin()->target()->point(), + havc_next->twin()->target()->point(), havc->curve().normal()); } else if (havc->source()->point() == havc->curve().target()) @@ -94,10 +94,10 @@ void Arr_transform_on_sphere(Arrangement & arr, havc->source()->point(), havc->curve().normal()); } - else + else CGAL_error_msg ("One of the edge points should be equal to the surce points"); - + // Erases the point from the list of boundary vertices (This is a // different data structute than the DCEL, which is handled by the // next call.) @@ -105,7 +105,7 @@ void Arr_transform_on_sphere(Arrangement & arr, // Merge the edges into a single one, and delete the vertex from the // DCEL. (By default, the merge_edge() funtion deletes the vertex.) - arr.merge_edge(havc, havc_next->twin() , merged_cv); + arr.merge_edge(havc, havc_next->twin() , merged_cv); } } } @@ -113,13 +113,13 @@ void Arr_transform_on_sphere(Arrangement & arr, //Rotate all the vertices. for (Vertex_handle vi1 = arr.vertices_begin(); vi1 != arr.vertices_end() ; ++vi1) - { - m_arr_access.modify_vertex_ex(vi1, aff.transform(vi1->point())); - } - + { + m_arr_access.modify_vertex_ex(vi1, aff.transform(vi1->point())); + } + unsigned int num_of_edges = arr.number_of_edges(); Edge_iterator ei1 = arr.edges_begin(); - + // Rotate all the halfedges. // The loop is over the initial edges , since new edges are created and // added to the edges list. @@ -129,7 +129,7 @@ void Arr_transform_on_sphere(Arrangement & arr, Halfedge_handle hei1 = ei1; ++ei1; - + // Take only the halfedge that its source is equal to the source of // the curve. bool eq1 = hei1->source()->point() == aff.transform(hei1->curve().source()); @@ -138,40 +138,40 @@ void Arr_transform_on_sphere(Arrangement & arr, hei1 = hei1->twin(); eq1 = hei1->source()->point() == aff.transform(hei1->curve().source()); } - + CGAL_assertion_msg - (eq1, + (eq1, "The new curve endpoints should be equal to the transform of the original"); - + // Create a new curve instead of the old one. - new_cv = Curve_2(hei1->source()->point(), hei1->target()->point(), + new_cv = Curve_2(hei1->source()->point(), hei1->target()->point(), aff.transform(hei1->curve().normal())); // Modify the edge with the new curve. m_arr_access.modify_edge_ex(hei1, new_cv); std::list objects; - // Try to split the curve into x_monotone pieces. + // Try to split the curve into x_monotone pieces. geom_traits->make_x_monotone_2_object()(new_cv , std::back_inserter(objects)); - + // If the curve is not x-monotone - split it into 2 x_monotone parts. // Since the curves were x_monotone before , can assume that it will be // splited into 2 parts max. if (objects.size() == 2) - { + { typename std::list::iterator it = objects.begin(); - + // The curve that its left vertex lies on the identification curve const X_monotone_curve_2 * sub_cv1 = - object_cast(&(*it)); + object_cast(&(*it)); ++it; //The curve that its rigth vertex lies on the identification curve const X_monotone_curve_2 * sub_cv2 = object_cast(&(*it)); - + bool eq1 = (*sub_cv1).source() == hei1->source()->point(); bool eq2 = (*sub_cv2).target() == hei1->target()->point(); - + if (eq1 && eq2) m_arr_access.split_edge_ex (hei1, (*sub_cv1).target(), *sub_cv1, *sub_cv2); @@ -180,28 +180,28 @@ void Arr_transform_on_sphere(Arrangement & arr, ("The new curve endpoints should be equal to the original ones"); } } - + // Update all the vertices that located on the boundary after the rotation // with boundary conditions for (Vertex_handle vi = arr.vertices_begin() ; vi != arr.vertices_end() ; ++vi) - { + { Arr_parameter_space bx = geom_traits->parameter_space_in_x_2_object()(vi->point()); Arr_parameter_space by = geom_traits->parameter_space_in_y_2_object()(vi->point()); if (bx != ARR_INTERIOR || by != ARR_INTERIOR) - { + { // The target of the Halfedge_around_vertex_circulator is the relevant // point. Halfedge_around_vertex_circulator havc = vi->incident_halfedges(); - + Arr_curve_end ind; - if (geom_traits->construct_min_vertex_2_object()(havc->curve()) == vi->point()) - ind = ARR_MIN_END; - else - ind = ARR_MAX_END; + if (geom_traits->construct_min_vertex_2_object()(havc->curve()) == vi->point()) + ind = ARR_MIN_END; + else + ind = ARR_MAX_END; // Check if it was already added. if (topol_traits->discontinuity_vertex(havc->curve(), ind)== nullptr && @@ -213,11 +213,11 @@ void Arr_transform_on_sphere(Arrangement & arr, havc->curve(), ind, bx, by); m_arr_access.set_vertex_boundary(havc->target(), bx, by); - + } - } + } } - + // Transform the faces with the suitable transformation traits. for(Face_handle f1 = arr.faces_begin() ; f1 != arr.faces_end() ; ++f1) tran_tr.rotate_face(f1, aff); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tags.h b/Arrangement_on_surface_2/include/CGAL/Arr_tags.h index a35aee82c936..e916b32ed922 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tags.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tags.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s): Efi Fogel // Eric Berberich @@ -71,7 +71,7 @@ struct Arr_complete_left_side_category { Get_left_side_category< Traits, has_Left_side_category< Traits >::value >::Category Category; }; -template < class GeometryTraits_2, bool b > +template < class GeometryTraits_2, bool b > struct Validate_left_side_category {}; template < class GeometryTraits_2 > @@ -84,16 +84,16 @@ template < class GeometryTraits_2 > struct Validate_left_side_category< GeometryTraits_2, false > { template void missing__Left_side_category() - { + { T - missing__Left_side_category__assuming__Arr_oblivious_side_tag__instead; + missing__Left_side_category__assuming__Arr_oblivious_side_tag__instead; } }; //! type to provide bottom side tag (is oblivious if not existing) template < class Traits_, bool B > -struct Get_bottom_side_category { +struct Get_bottom_side_category { }; template < class Traits_ > @@ -114,11 +114,11 @@ struct Arr_complete_bottom_side_category { typedef Traits_ Traits; typedef typename - Get_bottom_side_category< Traits, has_Bottom_side_category< Traits >::value >::Category + Get_bottom_side_category< Traits, has_Bottom_side_category< Traits >::value >::Category Category; }; -template < class GeometryTraits_2, bool b > +template < class GeometryTraits_2, bool b > struct Validate_bottom_side_category {}; template < class GeometryTraits_2 > @@ -131,16 +131,16 @@ template < class GeometryTraits_2 > struct Validate_bottom_side_category< GeometryTraits_2, false > { template void missing__Bottom_side_category() - { + { T - missing__Bottom_side_category__assuming__Arr_oblivious_side_tag__instead; + missing__Bottom_side_category__assuming__Arr_oblivious_side_tag__instead; } }; //! type to provide top side tag (is oblivious if not existing) template < class Traits_, bool B > -struct Get_top_side_category { +struct Get_top_side_category { }; template < class Traits_ > @@ -164,7 +164,7 @@ struct Arr_complete_top_side_category { Get_top_side_category< Traits, has_Top_side_category< Traits >::value >::Category Category; }; -template < class GeometryTraits_2, bool b > +template < class GeometryTraits_2, bool b > struct Validate_top_side_category {}; template < class GeometryTraits_2 > @@ -177,15 +177,15 @@ template < class GeometryTraits_2 > struct Validate_top_side_category< GeometryTraits_2, false > { template void missing__Top_side_category() - { - T missing__Top_side_category__assuming__Arr_oblivious_side_tag__instead; + { + T missing__Top_side_category__assuming__Arr_oblivious_side_tag__instead; } }; //! type to provide right side tag (is oblivious if not existing) template < class Traits_, bool B > -struct Get_right_side_category { +struct Get_right_side_category { }; template < class Traits_ > @@ -206,11 +206,11 @@ struct Arr_complete_right_side_category { typedef Traits_ Traits; typedef typename - Get_right_side_category< Traits, has_Right_side_category< Traits >::value >::Category + Get_right_side_category< Traits, has_Right_side_category< Traits >::value >::Category Category; }; -template < class GeometryTraits_2, bool b > +template < class GeometryTraits_2, bool b > struct Validate_right_side_category {}; template < class GeometryTraits_2 > @@ -223,9 +223,9 @@ template < class GeometryTraits_2 > struct Validate_right_side_category< GeometryTraits_2, false > { template void missing__Right_side_category() - { + { T - missing__Right_side_category__assuming__Arr_oblivious_side_tag__instead; + missing__Right_side_category__assuming__Arr_oblivious_side_tag__instead; } }; @@ -251,7 +251,7 @@ struct Arr_not_all_sides_non_open_tag {}; /*!\brief Struct to determine whether all side tags are "oblivious" */ -template < class ArrLeftSideCategory, class ArrBottomSideCategory, +template < class ArrLeftSideCategory, class ArrBottomSideCategory, class ArrTopSideCategory, class ArrRightSideCategory > struct Arr_are_all_sides_oblivious_tag { @@ -259,49 +259,49 @@ struct Arr_are_all_sides_oblivious_tag { //! This instance's first template parameter typedef ArrLeftSideCategory Left_side_category; - + //! This instance's second template parameter typedef ArrBottomSideCategory Bottom_side_category; - + //! This instance's third template parameter typedef ArrTopSideCategory Top_side_category; - + //! This instance's fourth template parameter typedef ArrRightSideCategory Right_side_category; - + private: - + typedef boost::mpl::bool_< true > true_; typedef boost::mpl::bool_< false > false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same< Left_side_category, Arr_oblivious_side_tag >, - true_, false_ > + true_, false_ > Left_oblivious; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Bottom_side_category, Arr_oblivious_side_tag >, - true_, false_ > + true_, false_ > Bottom_oblivious; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Top_side_category, Arr_oblivious_side_tag >, - true_, false_ > + true_, false_ > Top_oblivious; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Right_side_category, Arr_oblivious_side_tag >, - true_, false_ > + true_, false_ > Right_oblivious; - + public: - + /*!\brief - * boolean tag that is Arr_all_sides_oblivious_tag if all sides are + * boolean tag that is Arr_all_sides_oblivious_tag if all sides are * oblivious, otherwise Arr_not_all_sides_oblivious_tag */ - typedef typename boost::mpl::if_< - boost::mpl::and_< Left_oblivious, Bottom_oblivious, + typedef typename boost::mpl::if_< + boost::mpl::and_< Left_oblivious, Bottom_oblivious, Top_oblivious, Right_oblivious >, Arr_all_sides_oblivious_tag, Arr_not_all_sides_oblivious_tag >::type result; @@ -310,7 +310,7 @@ struct Arr_are_all_sides_oblivious_tag { /*!\brief Struct to determine whether all side tags are "non-open" */ -template < class ArrLeftSideCategory, class ArrBottomSideCategory, +template < class ArrLeftSideCategory, class ArrBottomSideCategory, class ArrTopSideCategory, class ArrRightSideCategory > struct Arr_are_all_sides_non_open_tag { @@ -318,51 +318,51 @@ struct Arr_are_all_sides_non_open_tag { //! This instance's first template parameter typedef ArrLeftSideCategory Left_side_category; - + //! This instance's second template parameter typedef ArrBottomSideCategory Bottom_side_category; - + //! This instance's third template parameter typedef ArrTopSideCategory Top_side_category; - + //! This instance's fourth template parameter typedef ArrRightSideCategory Right_side_category; - + private: - + typedef boost::mpl::bool_< true > true_; typedef boost::mpl::bool_< false > false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same< Left_side_category, Arr_open_side_tag >, - true_, false_ > + true_, false_ > Left_open; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Bottom_side_category, Arr_open_side_tag >, - true_, false_ > + true_, false_ > Bottom_open; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Top_side_category, Arr_open_side_tag >, - true_, false_ > + true_, false_ > Top_open; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Right_side_category, Arr_open_side_tag >, - true_, false_ > + true_, false_ > Right_open; - + public: - + /*!\brief - * boolean tag that is Arr_all_sides_non_open_tag if all sides are non-open, + * boolean tag that is Arr_all_sides_non_open_tag if all sides are non-open, * otherwise Arr_not_all_sides_non_open_tag */ typedef typename boost::mpl::if_< - boost::mpl::and_< boost::mpl::not_< Left_open >, - boost::mpl::not_< Bottom_open >, - boost::mpl::not_< Top_open >, + boost::mpl::and_< boost::mpl::not_< Left_open >, + boost::mpl::not_< Bottom_open >, + boost::mpl::not_< Top_open >, boost::mpl::not_< Right_open > >, Arr_all_sides_non_open_tag, Arr_not_all_sides_non_open_tag >::type result; @@ -371,47 +371,47 @@ struct Arr_are_all_sides_non_open_tag { /*!\brief Struct to check consistent tagging of identifications */ -template < class ArrLeftSideCategory, class ArrBottomSideCategory, +template < class ArrLeftSideCategory, class ArrBottomSideCategory, class ArrTopSideCategory, class ArrRightSideCategory > struct Arr_sane_identified_tagging { public: - + //! This instance's first template parameter typedef ArrLeftSideCategory Left_side_category; - + //! This instance's second template parameter typedef ArrBottomSideCategory Bottom_side_category; - + //! This instance's third template parameter typedef ArrTopSideCategory Top_side_category; - + //! This instance's fourth template parameter typedef ArrRightSideCategory Right_side_category; - + private: - + typedef boost::mpl::bool_< true > true_; typedef boost::mpl::bool_< false > false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same< Left_side_category, Arr_identified_side_tag >, - true_, false_ > + true_, false_ > Left_identified; typedef boost::mpl::if_< boost::is_same< Bottom_side_category, Arr_identified_side_tag >, - true_, false_ > + true_, false_ > Bottom_identified; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Top_side_category, Arr_identified_side_tag >, - true_, false_ > + true_, false_ > Top_identified; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same< Right_side_category, Arr_identified_side_tag >, - true_, false_ > + true_, false_ > Right_identified; typedef boost::mpl::and_< Left_identified, Right_identified > LR_identified; @@ -422,17 +422,17 @@ struct Arr_sane_identified_tagging { boost::mpl::not_< Right_identified > > LR_non_identified; - typedef boost::mpl::and_< boost::mpl::not_< Bottom_identified >, - boost::mpl::not_< Top_identified > > + typedef boost::mpl::and_< boost::mpl::not_< Bottom_identified >, + boost::mpl::not_< Top_identified > > BT_non_identified; - + typedef boost::mpl::or_< LR_identified, LR_non_identified > LR_ok; typedef boost::mpl::or_< BT_identified, BT_non_identified > BT_ok; - + public: - + /*!\brief - * boolean tag that is bool_ if opposite sides are either + * boolean tag that is bool_ if opposite sides are either * both identified or both non-identified, * otherwise bool_ */ @@ -448,29 +448,29 @@ struct Arr_sane_identified_tagging { * (ii) When Arr_has_identified_sides is used to check whether two non-opposite * sides are identified, the check applies to all four sides. */ -template +template struct Arr_has_identified_sides { public: //! This instance's first template parameter typedef ArrSideOneCategory Side_one_category; - + //! This instance's second template parameter typedef ArrSideTwoCategory Side_two_category; - + private: typedef boost::mpl::bool_ true_; typedef boost::mpl::bool_ false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same, true_, false_> Side_one_identified; typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_two_identified; - + public: /*!\brief * boolean tag that is bool_ if one side is identified, @@ -479,31 +479,31 @@ struct Arr_has_identified_sides { typedef boost::mpl::or_ result; }; -/*! Checks whether one of two boundary sides are contracted +/*! Checks whether one of two boundary sides are contracted */ -template +template struct Arr_has_contracted_sides_two { public: //! This instance's first template parameter typedef ArrSideOneCategory Side_one_category; - + //! This instance's second template parameter typedef ArrSideTwoCategory Side_two_category; - + private: typedef boost::mpl::bool_ true_; typedef boost::mpl::bool_ false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_one_contracted; typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_two_contracted; - + public: /*!\brief * boolean tag that is bool_ if one side is identified, @@ -512,31 +512,31 @@ struct Arr_has_contracted_sides_two { typedef boost::mpl::or_ result; }; -/*! Checks whether one of two boundary sides are closed +/*! Checks whether one of two boundary sides are closed */ -template +template struct Arr_has_closed_sides_two { public: //! This instance's first template parameter typedef ArrSideOneCategory Side_one_category; - + //! This instance's second template parameter typedef ArrSideTwoCategory Side_two_category; - + private: typedef boost::mpl::bool_ true_; typedef boost::mpl::bool_ false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_one_closed; typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_two_closed; - + public: /*!\brief * boolean tag that is bool_ if one side is identified, @@ -545,31 +545,31 @@ struct Arr_has_closed_sides_two { typedef boost::mpl::or_ result; }; -/*! Checks whether one of two boundary sides are open +/*! Checks whether one of two boundary sides are open */ -template +template struct Arr_has_open_sides_two { public: //! This instance's first template parameter typedef ArrSideOneCategory Side_one_category; - + //! This instance's second template parameter typedef ArrSideTwoCategory Side_two_category; - + private: typedef boost::mpl::bool_ true_; typedef boost::mpl::bool_ false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_one_open; typedef boost::mpl::if_< boost::is_same, - true_, false_> + true_, false_> Side_two_open; - + public: /*!\brief * boolean tag that is bool_ if one side is identified, @@ -581,25 +581,25 @@ struct Arr_has_open_sides_two { /*! Categorizes two boundary sides: * If one side is identified => Arr_has_identified_side_tag * Otherwise if one side is contracted => Arr_has_contracted_side_tag - * Otherwise if one side is closed => Arr_has_closed_side_tag + * Otherwise if one side is closed => Arr_has_closed_side_tag * Otherwise if one side is open => Arr_has_open_side_tag * Otherwise => Arr_all_sides_oblivious_tag */ -template < class ArrSideOneCategory, class ArrSideTwoCategory> +template < class ArrSideOneCategory, class ArrSideTwoCategory> struct Arr_two_sides_category { public: //! This instance's first template parameter typedef ArrSideOneCategory Side_one_category; - + //! This instance's second template parameter typedef ArrSideTwoCategory Side_two_category; - + private: // One of the two sides is identified typedef typename Arr_has_identified_sides::result Is_identified; - + // One of the two sides is contracted typedef typename Arr_has_contracted_sides_two::result @@ -614,7 +614,7 @@ struct Arr_two_sides_category { typedef typename Arr_has_open_sides_two::result Is_open; - + public: typedef typename boost::mpl::if_ Arr_has_open_side_tag * Otherwise (all sides oblivious) => Arr_all_sides_oblivious_tag */ -template < class ArrSideOneCategory, class ArrSideTwoCategory> +template < class ArrSideOneCategory, class ArrSideTwoCategory> struct Arr_all_sides_category { public: }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h index e3d80c81ee9e..b1e4b3fea0a0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -27,7 +27,7 @@ namespace CGAL { /*! \class - * A visitor class for Arrangement_zone_2, which performs incremental + * A visitor class for Arrangement_zone_2, which performs incremental * insertion of an x-monotone curve into an arrangement. * The class should be templated by an Arrangement_2 class (that is, an * Arrangement_on_surface_2 class, with the TopTraits @@ -80,7 +80,7 @@ class Arr_inc_insertion_zone_visitor void init (Arrangement_2 *arr) { p_arr = arr; - geom_traits = const_cast + geom_traits = const_cast (static_cast (p_arr->geometry_traits())); } @@ -153,10 +153,10 @@ found_subcurve (const X_monotone_curve_2& cv, Face_handle face, geom_traits->parameter_space_in_x_2_object(); typename Traits_adaptor_2::Parameter_space_in_y_2 ps_in_y = geom_traits->parameter_space_in_y_2_object(); - + // Create an arrangement accessor. Arr_accessor arr_access (*p_arr); - + // Get the boundary conditions of the curve ends. const Arr_parameter_space bx_l = ps_in_x (cv, ARR_MIN_END); const Arr_parameter_space by_l = ps_in_y (cv, ARR_MIN_END); @@ -232,12 +232,12 @@ found_subcurve (const X_monotone_curve_2& cv, Face_handle face, prev_he_right = right_he; else if (! right_v->is_isolated()) prev_he_right = arr_access.locate_around_vertex (right_v, cv); - + // In case the vertex does not exist, split right_he at cv's right // endpoint and create the vertex. if (right_v == invalid_v) { _split_edge (right_he, max_vertex (cv), arr_access); - + // Check whether we have just split the halfedge that left_he refers to. // If so, prev_he_right's target is now the new vertex, and we have to // proceed to the next halfedge (whose target is right_v). @@ -246,7 +246,7 @@ found_subcurve (const X_monotone_curve_2& cv, Face_handle face, } } else { - // Check whether the right end of cv is bounded or not. + // Check whether the right end of cv is bounded or not. if ((bx_r == ARR_RIGHT_BOUNDARY) || (by_r != ARR_INTERIOR)) { // Use the arrangement accessor and obtain a vertex associated with // the unbounded right end (possibly with a predecessor halfedge). @@ -290,15 +290,15 @@ found_subcurve (const X_monotone_curve_2& cv, Face_handle face, arr_access.create_vertex (max_vertex (cv)) : arr_access.create_boundary_vertex (cv, ARR_MAX_END, bx_r, by_r); } - + // We should insert the curve in the interior of the face. - inserted_he = arr_access.insert_in_face_interior_ex (face, cv, ARR_LEFT_TO_RIGHT, + inserted_he = arr_access.insert_in_face_interior_ex (face, cv, ARR_LEFT_TO_RIGHT, left_v, right_v); } else { // The right endpoint is associated with an arrangement vertex, and // we have the predecessor halfedge for the insertion. - inserted_he = arr_access.insert_from_vertex_ex (prev_he_right, cv, ARR_RIGHT_TO_LEFT, + inserted_he = arr_access.insert_from_vertex_ex (prev_he_right, cv, ARR_RIGHT_TO_LEFT, left_v); // The returned halfedge is directed to the newly created vertex @@ -318,7 +318,7 @@ found_subcurve (const X_monotone_curve_2& cv, Face_handle face, arr_access.create_vertex (max_vertex (cv)) : arr_access.create_boundary_vertex (cv, ARR_MAX_END, bx_r, by_r); } - + // Use the left predecessor for the insertion. inserted_he = arr_access.insert_from_vertex_ex (prev_he_left, cv, ARR_LEFT_TO_RIGHT, right_v); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_insertion_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_insertion_helper.h index 197334d7fb57..d11d81fc6834 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_insertion_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_insertion_helper.h @@ -88,7 +88,7 @@ class Arr_spherical_insertion_helper : virtual void before_handle_event(Event* event); //@} - + /*! A notification invoked when a new subcurve is created. */ virtual void add_subcurve(Halfedge_handle he, Subcurve* sc); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h index f14065caa5cd..532b2bf4dbd2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h @@ -32,7 +32,7 @@ namespace CGAL { -/*! \class +/*! \class * A model of the ArrangementTraits_2 concept that counts the methods invoked. */ template @@ -61,17 +61,17 @@ class Arr_tracing_traits_2 : public Base_traits { COMPARE_ENDPOINTS_XY_OP, PARAMETER_SPACE_IN_X_OP, - IS_ON_X_IDENTIFICATION_OP, + IS_ON_X_IDENTIFICATION_OP, COMPARE_Y_ON_BOUNDARY_OP, COMPARE_Y_NEAR_BOUNDARY_OP, - + PARAMETER_SPACE_IN_Y_OP, IS_ON_Y_IDENTIFICATION_OP, COMPARE_X_AT_LIMIT_OP, COMPARE_X_NEAR_LIMIT_OP, COMPARE_X_ON_BOUNDARY_OP, COMPARE_X_NEAR_BOUNDARY_OP, - + NUMBER_OF_OPERATIONS }; @@ -81,55 +81,55 @@ class Arr_tracing_traits_2 : public Base_traits { /*! A set of bits that indicate whether operations should be traced */ unsigned int m_flags; - + bool compare_x_op() const { return (0 != (m_flags & (0x1 << COMPARE_X_OP))); } bool compare_xy_op() const { return (0 != (m_flags & (0x1 << COMPARE_XY_OP))); } - + bool construct_min_vertex_op() const { return (0 != (m_flags & (0x1 << CONSTRUCT_MIN_VERTEX_OP))); } - + bool construct_max_vertex_op() const { return (0 != (m_flags & (0x1 << CONSTRUCT_MAX_VERTEX_OP))); } - + bool is_vertical_op() const { return (0 != (m_flags & (0x1 << IS_VERTICAL_OP))); } - + bool compare_y_at_x_op() const { return (0 != (m_flags & (0x1 << COMPARE_Y_AT_X_OP))); } - + bool equal_points_op() const { return (0 != (m_flags & (0x1 << EQUAL_POINTS_OP))); } - + bool equal_curves_op() const { return (0 != (m_flags & (0x1 << EQUAL_CURVES_OP))); } - + bool compare_y_at_x_left_op() const { return (0 != (m_flags & (0x1 << COMPARE_Y_AT_X_LEFT_OP))); } - + bool compare_y_at_x_right_op() const { return (0 != (m_flags & (0x1 << COMPARE_Y_AT_X_RIGHT_OP))); } - + bool make_x_monotone_op() const { return (0 != (m_flags & (0x1 << MAKE_X_MONOTONE_OP))); } - + bool split_op() const { return (0 != (m_flags & (0x1 << SPLIT_OP))); } - + bool intersect_op() const { return (0 != (m_flags & (0x1 << INTERSECT_OP))); } - + bool are_mergeable_op() const { return (0 != (m_flags & (0x1 << ARE_MERGEABLE_OP))); } - + bool merge_op() const { return (0 != (m_flags & (0x1 << MERGE_OP))); } - + bool construct_opposite_op() const { return (0 != (m_flags & (0x1 << CONSTRUCT_OPPOSITE_OP))); } - + bool compare_endpoints_xy_op() const { return (0 != (m_flags & (0x1 << COMPARE_ENDPOINTS_XY_OP))); } @@ -137,12 +137,12 @@ class Arr_tracing_traits_2 : public Base_traits { bool parameter_space_in_x_op() const { return (0 != (m_flags & (0x1 << PARAMETER_SPACE_IN_X_OP))); } - - bool is_on_x_identification_op() const - { return m_flags & (0x1 << IS_ON_X_IDENTIFICATION_OP); } + + bool is_on_x_identification_op() const + { return m_flags & (0x1 << IS_ON_X_IDENTIFICATION_OP); } bool compare_y_on_boundary_op() const - { return (0 != (m_flags & (0x1 << COMPARE_Y_ON_BOUNDARY_OP))); } + { return (0 != (m_flags & (0x1 << COMPARE_Y_ON_BOUNDARY_OP))); } bool compare_y_near_boundary_op() const { return m_flags & (0x1 << COMPARE_Y_NEAR_BOUNDARY_OP); } @@ -152,8 +152,8 @@ class Arr_tracing_traits_2 : public Base_traits { bool parameter_space_in_y_op() const { return (0 != (m_flags & (0x1 << PARAMETER_SPACE_IN_Y_OP))); } - bool is_on_y_identification_op() const - { return m_flags & (0x1 << IS_ON_Y_IDENTIFICATION_OP); } + bool is_on_y_identification_op() const + { return m_flags & (0x1 << IS_ON_Y_IDENTIFICATION_OP); } bool compare_x_at_limit_op() const { return m_flags & (0x1 << COMPARE_X_AT_LIMIT_OP); } @@ -162,11 +162,11 @@ class Arr_tracing_traits_2 : public Base_traits { { return m_flags & (0x1 << COMPARE_X_NEAR_LIMIT_OP); } bool compare_x_on_boundary_op() const - { return (0 != (m_flags & (0x1 << COMPARE_X_ON_BOUNDARY_OP))); } + { return (0 != (m_flags & (0x1 << COMPARE_X_ON_BOUNDARY_OP))); } bool compare_x_near_boundary_op() const { return m_flags & (0x1 << COMPARE_X_NEAR_BOUNDARY_OP); } - + public: /*! Default constructor */ Arr_tracing_traits_2() : @@ -184,7 +184,7 @@ class Arr_tracing_traits_2 : public Base_traits { * \param id the operation identifier */ void enable_all_traces() { m_flags = 0xffffffff; } - + /*! Disable the trace of a traits operation * \param id the operation identifier */ @@ -194,7 +194,7 @@ class Arr_tracing_traits_2 : public Base_traits { * \param id the operation identifier */ void disable_all_traces() { m_flags = 0x0; } - + /// \name Types and functors inherited from the base //@{ @@ -211,7 +211,7 @@ class Arr_tracing_traits_2 : public Base_traits { Top_side_category; typedef typename internal::Arr_complete_right_side_category< Base >::Category Right_side_category; - + typedef typename Base::Point_2 Point_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; typedef typename Base::Curve_2 Curve_2; @@ -222,7 +222,7 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_x_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_x_2(const Base * base, bool enabled = true) : @@ -320,11 +320,11 @@ class Arr_tracing_traits_2 : public Base_traits { std::cout << "construct_max_vertex" << std::endl << " xcv: " << xcv << std::endl; Point_2 p = m_object(xcv); - std::cout << " result: " << p << std::endl; + std::cout << " result: " << p << std::endl; return p; } }; - + /*! A functor that checks whether a given x-monotone curve is vertical. */ class Is_vertical_2 { private: @@ -335,7 +335,7 @@ class Arr_tracing_traits_2 : public Base_traits { /*! Construct */ Is_vertical_2(const Base * base, bool enabled = true) : m_object(base->is_vertical_2_object()), m_enabled(enabled) {} - + /*! Operate * \param xcv the curve * \return a Boolean that indicates whether the curve is vertical or not @@ -350,7 +350,7 @@ class Arr_tracing_traits_2 : public Base_traits { return is_vertical; } }; - + /*! A functor that compares the y-coordinates of a point and an * x-monotone curve at the point x-coordinate. */ @@ -381,7 +381,7 @@ class Arr_tracing_traits_2 : public Base_traits { return cr; } }; - + /*! A functor that checks whether two points and two x-monotone curves are * identical. */ @@ -431,7 +431,7 @@ class Arr_tracing_traits_2 : public Base_traits { bool equal = m_object(p1, p2); std::cout << " result: " << equal << std::endl; return equal; - } + } }; /*! A functor that compares compares the y-coordinates of two x-monotone @@ -449,7 +449,7 @@ class Arr_tracing_traits_2 : public Base_traits { /*! Operate * \param xcv1 the first curve - * \param xcv2 the second curve + * \param xcv2 the second curve * \param p the reference point * \return the comparison result */ @@ -501,7 +501,7 @@ class Arr_tracing_traits_2 : public Base_traits { return cr; } }; - + /*! A functor that divides a curve into x-monotone curves. */ class Make_x_monotone_2 { private: @@ -524,7 +524,7 @@ class Arr_tracing_traits_2 : public Base_traits { { if (!m_enabled) return m_object(cv, oi); std::cout << "make_x_monotone" << std::endl - << " cv: " << cv << std::endl; + << " cv: " << cv << std::endl; std::list container; m_object(cv, std::back_inserter(container)); if (container.empty()) return oi; @@ -544,7 +544,7 @@ class Arr_tracing_traits_2 : public Base_traits { continue; } } - + for (it = container.begin(); it != container.end(); ++it) *oi++ = *it; container.clear(); return oi; @@ -633,7 +633,7 @@ class Arr_tracing_traits_2 : public Base_traits { continue; } } - + for (it = container.begin(); it != container.end(); ++it) *oi++ = *it; container.clear(); return oi; @@ -768,7 +768,7 @@ class Arr_tracing_traits_2 : public Base_traits { Parameter_space_in_x_2(const Base * base, bool enabled = true) : m_object(base->parameter_space_in_x_2_object()), m_enabled(enabled) {} - + /*! Operate * \param xcv the curve the end of which is tested * \param ce the curve-end identifier @@ -786,14 +786,14 @@ class Arr_tracing_traits_2 : public Base_traits { } }; - /*! A functor that determines whether a point or curve is on + /*! A functor that determines whether a point or curve is on * x-identification. */ class Is_on_x_identification_2 { private: typename Base::Is_on_x_identification_2 m_object; bool m_enabled; - + public: /*! Construct */ Is_on_x_identification_2(const Base * base, bool enabled = true) : @@ -832,7 +832,7 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_y_on_boundary_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_y_on_boundary_2(const Base * base, bool enabled = true) : @@ -863,7 +863,7 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_y_near_boundary_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_y_near_boundary_2(const Base * base, bool enabled = true) : @@ -876,7 +876,7 @@ class Arr_tracing_traits_2 : public Base_traits { * \return the comparison result */ Comparison_result operator()(const X_monotone_curve_2 & xcv1, - const X_monotone_curve_2 & xcv2, + const X_monotone_curve_2 & xcv2, Arr_curve_end ce) const { if (!m_enabled) return m_object(xcv1, xcv2, ce); @@ -904,7 +904,7 @@ class Arr_tracing_traits_2 : public Base_traits { /*! Construct */ Parameter_space_in_y_2(const Base * base, bool enabled = true) : m_object(base->parameter_space_in_y_2_object()), m_enabled(enabled) {} - + /*! Operate * \param xcv the curve the end of which is tested * \param ce the curve-end identifier @@ -936,14 +936,14 @@ class Arr_tracing_traits_2 : public Base_traits { } }; - /*! A functor that determines whether a point or curve is on + /*! A functor that determines whether a point or curve is on * y-identification. */ class Is_on_y_identification_2 { private: typename Base::Is_on_y_identification_2 m_object; bool m_enabled; - + public: /*! Construct */ Is_on_y_identification_2(const Base * base, bool enabled = true) : @@ -982,14 +982,14 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_x_at_limit_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_x_at_limit_2(const Base * base, bool enabled = true) : m_object(base->compare_x_at_limit_2_object()), m_enabled(enabled) {} /*! Operate - * \param p the first point + * \param p the first point * \param xcv the curve the end of which is to be compared * \param ce the curve-end identifier * \return the comparison result @@ -1037,7 +1037,7 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_x_near_limit_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_x_near_limit_2(const Base * base, bool enabled = true) : @@ -1058,7 +1058,7 @@ class Arr_tracing_traits_2 : public Base_traits { std::cout << "compare_x_near_limit 2" << std::endl << " xcv1: " << xcv1 << std::endl << " xcv2: " << xcv2 << std::endl - << " ce: " << ce << std::endl; + << " ce: " << ce << std::endl; Comparison_result cr = m_object(xcv1, xcv2, ce); std::cout << " result: " << cr << std::endl; return cr; @@ -1072,7 +1072,7 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_x_on_boundary_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_x_on_boundary_2(const Base * base, bool enabled = true) : @@ -1097,7 +1097,7 @@ class Arr_tracing_traits_2 : public Base_traits { * \param xcv the curve. * \param ce the curve-end */ - Comparison_result operator()(const Point_2 & pt, + Comparison_result operator()(const Point_2 & pt, const X_monotone_curve_2 & xcv, Arr_curve_end ce) const { if (!m_enabled) return m_object(pt, xcv, ce); @@ -1131,7 +1131,7 @@ class Arr_tracing_traits_2 : public Base_traits { } }; - + /*! A functor that compares the x-coordinates of curve ends near the * boundary of the parameter space. */ @@ -1139,7 +1139,7 @@ class Arr_tracing_traits_2 : public Base_traits { private: typename Base::Compare_x_near_boundary_2 m_object; bool m_enabled; - + public: /*! Construct */ Compare_x_near_boundary_2(const Base * base, bool enabled = true) : @@ -1160,7 +1160,7 @@ class Arr_tracing_traits_2 : public Base_traits { std::cout << "compare_x_near_boundary 2" << std::endl << " xcv1: " << xcv1 << std::endl << " xcv2: " << xcv2 << std::endl - << " ce: " << ce << std::endl; + << " ce: " << ce << std::endl; Comparison_result cr = m_object(xcv1, xcv2, ce); std::cout << " result: " << cr << std::endl; return cr; @@ -1174,7 +1174,7 @@ class Arr_tracing_traits_2 : public Base_traits { Compare_x_2 compare_x_2_object() const { return Compare_x_2(this, compare_x_op()); } - + Compare_xy_2 compare_xy_2_object() const { return Compare_xy_2(this, compare_xy_op()); } @@ -1186,10 +1186,10 @@ class Arr_tracing_traits_2 : public Base_traits { Is_vertical_2 is_vertical_2_object() const { return Is_vertical_2(this, is_vertical_op()); } - + Compare_y_at_x_2 compare_y_at_x_2_object() const { return Compare_y_at_x_2(this, compare_y_at_x_op()); } - + Equal_2 equal_2_object() const { return Equal_2(this, equal_points_op(), equal_curves_op()); } @@ -1198,7 +1198,7 @@ class Arr_tracing_traits_2 : public Base_traits { Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const { return Compare_y_at_x_right_2(this, compare_y_at_x_right_op()); } - + Make_x_monotone_2 make_x_monotone_2_object() const { return Make_x_monotone_2(this, make_x_monotone_op()); } @@ -1225,9 +1225,9 @@ class Arr_tracing_traits_2 : public Base_traits { Parameter_space_in_x_2 parameter_space_in_x_2_object() const { return Parameter_space_in_x_2(this, parameter_space_in_x_op()); } - Is_on_x_identification_2 is_on_x_identification_2_object() const + Is_on_x_identification_2 is_on_x_identification_2_object() const { return Is_on_x_identification_2(this, is_on_x_identification_op()); } - + Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const { return Compare_y_on_boundary_2(this, compare_y_on_boundary_op()); } @@ -1235,11 +1235,11 @@ class Arr_tracing_traits_2 : public Base_traits { { return Compare_y_near_boundary_2(this, compare_y_near_boundary_op()); } // bottom-top - + Parameter_space_in_y_2 parameter_space_in_y_2_object() const { return Parameter_space_in_y_2(this, parameter_space_in_y_op()); } - - Is_on_y_identification_2 is_on_y_identification_2_object() const + + Is_on_y_identification_2 is_on_y_identification_2_object() const { return Is_on_y_identification_2(this, is_on_y_identification_op()); } Compare_x_at_limit_2 compare_x_at_limit_2_object() const diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h index 50c82a3f1840..7910c52bc6cd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Idit Haran // (based on old version by Oren Nechushtan and Iddo Hanniel) @@ -42,28 +42,28 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { typedef Arrangement_ Arrangement_on_surface_2; //type of geometry traits - typedef typename Arrangement_on_surface_2::Geometry_traits_2 + typedef typename Arrangement_on_surface_2::Geometry_traits_2 Geometry_traits_2; //type of traits adaptor - typedef typename Arrangement_on_surface_2::Traits_adaptor_2 + typedef typename Arrangement_on_surface_2::Traits_adaptor_2 Traits_adaptor_2; //type of vertex handle typedef typename Arrangement_on_surface_2::Vertex_handle Vertex_handle; //type of vertex const handle - typedef typename Arrangement_on_surface_2::Vertex_const_handle + typedef typename Arrangement_on_surface_2::Vertex_const_handle Vertex_const_handle; //type of halfedge handle - typedef typename Arrangement_on_surface_2::Halfedge_handle + typedef typename Arrangement_on_surface_2::Halfedge_handle Halfedge_handle; //type of halfedge const handle - typedef typename Arrangement_on_surface_2::Halfedge_const_handle + typedef typename Arrangement_on_surface_2::Halfedge_const_handle Halfedge_const_handle; //type of face const handle - typedef typename Arrangement_on_surface_2::Face_const_handle + typedef typename Arrangement_on_surface_2::Face_const_handle Face_const_handle; //type of edge const iterator - typedef typename Arrangement_on_surface_2::Edge_const_iterator + typedef typename Arrangement_on_surface_2::Edge_const_iterator Edge_const_iterator; //type of isolated vertex const iterator typedef typename Arrangement_on_surface_2::Isolated_vertex_const_iterator @@ -72,37 +72,37 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { typedef typename Geometry_traits_2::Point_2 Point_2; //type of x-monotone curve - typedef typename Geometry_traits_2::X_monotone_curve_2 + typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; - + //type of trapezoidal decomposition traits class - typedef CGAL::Td_traits + typedef CGAL::Td_traits Td_traits; //type of trapezoidal decomposition class - typedef Trapezoidal_decomposition_2 + typedef Trapezoidal_decomposition_2 Trapezoidal_decomposition; - + //!types of Td_map_item-s - typedef typename Trapezoidal_decomposition::Td_map_item + typedef typename Trapezoidal_decomposition::Td_map_item Td_map_item; - typedef typename Trapezoidal_decomposition::Td_active_vertex + typedef typename Trapezoidal_decomposition::Td_active_vertex Td_active_vertex; - typedef typename Trapezoidal_decomposition::Td_active_fictitious_vertex + typedef typename Trapezoidal_decomposition::Td_active_fictitious_vertex Td_active_fictitious_vertex; - typedef typename Trapezoidal_decomposition::Td_active_edge + typedef typename Trapezoidal_decomposition::Td_active_edge Td_active_edge; - typedef typename Trapezoidal_decomposition::Td_active_trapezoid + typedef typename Trapezoidal_decomposition::Td_active_trapezoid Td_active_trapezoid; //!type of side tags - typedef typename Traits_adaptor_2::Left_side_category + typedef typename Traits_adaptor_2::Left_side_category Left_side_category; - typedef typename Traits_adaptor_2::Bottom_side_category + typedef typename Traits_adaptor_2::Bottom_side_category Bottom_side_category; - typedef typename Traits_adaptor_2::Top_side_category + typedef typename Traits_adaptor_2::Top_side_category Top_side_category; - typedef typename Traits_adaptor_2::Right_side_category + typedef typename Traits_adaptor_2::Right_side_category Right_side_category; - + protected: typedef Arr_point_location_result Result; typedef typename Result::Type Result_type; @@ -115,8 +115,8 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { //type of trapezoidal decomposition class typedef Trapezoidal_decomposition TD; - typedef typename Arr_are_all_sides_oblivious_tag< - Left_side_category, Bottom_side_category, + typedef typename Arr_are_all_sides_oblivious_tag< + Left_side_category, Bottom_side_category, Top_side_category, Right_side_category >::result Are_all_sides_oblivious_category; @@ -125,7 +125,7 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { TD td; // instance of trapezoidal decomposition bool m_with_guarantees; //for the notification functions - X_monotone_curve_2 m_cv_before_split; + X_monotone_curve_2 m_cv_before_split; Halfedge_handle m_he_after_merge; //X_monotone_curve_2 m_cv_before_merge1; //X_monotone_curve_2 m_cv_before_merge2; @@ -136,9 +136,9 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { public: /*! Default constructor. */ - Arr_trapezoid_ric_point_location (bool with_guarantees = true, - double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, - double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) + Arr_trapezoid_ric_point_location (bool with_guarantees = true, + double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, + double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : m_traits (nullptr), m_with_guarantees(with_guarantees) { td.set_with_guarantees(with_guarantees); @@ -147,11 +147,11 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { } /*! Constructor given an arrangement. */ - Arr_trapezoid_ric_point_location (const Arrangement_on_surface_2& arr, - bool with_guarantees = true, - double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, + Arr_trapezoid_ric_point_location (const Arrangement_on_surface_2& arr, + bool with_guarantees = true, + double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : - Arr_observer + Arr_observer (const_cast(arr)), m_with_guarantees(with_guarantees) { @@ -166,11 +166,11 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { /*! Destructor. */ ~Arr_trapezoid_ric_point_location () { } - /*! defines whether the underlying search structure guarantees logarithmic + /*! defines whether the underlying search structure guarantees logarithmic * query time and linear size */ void with_guarantees (bool with_guarantees) { - //if with_guarantees was changed from false to true - reconstruct + //if with_guarantees was changed from false to true - reconstruct // the search structure with guarantees td.set_with_guarantees(with_guarantees); if (with_guarantees && !m_with_guarantees) @@ -180,8 +180,8 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { } m_with_guarantees = with_guarantees; } - - /*! returns the depth of the underlying search structure + + /*! returns the depth of the underlying search structure * (the longest path in the DAG) */ unsigned long depth() //longest_dag_path() @@ -250,7 +250,7 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { } virtual void after_assign () - { + { _construct_td(); } @@ -286,22 +286,22 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { td.insert(e); } - //TODO IDIT OREN: what can be done in order to avoid the need - //to save the original curve is to find the common endpoint of the - //two new halfedges, locate it in the trapezoid in order to find the - //curve it lies on, which is the curve that was split, and then remove + //TODO IDIT OREN: what can be done in order to avoid the need + //to save the original curve is to find the common endpoint of the + //two new halfedges, locate it in the trapezoid in order to find the + //curve it lies on, which is the curve that was split, and then remove //this curve. virtual void before_split_edge (Halfedge_handle e, - Vertex_handle /* v */, + Vertex_handle /* v */, const X_monotone_curve_2& /* cv1 */ , const X_monotone_curve_2& /* cv2 */ ) { - + ////MICHAL: commented due to inefficient depth update, remove and insert instead ////save the curve for the "after" function. //m_cv_before_split = e->curve(); - //td.before_split_edge(m_cv_before_split, cv1, cv2); - + //td.before_split_edge(m_cv_before_split, cv1, cv2); + td.remove(e); } @@ -310,7 +310,7 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { { //MICHAL: commented due to inefficient depth update, remove and insert instead //td.split_edge(m_cv_before_split,e1,e2); - + td.insert(e1); td.insert(e2); } @@ -351,8 +351,8 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { void _construct_td () { td.clear(); - - std::vector he_container; + + std::vector he_container; Edge_const_iterator eit; Halfedge_const_handle he_cst; Arrangement_on_surface_2 *arr = this->arrangement(); @@ -363,7 +363,7 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { he_container.push_back(he_cst); } //container insertion - td.insert(he_container.begin(), he_container.end()); + td.insert(he_container.begin(), he_container.end()); } /*! gets the unbounded face that contains the point when the trapezoid is @@ -373,9 +373,9 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { * \param Arr_all_sides_oblivious_tag * \return A Face_const_handle representing the arrangement unbounded face in * which the point p lies - */ + */ Face_const_handle _get_unbounded_face (const Td_map_item& tr, - const Point_2& p, + const Point_2& p, Arr_all_sides_oblivious_tag) const; /*! gets the unbounded face that contains the point when the trapezoid is @@ -383,11 +383,11 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { * \param tr The unbounded trapezoid whose face we should get * \param p The query point. * \param Arr_not_all_sides_oblivious_tag - * \return A Face_const_handle representing the arrangement unbounded face in which + * \return A Face_const_handle representing the arrangement unbounded face in which * the point p lies - */ + */ Face_const_handle _get_unbounded_face (const Td_map_item& tr, - const Point_2& p, + const Point_2& p, Arr_not_all_sides_oblivious_tag) const; /*! @@ -405,10 +405,10 @@ class Arr_trapezoid_ric_point_location : public Arr_observer { * (or unbounded face) * we check the isolated vertices inside the face to check whether there * is an isolated vertex right above/below the query point. - */ + */ result_type _check_isolated_for_vertical_ray_shoot - (Halfedge_const_handle halfedge_found, + (Halfedge_const_handle halfedge_found, const Point_2& p, bool shoot_up, const Td_map_item& tr) const; }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h index 8ddce7ec84af..0203f0466bd3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h @@ -50,9 +50,9 @@ class Arr_triangulation_point_location : public Arr_observer typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::Face_handle Face_handle; + typedef typename Arrangement_2::Vertex_handle Vertex_handle; + typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + typedef typename Arrangement_2::Face_handle Face_handle; typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h index f4bf4a4e57f6..ac6902cc9e22 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -201,11 +201,11 @@ class Arr_vertex_index_map : public Arr_observer { // Update the number of vertices. n_vertices--; - + // Reduce memory consumption in case the number of vertices has // drastically decreased. - if (2*n_vertices+1 < rev_map.size() && - rev_map.size() / 2 >= MIN_REV_MAP_SIZE) + if (2*n_vertices+1 < rev_map.size() && + rev_map.size() / 2 >= MIN_REV_MAP_SIZE) { rev_map.resize (rev_map.size() / 2); } @@ -216,7 +216,7 @@ class Arr_vertex_index_map : public Arr_observer if (index == n_vertices) return; - + Vertex_handle last_v = rev_map[n_vertices]; index_map[last_v] = index; rev_map[index] = last_v; @@ -227,13 +227,13 @@ class Arr_vertex_index_map : public Arr_observer //@} private: - + /*! Initialize the map for the given arrangement. */ void _init () { // Get the number of vertices and allocate the reverse map accordingly. n_vertices = static_cast(this->arrangement()->number_of_vertices()); - + if (n_vertices < MIN_REV_MAP_SIZE) rev_map.resize (MIN_REV_MAP_SIZE); else @@ -242,20 +242,20 @@ class Arr_vertex_index_map : public Arr_observer // Clear the current mapping. index_map.clear(); - // Create the initial mapping. + // Create the initial mapping. typename Arrangement_2::Vertex_iterator vit; Vertex_handle vh; unsigned int index = 0; for (vit = this->arrangement()->vertices_begin(); - vit != this->arrangement()->vertices_end(); ++vit, ++index) + vit != this->arrangement()->vertices_end(); ++vit, ++index) { // Map the current vertex to the current index. vh = vit; index_map[vh] = index; rev_map[index] = vh; } - } + } }; @@ -268,8 +268,8 @@ class Arr_vertex_index_map : public Arr_observer */ template unsigned int get (const CGAL::Arr_vertex_index_map& index_map, - typename Arrangement::Vertex_handle v) -{ + typename Arrangement::Vertex_handle v) +{ return index_map[v]; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h index 7cfe4e3da516..7ecbc8b6802a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h index 6097890a0e68..57f3acaf0040 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Oren Nechushtan and Iddo Hanniel) @@ -67,7 +67,7 @@ class Arr_walk_along_line_point_location { Isolated_vertex_const_iterator; // Data members: - const Arrangement_2* p_arr; // The associated arrangement. + const Arrangement_2* p_arr; // The associated arrangement. const Traits_adaptor_2* geom_traits; // Its associated geometry traits. const Topology_traits* top_traits; // Its associated topology traits. @@ -77,12 +77,12 @@ class Arr_walk_along_line_point_location { public: /*! Default constructor. */ - Arr_walk_along_line_point_location() : + Arr_walk_along_line_point_location() : p_arr(nullptr), geom_traits(nullptr), top_traits(nullptr) {} - + /*! Constructor given an arrangement. */ Arr_walk_along_line_point_location(const Arrangement_2& arr) : p_arr(&arr) @@ -93,7 +93,7 @@ class Arr_walk_along_line_point_location { } /*! Attach an arrangement object. */ - void attach(const Arrangement_2& arr) + void attach(const Arrangement_2& arr) { p_arr = &arr; geom_traits = @@ -108,7 +108,7 @@ class Arr_walk_along_line_point_location { geom_traits = nullptr; top_traits = nullptr; } - + /*! * Locate the arrangement feature containing the given point. * \param p The query point. @@ -168,7 +168,7 @@ class Arr_walk_along_line_point_location { * \param is_on_edge Output: Is the query point located on closest_he. * \param closest_to_target Output: Whether the closest point to p in * closest_he to p is its target (in case - * p is not located on closest_he). + * p is not located on closest_he). * \return (true) if p is contained in the connected component; * (false) otherwise. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h index 2052f0a87cdd..37e6e2547518 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s): Ron Wein // Efi Fogel @@ -30,15 +30,15 @@ namespace CGAL { /*! \class Arrangement_2 * The arrangement class, representing planar subdivisions induced by - * a set of arbitrary planar curves. + * a set of arbitrary planar curves. * The GeomTraits parameter corresponds to a geometry-traits class that * defines the Point_2 and X_monotone_curve_2 types and implements the * geometric predicates and constructions for the family of curves it defines. * The Dcel parameter should be a model of the ArrDcel concept and support * the basic topological operations on a doubly-connected edge-list. */ -template > +template > class Arrangement_2 : public Arrangement_on_surface_2 ::Traits> @@ -60,7 +60,7 @@ class Arrangement_2 : typedef typename Base::Point_2 Point_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; - + typedef typename Default_topology::Traits Topology_traits; // Type definitions. @@ -71,7 +71,7 @@ class Arrangement_2 : typedef typename Base::Vertex_iterator Vertex_iterator; typedef typename Base::Vertex_const_iterator Vertex_const_iterator; - + typedef typename Base::Halfedge_iterator Halfedge_iterator; typedef typename Base::Halfedge_const_iterator Halfedge_const_iterator; @@ -80,8 +80,8 @@ class Arrangement_2 : typedef typename Base::Face_iterator Face_iterator; typedef typename Base::Face_const_iterator Face_const_iterator; - - typedef typename Base::Halfedge_around_vertex_circulator + + typedef typename Base::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator; typedef typename Base::Halfedge_around_vertex_const_circulator Halfedge_around_vertex_const_circulator; @@ -89,7 +89,7 @@ class Arrangement_2 : typedef typename Base::Ccb_halfedge_circulator Ccb_halfedge_circulator; typedef typename Base::Ccb_halfedge_const_circulator Ccb_halfedge_const_circulator; - + typedef typename Base::Outer_ccb_iterator Outer_ccb_iterator; typedef typename Base::Outer_ccb_const_iterator Outer_ccb_const_iterator; @@ -202,7 +202,7 @@ class Arrangement_2 : // hole inside it. We return a handle to one of its neighboring faces, // which is necessarily unbounded. const typename Base::DFace *un_face = - this->topology_traits()->initial_face(); + this->topology_traits()->initial_face(); if (! un_face->is_fictitious()) return (Face_const_handle (un_face)); @@ -210,7 +210,7 @@ class Arrangement_2 : const typename Base::DHalfedge *p_he = *(un_face->inner_ccbs_begin()); const typename Base::DHalfedge *p_opp = p_he->opposite(); const typename Base::DOuter_ccb *p_oc = p_opp->outer_ccb(); - + return (Face_const_handle (p_oc->face())); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h index f8ea8bc79b30..b32ffa842c92 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ophir Setter // @@ -34,7 +34,7 @@ template class Arr_compute_zone_visitor { public: - + typedef OutputIterator_ OutputIterator; typedef Arrangement_ Arrangement_2; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_do_intersect_zone_visitor.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_do_intersect_zone_visitor.h index cb9570d82ad8..0e69460c71af 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_do_intersect_zone_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_do_intersect_zone_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ophir Setter // @@ -84,7 +84,7 @@ class Arr_do_intersect_zone_visitor Face_handle, Vertex_handle left_v, Halfedge_handle left_he, Vertex_handle right_v, Halfedge_handle right_he) - { + { if ((left_v == invalid_v) && (right_v == invalid_v) && (left_he == invalid_he) && (right_he == invalid_he)) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h index 0fbef04f2220..b60f198906f3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -70,7 +70,7 @@ operator=(const Self& arr) // Check for self-assignment. if (this == &arr) return (*this); - + assign (arr); return (*this); } @@ -84,15 +84,15 @@ assign(const Self& arr) { // Clear the current contents of the arrangement. clear(); - + // Assign the base arrangement. Base_arr_2::assign (arr); - + // Create duplicates of the stored curves and map the curves of the // original arrangement to their corresponding duplicates. typedef std::map Curve_map; typedef typename Curve_map::value_type Curve_map_entry; - + Curve_map cv_map; Curve_const_iterator ocit; const Curve_2 *p_cv; @@ -102,11 +102,11 @@ assign(const Self& arr) { // Create a duplicate of the current curve. dup_c = m_curves_alloc.allocate (1); - + p_cv = &(*ocit); std::allocator_traits::construct(m_curves_alloc, dup_c, *p_cv); m_curves.push_back (*dup_c); - + // Assign a map entry. cv_map.insert (Curve_map_entry (&(*ocit), dup_c)); } @@ -127,12 +127,12 @@ assign(const Self& arr) { e = eit; dup_curves.clear(); - for (dit = e->curve().data().begin(); + for (dit = e->curve().data().begin(); dit != e->curve().data().end(); ++dit) { org_c = static_cast(*dit); dup_c = (cv_map.find (org_c))->second; - + dup_curves.push_back (dup_c); dup_c->_insert (e); } @@ -165,21 +165,21 @@ void Arrangement_on_surface_with_history_2::clear () // Free all stored curves. Curve_iterator cit = m_curves.begin(); Curve_halfedges *p_cv; - + while (cit != m_curves.end()) { p_cv = &(*cit); ++cit; - + m_curves.erase (p_cv); std::allocator_traits::destroy(m_curves_alloc,p_cv); m_curves_alloc.deallocate (p_cv, 1); } m_curves.destroy(); - + // Clear the base arrangement. Base_arr_2::clear(); - + return; } @@ -193,7 +193,7 @@ split_edge(Halfedge_handle e, const Point_2& p) { // Split the curve associated with the halfedge e at the given point p. Data_x_curve_2 cv1, cv2; - + this->m_geom_traits->split_2_object() (e->curve(), p, cv1, cv2); @@ -219,14 +219,14 @@ typename Arrangement_on_surface_with_history_2::Halfedge_handle Arrangement_on_surface_with_history_2:: merge_edge(Halfedge_handle e1, Halfedge_handle e2) { - CGAL_precondition_msg (are_mergeable(e1, e2), + CGAL_precondition_msg (are_mergeable(e1, e2), "Edges are not mergeable."); // Merge the two curves. Data_x_curve_2 cv; - + this->m_geom_traits->merge_2_object()(e1->curve(), e2->curve(), cv); - + return (Base_arr_2::merge_edge (e1, e2, cv)); } @@ -245,7 +245,7 @@ bool Arrangement_on_surface_with_history_2::are_mergeable // In order to be mergeable, the two halfedges must share a common // end-vertex. We assign vh to be this vertex. Vertex_const_handle vh; - + if (e1->target() == e2->source() || e1->target() == e2->target()) { vh = e1->target(); @@ -262,12 +262,12 @@ bool Arrangement_on_surface_with_history_2::are_mergeable return (false); } } - + // If there are other edges incident to vh, it is impossible to remove it // and merge the two edges. if (vh->degree() != 2) return (false); - + // Check whether the curves associated with the two edges are mergeable. return (this->m_geom_traits->are_mergeable_2_object()(e1->curve(), e2->curve())); @@ -292,7 +292,7 @@ template bool Arrangement_on_surface_with_history_2:: _unregister_observer(Arr_observer *p_obs) { - return (Base_arr_2::_unregister_observer + return (Base_arr_2::_unregister_observer (reinterpret_cast*>(p_obs))); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h index 410dba0e7fa3..879ec2625ae5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h @@ -1389,34 +1389,34 @@ class Arr_traits_basic_adaptor_2 : public ArrangementBasicTraits_ { // now we are in the open case: ARR_MIN_END > vertical > ARR_MAX_END if (vert1) { - if (!vert2) { - res = ((ce2 == CGAL::ARR_MIN_END) ? CGAL::SMALLER : CGAL::LARGER); - return res; - } - // both are vertical - if (loc1 == loc2) { // both ends converge to the same infinity - res = CGAL::EQUAL; - return res; - } - res = (loc1 == CGAL::ARR_BOTTOM_BOUNDARY ? + if (!vert2) { + res = ((ce2 == CGAL::ARR_MIN_END) ? CGAL::SMALLER : CGAL::LARGER); + return res; + } + // both are vertical + if (loc1 == loc2) { // both ends converge to the same infinity + res = CGAL::EQUAL; + return res; + } + res = (loc1 == CGAL::ARR_BOTTOM_BOUNDARY ? CGAL::SMALLER : CGAL::LARGER); - return res; + return res; } if (vert2) { - res = ((ce1 == CGAL::ARR_MIN_END) ? CGAL::LARGER : CGAL::SMALLER); - return res; + res = ((ce1 == CGAL::ARR_MIN_END) ? CGAL::LARGER : CGAL::SMALLER); + return res; } // otherwise: both ends have asymptotic behaviour if (ce1 == ce2) { // both ends approach asymptote from one side - if (loc1 == loc2) { // need special y-comparison - res = m_self->compare_x_near_limit_2_object()(xcv1, xcv2, ce2); - return res; - } - // else: order can be determined without y-comparison - res = CGAL::EQUAL; - return res; + if (loc1 == loc2) { // need special y-comparison + res = m_self->compare_x_near_limit_2_object()(xcv1, xcv2, ce2); + return res; + } + // else: order can be determined without y-comparison + res = CGAL::EQUAL; + return res; } // curve ends approach vertical asymptote (or singularity) from // different sides => no comparisons required @@ -2158,9 +2158,9 @@ class Arr_traits_basic_adaptor_2 : public ArrangementBasicTraits_ { // Case 4: xcv1 is defined to the right of p, and xcv2 to its left. if (xcv_to_right) { - res1 = compare_y_at_x_right(xcv1, xcv, p); - if (res1 == EQUAL) xcv_equal_xcv1 = true; - return (res1 == LARGER); + res1 = compare_y_at_x_right(xcv1, xcv, p); + if (res1 == EQUAL) xcv_equal_xcv1 = true; + return (res1 == LARGER); } res2 = compare_y_at_x_left(xcv2, xcv, p); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h index 35490cfe4be7..93a0bff6a4ab 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s): Eric Berberich @@ -47,26 +47,26 @@ namespace internal { //! struct to combine results in "or"-fashion template < class ArrSmallerImplementationTag, class ArrLargerImplementationTag > struct Or_traits { - + public: - + //! This instance's first template parameter typedef ArrSmallerImplementationTag Arr_smaller_implementation_tag; - + //! This instance's second template parameter typedef ArrLargerImplementationTag Arr_larger_implementation_tag; - - + + private: - + typedef boost::mpl::bool_< true > true_; typedef boost::mpl::bool_< false > false_; - - typedef boost::mpl::if_< + + typedef boost::mpl::if_< boost::is_same< Arr_smaller_implementation_tag, Arr_use_traits_tag >, true_, false_ > Smaller_traits; - typedef boost::mpl::if_< + typedef boost::mpl::if_< boost::is_same< Arr_larger_implementation_tag, Arr_use_traits_tag >, true_, false_ > Larger_traits; @@ -94,27 +94,27 @@ namespace Parameter_space_in_x_2 { struct Curve_end { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_end< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_end< Arr_open_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_end< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_end< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_end< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -126,27 +126,27 @@ namespace Parameter_space_in_x_2 { struct Curve { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; @@ -163,27 +163,27 @@ namespace Parameter_space_in_x_2 { struct Point< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Point< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Point< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; }; - + } // namespace Parameter_space_in_x_2 @@ -195,27 +195,27 @@ namespace Is_on_y_identification_2 { struct Curve { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -232,27 +232,27 @@ namespace Is_on_y_identification_2 { struct Point< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; }; - + } // namespace Is_on_y_identification_2 @@ -268,22 +268,22 @@ namespace Compare_y_on_boundary_2 { struct Points< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Points< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Points< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Points< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Points< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -300,27 +300,27 @@ namespace Compare_y_near_boundary_2 { struct Curve_ends { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_open_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -334,33 +334,33 @@ template < class ArrLeftSideTag, class ArrRightSideTag > struct Arr_left_right_implementation_dispatch { public: - + //! This instance's first template parameter typedef ArrLeftSideTag Left_side_category; - + //! This instance's second template parameter typedef ArrRightSideTag Right_side_category; - + public: - + //! tag type for Parameter_space_in_x_2 (curve-end signature) typedef typename internal::Or_traits< - typename + typename internal::Parameter_space_in_x_2::Curve_end< Left_side_category >::type, - typename - internal::Parameter_space_in_x_2::Curve_end< Right_side_category >::type + typename + internal::Parameter_space_in_x_2::Curve_end< Right_side_category >::type >::type Parameter_space_in_x_2_curve_end_tag; //! tag type for Parameter_space_in_x_2 (curve signature) typedef typename internal::Or_traits< - typename + typename internal::Parameter_space_in_x_2::Curve< Left_side_category >::type, - typename - internal::Parameter_space_in_x_2::Curve< Right_side_category >::type + typename + internal::Parameter_space_in_x_2::Curve< Right_side_category >::type >::type Parameter_space_in_x_2_curve_tag; - + //! tag type for Parameter_space_in_x_2 (point signature) typedef typename internal::Or_traits< typename @@ -371,37 +371,37 @@ struct Arr_left_right_implementation_dispatch { //! tag type for Is_on_y_identification_2 (curve signature) typedef typename internal::Or_traits< - typename + typename internal::Is_on_y_identification_2::Curve< Left_side_category >::type, - typename - internal::Is_on_y_identification_2::Curve< Right_side_category >::type + typename + internal::Is_on_y_identification_2::Curve< Right_side_category >::type >::type Is_on_y_identification_2_curve_tag; //! tag type for Is_on_y_identification_2 (point signature) typedef typename internal::Or_traits< - typename + typename internal::Is_on_y_identification_2::Point< Left_side_category >::type, - typename - internal::Is_on_y_identification_2::Point< Right_side_category >::type + typename + internal::Is_on_y_identification_2::Point< Right_side_category >::type >::type Is_on_y_identification_2_point_tag; //! tag type for Compare_y_on_boundary_2 (points signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_y_on_boundary_2::Points< Left_side_category >::type, - typename - internal::Compare_y_on_boundary_2::Points< Right_side_category >::type + typename + internal::Compare_y_on_boundary_2::Points< Right_side_category >::type >::type Compare_y_on_boundary_2_points_tag; //! tag type for Compare_y_near_boundary_2 (curve-ends signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_y_near_boundary_2::Curve_ends< Left_side_category >::type, - typename - internal::Compare_y_near_boundary_2::Curve_ends< Right_side_category >::type + typename + internal::Compare_y_near_boundary_2::Curve_ends< Right_side_category >::type >::type Compare_y_near_boundary_2_curve_ends_tag; @@ -420,27 +420,27 @@ namespace Parameter_space_in_y_2 { struct Curve_end { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_end< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_end< Arr_open_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_end< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_end< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_end< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -452,27 +452,27 @@ namespace Parameter_space_in_y_2 { struct Curve { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; @@ -489,27 +489,27 @@ namespace Parameter_space_in_y_2 { struct Point< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Point< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Point< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; }; - + } // namespace Parameter_space_in_y_2 @@ -521,27 +521,27 @@ namespace Is_on_x_identification_2 { struct Curve { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -558,27 +558,27 @@ namespace Is_on_x_identification_2 { struct Point< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; }; - + } // namespace Is_on_x_identification_2 @@ -590,27 +590,27 @@ namespace Compare_x_at_limit_2 { struct Point_curve_end { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_open_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Point_curve_end< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; @@ -622,7 +622,7 @@ namespace Compare_x_at_limit_2 { struct Curve_ends { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; @@ -632,17 +632,17 @@ namespace Compare_x_at_limit_2 { struct Curve_ends< Arr_open_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; @@ -658,27 +658,27 @@ namespace Compare_x_near_limit_2 { struct Curve_ends { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_open_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; @@ -699,22 +699,22 @@ namespace Compare_x_on_boundary_2 { struct Points< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Points< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Points< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Points< Arr_contracted_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Points< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -726,27 +726,27 @@ namespace Compare_x_on_boundary_2 { struct Point_curve_end { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Point_curve_end< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Point_curve_end< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; @@ -758,7 +758,7 @@ namespace Compare_x_on_boundary_2 { struct Curve_ends { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; @@ -768,22 +768,22 @@ namespace Compare_x_on_boundary_2 { struct Curve_ends< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_closed_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_identified_side_tag > { typedef Arr_use_dummy_tag type; }; - + } // namespace Compare_x_on_boundary_2 @@ -795,27 +795,27 @@ namespace Compare_x_near_boundary_2 { struct Curve_ends { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_oblivious_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_open_side_tag > { typedef Arr_use_dummy_tag type; }; - + template <> struct Curve_ends< Arr_closed_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_contracted_side_tag > { typedef Arr_use_traits_tag type; }; - + template <> struct Curve_ends< Arr_identified_side_tag > { typedef Arr_use_traits_tag type; @@ -829,33 +829,33 @@ template < class ArrBottomSideTag, class ArrTopSideTag > struct Arr_bottom_top_implementation_dispatch { public: - + //! This instance's first template parameter typedef ArrBottomSideTag Bottom_side_category; - + //! This instance's second template parameter typedef ArrTopSideTag Top_side_category; - + public: //! tag type for Parameter_space_in_y_2 (curve-end signature) typedef typename internal::Or_traits< - typename + typename internal::Parameter_space_in_y_2::Curve_end< Bottom_side_category >::type, - typename - internal::Parameter_space_in_y_2::Curve_end< Top_side_category >::type + typename + internal::Parameter_space_in_y_2::Curve_end< Top_side_category >::type >::type Parameter_space_in_y_2_curve_end_tag; //! tag type for Parameter_space_in_y_2 (curve signature) typedef typename internal::Or_traits< - typename + typename internal::Parameter_space_in_y_2::Curve< Bottom_side_category >::type, - typename - internal::Parameter_space_in_y_2::Curve< Top_side_category >::type + typename + internal::Parameter_space_in_y_2::Curve< Top_side_category >::type >::type Parameter_space_in_y_2_curve_tag; - + //! tag type for Parameter_space_in_y_2 (point signature) typedef typename internal::Or_traits< typename @@ -863,87 +863,87 @@ struct Arr_bottom_top_implementation_dispatch { typename internal::Parameter_space_in_y_2::Point< Top_side_category >::type >::type Parameter_space_in_y_2_point_tag; - + //! tag type for Is_on_x_identification_2 (curve signature) typedef typename internal::Or_traits< - typename + typename internal::Is_on_x_identification_2::Curve< Bottom_side_category >::type, - typename - internal::Is_on_x_identification_2::Curve< Top_side_category >::type + typename + internal::Is_on_x_identification_2::Curve< Top_side_category >::type >::type Is_on_x_identification_2_curve_tag; //! tag type for Is_on_x_identification_2 (point signature) typedef typename internal::Or_traits< - typename + typename internal::Is_on_x_identification_2::Point< Bottom_side_category >::type, - typename - internal::Is_on_x_identification_2::Point< Top_side_category >::type + typename + internal::Is_on_x_identification_2::Point< Top_side_category >::type >::type Is_on_x_identification_2_point_tag; //! tag type for Compare_x_at_limit_2 (point-curve-end signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_at_limit_2::Point_curve_end< Bottom_side_category > ::type, - typename - internal::Compare_x_at_limit_2::Point_curve_end< Top_side_category >::type + typename + internal::Compare_x_at_limit_2::Point_curve_end< Top_side_category >::type >::type Compare_x_at_limit_2_point_curve_end_tag; //! tag type for Compare_x_at_limit_2 (curve-ends signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_at_limit_2::Curve_ends< Bottom_side_category >::type, - typename - internal::Compare_x_at_limit_2::Curve_ends< Top_side_category >::type + typename + internal::Compare_x_at_limit_2::Curve_ends< Top_side_category >::type >::type Compare_x_at_limit_2_curve_ends_tag; //! tag type for Compare_x_near_limit_boundary_2 (curve-ends signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_near_limit_2::Curve_ends< Bottom_side_category > ::type, - typename - internal::Compare_x_near_limit_2::Curve_ends< Top_side_category >::type + typename + internal::Compare_x_near_limit_2::Curve_ends< Top_side_category >::type >::type Compare_x_near_limit_2_curve_ends_tag; //! tag type for Compare_x_on_boundary_2 (points signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_on_boundary_2::Points< Bottom_side_category >::type, - typename - internal::Compare_x_on_boundary_2::Points< Top_side_category >::type + typename + internal::Compare_x_on_boundary_2::Points< Top_side_category >::type >::type Compare_x_on_boundary_2_points_tag; //! tag type for Compare_x_on_boundary_2 (point_curve-end signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_on_boundary_2::Point_curve_end< Bottom_side_category >::type, - typename - internal::Compare_x_on_boundary_2::Point_curve_end< Top_side_category >::type + typename + internal::Compare_x_on_boundary_2::Point_curve_end< Top_side_category >::type >::type Compare_x_on_boundary_2_point_curve_end_tag; //! tag type for Compare_x_on_boundary_2 (curve-ends signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_on_boundary_2::Curve_ends< Bottom_side_category >::type, - typename - internal::Compare_x_on_boundary_2::Curve_ends< Top_side_category >::type + typename + internal::Compare_x_on_boundary_2::Curve_ends< Top_side_category >::type >::type Compare_x_on_boundary_2_curve_ends_tag; - + //! tag type for Compare_x_near_boundary_2 (curve-ends signature) typedef typename internal::Or_traits< - typename + typename internal::Compare_x_near_boundary_2::Curve_ends< Bottom_side_category >::type, - typename - internal::Compare_x_near_boundary_2::Curve_ends< Top_side_category >::type + typename + internal::Compare_x_near_boundary_2::Curve_ends< Top_side_category >::type >::type Compare_x_near_boundary_2_curve_ends_tag; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_with_history_accessor.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_with_history_accessor.h index ce24ed544590..afc5ef36512b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_with_history_accessor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_with_history_accessor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -120,12 +120,12 @@ class Arr_with_history_accessor { // Allocate an extended curve (with an initially empty set of edges) // and store it in the curves' list. - typename Arrangement_with_history_2::Curve_halfedges *p_cv = + typename Arrangement_with_history_2::Curve_halfedges *p_cv = p_arr->m_curves_alloc.allocate (1); typedef decltype(p_arr->m_curves_alloc) M_Curves_alloc; std::allocator_traits::construct(p_arr->m_curves_alloc, p_cv, cv); p_arr->m_curves.push_back (*p_cv); - + // Return a handle to the inserted curve (the last in the list). Curve_handle ch = p_arr->m_curves.end(); return (--ch); @@ -142,9 +142,9 @@ class Arr_with_history_accessor typename Arrangement_with_history_2::Curve_halfedges& cv = *ch; cv._insert (he); - // Add the curve to the set of he's inducing curves. + // Add the curve to the set of he's inducing curves. he->curve().data().insert (&cv); - + return; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_2_iterators.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_2_iterators.h index 49e4d559feee..e210813d47fd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_2_iterators.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_2_iterators.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -38,9 +38,9 @@ class I_Dereference_iterator // Type definitions: typedef Iterator_ Iterator; typedef I_Dereference_iterator Self; + Value_, + Diff_, + Category_> Self; typedef Category_ iterator_category; typedef Value_ value_type; @@ -70,17 +70,17 @@ class I_Dereference_iterator { return (iter == it.iter); } - + bool operator!= (const Self& it) const { return (!(iter == it.iter)); } - + Iterator current_iterator () const { return (iter); } - + pointer ptr () const { return (static_cast (*iter)); @@ -96,7 +96,7 @@ class I_Dereference_iterator return (ptr()); } //@} - + /// \name Incremernt operations (forward category). //@{ Self& operator++() @@ -136,8 +136,8 @@ class I_Dereference_iterator * class (given as CIterator_), which is supposed to be a pointer, and handle * it as the value-type given by Value_. */ -template +template class I_Dereference_const_iterator { public: @@ -146,10 +146,10 @@ class I_Dereference_const_iterator typedef CIterator_ Const_iterator; typedef MIterator_ Mutable_iterator; typedef I_Dereference_const_iterator Self; + MIterator_, + Value_, + Diff_, + Category_> Self; typedef Category_ iterator_category; typedef Value_ value_type; @@ -184,17 +184,17 @@ class I_Dereference_const_iterator { return (iter == it.iter); } - + bool operator!= (const Self& it) const { return (!(iter == it.iter)); } - + Const_iterator current_iterator () const { return (iter); } - + pointer ptr () const { return (static_cast (*iter)); @@ -210,7 +210,7 @@ class I_Dereference_const_iterator return (ptr()); } //@} - + /// \name Incremernt operations (forward category). //@{ Self& operator++() @@ -256,7 +256,7 @@ class I_Filtered_iterator public: typedef Iterator_ Iterator; - typedef Filter_ Filter; + typedef Filter_ Filter; typedef I_Filtered_iterator() const { return ptr(); @@ -363,7 +363,7 @@ class I_Filtered_iterator return (*this); } - + Self operator++ (int) { Self tmp = *this; @@ -425,7 +425,7 @@ class I_Filtered_const_iterator Iterator nt; // The internal iterator (this member should not // be renamed in order to comply with the // HalfedgeDS circulators that refer to it). - Iterator iend; // A past-the-end iterator. + Iterator iend; // A past-the-end iterator. Filter filt; // The filter functor. public: @@ -491,12 +491,12 @@ class I_Filtered_const_iterator { return (nt == it.nt); } - - bool operator!= (const Self& it) const + + bool operator!= (const Self& it) const { return !(*this == it); } - + bool operator< (const Self& it) const { return &(**this) < (&*it); @@ -507,7 +507,7 @@ class I_Filtered_const_iterator { return (*(ptr())); } - + pointer operator->() const { return ptr(); @@ -523,7 +523,7 @@ class I_Filtered_const_iterator return (*this); } - + Self operator++ (int) { Self tmp = *this; @@ -556,11 +556,11 @@ namespace std { #if defined(BOOST_MSVC) # pragma warning(push) -# pragma warning(disable:4099) // For VC10 it is class hash +# pragma warning(disable:4099) // For VC10 it is class hash #endif #ifndef CGAL_CFG_NO_STD_HASH - + template struct hash @@ -33,18 +33,18 @@ namespace CGAL // the general solution that needs volunteers that wants to learn more generic // programming. // We detect "arrangements" by checking if they define types as specified and -// functions as specified. (For example, if they contain a Geometry_traits_2 +// functions as specified. (For example, if they contain a Geometry_traits_2 // type. // // 1) Write a meta-function that detects whether a type T has a nested type. // Consult Modern C++ Design Chapter 2.7. should look something like: -// +// // template // class does_contain_Geometry_traits_2 // { // typedef char True; // class False { char dummy[2]; }; - + // True Test(typename T::Geometry_traits_2); // False Test(...); // [Continue code] @@ -54,9 +54,9 @@ namespace CGAL // // 2) Make this class a macro. // 3) Can you detect functions in a class T (consult boost::type_traits. -// 4) Use boost::mpl to have is_arrangement_2 derive from the correct type +// 4) Use boost::mpl to have is_arrangement_2 derive from the correct type // (true_type or false_type) according to the meta-functions you wrote. -// 5) Optional: Check boost type_traits for platform-specific problems and +// 5) Optional: Check boost type_traits for platform-specific problems and // solutions. @@ -72,7 +72,7 @@ class Arrangement_2; // specialization template -class is_arrangement_2< +class is_arrangement_2< Arrangement_2 > : public boost::false_type {}; @@ -85,7 +85,7 @@ class Arrangement_on_surface_2; // specialization template -class is_arrangement_2< +class is_arrangement_2< Arrangement_on_surface_2 > : public boost::true_type {}; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h index e5ea7149306b..5525703839bd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -41,16 +41,16 @@ namespace CGAL { * with the arrangement edges. * The Arrangement_on_surface_with_history_2 class enables tracking the input * curve(s) that originated each such subcurve. It also enables keeping track - * of the edges that resulted from each input curve. + * of the edges that resulted from each input curve. * The Traits parameter corresponds to a traits class that defines the * Point_2, X_monotone_curve_2 and Curve_2 types and implements the geometric * predicates and constructions for the family of curves it defines. * The Dcel parameter should be a model of the ArrDcel concept and support * the basic topological operations on a doubly-connected edge-list. */ -template +template class Arrangement_on_surface_with_history_2 : - public Arrangement_on_surface_2 + public Arrangement_on_surface_2 , typename TopTraits_::template rebind @@ -91,11 +91,11 @@ class Arrangement_on_surface_with_history_2 : // Rebind the DCEL and the topology traits to the data-traits class. typedef typename Base_topology_traits::Dcel Base_dcel; - typedef typename Base_dcel::template + typedef typename Base_dcel::template rebind Dcel_rebind; typedef typename Dcel_rebind::other Data_dcel; - typedef typename Base_topology_traits::template + typedef typename Base_topology_traits::template rebind Top_traits_rebind; typedef typename Top_traits_rebind::other Data_top_traits; @@ -106,7 +106,7 @@ class Arrangement_on_surface_with_history_2 : public: typedef Arr_traits_adaptor_2 Traits_adaptor_2; - + public: typedef Data_top_traits Topology_traits; @@ -129,17 +129,17 @@ class Arrangement_on_surface_with_history_2 : typedef typename Base_arr_2::Face_const_iterator Face_const_iterator; typedef typename Base_arr_2::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator; - typedef typename Base_arr_2::Halfedge_around_vertex_const_circulator + typedef typename Base_arr_2::Halfedge_around_vertex_const_circulator Halfedge_around_vertex_const_circulator; typedef typename Base_arr_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; typedef typename Base_arr_2::Ccb_halfedge_const_circulator Ccb_halfedge_const_circulator; - typedef typename Base_arr_2::Outer_ccb_iterator + typedef typename Base_arr_2::Outer_ccb_iterator Outer_ccb_iterator; typedef typename Base_arr_2::Outer_ccb_const_iterator Outer_ccb_const_iterator; - typedef typename Base_arr_2::Inner_ccb_iterator + typedef typename Base_arr_2::Inner_ccb_iterator Inner_ccb_iterator; typedef typename Base_arr_2::Inner_ccb_const_iterator Inner_ccb_const_iterator; @@ -156,7 +156,7 @@ class Arrangement_on_surface_with_history_2 : typedef typename Base_arr_2::Face_const_handle Face_const_handle; protected: - + /*! \struct * Less functor for comparing two halfedge handles. */ @@ -222,7 +222,7 @@ class Arrangement_on_surface_with_history_2 : { return m_halfedges.begin(); } - + /*! Get a past-the-end iterator for the set edges (const version). */ const_iterator _end () const { @@ -242,14 +242,14 @@ class Arrangement_on_surface_with_history_2 : CGAL_assertion(res.second); return (res.first); } - + /*! Erase an edge, given by its position, from the set. */ void _erase(iterator pos) { m_halfedges.erase(pos); return; } - + /*! Erase an edge from the set. */ void _erase (Halfedge_handle he) { @@ -311,7 +311,7 @@ class Arrangement_on_surface_with_history_2 : { _register_edge(e); } - + /*! * Notification before the splitting of an edge into two. * \param e A handle to one of the existing halfedges. @@ -319,7 +319,7 @@ class Arrangement_on_surface_with_history_2 : * \param c2 The x-monotone curve to be associated with the second edge. */ virtual void before_split_edge (Halfedge_handle e, - Vertex_handle /* v */, + Vertex_handle /* v */, const X_monotone_curve_2& /* c1 */, const X_monotone_curve_2& /* c2 */) { @@ -369,7 +369,7 @@ class Arrangement_on_surface_with_history_2 : } private: - + /*! * Register the given halfedge in the set(s) associated with its curve. */ @@ -405,7 +405,7 @@ class Arrangement_on_surface_with_history_2 : Curves_alloc m_curves_alloc; Curve_halfedges_list m_curves; Curve_halfedges_observer m_observer; - + public: typedef typename Curve_halfedges_list::iterator Curve_iterator; @@ -458,7 +458,7 @@ class Arrangement_on_surface_with_history_2 : { return (&(this->m_topol_traits)); } - + /*! Access the topology-traits object (const version). */ inline const Topology_traits* topology_traits () const { @@ -493,7 +493,7 @@ class Arrangement_on_surface_with_history_2 : Base; public: - + Originating_curve_iterator () {} Originating_curve_iterator (Data_iterator iter) : Base (iter) {} @@ -507,10 +507,10 @@ class Arrangement_on_surface_with_history_2 : operator Curve_const_iterator () const { - const Curve_halfedges + const Curve_halfedges *p_cv = static_cast(this->ptr()); return (Curve_const_iterator (p_cv)); - } + } }; /// \name Traversal of the origin curves of an edge. @@ -626,7 +626,7 @@ class Arrangement_on_surface_with_history_2 : Base_arr_2& base_arr = *this; CGAL::insert (base_arr, data_curve, pl); - + // Return a handle to the inserted curve (the last in the list). Curve_handle ch = m_curves.end(); return (--ch); @@ -643,7 +643,7 @@ class Arrangement_on_surface_with_history_2 : // Allocate an extended curve (with an initially empty set of edges) // and store it in the curves' list. Curve_halfedges *p_cv = m_curves_alloc.allocate (1); - + std::allocator_traits::construct(m_curves_alloc, p_cv, cv); m_curves.push_back (*p_cv); @@ -655,12 +655,12 @@ class Arrangement_on_surface_with_history_2 : Base_arr_2& base_arr = *this; CGAL::insert (base_arr, data_curve); - + // Return a handle to the inserted curve (the last in the list). Curve_handle ch = m_curves.end(); return (--ch); } - + /*! * Insert a range of curves into the arrangement. * \param begin An iterator pointing to the first curve in the range. @@ -674,7 +674,7 @@ class Arrangement_on_surface_with_history_2 : while (begin != end) { Curve_halfedges *p_cv = m_curves_alloc.allocate (1); - + std::allocator_traits::construct(m_curves_alloc, p_cv, *begin); m_curves.push_back (*p_cv); @@ -696,7 +696,7 @@ class Arrangement_on_surface_with_history_2 : Size _remove_curve (Curve_handle ch) { // Go over all edges the given curve induces. - Curve_halfedges *p_cv = &(*ch); + Curve_halfedges *p_cv = &(*ch); typename Curve_halfedges::const_iterator it = ch->_begin(); Halfedge_handle he; Size n_removed = 0; @@ -784,9 +784,9 @@ class Arrangement_on_surface_with_history_2 : for (ocit1 = arr1.curves_begin(); ocit1 != arr1.curves_end(); ++ocit1) { // Create a duplicate of the current curve. dup_c = m_curves_alloc.allocate (1); - + p_cv = &(*ocit1); - + std::allocator_traits::construct(m_curves_alloc, dup_c, *p_cv); m_curves.push_back (*dup_c); @@ -800,7 +800,7 @@ class Arrangement_on_surface_with_history_2 : for (ocit2 = arr2.curves_begin(); ocit2 != arr2.curves_end(); ++ocit2) { // Create a duplicate of the current curve. dup_c = m_curves_alloc.allocate (1); - + p_cv = &(*ocit2); std::allocator_traits::construct(m_curves_alloc, dup_c, *p_cv); m_curves.push_back (*dup_c); @@ -899,8 +899,8 @@ insert (Arrangement_on_surface_with_history_2& arr, /*! - * Insert a range of curves into the arrangement (aggregated insertion). - * The inserted curves may intersect one another and may also intersect the + * Insert a range of curves into the arrangement (aggregated insertion). + * The inserted curves may intersect one another and may also intersect the * existing arrangement. * \param arr The arrangement-with-history object. * \param begin An iterator for the first curve in the range. diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h index 9472dd4cb524..134c2f0c20e7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s): Ron Wein @@ -28,15 +28,15 @@ namespace CGAL { /*! \class Arrangement_on_history_2 * The arrangement with history class, representing planar subdivisions - * induced by a set of arbitrary planar curves and storing the curve history. + * induced by a set of arbitrary planar curves and storing the curve history. * The GeomTraits parameter corresponds to a geometry-traits class that * defines the Point_2 and X_monotone_curve_2 types and implements the * geometric predicates and constructions for the family of curves it defines. * The Dcel parameter should be a model of the ArrDcel concept and support * the basic topological operations on a doubly-connected edge-list. */ -template > +template > class Arrangement_with_history_2 : public Arrangement_on_surface_with_history_2 topology_traits()->initial_face(); + this->topology_traits()->initial_face(); if (! un_face->is_fictitious()) return (Face_const_handle (un_face)); @@ -230,7 +230,7 @@ class Arrangement_with_history_2 : const typename Base::DHalfedge *p_he = *(un_face->inner_ccbs_begin()); const typename Base::DHalfedge *p_opp = p_he->opposite(); const typename Base::DOuter_ccb *p_oc = p_opp->outer_ccb(); - + return (Face_const_handle (p_oc->face())); } //@} diff --git a/Arrangement_on_surface_2/include/CGAL/CORE_algebraic_number_traits.h b/Arrangement_on_surface_2/include/CGAL/CORE_algebraic_number_traits.h index 6a9e5ff8e54d..5bc7c25f0199 100644 --- a/Arrangement_on_surface_2/include/CGAL/CORE_algebraic_number_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/CORE_algebraic_number_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -133,13 +133,13 @@ class CORE_algebraic_number_traits x.doubleInterval (x_lo, x_hi); return (std::make_pair (x_lo, x_hi)); } - + /*! * Convert a sequence of rational coefficients to an equivalent sequence * of integer coefficients. If the input coefficients are q(1), ..., q(k), * where q(i) = n(i)/d(i) then the output coefficients will be of the * form: - * n(i) * lcm {d(1), ... , d(k)} + * n(i) * lcm {d(1), ... , d(k)} * a(i) = ------------------------------- * d(i) * gcd {n(1), ... , n(k)} * @@ -283,7 +283,7 @@ class CORE_algebraic_number_traits * \return The polynomial. */ Polynomial construct_polynomial (const Integer *coeffs, - unsigned int degree) const + unsigned int degree) const { Polynomial poly = Polynomial (degree, const_cast (coeffs)); poly.contract(); @@ -298,12 +298,12 @@ class CORE_algebraic_number_traits * \param degree The degree of the input polynomial. * \param poly Output: The resulting polynomial with integer coefficients. * \param poly_denom Output: The denominator for the polynomial. - * \return Whether this polynomial is non-zero (false if the polynomial is + * \return Whether this polynomial is non-zero (false if the polynomial is * zero). */ bool construct_polynomial (const Rational *coeffs, - unsigned int degree, - Polynomial& poly, Integer& poly_denom) const + unsigned int degree, + Polynomial& poly, Integer& poly_denom) const { // Compute the true degree for the polynomial. while (CGAL::sign (coeffs[degree]) == ZERO) @@ -311,7 +311,7 @@ class CORE_algebraic_number_traits if (degree == 0) { poly_denom = 1; - return (false); + return (false); } degree--; } @@ -385,7 +385,7 @@ class CORE_algebraic_number_traits const_cast (p_coeffs)); Rat_polynomial Q = Rat_polynomial (q_degree, const_cast (q_coeffs)); - + P.contract(); Q.contract(); @@ -403,13 +403,13 @@ class CORE_algebraic_number_traits coeff = 1; q_poly = construct_polynomial (&coeff, 0); - + return (true); } // Compute the GCD of the two polynomials and normalize them. Rat_polynomial g = CORE::gcd (P, Q); - + if (g.getTrueDegree() > 0) { P = P.pseudoRemainder (g); @@ -422,15 +422,15 @@ class CORE_algebraic_number_traits Integer p_scale, q_scale; construct_polynomial (*(P.getCoeffs()), p_deg, - p_poly, q_scale); + p_poly, q_scale); construct_polynomial (*(Q.getCoeffs()), q_deg, - q_poly, p_scale); + q_poly, p_scale); // Scale the result polynomials. p_poly.mulScalar (p_scale); q_poly.mulScalar (q_scale); - + return (true); } @@ -462,7 +462,7 @@ class CORE_algebraic_number_traits */ template NT evaluate_at (const Polynomial& poly, - NT& x) const + NT& x) const { return (poly.eval (x)); } @@ -489,7 +489,7 @@ class CORE_algebraic_number_traits Polynomial temp = poly; return (temp.mulScalar (a)); } - + /*! * Perform "long division" of two polynomials: Given A(x) and B(x) compute * two polynomials Q(x) and R(x) such that: A(x) = Q(x)*B(x) + R(x) and @@ -517,7 +517,7 @@ class CORE_algebraic_number_traits */ template OutputIterator compute_polynomial_roots (const Polynomial& poly, - OutputIterator oi) const + OutputIterator oi) const { // Get the real degree of the polynomial. int degree = poly.getTrueDegree(); @@ -528,17 +528,17 @@ class CORE_algebraic_number_traits // Check if we really have a simple quadratic equation. if (degree <= 2) { - return (solve_quadratic_equation ((degree == 2 ? poly.getCoeff(2) : 0), - poly.getCoeff(1), - poly.getCoeff(0), - oi)); + return (solve_quadratic_equation ((degree == 2 ? poly.getCoeff(2) : 0), + poly.getCoeff(1), + poly.getCoeff(0), + oi)); } // Compute the real-valued roots of the polynomial. CORE::Sturm sturm (poly); const unsigned int n_roots = sturm.numberOfRoots(); unsigned int i; - + for (i = 1; i <= n_roots; i++) { // Get the i'th real-valued root. @@ -562,7 +562,7 @@ class CORE_algebraic_number_traits template OutputIterator compute_polynomial_roots (const Polynomial& poly, double x_min, double x_max, - OutputIterator oi) const + OutputIterator oi) const { // Get the real degree of the polynomial. int degree = poly.getTrueDegree(); @@ -577,7 +577,7 @@ class CORE_algebraic_number_traits Algebraic alg_min (x_min), alg_max (x_max); Algebraic buffer[2]; Algebraic *end_buffer = - solve_quadratic_equation ((degree == 2 ? poly.getCoeff(2) : 0), + solve_quadratic_equation ((degree == 2 ? poly.getCoeff(2) : 0), poly.getCoeff(1), poly.getCoeff(0), buffer); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index b8209b258fb9..62a1271d89f5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -373,7 +373,7 @@ class Arc_2 : /*!\brief * copy constructor */ -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Arc_2(const Self& a) : Base(static_cast(a)) { } @@ -1203,8 +1203,8 @@ class Arc_2 : } bool res = - (resmin != CGAL::SMALLER && resmax != CGAL::LARGER); - return res; + (resmin != CGAL::SMALLER && resmax != CGAL::LARGER); + return res; } /*!\brief @@ -2160,37 +2160,37 @@ class Arc_2 : typename Curve_kernel_2::Approximate_relative_1 approx_x; - typename Curve_kernel_2::Bound_between_1 bound_between_x; - - CGAL::Arr_parameter_space min_loc = location(CGAL::ARR_MIN_END); - bool min_has_x = - (is_finite(CGAL::ARR_MIN_END) || - min_loc == CGAL::ARR_BOTTOM_BOUNDARY || - min_loc == CGAL::ARR_TOP_BOUNDARY); - - CGAL::Arr_parameter_space max_loc = location(CGAL::ARR_MAX_END); - bool max_has_x = - (is_finite(CGAL::ARR_MAX_END) || - max_loc == CGAL::ARR_BOTTOM_BOUNDARY || - max_loc == CGAL::ARR_TOP_BOUNDARY); - - if (min_has_x) { - Coordinate_1 min_x = _minpoint().x(); - if (max_has_x) { - Coordinate_1 max_x = _maxpoint().x(); - res = bound_between_x(min_x, max_x); - } else { - std::pair min_pair=approx_x(min_x,4); - res = min_pair.second + Bound(1); - } - } else { - if (max_has_x) { - Coordinate_1 max_x = _maxpoint().x(); - std::pair max_pair=approx_x(max_x,4); - res = max_pair.first - Bound(1); - } else { - // res stays 0 - } + typename Curve_kernel_2::Bound_between_1 bound_between_x; + + CGAL::Arr_parameter_space min_loc = location(CGAL::ARR_MIN_END); + bool min_has_x = + (is_finite(CGAL::ARR_MIN_END) || + min_loc == CGAL::ARR_BOTTOM_BOUNDARY || + min_loc == CGAL::ARR_TOP_BOUNDARY); + + CGAL::Arr_parameter_space max_loc = location(CGAL::ARR_MAX_END); + bool max_has_x = + (is_finite(CGAL::ARR_MAX_END) || + max_loc == CGAL::ARR_BOTTOM_BOUNDARY || + max_loc == CGAL::ARR_TOP_BOUNDARY); + + if (min_has_x) { + Coordinate_1 min_x = _minpoint().x(); + if (max_has_x) { + Coordinate_1 max_x = _maxpoint().x(); + res = bound_between_x(min_x, max_x); + } else { + std::pair min_pair=approx_x(min_x,4); + res = min_pair.second + Bound(1); + } + } else { + if (max_has_x) { + Coordinate_1 max_x = _maxpoint().x(); + std::pair max_pair=approx_x(max_x,4); + res = max_pair.first - Bound(1); + } else { + // res stays 0 + } } CGAL_postcondition(is_in_x_range_interior(Coordinate_1(res))); return res; @@ -2237,10 +2237,10 @@ class Arc_2 : /* no need to recompute location since they are set during construction of respective curve ends */ rep._m_is_vertical = this->ptr()->_m_is_vertical; - rep._m_left_to_right = this->ptr()->_m_left_to_right; + rep._m_left_to_right = this->ptr()->_m_left_to_right; - rep._m_interval_id = boost::none; - rep._m_boundary_in_interval = boost::none; + rep._m_interval_id = boost::none; + rep._m_boundary_in_interval = boost::none; return std::make_pair(Kernel_arc_2(rep), cmp); } @@ -2812,40 +2812,40 @@ class Arc_2 : int low_idx = 0, high_idx = cpa_2.number_of_status_lines_with_event()-1; - bool index_at_event_min=false; - bool index_at_event_max=false; + bool index_at_event_min=false; + bool index_at_event_max=false; typename Curve_pair_analysis_2::Status_line_1 line; if(!inf_low) { line = cpa_2.status_line_for_x(low_x.x()); low_idx = line.index(); - index_at_event_min=line.is_event(); + index_at_event_min=line.is_event(); if(index_at_event_min) { if((cv1._minpoint().is_on_bottom_top() && low_x.x() == cv1._minpoint().x()) || (cv2._minpoint().is_on_bottom_top() && low_x.x() == cv2._minpoint().x())) { // hack: no intersection with asymptotic end - low_idx++; - index_at_event_min=false; - } + low_idx++; + index_at_event_min=false; + } } } if(!inf_high) { line = cpa_2.status_line_for_x(high_x.x()); high_idx = line.index(); - index_at_event_max=line.is_event(); + index_at_event_max=line.is_event(); if(!index_at_event_max) { - high_idx--; - } else if((cv1._maxpoint().is_on_bottom_top() && + high_idx--; + } else if((cv1._maxpoint().is_on_bottom_top() && high_x.x() == cv1._maxpoint().x()) || (cv2._maxpoint().is_on_bottom_top() && - high_x.x() == cv2._maxpoint().x())) { - // hack: no intersection with asymptotic end - high_idx--; - index_at_event_max=false; - } + high_x.x() == cv2._maxpoint().x())) { + // hack: no intersection with asymptotic end + high_idx--; + index_at_event_max=false; + } } // run over all event points within the joint x-range of two arcs @@ -2865,7 +2865,7 @@ class Arc_2 : Coordinate_1 x0 = tmp.x(); if((i == low_idx && index_at_event_min) || - (i == high_idx && index_at_event_max)) { + (i == high_idx && index_at_event_max)) { arcno1 = cv1.arcno(x0); arcno2 = cv2.arcno(x0); mult = 0; // intersection at end-point diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h index fa91e9bd68fb..b90d6d8a163f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -8,7 +8,7 @@ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Pavel Emeliyanenko +// Author(s) : Pavel Emeliyanenko #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H @@ -24,15 +24,15 @@ namespace CGAL { namespace internal { -/*!\brief +/*!\brief * Given an arc number over an interval \c i this functor computes a * corresponding event arcno (and asymptotic tendency) over a certain vertical - * line which lies on the given side w.r.t. the interval \c i. + * line which lies on the given side w.r.t. the interval \c i. * * For caching issues for each accessed \c Curve_2 object we store * \c Interval_arcno_map structure. In its turn, \c Interval_arcno_map * for each \c Status_line_1 object stores the precomputed mapping - * from interval arcnos (on left and right sides) to event arcnos + * from interval arcnos (on left and right sides) to event arcnos */ template struct Curve_interval_arcno_cache { @@ -42,20 +42,20 @@ struct Curve_interval_arcno_cache { //! this instance's first template parameter typedef CurveKernel_2 Curve_kernel_2; - + //! type of curve analysis typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! type of x-coordinate typedef typename Curve_kernel_2::Coordinate_1 Coordinate_1; - + //! type of status line typedef typename Curve_analysis_2::Status_line_1 Status_line_1; - + //! event arc number descriptor: stores an arc number along with curve's //! end type (+/-oo or \c ARR_INTERIOR ) typedef std::pair Arcno_desc; - + //! type of first argument typedef Status_line_1 first_argument_type; @@ -64,14 +64,14 @@ struct Curve_interval_arcno_cache { //! type of third arguent typedef int third_argument_type; - + //! the result type typedef Arcno_desc result_type; //! the arity of the functor - + //!@} - + //!\name Constructors //!@{ @@ -81,13 +81,13 @@ struct Curve_interval_arcno_cache { Curve_interval_arcno_cache() : _m_last_curve_id(-1) { } - + //!@} //!\name Functor invokation //!@{ - /*!\brief + /*!\brief * Given arcno over an interval, this computes a corresponding event * arcno on status line \c cv_line lying on the given \c side w.r.t. the * interval @@ -97,25 +97,25 @@ struct Curve_interval_arcno_cache { * \param interval_arcno Arcnumber of interval * \return Arcnumber information at event line */ - result_type operator()(const Status_line_1& cv_line, bool side, + result_type operator()(const Status_line_1& cv_line, bool side, int interval_arcno) const { - + CGAL_precondition(interval_arcno >= 0); if(!cv_line.is_event()) // # of arcs over interval is constant return std::make_pair(interval_arcno, CGAL::ARR_INTERIOR); - + Curve_analysis_2 ca_2 = cv_line.curve_analysis_2(); ///////////////////////////////// polynomial or curve id ? int curve_id = static_cast(ca_2.polynomial_2().id()); ///////////////////////////////// if(_m_last_curve_id != curve_id) { typename Curve_to_interval_arcno_map::iterator it; - if(_m_last_curve_id != -1) { + if(_m_last_curve_id != -1) { // commit the last changes to the global curve arcno map it = _m_curve_arcno_map.find(_m_last_curve_id); CGAL_precondition(it != _m_curve_arcno_map.end()); - it->second = _m_last_interval_map; - } + it->second = _m_last_interval_map; + } // modify _m_last_interval_map to be pointing to the // Interval_arcno_map corresponding to the given curve_id it = _m_curve_arcno_map.insert(std::make_pair(curve_id, @@ -126,17 +126,17 @@ struct Curve_interval_arcno_cache { // cache status lines by id(); shall we use x-coordinate instead of // id to ensure uniqueness ? // TODO: shall we use cv_line.index() ? - typename Interval_arcno_map::const_iterator it = + typename Interval_arcno_map::const_iterator it = _m_last_interval_map.find(cv_line.x().id()); if(it != _m_last_interval_map.end()) { const Arcno_vector_pair& tmp = it->second; - // note: side index must be reversed + // note: side index must be reversed CGAL_precondition(interval_arcno < static_cast(side == 1 ? tmp.first.size() : tmp.second.size())); return (side == 1 ? tmp.first[interval_arcno] : tmp.second[interval_arcno]); } - + int n_left = ca_2.status_line_of_interval( cv_line.index()).number_of_events(), // # arcs to the left n_right = ca_2.status_line_of_interval( // # arcs to the right @@ -149,24 +149,24 @@ struct Curve_interval_arcno_cache { Arcno_vector_pair vpair; vpair.first.resize(n_left); //+ n_mininf.first + n_maxinf.first); vpair.second.resize(n_right); //+ n_mininf.second + n_maxinf.second); - + int i, _arcno, left_i = 0, right_i = 0; // process arcs approaching -oo from left and right for(; left_i < n_mininf.first; left_i++) - vpair.first[left_i] = std::make_pair(left_i, + vpair.first[left_i] = std::make_pair(left_i, CGAL::ARR_BOTTOM_BOUNDARY); - + for(; right_i < n_mininf.second; right_i++) vpair.second[right_i] = std::make_pair(right_i, CGAL::ARR_BOTTOM_BOUNDARY); - + // process all finite events over this vertical line for(_arcno = 0; _arcno < cv_line.number_of_events(); _arcno++) { ipair = cv_line.number_of_incident_branches(_arcno); for(i = 0; i < ipair.first; i++) vpair.first[left_i++] = std::make_pair(_arcno, CGAL::ARR_INTERIOR); - + for(i = 0; i < ipair.second; i++) vpair.second[right_i++] = std::make_pair(_arcno, CGAL::ARR_INTERIOR); @@ -175,13 +175,13 @@ struct Curve_interval_arcno_cache { // this is not clear.. why arcnos at +oo are mapped to the same // interval arcnos ? for(i = 0; i < n_maxinf.first; i++, left_i++) - vpair.first[left_i] = std::make_pair(left_i, - CGAL::ARR_TOP_BOUNDARY); - + vpair.first[left_i] = std::make_pair(left_i, + CGAL::ARR_TOP_BOUNDARY); + for(i = 0; i < n_maxinf.second; i++, right_i++) vpair.second[right_i] = std::make_pair(right_i, CGAL::ARR_TOP_BOUNDARY); - + CGAL_precondition(left_i == static_cast(vpair.first.size())); CGAL_precondition(right_i == static_cast(vpair.second.size())); _m_last_interval_map.insert(std::make_pair(cv_line.x().id(), vpair)); @@ -192,33 +192,33 @@ struct Curve_interval_arcno_cache { } //!@} -private: - +private: + //!\name Private members //!@{ //! a pair of vectors (right and left side of event-line respectively) typedef std::pair, std::vector > Arcno_vector_pair; - + //! maps from \c Status_line_1 id to a container of interval -> - //! event arcnos + //! event arcnos // TODO: use hash instead ?? cache status lines by x-coordinate ? (Pavel) typedef typename Status_line_1::Algebraic_real_1::Id_type Id_type; typedef std::map Interval_arcno_map; - + //! maps from \c Curve_2 id to \c Interval_arcno_map typedef std::map Curve_to_interval_arcno_map; - + //! arcno mapping container instance mutable Curve_to_interval_arcno_map _m_curve_arcno_map; - + //! an id of the last queried \c Curve_2 object mutable int _m_last_curve_id; - - //! stores an address of the last accessed map + + //! stores an address of the last accessed map mutable Interval_arcno_map _m_last_interval_map; - + //!@} }; // struct Curve_interval_arcno_cache diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h index 4b663c89302a..81947d168b6a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany). +// Copyright (c) 2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany). // All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -29,13 +29,13 @@ // whether to use exact rational arithmetic #define CGAL_CKVA_USE_RATIONAL_ARITHMETIC -// this turns on a signleton curve renderer +// this turns on a signleton curve renderer // (not recommended for multi-threaded applications) //#define CGAL_CKVA_USE_STATIC_RENDERER -// prints out detailed info of the rendering process +// prints out detailed info of the rendering process // (only for internal debugging) -#ifndef Gfx_DETAILED_OUT +#ifndef Gfx_DETAILED_OUT //#define Gfx_USE_DETAILED_OUT #ifdef Gfx_USE_DETAILED_OUT #define Gfx_DETAILED_OUT(x) std::cerr << x @@ -71,17 +71,17 @@ namespace CGAL { template class Curve_renderer_interface; -/*!\brief +/*!\brief * represents a single curve renderer instance with usual parameter set to * speed up rendering of several objects supported by the same curve - * + * * @warning not recommended to use in multi-threaded applications */ template class Curve_renderer_facade { Curve_renderer_facade() { // private constructor - + } public: @@ -107,20 +107,20 @@ class Curve_renderer_facade } }; -/*! \brief +/*! \brief * CKvA interface to the curve renderer. Provides three levels of increasing * arithmetic precision - * + * * the curve renderer is instantiated with the base \c Float_ which can be * either integral or user-defined floating-point number type, and optionally * with multi-precision \c Bigfloat and exact rational number types as - * provided by the currently used \c Arithmetic_kernel + * provided by the currently used \c Arithmetic_kernel */ template class Curve_renderer_interface { public: - //! \name Public typedefs + //! \name Public typedefs //!@{ //! this instance's first argument @@ -128,7 +128,7 @@ class Curve_renderer_interface //! base floating-point number type typedef Float_ Float; - + //! type of a curve kernel typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; @@ -140,15 +140,15 @@ class Curve_renderer_interface //! multi-precision float NT typedef typename Arithmetic_kernel::Bigfloat_interval BFI; - typedef typename CGAL::Bigfloat_interval_traits::Bound - Bigfloat; + typedef typename CGAL::Bigfloat_interval_traits::Bound + Bigfloat; //! rational NT typedef typename Arithmetic_kernel::Rational Rational; - + //! an arc of generic curve typedef typename Curved_kernel_via_analysis_2::Arc_2 Arc_2; - + //! a point on curve typedef typename Curved_kernel_via_analysis_2::Point_2 Point_2; @@ -214,18 +214,18 @@ class Curve_renderer_interface //!@{ //!@note pass null-pointer for \c pbox parameter if you don't need - //! the drawing window - inline void get_setup_parameters(CGAL::Bbox_2 *pbox, int& res_w, + //! the drawing window + inline void get_setup_parameters(CGAL::Bbox_2 *pbox, int& res_w, int& res_h) { #ifndef CGAL_CKVA_DUMMY_RENDERER return renderer().get_setup_parameters(pbox, res_w, res_h); #endif } - + /*!\brief * initializes renderer with drawing window dimensions * and pixel resolution - * + * * [x_min; y_min]x[x_max; y_max] - drawing window * \c res_w and \c res_h - h/v pixel resolution */ @@ -233,7 +233,7 @@ class Curve_renderer_interface { #ifndef CGAL_CKVA_DUMMY_RENDERER renderer().setup(bbox, res_w, res_h); -#endif +#endif } /*!\brief @@ -244,16 +244,16 @@ class Curve_renderer_interface * clear operations * * \c Coord_2 must be constructible from a pair of integers / doubles - * depending on the renderer type + * depending on the renderer type * * computes optionaly end-point coordinates (even if they lie outside the * window) */ template < class Coord_2, template < class, class > class Container, class Allocator > - inline void draw(const Arc_2& arc, + inline void draw(const Arc_2& arc, Container< std::vector< Coord_2 >, Allocator >& pts, - boost::optional< Coord_2 > *end_pt1 = nullptr, + boost::optional< Coord_2 > *end_pt1 = nullptr, boost::optional< Coord_2 > *end_pt2 = nullptr) { #ifndef CGAL_CKVA_DUMMY_RENDERER @@ -263,26 +263,26 @@ class Curve_renderer_interface #endif renderer().set_IA_method(0); // start with QF -Lrestart: +Lrestart: try { renderer().draw(arc, pts, end_pt1, end_pt2); - } + } catch(internal::Insufficient_rasterize_precision_exception) { int prev = renderer().set_IA_method(1); if(prev == 0) { std::cerr << "Restarting with MAA\n"; pts.clear(); - goto Lrestart; + goto Lrestart; } - std::cerr << "Switching to multi-precision arithmetic" << + std::cerr << "Switching to multi-precision arithmetic" << std::endl; #ifdef CGAL_CKVA_USE_MULTIPREC_ARITHMETIC if(::boost::is_same:: Is_exact, CGAL::Tag_true>::value) goto Lexit; - + get_setup_parameters(&bbox, res_w, res_h); exact_renderer().setup(bbox, res_w, res_h); exact_renderer().set_IA_method(1); // always use MAA @@ -297,7 +297,7 @@ class Curve_renderer_interface goto Lexit; std::cerr << "Switching to exact arithmetic" << std::endl; #ifdef CGAL_CKVA_USE_RATIONAL_ARITHMETIC - + if(::boost::is_same< typename Algebraic_structure_traits< Float >::Is_exact, CGAL::Tag_true>::value) @@ -321,29 +321,29 @@ Lexit: std::cerr << "Sorry, this does not work even with exact " "arithmetic, bailing out..." << std::endl; std::cerr << "polynomial: " << renderer().curve().polynomial_2() << std::endl; - + renderer().get_setup_parameters(&bbox, res_w, res_h); std::cerr << "window: " << bbox << "; resolution: " << res_w << " x " << res_h << std::endl; - + #endif // CGAL_CKVA_USE_MULTIPREC_ARITHMETIC } #endif // !CGAL_CKVA_DUMMY_RENDERER } - + /*!\brief - * rasterizes a point on curve, returns point coordinates as objects of + * rasterizes a point on curve, returns point coordinates as objects of * type \c Coord_2 which are constructible from a pair of ints / doubles * - * retunrs \c false if point lies outside the window or cannot be + * retunrs \c false if point lies outside the window or cannot be * rasterized due to precision problems - */ + */ template < class Coord_2 > bool draw(const Point_2& point, Coord_2& coord) { #ifndef CGAL_CKVA_DUMMY_RENDERER try { return renderer().draw(point, coord); - } + } catch(internal::Insufficient_rasterize_precision_exception) { std::cerr << "Unable to rasterize point..\n"; return false; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index dbe509c0aff8..adb833f663ac 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -42,16 +42,16 @@ namespace Curved_kernel_via_analysis_2_Functors { /*!\brief * Base functor class for inheritance */ -template < class CurvedKernelViaAnalysis_2 > +template < class CurvedKernelViaAnalysis_2 > class Curved_kernel_via_analysis_2_functor_base { public: //!\name Public types //!@{ - + //! this instance's template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; - + //! the point type typedef typename Curved_kernel_via_analysis_2::Point_2 Point_2; @@ -59,12 +59,12 @@ class Curved_kernel_via_analysis_2_functor_base { typedef typename Curved_kernel_via_analysis_2::Arc_2 Arc_2; //! type of curve kernel - typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 + typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; //! type of curve analaysis typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! the x-coordinate type typedef typename Point_2::Coordinate_1 Coordinate_1; //typedef typename Point_2::Y_coordinate_1 Y_coordinate_1; @@ -75,7 +75,7 @@ class Curved_kernel_via_analysis_2_functor_base { public: //!\name Constructors //!@{ - + /*!\brief * Constructs base functor * @@ -92,8 +92,8 @@ class Curved_kernel_via_analysis_2_functor_base { protected: //!\name Access members //!@{ - - /*!\brief + + /*!\brief * Return pointer to curved kernel * \return Pointer to stored kernel */ @@ -102,14 +102,14 @@ class Curved_kernel_via_analysis_2_functor_base { } //!@} - + protected: //!\name Data members //!@{ - + //! stores pointer to \c Curved_kernel_via_analysis_2 Curved_kernel_via_analysis_2 *_m_curved_kernel; - + //!@} }; @@ -120,11 +120,11 @@ class Curved_kernel_via_analysis_2_functor_base { typedef typename Base::Coordinate_1 Coordinate_1; \ //typedef typename Base::Y_coordinate_1 Y_coordinate_1; -/*!\brief +/*!\brief * Functor to construct a point on a curve */ template < class CurvedKernelViaAnalysis_2 > -class Construct_point_2 : public +class Construct_point_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -132,16 +132,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Point_2 result_type; - /*!\brief + /*!\brief * Standard constructor * * \param kernel The kernel @@ -151,33 +151,33 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } /*!\brief - * Constructs an interior point - * + * Constructs an interior point + * * \param x x-coordinate * \param c The supporting curve * \param arcno Arcnumber on curve * \return The constructed point */ - Point_2 operator()(const Coordinate_1& x, - const Curve_analysis_2& c, + Point_2 operator()(const Coordinate_1& x, + const Curve_analysis_2& c, int arcno) { Point_2 pt(x, c, arcno); return pt; } - Point_2 operator()(const Coordinate_1& x, + Point_2 operator()(const Coordinate_1& x, const Arc_2& a) { CGAL_precondition(a.is_in_x_range(x)); - Point_2 pt(x, a.curve(), a.arcno(x)); + Point_2 pt(x, a.curve(), a.arcno(x)); return pt; } - + template Point_2 operator() (const T& x, const T& y) { Point_2 pt(x,y); - return pt; + return pt; } @@ -188,7 +188,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor to construct point on an arc */ template < class CurvedKernelViaAnalysis_2 > -class Construct_point_on_arc_2 : public +class Construct_point_on_arc_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -196,16 +196,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Point_2 result_type; - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -213,10 +213,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Construct_point_on_arc_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Constructs point on an arc - * + * * \param x x-coordinate of point * \param c The supporting curve * \param arcno Arcnumber on curve @@ -230,7 +230,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { // avoid compiler warning (void)arc; - + //CGAL::set_pretty_mode(std::cerr); CERR("Construct_pt_on_arc: " << CGAL::to_double(x) << ", " << arcno << ", " << c.id() << "\narc = " << arc << "\n"); @@ -239,8 +239,8 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { //CGAL_assertion(arcno == arc.arcno(x)); Point_2 pt = Base::_ckva()->construct_point_2_object()(x, c, arcno); - - // here we can modify the point wrt "data stored in arc", + + // here we can modify the point wrt "data stored in arc", // if we want to return pt; } @@ -248,10 +248,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { /*!\brief - * Functor to construct an x-monotone arc + * Functor to construct an x-monotone arc */ template < class CurvedKernelViaAnalysis_2 > -class Construct_arc_2 : public +class Construct_arc_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -259,16 +259,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Arc_2 result_type; - /*!\brief + /*!\brief * Standard constructor * * \param kernel The kernel @@ -279,10 +279,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { //!\name Constructing non-vertical arcs //!@{ - - /*!\brief + + /*!\brief * Constructs a non-vertical arc with two interior end-points (segment). - * + * * \param p first endpoint * \param q second endpoint * \param c The supporting curve @@ -290,20 +290,20 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \param arcno_p The arcnumber wrt \c c of the arc at \c p * \param arcno_q The arcnumber wrt \c c of the arc at \c q * \returns The constructed segment - * + * * \pre p.x() != q.x() * */ - Arc_2 operator()(const Point_2& p, const Point_2& q, + Arc_2 operator()(const Point_2& p, const Point_2& q, const Curve_analysis_2& c, int arcno, int arcno_p, int arcno_q) { Arc_2 arc(p, q, c, arcno, arcno_p, arcno_q); return arc; } - + /*!\brief * Constructs a non-vertical arc with one interior end-point and whose - * other end approaches the left or right boundary of the parameter space + * other end approaches the left or right boundary of the parameter space * (ray I) * * \param origin The interior end-point of the ray @@ -311,17 +311,17 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * boundary * \param c The supporting curve * \param arcno The arcnumber wrt \c c in the interior of the arc - * \param arcno_o The arcnumber wrt \c c of the arc at \c origin + * \param arcno_o The arcnumber wrt \c c of the arc at \c origin * \return The constructed ray */ - Arc_2 operator()(const Point_2& origin, CGAL::Arr_curve_end inf_end, + Arc_2 operator()(const Point_2& origin, CGAL::Arr_curve_end inf_end, const Curve_analysis_2& c, int arcno, int arcno_o) { Arc_2 arc(origin, inf_end, c, arcno, arcno_o); return arc; } /*!\brief - * Constructs a non-vertical arc with one interior end-point and whose + * Constructs a non-vertical arc with one interior end-point and whose * other end approaches a vertical asymptote (ray II) * * \param origin The interior end-point @@ -329,21 +329,21 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \param inf_end Arc is approaching the bottom or top boundary * \param c The supporting curve * \param arcno The arcnumber wrt \c c in the interior of the arc - * \param arcno_o The arcnumber wrt \c c of the arc at \c origin + * \param arcno_o The arcnumber wrt \c c of the arc at \c origin * \return The constructed ray * * \pre origin.x() != asympt_x */ - Arc_2 operator()(const Point_2& origin, const Coordinate_1& asympt_x, - CGAL::Arr_curve_end inf_end, - const Curve_analysis_2& c, int arcno, + Arc_2 operator()(const Point_2& origin, const Coordinate_1& asympt_x, + CGAL::Arr_curve_end inf_end, + const Curve_analysis_2& c, int arcno, int arcno_o) { Arc_2 arc(origin, asympt_x, inf_end, c, arcno, arcno_o); return arc; } /*!\brief - * Constructs a non-vertical arc with two non-interior ends at + * Constructs a non-vertical arc with two non-interior ends at * the left and right boundary (branch I) * * \param c The supporting curve @@ -354,32 +354,32 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Arc_2 arc(c, arcno); return arc; } - + /*!\brief * Constructs a non-vertical arc with two ends approaching vertical * asymptotes (branch II). * * \param asympt_x1 The x-coordinate of the first asymptote - * \param inf_end1 Arc is approaching the bottom or top boundary at + * \param inf_end1 Arc is approaching the bottom or top boundary at * \c asympt_x1 * \param asympt_x2 The x-coordinate of the second asymptote - * \param inf_end2 Arc is approaching the bottom or top boundary at + * \param inf_end2 Arc is approaching the bottom or top boundary at * \c asympt_x2 * \return The constructed branch * * \pre asympt_x1 != asympt_x2 */ - Arc_2 operator()(const Coordinate_1& asympt_x1, + Arc_2 operator()(const Coordinate_1& asympt_x1, CGAL::Arr_curve_end inf_end1, - const Coordinate_1& asympt_x2, + const Coordinate_1& asympt_x2, CGAL::Arr_curve_end inf_end2, const Curve_analysis_2& c, int arcno) { Arc_2 arc(asympt_x1, inf_end1, asympt_x2, inf_end2, c, arcno); return arc; } - + /*!\brief - * Construct a non-vertical arc with one left- or right-boundary end + * Construct a non-vertical arc with one left- or right-boundary end * and one end that approaches a vertical asymptote (branch III) * * \param inf_endx Defining whether the arc emanates from the left or right @@ -389,38 +389,38 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * asympt_x * \return The constructed branch */ - Arc_2 operator()(CGAL::Arr_curve_end inf_endx, + Arc_2 operator()(CGAL::Arr_curve_end inf_endx, const Coordinate_1& asympt_x, - CGAL::Arr_curve_end inf_endy, + CGAL::Arr_curve_end inf_endy, const Curve_analysis_2& c, int arcno) { Arc_2 arc(inf_endx, asympt_x, inf_endy, c, arcno); return arc; } - + //!@} //!\name Constructing vertical arcs //!@{ - - /*!\brief - * Constructs a vertical arc with two interior end-points + + /*!\brief + * Constructs a vertical arc with two interior end-points * (vertical segment) * * \param p The first end-point * \param q The second end-point * \param c The supporting curve * \return The constructed arc - * + * * \pre p != q && p.x() == q.x() * \pre c must have a vertical component at this x */ - Arc_2 operator()(const Point_2& p, const Point_2& q, + Arc_2 operator()(const Point_2& p, const Point_2& q, const Curve_analysis_2& c) { Arc_2 arc(p,q,c); return arc; } - + /*!\brief - * Constructs a vertical arc with one interior end-point and + * Constructs a vertical arc with one interior end-point and * one that reaches the bottom or top boundary (vertical ray) * * \param origin The interior end-point @@ -431,18 +431,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { */ Arc_2 operator()(const Point_2& origin, CGAL::Arr_curve_end inf_end, const Curve_analysis_2& c) { - + Arc_2 arc(origin, inf_end, c); return arc; } - + /*!\brief * Constructs a vertical arc that connects bottom with top boundary * (vertical branch) * * \param x The x-coordinate of the branch * \return The constructed branch - * + * * \pre c must have a vertical line component at this x */ Arc_2 operator()(const Coordinate_1& x, const Curve_analysis_2& c) { @@ -457,7 +457,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that checks whether a given arc is vertical */ template < class CurvedKernelViaAnalysis_2 > -class Is_vertical_2 : public +class Is_vertical_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -465,18 +465,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES //! the result type typedef bool result_type; - + //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -500,26 +500,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor constructing minimum point of an arc (if interior) */ template < class CurvedKernelViaAnalysis_2 > -class Construct_min_vertex_2 : public +class Construct_min_vertex_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Point_2 result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -537,7 +537,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \pre minimum end-point is interior */ result_type operator()(const Arc_2& cv) const { - + return cv.curve_end(CGAL::ARR_MIN_END); } }; @@ -546,26 +546,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor constructing maximum point of an arc (if interior) */ template < class CurvedKernelViaAnalysis_2 > -class Construct_max_vertex_2 : public +class Construct_max_vertex_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Point_2 result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -583,7 +583,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \pre maximum end-point is interior */ result_type operator()(const Arc_2& cv) const { - + return cv.curve_end(CGAL::ARR_MAX_END); } }; @@ -592,24 +592,24 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor constructing an interior point of on an arc. */ template < class CurvedKernelViaAnalysis_2 > -class Construct_interior_vertex_2 : public +class Construct_interior_vertex_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Point_2 result_type; - /*!\brief + /*!\brief * Standard constructor * * \param kernel The kernel @@ -627,27 +627,27 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { result_type operator()(const Arc_2& arc) const { Point_2 p = compute_interior_vertex(arc); CGAL_postcondition(this->_ckva()->is_on_2_object()(p,arc)); - return p; + return p; } - + private: - + result_type compute_interior_vertex(const Arc_2& arc) const { - + typedef typename Curved_kernel_via_analysis_2::Curve_2 Curve_analysis_2; - - typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 + + typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Algebraic_curve_kernel_2; typedef typename Algebraic_curve_kernel_2::Bound Bound; typedef typename Algebraic_curve_kernel_2::Coordinate_1 Coordinate_1; - + typedef CGAL::Polynomial< Bound > Poly_rat_1; typedef CGAL::Polynomial< Poly_rat_1 > Poly_rat_2; - + typedef CGAL::Polynomial_traits_d< Poly_rat_1 > PT_rat_1; typedef CGAL::Polynomial_traits_d< Poly_rat_2 > PT_rat_2; - + typedef CGAL::Fraction_traits< Poly_rat_2 > FT_2; if (!arc.is_vertical()) @@ -655,13 +655,13 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Bound x_coord = arc.boundary_in_x_range_interior(); int arcno = arc.arcno(); const Curve_analysis_2& ca = arc.curve(); - + Point_2 p = Curved_kernel_via_analysis_2::instance(). - construct_point_on_arc_2_object() + construct_point_on_arc_2_object() (Coordinate_1(x_coord), ca, arcno, arc); return p; } - + Bound y_coord = 0; if (arc.is_finite(ARR_MIN_END)) { @@ -675,37 +675,37 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } else { - std::pair approx_pair = - Curved_kernel_via_analysis_2::instance().kernel(). - approximate_relative_y_2_object() - (arc.curve_end(ARR_MIN_END).xy(),4); + std::pair approx_pair = + Curved_kernel_via_analysis_2::instance().kernel(). + approximate_relative_y_2_object() + (arc.curve_end(ARR_MIN_END).xy(),4); y_coord = approx_pair.second + Bound(1); - + } } else { if (arc.is_finite(ARR_MAX_END)) { - std::pair approx_pair = - Curved_kernel_via_analysis_2::instance().kernel(). - approximate_relative_y_2_object() - (arc.curve_end(ARR_MAX_END).xy(),4); + std::pair approx_pair = + Curved_kernel_via_analysis_2::instance().kernel(). + approximate_relative_y_2_object() + (arc.curve_end(ARR_MAX_END).xy(),4); y_coord = approx_pair.first-Bound(1); } } - + /*! \todo Try to remove this polynomial stuff */ typename PT_rat_1::Construct_polynomial cp1; - Poly_rat_2 poly2 = typename PT_rat_2::Construct_polynomial() + Poly_rat_2 poly2 = typename PT_rat_2::Construct_polynomial() (cp1(-y_coord), cp1(Bound(1))); - + typename FT_2::Denominator_type dummy; typename FT_2::Numerator_type curve_poly; typename FT_2::Decompose() (poly2, curve_poly, dummy); - + Curve_analysis_2 curve = Curved_kernel_via_analysis_2::instance(). - kernel().construct_curve_2_object()(curve_poly); + kernel().construct_curve_2_object()(curve_poly); Point_2 p = Curved_kernel_via_analysis_2::instance(). construct_point_on_arc_2_object()(arc.x(), curve, 0, arc); return p; @@ -717,26 +717,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that compares x-coordinates of two interior points */ template < class CurvedKernelViaAnalysis_2 > -class Compare_x_2 : public +class Compare_x_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -744,7 +744,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Compare_x_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Compare the x-coordinates of two points. * @@ -765,7 +765,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that compares coordinates of two interior points lexicographically */ template < class CurvedKernelViaAnalysis_2 > -class Compare_xy_2 : public +class Compare_xy_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -773,18 +773,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -793,13 +793,13 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Base(kernel) { } - /*!\brief + /*!\brief * Compares two points lexigoraphically: by x, then by y. * \param p1 The first point. * \param p2 The second point. - * \return CGAL::LARGER if x(p1) > x(p2), + * \return CGAL::LARGER if x(p1) > x(p2), * or if x(p1) = x(p2) and y(p1) > y(p2); - * CGAL::SMALLER if x(p1) \< x(p2), + * CGAL::SMALLER if x(p1) \< x(p2), * or if x(p1) = x(p2) and y(p1) \< y(p2); * CGAL::EQUAL if the two points are equal. */ @@ -807,7 +807,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { bool equal_x = false) const { // TODO add CGAL_precondition(p1.location() == CGAL::ARR_INTERIOR); // TODO add CGAL_precondition(p2.location() == CGAL::ARR_INTERIOR); - + CERR("\ncompare_xy; p1: " << p1 << ";\n p2:" << p2 << ""); @@ -829,30 +829,30 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { }; /*!\brief - * Functor that computes relative vertical alignment of an interior point and + * Functor that computes relative vertical alignment of an interior point and * an arc */ template < class CurvedKernelViaAnalysis_2 > -class Compare_y_at_x_2 : public +class Compare_y_at_x_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -863,10 +863,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { /*!\brief * Return the relative vertical alignment of a point with an arc - * + * * \param p The point * \param cv The arc - * \return CGAL::SMALLER if y(p) \< cv(x(p)), i.e., + * \return CGAL::SMALLER if y(p) \< cv(x(p)), i.e., * the point is below the arc; * CGAL::LARGER if y(p) > cv(x(p)), i.e., * the point is above the arc; @@ -876,9 +876,9 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * */ result_type operator()(const Point_2& p, const Arc_2& cv) const { - + CGAL_precondition(p.is_finite()); - + CERR("\ncompare_y_at_x; p: " << p << ";\n cv:" << cv << "\n"); bool eq_min, eq_max; @@ -905,7 +905,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } if (cv.is_finite(CGAL::ARR_MAX_END)) { - if (cmp_xy(p.xy(), cv._maxpoint().xy(), true) == + if (cmp_xy(p.xy(), cv._maxpoint().xy(), true) == CGAL::LARGER) { CERR("cmp result: " << CGAL::LARGER << "\n"); return CGAL::LARGER; @@ -915,12 +915,12 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { return CGAL::EQUAL; // p lies on a vertical arc } CGAL::Comparison_result res; - if (eq_min) { + if (eq_min) { if(cv._minpoint().is_finite()){ res = cmp_xy(p.xy(), cv._minpoint().xy(), true); }else{ res = (cv.location(CGAL::ARR_MIN_END)==ARR_TOP_BOUNDARY)? - CGAL::SMALLER : CGAL::LARGER; + CGAL::SMALLER : CGAL::LARGER; } } else if (eq_max) { CGAL_precondition(p.is_finite()); @@ -928,13 +928,13 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { res = cmp_xy(p.xy(), cv._maxpoint().xy(), true); }else{ res = (cv.location(CGAL::ARR_MAX_END)==ARR_TOP_BOUNDARY)? - CGAL::SMALLER : CGAL::LARGER; + CGAL::SMALLER : CGAL::LARGER; } } else { Point_2 point_on_s = Base::_ckva()->construct_point_on_arc_2_object() (p.x(), cv.curve(), cv.arcno(), cv ); - + CGAL_precondition(p.is_finite()); CGAL_precondition(point_on_s.is_finite()); res = cmp_xy(p.xy(), point_on_s.xy(), true); @@ -949,26 +949,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * of a point */ template < class CurvedKernelViaAnalysis_2 > -class Compare_y_at_x_left_2 : public +class Compare_y_at_x_left_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -976,19 +976,19 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Compare_y_at_x_left_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief - * Compares the relative vertical alignment of two arcs - * immediately to the left of one of their intersection points. - * - * If one of the arcs is vertical (emanating downward from p), it is + * Compares the relative vertical alignment of two arcs + * immediately to the left of one of their intersection points. + * + * If one of the arcs is vertical (emanating downward from p), it is * always considered to be below the other curve. * * \param cv1 The first arc * \param cv2 The second arc * \param p The intersection point. - * \return The relative vertical alignment of cv1 with respect to cv2 - * immediately to the left of p: CGAL::SMALLER, CGAL::LARGER or + * \return The relative vertical alignment of cv1 with respect to cv2 + * immediately to the left of p: CGAL::SMALLER, CGAL::LARGER or CGAL::EQUAL. * * \pre The point p lies on both curves, and both of them must be also be @@ -1000,20 +1000,20 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { CERR("\ncompare_y_at_x_left(cv2); cv1: " << cv1 << "; cv2: " << cv2 << "; p: " << p << "\n"); - // ensure that p lies on both arcs + // ensure that p lies on both arcs CGAL_precondition(cv1.compare_y_at_x(p) == CGAL::EQUAL); CGAL_precondition(cv2.compare_y_at_x(p) == CGAL::EQUAL); - + // check whether both arcs indeed lie to the left of p CGAL_precondition( - (cv1.is_vertical() && - cv1.location(CGAL::ARR_MIN_END) == + (cv1.is_vertical() && + cv1.location(CGAL::ARR_MIN_END) == CGAL::ARR_BOTTOM_BOUNDARY) || cv1._same_arc_compare_xy(cv1._minpoint(), p) == CGAL::SMALLER ); CGAL_precondition( (cv2.is_vertical() && - cv2.location(CGAL::ARR_MIN_END) == CGAL::ARR_BOTTOM_BOUNDARY) + cv2.location(CGAL::ARR_MIN_END) == CGAL::ARR_BOTTOM_BOUNDARY) || cv2._same_arc_compare_xy(cv2._minpoint(), p) == CGAL::SMALLER ); @@ -1025,29 +1025,29 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { // a vertical arc is always smaller than the arc extending to the // left return CGAL::SMALLER; - } + } // a vertical arc is always smaller than the arc extending to the left; // due to the order, we have to return the opposite if (cv2.is_vertical()) { return CGAL::LARGER; } - + if (cv1.is_singular()) {// singularity in y CGAL_error_msg("Handling singularity in y is not yet implemented"); } - + // vertical line immediately to the left of p: if p lies on boundary // get the vertical line over the last interval; otherwise // obtain the interval w.r.t. point's x-coordinate (this also valid // for discontinuity in y) - /*if(bndp_x == CGAL::BEFORE_SINGULARITY || + /*if(bndp_x == CGAL::BEFORE_SINGULARITY || bndp_x == CGAL::BEFORE_DISCONTINUITY) return _compare_arc_numbers(cv2, bndp_x); else*/ - CGAL::Comparison_result res = + CGAL::Comparison_result res = cv1._compare_arc_numbers(cv2, - CGAL::ARR_INTERIOR, + CGAL::ARR_INTERIOR, p.x(), CGAL::NEGATIVE); CERR("result: " << res << "\n"); return res; @@ -1060,26 +1060,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * of a point */ template < class CurvedKernelViaAnalysis_2 > -class Compare_y_at_x_right_2 : public +class Compare_y_at_x_right_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1089,17 +1089,17 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } /*!\brief - * Compares the relative vertical alignment of two arcs - * immediately to the right of one of their intersection points. - * - * If one of the arcs is vertical (emanating downward from p), it is + * Compares the relative vertical alignment of two arcs + * immediately to the right of one of their intersection points. + * + * If one of the arcs is vertical (emanating downward from p), it is * always considered to be below the other curve. * * \param cv1 The first arc * \param cv2 The second arc * \param p The intersection point. - * \return The relative vertical alignment of cv1 with respect to cv2 - * immediately to the right of p: CGAL::SMALLER, CGAL::LARGER or + * \return The relative vertical alignment of cv1 with respect to cv2 + * immediately to the right of p: CGAL::SMALLER, CGAL::LARGER or CGAL::EQUAL. * * \pre The point p lies on both curves, and both of them must be also be @@ -1110,15 +1110,15 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { CERR("\ncompare_y_at_x_right; cv1: " << cv1 << "; cv2: " << cv2 << "; p: " << p << "\n"); - + // ensure that p lies on both arcs and doesn't lie on the positive // boundary CGAL_precondition(cv1.compare_y_at_x(p) == CGAL::EQUAL); CGAL_precondition(cv2.compare_y_at_x(p) == CGAL::EQUAL); - - // check whether both arcs indeed lie to the left of p + + // check whether both arcs indeed lie to the left of p CGAL_precondition( - (cv1.is_vertical() && + (cv1.is_vertical() && cv1.location(CGAL::ARR_MAX_END) == CGAL::ARR_TOP_BOUNDARY) || cv1._same_arc_compare_xy(p, cv1._maxpoint()) == CGAL::SMALLER ); @@ -1127,7 +1127,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { cv2.location(CGAL::ARR_MAX_END) == CGAL::ARR_TOP_BOUNDARY) || cv2._same_arc_compare_xy(p, cv2._maxpoint()) == CGAL::SMALLER ); - + if (cv1.is_vertical()) { // if both are vertical (they overlap), we return EQUAL if (cv2.is_vertical()) { @@ -1136,30 +1136,30 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { // a vertical arc is always LARGER than arc extending to the // right return CGAL::LARGER; - } - // a vertical arc is always LARGER than arc extending to the right; + } + // a vertical arc is always LARGER than arc extending to the right; // due to the order, we have to return the opposite if (cv2.is_vertical()) { return CGAL::SMALLER; } - + if (cv1.is_singular()) {// singularity in y CGAL_error_msg("Handling singularity in y is not yet \ implemented"); } - + // vertical line immediately to the right of p: if p lies on boundary // get the vertical line over the first interval; otherwise // obtain the interval w.r.t. point's x-coordinate (this also valid - // for discontinuity in y) - /*if(bndp_x == CGAL::AFTER_SINGULARITY || + // for discontinuity in y) + /*if(bndp_x == CGAL::AFTER_SINGULARITY || bndp_x == CGAL::AFTER_DISCONTINUITY) return _compare_arc_numbers(cv2, bndp_x); else*/ - CGAL::Comparison_result res = + CGAL::Comparison_result res = cv1._compare_arc_numbers(cv2, - CGAL::ARR_INTERIOR, - p.x(), + CGAL::ARR_INTERIOR, + p.x(), CGAL::POSITIVE); CERR("result: " << res << "\n"); return res; @@ -1170,26 +1170,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that checks whether a point is in the x-range of an arc */ template < class CurvedKernelViaAnalysis_2 > -class Is_in_x_range_2 : public +class Is_in_x_range_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef bool result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1197,10 +1197,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Is_in_x_range_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Check whether a given point lies within the curve's x-range - * + * * \param cv The arc * \param p the point * \return \c true if p lies in arc's x-range; \c false otherwise. @@ -1214,7 +1214,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Tests two objects, whether they are equal */ template < class CurvedKernelViaAnalysis_2 > -class Equal_2 : public +class Equal_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -1222,18 +1222,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef bool result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1241,7 +1241,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Equal_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Check if the two points are the same * @@ -1251,13 +1251,13 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { */ result_type operator()(const Point_2& p1, const Point_2& p2) const { return (Curved_kernel_via_analysis_2::instance(). - compare_xy_2_object()(p1, p2) == + compare_xy_2_object()(p1, p2) == CGAL::EQUAL); } - - /*!\brief - * Check if the two arcs are the same - * + + /*!\brief + * Check if the two arcs are the same + * * \param cv1 The first arc * \param cv2 The second arc * \return \c true if the two curves are the same; \c false otherwise. @@ -1271,27 +1271,27 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { if (cv1.is_vertical() != cv2.is_vertical()) { return false; } - - Arc_2::simplify(cv1,cv2); + + Arc_2::simplify(cv1,cv2); // distinct supporting curves implies inequality, provided the // coprimality condition is satisfied if (!cv1.curve().is_identical(cv2.curve())) { return false; } - + // here either both or none of the arcs are vertical, check for arcnos // equality if (!cv1.is_vertical() && cv1.arcno() != cv2.arcno()) { return false; } - // otherwise compare respective curve ends: supporting curves and + // otherwise compare respective curve ends: supporting curves and // arcnos are equal => the curve ends belong to the same arc return ((cv1._same_arc_compare_xy(cv1._minpoint(), cv2._minpoint()) == CGAL::EQUAL && cv1._same_arc_compare_xy(cv1._maxpoint(), cv2._maxpoint()) == CGAL::EQUAL)); } - + }; @@ -1299,26 +1299,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that checks whether two arcs overlap */ template < class CurvedKernelViaAnalysis_2 > -class Do_overlap_2 : public +class Do_overlap_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef bool result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1326,7 +1326,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Do_overlap_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Check whether two given arcs overlap, i.e., they have infinitely * many intersection points @@ -1336,18 +1336,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \return \c true if the curves overlap; \c false otherwise */ bool operator()(const Arc_2& cv1, const Arc_2& cv2) const { - + CERR("\ndo_overlap\n"); if (cv1.is_identical(cv2)) { return true; } - + Arc_2::simplify(cv1, cv2); - // arcs with coprime support do not overlap + // arcs with coprime support do not overlap if (!cv1.curve().is_identical(cv2.curve())) { return false; } - + if (cv1.is_vertical() != cv2.is_vertical()) { return false; // only one arc is vertical => can't overlap } @@ -1364,16 +1364,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { cv1._minpoint(), cv2._minpoint(), true) ) { case CGAL::EQUAL: // this->source == cv2->source => overlap ! - return true; + return true; case CGAL::SMALLER: // this->source < cv2->source // check whether this->target > cv2->source return (cv1._same_arc_compare_xy( - cv1._maxpoint(), cv2._minpoint(), + cv1._maxpoint(), cv2._minpoint(), true) == CGAL::LARGER); case CGAL::LARGER: // this->source > cv2->source // check whether this->source < cv2->target return (cv1._same_arc_compare_xy( - cv1._minpoint(), cv2._maxpoint(), + cv1._minpoint(), cv2._maxpoint(), true) == CGAL::SMALLER); } } @@ -1388,16 +1388,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { cv1._minpoint(), cv2._minpoint(), false, true) ) { case CGAL::EQUAL: // this->source == cv2->source => overlap ! - return true; + return true; case CGAL::SMALLER: // this->source < cv2->source // check whether this->target > cv2->source return (cv1._same_arc_compare_xy( - cv1._maxpoint(), cv2._minpoint(), false, + cv1._maxpoint(), cv2._minpoint(), false, true) == CGAL::LARGER); case CGAL::LARGER: // this->source > cv2->source // check whether this->source < cv2->target return (cv1._same_arc_compare_xy( - cv1._minpoint(), cv2._maxpoint(), false, + cv1._minpoint(), cv2._maxpoint(), false, true) == CGAL::SMALLER); } CGAL_error_msg("bogus comparison result"); @@ -1410,7 +1410,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that computes the intersections of two arcs */ template < class CurvedKernelViaAnalysis_2 > -class Intersect_2 : public +class Intersect_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -1418,19 +1418,19 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::cpp98::iterator< std::output_iterator_tag, CGAL::Object > result_type; - + //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1438,15 +1438,15 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Intersect_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + // TODO add operators for non-x-monotone arcs + curves (i.e., all combis) - + /*!\brief - * Find all intersections of the two given arcs and insert them to the - * output iterator. + * Find all intersections of the two given arcs and insert them to the + * output iterator. * - * Type of output iterator is \c CGAL::Object - * containing either an \c Arc_2 object (overlap) or a \c + * Type of output iterator is \c CGAL::Object + * containing either an \c Arc_2 object (overlap) or a \c * std::pair< Point_2, unsigned int >, where the unsigned int denotes * the multiplicity of the zero-dimensional intersection (0 if unknown) * @@ -1458,10 +1458,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { template < class OutputIterator > OutputIterator operator()(const Arc_2& cv1, const Arc_2& cv2, OutputIterator oi) const { - - CERR("\nintersect; cv1: " << cv1 + + CERR("\nintersect; cv1: " << cv1 << ";\n cv2:" << cv2 << ""); - + // if arcs overlap, just store their common part, otherwise compute // point-wise intersections std::vector< Arc_2 > common_arcs; @@ -1470,9 +1470,9 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { for(it = common_arcs.begin(); it < common_arcs.end(); it++) { *oi++ = CGAL::make_object(*it); } - return oi; + return oi; } - // process non-ov erlapping case + // process non-ov erlapping case typedef std::pair< Point_2, unsigned int > Point_and_mult; typedef std::vector< Point_and_mult > Point_vector; Point_vector vec; @@ -1492,26 +1492,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functors that trims an arc */ template < class CurvedKernelViaAnalysis_2 > -class Trim_2 : public +class Trim_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Arc_2 result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1519,10 +1519,10 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Trim_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Returns a trimmed version of an arc - * + * * \param cv The arc * \param p the new first endpoint * \param q the new second endpoint @@ -1532,15 +1532,15 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \pre both points must be interior and must lie on \c cv */ Arc_2 operator()(const Arc_2& cv, const Point_2& p, const Point_2& q) { - + CERR("trim\n"); CGAL_precondition(p.location() == CGAL::ARR_INTERIOR); CGAL_precondition(q.location() == CGAL::ARR_INTERIOR); - + CGAL_precondition(!Base::_ckva()->equal_2_object()(p, q)); CGAL_precondition(cv.compare_y_at_x(p) == CGAL::EQUAL); - CGAL_precondition(cv.compare_y_at_x(q) == CGAL::EQUAL); + CGAL_precondition(cv.compare_y_at_x(q) == CGAL::EQUAL); return cv._trim(p, q); } @@ -1551,26 +1551,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that splits a arc at an interior point */ template < class CurvedKernelViaAnalysis_2 > -class Split_2 : public +class Split_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef void result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1578,25 +1578,25 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Split_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Split a given arc at a given point into two sub-arcs - * + * * \param cv The arc to split * \param p The split point * \param c1 Output: The left resulting subcurve (p is its right endpoint) * \param c2 Output: The right resulting subcurve (p is its left endpoint) - * + * * \pre p lies on cv but is not one of its end-points. */ void operator()(const Arc_2& cv, const Point_2 & p, Arc_2& c1, Arc_2& c2) const { - + CGAL_precondition(cv.compare_y_at_x(p) == CGAL::EQUAL); // check that p is not an end-point of the arc CGAL_precondition(cv._same_arc_compare_xy(cv._minpoint(), p) != CGAL::EQUAL); CGAL_precondition(cv._same_arc_compare_xy(cv._maxpoint(), p) != CGAL::EQUAL); - + CERR("\nsplit\n"); c1 = cv._replace_endpoints( cv._minpoint(), p, -1, (cv.is_vertical() ? -1 : cv.arcno()) @@ -1611,26 +1611,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that computes whether two arcs are mergeable */ template < class CurvedKernelViaAnalysis_2 > -class Are_mergeable_2 : public +class Are_mergeable_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef bool result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1638,7 +1638,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Are_mergeable_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Check whether two given arcs are mergeable * @@ -1648,59 +1648,59 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * by the same curve and share a common endpoint; \c false otherwise. */ bool operator()(const Arc_2& cv1, const Arc_2& cv2) const { - + CERR("\nare_mergeable\n"); - + if (cv1.do_overlap(cv2)) {// if arcs overlap they are not mergeable return false; // this also call simplify } - + // touch in at most one point now and supporting curves are simplified // both arcs must be either vertical or not - if (!cv1.curve().is_identical(cv2.curve()) || + if (!cv1.curve().is_identical(cv2.curve()) || cv1.is_vertical() != cv2.is_vertical()) { return false; } // if both arcs are non-vertical => they must have equal arcnos - // to be mergeable + // to be mergeable if (!cv1.is_vertical() && cv1.arcno() != cv2.arcno()) { return false; } // for non-vertical arcs arc numbers are equal => can use same_arc_cmp - bool max_min = - (cv1._same_arc_compare_xy(cv1._maxpoint(), cv2._minpoint()) == + bool max_min = + (cv1._same_arc_compare_xy(cv1._maxpoint(), cv2._minpoint()) == CGAL::EQUAL), min_max = false; if (!max_min) { // both cases cannot happen simultaneously - min_max = - (cv1._same_arc_compare_xy(cv1._minpoint(), cv2._maxpoint()) == + min_max = + (cv1._same_arc_compare_xy(cv1._minpoint(), cv2._maxpoint()) == CGAL::EQUAL); if (!min_max) { // arcs have no common end-point => not mergeable return false; } } // check that the common point is not an event point - if (cv1.is_vertical()) { // both arcs are vertical + if (cv1.is_vertical()) { // both arcs are vertical Point_2 common = (max_min ? cv1._maxpoint() : cv1._minpoint()); // a common end must be a finite point CGAL_precondition(cv1.is_interior(common.location())); - // check that there are no other non-vertical branches coming + // check that there are no other non-vertical branches coming // through this point - + Curve_analysis_2 ca_2(cv1.curve()); - typename Curve_analysis_2::Status_line_1 cv_line = + typename Curve_analysis_2::Status_line_1 cv_line = ca_2.status_line_for_x(common.x()); CGAL_assertion(cv_line.is_event()); // ?? // we are not allowed to use number_of_incident_branches() - // since the common point might be supported by different curve, + // since the common point might be supported by different curve, // and therefore its arcno might be not valid for *this arc for (int k = 0; k < cv_line.number_of_events(); k++) { // use a temporary object for comparison predicate typename Point_2::Coordinate_2 tmp(common.x(), cv1.curve(), k); if (Curved_kernel_via_analysis_2::instance(). kernel().compare_xy_2_object()( - common.xy(), tmp) == + common.xy(), tmp) == CGAL::EQUAL) { return false; } @@ -1708,7 +1708,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } else if (cv1.interval_id() != cv2.interval_id()) { return false; // non-vertical case } - + return true; } }; @@ -1717,26 +1717,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that merges two arcs */ template < class CurvedKernelViaAnalysis_2 > -class Merge_2 : public +class Merge_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef void result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1751,26 +1751,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \param cv1 The first arc * \param cv2 The second arc * \param c Output: The resulting arc - * + * * \pre The two arcs are mergeable, that is they are supported by the * same curve and share a common endpoint. - */ + */ void operator()(const Arc_2& cv1, const Arc_2& cv2, Arc_2& c) const { - + CERR("merge\n"); CGAL_precondition(cv1.are_mergeable(cv2)); Arc_2::simplify(cv1, cv2); - + Point_2 src, tgt; int arcno_s = -1, arcno_t = -1; bool replace_src; // true if cv2 < *this otherwise *this arc < cv2 arc // arcs are mergeable => they have one common finite end-point - replace_src = - (cv1._same_arc_compare_xy(cv1._minpoint(), cv2._maxpoint()) == + replace_src = + (cv1._same_arc_compare_xy(cv1._minpoint(), cv2._maxpoint()) == CGAL::EQUAL); src = (replace_src ? cv2._minpoint() : cv1._minpoint()); tgt = (replace_src ? cv1._maxpoint() : cv2._maxpoint()); - + if (!cv1.is_vertical()) { arcno_s = (replace_src ? cv2.arcno(CGAL::ARR_MIN_END) : cv1.arcno(CGAL::ARR_MIN_END)); @@ -1780,7 +1780,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Arc_2 arc = cv1._replace_endpoints(src, tgt, arcno_s, arcno_t).first; // arc.set_boundaries_after_merge(*this, s); - no need to, since // boundaries are stored in Point_2 type and will be copied implicitly - + c = arc; } }; @@ -1790,7 +1790,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that computes whether a point lies on a supporting curve */ template < class CurvedKernelViaAnalysis_2 > -class Is_on_2 : public +class Is_on_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -1798,18 +1798,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef bool result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1817,16 +1817,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Is_on_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief - * Checks whether \c p lies on \c c - * + * Checks whether \c p lies on \c c + * * \param p The point to test * \param c The curve * \return \c true if the \c p lies on \c c, \c false otherwise */ result_type operator()(const Point_2& p, const Curve_analysis_2& c) const { - result_type res = + result_type res = (Curved_kernel_via_analysis_2::instance(). kernel().sign_at_2_object()(c, p.xy()) == CGAL::ZERO); @@ -1834,24 +1834,24 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } /*!\brief - * Checks whether \c p lies on \c cv - * + * Checks whether \c p lies on \c cv + * * \param p The point to test * \param c The curve arc * \return \c true if the \c p lies on \c cv, \c false otherwise */ result_type operator()(const Point_2& p, const Arc_2& cv) const { - // fix by Michael Hemmer: + // fix by Michael Hemmer: if(cv.is_in_x_range(p.x())){ return cv.compare_y_at_x(p) == CGAL::EQUAL; } - return false; - + return false; + // This is the old code that seems to interpret the arc as open - // In particular, it returns false for vertical arcs. + // In particular, it returns false for vertical arcs. // (Michael Hemmer) // bool is_left, is_right; -// result_type res = +// result_type res = // (cv.is_in_x_range(p.x(),&is_left,&is_right)) && // !(is_left) && // !(is_right) && @@ -1862,11 +1862,11 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { }; -/*!\brief +/*!\brief * Functor that decomposes curve into x-monotone arcs and isolated points */ template < class CurvedKernelViaAnalysis_2 > -class Make_x_monotone_2 : public +class Make_x_monotone_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -1874,32 +1874,32 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::cpp98::iterator< std::output_iterator_tag, CGAL::Object > result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel */ Make_x_monotone_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { - } + } /*!\brief - * Decomposes a given arc into list of x-monotone arcs - * (subcurves) and insert them to the output iterator. Since \c Arc_2 - * is by definition x-monotone, an input arc is passed to the - * output iterator directly. + * Decomposes a given arc into list of x-monotone arcs + * (subcurves) and insert them to the output iterator. Since \c Arc_2 + * is by definition x-monotone, an input arc is passed to the + * output iterator directly. * * \param cv The arc * \param oi The output iterator, whose value-type is Object @@ -1908,15 +1908,15 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { */ template < class OutputIterator > OutputIterator operator()(const Arc_2& cv, OutputIterator oi) const { - + *oi++ = CGAL::make_object(cv); return oi; } - - /*!\brief + + /*!\brief * Decomposes a given curve into list of x-monotone arcs - * (subcurves) and isolated points and insert them to the output iterator. - * + * (subcurves) and isolated points and insert them to the output iterator. + * * \param cv The curve * \param oi The output iterator, whose value-type is Object. * The returned objects either wrapper Arc_2 or Point_2 objects @@ -1925,7 +1925,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { template < class OutputIterator > OutputIterator operator()(const Curve_analysis_2& cv, OutputIterator oi) const { - + CGAL::internal::Make_x_monotone_2< Curved_kernel_via_analysis_2 > make_x_monotone(Base::_ckva()); @@ -1949,11 +1949,11 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Curve_analysis_2 curve; Non_x_monotone_arc_2 nxarc; - if(CGAL::assign(curve, obj)) + if(CGAL::assign(curve, obj)) oi = (*this)(curve, oi); else if(CGAL::assign(nxarc, obj)) - std::cerr << "AU BACKE" << std::endl; - //oi = std::transform(nxarc.begin(), nxarc.end(), oi, + std::cerr << "AU BACKE" << std::endl; + //oi = std::transform(nxarc.begin(), nxarc.end(), oi, // std::ptr_fun(CGAL::make_object)); else // allow the remaining objects to pass through *oi++ = obj; @@ -1968,7 +1968,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor computing parameter space in x for arc */ template < class CurvedKernelViaAnalysis_2 > -class Parameter_space_in_x_2 : public +class Parameter_space_in_x_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -1976,18 +1976,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Arr_parameter_space result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -1995,7 +1995,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Parameter_space_in_x_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*! Obtains the parameter space in x at the end of an arc. * * \param cv The arc @@ -2003,7 +2003,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * ARR_MIN_END - the minimal end of cv * ARR_MAX_END - the maximal end of cv * \return the parameter space at the \c ce end of \c cv - * ARR_LEFT_BOUNDARY - the arc approaches the left boundary of the + * ARR_LEFT_BOUNDARY - the arc approaches the left boundary of the * parameter space * ARR_INTERIOR - the arc does not approach a boundary of the * parameter space @@ -2028,7 +2028,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that compares ends of arcs near left or right boundary */ template < class CurvedKernelViaAnalysis_2 > -class Compare_y_near_boundary_2 : public +class Compare_y_near_boundary_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2036,18 +2036,18 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -2059,7 +2059,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { /*!\brief * Compare the y-coordinates of 2 arcs at their ends near the left * or right boundary of the parameter space - * + * * \param cv1 the first arc. * \param cv2 the second arc. * \param ce the arc end indicator. @@ -2073,63 +2073,63 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { */ result_type operator()(const Arc_2& cv1, const Arc_2& cv2, CGAL::Arr_curve_end ce) const { - + CERR("\ncompare_y_near_boundary; cv1: " << cv1 << "; cv2: " << cv2 << "; end: " << ce << "\n"); - - + + CGAL::Comparison_result res = CGAL::EQUAL; - + CGAL::Arr_parameter_space loc1 = cv1.location(ce); CGAL_precondition(cv1.is_on_left_right(loc1)); CGAL_precondition(loc1 == cv2.location(ce)); // comparing ids is the same as calling is_identical() ?? if (cv1.id() == cv2.id()) { - CERR("result: " << res << "\n"); // EQUAL - return res; - } - + CERR("result: " << res << "\n"); // EQUAL + return res; + } + // both points lie on the left-right-identification, i.e., equalx // TODO this interface is NOT official - CGAL::Object obj1 = - cv1.curve().asymptotic_value_of_arc(loc1, cv1.arcno()); - CGAL::Object obj2 = - cv2.curve().asymptotic_value_of_arc(loc1, cv2.arcno()); - + CGAL::Object obj1 = + cv1.curve().asymptotic_value_of_arc(loc1, cv1.arcno()); + CGAL::Object obj2 = + cv2.curve().asymptotic_value_of_arc(loc1, cv2.arcno()); + typename Point_2::Curved_kernel_via_analysis_2::Curve_kernel_2:: - Algebraic_real_1 y1, y2; + Algebraic_real_1 y1, y2; CGAL::Arr_parameter_space ps1, ps2; - + if (CGAL::assign(ps1, obj1)) { - if (CGAL::assign(ps2, obj2)) { - res = CGAL::EQUAL; - } else { - CGAL_assertion(CGAL::assign(y2, obj2)); - res = (ps1 == CGAL::ARR_BOTTOM_BOUNDARY ? - CGAL::SMALLER : CGAL::LARGER); - } + if (CGAL::assign(ps2, obj2)) { + res = CGAL::EQUAL; + } else { + CGAL_assertion(CGAL::assign(y2, obj2)); + res = (ps1 == CGAL::ARR_BOTTOM_BOUNDARY ? + CGAL::SMALLER : CGAL::LARGER); + } } else { - CGAL_assertion_code(bool check = ) - CGAL::assign(y1, obj1); - CGAL_assertion(check); - if (CGAL::assign(ps2, obj2)) { - res = (ps2 == CGAL::ARR_TOP_BOUNDARY ? - CGAL::SMALLER : CGAL::LARGER); - } else { - CGAL_assertion_code(bool check = ) - CGAL::assign(y2, obj2); - CGAL_assertion(check); - - // Remark: Is filtered - res = Base::_ckva()->kernel().compare_1_object()(y1, y2); - } + CGAL_assertion_code(bool check = ) + CGAL::assign(y1, obj1); + CGAL_assertion(check); + if (CGAL::assign(ps2, obj2)) { + res = (ps2 == CGAL::ARR_TOP_BOUNDARY ? + CGAL::SMALLER : CGAL::LARGER); + } else { + CGAL_assertion_code(bool check = ) + CGAL::assign(y2, obj2); + CGAL_assertion(check); + + // Remark: Is filtered + res = Base::_ckva()->kernel().compare_1_object()(y1, y2); + } } - + if (res != EQUAL) { CERR("result: " << res << "\n"); return res; } - + CGAL_precondition(cv1.is_on_left_right(loc1)); CGAL_precondition(loc1 == cv2.location(ce)); // comparing ids is the same as calling is_identical() ?? @@ -2137,8 +2137,8 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { CGAL::Comparison_result res = CGAL::EQUAL; CERR("result: " << res << "\n"); return res; - } - + } + // in this setting same handling as for +/-oo ? res = cv1._compare_arc_numbers(cv2, loc1); CERR("result: " << res << "\n"); @@ -2149,26 +2149,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { // bottom-top template < class CurvedKernelViaAnalysis_2 > -class Parameter_space_in_y_2 : public +class Parameter_space_in_y_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { - + public: //! this instance' first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Arr_parameter_space result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel @@ -2178,13 +2178,13 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { } /*! Obtains the parameter space in y at the end of an arc. - * + * * \param cv The arc * \param ce the arc end indicator: * ARR_MIN_END - the minimal end of cv * ARR_MAX_END - the maximal end of cv * \return the parameter space at the \c ce end of \c cv - * ARR_BOTTOM_BOUNDARY- the arc approaches the bottom boundary of the + * ARR_BOTTOM_BOUNDARY- the arc approaches the bottom boundary of the * parameter space * ARR_INTERIOR - the arc does not approach a boundary of the * parameter space @@ -2192,7 +2192,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * parameter space */ result_type operator()(const Arc_2& cv, CGAL::Arr_curve_end ce) const { - + CGAL::Arr_parameter_space loc = cv.location(ce); if(loc == CGAL::ARR_BOTTOM_BOUNDARY || loc == CGAL::ARR_TOP_BOUNDARY) return loc; @@ -2210,7 +2210,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that compares x-limits at the top or bottom boundary */ template < class CurvedKernelViaAnalysis_2 > -class Compare_x_at_limit_2 : public +class Compare_x_at_limit_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2218,12 +2218,12 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; @@ -2235,7 +2235,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { /*!\brief Compare the x-limit of a vertical with the x-limit of * an arc end near the boundary at bottom or top boundary - * + * * \param p the point direction. * \param cv the arc, the endpoint of which is compared. * \param ce the arc-end indicator - @@ -2255,13 +2255,13 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { CERR("\ncompare_x_at_limit: p: " << p << "\n cv: " << cv << "; curve_end: " << ce << "\n"); - + // this curve end has boundary only in y CGAL_precondition(cv.is_on_bottom_top(cv.location(ce))); if (cv.is_singular()) // the curve end goes to contraction => x-order - return CGAL::EQUAL; // doesn't matter + return CGAL::EQUAL; // doesn't matter - CGAL::Comparison_result res = + CGAL::Comparison_result res = Curved_kernel_via_analysis_2::instance(). kernel().compare_1_object()( p.x(), cv.curve_end_x(ce) @@ -2270,7 +2270,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { return res; } - /*! Compare the x-limits of 2 arcs ends near the top or bottom + /*! Compare the x-limits of 2 arcs ends near the top or bottom * boundary of the parameter space * \param cv1 the first arc. * \param ce1 the first arc end indicator - @@ -2293,24 +2293,24 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { CERR("\ncompare_x_at_limit: cv1: " << cv1 << "\n cv2: " << cv2 << "; end1: " << ce1 << "; end2: " << ce2 << "\n"); - /*CGAL::Arr_boundary_type bnd1 = boundary(end1), + /*CGAL::Arr_boundary_type bnd1 = boundary(end1), bnd2 = cv2.boundary(ce2);*/ CGAL_precondition_code(CGAL::Arr_parameter_space loc1 = cv1.location(ce1)); CGAL_precondition_code(CGAL::Arr_parameter_space loc2 = cv2.location(ce2)); CGAL_precondition(cv1.is_on_bottom_top(loc1)); CGAL_precondition(cv1.is_on_bottom_top(loc2)); - + if (cv1.is_singular() != cv1.is_singular()) { // only one curve end lies at singularity (another at +/-oo) CGAL_error_msg("SINGULARITY + INF comparison is not yet \ implemented"); } - + CGAL::Comparison_result res = Curved_kernel_via_analysis_2::instance(). - kernel().compare_1_object()( - cv1.curve_end_x(ce1), - cv2.curve_end_x(ce2) - ); + kernel().compare_1_object()( + cv1.curve_end_x(ce1), + cv2.curve_end_x(ce2) + ); CERR("result: " << res << "\n"); return res; } @@ -2321,7 +2321,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * Functor that compares x-coordinates near the top or bottom boundary */ template < class CurvedKernelViaAnalysis_2 > -class Compare_x_near_limit_2 : public +class Compare_x_near_limit_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2329,12 +2329,12 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; @@ -2344,7 +2344,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { Base(kernel) { } - /*! Compare the x-coordinates of 2 arcs ends near the top or bottom + /*! Compare the x-coordinates of 2 arcs ends near the top or bottom * boundary of the parameter space * \param cv1 the first arc. * \param cv2 the second arc. @@ -2361,7 +2361,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { * \pre both curve ends are on the same boundary */ result_type operator()(const Arc_2& cv1, const Arc_2& cv2, - CGAL::Arr_curve_end ce) const { + CGAL::Arr_curve_end ce) const { CERR("\ncompare_x_near_limit: cv1: " << cv1 << "\n cv2: " << cv2 << "; ce: " << ce << "\n"); @@ -2371,33 +2371,33 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { cv2.location(ce)); CGAL_precondition(cv1.is_on_bottom_top(loc1)); CGAL_precondition(cv1.is_on_bottom_top(loc2)); - CGAL_precondition(cv1.compare_x_at_limit(ce, cv2, ce) == CGAL::EQUAL); + CGAL_precondition(cv1.compare_x_at_limit(ce, cv2, ce) == CGAL::EQUAL); CGAL_precondition(loc1 == loc2); - Coordinate_1 x0(cv1.curve_end_x(ce)); - CGAL::Comparison_result res = cv1._compare_arc_numbers( - cv2, CGAL::ARR_INTERIOR, x0, - (ce == CGAL::ARR_MIN_END ? - CGAL::POSITIVE : CGAL::NEGATIVE) - ); - if ((ce == CGAL::ARR_MAX_END && - loc1 == CGAL::ARR_TOP_BOUNDARY) || - (ce == CGAL::ARR_MIN_END && - loc1 == CGAL::ARR_BOTTOM_BOUNDARY)) { - res = opposite(res); - } + Coordinate_1 x0(cv1.curve_end_x(ce)); + CGAL::Comparison_result res = cv1._compare_arc_numbers( + cv2, CGAL::ARR_INTERIOR, x0, + (ce == CGAL::ARR_MIN_END ? + CGAL::POSITIVE : CGAL::NEGATIVE) + ); + if ((ce == CGAL::ARR_MAX_END && + loc1 == CGAL::ARR_TOP_BOUNDARY) || + (ce == CGAL::ARR_MIN_END && + loc1 == CGAL::ARR_BOTTOM_BOUNDARY)) { + res = opposite(res); + } CERR("result: " << res << "\n"); return res; } }; -/*!\brief +/*!\brief * Functor to construct a point on a curve */ template < class CurvedKernelViaAnalysis_2 > -class Compare_endpoints_xy_2 : public +class Compare_endpoints_xy_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2405,16 +2405,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef CGAL::Comparison_result result_type; - /*!\brief + /*!\brief * Standard constructor * * \param kernel The kernel @@ -2425,26 +2425,26 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { /*!\brief * Compares endpoints of arc lexicographically - * - * \param arc the arc + * + * \param arc the arc * \return The order of endpoints */ CGAL::Comparison_result operator()(const Arc_2& xcv) { if (xcv.is_left_to_right()) { return (CGAL::SMALLER); } else { - return (CGAL::LARGER); + return (CGAL::LARGER); } return CGAL::EQUAL; } }; -/*!\brief +/*!\brief * Functor to construct a point on a curve */ template < class CurvedKernelViaAnalysis_2 > -class Construct_opposite_2 : public +class Construct_opposite_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2452,16 +2452,16 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; - + CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES - + //! the result type typedef Arc_2 result_type; - /*!\brief + /*!\brief * Standard constructor * * \param kernel The kernel @@ -2472,7 +2472,7 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { /*!\brief * Construct an arc of opposite direction - * + * * \param arc the arc to be reversed * \return The reversed arc */ @@ -2483,11 +2483,11 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { -/*!\brief +/*!\brief * Functor that computes the x-extreme points of a curve */ template < class CurvedKernelViaAnalysis_2 > -class X_extreme_points_2 : public +class X_extreme_points_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2495,33 +2495,33 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES typedef typename Curve_analysis_2::Coordinate_2 Coordinate_2; - + //! the result type typedef CGAL::cpp98::iterator< std::output_iterator_tag, Coordinate_2 > result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel */ X_extreme_points_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { - } + } /*!\brief */ template < class OutputIterator > - OutputIterator operator()(const Curve_analysis_2& ca, + OutputIterator operator()(const Curve_analysis_2& ca, OutputIterator oi) const { typedef typename Curve_analysis_2::Status_line_1 Status_line_1; @@ -2529,9 +2529,9 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { int events = ca.number_of_status_lines_with_event(); for ( int i = 0; i < events; i++ ) { - + Status_line_1 status_line = ca.status_line_at_event(i); - + int lifts = status_line.number_of_events(); for( int j = 0; j < lifts; j++ ) { @@ -2539,20 +2539,20 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { std::pair arcs = status_line.number_of_incident_branches(j); - if (arcs.first == 0 || arcs.second == 0) + if (arcs.first == 0 || arcs.second == 0) *oi++ = status_line.algebraic_real_2(j); } } return oi; } - + }; -/*!\brief +/*!\brief * Functor that computes the y-extreme points of a curve */ template < class CurvedKernelViaAnalysis_2 > -class Y_extreme_points_2 : public +class Y_extreme_points_2 : public Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { public: @@ -2560,61 +2560,61 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //! the base type - typedef + typedef Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 > Base; CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES typedef typename Curve_analysis_2::Coordinate_2 Coordinate_2; - + //! the result type typedef CGAL::cpp98::iterator< std::output_iterator_tag, Coordinate_2 > result_type; //! the arity of the functor - - /*!\brief + + /*!\brief * Standard constructor * * \param kernel The kernel */ Y_extreme_points_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { - } + } /*!\brief */ template < class OutputIterator > - OutputIterator operator()(const Curve_analysis_2& ca, + OutputIterator operator()(const Curve_analysis_2& ca, OutputIterator oi) const { typedef typename Curve_analysis_2::Status_line_1 Status_line_1; typename Base::Curve_kernel_2 curve_kernel = Base::_ckva()->kernel(); - - Curve_analysis_2 ca_yx + + Curve_analysis_2 ca_yx = curve_kernel.swap_x_and_y_2_object() (ca); - + std::vector y_critical_points; Base::_ckva()->x_extreme_points_2_object()(ca_yx, std::back_inserter(y_critical_points)); - for( typename std::vector::iterator it + for( typename std::vector::iterator it = y_critical_points.begin(); it != y_critical_points.end(); it++ ) { - + Coordinate_1 curr_x = curve_kernel.get_y_2_object()( *it ); Status_line_1 status_line = ca.status_line_at_exact_x(curr_x); - + int lifts = status_line.number_of_events(); - + for( int i = 0; i < lifts; i++ ) { Coordinate_2 lift_xy = status_line.algebraic_real_2(i); - + bool y_coordinate_found; while(true) { @@ -2629,23 +2629,23 @@ Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > { y_coordinate_found = true; break; } - + curve_kernel.refine_x_2_object() (*it); } - + if(y_coordinate_found) { *oi++ = Coordinate_2(curr_x, ca, i); break; - } + } } } return oi; } - + }; -#undef CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES +#undef CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES } // namespace Curved_kernel_via_analysis_2_Functors @@ -2658,13 +2658,13 @@ class Curved_kernel_via_analysis_2_functors { public: //!\name Public types //!@{ - + //! this instance's first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //!@} // typedef Curved_kernel_via_analysis_2_functors< // CurvedKernelViaAnalysis_2 > Functor_base; - + // declares curved kernel functors, for each functor defines a member function // returning an instance of this functor #define CGAL_CKvA_2_functor_pred(Y, Z) \ @@ -2675,9 +2675,9 @@ class Curved_kernel_via_analysis_2_functors { #define CGAL_CKvA_2_functor_cons(Y, Z) CGAL_CKvA_2_functor_pred(Y, Z) - CGAL_CKvA_2_functor_pred(Compare_x_2, compare_x_2_object); + CGAL_CKvA_2_functor_pred(Compare_x_2, compare_x_2_object); CGAL_CKvA_2_functor_pred(Compare_xy_2, compare_xy_2_object); - CGAL_CKvA_2_functor_pred(Is_vertical_2, is_vertical_2_object); + CGAL_CKvA_2_functor_pred(Is_vertical_2, is_vertical_2_object); CGAL_CKvA_2_functor_cons(Construct_min_vertex_2, construct_min_vertex_2_object); @@ -2686,32 +2686,32 @@ class Curved_kernel_via_analysis_2_functors { CGAL_CKvA_2_functor_cons(Construct_interior_vertex_2, construct_interior_vertex_2_object); - CGAL_CKvA_2_functor_pred(Compare_y_at_x_2, compare_y_at_x_2_object); + CGAL_CKvA_2_functor_pred(Compare_y_at_x_2, compare_y_at_x_2_object); CGAL_CKvA_2_functor_pred(Compare_y_at_x_left_2, compare_y_at_x_left_2_object); CGAL_CKvA_2_functor_pred(Compare_y_at_x_right_2, compare_y_at_x_right_2_object); - CGAL_CKvA_2_functor_pred(Equal_2, equal_2_object); + CGAL_CKvA_2_functor_pred(Equal_2, equal_2_object); CGAL_CKvA_2_functor_pred(Is_in_x_range_2, is_in_x_range_2_object); CGAL_CKvA_2_functor_pred(Do_overlap_2, do_overlap_2_object); CGAL_CKvA_2_functor_cons(Intersect_2, intersect_2_object); CGAL_CKvA_2_functor_cons(Trim_2, trim_2_object); - CGAL_CKvA_2_functor_cons(Split_2, split_2_object); - CGAL_CKvA_2_functor_pred(Are_mergeable_2, are_mergeable_2_object); - CGAL_CKvA_2_functor_cons(Merge_2, merge_2_object); + CGAL_CKvA_2_functor_cons(Split_2, split_2_object); + CGAL_CKvA_2_functor_pred(Are_mergeable_2, are_mergeable_2_object); + CGAL_CKvA_2_functor_cons(Merge_2, merge_2_object); - CGAL_CKvA_2_functor_pred(Is_on_2, is_on_2_object); + CGAL_CKvA_2_functor_pred(Is_on_2, is_on_2_object); CGAL_CKvA_2_functor_cons(Make_x_monotone_2, make_x_monotone_2_object); - + // left-right - CGAL_CKvA_2_functor_pred(Parameter_space_in_x_2, + CGAL_CKvA_2_functor_pred(Parameter_space_in_x_2, parameter_space_in_x_2_object); CGAL_CKvA_2_functor_pred(Compare_y_near_boundary_2, compare_y_near_boundary_2_object); // bottom-top - CGAL_CKvA_2_functor_pred(Parameter_space_in_y_2, + CGAL_CKvA_2_functor_pred(Parameter_space_in_y_2, parameter_space_in_y_2_object); CGAL_CKvA_2_functor_pred(Compare_x_at_limit_2, compare_x_at_limit_2_object); @@ -2721,19 +2721,19 @@ class Curved_kernel_via_analysis_2_functors { CGAL_CKvA_2_functor_cons(X_extreme_points_2, x_extreme_points_2_object); CGAL_CKvA_2_functor_cons(Y_extreme_points_2, y_extreme_points_2_object); - CGAL_CKvA_2_functor_cons(Construct_point_2, + CGAL_CKvA_2_functor_cons(Construct_point_2, construct_point_2_object); - CGAL_CKvA_2_functor_cons(Construct_point_on_arc_2, + CGAL_CKvA_2_functor_cons(Construct_point_on_arc_2, construct_point_on_arc_2_object); - - CGAL_CKvA_2_functor_cons(Construct_arc_2, + + CGAL_CKvA_2_functor_cons(Construct_arc_2, construct_arc_2_object); - - CGAL_CKvA_2_functor_pred(Compare_endpoints_xy_2, + + CGAL_CKvA_2_functor_pred(Compare_endpoints_xy_2, compare_endpoints_xy_2_object); - CGAL_CKvA_2_functor_cons(Construct_opposite_2, + CGAL_CKvA_2_functor_cons(Construct_opposite_2, construct_opposite_2_object); #undef CGAL_CKvA_2_functor_pred diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h index 5762fa8de652..e5d220e482f0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -16,7 +16,7 @@ /*!\file include/CGAL/Curved_kernel_via_analysis_2.h * \brief defines class \c Curved_kernel_via_analysis_2 - * + * * Defines points and arcs supported by curves that can be analyzed. */ @@ -43,13 +43,13 @@ namespace internal { template < class NewCKvA, class BaseCKvA, class CurveKernel_2, template class FunctorBase = Curved_kernel_via_analysis_2_functors > -class Curved_kernel_via_analysis_2_base +class Curved_kernel_via_analysis_2_base : public FunctorBase< NewCKvA, BaseCKvA > { - + public: //!\name Global types //!@{ - + //! type of curve kernel typedef CurveKernel_2 Curve_kernel_2; @@ -58,7 +58,7 @@ class Curved_kernel_via_analysis_2_base struct rebind { typedef FunctorBase Functor_base; + BaseCKvA::Curved_kernel_via_analysis_2> Functor_base; }; //!\name Embedded types to fulfill \c ArrangementTraits_2 concept @@ -72,19 +72,19 @@ class Curved_kernel_via_analysis_2_base //! the multiplicity type typedef unsigned int Multiplicity; - + //!@} public: //!\name Tags //!@{ - + //! tag specifies that "to the left of" comparisons are supported typedef CGAL::Tag_true Has_left_category; //! tag specifies that merge and split functors are supported - typedef CGAL::Tag_true Has_merge_category; + typedef CGAL::Tag_true Has_merge_category; typedef CGAL::Tag_false Has_do_intersect_category; @@ -97,15 +97,15 @@ class Curved_kernel_via_analysis_2_base public: //!\name Caching - + //!@{ - + //! type of inverval arcno cache - typedef internal::Curve_interval_arcno_cache< Curve_kernel_2 > + typedef internal::Curve_interval_arcno_cache< Curve_kernel_2 > Curve_interval_arcno_cache; //!@} - + public: //! \name Constructors //!@{ @@ -119,23 +119,23 @@ class Curved_kernel_via_analysis_2_base Curved_kernel_via_analysis_2_base(const Curve_kernel_2& kernel) : _m_kernel(kernel) { } - + //!@} //!\name underlying curve kernel + caching //!@{ - + /*!\brief * access to static Curve_interval_arcno_cache */ const Curve_interval_arcno_cache& interval_arcno_cache() const { return _m_interval_arcno_cache; } - + /*!\brief * instance of internal Curve_kernel_2 instance * - * \return + * \return */ Curve_kernel_2& kernel() const { return _m_kernel; @@ -146,13 +146,13 @@ class Curved_kernel_via_analysis_2_base protected: //!\name private members //!@{ - + //! an instance of \c Curve_kernel_2 mutable Curve_kernel_2 _m_kernel; - + //! an instance of \c Curve_interval_arcno_cache mutable Curve_interval_arcno_cache _m_interval_arcno_cache; - + //!@} public: @@ -167,7 +167,7 @@ class Curved_kernel_via_analysis_2_base static NewCKvA& instance() { return set_instance(_set_instance()); } - + /*!\brief * sets static instance of \c Curved_kernel_via_analysis_2 to \c ckva * @@ -179,66 +179,66 @@ class Curved_kernel_via_analysis_2_base ) { CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, instance); CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, binstance); - + if (&ckva == &_reset_instance()) { - instance = binstance; + instance = binstance; } else if (&ckva != &_set_instance()) { binstance = instance; instance = ckva; } return instance; - + } - + /*!\brief * resets static instance to original one - */ + */ static void reset_instance() { set_instance(_reset_instance()); } - + private: - /*!\brief + /*!\brief * sets instance to default for internal purposes */ static NewCKvA& _set_instance() { CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, instance); return instance; - + } - - /*!\brief + + /*!\brief * sets instance to default for internal purposes */ static NewCKvA& _reset_instance() { CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, instance); return instance; } - + //!@} -}; - +}; + } // namespace internal template < class CurveKernel_2 > class Curved_kernel_via_analysis_2 : public internal::Curved_kernel_via_analysis_2_base< Curved_kernel_via_analysis_2, - void, CurveKernel_2 > + void, CurveKernel_2 > { -public: +public: //! type of curve kernel typedef CurveKernel_2 Curve_kernel_2; //! this instance itself typedef Curved_kernel_via_analysis_2< Curve_kernel_2 > Self; - - //! redefine rebind to terminate unrolling nested templates + + //! redefine rebind to terminate unrolling nested templates template < class X > struct rebind { typedef internal::Curved_kernel_via_analysis_2_functors< X > - Functor_base; + Functor_base; }; public: @@ -246,9 +246,9 @@ class Curved_kernel_via_analysis_2 : //!@{ typedef internal::Point_2< Self > Point_2; - + typedef internal::Arc_2< Self > Arc_2; - + //! type of weakly x-monotone arc for \c ArrangementTraits_2 typedef Arc_2 X_monotone_curve_2; @@ -256,7 +256,7 @@ class Curved_kernel_via_analysis_2 : protected: //!\name Protected base types //!@{ - + //! class collecting basic types typedef internal::Curved_kernel_via_analysis_2_base < Self, void, CurveKernel_2 > Base_kernel; @@ -272,7 +272,7 @@ class Curved_kernel_via_analysis_2 : Curved_kernel_via_analysis_2() : Base_kernel(Curve_kernel_2::get_static_instance()) { } - + /*!\brief * construct from \c kernel * @@ -281,9 +281,9 @@ class Curved_kernel_via_analysis_2 : Curved_kernel_via_analysis_2(const Curve_kernel_2& kernel) : Base_kernel(kernel) { } - + //!@} -}; +}; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h index 83a90b20f2c6..55d269ca01b2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Ophir Setter // @@ -30,8 +30,8 @@ namespace CGAL { * outputs a curve arc to \c Fig_stream */ template -CGAL::Fig_stream& -operator << +CGAL::Fig_stream& +operator << (CGAL::Fig_stream& ws, const internal::Arc_2< CKvA_2 >& arc) { typedef typename RatKernel::FT NT; @@ -46,9 +46,9 @@ operator << boost::optional < Coord_2 > p1, p2; std::list points; - Bbox_2 bbox (CGAL::to_double(ws.bounding_rect().xmin()), - CGAL::to_double(ws.bounding_rect().ymin()), - CGAL::to_double(ws.bounding_rect().xmax()), + Bbox_2 bbox (CGAL::to_double(ws.bounding_rect().xmin()), + CGAL::to_double(ws.bounding_rect().ymin()), + CGAL::to_double(ws.bounding_rect().xmax()), CGAL::to_double(ws.bounding_rect().ymax())); // The maximum resolution of the renderer is 2048. @@ -61,7 +61,7 @@ operator << Facade::instance().draw(arc, points, &p1, &p2); if(points.empty()) return ws; - + // When we create the polyline, we need to scale it back to "regular" // coordinates as the Fig_stream also scales them. @@ -81,13 +81,13 @@ operator << std::vector< Point_2 > polyline; for (; vit != vec.end(); ++vit) { - polyline.push_back(Point_2(vit->first / x_scale + x_min, + polyline.push_back(Point_2(vit->first / x_scale + x_min, vit->second / y_scale + y_min)); } lit++; ws.write_polyline(polyline.begin(), polyline.end()); } - + return ws; } @@ -95,28 +95,28 @@ operator << * outputs a curve point to \c Fig_stream */ template -CGAL::Fig_stream& -operator << +CGAL::Fig_stream& +operator << (CGAL::Fig_stream& ws, const internal::Point_2< CKvA_2 >& pt) { #if 0 // TODO check why no point is drawn! typedef typename RatKernel::Point_2 Point_2; typedef typename RatKernel::Segment_2 Segment_2; - - typedef Curve_renderer_facade Facade; - - Bbox_2 bbox(CGAL::to_double(ws.bounding_rect().xmin()), - CGAL::to_double(ws.bounding_rect().ymin()), - CGAL::to_double(ws.bounding_rect().xmax()), + + typedef Curve_renderer_facade Facade; + + Bbox_2 bbox(CGAL::to_double(ws.bounding_rect().xmin()), + CGAL::to_double(ws.bounding_rect().ymin()), + CGAL::to_double(ws.bounding_rect().xmax()), CGAL::to_double(ws.bounding_rect().ymax())); - + Facade::setup(bbox, ws.width(), ws.height()); - - std::pair< int, int > coord; + + std::pair< int, int > coord; if (!Facade::instance().draw(pt, coord)) { - return ws; + return ws; } - + int height = ws.height(); Point_2 rat_pt(coord.first, height - coord.second); @@ -124,7 +124,7 @@ operator << ws.set_fill_style(CGAL::FIG_FILLED); ws.set_fill_color(CGAL::FIG_BLACK); ws.set_point_style(CGAL::FIG_DISC); - + ws.write_point(rat_pt); #endif return ws; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h index ac7161968476..38c8eda3412a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -17,7 +17,7 @@ /*!\file include/CGAL/Filtered_curved_kernel_via_analysis_2.h * \brief defines class \c Filtered_curved_kernel_via_analysis_2 - * + * * Defines points and arcs supported by curves that can be analyzed * and where some operations are filtered. */ @@ -31,7 +31,7 @@ namespace CGAL { #ifndef CKvA_CERR -//#define FCKvA_DEBUG_PRINT_CERR +//#define FCKvA_DEBUG_PRINT_CERR #ifdef FCKvA_DEBUG_PRINT_CERR #define CKvA_CERR(x) std::cout << x #else @@ -68,13 +68,13 @@ class Compare_xy_2 : //! type of arc typedef typename Curved_kernel_via_analysis_2::Arc_2 Arc_2; #endif - + //! the base type typedef typename FunctorBase::Compare_xy_2 Base; //! the result type typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_xy_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { @@ -85,7 +85,7 @@ class Compare_xy_2 : * \param p1 The first point. * \param p2 The second point. * \return LARGER if x(p1) > x(p2), or if x(p1) = x(p2) and y(p1) > y(p2); - * SMALLER if x(p1) \< x(p2), or if x(p1) = x(p2) and + * SMALLER if x(p1) \< x(p2), or if x(p1) = x(p2) and * y(p1) \< y(p2); * EQUAL if the two points are equal. */ @@ -104,9 +104,9 @@ class Compare_xy_2 : template < class CurvedKernelViaAnalysis_2, class FunctorBase > -class Compare_y_near_boundary_2 : +class Compare_y_near_boundary_2 : public FunctorBase::Compare_y_near_boundary_2 { - + public: //! this instance template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -127,10 +127,10 @@ class Compare_y_near_boundary_2 : //! the bae type typedef typename FunctorBase::Compare_y_near_boundary_2 Base; - + //! the result type typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_y_near_boundary_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { @@ -147,8 +147,8 @@ class Compare_y_near_boundary_2 : */ result_type operator()(const Arc_2& cv1, const Arc_2& cv2, CGAL::Arr_curve_end ce) const { - - CKvA_CERR("\nfilteredcompare_y_near_boundary; cv1: " << cv1 + + CKvA_CERR("\nfilteredcompare_y_near_boundary; cv1: " << cv1 << "; cv2: " << cv2 << "; end: " << ce << "\n"); CGAL_assertion_code ( @@ -159,8 +159,8 @@ class Compare_y_near_boundary_2 : // comparing ids is the same as calling is_identical() ?? if (cv1.id() == cv2.id()) { return CGAL::EQUAL; - } - + } + typedef typename Arc_2::Curve_kernel_2 Curve_kernel_2; typedef typename Curve_kernel_2::Coordinate_1 Coordinate_1; @@ -168,16 +168,16 @@ class Compare_y_near_boundary_2 : CGAL::Object obj1, obj2; Coordinate_1 asym_info1, asym_info2; CGAL::Arr_parameter_space ps1, ps2; - + obj1 = cv1.curve().asymptotic_value_of_arc( cv1.location(ce), cv1.arcno() ); obj2 = cv2.curve().asymptotic_value_of_arc( cv2.location(ce), cv2.arcno() ); - + CGAL::Comparison_result filter_res = CGAL::EQUAL; - + if (CGAL::assign(ps1, obj1)) { if (CGAL::assign(ps2, obj2)) { if (ps1 == ps2) { @@ -207,13 +207,13 @@ class Compare_y_near_boundary_2 : ); } } - + if (filter_res != CGAL::EQUAL) { CGAL_assertion_code( { Base base_compare_y_near_boundary(this->_ckva()); - - CGAL::Comparison_result check_res = + + CGAL::Comparison_result check_res = base_compare_y_near_boundary(cv1, cv2, ce); CGAL_assertion(check_res == filter_res); } @@ -226,9 +226,9 @@ class Compare_y_near_boundary_2 : }; template < class CurvedKernelViaAnalysis_2, class FunctorBase > -class Compare_y_at_x_2 : +class Compare_y_at_x_2 : public FunctorBase::Compare_y_at_x_2 { - + public: //! this instance template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -248,10 +248,10 @@ class Compare_y_at_x_2 : //! the bae type typedef typename FunctorBase::Compare_y_at_x_2 Base; - + //! the result type typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_y_at_x_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { @@ -267,15 +267,15 @@ class Compare_y_at_x_2 : * EQUAL if p lies on the curve. */ result_type operator()(const Point_2& p, const Arc_2& cv) const { - + return Base::operator()(p, cv); } }; template < class CurvedKernelViaAnalysis_2, class FunctorBase > -class Compare_y_at_x_left_2 : +class Compare_y_at_x_left_2 : public FunctorBase::Compare_y_at_x_left_2 { - + public: //! this instance template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -298,12 +298,12 @@ class Compare_y_at_x_left_2 : //! the result type typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_y_at_x_left_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*! * Compares the y value of two x-monotone curves immediately to the left * of their intersection point. If one of the curves is vertical @@ -325,9 +325,9 @@ class Compare_y_at_x_left_2 : }; template < class CurvedKernelViaAnalysis_2, class FunctorBase > -class Compare_y_at_x_right_2 : +class Compare_y_at_x_right_2 : public FunctorBase::Compare_y_at_x_right_2 { - + public: //! this instance template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -347,15 +347,15 @@ class Compare_y_at_x_right_2 : //! the bae type typedef typename FunctorBase::Compare_y_at_x_right_2 Base; - + //! the result type typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_y_at_x_right_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*! * Compares the y value of two x-monotone curves immediately to the right * of their intersection point. If one of the curves is vertical @@ -407,43 +407,43 @@ class May_have_intersection_2 : private: - typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 + typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; - + typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; typedef typename Curve_kernel_2::Coordinate_1 Coordinate_1; typedef typename Curve_kernel_2::Coordinate_2 Coordinate_2; typedef typename Curve_kernel_2::X_real_traits_1 X_real_traits_1; typedef typename Curve_kernel_2::Y_real_traits_1 Y_real_traits_1; - + typename X_real_traits_1::Lower_boundary x_low; typename X_real_traits_1::Upper_boundary x_high; typename X_real_traits_1::Refine x_refine; - + typename Y_real_traits_1::Lower_boundary y_low; typename Y_real_traits_1::Upper_boundary y_high; typename Y_real_traits_1::Refine y_refine; - + typedef typename Coordinate_1::Rational Boundary; - + public: typedef bool result_type; - + //! standard constructor May_have_intersection_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*!\brief * Checks whether \c cv1 and \c cv2 can have an intersection. If * not it certainly returns false, if possible, it return true. */ bool operator()(const Arc_2& cv1, const Arc_2& cv2) const { - + Arc_2 trimmed_cv1, trimmed_cv2; if(! cv1.is_vertical() && ! cv2.is_vertical() ) { - + if(! cv1.trim_by_arc(cv2,trimmed_cv1,trimmed_cv2)) { return false; } @@ -455,12 +455,12 @@ class May_have_intersection_2 : std::list< CGAL::Bbox_2 > boxes1, boxes2; - construct_covering_approximation(trimmed_cv1, + construct_covering_approximation(trimmed_cv1, std::back_inserter(boxes1)); - construct_covering_approximation(trimmed_cv2, + construct_covering_approximation(trimmed_cv2, std::back_inserter(boxes2)); - + if (!boxes1.empty() && !boxes2.empty()) { // TODO better strategy than quadratic pair of for-loops (MK) for (typename std::list< CGAL::Bbox_2 >::const_iterator bit1 = @@ -470,10 +470,10 @@ class May_have_intersection_2 : if (CGAL::do_overlap(*bit1, *bit2)) { return true; } - } + } } - } - + } + return false; } @@ -486,15 +486,15 @@ class May_have_intersection_2 : OutputIterator construct_covering_approximation( const Arc_2& arc, OutputIterator oi) const { - CKvA_CERR("\nconstruct_covering_approximation; arc: " << arc + CKvA_CERR("\nconstruct_covering_approximation; arc: " << arc << ";\n cv:" << arc << "\n"); - + // TODO compute more than a single bbox (EB) CGAL::Bbox_2 bbox = arc.bbox(); - + CKvA_CERR("\nres: " << bbox << "\n"); - + *oi++ = bbox; return oi; } @@ -504,9 +504,9 @@ class May_have_intersection_2 : //! checks whether and how two arcs are intersection - with first filtering template < class CurvedKernelViaAnalysis_2, class FunctorBase > -class Intersect_2 : +class Intersect_2 : public FunctorBase::Intersect_2 { - + public: //! this instance template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -531,11 +531,11 @@ class Intersect_2 : Intersect_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*! - * Find all intersections of the two given curves and insert them to the + * Find all intersections of the two given curves and insert them to the * output iterator. If two arcs intersect only once, only a single will be - * placed to the iterator. Type of output iterator is \c CGAL::Object + * placed to the iterator. Type of output iterator is \c CGAL::Object * containing either an \c Arc_2 object (overlap) or a \c Point_2 object * with multiplicity (point-wise intersections) * \param cv1 The first curve. @@ -547,7 +547,7 @@ class Intersect_2 : OutputIterator operator()(const Arc_2& cv1, const Arc_2& cv2, OutputIterator oi) const { - CKvA_CERR("\nfiltered_intersect; cv1: " << cv1 + CKvA_CERR("\nfiltered_intersect; cv1: " << cv1 << ";\n cv2:" << cv2 << ""); if (!Base::_ckva()->may_have_intersection_2_object()(cv1, cv2)) { @@ -563,7 +563,7 @@ class Intersect_2 : return oi; } - // else + // else CKvA_CERR("\nfilter: failed\n"); return Base::operator()(cv1, cv2, oi); @@ -571,9 +571,9 @@ class Intersect_2 : }; template < class CurvedKernelViaAnalysis_2, class FunctorBase > -class Is_on_2 : +class Is_on_2 : public FunctorBase::Is_on_2 { - + public: //! this instance template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -593,37 +593,37 @@ class Is_on_2 : //! the bae type typedef typename FunctorBase::Is_on_2 Base; - + //! the result type typedef bool result_type; - + //! standard constructor Is_on_2(Curved_kernel_via_analysis_2 *kernel) : Base(kernel) { } - + /*! - * Checks whether \c p lies on \c c + * Checks whether \c p lies on \c c * \param p The point to test * \param c The curve * \return (true) if the \c p lies on \c c */ result_type operator()(const Point_2& p, const Curve_2& c) const { - + CKvA_CERR("\nfiltered_is_on; p: " << p << ";\n c:" << c << ""); return Base::operator()(p, c); } result_type operator()(const Point_2& p, const Arc_2& arc) const { - + return Base::operator()(p, arc); } }; #undef CGAL_FILTERED_CKvA_2_GRAB_BASE_FUNCTOR_TYPES -} // namespace Filtered_curved_kernel_via_analysis_2_Functors +} // namespace Filtered_curved_kernel_via_analysis_2_Functors template @@ -634,7 +634,7 @@ struct Filtered_functor_base : typedef BaseCKvA Base_ckva; - typedef typename BaseCKvA::template rebind< Self >::Functor_base + typedef typename BaseCKvA::template rebind< Self >::Functor_base Functor_base; // declares curved kernel functors, for each functor defines a member function @@ -646,17 +646,17 @@ struct Filtered_functor_base : #define CGAL_FILTERED_CKvA_2_functor_cons(Y, Z) \ CGAL_FILTERED_CKvA_2_functor_pred(Y, Z) - + CGAL_FILTERED_CKvA_2_functor_pred(Compare_xy_2, compare_xy_2_object); - - CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_near_boundary_2, + + CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_near_boundary_2, compare_y_near_boundary_2_object); - CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_at_x_2, + CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_at_x_2, compare_y_at_x_2_object); - CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_at_x_left_2, + CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_at_x_left_2, compare_y_at_x_left_2_object); - CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_at_x_right_2, + CGAL_FILTERED_CKvA_2_functor_pred(Compare_y_at_x_right_2, compare_y_at_x_right_2_object); CGAL_FILTERED_CKvA_2_functor_pred(Is_on_2, is_on_2_object); @@ -664,9 +664,9 @@ struct Filtered_functor_base : CGAL_FILTERED_CKvA_2_functor_pred( May_have_intersection_2, may_have_intersection_2_object ); - + CGAL_FILTERED_CKvA_2_functor_cons(Intersect_2, intersect_2_object); - + #undef CGAL_FILTERED_CKvA_2_functor_pred #undef CGAL_FILTERED_CKvA_2_functor_cons @@ -692,13 +692,13 @@ class Filtered_curved_kernel_via_analysis_2 : //! this instance's first template argument typedef BaseCKvA_2 Curved_kernel_via_analysis_2; - + //! myself typedef Filtered_curved_kernel_via_analysis_2< Curved_kernel_via_analysis_2 > Self; //! type of curve kernel - typedef typename + typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; //! type of curve analysis @@ -712,12 +712,12 @@ class Filtered_curved_kernel_via_analysis_2 : //! type of curve_2 typedef Curve_analysis_2 Curve_2; - + //! type of a point on generic curve - typedef internal::Point_2< Self > Point_2; + typedef internal::Point_2< Self > Point_2; //! type of an arc on generic curve - typedef internal::Arc_2< Self > Arc_2; + typedef internal::Arc_2< Self > Arc_2; //! type of weakly x-monotone arc for \c ArrangementTraits_2 typedef Arc_2 X_monotone_curve_2; @@ -725,7 +725,7 @@ class Filtered_curved_kernel_via_analysis_2 : //!@} protected: - + //! base kernel type typedef internal::Curved_kernel_via_analysis_2_base< Self, Curved_kernel_via_analysis_2, Curve_kernel_2, @@ -739,14 +739,14 @@ class Filtered_curved_kernel_via_analysis_2 : Filtered_curved_kernel_via_analysis_2() : Base_kernel() { } - + //! construct using specific \c Curve_kernel_2 instance (for controlling) Filtered_curved_kernel_via_analysis_2(const Curve_kernel_2& kernel) : Base_kernel(kernel) { } - + //!@} - + }; // class Filtered_curved_kernel_via_analysis_2 } // namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h index 5e86e37c1bfd..9465f5cd78cc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -16,7 +16,7 @@ /*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h * \brief defines class \c Generic_arc_2 - * + * * adds support for isolated points to native CKvA_2 object */ @@ -37,15 +37,15 @@ std::ostream& operator<< (std::ostream&, template class Generic_arc_2_rep -{ +{ public: // this instance's template parameter typedef SweepCurvesAdaptor_2 Sweep_curves_adaptor_2; - + // myself typedef Generic_arc_2_rep Self; - + // type of generic point object provided by CKvA_2 typedef typename Sweep_curves_adaptor_2::Native_point_2 Point_2; @@ -54,8 +54,8 @@ class Generic_arc_2_rep // type of a generic point (which may lie at infinity) typedef typename Sweep_curves_adaptor_2::Generic_point_2 Generic_point_2; - -public: + +public: // default constructor Generic_arc_2_rep() : _m_min(), _m_max(Generic_point_2()), _m_arc(Arc_2()) { @@ -63,9 +63,9 @@ class Generic_arc_2_rep // standard constructor : normal arc Generic_arc_2_rep(const Arc_2& c) { - - if(c.location(CGAL::ARR_MIN_END) != CGAL::ARR_INTERIOR) - _m_min = Generic_point_2(c, CGAL::ARR_MIN_END); + + if(c.location(CGAL::ARR_MIN_END) != CGAL::ARR_INTERIOR) + _m_min = Generic_point_2(c, CGAL::ARR_MIN_END); else { _m_min = Generic_point_2(c.curve_end(CGAL::ARR_MIN_END)); _m_arc = c; @@ -74,7 +74,7 @@ class Generic_arc_2_rep Generic_point_2(c, CGAL::ARR_MAX_END) : Generic_point_2(c.curve_end(CGAL::ARR_MAX_END))); } - + // standard constructor : degenerate arc Generic_arc_2_rep(const Generic_point_2& p) : _m_min(p) { @@ -85,8 +85,8 @@ class Generic_arc_2_rep mutable boost::optional _m_max; // stores native arc object (only for non-degenerate case) - mutable boost::optional _m_arc; - + mutable boost::optional _m_arc; + // whether an arc is degenerate //bool _m_is_degenerate; @@ -97,14 +97,14 @@ class Generic_arc_2_rep // Boundary_type defined in Arr_enums.h //! \brief class defines a point on a generic curve -template > class Generic_arc_2 : public CGAL::Handle_with_policy< Rep_ > { public: //!\name publuic typedefs //!@{ - + //! this instance's first template parameter typedef SweepCurvesAdaptor_2 Sweep_curves_adaptor_2; @@ -113,7 +113,7 @@ class Generic_arc_2 //! this instance itself typedef Generic_arc_2 Self; - + //! type of generic point object provided by CKvA_2 typedef typename Sweep_curves_adaptor_2::Native_point_2 Point_2; @@ -122,10 +122,10 @@ class Generic_arc_2 //! type of a generic point (which may lie at infinity) typedef typename Sweep_curves_adaptor_2::Generic_point_2 Generic_point_2; - + //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //!@} public: //!\name basic constructors @@ -134,43 +134,43 @@ class Generic_arc_2 /*!\brief * Default constructor */ - Generic_arc_2() : - Base(Rep()) { + Generic_arc_2() : + Base(Rep()) { } /*!\brief * copy constructor */ -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Generic_arc_2(const Self& p) : - Base(static_cast(p)) { + Base(static_cast(p)) { } #endif - + /*!\brief * constructs an arc from a given represenation */ Generic_arc_2(Rep rep) : - Base(rep) { + Base(rep) { } - + //!@} //!\name standard constructors //!@{ - - //! \brief + + //! \brief //! constructs normal (non-degenerate) arc - explicit Generic_arc_2(const Arc_2& c) : + explicit Generic_arc_2(const Arc_2& c) : Base(Rep(c)) { } - + /*!\brief * constructs degenerate arc from a point */ explicit Generic_arc_2(const Generic_point_2& pt) : Base(Rep(pt)) { } - + //!@} public: //!\name access functions @@ -230,10 +230,10 @@ class Generic_arc_2 Arc_2 a; if(!is_degenerate()) { if(!cv2.is_degenerate()) { - typedef std::vector > + typedef std::vector > Point_container; Point_container tmp; - Arc_2::_intersection_points(arc(), cv2.arc(), + Arc_2::_intersection_points(arc(), cv2.arc(), std::back_inserter(tmp)); // leave only intersection point (without multiplicity) for(typename Point_container::const_iterator it = tmp.begin(); @@ -246,7 +246,7 @@ class Generic_arc_2 return oi; // no intersections with degenerate arc at inf a = arc(); pt = cv2.source().point(); - + } else if(!cv2.is_degenerate()) { a = cv2.arc(); if(!source().is_finite()) @@ -267,8 +267,8 @@ class Generic_arc_2 //! befriending output operator // friend std::ostream& operator << <>(std::ostream&, const Self&); - - //!@} + + //!@} }; // class Generic_arc_2 template diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h index 5501fc3485bf..708fb351d8b7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -15,7 +15,7 @@ /*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h * \brief defines class \c Generic_point_2 - * + * * adds support for points at infinity to native CKvA_2 object */ @@ -36,22 +36,22 @@ std::ostream& operator<< (std::ostream&, template class Generic_point_2_rep -{ +{ public: // this instance's template parameter typedef SweepCurvesAdaptor_2 Sweep_curves_adaptor_2; - + // myself typedef Generic_point_2_rep Self; - + // type of a native point object provided by CKvA_2 typedef typename Sweep_curves_adaptor_2::Native_point_2 Point_2; // type of a native arc object provided by CKvA_2 typedef typename Sweep_curves_adaptor_2::Native_arc_2 Arc_2; - -public: + +public: // default constructor Generic_point_2_rep() : _m_point(Point_2()) { @@ -61,7 +61,7 @@ class Generic_point_2_rep Generic_point_2_rep(const Arc_2& c, CGAL::Arr_curve_end end) : _m_arc(c), _m_end(end) { } - + // standard constructor : normal point Generic_point_2_rep(const Point_2& p) : _m_point(p) { @@ -70,8 +70,8 @@ class Generic_point_2_rep mutable boost::optional _m_arc; // supporting arc for points at inf // stores respective curve end if this is a point at infinity - CGAL::Arr_curve_end _m_end; - + CGAL::Arr_curve_end _m_end; + mutable boost::optional _m_point; // stores a finite point // befriending the handle @@ -81,14 +81,14 @@ class Generic_point_2_rep // Boundary_type defined in Arr_enums.h //! \brief class defines a point on a generic curve -template > class Generic_point_2 : public CGAL::Handle_with_policy< Rep_ > { public: //!\name publuic typedefs //!@{ - + //! this instance's first template parameter typedef SweepCurvesAdaptor_2 Sweep_curves_adaptor_2; @@ -97,16 +97,16 @@ class Generic_point_2 //! this instance itself typedef Generic_point_2 Self; - + //! type of a native point object provided by CKvA_2 typedef typename Sweep_curves_adaptor_2::Native_point_2 Point_2; //! type of a native arc object provided by CKvA_2 typedef typename Sweep_curves_adaptor_2::Native_arc_2 Arc_2; - + //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //!@} public: //!\name basic constructors @@ -115,29 +115,29 @@ class Generic_point_2 /*!\brief * Default constructor */ - Generic_point_2() : - Base(Rep()) { + Generic_point_2() : + Base(Rep()) { } /*!\brief * copy constructor */ -#ifdef DOXYGEN_RUNNING +#ifdef DOXYGEN_RUNNING Generic_point_2(const Self& p) : - Base(static_cast(p)) { + Base(static_cast(p)) { } -#endif +#endif /*!\brief * constructs an arc from a given represenation */ Generic_point_2(Rep rep) : - Base(rep) { + Base(rep) { } - + //!@} //!\name standard constructors //!@{ - + /*!\brief * constructs a finite point */ @@ -145,12 +145,12 @@ class Generic_point_2 Base(Rep(pt)) { } - //! \brief + //! \brief //! constructs a 'point at infinity' explicit Generic_point_2(const Arc_2& c, CGAL::Arr_curve_end end) : Base(Rep(c, end)) { } - + //!@} public: //!\name access functions @@ -187,8 +187,8 @@ class Generic_point_2 //! befriending output operator // friend std::ostream& operator << <>(std::ostream&, const Self&); - - //!@} + + //!@} }; // class Generic_point_2 template diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h index 5522aa7ee903..495137bfee9a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h @@ -288,7 +288,7 @@ struct Make_x_monotone_2 : *oi++ = CGAL::make_object(construct_arc_2(pts[j], pts[j+1], _m_curve)); // the last vertical ray - *oi++ = CGAL::make_object(construct_arc_2(pts[n-1], + *oi++ = CGAL::make_object(construct_arc_2(pts[n-1], CGAL::ARR_MAX_END, _m_curve)); } else // unbounded vertical line *oi++ = CGAL::make_object(construct_arc_2(x, _m_curve)); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h index b8c794166438..d2cae5964bfe 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -15,7 +15,7 @@ /*!\file include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h * \brief defines class \c Non_x_monotone_arc_2 - * + * * non x-monotone arc of a generic curve */ @@ -30,13 +30,13 @@ namespace CGAL { namespace internal { template < class CurvedKernelViaAnalysis_2 > -class Non_x_monotone_arc_2_rep { +class Non_x_monotone_arc_2_rep { public: // this instance's first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; - + // myself typedef Non_x_monotone_arc_2_rep< Curved_kernel_via_analysis_2 > Self; @@ -46,7 +46,7 @@ class Non_x_monotone_arc_2_rep { // a list of x-monotone arcs typedef std::vector< Arc_2 > Arc_vector; -public: +public: /*!\brief * Default constructor @@ -54,14 +54,14 @@ class Non_x_monotone_arc_2_rep { Non_x_monotone_arc_2_rep() { } - /*!\brief + /*!\brief * constructs from one x-monotone arc */ Non_x_monotone_arc_2_rep(const Arc_2& arc) { _m_x_monotone_arcs.push_back(arc); } - /*!\brief + /*!\brief * constructs a non x-monotone arc from the list of x-monotone pieces */ template @@ -89,11 +89,11 @@ template < class CurvedKernelViaAnalysis_2, class Rep_ = Non_x_monotone_arc_2_rep< CurvedKernelViaAnalysis_2 > > class Non_x_monotone_arc_2 : public CGAL::Handle_with_policy< Rep_ > { - + public: //!\name public typedefs //!@{ - + //! this instance's first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -102,14 +102,14 @@ class Non_x_monotone_arc_2 : //! this instance itself typedef Non_x_monotone_arc_2< Curved_kernel_via_analysis_2, Rep > Self; - + //! type of curve kernel typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; - + //! type of analysis of a pair of curves typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! type of a point on generic curve typedef typename Curved_kernel_via_analysis_2::Point_2 Point_2; @@ -118,7 +118,7 @@ class Non_x_monotone_arc_2 : //! iterator type to range through the list of x-monotone arcs typedef typename Rep::Arc_vector::const_iterator Arc_const_iterator; - + //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; @@ -130,8 +130,8 @@ class Non_x_monotone_arc_2 : /*!\brief * Default constructor */ - Non_x_monotone_arc_2() : - Base(Rep()) { + Non_x_monotone_arc_2() : + Base(Rep()) { } /*!\brief @@ -139,7 +139,7 @@ class Non_x_monotone_arc_2 : */ #ifdef DOXYGEN_RUNNING Non_x_monotone_arc_2(const Self& a) : - Base(static_cast(a)) { + Base(static_cast(a)) { } #endif @@ -155,7 +155,7 @@ class Non_x_monotone_arc_2 : * iterator range [start; end) * * template argument type of \c InputIterator is \c Arc_2 - * + * * \pre the x-monotone arcs must be connected into a single chain * \pre either all x-monotone arcs must be vertical or non-vertical */ @@ -188,19 +188,19 @@ class Non_x_monotone_arc_2 : public: //! \name Access functions //!@{ - + /*!\brief * returns the number of x-monotone arcs this object consists of */ int number_of_x_monotone_arcs() const { return static_cast(this->ptr()->_m_x_monotone_arcs.size()); } - + /*!\brief * returns iterator pointing to the first x-monotone arc in the list */ Arc_const_iterator begin() const { - return this->ptr()->_m_x_monotone_arcs.begin(); + return this->ptr()->_m_x_monotone_arcs.begin(); } /*!\brief @@ -219,7 +219,7 @@ class Non_x_monotone_arc_2 : CGAL_precondition(i < number_of_x_monotone_arcs()); return this->ptr()->_m_x_monotone_arcs[i]; } -#endif +#endif /*!\brief * returns the supporting curve @@ -235,13 +235,13 @@ class Non_x_monotone_arc_2 : bool is_vertical() const { CGAL_precondition(number_of_x_monotone_arcs() > 0); return this->ptr()->_m_x_monotone_arcs[0].is_vertical(); - } - + } + //!@} }; // Non_x_monotone_arc_2 /*!\relates Non_x_monotone_arc_2 - * \brief + * \brief * output operator */ template < class CurvedKernelViaAnalysis_2, class Rep_> diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 775a70c74d2b..8a26fb9ee55f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -36,7 +36,7 @@ namespace CGAL { namespace internal { // forward class declaration -template < class CurvedKernelViaAnalysis_2, class Rep_ > +template < class CurvedKernelViaAnalysis_2, class Rep_ > class Point_2; // forward class declaration @@ -52,62 +52,62 @@ class Arc_2; * representation class for Point_2 */ template < class CurvedKernelViaAnalysis_2 > -class Point_2_rep +class Point_2_rep { public: //! this instance's template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; - + //! the class itself typedef Point_2_rep< Curved_kernel_via_analysis_2 > Self; //! type of curve kernel - typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 + typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; //! type of x-coordinate typedef typename Curve_kernel_2::Coordinate_1 Coordinate_1; - + //! type of a finite point on curve typedef typename Curve_kernel_2::Coordinate_2 Coordinate_2; //! type of curve analysis typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! default constructor Point_2_rep() { } - + //! constructs a "finite" point on curve, //! implies CGAL::NO_BOUNDARY in x/y - Point_2_rep(const Coordinate_2& xy) : + Point_2_rep(const Coordinate_2& xy) : _m_xy(xy), _m_location(CGAL::ARR_INTERIOR) { } //! constructs a point at +/-oo in x Point_2_rep(CGAL::Arr_curve_end inf_end, const Curve_analysis_2& c, int arcno) : - _m_curve(c), + _m_curve(c), _m_arcno(arcno) { _m_location = (inf_end == CGAL::ARR_MIN_END ? CGAL::ARR_LEFT_BOUNDARY : CGAL::ARR_RIGHT_BOUNDARY); } - + //! constructs a point on curve with y-coordinate at infinity - Point_2_rep(const Coordinate_1& x, const Curve_analysis_2& c, + Point_2_rep(const Coordinate_1& x, const Curve_analysis_2& c, CGAL::Arr_curve_end inf_end) : _m_x(x), _m_curve(c) { _m_location = (inf_end == CGAL::ARR_MIN_END ? CGAL::ARR_BOTTOM_BOUNDARY : CGAL::ARR_TOP_BOUNDARY); - + } - //! curve point finite coordinates. They are valid only if boundary in y + //! curve point finite coordinates. They are valid only if boundary in y //! is not set (CGAL::NO_BOUNDARY), otherwise only x-coordinate is //! accessible, i.e., point is in interior boost::optional< Coordinate_2 > _m_xy; - + //! x-coordinate of a curve point boost::optional< Coordinate_1 > _m_x; @@ -124,21 +124,21 @@ class Point_2_rep mutable boost::optional< std::pair< double, double > > _m_doubles; }; -/*!\brief +/*!\brief * Class defines a point on a curve that can be analyzed - * - * Only points with finite coordinates can be constructed explicitly + * + * Only points with finite coordinates can be constructed explicitly * (by the user). Points on the boundary use special private constructors to * to represent ends of curve arcs on the boundary. */ -template > -class Point_2 : +class Point_2 : public CGAL::Handle_with_policy< Rep_ > { public: //!\name Public types //!@{ - + //! this instance's first template parameter typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; @@ -147,23 +147,23 @@ class Point_2 : //! this instance itself typedef Point_2< Curved_kernel_via_analysis_2, Rep > Self; - + //! type of underlying curve kernel typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; - + //! type of an x-coordinate typedef typename Curve_kernel_2::Coordinate_1 Coordinate_1; - + //! type of an xy-coordinate typedef typename Curve_kernel_2::Coordinate_2 Coordinate_2; - + //! type that analyzes a curve typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //! type of kernel point typedef typename Curved_kernel_via_analysis_2::Point_2 Kernel_point_2; @@ -176,7 +176,7 @@ class Point_2 : public: //!\name Rebind //!@{ - + /*!\brief * An auxiliary structure for rebinding the point with a new rep */ @@ -192,13 +192,13 @@ class Point_2 : //! the rebound type typedef Point_2< New_curved_kernel_via_analysis_2, NewRep > Other; - + //! the rebound point - typedef typename New_curved_kernel_via_analysis_2::Point_2 + typedef typename New_curved_kernel_via_analysis_2::Point_2 Rebound_point_2; - + /*!\brief - * constructs a point of type \c Rebound_point_2 from the point \c pt + * constructs a point of type \c Rebound_point_2 from the point \c pt * of type \c Self. * * All known items of the base class rep will be copied. @@ -215,7 +215,7 @@ class Point_2 : // TODO move to SfP_2l /*!\brief - * reverse rebind, i.e., extracts original point type from a + * reverse rebind, i.e., extracts original point type from a * rebound instance */ Self operator()(const Rebound_point_2& pt) { @@ -232,9 +232,9 @@ class Point_2 : return Self(rep); } }; - + //!@} - + public: //!\name Standard constructors //!@{ @@ -242,16 +242,16 @@ class Point_2 : /*!\brief * Default constructor */ - Point_2() : - Base(Rep()) { + Point_2() : + Base(Rep()) { } /*!\brief * copy constructor */ -#ifdef DOXYGEN_RUNNING - Point_2(const Self& p) : - Base(static_cast(p)) { +#ifdef DOXYGEN_RUNNING + Point_2(const Self& p) : + Base(static_cast(p)) { } #endif //!@} @@ -259,11 +259,11 @@ class Point_2 : public: //!\name Usual constructors //!@{ - - /*!\brief + + /*!\brief * Constructs an interior point * - * \param x The x-coordinate + * \param x The x-coordinate * \param c The supporting curve * \param arcno Arcno of point on \c c * \return The constructed point @@ -276,23 +276,23 @@ class Point_2 : Point_2(const T& x, const T& y) : // TODO use default kernel Base(Rep(Curved_kernel_via_analysis_2::instance().kernel(). - construct_algebraic_real_2_object()(x,y))) + construct_algebraic_real_2_object()(x,y))) { } - // FUTURE TODO allow to construct without curve, + // FUTURE TODO allow to construct without curve, // i.e, isolated points on toric identifications -> do it also for arcs // FUTURE TODO parameter space in x/y (full set of tasks) - + //!@} public: // was protected: //!\name Special constructors for points on the boundary //!@{ - - /*!\brief + + /*!\brief * Constructs a point with x-coordinate at the left/right boundary * * \param inf_end Determines whether point is on left or right boundary @@ -300,30 +300,30 @@ class Point_2 : * \param arcno Arcno of point on \c on left/right boundary * \return The constructed point */ - Point_2(CGAL::Arr_curve_end inf_end, + Point_2(CGAL::Arr_curve_end inf_end, const Curve_analysis_2& c, int arcno) : Base(Rep(inf_end, c, arcno)) { } - - /*!\brief + + /*!\brief * Constructs a point on bottom or top boundary - * + * * \param x The x-coordinate of point * \param c The supporting curve * \param inf_end Defines whether point is on bottom or top boundary * \return The constructed point */ - Point_2(const Coordinate_1& x, const Curve_analysis_2& c, + Point_2(const Coordinate_1& x, const Curve_analysis_2& c, CGAL::Arr_curve_end inf_end) : Base(Rep(x, c, inf_end)) { } - + //!@} protected: //!\name Constructors for rebind //!@{ - + /*!\brief * constructs from a given represenation */ @@ -333,12 +333,12 @@ class Point_2 : * \param rep The representation * \return The constructed point */ - Point_2(Rep rep) : - Base(rep) { + Point_2(Rep rep) : + Base(rep) { } - + //!@} - + public: //!\name Destructors //!@{ @@ -348,20 +348,20 @@ class Point_2 : */ virtual ~Point_2() { } - + //!@} public: //!\name Access members //!@{ - /*!\brief + /*!\brief * Access to the point's x-coordinate (y-coordinate can be undefined) - * + * * \return The stored x-coordinate * \pre the point's x must be finite */ - inline + inline const Coordinate_1& x() const { CGAL_precondition_msg( this->ptr()->_m_xy || this->ptr()->_m_x, @@ -370,14 +370,14 @@ class Point_2 : return (is_finite() ? (*(this->ptr()->_m_xy)).x() : *(this->ptr()->_m_x)); } - - /*!\brief + + /*!\brief * Access to underlying \c Coordinate_2 object * * \return The stored xy-coordinate * \pre The xy-coordinates must be finite */ - inline + inline const Coordinate_2& xy() const { CGAL_precondition_msg(bool(this->ptr()->_m_xy), "Denied access to the curve end lying at x/y-infinity"); @@ -393,35 +393,35 @@ class Point_2 : * * \return supporting curve of point */ - inline + inline Curve_analysis_2 curve() const { CGAL_precondition_msg( this->ptr()->_m_xy || this->ptr()->_m_curve, "Denied access to the curve end lying at y-infinity"); - return (is_finite() ? + return (is_finite() ? (*(this->ptr()->_m_xy)).curve() : *(this->ptr()->_m_curve)); } - + /*!\brief * Arc number of point on a curve * * \return arcno of point - * \pre Is not endpoint of a vertical ray or branch - */ + * \pre Is not endpoint of a vertical ray or branch + */ inline int arcno() const { CGAL_precondition_msg(this->ptr()->_m_xy || this->ptr()->_m_arcno, "Denied access to the curve end lying at y-infinity"); - return (is_finite() ? + return (is_finite() ? (*(this->ptr()->_m_xy)).arcno() : *(this->ptr()->_m_arcno)); } - + //!@} -public: +public: //!\name Methods for location //!@{ - + /*!\brief * sets location of a point in parameter space to \c loc * @@ -432,16 +432,16 @@ class Point_2 : void set_location(CGAL::Arr_parameter_space loc) const { this->ptr()->_m_location = loc; } - + /*!\brief * location of a point in parameter space * * \return location in parameter space */ - inline CGAL::Arr_parameter_space location() const { - return this->ptr()->_m_location; - } - + inline CGAL::Arr_parameter_space location() const { + return this->ptr()->_m_location; + } + /*!\brief * checks if the point lies on left/right boundary * @@ -451,7 +451,7 @@ class Point_2 : return (location() == CGAL::ARR_LEFT_BOUNDARY || location() == CGAL::ARR_RIGHT_BOUNDARY); } - + /*!\brief * checks if the point lies on bottom/top boundary * @@ -467,13 +467,13 @@ class Point_2 : * * \return \c true, if point is finite, \c false otherwise */ - inline + inline bool is_finite() const { return bool(this->ptr()->_m_xy); } - - //!@} - + + //!@} + //!\name Predicates //!@{ @@ -483,7 +483,7 @@ class Point_2 : /*!\brief * Compares x-coordinates of this point with \c q - * + * * \param q The other point * \return CGAL::LARGER if x(*this) > x(q); * CGAL::SMALLER if x(*this) \< x(q); @@ -501,19 +501,19 @@ class Point_2 : return compare_x_2(*dynamic_cast< const Kernel_point_2* >(this), q); } - /*!\brief + /*!\brief * Compares this point with \c q lexicographically - * + * * \param q The other point - * \return CGAL::LARGER if x(*this) > x(q), + * \return CGAL::LARGER if x(*this) > x(q), * or if x(*this) = x(q) and y(*this) > y(q); - * CGAL::SMALLER if x(*this) \< x(q), + * CGAL::SMALLER if x(*this) \< x(q), * or if x(*this) = x(q) and y(*this) \< y(q); * CGAL::EQUAL if the two points are equal. * \pre Compared points are in the interior of parameter space */ inline - CGAL::Comparison_result compare_xy(const Kernel_point_2& q, + CGAL::Comparison_result compare_xy(const Kernel_point_2& q, bool equal_x = false) const { CGAL_precondition(bool(this->ptr()->_m_xy)); CGAL_precondition(bool(q.ptr()->_m_xy)); @@ -526,13 +526,13 @@ class Point_2 : ); } - /*!\brief + /*!\brief * Checks if a point lies on on a curve * * \param curve The curve to check * \return \c true, if *this lies on \c curve, \c false otherwise */ - inline + inline bool is_on( const typename Curved_kernel_via_analysis_2::Curve_2& curve ) const { @@ -545,7 +545,7 @@ class Point_2 : } #undef CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT - + //!@} //!\name Comparison operators for points in the interior of parameter space @@ -553,22 +553,22 @@ class Point_2 : //! equality inline - bool operator == (const Kernel_point_2& q) const { + bool operator == (const Kernel_point_2& q) const { return this->compare_xy(q) == CGAL::EQUAL; } - + //! inequality inline bool operator != (const Kernel_point_2& q) const { return this->compare_xy(q) != CGAL::EQUAL; } - + //! less than in (x,y) lexicographic order inline bool operator < (const Kernel_point_2& q) const { return this->compare_xy(q) == CGAL::SMALLER; } - + //! less-equal in (x,y) lexicographic order inline bool operator <= (const Kernel_point_2& q) const { @@ -586,13 +586,13 @@ class Point_2 : bool operator >= (const Kernel_point_2& q) const { return this->compare_xy(q) != CGAL::SMALLER; } - + //!@} //!\name Approximation //!@{ - - /*!\brief + + /*!\brief * pair of doubles approximating the coordinates */ std::pair< double, double > to_double() const { @@ -602,33 +602,33 @@ class Point_2 : } return *(this->ptr()->_m_doubles); } - + //!@} public: //!\name IO //!@{ - + /*!\brief * writes point to \c os */ void write(std::ostream& os) const { - + switch(::CGAL::get_mode(os)) { case ::CGAL::IO::PRETTY: os << "point@" << this->id() << "("; os << "sup@" << this->curve().id() << "; "; os << "loc=" << this->location() << "; "; os << std::flush; - // write x value - switch (this->location()) { - case CGAL::ARR_TOP_BOUNDARY: - case CGAL::ARR_BOTTOM_BOUNDARY: + // write x value + switch (this->location()) { + case CGAL::ARR_TOP_BOUNDARY: + case CGAL::ARR_BOTTOM_BOUNDARY: case CGAL::ARR_INTERIOR: { - os << "x=" << this->x().to_double()<< "; "; + os << "x=" << this->x().to_double()<< "; "; break; - } + } case CGAL::ARR_LEFT_BOUNDARY: { os << "x=-oo; "; break; @@ -638,17 +638,17 @@ class Point_2 : break; } default:{ - // bogus location + // bogus location CGAL_assertion(false); - }} + }} os << std::flush; - - // write y value + + // write y value switch (this->location()) { case CGAL::ARR_INTERIOR: { - os << "y=" << this->xy().to_double().second<< "; "; ; + os << "y=" << this->xy().to_double().second<< "; "; ; break; - } + } case CGAL::ARR_TOP_BOUNDARY: { os << "y=+oo; "; break; @@ -657,34 +657,34 @@ class Point_2 : os << "y=-oo; "; break; } - case CGAL::ARR_LEFT_BOUNDARY: + case CGAL::ARR_LEFT_BOUNDARY: case CGAL::ARR_RIGHT_BOUNDARY: { - CGAL::Object obj = + CGAL::Object obj = this->curve().asymptotic_value_of_arc( this->location(), this->arcno() ); CGAL::Arr_parameter_space ps; if (CGAL::assign(ps, obj)) { if (ps == CGAL::ARR_BOTTOM_BOUNDARY) { - os << "y=-oo(asym)"<< "; "; + os << "y=-oo(asym)"<< "; "; } else { - os << "y=+oo(asym)"<< "; "; + os << "y=+oo(asym)"<< "; "; } } else { Coordinate_1 y; CGAL_assertion_code(bool check =) CGAL::assign(y, obj); CGAL_assertion(check); - os << "y=" << CGAL::to_double(y) << "(asym)" << "; "; + os << "y=" << CGAL::to_double(y) << "(asym)" << "; "; } break; os << "y=??; "; break; } default:{ - // bogus location + // bogus location CGAL_assertion(false); - }} + }} os << std::flush; if (this->ptr()->_m_xy || this->ptr()->_m_arcno) { os << "ARCNO=" << this->arcno(); @@ -698,7 +698,7 @@ class Point_2 : std::cerr << "BINARY format not yet implemented" << std::endl; break; default: - // ASCII + // ASCII os << "Point_2("; os << this->ptr()->_m_xy; @@ -721,11 +721,11 @@ class Point_2 : * reads point from \c is */ void read(std::istream& is) { - + CGAL_precondition(CGAL::is_ascii(is)); - + Rep rep; - + // read "Point_2(" swallow(is, 'P'); swallow(is, 'o'); @@ -772,10 +772,10 @@ class Point_2 : // read the ')' swallow(is, ')'); - + *this = Point_2< Curved_kernel_via_analysis_2, Rep >(rep); } - + //! @} // friends //////////////////////////////////////////////////////////////// @@ -785,16 +785,16 @@ class Point_2 : //friend class Non_x_monotone_arc_2< Curved_kernel_via_analysis_2 >; // befriending the functors - + #if defined(_MSC_VER) #define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \ friend typename Curved_kernel_via_analysis_2::Z; \ friend typename Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 > #else // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER) #define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \ - friend class Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 > + friend class Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 > #endif // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER) - + CGAL_BEFRIEND_CKvA_2_FUNCTOR(Construct_point_2); CGAL_BEFRIEND_CKvA_2_FUNCTOR(Compare_x_2); CGAL_BEFRIEND_CKvA_2_FUNCTOR(Compare_xy_2); @@ -805,13 +805,13 @@ class Point_2 : /*!\relates Point_2 - * \brief - * writes \c pt to \c os + * \brief + * writes \c pt to \c os */ template < class CurvedKernelViaAnalysis_2, class Rep_ > std::ostream& operator <<(std::ostream& os, const Point_2< CurvedKernelViaAnalysis_2, Rep_ >& pt) { - + pt.write(os); return os; } @@ -820,16 +820,16 @@ std::ostream& operator <<(std::ostream& os, //! \brief Reads the objects from stream. template < class CurvedKernelViaAnalysis_2, class Rep_ > std::istream& operator>> ( - std::istream& is, + std::istream& is, Point_2< CurvedKernelViaAnalysis_2, Rep_ >& pt) { CGAL_precondition(CGAL::is_ascii(is)); - + //typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //typedef Rep_ Rep; - + pt.read(is); - + return is; } diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 44fda6c8fddc..fbd39ef99d06 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2007,2008,2009,2010,2011 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -53,7 +53,7 @@ class Compare_xy_2 public: typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_xy_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -71,7 +71,7 @@ class Compare_xy_2 * \param p1 The first point. * \param p2 The second point. * \return LARGER if x(p1) > x(p2), or if x(p1) = x(p2) and y(p1) > y(p2); - * SMALLER if x(p1) \< x(p2), or if x(p1) = x(p2) and + * SMALLER if x(p1) \< x(p2), or if x(p1) = x(p2) and * y(p1) \< y(p2); * EQUAL if the two points are equal. */ @@ -79,7 +79,7 @@ class Compare_xy_2 { if(p1.is_identical(p2)) return CGAL::EQUAL; - + typedef typename SweepCurvesAdapter_2::Native_arc_2 Native_arc_2; typename SweepCurvesAdapter_2::Native_point_2 pt; Native_arc_2 arc; @@ -101,7 +101,7 @@ class Compare_xy_2 arc = p1.arc(); end = p1.curve_end(); loc1 = arc.location(end); - + if(!p2.is_finite()) { // both points lie at infinity loc2 = p2.arc().location(p2.curve_end()); if(Native_arc_2::is_on_left_right(loc1)) { @@ -119,7 +119,7 @@ class Compare_xy_2 if(res == CGAL::EQUAL && end == p2.curve_end() && loc1 != loc2) { return (loc1 == CGAL::ARR_BOTTOM_BOUNDARY ? - CGAL::SMALLER : CGAL::LARGER); + CGAL::SMALLER : CGAL::LARGER); } return res; } @@ -138,14 +138,14 @@ class Compare_xy_2 // compares a finite point with a curve end at y=+/-oo: res = _m_adapter->kernel().kernel().compare_1_object() (pt.x(), arc.curve_end_x(end)); - + if(res == CGAL::EQUAL) // in case of equality use boundary types: res = (loc1 == CGAL::ARR_BOTTOM_BOUNDARY ? CGAL::LARGER : CGAL::SMALLER); } return (inverse ? -res : res); } - + private: SweepCurvesAdapter_2 *_m_adapter; }; @@ -157,7 +157,7 @@ class Less_xy_2 public: typedef bool result_type; - + //! standard constructor Less_xy_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -170,7 +170,7 @@ class Less_xy_2 result_type operator()(const Point_2& p1, const Point_2& p2) const { return (_m_adapter->compare_xy_2_object()(p1, p2) == CGAL::SMALLER); } - + private: SweepCurvesAdapter_2 *_m_adapter; }; @@ -180,10 +180,10 @@ class Compare_y_at_x_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_y_at_x_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -240,7 +240,7 @@ class Compare_y_at_x_2 CGAL::Arr_curve_end end = p.curve_end(), end2; // CGAL::Boundary_type bnd_x = p.arc().boundary_in_x(end); CGAL::Arr_parameter_space locp = p.arc().location(end); - + if(Native_arc_2::is_on_left_right(locp)) { CGAL_precondition(locp == cv.arc().location(end)); // compare two curve ends at +/-oo in x @@ -275,7 +275,7 @@ class Compare_y_at_x_2 // arc is vertical => infinite end coincides return CGAL::EQUAL; // two vertical arcs => coincide } - + CGAL_precondition_msg(end == end2, "Point is not within the arc's " "x-range"); @@ -291,11 +291,11 @@ class Compare_y_at_x_2 if(locp == cv.arc().location(end2) && !p.arc().is_vertical() && !cv.arc().is_vertical()) if((end == CGAL::ARR_MAX_END && locp == CGAL::ARR_TOP_BOUNDARY) || - (end == CGAL::ARR_MIN_END && locp == CGAL::ARR_BOTTOM_BOUNDARY)) + (end == CGAL::ARR_MIN_END && locp == CGAL::ARR_BOTTOM_BOUNDARY)) res = -res; return res; } - + private: SweepCurvesAdapter_2 *_m_adapter; @@ -306,10 +306,10 @@ class Equal_y_at_x_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef bool result_type; - + //! standard constructor Equal_y_at_x_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -323,7 +323,7 @@ class Equal_y_at_x_2 { return (_m_adapter->compare_y_at_x_2_object()(cv, p) == CGAL::EQUAL); } - + private: SweepCurvesAdapter_2 *_m_adapter; @@ -334,17 +334,17 @@ class Multiplicity_of_intersection_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef int result_type; - + //! standard constructor Multiplicity_of_intersection_2(SweepCurvesAdapter_2 *) { } - /*!\brief + /*!\brief * multiplicity of intersection - * + * * The intersection multiplicity of \c *this and \c cv2 at point \c p is * returned. * @@ -369,25 +369,25 @@ class Compare_y_right_of_point_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef CGAL::Comparison_result result_type; - + //! standard constructor Compare_y_right_of_point_2(SweepCurvesAdapter_2 *) { } /*! - * Compares the y value of two x-monotone curves immediately + * Compares the y value of two x-monotone curves immediately * to the right of their intersection point. If one of the curves is * vertical (emanating upward from p), it's always considered to be above * the other curve. * \param cv1 The first curve. * \param cv2 The second curve. * \param p The intersection point. - * \pre The point p lies on both curves, and both of them must be + * \pre The point p lies on both curves, and both of them must be * also be defined (lexicographically) to its right. - * \return The relative position of cv1 with respect to + * \return The relative position of cv1 with respect to * cv2 immdiately to the right of p: SMALLER, LARGER or EQUAL. */ result_type operator()(const Arc_2& cv1, const Arc_2& cv2, @@ -395,7 +395,7 @@ class Compare_y_right_of_point_2 SCA_CERR("Compare_y_right_of_point_2: cv1: " << cv1 << "\n cv2: " << cv2 << "\n pt: " << p << std::endl); - + CGAL_precondition(!cv1.is_degenerate()); CGAL_precondition(!cv2.is_degenerate()); CGAL_precondition(p.is_finite()); @@ -409,10 +409,10 @@ class Source_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef Point_2 result_type; - + //! standard constructor Source_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -428,7 +428,7 @@ class Source_2 private: SweepCurvesAdapter_2 *_m_adapter; - + }; template < class SweepCurvesAdapter_2 > @@ -436,10 +436,10 @@ class Target_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef Point_2 result_type; - + //! standard constructor Target_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -452,10 +452,10 @@ class Target_2 result_type operator()(const Arc_2& cv) const { return cv.target(); } - + private: SweepCurvesAdapter_2 *_m_adapter; - + }; template < class SweepCurvesAdapter_2 > @@ -463,10 +463,10 @@ class Construct_segment_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef Arc_2 result_type; - + //! standard constructor Construct_segment_2(SweepCurvesAdapter_2 *) { } @@ -486,10 +486,10 @@ template < class SweepCurvesAdapter_2 > class Is_degenerate_2 { typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef bool result_type; - + //! standard constructor Is_degenerate_2(SweepCurvesAdapter_2 *) { } @@ -498,7 +498,7 @@ class Is_degenerate_2 * checks whether this arc represents an isolated point (i.e., degenerate) */ result_type operator()(const Arc_2& cv) const { - + return cv.is_degenerate(); } }; @@ -507,10 +507,10 @@ template < class SweepCurvesAdapter_2 > class Do_overlap_2 { typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef bool result_type; - + //! standard constructor Do_overlap_2(SweepCurvesAdapter_2 *) { } @@ -520,7 +520,7 @@ class Do_overlap_2 * i.e., they overlap */ result_type operator()(const Arc_2& cv1, const Arc_2& cv2) const { - + if(cv1.is_degenerate() || cv2.is_degenerate()) return false; return cv1.arc().do_overlap(cv2.arc()); @@ -532,10 +532,10 @@ class New_endpoints_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef Arc_2 result_type; - + //! standard constructor New_endpoints_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -557,14 +557,14 @@ class New_endpoints_2 { CGAL_precondition( _m_adapter->compare_xy_2_object()(cv.target(), q) == CGAL::EQUAL ); - + cv.new_endpoints(p, q); return cv; } - + private: SweepCurvesAdapter_2 *_m_adapter; - + }; template < class SweepCurvesAdapter_2 > @@ -572,10 +572,10 @@ class New_endpoints_opposite_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef Arc_2 result_type; - + //! standard constructor New_endpoints_opposite_2(SweepCurvesAdapter_2 *) { } @@ -585,7 +585,7 @@ class New_endpoints_opposite_2 { * lexicographic order of endpoints is ensured automatically, hence no * special handling is required */ - result_type operator()(const Arc_2& cv, + result_type operator()(const Arc_2& cv, const Point_2& /* p */, const Point_2& /* q */) const { SCA_CERR("\n\nWARNING!! New_endpoints_opposite_2: cv: " << cv << @@ -602,10 +602,10 @@ template < class SweepCurvesAdapter_2 > class Intersect_2 { typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: //typedef bool result_type; - + //! standard constructor Intersect_2(SweepCurvesAdapter_2 *) { } @@ -620,7 +620,7 @@ class Intersect_2 { SCA_CERR("Intersect_2: cv1: " << cv1 << "\n cv2: " << cv2 << std::endl); - + return cv1.intersect(cv2, oi); } }; @@ -630,10 +630,10 @@ class Intersect_right_of_point_2 { typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Arc_2; - + public: typedef bool result_type; - + //! standard constructor Intersect_right_of_point_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -644,8 +644,8 @@ class Intersect_right_of_point_2 { * computes the next intersection of \c cv1 and \c cv2 right of \c ref * in lexicographical order and returns it through \c res argument * - * intersect_right_of_point is not called when using sweep_curves() with - * intersection dictionary and without validation of internal structures + * intersect_right_of_point is not called when using sweep_curves() with + * intersection dictionary and without validation of internal structures * (as is standard). Hence we can be lazy here for the moment * without losing performance. */ @@ -654,14 +654,14 @@ class Intersect_right_of_point_2 { SCA_CERR("Intersect_right_of_point_2: cv1: " << cv1 << "\n cv2: " << cv2 << "\n ref: " << ref << std::endl); - + typedef std::vector Point_container; Point_container tmp; cv1.intersect(cv2, back_inserter(tmp)); for(typename Point_container::const_iterator it = tmp.begin(); it != tmp.end(); it++) { - // assume points are sorted lexicographical + // assume points are sorted lexicographical if(_m_adapter->compare_xy_2_object()(*it, ref) == CGAL::LARGER) { res = *it; SCA_CERR("intersection found: " << res << "\n"); @@ -670,23 +670,23 @@ class Intersect_right_of_point_2 { } return false; } - + private: SweepCurvesAdapter_2 *_m_adapter; }; template < class SweepCurvesAdapter_2 > -class Make_x_monotone_2 +class Make_x_monotone_2 { typedef typename SweepCurvesAdapter_2::Curve_2 Curve_2; typedef typename SweepCurvesAdapter_2::Generic_point_2 Point_2; typedef typename SweepCurvesAdapter_2::Generic_arc_2 Generic_arc_2; - + public: typedef CGAL::cpp98::iterator result_type; - + //! standard constructor Make_x_monotone_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { @@ -694,12 +694,12 @@ class Make_x_monotone_2 } /*! - * decompose a given arc into list of x-monotone pieces - * (subcurves) and insert them to the output iterator. Since \c Arc_2 - * is by definition x-monotone, an input arc is passed to the - * output iterator directly. + * decompose a given arc into list of x-monotone pieces + * (subcurves) and insert them to the output iterator. Since \c Arc_2 + * is by definition x-monotone, an input arc is passed to the + * output iterator directly. * \param cv The curve. - * \param oi The output iterator, whose value-type is Object. + * \param oi The output iterator, whose value-type is Object. * The returned objects are all wrappers X_monotone_curve_2 objects. * \return The past-the-end iterator. */ @@ -709,12 +709,12 @@ class Make_x_monotone_2 *oi++ = cv; return oi; } - + /*! - * decompose a given curve into list of x-monotone pieces - * (subcurves) and insert them to the output iterator. + * decompose a given curve into list of x-monotone pieces + * (subcurves) and insert them to the output iterator. * \param cv The curve. - * \param oi The output iterator, whose value-type is Object. + * \param oi The output iterator, whose value-type is Object. * The returned objects are all wrappers X_monotone_curve_2 objects. * \return The past-the-end iterator. */ @@ -724,7 +724,7 @@ class Make_x_monotone_2 typedef typename SweepCurvesAdapter_2::Native_arc_2 Native_arc_2; typedef typename SweepCurvesAdapter_2::Native_point_2 Native_point_2; typedef typename SweepCurvesAdapter_2::Generic_point_2 Generic_point_2; - + typedef std::vector Objects; Objects objs; _m_adapter->kernel().make_x_monotone_2_object()(cv, @@ -743,7 +743,7 @@ class Make_x_monotone_2 } return oi; } - + private: SweepCurvesAdapter_2 *_m_adapter; }; @@ -765,10 +765,10 @@ class Sweep_curves_adapter_2 { //! type of curve kernel typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; - + //! myself typedef Sweep_curves_adapter_2< Curved_kernel_via_analysis_2 > Self; - + //!@} public: @@ -778,14 +778,14 @@ class Sweep_curves_adapter_2 { //! default constructor Sweep_curves_adapter_2() { } - + //! construct using specific \c CKvA_2 instance (for controlling) Sweep_curves_adapter_2(const Curved_kernel_via_analysis_2& kernel) : _m_kernel(kernel) { } - + //!@} - + //!\name embedded types and predicates for \c CurveSweepTraits //!@{ @@ -800,10 +800,10 @@ class Sweep_curves_adapter_2 { //! generic arc (supports isolated points) typedef internal::Generic_arc_2 Generic_arc_2; - //! type of point in model of \c CurveSweepTraits_2 + //! type of point in model of \c CurveSweepTraits_2 typedef Generic_point_2 Point_2; - //! type of segment in model of \c CurveSweepTraits_2 + //! type of segment in model of \c CurveSweepTraits_2 typedef Generic_arc_2 Segment_2; // declares functors, for each functor defines a member function @@ -812,32 +812,32 @@ class Sweep_curves_adapter_2 { typedef Sweep_curves_functors::Y Y; \ Y Z() const { return Y((Sweep_curves_adapter_2 *)this); } #define CGAL_Sweep_curves_cons(Y, Z) CGAL_Sweep_curves_pred(Y, Z) - + CGAL_Sweep_curves_pred(Compare_xy_2, compare_xy_2_object) CGAL_Sweep_curves_pred(Less_xy_2, less_xy_2_object) CGAL_Sweep_curves_pred(Is_degenerate_2, is_degenerate_2_object) - + CGAL_Sweep_curves_pred(Do_overlap_2, do_overlap_2_object) CGAL_Sweep_curves_pred(Compare_y_at_x_2, compare_y_at_x_2_object) CGAL_Sweep_curves_pred(Equal_y_at_x_2, equal_y_at_x_2_object) - + CGAL_Sweep_curves_pred(Multiplicity_of_intersection_2, multiplicity_of_intersection_2_object) CGAL_Sweep_curves_pred(Compare_y_right_of_point_2, compare_y_right_of_point_2_object) - + CGAL_Sweep_curves_cons(Source_2, source_2_object) CGAL_Sweep_curves_cons(Target_2, target_2_object) CGAL_Sweep_curves_cons(Construct_segment_2, construct_segment_2_object) - + CGAL_Sweep_curves_cons(New_endpoints_2, new_endpoints_2_object) CGAL_Sweep_curves_cons(New_endpoints_opposite_2, new_endpoints_opposite_2_object) - + CGAL_Sweep_curves_cons(Intersect_2, intersect_2_object) CGAL_Sweep_curves_cons(Intersect_right_of_point_2, intersect_right_of_point_2_object) - + CGAL_Sweep_curves_cons(Make_x_monotone_2, make_x_monotone_2_object) #undef CGAL_Sweep_curves_pred @@ -855,7 +855,7 @@ class Sweep_curves_adapter_2 { //! reference to Curved_kernel_via_analysis_2 object Curved_kernel_via_analysis_2 _m_kernel; - + //!@} }; // class Sweep_curves_adapter_2 diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h index 873df122aee7..0bc77123f226 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h @@ -12,7 +12,7 @@ // ============================================================================ /*!\file CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h - * \brief definition of Curve_renderer_2<> + * \brief definition of Curve_renderer_2<> * rasterization of algebraic curves */ @@ -57,23 +57,23 @@ namespace CGAL { // subdivision level beyond which visibly coincide branches are not further // discriminated -#define CGAL_COINCIDE_LEVEL 4 +#define CGAL_COINCIDE_LEVEL 4 // maximal recursion depth for derivative check -#define CGAL_DER_CHECK_DEPTH 5 +#define CGAL_DER_CHECK_DEPTH 5 // # of pixels to enlarge the drawing window in y-direction: required to skip // closely located clip-points -#define CGAL_WINDOW_ENLARGE 15 +#define CGAL_WINDOW_ENLARGE 15 // refine factor for intervals in x-direction (in pixel size) -#define CGAL_REFINE_X 100 // was 1000 previously +#define CGAL_REFINE_X 100 // was 1000 previously -// refine factor for intervals in y-direction (in pixel size) -#define CGAL_REFINE_Y 100000 +// refine factor for intervals in y-direction (in pixel size) +#define CGAL_REFINE_Y 100000 -// refine factor for clip-points -#define CGAL_REFINE_CLIP_POINTS 1000 +// refine factor for clip-points +#define CGAL_REFINE_CLIP_POINTS 1000 // refine threshold for double point approximation #define CGAL_REFINE_DOUBLE_APPROX 1e-10 @@ -83,13 +83,13 @@ namespace CGAL { //#warning approximation hangs for CORE::BigFloat !! #define CGAL_CKVA_STORE_COORDS(container, pixel) \ if(!std::isnan(pixel.xv)) \ - container.push_back(Coord_2(pixel.xv, pixel.yv)); + container.push_back(Coord_2(pixel.xv, pixel.yv)); #else #define CGAL_CKVA_STORE_COORDS(container, pixel) \ container.push_back(Coord_2(pixel.x, pixel.y)); #endif -#endif // CGAL_CURVE_RENDERER_DEFS +#endif // CGAL_CURVE_RENDERER_DEFS namespace { // map from box sides to subpixel numbers (for h/v directions) @@ -99,57 +99,57 @@ static const int HV_SUBPIX_MAP[][4] = { {3,2,1,0}, // top(1) {2,0,3,1}, // left(2) {0,1,2,3} // bottom(3) -}; +}; static const int D_SUBPIX_MAP[][4] = { {3,1,2,0}, // dir = 0 {2,3,0,1}, // dir = 1 {0,2,1,3}, // dir = 2 {1,0,3,2} // dir = 3 -}; -} // anonymous namespace +}; +} // anonymous namespace /*! * \brief The class template \c Curve_renderer_2 and its associate functions. - * - * The class implements rendering of distinct curve arcs and points as - * defined by \c CurvedKernelViaAnalysis_2::Arc_2 and + * + * The class implements rendering of distinct curve arcs and points as + * defined by \c CurvedKernelViaAnalysis_2::Arc_2 and * \c CurvedKernelViaAnalysis_2::Point_2. \c Coeff_ template parameter - * defines an underlying number type to be used in polynomial and range - * evaluations. Valid instantiations are \c double, multi-precision float or - * exact rational number type. The main float-point number type is defined by + * defines an underlying number type to be used in polynomial and range + * evaluations. Valid instantiations are \c double, multi-precision float or + * exact rational number type. The main float-point number type is defined by * \c Curve_renderer_traits::Float. */ //!@{ template class Curve_renderer_2 { -public: - //! \name public typedefs - //!@{ - +public: + //! \name public typedefs + //!@{ + //! this instance's first template argument typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; - + //! this instance's second template argument typedef Coeff_ Coeff; - + //! type of embedded curve kernel - typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 + typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2 Curve_kernel_2; - + //! type of x-monotone arc typedef typename Curved_kernel_via_analysis_2::X_monotone_curve_2 Arc_2; - + //! type of a point on curve typedef typename Curved_kernel_via_analysis_2::Point_2 Point_2; - + //! type of 1-curve analysis typedef typename Curve_kernel_2::Curve_analysis_2 Curve_analysis_2; - + //!@} -private: - //! \name private typedefs +private: + //! \name private typedefs //!@{ //! type of X_coordinate @@ -171,7 +171,7 @@ class Curve_renderer_2 //! curve renderer type conversion traits typedef typename Renderer_internals::Renderer_traits Renderer_traits; - + //! coercion between rational and polynomial coefficients number type typedef typename Renderer_internals::Rat_coercion_type Rat_coercion_type; @@ -183,52 +183,52 @@ class Curve_renderer_2 //! specialized integer number type typedef typename Renderer_traits::Integer Integer; - + //! event line instance type typedef typename Curve_analysis_2::Status_line_1 Status_line_1; - + //! underlying bivariate polynomial type typedef typename Renderer_internals::Polynomial_2 Polynomial_2; - + //! underlying univariate polynomial type typedef typename Renderer_internals::Poly_dst_1 Poly_dst_1; - + //! basic number type used in all computations typedef typename Renderer_internals::NT NT; - + //! instance of a univariate polynomial typedef typename Renderer_internals::Poly_1 Poly_1; //! instance of a bivariate polynomial typedef typename Renderer_internals::Poly_2 Poly_2; - + //! conversion from the basic number type to doubles typename CGAL::Real_embeddable_traits::To_double to_double; - + //! conversion from the basic number type to integers typename Renderer_traits::Rat_to_integer rat2integer; //! conversion from \c Integer type to built-in integer typename Renderer_traits::Float_to_int float2int; - + //! conversion from \c Rational type to used number type typename Renderer_traits::Rat_to_float rat2float; //! makes the result exact after inexact operation (applicable only for //! exact number types typename Renderer_traits::Make_exact make_exact; - + //! returns \c true when the precision limit for a specified number type is //! reached typename Renderer_traits::Precision_limit limit; //! maximum level of subdivision dependending on speficied number type - static const unsigned MAX_SUBDIVISION_LEVEL = + static const unsigned MAX_SUBDIVISION_LEVEL = Renderer_traits::MAX_SUBDIVISION_LEVEL; - + //! pixel instance type typedef internal::Pixel_2_ Pixel_2; //! seed point instance type typedef internal::Seed_point_ Seed_point; //! support for multiple seed points typedef std::stack Seed_stack; - + //! a range of x-coordinates to define bottom/top clip points typedef internal::Clip_point_ Clip_point_entry; @@ -236,12 +236,12 @@ class Curve_renderer_2 typedef std::vector Clip_points; //! an integer index container typedef std::vector index_vector; - + //! map container element's type for maintaining a list of cache instances typedef std::pair LRU_entry; //! LRU list used for cache switching typedef std::vector< LRU_entry > Cache_list; - + //! internal use only: a stripe defined by bounding polynomials //! and coordinates on sides, index 0 - lower boundary, 1 - upper boundary struct Stripe { @@ -249,39 +249,39 @@ class Curve_renderer_2 NT key[2]; unsigned level[2]; } ; - + //!@} -public: +public: //! \name public methods - //!@{ - + //!@{ + //! default constructor: a curve segment is undefined Curve_renderer_2() : cache_id(-1), IA_method(0), initialized(false), one(1) { arcno = -1; setup(Bbox_2(-1.0, -1.0, 1.0, 1.0), 640, 480); } - + //! sets up drawing window and pixel resolution void setup(const Bbox_2& bbox_, int res_w_, int res_h_) { - + initialized = engine.setup(bbox_, res_w_, res_h_); clip_pts_computed = false; // need to recompute clip points each time // the window dimensions are changed } - + //! \brief returns currently used supporting algebraic curve Curve_analysis_2 curve() const { return *support; } - - //! \brief returns the drawing window and resolution - void get_setup_parameters(CGAL::Bbox_2 *pbox, int& res_w_, + + //! \brief returns the drawing window and resolution + void get_setup_parameters(CGAL::Bbox_2 *pbox, int& res_w_, int& res_h_) const { if(pbox != nullptr) *pbox = engine.window; - res_w_ = engine.res_w; + res_w_ = engine.res_w; res_h_ = engine.res_h; } @@ -297,12 +297,12 @@ class Curve_renderer_2 ~Curve_renderer_2() { cache_list.clear(); } - - //!@} + + //!@} private: //! \name Private methods - //!@{ - + //!@{ + //! \brief advances pixel's coordinates by given increments void advance_pixel(Pixel_2& pix, int new_dir) { @@ -318,11 +318,11 @@ class Curve_renderer_2 (y < 0 ? pix.y-- : y > pow ? pix.y++ : y); pix.sub_x = x&pow; pix.sub_y = y&pow; - } + } } - + //! computes pixel coordinates from rational point - void get_pixel_coords(const Rational& x, const Rational& y, + void get_pixel_coords(const Rational& x, const Rational& y, Pixel_2& pix, Rational *ppix_x=nullptr, Rational *ppix_y=nullptr) { Rational p_x = (x - engine.x_min_r) / engine.pixel_w_r, @@ -331,22 +331,22 @@ class Curve_renderer_2 #ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT pix.xv = CGAL::to_double(x); pix.yv = CGAL::to_double(y); -#endif +#endif pix.x = static_cast(std::floor(CGAL::to_double(p_x))); - pix.y = static_cast(std::floor(CGAL::to_double(p_y))); + pix.y = static_cast(std::floor(CGAL::to_double(p_y))); if(ppix_x != nullptr && ppix_y != nullptr) { *ppix_x = p_x; *ppix_y = p_y; } } - + //! refines y-coordinate of \c Coordinate_2 to a certain bound void refine_xy(const Coordinate_2& xy, const Rational& bound, Rational& low, Rational& up) { Approximate_absolute_y_2 ay = - xy.kernel()->approximate_absolute_y_2_object(); + xy.kernel()->approximate_absolute_y_2_object(); Bounds bnd = ay(xy, -2); // do not approximate int prec = 1; @@ -356,59 +356,59 @@ class Curve_renderer_2 } low = bnd.first, up = bnd.second; } - + //!@} private: //! \name Private properties - //!@{ - + //!@{ + unsigned max_level; //! maximum subdivision level unsigned current_level; int arcno; //! arcno ? - + bool clip_pts_computed; //! indicates whether clip points are computed - + Pixel_2 isolated_l, isolated_h; //! isolating rectangles for lower and //! upper end-points - + //! an instance of rendering engine internal::Curve_renderer_internals engine; - + Curve_analysis_2 *support; //! supporting 1-curve analysis Curve_analysis_2 support_[CGAL_N_CACHES]; - + Clip_points btm_clip, top_clip; //! a set of bottom and top clip points - Poly_dst_1 btm_poly, top_poly; //! bottom and top polynomials - + Poly_dst_1 btm_poly, top_poly; //! bottom and top polynomials + int cache_id; //! index of currently used cache instance Cache_list cache_list; //! list of indices of cache instances - + Seed_stack s_stack; //! a stack of seed points Seed_point current_seed; //! current seed point - + int IA_method; //! which IA method to use (0 - QF, 1 - MAA) - + bool initialized; //! indicates whether the renderer has been initialized //! with correct parameters const Integer one; //! just "one" bool branches_coincide; //! indicates that there are several branches //! passing through one neighbourhood pixel - int direction_taken; //! stores a direction taken from the seed point + int direction_taken; //! stores a direction taken from the seed point //! during tracking, if it's possible to determine //! 0 - towards lower point, 1 - towards upper //!@} //!\name public methods //!@{ -public: +public: -/*!\brief +/*!\brief * main rendering procedure for curve arcs * returns a list of sequences of coordinates as objects of type \c Coord_2 * which must be constructible from a pair of ints / doubles * - * An exception \c Insufficient_rasterize_precision_exception is + * An exception \c Insufficient_rasterize_precision_exception is * thrown whenever the precision of currently used NT is not enough * to correctly render a curve arc. The exception has to be caught * outside the renderer to switch to a higher-precision arithmetic @@ -417,9 +417,9 @@ class Curve_renderer_2 */ template < class Coord_2, template < class, class > class Container, class Allocator > -void draw(const Arc_2& arc, +void draw(const Arc_2& arc, Container< std::vector< Coord_2 >, Allocator >& points, - boost::optional< Coord_2 > *end_pt1 = nullptr, + boost::optional< Coord_2 > *end_pt1 = nullptr, boost::optional< Coord_2 > *end_pt2 = nullptr) { #ifdef CGAL_CKVA_CR_TIMING @@ -428,13 +428,13 @@ void draw(const Arc_2& arc, if(!initialized) return; - select_cache_entry(arc); // lookup for appropriate cache instance + select_cache_entry(arc); // lookup for appropriate cache instance Gfx_OUT("\n////////////////////\n resolution: " << engine.res_w << " x " << engine.res_h << std::endl); Gfx_OUT("box: [" << engine.x_min << "; " << engine.y_min << "]x[" << engine.x_max << "; " << engine.y_max << "]" << std::endl); - + #ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT Rational lower = engine.x_min_r, upper = engine.x_max_r, y_lower = 0, y_upper = 0; @@ -449,9 +449,9 @@ void draw(const Arc_2& arc, Gfx_OUT("refining left point\n"); const Coordinate_1& x0 = arc.curve_end_x(CGAL::ARR_MIN_END); typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1 - approximate_x; + approximate_x; - Bounds bnd = approximate_x(x0, 0); + Bounds bnd = approximate_x(x0, 0); while(1) { if(bnd.first >= engine.x_max_r) { x_outside_window = true; @@ -466,11 +466,11 @@ void draw(const Arc_2& arc, } bnd = approximate_x(x0, 1); } - } + } // since end-points are sorted lexicographically, no need to check for - // lower boundary - if(loc_p2 == CGAL::ARR_TOP_BOUNDARY && arc.is_vertical()) + // lower boundary + if(loc_p2 == CGAL::ARR_TOP_BOUNDARY && arc.is_vertical()) y_upper = engine.y_max_r; if(loc_p2 != CGAL::ARR_RIGHT_BOUNDARY) { @@ -479,7 +479,7 @@ void draw(const Arc_2& arc, const Coordinate_1& x0 = arc.curve_end_x(CGAL::ARR_MAX_END); typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1 - approximate_x; + approximate_x; Bounds bnd = approximate_x(x0, 0); // do not approximate while(1) { @@ -508,12 +508,12 @@ void draw(const Arc_2& arc, CGAL::Arr_parameter_space loc_p1 = arc.location(CGAL::ARR_MIN_END), loc_p2 = arc.location(CGAL::ARR_MAX_END); - + Rational ref_bound = engine.pixel_w_r/CGAL_REFINE_X; if(loc_p1 != CGAL::ARR_LEFT_BOUNDARY) { const Coordinate_1& x0 = arc.curve_end_x(CGAL::ARR_MIN_END); typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1 - approximate_x; + approximate_x; Bounds bnd = approximate_x(x0, 0); // do not approximate @@ -522,19 +522,19 @@ void draw(const Arc_2& arc, } lower = bnd.second; } else { - lower = engine.x_min_r; + lower = engine.x_min_r; clip_src = true; - } + } // since end-points are sorted lexicographically, no need to check for - // lower boundary - if(loc_p2 == CGAL::ARR_TOP_BOUNDARY && arc.is_vertical()) + // lower boundary + if(loc_p2 == CGAL::ARR_TOP_BOUNDARY && arc.is_vertical()) y_upper = engine.y_max_r; if(loc_p2 != CGAL::ARR_RIGHT_BOUNDARY) { const Coordinate_1& x0 = arc.curve_end_x(CGAL::ARR_MAX_END); typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1 - approximate_x; + approximate_x; Bounds bnd = approximate_x(x0, 0); // do not approximate while(bnd.second - bnd.first > ref_bound) { @@ -556,7 +556,7 @@ void draw(const Arc_2& arc, x_outside_window = true; clip_src = clip_tgt = true; } - + if(lower < engine.x_min_r) { lower = engine.x_min_r; clip_src = true; @@ -576,55 +576,55 @@ void draw(const Arc_2& arc, #endif Gfx_OUT("computing y-coordinates\n"); - if(loc_p1 == CGAL::ARR_INTERIOR || clip_src) + if(loc_p1 == CGAL::ARR_INTERIOR || clip_src) y_lower = get_endpoint_y(arc, lower, CGAL::ARR_MIN_END, clip_src, ref_bound); - - else if(loc_p1 == CGAL::ARR_BOTTOM_BOUNDARY) + + else if(loc_p1 == CGAL::ARR_BOTTOM_BOUNDARY) y_lower = (arc.is_vertical() ? engine.y_min_r : engine.y_min_r - height_r); - + else { // endpoints must be sorted lexicographical CGAL_precondition(!arc.is_vertical()); y_lower = engine.y_max_r + height_r; } - if(loc_p2 == CGAL::ARR_INTERIOR || clip_tgt) + if(loc_p2 == CGAL::ARR_INTERIOR || clip_tgt) y_upper = get_endpoint_y(arc, upper, CGAL::ARR_MAX_END, clip_tgt, ref_bound); - + else if(loc_p2 == CGAL::ARR_BOTTOM_BOUNDARY) { CGAL_precondition(!arc.is_vertical()); y_upper = engine.y_min_r - height_r; - + } else y_upper = (arc.is_vertical() ? engine.y_max_r : engine.y_max_r + height_r); - } + } #ifdef CGAL_CKVA_CR_TIMING refine_timer.stop(); #endif #ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT - if(end_pt1 != nullptr && loc_p1 == CGAL::ARR_INTERIOR && + if(end_pt1 != nullptr && loc_p1 == CGAL::ARR_INTERIOR && (clip_src || y_lower < engine.y_min_r || y_lower > engine.y_max_r)) { - y_lower0 = (clip_src ? + y_lower0 = (clip_src ? get_endpoint_y(arc, lower0, CGAL::ARR_MIN_END, false, CGAL_REFINE_DOUBLE_APPROX) : y_lower); Gfx_OUT("lower end-point: [" << CGAL::to_double(lower0) << "; " << CGAL::to_double(y_lower0) << "]\n"); - *end_pt1 = Coord_2(CGAL::to_double(lower0), - CGAL::to_double(y_lower0)); + *end_pt1 = Coord_2(CGAL::to_double(lower0), + CGAL::to_double(y_lower0)); } - if(end_pt2 != nullptr && loc_p2 == CGAL::ARR_INTERIOR && - (clip_tgt || y_upper < engine.y_min_r || y_upper > engine.y_max_r)) { - y_upper0 = (clip_tgt ? + if(end_pt2 != nullptr && loc_p2 == CGAL::ARR_INTERIOR && + (clip_tgt || y_upper < engine.y_min_r || y_upper > engine.y_max_r)) { + y_upper0 = (clip_tgt ? get_endpoint_y(arc, upper0, CGAL::ARR_MAX_END, false, CGAL_REFINE_DOUBLE_APPROX) : y_upper); Gfx_OUT("upper end-point: [" << CGAL::to_double(upper0) << "; " << CGAL::to_double(y_upper0) << "]\n"); - *end_pt2 = Coord_2(CGAL::to_double(upper0), + *end_pt2 = Coord_2(CGAL::to_double(upper0), CGAL::to_double(y_upper0)); } if(x_outside_window) @@ -632,30 +632,30 @@ void draw(const Arc_2& arc, #endif // CGAL_CKVA_RENDER_WITH_REFINEMENT Pixel_2 pix_1, pix_2; - + Gfx_OUT("lower: " << CGAL::to_double(lower) << "; upper: " << CGAL::to_double(upper) << "; y_lower: " << CGAL::to_double(y_lower) << "; y_upper: " << CGAL::to_double(y_upper) << "\n"); - get_pixel_coords(lower, y_lower, pix_1); - get_pixel_coords(upper, y_upper, pix_2); - + get_pixel_coords(lower, y_lower, pix_1); + get_pixel_coords(upper, y_upper, pix_2); + #ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT if(end_pt1 != nullptr) *end_pt1 = Coord_2(pix_1.x, pix_1.y); if(end_pt2 != nullptr) *end_pt2 = Coord_2(pix_2.x, pix_2.y); #endif - + Gfx_OUT("lower pix: (" << pix_1.x << "; " << pix_1.y << ") upper pix: (" << pix_2.x << "; " << pix_2.y << ") pixel_w: " << engine.pixel_w << " pixel_h: " << engine.pixel_h << std::endl); - + std::vector< Coord_2 > rev_points; // reserve at least enough space for arc's x-length rev_points.reserve(CGAL_ABS(pix_2.x - pix_1.x)); - + if(arc.is_vertical()) { #ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT CGAL_CKVA_STORE_COORDS(rev_points, pix_1); @@ -677,56 +677,56 @@ void draw(const Arc_2& arc, horizontal_clip(); clip_pts_computed = true; } - + typedef std::pair Int_pair; typedef std::vector index_pair_vector; index_vector btm_idx, top_idx; index_pair_vector seg_pts; - + Gfx_OUT("checking bottom clip: y = " << engine.y_min << "\n"); segment_clip_points(lower, upper, y_lower, y_upper, engine.y_min_r, btm_poly, arc.arcno(), btm_clip, btm_idx); - + Gfx_OUT("checking top clip: y = " << engine.y_max << "\n"); segment_clip_points(lower, upper, y_lower, y_upper, engine.y_max_r, top_poly, arc.arcno(), top_clip, top_idx); - + index_vector::iterator it1 = btm_idx.begin(), it2 = top_idx.begin(); - while(1) { + while(1) { bool push_1 = true; if(it1 != btm_idx.end()) { if(it2 != top_idx.end()) push_1 = ((btm_clip)[*it1].left < (top_clip)[*it2].left); - } else if(it2 != top_idx.end()) + } else if(it2 != top_idx.end()) push_1 = false; - else + else break; if(push_1) { // 0 - bottom point, 1 - top point seg_pts.push_back(Int_pair(*it1,0)); - it1++; + it1++; } else { seg_pts.push_back(Int_pair(*it2,1)); - it2++; + it2++; } } - + max_level = 0; Pixel_2 start; int dir[2], b_taken[2], last_x = -engine.res_w; bool b_coincide; Rational pt, mid; - + branches_coincide = false; // make a small tolerance bool pt1_inside = (pix_1.y >= -1 && pix_1.y <= engine.res_h), pt2_inside = (pix_2.y >= -1 && pix_2.y <= engine.res_h); - + //TODO: use Event1_info::multiplicity(i) - to gather information about roots ? if(seg_pts.size() == 1 && pt1_inside && pt2_inside) seg_pts.clear(); - + arcno = arc.arcno(); - // easy case: no clip-points found + // easy case: no clip-points found if(seg_pts.size() == 0) { if(!pt1_inside && !pt2_inside) { Gfx_OUT("segment is outside\n"); @@ -735,20 +735,20 @@ void draw(const Arc_2& arc, /// WARNING: if x-interval is small while y coordinates are far away from /// the window, we can get into the troubles.. if(pix_2.x - pix_1.x <= 1) {// it goes away right here - CGAL_CKVA_STORE_COORDS(rev_points, pix_1); + CGAL_CKVA_STORE_COORDS(rev_points, pix_1); CGAL_CKVA_STORE_COORDS(rev_points, pix_2); points.push_back(rev_points); return; - } + } Gfx_OUT("NO clip points\n"); mid = (lower + upper)/2; pt = engine.x_min_r + (pix_1.x*2+5)*engine.pixel_w_r/2; // segment is almost vertical - start from a middle point - //if(pt > mid) - pt = mid; + //if(pt > mid) + pt = mid; if(!get_seed_point(pt, start, dir, b_taken, b_coincide)) { - Gfx_OUT("generic error occurred..\n"); + Gfx_OUT("generic error occurred..\n"); return; } Gfx_OUT("starting pixel found: " << start << " directions: " << dir[0] @@ -756,30 +756,30 @@ void draw(const Arc_2& arc, // only one point list draw_lump(rev_points, last_x, pix_1, pix_2); points.push_back(rev_points); - + Gfx_OUT("exit normal, max_level: " << max_level << std::endl); return; - } - + } + // clip-points presented Rational l, r, y_clip; Coordinate_1 alpha; Poly_dst_1 *ppoly; Clip_point_entry *pclip, *ptmp; - + Gfx_OUT("segment is not completely inside the window..\n"); - index_pair_vector::iterator it = seg_pts.begin(), + index_pair_vector::iterator it = seg_pts.begin(), eend = seg_pts.end(); - + Gfx_OUT("\n\nSEGMENT clip points: \n"); Pixel_2 pix_beg, pix_end; bool straight_segment; - + while(it != eend) { if(it != seg_pts.begin() && it == eend-1 && !pt2_inside) break; straight_segment = false; - + int idx = it->first; if(it->second == 0) {// bottom points pclip = &btm_clip[idx]; @@ -794,20 +794,20 @@ void draw(const Arc_2& arc, } l = pclip->left; r = pclip->right; - Gfx_OUT(CGAL::to_double(l) << "; " << CGAL::to_double(r) << "\n"); + Gfx_OUT(CGAL::to_double(l) << "; " << CGAL::to_double(r) << "\n"); if(last_x != -engine.res_w) { // compute screen coordinates of a pixel Rational last_pt = engine.x_min_r + static_cast(last_x)* - engine.pixel_w_r; + engine.pixel_w_r; if(r <= last_pt) { // skip a clip-point if already drawn Gfx_OUT("clip point skipped..\n"); it++; continue; } } - + rev_points.clear(); - if(it == seg_pts.begin() && pt1_inside) { + if(it == seg_pts.begin() && pt1_inside) { Gfx_OUT("starting point is near the left end-point\n"); //pt = engine.x_min_r + (pix_1.x*2+5)*engine.pixel_w_r/2; @@ -816,12 +816,12 @@ void draw(const Arc_2& arc, Gfx_OUT("refining the left end-point\n"); refine_alg_point(l, r, *ppoly, lower, 1); - pt = l; - if(l - lower <= engine.pixel_w_r*2) + pt = l; + if(l - lower <= engine.pixel_w_r*2) straight_segment = true; } pix_beg = pix_1; - get_pixel_coords(l, y_clip, pix_end); + get_pixel_coords(l, y_clip, pix_end); } else if(it == eend - 1 && pt2_inside) { @@ -831,46 +831,46 @@ void draw(const Arc_2& arc, Gfx_OUT("pt is: " << CGAL::to_double(pt) << "; r is: " << CGAL::to_double(r) << ": pixel_w_r: " << CGAL::to_double(engine.pixel_w_r) << "\n"); - + if(pt >= upper) { // ensure that clip-point interval is sufficiently small refine_alg_point(l, r, *ppoly, upper, 1); - pt = r; - if(upper - r <= engine.pixel_w_r*2) + pt = r; + if(upper - r <= engine.pixel_w_r*2) straight_segment = true; } pix_end = pix_2; - get_pixel_coords(r, y_clip, pix_beg); + get_pixel_coords(r, y_clip, pix_beg); } else { Gfx_OUT("starting point is between clip-points\n"); it++; - + if(it == seg_pts.end()) { Gfx_OUT("ERROR: clip point missed ?\n"); break; } - + idx = it->first; ptmp = (it->second ? &top_clip[idx] : &btm_clip[idx]); pt = pclip->alpha.rational_between(ptmp->alpha); - - get_pixel_coords(l, y_clip, pix_beg); + + get_pixel_coords(l, y_clip, pix_beg); get_pixel_coords(ptmp->left, it->second ? engine.y_max_r : - engine.y_min_r, pix_end); + engine.y_min_r, pix_end); if(CGAL_ABS(ptmp->left - l) <= engine.pixel_w_r*2) { - + Coordinate_2 xy(Coordinate_1(pt), *support, arc.arcno()); Rational _; refine_xy(xy, engine.pixel_h_r/CGAL_REFINE_Y, _, mid); // mid = ubound_y(xy); CGAL_CKVA_STORE_COORDS(rev_points, pix_beg); - get_pixel_coords(pt, mid, pix_beg); + get_pixel_coords(pt, mid, pix_beg); straight_segment = true; - } + } } -#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT +#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT if(straight_segment) { Gfx_OUT("straight subsegment found\n"); CGAL_CKVA_STORE_COORDS(rev_points, pix_beg); @@ -881,13 +881,13 @@ void draw(const Arc_2& arc, continue; } #endif // !CGAL_CKVA_RENDER_WITH_REFINEMENT - + if(!get_seed_point(pt, start, dir, b_taken, b_coincide)) { Gfx_OUT("get_seed_point: a problem occurred..\n"); - it++; + it++; continue; } - + Gfx_OUT("starting pixel found: " << start << " directions: " << dir[0] << " and " << dir[1] << std::endl); draw_lump(rev_points, last_x, pix_beg, pix_end); @@ -925,7 +925,7 @@ bool draw(const Point_2& pt, Coord_2& coord) { // while(ubound_x(x0) - lbound_x(x0) > ref_bound) // refine_x(x0); Rational x_s = bnd.first, y_s; -#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT +#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT if(x_s < engine.x_min_r || x_s > engine.x_max_r) return false; #endif @@ -941,8 +941,8 @@ bool draw(const Point_2& pt, Coord_2& coord) { Pixel_2 pix; get_pixel_coords(x_s, y_s, pix); -#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT - if(pix.x < 0 || pix.x >= engine.res_w || pix.y < 0 || +#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT + if(pix.x < 0 || pix.x >= engine.res_w || pix.y < 0 || pix.y >= engine.res_h) return false; @@ -968,16 +968,16 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, int back_dir, new_dir, stored_dir, dir[2], b_taken[2], ux, uy; bool b_coincide, failed; start = s_stack.top().start; - + bool pix_1_close = (CGAL_ABS(start.x - pix_1.x) <= 1&& CGAL_ABS(start.y - pix_1.y) <= 1), pix_2_close = (CGAL_ABS(start.x - pix_2.x) <= 1&& CGAL_ABS(start.y - pix_2.y) <= 1); - + // stores an x-coordinate of the last traced pixel in --> direction: // required to "jump" over clip-points - last_x = -engine.res_w; - + last_x = -engine.res_w; + if(pix_1_close && pix_2_close) { // suppress drawing of trivial segments CGAL_CKVA_STORE_COORDS(rev_points, pix_1); CGAL_CKVA_STORE_COORDS(rev_points, pix_2); @@ -999,7 +999,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, current_seed = s_stack.top(); s_stack.pop(); branches_coincide = current_seed.branches_coincide; - if(direction_taken == -1) + if(direction_taken == -1) direction_taken = current_seed.direction_taken; witness = current_seed.start; @@ -1016,20 +1016,20 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, // store result in a list or reversed list depending on the orientation std::vector< Coord_2 > & ppoints = (direction_taken == 0 ? rev_points : points); - + Gfx_OUT("continuing from a seed point: " << witness << "; back_dir: " << back_dir << " direction_taken: " << direction_taken << std::endl); - + bool is_exit = false; while(1) { if(pix.x < 0 || pix.x > engine.res_w || pix.y < -CGAL_WINDOW_ENLARGE|| pix.y > engine.res_h + CGAL_WINDOW_ENLARGE) { branches_coincide = false; break; - } + } CGAL_CKVA_STORE_COORDS(ppoints, pix); -#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT +#ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT bool bb1 = (direction_taken == 0 && pix.x <= pix_1.x), bb2 = (direction_taken == 1 && pix.x >= pix_2.x); if((bb1 || bb2)) { @@ -1043,16 +1043,16 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, bool set_ready = false; if(CGAL_ABS(pix.x - pix_1.x) <= 1 && CGAL_ABS(pix.y - pix_1.y) <= 1) { if(!overstep || ready) { - pix = pix_1; + pix = pix_1; branches_coincide = false; break; } set_ready = true; - } + } if(CGAL_ABS(pix.x - pix_2.x) <= 1 && CGAL_ABS(pix.y - pix_2.y) <= 1) { if(!overstep || ready) { - pix = pix_2; + pix = pix_2; branches_coincide = false; break; } @@ -1070,7 +1070,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, break; } prev_pix = pix; - advance_pixel(pix,new_dir); + advance_pixel(pix,new_dir); back_dir = (new_dir+4)&7; } else { back_dir = stored_dir; @@ -1119,7 +1119,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, break; stored_dir = back_dir; - witness = pix; + witness = pix; pix.level = 0; pix.sub_x = 0; pix.sub_y = 0; @@ -1132,37 +1132,37 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, } back_dir = (new_dir+4)&7; } - + if(branches_coincide) { // oops, need another seed point if(direction_taken == -1) { Gfx_OUT("\n\nFATAL: unknown direction in coincide mode!\n\n"); return; } - + (direction_taken == 0) ? pix.x -= 1 : pix.x += 1; if(pix.x >= pix_2.x-1||pix.x <= pix_1.x+1) goto Lexit; - + //std::cout << "New seed point required at: " << pix << std::endl; if(!get_seed_point(engine.x_min_r+pix.x*engine.pixel_w_r, start, dir, - b_taken, b_coincide)) { + b_taken, b_coincide)) { std::cerr << " wrong seed point found " << std::endl; throw internal::Insufficient_rasterize_precision_exception(); } - + Gfx_OUT("new seed point found: " << start << " directions: " << dir[0] << " and " << dir[1] << "; taken = " << direction_taken << std::endl); - + b_taken[0] = internal::DIR_TAKEN_MAP[dir[0]]; b_taken[1] = internal::DIR_TAKEN_MAP[dir[1]]; - if(b_taken[0] != -1) + if(b_taken[0] != -1) new_dir = dir[b_taken[0] != direction_taken ? 0: 1]; - else if(b_taken[1] != -1) + else if(b_taken[1] != -1) new_dir = dir[b_taken[1] != direction_taken ? 1: 0]; else { - std::cerr << "ERROR: wrong backward dir after seed point: " << + std::cerr << "ERROR: wrong backward dir after seed point: " << dir[0] << " " << dir[1] << std::endl; throw internal::Insufficient_rasterize_precision_exception(); } @@ -1171,7 +1171,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, continue; } else if(is_exit) { -Lexit: +Lexit: pix = (direction_taken == 0 ? pix_1 : pix_2); } @@ -1179,7 +1179,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, //! if they proceeded by pt1/2_inside (-1 or res_h+1) //if(pix.y >= 0 && pix.y < engine.res_h) CGAL_CKVA_STORE_COORDS(ppoints, pix); - + // we were tracing in --> direction: store the pixel where we stopped if(direction_taken == 1) last_x = pix.x; @@ -1187,7 +1187,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, if(direction_taken != -1) direction_taken = 1 - direction_taken; ready = false; - + } // while(!s_stack.empty()) std::reverse(rev_points.begin(), rev_points.end()); @@ -1200,30 +1200,30 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x, //! recursively subdivides pixel into 4 subpixels, returns a new tracking //! direction -bool subdivide(Pixel_2& pix, int back_dir, int& new_dir) { +bool subdivide(Pixel_2& pix, int back_dir, int& new_dir) { - //Gfx_OUT("\n\nSubdivision of a pixel" << pix << " with back_dir = " << + //Gfx_OUT("\n\nSubdivision of a pixel" << pix << " with back_dir = " << //back_dir << std::endl); NT inv = NT(1) / NT(one << pix.level); make_exact(inv); int idx, pref_dir = back_dir>>1; - + if(pix.level >= MAX_SUBDIVISION_LEVEL) { - std::cerr << "reached maximum subdivision level: " << pix << + std::cerr << "reached maximum subdivision level: " << pix << std::endl; throw internal::Insufficient_rasterize_precision_exception(); } - + if(limit(engine.pixel_w * inv) || limit(engine.pixel_h * inv)) { std::cerr << "too small subpixel size: " << pix << std::endl; throw internal::Insufficient_rasterize_precision_exception(); } - + // if several branches coincide withing this pixel we cannot perform // a subdivision - if(branches_coincide) + if(branches_coincide) return false; - + if(back_dir & 1) { // diagonal direction idx = get_subpixel_diag(pix,pref_dir); if(idx == -1) { @@ -1232,7 +1232,7 @@ bool subdivide(Pixel_2& pix, int back_dir, int& new_dir) { throw internal::Insufficient_rasterize_precision_exception(); } idx = D_SUBPIX_MAP[pref_dir][idx]; - + } else { idx = get_subpixel_hv(pix,pref_dir); if(idx == -1) { @@ -1242,13 +1242,13 @@ bool subdivide(Pixel_2& pix, int back_dir, int& new_dir) { } idx = HV_SUBPIX_MAP[pref_dir][idx]; } - + pix.level++; if(max_level < pix.level) max_level = pix.level; if(current_level < pix.level) current_level = pix.level; - + pix.sub_x = (pix.sub_x<<1) + (idx&1); pix.sub_y = (pix.sub_y<<1) + (idx>>1); //Gfx_DETAILED_OUT("subpixel index: " << idx << " (" << pix.sub_x << "; " @@ -1261,7 +1261,7 @@ bool subdivide(Pixel_2& pix, int back_dir, int& new_dir) { } //! returns a "seed" point of a segment and two possible directions from it -bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir, +bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir, int *b_taken, bool& b_coincide) { Rational x_s = seed, y_s; @@ -1270,39 +1270,39 @@ bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir, //NOTE dirty HACK: we have no kernel instance .. Coordinate_2 xy(Coordinate_1(seed), *support, arcno); - Rational _; + Rational _; refine_xy(xy, engine.pixel_h_r/CGAL_REFINE_Y, _, y_s); // y_s = ubound_y(xy); Integer lvl = one; Rational x_seed, y_seed; get_pixel_coords(x_s, y_s, start, &x_seed, &y_seed); - + Gfx_OUT("y_seed = " << rat2float(y_seed) << std::endl); - + // we allow a small tolerance for seed point coordinates due to // round off errors - if(start.y < -CGAL_WINDOW_ENLARGE || + if(start.y < -CGAL_WINDOW_ENLARGE || start.y > engine.res_h + CGAL_WINDOW_ENLARGE) { - Gfx_OUT("get_seed_point: starting pixel does not fit the window " + Gfx_OUT("get_seed_point: starting pixel does not fit the window " "boundaries " << std::endl); return false; } - + start.level = 0; start.sub_x = 0; start.sub_y = 0; current_level = 0; - + //Gfx_OUT("refining starting pixel: " << start << std::endl); // Gfx_OUT("x/y seed: (" << CGAL::to_double(x_seed) << "; " << // CGAL::to_double(y_seed) << ")" << std::endl); b_taken[0] = b_taken[1] = -1; b_coincide = false; - + int coincide_level = 0; while(!test_pixel(start, (int *)dir, (int *)b_taken, b_coincide)) { - + //Gfx_OUT("refining starting pixel: " << start << std::endl); if(start.level >= MAX_SUBDIVISION_LEVEL) { std::cerr << "get_seed_point: reached maximum subdivision level " @@ -1310,38 +1310,38 @@ bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir, throw internal::Insufficient_rasterize_precision_exception(); } //dump_neighbourhood(start); - + if(limit(engine.pixel_w/NT(lvl))||limit(engine.pixel_h/NT(lvl))) { std::cerr << "get_seed_point: too small subpixel size: " << start.level << std::endl; throw internal::Insufficient_rasterize_precision_exception(); } - + start.level++; if(start.level > max_level) max_level = start.level; if(start.level > current_level) current_level = start.level; lvl <<= 1; - + if(lvl > CGAL_REFINE_Y) { Rational _; refine_xy(xy, engine.pixel_h_r/(lvl*2), _, y_s); y_seed = (y_s - engine.y_min_r)/engine.pixel_h_r; } - + start.sub_x = rat2integer((x_seed - start.x)*lvl); start.sub_y = rat2integer((y_seed - start.y)*lvl); - + if(start.sub_x < 0) start.sub_x = 0; start.sub_x &= (lvl-1); if(start.sub_y < 0) start.sub_y = 0; start.sub_y &= (lvl-1); - + if(current_level >= CGAL_COINCIDE_LEVEL) { - + Pixel_2 test = start; test.sub_x = start.sub_x >> (start.level - coincide_level); test.sub_y = start.sub_y >> (start.level - coincide_level); @@ -1373,11 +1373,11 @@ bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir, Rat_coercion_type vx = -engine.substitute_xy(*(engine.rational_fy), x_s, y_s), vy = engine.substitute_xy(*(engine.rational_fx), x_s, y_s); - + NT vvx = rat2float(vx), vvy = rat2float(vy); if(vvy < 0) { vvx = -vvx; - } + } // vx > 0: 2 - right(1), 6 - left(0) // vx < 0: 2 - left(0), 6 - right(1) @@ -1388,14 +1388,14 @@ bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir, b_taken[0] = !flag; // !(vx > 0) b_taken[1] = flag; // vx > 0 } else if(dir[0] == 6||dir[1] == 2) { - b_taken[0] = flag; // vx > 0 + b_taken[0] = flag; // vx > 0 b_taken[1] = !flag; // !(vx > 0) - } + } } else // t1 != -1 b_taken[0] = 1 - b_taken[1]; } else if(t1 == -1) b_taken[1] = 1 - b_taken[0]; - + s_stack.push(Seed_point(start, dir[0], b_taken[0], b_coincide)); s_stack.push(Seed_point(start, dir[1], b_taken[1], b_coincide)); } @@ -1413,7 +1413,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) make_exact(inv); get_boundaries(CGAL_X_RANGE, pix, box[1]); get_boundaries(CGAL_Y_RANGE, pix, box[0]); - NT bottom = box[1].key[0], //top = box[1].key[1], + NT bottom = box[1].key[0], //top = box[1].key[1], left = box[0].key[0], lower;//, right = box[0].key[1], lower; // bottom(2), top(3), left(0), right(1) int n_sign = 0, i, j, n_dir = 0, shift, n_local, new_dir; @@ -1423,22 +1423,22 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) Gfx_OUT("test pixel: " << pix << "--------------------------------\n"); dump_neighbourhood(pix); Gfx_OUT("----------------------------------------------\n\n");*/ - + b_coincide = false; int n_corner_dir = 0, corner_dir[] = {-1, -1}; // process subsegments: left/right - for(i = 0; i < 2; i++) { - for(j = 0, n_local = 0, lower = bottom; j < 3; j++, lower += inv) + for(i = 0; i < 2; i++) { + for(j = 0, n_local = 0, lower = bottom; j < 3; j++, lower += inv) if(get_range_1(CGAL_Y_RANGE, lower, lower+inv, box[0].key[i], box[0].poly[i], 3) || engine.zero_bounds) { - + Gfx_DETAILED_OUT("intersection detected at subsegment: " << j << " side: " << i << "; left(0), right(1), bottom(2), top(3)" << std::endl); - + if(engine.zero_bounds) { - + bool is_corner = false; int diff = float2int((lower - pix.y)*lvl - pix.sub_y); int low_sign = engine.evaluate_generic(CGAL_Y_RANGE, lower, @@ -1446,7 +1446,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) Gfx_DETAILED_OUT("zero bounds detected, low_sign: " << low_sign << "\n"); - + if(diff != 0) { if(diff == 1) { is_corner = (engine.evaluate_generic(CGAL_Y_RANGE, @@ -1460,7 +1460,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) if(!is_corner) continue; } - + if(is_corner) { // compute corner direction diff = internal::DIR_MAP[i][diff+1]; @@ -1476,7 +1476,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) } else if(low_sign != 0) continue; } - + n_local++; if(n_local > 1) { Gfx_DETAILED_OUT("more than 1 intersection along vertical side " @@ -1502,15 +1502,15 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) } n_sign += n_local; } - + get_polynomials(CGAL_X_RANGE,box[1]); Gfx_DETAILED_OUT("computing bottom/top sides" << std::endl); for(i = 0; i < 2; i++) { for(j = 0, n_local = 0, lower = left; j < 3; j++, lower += inv) { - + if(get_range_1(CGAL_X_RANGE,lower,lower+inv,box[1].key[i], box[1].poly[i], 3) || engine.zero_bounds) { - + Gfx_DETAILED_OUT("intersection detected at subsegment: " << j << " side: " << i + 2 << "; left(0), right(1), bottom(2), top(3) " << std::endl); @@ -1524,7 +1524,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) Gfx_DETAILED_OUT("zero bounds detected, low_sign: " << low_sign << "\n"); - + if(diff != 0) { if(diff == 1) { is_corner = (engine.evaluate_generic(CGAL_X_RANGE, @@ -1538,7 +1538,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) if(!is_corner) continue; } - + if(is_corner) { Gfx_DETAILED_OUT("corner direction detected\n"); // compute corner direction @@ -1552,8 +1552,8 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) } } else if(low_sign != 0) continue; - } - + } + n_local++; n_sign++; if(n_local > 1||n_sign > 2) { @@ -1561,7 +1561,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) "side " << i+2 << std::endl); return false; } - + if(!b_coincide) if(engine.first_der && !recursive_check(CGAL_X_RANGE, lower, lower+inv, box[1].key[i],box[1].poly[i])) { @@ -1591,35 +1591,35 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) make_exact(inv); get_boundaries(CGAL_X_RANGE,pix,box[1]); get_boundaries(CGAL_Y_RANGE,pix,box[0]); - //NT bottom = box[1].key[0], //top = box[1].key[1], + //NT bottom = box[1].key[0], //top = box[1].key[1], //left = box[0].key[0], right = box[0].key[1]; NT lower; // bottom(2), top(3), left(0), right(1) int f_der[2]; - int idx[2], ibox, ikey, var, n_sign = 0, i, j, n_dir = 0, shift, + int idx[2], ibox, ikey, var, n_sign = 0, i, j, n_dir = 0, shift, n_local, new_dir; get_polynomials(CGAL_Y_RANGE,box[0]); b_coincide = false; - for(i = 0; i < 4; i++) { + for(i = 0; i < 4; i++) { if(i == 2) get_polynomials(CGAL_X_RANGE,box[1]); var = (i < 2 ? CGAL_Y_RANGE : CGAL_X_RANGE); ibox = i >> 1; ikey = i & 1; - lower = box[1-ibox].key[0]; - for(j = 0, n_local = 0; j < 3; j++, lower += inv) + lower = box[1-ibox].key[0]; + for(j = 0, n_local = 0; j < 3; j++, lower += inv) if(get_range_1(var,lower,lower+inv,box[ibox].key[ikey], box[ibox].poly[ikey])||zero_bounds) { Gfx_DETAILED_OUT("intersection detected at subsegment: " << j << " side: " << i << "; left(0), right(1), bottom(2), top(3)" << std::endl); - if(zero_bounds&&evaluate_modular(var, lower, + if(zero_bounds&&evaluate_modular(var, lower, box[ibox].key[ikey], true) != 0) continue; n_local++; n_sign++; if(n_local > 1||n_sign > 2) { - Gfx_DETAILED_OUT("more than 1 intersection along side " << i + Gfx_DETAILED_OUT("more than 1 intersection along side " << i << std::endl); return false; } @@ -1658,7 +1658,7 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide) new_dir = internal::DIR_MAP[idx[i]][shift+1]; b_taken[i] = 1 - internal::DIR_TAKEN_MAP[new_dir]; dir[i] = new_dir; - Gfx_DETAILED_OUT(" direction " << i << " found: " << new_dir << + Gfx_DETAILED_OUT(" direction " << i << " found: " << new_dir << " taken: " << b_taken[i] << std::endl); } return true;*/ @@ -1674,7 +1674,7 @@ void horizontal_clip() top_clip.clear(); btm_clip.clear(); Rational l, r; - + typename CGAL::Polynomial_traits_d< Poly_dst_1 >::Make_square_free msf; decompose(engine.y_min_r, num, denom); @@ -1690,7 +1690,7 @@ void horizontal_clip() int n_roots = isolator_btm.number_of_real_roots(), i; Rational criteria = engine.pixel_w_r/CGAL_REFINE_CLIP_POINTS; - + for(i = 0; i < n_roots; i++) { l = isolator_btm.left_bound(i); r = isolator_btm.right_bound(i); @@ -1720,16 +1720,16 @@ void segment_clip_points(const Rational& x_lower, const Rational& x_upper, int n_arcs, i, j = 0; typename Clip_points::iterator it = clip_points.begin(); Rational low, high, d, l, r; - Gfx_DETAILED_OUT("segment: (" << rat2float(x_lower) << "; " << + Gfx_DETAILED_OUT("segment: (" << rat2float(x_lower) << "; " << rat2float(x_upper) << "); arcno: " << arcno << "\n"); - + while(it != clip_points.end()) { l = it->left; r = it->right; if(r > x_lower && l < x_upper) { Coordinate_1 alpha = (l == r ? Coordinate_1(r) : Coordinate_1(poly, l, r)); - + // need precise comparisons in case of tight boundaries if(l < x_lower && alpha.compare(x_lower) != ::CGAL::LARGER) { it++; j++; @@ -1743,7 +1743,7 @@ void segment_clip_points(const Rational& x_lower, const Rational& x_upper, Status_line_1 sline = support->status_line_for_x(alpha); n_arcs = sline.number_of_events(); for(i = 0; i < n_arcs; i++) { - + Coordinate_2 xy(alpha, *support, i); Bounds _ = xy.kernel()->approximate_absolute_y_2_object()(xy, -2); // low = lbound_y(xy); @@ -1761,7 +1761,7 @@ void segment_clip_points(const Rational& x_lower, const Rational& x_upper, Gfx_DETAILED_OUT("clip point assigned to arcno: " << i << "\n"); break; - } + } } } } @@ -1778,11 +1778,11 @@ void segment_clip_points(const Rational& x_lower, const Rational& x_upper, // d = ubound_y(xy) - y_upper; d = _.second - y_upper; set = (CGAL_ABS(d) > engine.pixel_h_r); - } + } if(set) { Gfx_DETAILED_OUT("clip-point found\n"); clip_indices.push_back(j); // store point index - } + } } } it++; j++; @@ -1791,7 +1791,7 @@ void segment_clip_points(const Rational& x_lower, const Rational& x_upper, //! mode = 0: criteria specifies the length of the refined interval //! mode = 1: criteria specifies a point that must be lie outside the interval -void refine_alg_point(Rational& l, Rational& r, const Poly_dst_1& poly, +void refine_alg_point(Rational& l, Rational& r, const Poly_dst_1& poly, const Rational& criteria, int mode = 0) { CGAL::Sign eval_l, eval_m; @@ -1807,61 +1807,61 @@ void refine_alg_point(Rational& l, Rational& r, const Poly_dst_1& poly, eval_m = poly.sign_at(mid); if(eval_m == CGAL::EQUAL) l = r = mid; - else if(eval_m == eval_l) + else if(eval_m == eval_l) l = mid; else r = mid; - } + } } //! recursively checks whether only one curve branch crosses a line segment -bool recursive_check(int var, const NT& beg_, const NT& end_, +bool recursive_check(int var, const NT& beg_, const NT& end_, const NT& key, const Poly_1& poly, int depth = 0) { // if polynomial is linear/quadratic and there is sign-change over interval // => only one curve branch is guaranteed - //if(poly.degree() < 3) + //if(poly.degree() < 3) // return true; int val_1, val_2, val_3; NT mid = (beg_+end_)/2, key_1, key_2, beg = beg_, end = end_; make_exact(mid); - + Gfx_DETAILED_OUT("executing recursive check; poly = " << poly << std::endl); val_1 = engine.evaluate_generic(var, beg, key, poly); val_3 = engine.evaluate_generic(var, end, key, poly); - + Gfx_DETAILED_OUT("beg: " << val_1 << " end: " << val_3 << std::endl); // no sing change: at least two curve branches inside if((val_1^val_3)==0) return false; - + val_2 = engine.evaluate_generic(var, mid, key, poly); // select the half with even number of intersections if((val_1^val_2)==0) - key_1 = beg; + key_1 = beg; else - key_1 = end; - if(get_range_1(var, key_1, mid, key, poly)) + key_1 = end; + if(get_range_1(var, key_1, mid, key, poly)) return false; // at least three intersections over the interval: done key_2 = beg + end - key_1; - + get_range_1(var, key_2, mid, key, poly, 3); - + // the first derivative does not straddle zero then only one intersection - if(!engine.first_der) - return true; + if(!engine.first_der) + return true; // if second derivative does not stranddle zero - only 1 first derivative - //if(engine.second_der == 0) + //if(engine.second_der == 0) //return true; - if(depth > CGAL_DER_CHECK_DEPTH) + if(depth > CGAL_DER_CHECK_DEPTH) return true; return recursive_check(var, key_2, mid, key, poly, depth+1); } //! computes lower/upper boundaries for pixel's neighbourhood void get_boundaries(int var, const Pixel_2& pix, Stripe& stripe) { - + int level = pix.level, val = pix.y; Integer sub = pix.sub_y, cur_sub; if(var == CGAL_Y_RANGE) { @@ -1873,19 +1873,19 @@ void get_boundaries(int var, const Pixel_2& pix, Stripe& stripe) { cur_sub += 2; // obtain local coordinates for upper boundary // for even boundaries raise the level up while(level > 0 && ((cur_sub & 1) == 0)) { - level--; + level--; cur_sub >>= 1; } } stripe.level[1] = level; - if(level == 0) + if(level == 0) cur_sub = 2 - cur_sub; stripe.key[1] = val + NT(cur_sub) / NT(one << level); make_exact(stripe.key[1]); - level = pix.level; - cur_sub = sub - 1; + level = pix.level; + cur_sub = sub - 1; while(level > 0 && ((cur_sub & 1) == 0)) { - level--; + level--; cur_sub >>= 1; } stripe.level[0] = level; @@ -1901,13 +1901,13 @@ inline void get_polynomials(int var, Stripe& stripe) { stripe.poly[0]); } -/*! - * checks 8-pixel neighbourhood of a pixel, returns \c true if +/*! + * checks 8-pixel neighbourhood of a pixel, returns \c true if * only one curve branch intersects pixel's neighbourhood, \c dir * defines backward direction, \c new_dir is a new tracking direction * * if \c CGAL_CKVA_RENDER_WITH_REFINEMENT is set, in case of success \c pix - * receives double approximations of intersection point + * receives double approximations of intersection point */ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) { @@ -1921,20 +1921,20 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) // box[1].key[0] - y-coordinate of bottom pixel boundary // box[1].key[1] - y-coordinate of top pixel boundary Stripe box[2]; // 0 - left-right stripe, 1 - bottom-top stripe - NT p1, p2, lower; + NT p1, p2, lower; get_boundaries(CGAL_X_RANGE,pix,box[1]); get_boundaries(CGAL_Y_RANGE,pix,box[0]); - - struct { // local point descriptor + + struct { // local point descriptor NT key; // respective "key" - int flag; // 0th bit: 0: lower polynomial(left/bottom); + int flag; // 0th bit: 0: lower polynomial(left/bottom); // 1: upper polynomial(right/top) // 1st bit: 0: x-range poly; 1: y-range poly - // 2nd bit: 0: c is in lower poly; 1: c is in upper poly + // 2nd bit: 0: c is in lower poly; 1: c is in upper poly // (for regular points only) - } pts[6] = {{box[0].key[0], 0}, {box[0].key[0], 1}, {box[0].key[1], 1|4}, + } pts[6] = {{box[0].key[0], 0}, {box[0].key[0], 1}, {box[0].key[1], 1|4}, {box[0].key[1], 0|4}}; - + int ix = internal::directions[back_dir].x; int e_dir = back_dir, _3and5 = 0, _3and7 = 0; if(back_dir&1) {// 5 and 3: 4; 7 and 1: 0 @@ -1944,16 +1944,16 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) } int _4and6 = e_dir>>2, _2and6 = (e_dir&2)>>1; int _2and4 = (e_dir==2)||(e_dir==4); - + pts[4].key = box[_2and6].key[_4and6] + (1-(_4and6<<1))*inv; pts[4].flag = (_2and6<<1) + _2and4; pts[5].key = pts[4].key; pts[5].flag = pts[4].flag^1; //(_2and6<<1) + (!_2and4); // pts[4].flag^1 ? idx[0] = 4; idx[3] = 5; - if(back_dir&1) + if(back_dir&1) (_3and7) ? pts[5].key += ix*inv : pts[4].key += ix*inv; - shift = (6 - e_dir) >> 1; + shift = (6 - e_dir) >> 1; n_pts = 4; idx[1] = (1 + shift) & 3; idx[2] = (2 + shift) & 3; @@ -1977,8 +1977,8 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) Gfx_DETAILED_OUT("test_neigh for " << pix << "; dir = " << dir << "\n"); n_sign = 0; - get_polynomials(CGAL_Y_RANGE,box[0]); - get_polynomials(CGAL_X_RANGE,box[1]); + get_polynomials(CGAL_Y_RANGE,box[0]); + get_polynomials(CGAL_X_RANGE,box[1]); int f_der = -1, corner_dir = -1; bool set_coincide = false; // bool s_change = false; @@ -1986,57 +1986,57 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) for(i = 0; i < n_pts - 1; i++) { int f1 = pts[idx[i]].flag, f2 = pts[idx[i+1]].flag; var = CGAL_Y_RANGE; - p1 = pts[idx[i]].key; + p1 = pts[idx[i]].key; p2 = pts[idx[i+1]].key; if((f1&2) + (f2&2) == 0) {// both can use x-range polynomials // different polys in x-range - use y-range instead if((f1&1)!=(f2&1)) { shift = (f1&4)>>2; - p1 = box[1].key[0]; - p2 = box[1].key[1]; + p1 = box[1].key[0]; + p2 = box[1].key[1]; } else { // same polys in x-range shift = f1&1; - var = CGAL_X_RANGE; + var = CGAL_X_RANGE; shift += 2; } - } else { + } else { if((f1&2) == 0) { // first point is in x-range (convert to y-range) shift = f2&1; - p1 = box[1].key[f1&1]; + p1 = box[1].key[f1&1]; } else { // second point is in x-range shift = f1&1; - p2 = box[1].key[f2&1]; + p2 = box[1].key[f2&1]; } - } + } if(p1 > p2) { NT tmp1 = p1; p1 = p2; p2 = tmp1; } - res = float2int((p2 - p1)*lvl); + res = float2int((p2 - p1)*lvl); int local_sign = 0; for(j = 0; j < res; j++, p1 += inv) { NT lkey = box[shift>>1].key[shift&1]; const Poly_1& lpoly = box[shift>>1].poly[shift&1]; - + if(get_range_1(var, p1, p1+inv, lkey, lpoly, 3) || engine.zero_bounds) { - Gfx_DETAILED_OUT("range including 0 found at: " << i << + Gfx_DETAILED_OUT("range including 0 found at: " << i << "; subseg: " << j << "; first der = " << engine.first_der << std::endl); if(engine.zero_bounds) { Gfx_DETAILED_OUT("also with zero_bounds"); - + bool is_corner = false; int diff = float2int(var == CGAL_X_RANGE ? ((p1 - pix.x)*lvl - pix.sub_x) : ((p1 - pix.y)*lvl - pix.sub_y)); int low_sign = engine.evaluate_generic(var, p1, lkey, lpoly); - + if(diff != 0) { // diff == -1: test lower corner: p1 // diff == 1: test upper corver: p1+inv @@ -2052,13 +2052,13 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) if(!is_corner) continue; } - + if(is_corner) { // compute corner direction tmp = internal::DIR_MAP[shift][diff+1]; Gfx_DETAILED_OUT("corner direction detected: " << tmp << "\n"); - + if(corner_dir == -1) corner_dir = tmp; else if(corner_dir != tmp) { @@ -2077,7 +2077,7 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) } else if(low_sign != 0) continue; } - local_sign++; + local_sign++; // Gfx_DETAILED_OUT("a curve branch detected at interval: (" << i // << "; " << i+1 << ") segment: " << j << std::endl); if(local_sign > 1) { @@ -2085,7 +2085,7 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) std::endl); return false; } - lower = p1; + lower = p1; s_shift = shift; f_der = engine.first_der; // s_change = engine.sign_change; @@ -2102,7 +2102,7 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) // else { // if(!branches_coincide&& // (current_level < CGAL_COINCIDE_LEVEL)) -// return false; // level is too small +// return false; // level is too small // set_coincide = true; // diagonal coincide mode // //std::cerr << "diagonal coincide mode\n"; // } @@ -2113,7 +2113,7 @@ bool test_neighbourhood(Pixel_2& pix, int dir, int& new_dir) } } } - + //Gfx_DETAILED_OUT("processing segment: [" << lower << "; " << lower+inv << // "]" < threshold) { NT mid = (l + r) / NT(2); make_exact(mid); @@ -2236,15 +2236,15 @@ bool compute_double_approx(int var, const NT& l_, const NT& r_, //Gfx_DETAILED_OUT("l = " << l << "; r = " << r << "; mid = " << mid << "\n"); mid_eval = engine.evaluate_generic(var, mid, key, poly); if(mid_eval == 0) { - l = r = mid; + l = r = mid; break; - } + } if(mid_eval == eval1) l = mid; else r = mid; } -Lexit: +Lexit: NT x = l, y = key; if(var == CGAL_Y_RANGE) { x = key; @@ -2263,12 +2263,12 @@ bool compute_double_approx(int var, const NT& l_, const NT& r_, //! 0th bit - of a polynomial itself (0th derivative, default) //! 1st bit - of the first derivative (sets \c first_der flag) //! 2nd bit - of the second derivative -inline bool get_range_1(int var, const NT& lower, const NT& upper, +inline bool get_range_1(int var, const NT& lower, const NT& upper, const NT& key, const Poly_1& poly, int check = 1) { if(IA_method == 0) return engine.get_range_QF_1(var, lower, upper, key, poly, check); - + return engine.get_range_MAA_1(var, lower, upper, key, poly, check); } @@ -2276,20 +2276,20 @@ inline bool get_range_1(int var, const NT& lower, const NT& upper, //! uses caching if possible Rational get_endpoint_y(const Arc_2& arc, const Rational& x, CGAL::Arr_curve_end end, bool is_clipped, Rational refine_bound) { - + int arcno; Coordinate_2 xy; - + if(arc.location(end) != CGAL::ARR_LEFT_BOUNDARY && arc.location(end) != CGAL::ARR_RIGHT_BOUNDARY && !is_clipped) { arcno = arc.curve_end(end).arcno(); xy = Coordinate_2(arc.curve_end_x(end), arc.curve_end(end).curve(), arcno); - + } else { arcno = arc.arcno(); xy = Coordinate_2(Coordinate_1(x), *support, arcno); - //refine_bound = engine.pixel_h_r / 6; //! use other bound HACK + //refine_bound = engine.pixel_h_r / 6; //! use other bound HACK } // refine the y-interval until its size is smaller than the pixel size @@ -2300,10 +2300,10 @@ Rational get_endpoint_y(const Arc_2& arc, const Rational& x, return _2;//event.upper_boundary(arcno); } -//! \brief switches to a certain cache instance depending on currently used +//! \brief switches to a certain cache instance depending on currently used //! algebraic curve void select_cache_entry(const Arc_2& arc) { - + int cid = arc.curve().id(); typename Cache_list::iterator it = cache_list.begin(); while(it != cache_list.end()) { @@ -2318,7 +2318,7 @@ void select_cache_entry(const Arc_2& arc) { if(new_id >= CGAL_N_CACHES) { new_id = cache_list.back().second; cache_list.pop_back(); - } + } cache_list.insert(cache_list.begin(), LRU_entry(cid, new_id)); } else { // mark this entry as MRU @@ -2327,17 +2327,17 @@ void select_cache_entry(const Arc_2& arc) { cache_list.erase(it); cache_list.insert(cache_list.begin(), lru); } - - if(cache_id != new_id) + + if(cache_id != new_id) clip_pts_computed = false; cache_id = new_id; - + support = support_ + cache_id; engine.select_cache_entry(cache_id); - + while(!s_stack.empty()) - s_stack.pop(); - + s_stack.pop(); + if(new_entry) { *support = arc.curve(); engine.precompute(support->polynomial_2()); @@ -2347,7 +2347,7 @@ void select_cache_entry(const Arc_2& arc) { //! \brief returns one of 4 subpixels of a pixel which is crossed by the curve //! branch //! -//! subpixels are chosen with the priority \c dir which defines a preferred +//! subpixels are chosen with the priority \c dir which defines a preferred //! direction, i.e. right(0), top(1), left(2) or bottom(3) this is only for h/v //! directions int get_subpixel_hv(const Pixel_2& pix, int dir) @@ -2376,38 +2376,38 @@ int get_subpixel_hv(const Pixel_2& pix, int dir) s_c = s_c + inv_2 - inc_c; s_key = s_key + inv_2 - inc_key; engine.get_precached_poly(var, s_key, pix.level, box[0]); - + //Gfx_DETAILED_OUT("hv subdpixel" << std::endl); int p0 = engine.evaluate_generic(var, s_c, s_key, box[0]); // 0 int p1 = engine.evaluate_generic(var, s_c + inc_c, s_key, box[0]); // 1 if(p0^p1) - return 0; - + return 0; + int p2 = engine.evaluate_generic(var, s_c + inc_c*2, s_key, box[0]); // 2 if(p2^p1) return 1; - - engine.get_precached_poly(inv_var, s_c, pix.level, box[1]); + + engine.get_precached_poly(inv_var, s_c, pix.level, box[1]); int p3 = engine.evaluate_generic(inv_var, s_key+inc_key, s_c, box[1]); // 3 if(p3^p0) return 0; - + engine.get_precached_poly(inv_var, s_c + inc_c*2, pix.level, box[2]); int p4 = engine.evaluate_generic(inv_var, s_key+inc_key, s_c + inc_c*2, box[2]); - + if(p4^p2) return 1; - - int p5 = engine.evaluate_generic(inv_var, s_key+inc_key*2, s_c, box[1]); + + int p5 = engine.evaluate_generic(inv_var, s_key+inc_key*2, s_c, box[1]); if(p3^p5) return 2; - + int p7 = engine.evaluate_generic(inv_var, s_key+inc_key*2, s_c + inc_c*2, box[2]); // 7 if(p4^p7) return 3; - + engine.get_precached_poly(var, s_key+inc_key*2, pix.level, box[3]); int p6 = engine.evaluate_generic(var, s_c + inc_c, s_key+inc_key*2, box[3]); // 6 @@ -2415,11 +2415,11 @@ int get_subpixel_hv(const Pixel_2& pix, int dir) return 2; if(p6^p7) return 3; - return -1; + return -1; } //! \brief the same for diagonal directions -//! +//! //! preferred direction: NE(0), NW(1), SW(2), SE(3) int get_subpixel_diag(const Pixel_2& pix, int dir) { @@ -2446,45 +2446,45 @@ int get_subpixel_diag(const Pixel_2& pix, int dir) inv_var = 1 - var; key_1 = key_1 + inv_2 - inc_1; key_2 = key_2 + inv_2 - inc_2; - + engine.get_precached_poly(var, key_2, pix.level, box[0]); int p0 = engine.evaluate_generic(var, key_1, key_2, box[0]); // 0 int p1 = engine.evaluate_generic(var, key_1 + inc_1, key_2, box[0]); // 1 //Gfx_DETAILED_OUT("p0: " << p0 << "; p1: " << p1 << std::endl); - + if(p0^p1) - return 0; - - engine.get_precached_poly(inv_var, key_1, pix.level, box[1]); + return 0; + + engine.get_precached_poly(inv_var, key_1, pix.level, box[1]); int p2 = engine.evaluate_generic(inv_var, key_2+inc_2, key_1, box[1]); // 2 //Gfx_DETAILED_OUT << "p2: " << p2 << std::endl; if(p2^p0) - return 0; - + return 0; + int p3 = engine.evaluate_generic(var, key_1 + inc_1*2, key_2, box[0]); // 3 //Gfx_DETAILED_OUT << "p3: " << p3 << std::endl; if(p3^p1) return 1; - + int p4 = engine.evaluate_generic(inv_var, key_2+inc_2*2, key_1, box[1]); //Gfx_DETAILED_OUT << "p4: " << p4 << std::endl; if(p4^p2) return 2; - - engine.get_precached_poly(inv_var, key_1 + inc_1*2, pix.level, box[2]); + + engine.get_precached_poly(inv_var, key_1 + inc_1*2, pix.level, box[2]); int p5 = engine.evaluate_generic(inv_var, key_2+inc_2, key_1 + inc_1*2, box[2]); //Gfx_DETAILED_OUT << "p5: " << p5 << std::endl; if(p3^p5) return 1; - + engine.get_precached_poly(var, key_2+inc_2*2, pix.level, box[3]); int p6 = engine.evaluate_generic(var, key_1 + inc_1, key_2+inc_2*2, box[3]); // 6 //Gfx_DETAILED_OUT << "p6: " << p6 << std::endl; if(p4^p6) - return 2; - + return 2; + int p7 = engine.evaluate_generic(var, key_1+inc_1*2, key_2 + inc_2*2, box[3]); // 7 //Gfx_DETAILED_OUT << "p7: " << p7 << std::endl; @@ -2493,11 +2493,11 @@ int get_subpixel_diag(const Pixel_2& pix, int dir) if(p6^p7) return 3; - return -1; + return -1; } //! attempts to find an isolating box for an end-point whose upper/lower -//! boundaries do not intersect with a curve +//! boundaries do not intersect with a curve bool get_isolating_box(const Rational& x_s, const Rational& y_s, Pixel_2& res) { Integer lvl = one; @@ -2506,31 +2506,31 @@ bool get_isolating_box(const Rational& x_s, const Rational& y_s, Pixel_2& res) res.level = 0; res.sub_x = 0; res.sub_y = 0; - - NT inv = NT(1), bottom = NT(res.y), top = bottom + inv, left = NT(res.x); - + + NT inv = NT(1), bottom = NT(res.y), top = bottom + inv, left = NT(res.x); + Poly_1 poly_btm, poly_top; engine.get_precached_poly(CGAL_X_RANGE, bottom, 0, poly_btm); engine.get_precached_poly(CGAL_X_RANGE, top, 0, poly_top); - + while(1) { inv = NT(1) / NT(lvl); make_exact(inv); left = NT(res.x) + NT(res.sub_x) * inv; - + Gfx_DETAILED_OUT("processing pixel: " << res << std::endl); if(get_range_1(CGAL_X_RANGE,left,left+inv,bottom,poly_btm)&& - !engine.zero_bounds) { - + !engine.zero_bounds) { + Gfx_DETAILED_OUT("bottom boundary intersection found at pixel: " << res << std::endl); } else { if(!get_range_1(CGAL_X_RANGE,left,left+inv,top,poly_top)) { - + Gfx_DETAILED_OUT("no bottom/top intersections found at pixel:" << res << std::endl); break; - } else { + } else { Gfx_DETAILED_OUT("top boundary intersection found at pixel: " << res << std::endl); } @@ -2538,7 +2538,7 @@ bool get_isolating_box(const Rational& x_s, const Rational& y_s, Pixel_2& res) lvl <<= 1; /*if(lvl > CGAL_REFINE_Y) { event.refine_to(arcno, pixel_h_r/(lvl*2)); - y_seed = (event.lower_boundary(arcno) + + y_seed = (event.lower_boundary(arcno) + event.upper_boundary(arcno))/2; }*/ if(res.level >= MAX_SUBDIVISION_LEVEL) { @@ -2555,7 +2555,7 @@ bool get_isolating_box(const Rational& x_s, const Rational& y_s, Pixel_2& res) if(res.sub_y < 0) res.sub_y = 0; res.sub_y &= (lvl-1); - } + } return true; } @@ -2590,38 +2590,38 @@ void dump_neighbourhood(const Pixel_2& pix) { get_boundaries(CGAL_Y_RANGE,pix,box[0]); NT bottom = box[1].key[0], top = box[1].key[1], left = box[0].key[0], right = box[0].key[1]; - + Gfx_OUT("\n\nComputing nighbourhood for pixel: " << pix << std::endl); get_polynomials(CGAL_X_RANGE, box[1]); get_polynomials(CGAL_Y_RANGE, box[0]); NT a,b,range,inc,val; /////////////////////////////////////////////////////////////////////// Gfx_OUT("\nevaluate RIGHT side:" << std::endl); - range = top - bottom; + range = top - bottom; inc = range / 3; val = bottom; - + if(get_range_1(CGAL_Y_RANGE, bottom, top, right, box[0].poly[1])) Gfx_OUT("segment RIGHT registered" << std::endl); if(get_range_1(CGAL_Y_RANGE, val, val + inc, right, box[0].poly[1])) Gfx_OUT("segment 0 registered" << std::endl); - + a = engine.evaluate_generic(CGAL_Y_RANGE, val, right, box[0].poly[1]); Gfx_OUT("val = " << a << std::endl); val += inc; - + b = engine.evaluate_generic(CGAL_Y_RANGE, val, right, box[0].poly[1]); Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 0" << std::endl); a = b; if(get_range_1(CGAL_Y_RANGE, val, val + inc, right, box[0].poly[1])) Gfx_OUT("segment 1 registered" << std::endl); val += inc; b = engine.evaluate_generic(CGAL_Y_RANGE, val, right, box[0].poly[1]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 1" << std::endl); if(get_range_1(CGAL_Y_RANGE, val, val + inc, right, box[0].poly[1])) Gfx_OUT("segment 2 registered" << std::endl); @@ -2630,15 +2630,15 @@ void dump_neighbourhood(const Pixel_2& pix) { Gfx_OUT("poly right: " << box[0].poly[1] << " at (" << val << "; " << right << ")\n"); - + b = engine.evaluate_generic(CGAL_Y_RANGE, val, right, box[0].poly[1]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 2" << std::endl); - /////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////// Gfx_OUT("\nevaluate BOTTOM side:" << std::endl); - range = right - left; + range = right - left; inc = range / 3; val = left; if(get_range_1(CGAL_X_RANGE, left, right, bottom, box[1].poly[0])) @@ -2648,37 +2648,37 @@ void dump_neighbourhood(const Pixel_2& pix) { Gfx_OUT("poly bottom: " << box[1].poly[0] << " at (" << val << "; " << bottom << ")\n"); - + a = engine.evaluate_generic(CGAL_X_RANGE, val, bottom, box[1].poly[0]); - + Gfx_OUT("val = " << a << std::endl); val += inc; b = engine.evaluate_generic(CGAL_X_RANGE, val, bottom, box[1].poly[0]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 0" << std::endl); a = b; if(get_range_1(CGAL_X_RANGE, val, val + inc, bottom, box[1].poly[0])) Gfx_OUT("segment 1 registered" << std::endl); val += inc; b = engine.evaluate_generic(CGAL_X_RANGE, val, bottom, box[1].poly[0]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 1" << std::endl); a = b; if(get_range_1(CGAL_X_RANGE, val, val + inc, bottom, box[1].poly[0])) Gfx_OUT("segment 2 registered" << std::endl); val = right; b = engine.evaluate_generic(CGAL_X_RANGE, val, bottom, box[1].poly[0]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 2" << std::endl); - /////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////// Gfx_OUT("\nevaluate LEFT side:" << std::endl); - range = top - bottom; + range = top - bottom; inc = range / 3; val = bottom; if(get_range_1(CGAL_Y_RANGE, bottom, top, left, box[0].poly[0])) @@ -2689,62 +2689,62 @@ void dump_neighbourhood(const Pixel_2& pix) { Gfx_OUT("poly left: " << box[0].poly[0] << " at (" << val << "; " << left << ")\n"); a = engine.evaluate_generic(CGAL_Y_RANGE, val, left, box[0].poly[0]); - + Gfx_OUT("val = " << a << std::endl); val += inc; b = engine.evaluate_generic(CGAL_Y_RANGE, val, left, box[0].poly[0]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 0" << std::endl); a = b; if(get_range_1(CGAL_Y_RANGE, val, val + inc, left, box[0].poly[0])) Gfx_OUT("segment 1 registered" << std::endl); val += inc; b = engine.evaluate_generic(CGAL_Y_RANGE, val, left, box[0].poly[0]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 1" << std::endl); a = b; if(get_range_1(CGAL_Y_RANGE, val, val + inc, left, box[0].poly[0])) Gfx_OUT("segment 2 registered" << std::endl); val = top; b = engine.evaluate_generic(CGAL_Y_RANGE, val, left, box[0].poly[0]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 2" << std::endl); - /////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////// Gfx_OUT("\nevaluate TOP side:" << std::endl); - range = right - left; + range = right - left; inc = range / 3; val = left; if(get_range_1(CGAL_X_RANGE, left, right, top, box[1].poly[1])) Gfx_OUT("segment TOP registered" << std::endl); - + if(get_range_1(CGAL_X_RANGE, val, val + inc, top, box[1].poly[1])) Gfx_OUT("segment 0 registered" << std::endl); a = engine.evaluate_generic(CGAL_X_RANGE, val, top, box[1].poly[1]); - + Gfx_OUT("val = " << a << std::endl); val += inc; b = engine.evaluate_generic(CGAL_X_RANGE, val, top, box[1].poly[1]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 0" << std::endl); a = b; if(get_range_1(CGAL_X_RANGE, val, val + inc, top, box[1].poly[1])) Gfx_OUT("segment 1 registered" << std::endl); val += inc; b = engine.evaluate_generic(CGAL_X_RANGE, val, top, box[1].poly[1]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 1" << std::endl); a = b; - + if(get_range_1(CGAL_X_RANGE, val, val + inc, top, box[1].poly[1])) Gfx_OUT("segment 2 registered" << std::endl); @@ -2753,14 +2753,14 @@ void dump_neighbourhood(const Pixel_2& pix) { Gfx_OUT("poly top: " << box[1].poly[1] << " at (" << val << "; " << top << ")\n"); b = engine.evaluate_generic(CGAL_X_RANGE, val, top, box[1].poly[1]); - + Gfx_OUT("val = " << b << std::endl); - if(a*b < 0) + if(a*b < 0) Gfx_OUT("sign change at segment 2" << std::endl); #endif // Gfx_USE_OUT } -//!@} +//!@} }; // class Curve_renderer_2<> //!@} diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h index b33cefb1e56d..1c0ca9cf40bd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h @@ -14,10 +14,10 @@ /*!\file CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h * \brief * contains various low-level routines used by \c Curve_renderer_2 and - * \c Subdivision_1 + * \c Subdivision_1 * * provide caching for polynomials and polynomial evaluations; 1D range - * analysis using First Quadratic Affine Form (QF) and Modified Affine + * analysis using First Quadratic Affine Form (QF) and Modified Affine * Arithmetic (MAA), both equipped with recursive derivative information */ @@ -53,12 +53,12 @@ namespace internal { // defines subdivision level beyond which univariate polynomials are not // cached (if 0 cache is off) -#define CGAL_MAX_POLY_CACHE_LEVEL 8 +#define CGAL_MAX_POLY_CACHE_LEVEL 8 // maximal number of entries in univariate polynomial cache containers #define CGAL_POLY_CACHE_SIZE 1024*1024 -// maximal degree of the derivative taken into account during recursive +// maximal degree of the derivative taken into account during recursive // derivative range analysis #define CGAL_RECURSIVE_DER_MAX_DEGREE 7 @@ -79,7 +79,7 @@ template struct Pixel_2_ { int x, y; // pixel coordinates relative to the drawing area - unsigned level; // subdivision level: 0 - for pixels, + unsigned level; // subdivision level: 0 - for pixels, // 1 - for 1/2 pixels, and so on) #ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT double xv, yv; // double approximation of curve-pixel intersection point @@ -87,7 +87,7 @@ struct Pixel_2_ Integer sub_x, sub_y; // subpixel coordinates relative to pixel's boundary // (always 0 for pixels) - + Pixel_2_& operator =(const Pixel_2_& pix) { #ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT memcpy(this, &pix, sizeof(int)*3 + sizeof(double)*2); @@ -116,7 +116,7 @@ struct Seed_point_ Seed_point_(const Pixel_2_& start_, int dir_, int taken_, bool coincide_) : start(start_), - back_dir(dir_), direction_taken(taken_), + back_dir(dir_), direction_taken(taken_), branches_coincide(coincide_) { } @@ -131,22 +131,22 @@ struct Clip_point_ // describes a bottom/top clip point { Clip_point_() { } Clip_point_(Rational left_, Rational right_, int arcno_=-1) : - left(left_), right(right_), arcno(arcno_) { } + left(left_), right(right_), arcno(arcno_) { } Rational left, right; // isolating interval boundaries int arcno; // arcno of a segment this point belongs to AlgebraicReal alpha; // this clip point event line }; template -std::ostream& operator <<(std::ostream& os, const Pixel_2_& pix) +std::ostream& operator <<(std::ostream& os, const Pixel_2_& pix) { - os << " (" << pix.x << "/" << pix.sub_x << "; " << pix.y << "/" << + os << " (" << pix.x << "/" << pix.sub_x << "; " << pix.y << "/" << pix.sub_y << ") level = " << pix.level; return os; } /*! \brief defines class \c Curve_renderer_internals - * + * * provides an interface to low-level range analysis and polynomials evaluation * methods along with caching mechanism. \c Coeff_ defines internal polynomial * coefficients used by the renderer. @@ -156,9 +156,9 @@ template class Curve_renderer_internals { public: - //! \name typedefs + //! \name typedefs //!@{ - + //! this instance's first template argument typedef CurveKernel_2 Curve_kernel_2; @@ -189,20 +189,20 @@ class Curve_renderer_internals //! coercion between rational and polynomial coefficients number type typedef typename Coercion::Type Rat_coercion_type; - + //! base number type for all internal computations typedef typename Renderer_traits::Float NT; - + //! instance of a univariate polynomial typedef CGAL::Polynomial Poly_1; //! instance of a bivariate polynomial typedef CGAL::Polynomial Poly_2; //! container's const iterator (random access) - typedef typename Poly_1::const_iterator const_iterator_1; + typedef typename Poly_1::const_iterator const_iterator_1; //! container's const iterator (random access) - typedef typename Poly_2::const_iterator const_iterator_2; - - //! a univariate rational polynomial + typedef typename Poly_2::const_iterator const_iterator_2; + + //! a univariate rational polynomial typedef CGAL::Polynomial Rational_poly_1; //! a bivariate rational polynomial typedef CGAL::Polynomial Rational_poly_2; @@ -219,7 +219,7 @@ class Curve_renderer_internals private: //!\name private typedefs //!@{ - + //! container to store derivative coefficients typedef std::vector Derivative_1; //! instance of polynomial derivatives type @@ -228,10 +228,10 @@ class Curve_renderer_internals typedef typename Derivative_2::const_iterator der_iterator_2; //! const_iterator_1 for polynomial derivatives typedef typename std::vector::const_iterator der_iterator_1; - + //! hashed container element's type for univariate polynomials typedef std::pair Poly_entry; - + //! hash function to cache univariate polynomials // struct hash_func_poly { // typename Renderer_traits::Hash_function hash; @@ -239,7 +239,7 @@ class Curve_renderer_internals // return hash(key); // } // }; -// +// //! hash function to cache function evaluations // struct hash_func_eval { // typename Renderer_traits::Hash_function hash; @@ -248,7 +248,7 @@ class Curve_renderer_internals // return (h1 - h2); // } // }; - + //! hashed map container with LRU capabilities used to store precomputed //! univariate polynomials at fixed x or y coordinates // typedef boost::multi_index::multi_index_container< @@ -257,9 +257,9 @@ class Curve_renderer_internals // boost::multi_index::sequenced<>, // boost::multi_index::hashed_unique< // BOOST_MULTI_INDEX_MEMBER(Poly_entry, NT, first), -// hash_func_poly > > > +// hash_func_poly > > > // Poly_cache; - + //! hashed map used to store precomputed polynomial evaluations // typedef boost::multi_index::multi_index_container< // Eval_entry, @@ -267,32 +267,32 @@ class Curve_renderer_internals // boost::multi_index::sequenced<>, // boost::multi_index::hashed_unique< // BOOST_MULTI_INDEX_MEMBER(Eval_entry, Eval_hash_key, first), -// hash_func_eval > > > +// hash_func_eval > > > // Eval_cache; - + //!@} public: //!\name public interface //!@{ - + //! default constructor Curve_renderer_internals() : window(0.0, 0.0, 0.0, 0.0), res_w(0), res_h(0) { } - + //! \brief checks whether interval contains zero inline bool is_zero(const NT& low, const NT& up) { return (low*up < 0); //(low < 0&&up > 0); } - + //! \brief evalutates a certain polynomial derivative at x //! - //! \c der_coeffs is a set of derivative coefficients, + //! \c der_coeffs is a set of derivative coefficients, //! \c poly - polynomial coefficients NT evaluate_der(const CGAL::Polynomial& der_coeffs, const Poly_1& poly, const NT& x) - { + { typename Renderer_traits::Extract_eval extract; const_iterator_1 poly_it = poly.end() - 1; der_iterator_1 der_it = der_coeffs.end() - 1; @@ -302,16 +302,16 @@ class Curve_renderer_internals } return y; } - + //! \brief the same as \c evaluate but arguments are passed by value //! (needed to substitute variables in bivariate polynomial) inline static NT binded_eval(Poly_1 poly, NT x) { return evaluate(poly, x); } - + //! \brief evalutates a polynomial at certain x-coordinate - static NT evaluate(const Poly_1& poly, const NT& x, + static NT evaluate(const Poly_1& poly, const NT& x, bool *error_bounds_ = nullptr) { typename Renderer_traits::Extract_eval extract; @@ -326,7 +326,7 @@ class Curve_renderer_internals // const_iterator_1 beg = poly.begin()+odd; Coeff y1 = *it1, y2 = *it2, mul = cc, y; // unrolled loop for better instruction pairing - while(m-- > odd) { + while(m-- > odd) { it1--; it2--; y1 = y1*cc + (*it1); y2 = y2*cc + (*it2); @@ -355,59 +355,59 @@ class Curve_renderer_internals r = r * yc + rit->evaluate(x); return r; } - - //! destructor + + //! destructor ~Curve_renderer_internals() { clear_caches(); } - - //!@} + + //!@} public: //!\name public data (can be accessed from hosting curve renderer) //!@{ - - CGAL::Bbox_2 window; //! drawing window - NT x_min, x_max, y_min, y_max; + + CGAL::Bbox_2 window; //! drawing window + NT x_min, x_max, y_min, y_max; NT pixel_w, pixel_h; //! pixel dimensions w.r.t. resolution - + Rational x_min_r, y_min_r, x_max_r, y_max_r; //! rational versions - Rational pixel_w_r, pixel_h_r; - + Rational pixel_w_r, pixel_h_r; + int res_w, res_h; //! pixel resolution - + Poly_2 *coeffs_x, *coeffs_y; //! f(x(y)) / f(y(x)) Derivative_2 *der_x, *der_y; //! derivative coefficients df/dx (df/dy) - + //! caches of precomputed univariate polynomials in x and y directions //Poly_cache *cached_x, *cached_y; - + Rational_poly_2 *rational_x, *rational_y; //! poly with rational coeffs - + Rational_poly_2 *rational_fx, *rational_fy; //! partial derivatives - - //! 0 - the 1st (2nd) derivative does not have zero over an + + //! 0 - the 1st (2nd) derivative does not have zero over an //! interval; 1 - does have 0; -1 - not computed - int first_der, second_der; - bool sign_change; //! detected a sign change over interval - - bool zero_bounds; //! indicates that the result of the last range + int first_der, second_der; + bool sign_change; //! detected a sign change over interval + + bool zero_bounds; //! indicates that the result of the last range //! evaluation has at least one zero boundary - + // static bool show_dump; //! for debugging - + //!@} private: //!\name private members for caching support //!@{ - + //! data structures grouped into arrays to facilitate caching Poly_2 coeffs_x_[CGAL_N_CACHES], coeffs_y_[CGAL_N_CACHES]; Derivative_2 der_x_[CGAL_N_CACHES], der_y_[CGAL_N_CACHES]; //Poly_cache cached_x_[CGAL_N_CACHES], cached_y_[CGAL_N_CACHES]; Rational_poly_2 rational_x_[CGAL_N_CACHES], rational_y_[CGAL_N_CACHES]; Rational_poly_2 rational_fx_[CGAL_N_CACHES], rational_fy_[CGAL_N_CACHES]; - + //!@} public: //! \name public methods @@ -419,103 +419,103 @@ class Curve_renderer_internals //! sets up drawing window and pixel resolution //! //! returns \c false if parameters are incorrect -bool setup(const CGAL::Bbox_2& box_, int res_w_, int res_h_) -{ +bool setup(const CGAL::Bbox_2& box_, int res_w_, int res_h_) +{ window = box_; x_min = static_cast(box_.xmin()); y_min = static_cast(box_.ymin()); x_max = static_cast(box_.xmax()); y_max = static_cast(box_.ymax()); - res_w = res_w_; + res_w = res_w_; res_h = res_h_; - + if (x_min >= x_max) { std::cerr << "Incorrect setup parameters: " - << "x_min = " << x_min << " >= " << x_max << " = x_max" + << "x_min = " << x_min << " >= " << x_max << " = x_max" << std::endl; return false; } if (y_min >= y_max) { std::cerr << "Incorrect setup parameters: " - << "y_min = " << y_min << " >= " << y_max << " = y_max" + << "y_min = " << y_min << " >= " << y_max << " = y_max" << std::endl; return false; } if (res_w < 4) { std::cerr << "Incorrect setup parameters: " - << "res_w = " << res_w << " < 4" + << "res_w = " << res_w << " < 4" << std::endl; return false; } if (res_h < 4) { std::cerr << "Incorrect setup parameters: " - << "res_h = " << res_h << " < 4" + << "res_h = " << res_h << " < 4" << std::endl; return false; } if (res_w > 2048) { std::cerr << "Incorrect setup parameters: " - << "res_w = " << res_w << " > 2048" + << "res_w = " << res_w << " > 2048" << std::endl; return false; } if (res_h > 2048) { std::cerr << "Incorrect setup parameters: " - << "res_h = " << res_h << " > 2048" + << "res_h = " << res_h << " > 2048" << std::endl; return false; } - + pixel_w = (x_max - x_min) / res_w; pixel_h = (y_max - y_min) / res_h; //srand(time(nullptr)); // from 0.1 to 0.5 double rmin = 0.1, rmax = 0.5; - NT sx = pixel_w * static_cast(rmin + + NT sx = pixel_w * static_cast(rmin + (static_cast(rand()) / RAND_MAX) * (rmax - rmin)); - NT sy = pixel_h * static_cast(rmin + + NT sy = pixel_h * static_cast(rmin + (static_cast(rand()) / RAND_MAX) * (rmax - rmin)); - Gfx_OUT("---------------------- sx: " << (sx / pixel_w) << "; sy: " << + Gfx_OUT("---------------------- sx: " << (sx / pixel_w) << "; sy: " << (sy / pixel_h) << "\n"); - x_min += sx, x_max += sx, y_min += sy, y_max += sy; + x_min += sx, x_max += sx, y_min += sy, y_max += sy; x_min_r = Rational(x_min), y_min_r = Rational(y_min); x_max_r = Rational(x_max), y_max_r = Rational(y_max); - + pixel_w_r = (x_max_r - x_min_r) / res_w; pixel_h_r = (y_max_r - y_min_r) / res_h; - + pixel_w = rat2float(pixel_w_r); pixel_h = rat2float(pixel_h_r); make_exact(pixel_w); make_exact(pixel_h); - + //show_dump = false; return true; -} +} //! \brief computes a range of polynomial values \c f([lower,upper]) using //! the First Affine Form (AF1) with Recursive Derivative information -bool get_range_AF1_1(int var, +bool get_range_AF1_1(int var, const NT& l_, const NT& r_, const NT& key, const Poly_1& poly, int check) { Derivative_2 *der = (var == CGAL_X_RANGE ? der_x : der_y); NT l(l_), r(r_), l1, r1, low, up; NT v1, v2; int eval1, eval2; - der_iterator_2 der_it_2 = der->end()-1; + der_iterator_2 der_it_2 = der->end()-1; der_iterator_1 der_it, der_begin; const_iterator_1 cache_it, begin; - + first_der = false, sign_change = false; if(poly.degree() == 0) { zero_bounds = false; return (poly.lcoeff() == NT(0.0)); } - + if(l_ == r_) { zero_bounds = false; return false; @@ -524,7 +524,7 @@ bool get_range_AF1_1(int var, l = r_; r = l_; } - + eval1 = evaluate_generic(var, l, key, poly); eval2 = evaluate_generic(var, r, key, poly); bool sign_change = (eval1*eval2 < 0); @@ -539,9 +539,9 @@ bool get_range_AF1_1(int var, l1 = y_min + l*pixel_h; r1 = y_min + r*pixel_h; } - + typename Renderer_traits::Extract_eval extract; - unsigned index = CGAL_RECURSIVE_DER_MAX_DEGREE; + unsigned index = CGAL_RECURSIVE_DER_MAX_DEGREE; if(index >= der->size()) { low = up = extract(poly.lcoeff()) * (*der_it_2).lcoeff(); } else { @@ -549,19 +549,19 @@ bool get_range_AF1_1(int var, low = 1; up = -1; } - - NT x0 = (l1 + r1)/2, x1 = (r1 - l1)/2; + + NT x0 = (l1 + r1)/2, x1 = (r1 - l1)/2; make_exact(x0); make_exact(x1); NT x0_abs = CGAL_ABS(x0), x1_abs = CGAL_ABS(x1); while((der_it_2--) != der->begin()) { // iterate through derivative coefficients - der_it = der_it_2->end() - 1; + der_it = der_it_2->end() - 1; der_begin = der_it_2->begin(); cache_it = poly.end() - 1; // iterate through precomputed y-values - // if a derivative does not straddle zero we can - // calculate the exact boundaries for f(x) + // if a derivative does not straddle zero we can + // calculate the exact boundaries for f(x) if(low * up >= 0) { v1 = v2 = extract(*cache_it--) * (*der_it); // calculate the ith derivative at xa and xb @@ -570,14 +570,14 @@ bool get_range_AF1_1(int var, v1 = v1 * l1 + cc1; v2 = v2 * r1 + cc1; } - low = v1, up = v2; + low = v1, up = v2; } else { // use affine arithmetic to compute bounds NT y0 = extract(*cache_it) * (*der_it), y1(0), e1(0); cache_it--; while((der_it--)!=der_begin) { e1 = x0_abs*e1 + x1_abs*(CGAL_ABS(y1) + CGAL_ABS(e1)); - y1 = y1*x0 + x1*y0; + y1 = y1*x0 + x1*y0; y0 = x0*y0 + extract(*cache_it) * (*der_it); cache_it--; } @@ -587,44 +587,44 @@ bool get_range_AF1_1(int var, if(der_it_2 == der->begin() && check == 3) { first_der = //(eval1*eval2 < 0); is_zero(low, up); - if(sign_change||zero_bounds) + if(sign_change||zero_bounds) return true; } } if(low * up < 0) { cache_it = poly.end()-1; begin = poly.begin(); - + NT y0 = extract(*cache_it), y1(0), e1(0); while((cache_it--) != begin) { e1 = x0_abs*e1 + x1_abs*(CGAL_ABS(y1) + CGAL_ABS(e1)); - y1 = y1*x0 + x1*y0; + y1 = y1*x0 + x1*y0; y0 = x0*y0 + extract(*cache_it); } NT spread = CGAL_ABS(y1) + CGAL_ABS(e1); low = y0 - spread, up = y0 + spread; - + eval1 = CGAL_SGN(low), eval2 = CGAL_SGN(up); } zero_bounds = ((eval1 & eval2) == 0); if(eval1 * eval2 < 0) { //std::cerr << "eval1 = " << low << "; eval2 = " << up << std::endl; return true; - } + } return false; } //! \brief evaluates a univariate polynomial over an interval using //! First Quadratic Affine Form -bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, +bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, const Poly_1& poly, int check = 1) { Derivative_2 *der = (var == CGAL_X_RANGE ? der_x : der_y); NT l(l_), r(r_), l1, r1, low, up; NT v1, v2; int eval1, eval2; - der_iterator_2 der_it_2 = der->end()-1; + der_iterator_2 der_it_2 = der->end()-1; der_iterator_1 der_it, der_begin; const_iterator_1 cache_it, begin; @@ -641,15 +641,15 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, l = r_; r = l_; } - + eval1 = evaluate_generic(var, l, key, poly); eval2 = evaluate_generic(var, r, key, poly); sign_change = (eval1*eval2 < 0); - + zero_bounds = ((eval1 & eval2) == 0); if((sign_change || zero_bounds) && check==1) return true; - + if(var == CGAL_X_RANGE) { l1 = x_min + l*pixel_w; r1 = x_min + r*pixel_w; @@ -657,7 +657,7 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, l1 = y_min + l*pixel_h; r1 = y_min + r*pixel_h; } - + typename Renderer_traits::Extract_eval extract; unsigned index = CGAL_RECURSIVE_DER_MAX_DEGREE; if(index >= der->size()) { @@ -667,8 +667,8 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, low = 1; up = -1; } - - NT x0 = (l1 + r1)/2, x1 = (r1 - l1)/2; + + NT x0 = (l1 + r1)/2, x1 = (r1 - l1)/2; make_exact(x0); make_exact(x1); NT x0_abs = CGAL_ABS(x0), xsum_abs = CGAL_ABS(x1) + x0_abs; @@ -676,10 +676,10 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, while((der_it_2--)!=der->begin()) { // iterate through derivative coefficients - der_it = (*der_it_2).end()-1; + der_it = (*der_it_2).end()-1; der_begin = (*der_it_2).begin(); cache_it = poly.end()-1; // iterate through precomputed y-values - + // if a derivative does not straddle zero we can obtain exact bounds // by evaluating a polynomial at end-points if(low * up >= 0) { @@ -690,8 +690,8 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, v1 = v1 * l1 + cc1; v2 = v2 * r1 + cc1; } - low = v1; - up = v2; + low = v1; + up = v2; } else { // use Quadratic Form to compute the bounds NT y0 = extract(*cache_it) * (*der_it), y1(0), z1(0), e1(0); @@ -699,7 +699,7 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, while((der_it--)!=der_begin) { e1 = xsum_abs * e1 + CGAL_ABS(x1 * z1); z1 = x0*z1 + x1*y1; - y1 = y1*x0 + x1*y0; + y1 = y1*x0 + x1*y0; y0 = x0*y0 + extract(*cache_it)*(*der_it); cache_it--; } @@ -713,15 +713,15 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, low = y0 - low; up = y0 + up; } - + if(der_it_2 == der->begin() && check==3) { first_der = //(eval1*eval2 < 0);// is_zero(low, up); - if(sign_change||zero_bounds) + if(sign_change||zero_bounds) return true; } } - + if(low * up < 0) { cache_it = poly.end()-1; begin = poly.begin(); @@ -729,7 +729,7 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, while((cache_it--) != begin) { e1 = xsum_abs * e1 + CGAL_ABS(x1*z1); z1 = x0*z1 + x1*y1; - y1 = y1*x0 + x1*y0; + y1 = y1*x0 + x1*y0; y0 = x0*y0 + extract(*cache_it); } NT spread = CGAL_ABS(y1) + e1; @@ -751,8 +751,8 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key, } //! \brief evaluates a univariate polynomial over an interval using -//! Modified Affine Arithmetic -bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, +//! Modified Affine Arithmetic +bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, const Poly_1& poly, int check = 1) { Derivative_2 *der = (var == CGAL_X_RANGE) ? der_x : der_y; @@ -779,13 +779,13 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, } eval1 = evaluate_generic(var, l, key, poly); eval2 = evaluate_generic(var, r, key, poly); - + sign_change = (eval1*eval2 < 0); zero_bounds = ((eval1&eval2) == 0); - + if((sign_change || zero_bounds) && check == 1) return true; - + if(var == CGAL_X_RANGE) { l1 = x_min + l*pixel_w; r1 = x_min + r*pixel_w; @@ -796,10 +796,10 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, NT x0 = (l1 + r1)/2, x1 = (r1 - l1)/2; make_exact(x0); make_exact(x1); - + int d = 0; v1 = evaluate(poly, x0); - //der_cache[d] = v1; + //der_cache[d] = v1; der_cache.push_back(v1); v = x1, d++; der_iterator_2 der_it_2; @@ -807,10 +807,10 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, v1 = evaluate_der((*der_it_2), poly, x0); der_cache.push_back(v1); //der_cache[d] = v1; // replace by push_backs ? - //binom[d] = v; + //binom[d] = v; binom.push_back(v); d++; - //v *= x1/d; + //v *= x1/d; //make_exact(v); v *= x1; // ONLY when derivative coefficients are normalized } @@ -824,7 +824,7 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, low = 1; up = -1; } - // assume we have an array of derivatives: + // assume we have an array of derivatives: // der_cache: {f^(0); f^(1); f^(2); ...} // and binominal coefficients: [h; h^2/2; h^3/6; ... h^d/d!] der_iterator_1 eval_it = der_cache.end()-1, local_it, binom_it, @@ -840,13 +840,13 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, while((local_it) != eval_end) {// calculate derivative bounds v1 = (*local_it++) * (*binom_it++); if(v1 >= 0) { // derivative index is odd - up += v1; - low -= v1; - } else { - up -= v1; - low += v1; + up += v1; + low -= v1; + } else { + up -= v1; + low += v1; } - if(local_it == eval_end) + if(local_it == eval_end) break; // derivative index is even v1 = (*local_it++) * (*binom_it++); @@ -854,34 +854,34 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key, } eval1 = CGAL_SGN(low); eval2 = CGAL_SGN(up); - + } else if(d > 0) { low = evaluate_der((*der_it_2), poly, l1); up = evaluate_der((*der_it_2), poly, r1); eval1 = CGAL_SGN(low); eval2 = CGAL_SGN(up); - + } else if(d == 0) ;//Gfx_DETAILED_OUT("MAA bounds: sign change\n"); - + if(d == 1 && check == 3) { first_der = (eval1*eval2 < 0); - if(sign_change||zero_bounds) + if(sign_change||zero_bounds) return true; } else if(d == 0) { - + zero_bounds = ((eval1&eval2) == 0); return (eval1*eval2 < 0); } d--; der_it_2--; - if((eval_it--) == der_cache.begin()) + if((eval_it--) == der_cache.begin()) break; } return true; } //! \brief fixes one coordinate of a bivariate polynomial, uses caching -//! if appropriate +//! if appropriate void get_precached_poly(int var, const NT& key, int /* level */, Poly_1& poly) { NT key1; @@ -890,25 +890,25 @@ void get_precached_poly(int var, const NT& key, int /* level */, Poly_1& poly) //typename boost::multi_index::nth_index_iterator::type it; bool not_cached = true, /*(level >= CGAL_MAX_POLY_CACHE_LEVEL)*/ not_found = false; - + if(var == CGAL_Y_RANGE) { - //cached = cached_y; - coeffs = coeffs_y; + //cached = cached_y; + coeffs = coeffs_y; key1 = x_min + key*pixel_w; - } else + } else key1 = y_min + key*pixel_h; - + // if(!not_cached) { -// typename boost::multi_index::nth_index::type& +// typename boost::multi_index::nth_index::type& // idx = cached->get<1>(); // it = idx.find(key1); //*4 // not_found = (it == idx.end()); // } - + if(not_cached||not_found) { - poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(), + poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(), boost::bind2nd(std::ptr_fun(binded_eval), key1)), - ::boost::make_transform_iterator(coeffs->end(), + ::boost::make_transform_iterator(coeffs->end(), boost::bind2nd(std::ptr_fun(binded_eval), key1))); if(not_cached) return; @@ -917,19 +917,19 @@ void get_precached_poly(int var, const NT& key, int /* level */, Poly_1& poly) // cached->pop_back(); // cached->push_front(Poly_entry(key1,poly)); //*4 // return; - } + } // cached->relocate(cached->begin(), cached->project<0>(it)); // poly = (*it).second; } -//! \brief computes the sign of univariate polynomial at (x; y). +//! \brief computes the sign of univariate polynomial at (x; y). //! //! if computation with the current precision is not reliable, the sign is //! recomputed with modular or exact rational arithmetic int evaluate_generic(int var, const NT& c, const NT& key, const Poly_1& poly) -{ +{ NT x = key, y = c, c1; - + if(var == CGAL_X_RANGE) { x = c; y = key; @@ -941,11 +941,11 @@ int evaluate_generic(int var, const NT& c, const NT& key, const Poly_1& poly) int sign; NT res = evaluate(poly, c1, &error_bounds_); - if(error_bounds_) + if(error_bounds_) sign = evaluate_rational(var, c, key); else sign = CGAL_SGN(res); - + return sign; } @@ -956,12 +956,12 @@ int evaluate_rational(int var, const NT& c, const NT& key) Rational c_r = float2rat(c), key_r = float2rat(key); c_r = (var == CGAL_X_RANGE) ? (x_min_r + c_r*pixel_w_r) : (y_min_r + c_r*pixel_h_r); - + Rational_poly_2 *rat = rational_x; if(var == CGAL_Y_RANGE) { - rat = rational_y; + rat = rational_y; key_r = x_min_r + key_r*pixel_w_r; - } else + } else key_r = y_min_r + key_r*pixel_h_r; Rat_coercion_type res = substitute_xy(*rat, key_r, c_r); @@ -972,7 +972,7 @@ int evaluate_rational(int var, const NT& c, const NT& key) void precompute(const Polynomial_2& in) { typedef typename Polynomial_traits_2::Innermost_coefficient_type Coeff_src; - + Max_coeff max_coeff; Coeff_src max_c = max_coeff(in); /////// magic symbol //////////// @@ -982,7 +982,7 @@ void precompute(const Polynomial_2& in) { typedef Reduce_by Reduce_op; Transform transform; Reduce_op op(max_c); - + typedef CGAL::Polynomial_traits_d RP_traits; *rational_y = transform(in, op); // divides by maximal coefficient *rational_x = typename RP_traits::Swap()(*rational_y, 0, 1); @@ -1001,7 +1001,7 @@ void precompute(const Polynomial_2& in) { int degree_x = coeffs_x->degree(), degree_y = coeffs_y->degree(); -/* cached_x->clear(); +/* cached_x->clear(); cached_y->clear(); */ der_x->clear(); der_y->clear(); @@ -1012,7 +1012,7 @@ void precompute(const Polynomial_2& in) { NT det(1.0); for(i = 0; i < degree_x; i++) { - if(i != 0) + if(i != 0) det = X[0]; for(j = 1; j <= degree_x - i; j++) { // divide by the lowest coefficient ? @@ -1025,11 +1025,11 @@ void precompute(const Polynomial_2& in) { det = NT(1.0); for(i = 0; i < degree_y; i++) { - if(i != 0) + if(i != 0) det = X[0]; for(j = 1; j <= degree_y - i; j++) { // divide by the lowest coefficient ? - X[j - 1] = (i == 0 ? NT(j) : X[j] * NT(j) / det); + X[j - 1] = (i == 0 ? NT(j) : X[j] * NT(j) / det); make_exact(X[j-1]); } der_y->push_back(CGAL::Polynomial(X.begin(), @@ -1037,7 +1037,7 @@ void precompute(const Polynomial_2& in) { } } -//! \brief activates the cache entry \c cache_id +//! \brief activates the cache entry \c cache_id void select_cache_entry(int cache_id) { coeffs_x = coeffs_x_ + cache_id; @@ -1048,7 +1048,7 @@ void select_cache_entry(int cache_id) rational_fy = rational_fy_ + cache_id; der_x = der_x_ + cache_id; der_y = der_y_ + cache_id; -/* cached_x = cached_x_ + cache_id; +/* cached_x = cached_x_ + cache_id; cached_y = cached_y_ + cache_id;*/ } @@ -1056,7 +1056,7 @@ void select_cache_entry(int cache_id) void clear_caches() { for(unsigned i = 0; i < CGAL_N_CACHES; i++) { -/* cached_x_[i].clear(); +/* cached_x_[i].clear(); cached_y_[i].clear(); */ der_x_[i].clear(); der_y_[i].clear(); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h index 895e7560612d..bf85bc0a54c7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h @@ -21,11 +21,11 @@ /*! \file CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h * \brief * defines class Curve_renderer_traits. - * + * * provides specialisations of Curve_renderer_traits for different number * types compatible with the curve renderer */ - + namespace CGAL { // transformation routine @@ -81,7 +81,7 @@ struct Reduce_by { Reduce_by(const Input& denom_) : denom(cast(denom_)) { } - + Result operator()(const Input& x) { return (cast(x)/denom); } @@ -128,16 +128,16 @@ struct Transform { * * this traits class prodives various number type conversions for the * curve renderer - */ + */ template -struct Curve_renderer_traits_base -{ +struct Curve_renderer_traits_base +{ //! type of innermost polynomial coefficients typedef Coeff_ Coeff; - + //! an integer number type - typedef Integer_ Integer; + typedef Integer_ Integer; typedef Rational_ Rational; @@ -147,32 +147,32 @@ struct Curve_renderer_traits_base typedef Float result_type; template - Float operator()(const Sqrt_extension& x) const { + Float operator()(const Sqrt_extension& x) const { typename CGAL::Coercion_traits, Float>::Cast - cast; - return cast(x); + cast; + return cast(x); } - Float operator()(const Rational& x) const { - return static_cast(x); + Float operator()(const Rational& x) const { + return static_cast(x); } }; - + //! provided for convenience when there exists an implicit coercion //! between number types template struct Implicit_coercion { typedef To result_type; - - template + + template To operator()(const From& x) const { return static_cast(x); } }; - + struct Float_to_int { typedef int result_type; - + template int operator()(const Float& x) const { return static_cast(std::floor(CGAL::to_double(x))); } @@ -187,13 +187,13 @@ struct Curve_renderer_traits_base * \c FieldWithSqrt , etc. Provided that there is a type coercion between * \c Extended and \c Coeff */ - struct Convert_poly { + struct Convert_poly { typedef CGAL::Polynomial > result_type; - + template - inline result_type operator()(const + inline result_type operator()(const CGAL::Polynomial >& poly) const { - + //!@todo: use Rat_to_float functor instead of coercion traits ? //! need some sort of polymorphism.. @@ -206,64 +206,64 @@ struct Curve_renderer_traits_base return transform(poly); } }; - + //! converts polynomial coefficients to floating-point representation //! \c error_bounds is set if the result is not reliable struct Extract_eval { typedef Coeff argument_type; typedef Coeff result_type; - - Coeff operator()(const Coeff& x, - bool *error_bounds = nullptr) const { + + Coeff operator()(const Coeff& x, + bool *error_bounds = nullptr) const { if(error_bounds != nullptr) *error_bounds = false; return x; } }; - + //! computes a 32-bit hash value from floating-point argument struct Hash_function { typedef std::size_t result_type; struct long_long { long low, high; }; - + template std::size_t operator()(const Float& key) const { const long_long *hk = reinterpret_cast(&key); return (hk->low ^ hk->high); } }; - + //! makes result exact after inexact operation such as div, sqrt, etc. //! (required for multi-precision arithmetic) struct Make_exact { typedef void result_type; - + template void operator()(const Float& x) const { } }; - + //! compares a given quantity with the precision limit a floating-point //! number type, returns \c true if this limit is exceeded struct Precision_limit { typedef bool result_type; - + template bool operator()(const Float& x) const { return false;/*(CGAL_ABS(x) <= 1e-16)*/; } }; - + //! maximum subdivision level for the curve renderer by exceeding which //! an exception of type \c Insufficient_rasterize_precision_exception //! will be thrown, this is also limited by \c Integer number type, since //! the integer must be able to store numbers up to 2^MAX_SUBDIVISION_LEVEL - static const unsigned MAX_SUBDIVISION_LEVEL = 12; + static const unsigned MAX_SUBDIVISION_LEVEL = 12; }; template -struct Curve_renderer_traits +struct Curve_renderer_traits { }; #ifdef CGAL_USE_CORE @@ -272,15 +272,15 @@ template <> struct Curve_renderer_traits, CORE::BigRat > : public Curve_renderer_traits_base, int, CORE::BigRat> { - + typedef double Float; struct Rat_to_float { typedef Float result_type; - + template Float operator()(const Extended& x) const { - return CGAL::to_double(x); + return CGAL::to_double(x); } }; @@ -298,9 +298,9 @@ struct Curve_renderer_traits, CORE::BigRat > : struct Extract_eval { typedef Coeff argument_type; typedef Float result_type; - - Float operator()(const Coeff& x, - bool *error_bounds = nullptr) const { + + Float operator()(const Coeff& x, + bool *error_bounds = nullptr) const { bool err_bnd; // err_bnd = (CGAL_ABS(l) < 1E-15 || CGAL_ABS(u) < 1E-15) || // ((l <= 0 && u >= 0)); @@ -311,7 +311,7 @@ struct Curve_renderer_traits, CORE::BigRat > : //! ATTENTION!!! if smth is screwed up try to uncomment the line below //! this is very crucial for performance & stability if(err_bnd) // && ABS(mid) < 1E-15) - return 0; + return 0; //! ATTENTION!!! return mid; } @@ -321,7 +321,7 @@ struct Curve_renderer_traits, CORE::BigRat > : //! number type, returns \c true if this limit is exceeded struct Precision_limit { typedef bool result_type; - + template bool operator()(const Float& x) const { return (CGAL_ABS(x) <= 1e-16); } @@ -332,7 +332,7 @@ struct Curve_renderer_traits, CORE::BigRat > : //! Specialization for \c CORE::BigFloat template <> -struct Curve_renderer_traits +struct Curve_renderer_traits : public Curve_renderer_traits_base { @@ -341,37 +341,37 @@ struct Curve_renderer_traits struct Rat_to_integer { typedef Rational argument_type; typedef Integer result_type; - - Integer operator()(const Rational& x) const { - return x.BigIntValue(); + + Integer operator()(const Rational& x) const { + return x.BigIntValue(); } }; typedef Rat_to_float Rat_to_float; - + struct Float_to_rat { typedef Float argument_type; typedef Rational result_type; - + Rational operator()(const Float& x) const { return x.BigRatValue(); } }; - + struct Hash_function { typedef Float argument_type; typedef std::size_t result_type; - + inline result_type operator()(const Float& key) const { const CORE::BigFloatRep& rep = key.getRep(); std::size_t ret = reinterpret_cast(&rep); return ret; } }; - + struct Make_exact { typedef Float argument_type; typedef void result_type; - + inline void operator()(Float& x) const { x.makeExact(); } }; @@ -381,7 +381,7 @@ struct Curve_renderer_traits //! Specialization for \c CORE::BigRat template <> -struct Curve_renderer_traits : +struct Curve_renderer_traits : public Curve_renderer_traits_base { @@ -394,16 +394,16 @@ struct Curve_renderer_traits : struct Rat_to_integer { typedef Rational argument_type; typedef Integer result_type; - - Integer operator()(const Rational& x) const { - return x.BigIntValue(); + + Integer operator()(const Rational& x) const { + return x.BigIntValue(); } }; - + struct Hash_function { typedef Float argument_type; typedef std::size_t result_type; - + inline result_type operator()(const Float& key) const { const CORE::BigRatRep& rep = key.getRep(); std::size_t ret = reinterpret_cast(&rep); @@ -418,15 +418,15 @@ template <> struct Curve_renderer_traits, leda::rational > : public Curve_renderer_traits_base, int, leda::rational> { - + typedef double Float; struct Rat_to_float { typedef Float result_type; - + template Float operator()(const Extended& x) const { - return CGAL::to_double(x); + return CGAL::to_double(x); } }; @@ -445,9 +445,9 @@ struct Curve_renderer_traits, leda::rational > : struct Extract_eval { typedef Coeff argument_type; typedef Float result_type; - - Float operator()(const Coeff& x, - bool *error_bounds = nullptr) const { + + Float operator()(const Coeff& x, + bool *error_bounds = nullptr) const { bool err_bnd; // err_bnd = (CGAL_ABS(l) < 1E-15 || CGAL_ABS(u) < 1E-15) || // ((l <= 0 && u >= 0)); @@ -458,7 +458,7 @@ struct Curve_renderer_traits, leda::rational > : //! ATTENTION!!! if smth is screwed up try to uncomment the line below //! this is very crucial for performance & stability if(err_bnd) // && ABS(mid) < 1E-15) - return 0; + return 0; //! ATTENTION!!! return mid; } @@ -468,7 +468,7 @@ struct Curve_renderer_traits, leda::rational > : //! number type, returns \c true if this limit is exceeded struct Precision_limit { typedef bool result_type; - + template bool operator()(const Float& x) const { return (CGAL_ABS(x) <= 1e-16); } @@ -477,7 +477,7 @@ struct Curve_renderer_traits, leda::rational > : //! Specialization for \c leda::bigfloat template <> -struct Curve_renderer_traits +struct Curve_renderer_traits : public Curve_renderer_traits_base { @@ -486,9 +486,9 @@ struct Curve_renderer_traits struct Rat_to_integer { typedef Rational argument_type; typedef Integer result_type; - - Integer operator()(const Rational& x) const { - return leda::floor(x); + + Integer operator()(const Rational& x) const { + return leda::floor(x); } }; @@ -496,45 +496,45 @@ struct Curve_renderer_traits typedef Float result_type; template - Float operator()(const Sqrt_extension& x) const { + Float operator()(const Sqrt_extension& x) const { typename CGAL::Coercion_traits, Float>::Cast - cast; - return cast(x); + cast; + return cast(x); } // no implicit coercion between leda rational and floats, therefore // decompose rational to compute the result - Float operator()(const Rational& x) const { - return (static_cast(x.numerator()) / - static_cast(x.denominator())); + Float operator()(const Rational& x) const { + return (static_cast(x.numerator()) / + static_cast(x.denominator())); } }; - + struct Float_to_rat { typedef Float argument_type; typedef Rational result_type; - + Rational operator()(const Float& x) const { return x.to_rational(); } }; - - struct Convert_poly { + + struct Convert_poly { typedef CGAL::Polynomial > result_type; - + template - inline result_type operator()(const + inline result_type operator()(const CGAL::Polynomial >& poly) const { - + Transform >, Rat_to_float> transform; return transform(poly); } }; - + struct Hash_function { typedef Float argument_type; typedef std::size_t result_type; - + inline result_type operator()(const Float& key) const { return static_cast( key.get_significant_length()); @@ -544,7 +544,7 @@ struct Curve_renderer_traits //! Specialization for \c leda::rational template <> -struct Curve_renderer_traits : +struct Curve_renderer_traits : public Curve_renderer_traits_base { @@ -557,16 +557,16 @@ struct Curve_renderer_traits : struct Rat_to_integer { typedef Rational argument_type; typedef Integer result_type; - - Integer operator()(const Rational& x) const { - return leda::floor(x); + + Integer operator()(const Rational& x) const { + return leda::floor(x); } }; - + struct Hash_function { typedef Float argument_type; typedef std::size_t result_type; - + inline result_type operator()(const Float& key) const { std::size_t ret = reinterpret_cast( key.numerator().word_vector()); @@ -577,7 +577,7 @@ struct Curve_renderer_traits : struct Make_exact { typedef Float argument_type; typedef void result_type; - + inline void operator()(Float& x) const { x.normalize(); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h index 5a3375ec0f2b..322f57d08466 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h @@ -12,7 +12,7 @@ // ============================================================================ /*!\file CGAL/Curved_kernel_via_analysis_2/gfx//Subdivision_1.h - * \brief definition of Subdivision_1<> + * \brief definition of Subdivision_1<> * 1D space subdivision for rasterization of planar curves */ @@ -47,78 +47,78 @@ namespace internal { #define SoX_WINDOW_ENLARGE 15 // # of pixels by which the drawing window // is enlarged in y-direction: this is used - // to skip closely located clip-points - -#define SoX_REFINE_X 1000 // refine factor for X-intervals + // to skip closely located clip-points + +#define SoX_REFINE_X 1000 // refine factor for X-intervals + // (in pixel size) +#define SoX_REFINE_Y 100000 // refine factor for Y-intervals // (in pixel size) -#define SoX_REFINE_Y 100000 // refine factor for Y-intervals - // (in pixel size) #endif // SoX_CURVE_RENDERER_DEFS -#define SoX_REFINE_ISOLATED_POINTS 2 // refine factor for clip points +#define SoX_REFINE_ISOLATED_POINTS 2 // refine factor for clip points template struct Range_templ { Range_templ() { } - Range_templ(const NT& l_, const NT& r_) : left(l_), right(r_) - { + Range_templ(const NT& l_, const NT& r_) : left(l_), right(r_) + { sign_change = true; } NT left, right; bool sign_change; -}; +}; } // namespace internal -/*!\brief +/*!\brief * The class template \c Subdivision_1 and its associate functions. - * + * * The class implements a space method to plot algebraic curves, we use Affine * Arithmetic with recursive derivative information */ template class Subdivision_1 { -public: - //! \name public typedefs - //!@{ - +public: + //! \name public typedefs + //!@{ + //! this instance's first template argument typedef Coeff_ Coeff; //! this instance's second template argument typedef Algebraic_curve_2_ Algebraic_curve_2; - + //!@} -private: - //! \name private typedefs - //!@{ +private: + //! \name private typedefs + //!@{ //! rational number type typedef typename Algebraic_curve_2::Rational Rational; - + //! special number type traits dependent on polynomial coefficient typedef SoX::Curve_renderer_traits Renderer_traits; - + //! specialized integer number type typedef typename Renderer_traits::Integer Integer; //! supporting bivariate polynomial type typedef typename Algebraic_curve_2::Poly_d Poly_dst_2; //! supporting univariate polynomial type typedef typename Algebraic_curve_2::Poly_d::NT Poly_dst_1; - - //! a univariate rational polynomial + + //! a univariate rational polynomial typedef CGAL::Polynomial Rational_poly_1; //! a bivariate rational polynomial typedef CGAL::Polynomial Rational_poly_2; - + //! basic number type used in all computations typedef typename Renderer_traits::Float NT; //! instance of a univariate polynomial typedef CGAL::Polynomial Poly_1; //! instance of a bivariate polynomial typedef CGAL::Polynomial Poly_2; - + //! conversion from the basic number type to doubles typename CGAL::Real_embeddable_traits::To_double to_double; //! conversion from the basic number type to integers @@ -132,21 +132,21 @@ class Subdivision_1 //! makes the result exact after inexact operation (applicable only for //! exact number types typename Renderer_traits::Make_exact make_exact; - - //! returns \c true whenever a precision limit of used number type is + + //! returns \c true whenever a precision limit of used number type is //! reached typename Renderer_traits::Precision_limit limit; //! maximum level of subdivision, dependent on used data type - static const unsigned MAX_SUBDIVISION_LEVEL = + static const unsigned MAX_SUBDIVISION_LEVEL = Renderer_traits::MAX_SUBDIVISION_LEVEL; //! isolated point typedef Intern::Range_templ Isolated_point; //! a list of isolated points typedef std::list Isolated_points; - + //! map container element's type for maintaining a list of cache instances typedef std::pair LRU_entry; - + //! LRU list used for effective cache switching typedef boost::multi_index::multi_index_container< LRU_entry, boost::multi_index::indexed_by< @@ -154,28 +154,28 @@ class Subdivision_1 boost::multi_index::ordered_unique< BOOST_MULTI_INDEX_MEMBER(LRU_entry,int,first) > > > LRU_list; - + //!@} -public: +public: //! \name Constructors - //!@{ - + //!@{ + //! default constructor Subdivision_1() : initialized(false), one(1), polynomial_set(false) {} //!@} - + public: //! \name public methods - //!@{ - + //!@{ + //! sets up drawing window and pixel resolution void setup(const double& x_min_,const double& y_min_, const double& x_max_,const double& y_max_, int res_w_, int res_h_) { initialized = engine.setup(x_min_, y_min_, x_max_, y_max_, res_w_, res_h_); - } - + } + //! sets up the underlying polynomial void set_polynomial(const Poly_dst_2& poly) { @@ -188,50 +188,50 @@ class Subdivision_1 { return input_poly; } - + //! \brief returns drawing window boundaries - void get_window(double& x_min_, double& y_min_, double& x_max_, + void get_window(double& x_min_, double& y_min_, double& x_max_, double& y_max_) const { - x_min_ = to_double(engine.x_min); - x_max_ = to_double(engine.x_max); - y_min_ = to_double(engine.y_min); + x_min_ = to_double(engine.x_min); + x_max_ = to_double(engine.x_max); + y_min_ = to_double(engine.y_min); y_max_ = to_double(engine.y_max); } - + //! \brief returns pixel resolution void get_resolution(int& res_w_, int& res_h_) const { - res_w_ = engine.res_w; + res_w_ = engine.res_w; res_h_ = engine.res_h; } - + //! \brief the main rendering procedure, copies a set of pixel coordinates //! to the output iterator \c oi template - OutputIterator draw(OutputIterator oi); - + OutputIterator draw(OutputIterator oi); + ~Subdivision_1() { cache_list.clear(); } - - //!@} + + //!@} private: //! \name Private methods - //!@{ - + //!@{ + //! makes certain cache entry active void select_cache_entry(); - + //! refines isolated point intervals until pixel size - void refine_points(int var, const NT& key, const Poly_1& poly, + void refine_points(int var, const NT& key, const Poly_1& poly, Isolated_points& points); - + //! isolates curve points along a sweep-line - bool isolate_recursive(int var, const NT& beg, const NT& end, + bool isolate_recursive(int var, const NT& beg, const NT& end, const NT& clip, const Poly_1& poly, Isolated_points& points); - + //! \brief returns whether a polynomial has zero over an interval, //! we are not interested in concrete values //! @@ -239,32 +239,32 @@ class Subdivision_1 //! 0th bit - of a polynomial itself (0th derivative, default) //! 1st bit - of the first derivative (sets \c first_der flag) //! 2nd bit - of the second derivative - bool get_range_1(int var, const NT& lower, const NT& upper, const NT& key, + bool get_range_1(int var, const NT& lower, const NT& upper, const NT& key, const Poly_1& poly, int check = 1); - + //!@} private: //! \name Private properties - //!@{ - + //!@{ + Poly_dst_2 input_poly; //! supporting polynomial - + //! an instance of rendering engine Intern::Curve_renderer_internals engine; - + int cache_id; //! index of currently used cache instance LRU_list cache_list; //! list of indices of cache instances - + bool initialized; //! indicates whether the renderer has been initialized //! with correct parameters const Integer one; //! just "one" - + bool polynomial_set; //! true if input polynomial was set - - //!@} + + //!@} }; // class Subdivision_1<> -//! \brief main rasterization procedure, copies in the the output iterator +//! \brief main rasterization procedure, copies in the the output iterator //! \c oi a set of pixel coordinates template @@ -277,20 +277,20 @@ OutputIterator Subdivision_1::draw( //std::cout << "resolution: " << res_w << " x " << res_h << std::endl; //std::cout << "box: [" << x_min << "; " << y_min << "]x[" << x_max << "; " // << y_max << "]" << std::endl; - + Isolated_points points; Poly_1 poly; int x, y; - + for(x = 0; x < engine.res_w; x++) { NT key = NT(x); points.clear(); - + engine.get_precached_poly(SoX_Y_RANGE, key, 0, poly); isolate_recursive(SoX_Y_RANGE, NT(0), NT(engine.res_h), key, poly, points); refine_points(SoX_Y_RANGE, key, poly, points); - + typename Isolated_points::iterator it = points.begin(); while(it != points.end()) { // std::cout << "(" << x << "; " << y << ") "; @@ -305,26 +305,26 @@ OutputIterator Subdivision_1::draw( it++; } } - + for(y = 0; y < engine.res_h; y++) { NT key = NT(y); points.clear(); - + engine.get_precached_poly(SoX_X_RANGE, key, 0, poly); isolate_recursive(SoX_X_RANGE, NT(0), NT(engine.res_h), key, poly, points); refine_points(SoX_X_RANGE, key, poly, points); - + typename Isolated_points::iterator it = points.begin(); while(it != points.end()) { // std::cout << "(" << x << "; " << y << ") "; x = (int)floor((*it).left); *oi++ = std::make_pair(x, engine.res_h - y); - + //int yend = res_h - (int)floor((*it).right); //painter->moveTo(x,y); //painter->lineTo(x,yend); - + it++; } } @@ -342,25 +342,25 @@ void Subdivision_1::refine_points(int var, while(it != points.end()) { NT l = (*it).left, r = (*it).right; //Gfx_OUT << l << " " << r << "\n"; - int eval_l = engine.evaluate_generic(var, l, key, poly), + int eval_l = engine.evaluate_generic(var, l, key, poly), eval_r = engine.evaluate_generic(var, r, key, poly); if((eval_l^eval_r)==0) { // no sign change - interval is too small - /*if(eval_l==0) + /*if(eval_l==0) (*it).left = (*it).right = l; - else if(eval_r==0) + else if(eval_r==0) (*it).left = (*it).right = r;*/ (*it).sign_change = false; //std::cout << "no sign change\n"; it++; continue; - } + } while(r - l > dist) { NT mid = (l+r)/2; make_exact(mid); int eval_m = engine.evaluate_generic(var, mid, key, poly); - if(eval_m == 0) + if(eval_m == 0) l = r = mid; - else if(eval_m == eval_l) + else if(eval_m == eval_l) l = mid; else r = mid; @@ -378,28 +378,28 @@ bool Subdivision_1::isolate_recursive { // y_clip: 0 for top boundary, res_h-1 for bottom boundary // beg, end: 0 and res_w-1 respectively - + if(!get_range_1(var, beg, end, key, poly, 3)) - return false; - + return false; + if(!engine.first_der) { //std::cout << "interval found: " << (x_end - x_beg) << std::endl; points.push_back(Isolated_point(beg, end)); return true; } - + NT dist = NT(1)/NT(SoX_REFINE_ISOLATED_POINTS); make_exact(dist); if(end - beg < dist) {// pixel size is reached //std::cout << "WARNING: roots are too close..\n"; - + // in this case we should generate an exception.. points.push_back(Isolated_point(beg, end)); return true; } NT mid = (beg + end)/2; make_exact(mid); - + isolate_recursive(var, beg, mid, key, poly, points); isolate_recursive(var, mid, end, key, poly, points); return true; @@ -410,20 +410,20 @@ bool Subdivision_1::isolate_recursive //! //! if \t der_check is set a range for the first derivative is also computed template -inline bool Subdivision_1::get_range_1(int var, - const NT& lower, const NT& upper, const NT& key, const Poly_1& poly, +inline bool Subdivision_1::get_range_1(int var, + const NT& lower, const NT& upper, const NT& key, const Poly_1& poly, int check) { bool res = engine.get_range_QF_1(var, lower, upper, key, poly, check); return res; } -//! \brief switches to a certain cache instance depending on currently used +//! \brief switches to a certain cache instance depending on currently used //! algebraic curve template void Subdivision_1::select_cache_entry() { - cache_id = 0; // no cache is currently used + cache_id = 0; // no cache is currently used engine.select_cache_entry(cache_id); engine.precompute(input_poly); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h index af9c9261b5b5..e419876590ee 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h @@ -12,7 +12,7 @@ // ============================================================================ /*!\file CGAL/Curved_kernel_via_analysis_2/gfx//Subdivision_2.h - * \brief definition of Subdivision_2<> + * \brief definition of Subdivision_2<> * 2D space subdivision for rasterization of planar curves */ @@ -34,514 +34,514 @@ namespace internal { template struct Range_templ { - Range_templ() { } - Range_templ(const NT& l_, const NT& u_) : lower(l_), upper(u_) { } - NT lower, upper; -}; + Range_templ() { } + Range_templ(const NT& l_, const NT& u_) : lower(l_), upper(u_) { } + NT lower, upper; +}; } // namespace internal -/*!\brief +/*!\brief * The class template \c Subdivision_2 and its associate functions. - * + * * The class implements a space method to plot algebraic curves, we use Affine * Arithmetic with recursive derivative information */ template class Subdivision_2 { -public: - //! \name public typedefs - //!@{ - //! this instance's first template argument - typedef NT_ NT; - //! this instance's second template argument - typedef Algebraic_curve_2_ Algebraic_curve_2; - //! specialized integer number type - typedef typename SoX::Curve_renderer_traits::Integer Integer; - //! instance of univariate polynomial - typedef CGAL::Polynomial Poly_1; - //! instance of bivariate polynomial - typedef CGAL::Polynomial Poly_2; - //! rational number type instance - typedef typename Algebraic_curve_2::Rational Rational; - //! instance of input bivariate polynomial - typedef typename Algebraic_curve_2::Poly_d Poly_input_2; - //! instance of input univariate polynomuial - typedef typename Poly_input_2::NT Poly_input_1; - //! instance of coefficient number type - typedef typename Poly_input_1::NT Coeff; - //! container used to store coefficient sequence - typedef typename Poly_1::Vector Vector_1; - //! container's const iterator (random access) - typedef typename Poly_1::const_iterator const_iterator_1; - //! container used to store univariate polynomials sequence - typedef typename Poly_2::Vector Vector_2; - //! container's const iterator (random access) - typedef typename Poly_2::const_iterator const_iterator_2; - //@} -private: - //! \name private typedefs - //@{ - - //! conversion from the basic number type to integers - typename SoX::Curve_renderer_traits::To_integer to_integer; - //! conversion from \c Integer type to built-in integer - typename SoX::Curve_renderer_traits::To_machine_int to_int; +public: + //! \name public typedefs + //!@{ + //! this instance's first template argument + typedef NT_ NT; + //! this instance's second template argument + typedef Algebraic_curve_2_ Algebraic_curve_2; + //! specialized integer number type + typedef typename SoX::Curve_renderer_traits::Integer Integer; + //! instance of univariate polynomial + typedef CGAL::Polynomial Poly_1; + //! instance of bivariate polynomial + typedef CGAL::Polynomial Poly_2; + //! rational number type instance + typedef typename Algebraic_curve_2::Rational Rational; + //! instance of input bivariate polynomial + typedef typename Algebraic_curve_2::Poly_d Poly_input_2; + //! instance of input univariate polynomuial + typedef typename Poly_input_2::NT Poly_input_1; + //! instance of coefficient number type + typedef typename Poly_input_1::NT Coeff; + //! container used to store coefficient sequence + typedef typename Poly_1::Vector Vector_1; + //! container's const iterator (random access) + typedef typename Poly_1::const_iterator const_iterator_1; + //! container used to store univariate polynomials sequence + typedef typename Poly_2::Vector Vector_2; + //! container's const iterator (random access) + typedef typename Poly_2::const_iterator const_iterator_2; + //@} +private: + //! \name private typedefs + //@{ + + //! conversion from the basic number type to integers + typename SoX::Curve_renderer_traits::To_integer to_integer; + //! conversion from \c Integer type to built-in integer + typename SoX::Curve_renderer_traits::To_machine_int to_int; //! conversion from \c Rational type to used number type - typename SoX::Curve_renderer_traits::From_rational from_rat; - //! makes the result exact after inexact operation (applicable only for - //! exact number types - typename SoX::Curve_renderer_traits::Make_exact make_exact; - //! an interval - typedef Intern::Range_templ Range; - //! affine form instance - typedef SoX::Affine_form Affine_form; - //@} -public: - //! \name Constructors - //@{ - //! default constructor - Subdivision_2() : initialized(false), polynomial_set(false) {} - //@} + typename SoX::Curve_renderer_traits::From_rational from_rat; + //! makes the result exact after inexact operation (applicable only for + //! exact number types + typename SoX::Curve_renderer_traits::Make_exact make_exact; + //! an interval + typedef Intern::Range_templ Range; + //! affine form instance + typedef SoX::Affine_form Affine_form; + //@} public: - //! \name public methods - //@{ - //! specifies drawing window and pixel resolution - void setup(const double& x_min_,const double& y_min_, - const double& x_max_,const double& y_max_, - int res_w_, int res_h_) - { - x_min = static_cast(x_min_); - x_max = static_cast(x_max_); - y_min = static_cast(y_min_); - y_max = static_cast(y_max_); - res_w = res_w_; - res_h = res_h_; - if(x_min >= x_max||y_min >= y_max||res_w < 5||res_h < 5||res_w > 1024|| - res_h > 1024) { - std::cout << "Incorrect setup parameters" << std::endl; - initialized = false; - return; - } - pixel_w = (x_max - x_min) / res_w; - pixel_h = (y_max - y_min) / res_h; - make_exact(pixel_w); - make_exact(pixel_h); - initialized = true; - } - //! sets up the underlying polynomial - void set_polynomial(const Poly_input_2& poly) - { - input_poly = poly; - precompute(); - } - //! returns the underlying polynomial - Poly_input_2 get_polynomial() const - { - return input_poly; - } - //! \brief returns drawing window boundaries - void get_window(double& x_min_, double& y_min_, double& x_max_, - double& y_max_) const - { - x_min_ = to_double(x_min); - x_max_ = to_double(x_max); - y_min_ = to_double(y_min); - y_max_ = to_double(y_max); - } - //! \brief returns pixel resolution - void get_resolution(int& res_w_, int& res_h_) const - { - res_w_ = res_w; - res_h_ = res_h; - } - //! \brief the main rendering procedure - void draw(QPainter *painter_); - //@} + //! \name Constructors + //@{ + //! default constructor + Subdivision_2() : initialized(false), polynomial_set(false) {} + //@} +public: + //! \name public methods + //@{ + //! specifies drawing window and pixel resolution + void setup(const double& x_min_,const double& y_min_, + const double& x_max_,const double& y_max_, + int res_w_, int res_h_) + { + x_min = static_cast(x_min_); + x_max = static_cast(x_max_); + y_min = static_cast(y_min_); + y_max = static_cast(y_max_); + res_w = res_w_; + res_h = res_h_; + if(x_min >= x_max||y_min >= y_max||res_w < 5||res_h < 5||res_w > 1024|| + res_h > 1024) { + std::cout << "Incorrect setup parameters" << std::endl; + initialized = false; + return; + } + pixel_w = (x_max - x_min) / res_w; + pixel_h = (y_max - y_min) / res_h; + make_exact(pixel_w); + make_exact(pixel_h); + initialized = true; + } + //! sets up the underlying polynomial + void set_polynomial(const Poly_input_2& poly) + { + input_poly = poly; + precompute(); + } + //! returns the underlying polynomial + Poly_input_2 get_polynomial() const + { + return input_poly; + } + //! \brief returns drawing window boundaries + void get_window(double& x_min_, double& y_min_, double& x_max_, + double& y_max_) const + { + x_min_ = to_double(x_min); + x_max_ = to_double(x_max); + y_min_ = to_double(y_min); + y_max_ = to_double(y_max); + } + //! \brief returns pixel resolution + void get_resolution(int& res_w_, int& res_h_) const + { + res_w_ = res_w; + res_h_ = res_h; + } + //! \brief the main rendering procedure + void draw(QPainter *painter_); + //@} private: - //! \name Private methods - //@{ - //! precomputes polynomials and derivative coefficients - void precompute(); - //! \brief switches to another cache instance depending on the - //! supporting curve of a segment - //! \brief evalutates the ith derivative at certain x - //! - //! \c cache_it - an intetator pointing to the end of an array of - //! polynomial coefficients, \c der_it - an iterator for derivative - //! coefficients - NT evaluate_der(const_iterator_1 der_it, const_iterator_1 begin, - const_iterator_1 cache_it, const NT& x) - { - NT val((*cache_it--) * (*der_it)); - while((der_it--)!=begin) - val = val * x + (*cache_it--) * (*der_it); - return val; - } - //! evalutates a function at a certain x - NT evaluate(const Poly_1& poly, const NT& x) - { - const_iterator_1 it = poly.end() - 1, begin = poly.begin(); - NT val(*it); - while((it--)!=begin) - val = val * x + (*it); - return val; - } - //! \brief computes the ranges of univariate polynomial values over an interval - void get_range_1(int var, const NT& lower, const NT& upper, - const Poly_1& poly, NT& l, NT& h); - //! Affine Arithmetic with Recursive Derivative information - //! for univariate case - void get_range_AARD_1(int var, const NT& lower, const NT& upper, - const Poly_1& poly, NT& l, NT& h); - //! \brief Recursive Taylor, bivariate case - //! - //! returns a range of polynomial values as Affine_form - void get_range_RT_2(const NT& x_low, const NT& x_high, const NT& y_low, - const NT& y_high, int depth, int index, Affine_form& res); - //! checks a rectangular area with 2D range analysis: either discrads it, - //! subdivides further or draws a pixel - void quad_tree(const NT& x_low, const NT& x_high, const NT& y_low, - const NT& y_high); - //! \brief recursive quad tree subdivision - void subdivide(const NT& x_low, const NT& x_high, const NT& y_low, - const NT& y_high); + //! \name Private methods + //@{ + //! precomputes polynomials and derivative coefficients + void precompute(); + //! \brief switches to another cache instance depending on the + //! supporting curve of a segment + //! \brief evalutates the ith derivative at certain x + //! + //! \c cache_it - an intetator pointing to the end of an array of + //! polynomial coefficients, \c der_it - an iterator for derivative + //! coefficients + NT evaluate_der(const_iterator_1 der_it, const_iterator_1 begin, + const_iterator_1 cache_it, const NT& x) + { + NT val((*cache_it--) * (*der_it)); + while((der_it--)!=begin) + val = val * x + (*cache_it--) * (*der_it); + return val; + } + //! evalutates a function at a certain x + NT evaluate(const Poly_1& poly, const NT& x) + { + const_iterator_1 it = poly.end() - 1, begin = poly.begin(); + NT val(*it); + while((it--)!=begin) + val = val * x + (*it); + return val; + } + //! \brief computes the ranges of univariate polynomial values over an interval + void get_range_1(int var, const NT& lower, const NT& upper, + const Poly_1& poly, NT& l, NT& h); + //! Affine Arithmetic with Recursive Derivative information + //! for univariate case + void get_range_AARD_1(int var, const NT& lower, const NT& upper, + const Poly_1& poly, NT& l, NT& h); + //! \brief Recursive Taylor, bivariate case + //! + //! returns a range of polynomial values as Affine_form + void get_range_RT_2(const NT& x_low, const NT& x_high, const NT& y_low, + const NT& y_high, int depth, int index, Affine_form& res); + //! checks a rectangular area with 2D range analysis: either discrads it, + //! subdivides further or draws a pixel + void quad_tree(const NT& x_low, const NT& x_high, const NT& y_low, + const NT& y_high); + //! \brief recursive quad tree subdivision + void subdivide(const NT& x_low, const NT& x_high, const NT& y_low, + const NT& y_high); public: - //! destructor - ~Subdivision_2() - { - - } - //@} + //! destructor + ~Subdivision_2() + { + + } + //@} private: - //! \name Private properties - //@{ - NT x_min, x_max, y_min, y_max; //! drawing window boundaries - int res_w, res_h; //! pixel resolution - NT pixel_w, pixel_h; //! pixel dimensions w.r.t. resolution - Poly_2 coeffs_x, coeffs_y; //! f(x(y)) / f(y(x)) - Poly_input_2 input_poly; - Vector_2 der_x, der_y; //! derivative coefficients df/dx (df/dy) - std::vector mixed_derivatives; - int max_deg; //! the maximal degree w.r.t. x and y - bool initialized, polynomial_set; - QPainter *painter; - //@} + //! \name Private properties + //@{ + NT x_min, x_max, y_min, y_max; //! drawing window boundaries + int res_w, res_h; //! pixel resolution + NT pixel_w, pixel_h; //! pixel dimensions w.r.t. resolution + Poly_2 coeffs_x, coeffs_y; //! f(x(y)) / f(y(x)) + Poly_input_2 input_poly; + Vector_2 der_x, der_y; //! derivative coefficients df/dx (df/dy) + std::vector mixed_derivatives; + int max_deg; //! the maximal degree w.r.t. x and y + bool initialized, polynomial_set; + QPainter *painter; + //@} }; // class Subdivision_2<> //! \brief main rasterization procedure template void Subdivision_2::draw(QPainter *painter_) { - if(!initialized||!polynomial_set||painter_==nullptr) - return; - painter = painter_; - //std::cout << " P(x(y)): " << coeffs_x << std::endl; - //std::cout << " P(y(x)): " << coeffs_y << std::endl; - std::cout << "resolution: " << res_w << " x " << res_h << std::endl; - //std::cout << "box: [" << x_min << "; " << y_min << "]x[" << x_max << "; " - // << y_max << "]" << std::endl; - - //quad_tree(x_min/15, x_max/15, y_min/15, y_max/15); - quad_tree(x_min, x_max, y_min, y_max); - //std::cout << "exit normal" << std::endl; + if(!initialized||!polynomial_set||painter_==nullptr) + return; + painter = painter_; + //std::cout << " P(x(y)): " << coeffs_x << std::endl; + //std::cout << " P(y(x)): " << coeffs_y << std::endl; + std::cout << "resolution: " << res_w << " x " << res_h << std::endl; + //std::cout << "box: [" << x_min << "; " << y_min << "]x[" << x_max << "; " + // << y_max << "]" << std::endl; + + //quad_tree(x_min/15, x_max/15, y_min/15, y_max/15); + quad_tree(x_min, x_max, y_min, y_max); + //std::cout << "exit normal" << std::endl; } //! \brief checks a rectangular area with 2D range analysis: either discrads it, //! subdivides further or draws a pixel template -void Subdivision_2::quad_tree(const NT& x_low, - const NT& x_high, const NT& y_low, const NT& y_high) +void Subdivision_2::quad_tree(const NT& x_low, + const NT& x_high, const NT& y_low, const NT& y_high) { - Affine_form res; - NT lower, upper; - get_range_RT_2(x_low, x_high, y_low, y_high, 0, 0, res); - res.convert(lower, upper); - if(lower*upper > 0) - return; - if(x_high - x_low <= pixel_w&&y_high - y_low <= pixel_h) { - NT x = (x_low), y = (y_low); - int pix_x = static_cast(CGAL::to_double((x - x_min) / pixel_w)), - pix_y = static_cast(CGAL::to_double((y - y_min) / pixel_h)); - painter->drawPoint(pix_x, res_h - pix_y); - //painter->drawEllipse(pix_x-2,res_h-pix_y-2,4,4); - } - else - subdivide(x_low, x_high, y_low, y_high); + Affine_form res; + NT lower, upper; + get_range_RT_2(x_low, x_high, y_low, y_high, 0, 0, res); + res.convert(lower, upper); + if(lower*upper > 0) + return; + if(x_high - x_low <= pixel_w&&y_high - y_low <= pixel_h) { + NT x = (x_low), y = (y_low); + int pix_x = static_cast(CGAL::to_double((x - x_min) / pixel_w)), + pix_y = static_cast(CGAL::to_double((y - y_min) / pixel_h)); + painter->drawPoint(pix_x, res_h - pix_y); + //painter->drawEllipse(pix_x-2,res_h-pix_y-2,4,4); + } + else + subdivide(x_low, x_high, y_low, y_high); } //! \brief recursive quad tree subdivision template -void Subdivision_2::subdivide(const NT& x_low, - const NT& x_high, const NT& y_low, const NT& y_high) +void Subdivision_2::subdivide(const NT& x_low, + const NT& x_high, const NT& y_low, const NT& y_high) { - NT x_mid = (x_low + x_high)/2, y_mid = (y_low + y_high)/2; - quad_tree(x_low,x_mid,y_low,y_mid); - quad_tree(x_low,x_mid,y_mid,y_high); - quad_tree(x_mid,x_high,y_mid,y_high); - quad_tree(x_mid,x_high,y_low,y_mid); + NT x_mid = (x_low + x_high)/2, y_mid = (y_low + y_high)/2; + quad_tree(x_low,x_mid,y_low,y_mid); + quad_tree(x_low,x_mid,y_mid,y_high); + quad_tree(x_mid,x_high,y_mid,y_high); + quad_tree(x_mid,x_high,y_low,y_mid); } //! \brief Recursive Taylor, bivariate case template void Subdivision_2::get_range_RT_2( - const NT& x_low, const NT& x_high, const NT& y_low, const NT& y_high, - int depth, int index, Affine_form& res) + const NT& x_low, const NT& x_high, const NT& y_low, const NT& y_high, + int depth, int index, Affine_form& res) { - //std::cout << "range for [" << x_low << "; " << y_low << "]x[" << - //x_high << - //"; " << y_high << "]: (" << low << "; " << high << ")" << std::endl; - typename std::vector::const_iterator der_it = - mixed_derivatives.begin() + index; - if((*der_it).degree()==0) { - NT c = (*der_it).lcoeff().lcoeff(); - res = Affine_form(c,c); - return; - } else if((*der_it).degree()==1) { - Poly_1 p_x_low = NiX::substitute_x((*der_it), x_low), - p_x_high = NiX::substitute_x((*der_it), x_high); - NT eval_1 = p_x_low.evaluate(y_low), - eval_2 = p_x_low.evaluate(y_high), - eval_3 = p_x_high.evaluate(y_low), - eval_4 = p_x_high.evaluate(y_high); - NT min1 = eval_1, max1 = eval_2; - if(min1 > eval_2) { - min1 = eval_2; - max1 = eval_1; - } - NT min2 = eval_3, max2 = eval_4; - if(min2 > eval_4) { - min2 = eval_4; - max2 = eval_3; - } - if(min1 > min2) - min1 = min2; - if(max1 < max2) - max1 = max2; - res = Affine_form(min1,max1); - return; - } - - if(depth >= 4) - { - NT l, h; - std::vector x_forms; - const_iterator_2 it_2 = (*der_it).begin(); - while(it_2 != (*der_it).end()) - { - // it_2 - a poly in x_range - if((*it_2).is_zero()) - l = h = 0; - else - get_range_1(X_RANGE, x_low, x_high, *it_2, l, h); - x_forms.push_back(Affine_form(l, h)); - it_2++; - } - typename std::vector::const_iterator it = - x_forms.end()-1; - Affine_form y_form(y_low, y_high); - res = Affine_form(*it); - while((it--) != x_forms.begin()) - res = res * y_form + (*it); - //res.convert(lower, upper); - return; - } - - NT x0 = (x_low+x_high)/2, y0 = (y_low+y_high)/2, x1 = (x_high-x_low)/2, - y1 = (y_high-y_low)/2; - Affine_form one1(-1,1), one2(-1,1), one3(-1,1), - zero1(0,1), zero2(0,1), fxx, fxy, fyy; - NT eval_f = NiX::substitute_xy(*der_it, x0, y0), - eval_fx = NiX::substitute_xy(*(der_it+depth+1), x0, y0)*x1, - eval_fy = NiX::substitute_xy(*(der_it+depth+2), x0, y0)*y1; - res = eval_f + eval_fx*one1 + eval_fy*one2; - - int idx = index+2*depth+3; - if(idx < (int)mixed_derivatives.size()) { - get_range_RT_2(x_low, x_high, y_low, y_high, depth+2, idx, fxx); - get_range_RT_2(x_low, x_high, y_low, y_high, depth+2, idx+1, fxy); - get_range_RT_2(x_low, x_high, y_low, y_high, depth+2, idx+2, fyy); - res = res + ((x1*x1/2*zero1)*fxx) + ((y1*y1/2*zero2)*fyy) + - ((x1*y1*one3)*fxy); - } - - //res.convert(lower, upper); - //std::cout << "range for depth = " << depth << " index = " << index << - //" [" << lower << "; " << upper << "]" << std::endl; + //std::cout << "range for [" << x_low << "; " << y_low << "]x[" << + //x_high << + //"; " << y_high << "]: (" << low << "; " << high << ")" << std::endl; + typename std::vector::const_iterator der_it = + mixed_derivatives.begin() + index; + if((*der_it).degree()==0) { + NT c = (*der_it).lcoeff().lcoeff(); + res = Affine_form(c,c); + return; + } else if((*der_it).degree()==1) { + Poly_1 p_x_low = NiX::substitute_x((*der_it), x_low), + p_x_high = NiX::substitute_x((*der_it), x_high); + NT eval_1 = p_x_low.evaluate(y_low), + eval_2 = p_x_low.evaluate(y_high), + eval_3 = p_x_high.evaluate(y_low), + eval_4 = p_x_high.evaluate(y_high); + NT min1 = eval_1, max1 = eval_2; + if(min1 > eval_2) { + min1 = eval_2; + max1 = eval_1; + } + NT min2 = eval_3, max2 = eval_4; + if(min2 > eval_4) { + min2 = eval_4; + max2 = eval_3; + } + if(min1 > min2) + min1 = min2; + if(max1 < max2) + max1 = max2; + res = Affine_form(min1,max1); + return; + } + + if(depth >= 4) + { + NT l, h; + std::vector x_forms; + const_iterator_2 it_2 = (*der_it).begin(); + while(it_2 != (*der_it).end()) + { + // it_2 - a poly in x_range + if((*it_2).is_zero()) + l = h = 0; + else + get_range_1(X_RANGE, x_low, x_high, *it_2, l, h); + x_forms.push_back(Affine_form(l, h)); + it_2++; + } + typename std::vector::const_iterator it = + x_forms.end()-1; + Affine_form y_form(y_low, y_high); + res = Affine_form(*it); + while((it--) != x_forms.begin()) + res = res * y_form + (*it); + //res.convert(lower, upper); + return; + } + + NT x0 = (x_low+x_high)/2, y0 = (y_low+y_high)/2, x1 = (x_high-x_low)/2, + y1 = (y_high-y_low)/2; + Affine_form one1(-1,1), one2(-1,1), one3(-1,1), + zero1(0,1), zero2(0,1), fxx, fxy, fyy; + NT eval_f = NiX::substitute_xy(*der_it, x0, y0), + eval_fx = NiX::substitute_xy(*(der_it+depth+1), x0, y0)*x1, + eval_fy = NiX::substitute_xy(*(der_it+depth+2), x0, y0)*y1; + res = eval_f + eval_fx*one1 + eval_fy*one2; + + int idx = index+2*depth+3; + if(idx < (int)mixed_derivatives.size()) { + get_range_RT_2(x_low, x_high, y_low, y_high, depth+2, idx, fxx); + get_range_RT_2(x_low, x_high, y_low, y_high, depth+2, idx+1, fxy); + get_range_RT_2(x_low, x_high, y_low, y_high, depth+2, idx+2, fyy); + res = res + ((x1*x1/2*zero1)*fxx) + ((y1*y1/2*zero2)*fyy) + + ((x1*y1*one3)*fxy); + } + + //res.convert(lower, upper); + //std::cout << "range for depth = " << depth << " index = " << index << + //" [" << lower << "; " << upper << "]" << std::endl; } //! \brief computes the range of polynomial values \c f([lower,upper]) using //! Affine Arithmetic with Recursive Derivative information //! -//! \c var = \c X_RANGE: \c y is fixed - polynomial is given in \c x -//! coordinates, otherwise: \c x is fixed - polynomial is given in \c y -//! coordinates +//! \c var = \c X_RANGE: \c y is fixed - polynomial is given in \c x +//! coordinates, otherwise: \c x is fixed - polynomial is given in \c y +//! coordinates template -void Subdivision_2::get_range_AARD_1(int var, - const NT& l_, const NT& r_, const Poly_1& poly, NT& l1, NT& h1) +void Subdivision_2::get_range_AARD_1(int var, + const NT& l_, const NT& r_, const Poly_1& poly, NT& l1, NT& h1) { - Vector_2 *der = &der_y; - if(var == X_RANGE) - der = &der_x; - NT low, up, l(l_), r(r_); - const_iterator_2 der_it_2 = der->end()-1; - const_iterator_1 der_it, cache_it, begin; - if(poly.degree()==0) { - l1 = h1 = poly.lcoeff(); - return; - } - low = up = poly.lcoeff() * (*der_it_2).lcoeff(); - if(l > r) { - l = r_; - r = l_; - } - Affine_form f(l,r); - /*while((der_it_2--)!=der->begin()) { - // iterate through derivative coefficients - der_it = (*der_it_2).end()-1; - begin = (*der_it_2).begin(); - cache_it = poly.end()-1; // iterate through precomputed y-values - // if a derivative does not straddle zero we can - // calculate the exact boundaries for f(x) - if(low * up > 0) { - v1 = v2 = (*cache_it--) * (*der_it); - // calculate the ith derivative at xa and xb - while((der_it--)!=begin) { - v1 = v1 * l + (*cache_it) * (*der_it); - v2 = v2 * r + (*cache_it--) * (*der_it); - } - if(low < 0 && up < 0) { - v = v1; - v1 = v2; - v2 = v; - } - low = v1; - up = v2; - } else { // use affine arithmetic to compute bounds - Affine_form range(((*cache_it--) * (*der_it))); - // calculate the ith derivative using affine arithmetic - while((der_it--)!=begin) - range = (*cache_it--) * (*der_it) + (range * f); - range.convert(low,up); - } - } - if(low * up >= 0) { - Gfx_OUT << "+ " << std::endl; - v1 = evaluate(poly, l); - v2 = evaluate(poly, r); - //Gfx_OUT << "v1 = " << v1 << " v2 = " << v2 << std::endl; - if(low < 0 && up < 0) { - v = v1; - v1 = v2; - v2 = v; - } - low = v1; - up = v2; - } else */{ // use affine arithmetic to compute bounds - cache_it = poly.end()-1; - begin = poly.begin(); - Affine_form res(*cache_it); - while((cache_it--)!=begin) - res = (*cache_it) + (res * f); - res.convert(low,up); - } - l1 = low; - h1 = up; -//std::cout << "AARD bounds: [" << low << "; " << up << "]" << std::endl; + Vector_2 *der = &der_y; + if(var == X_RANGE) + der = &der_x; + NT low, up, l(l_), r(r_); + const_iterator_2 der_it_2 = der->end()-1; + const_iterator_1 der_it, cache_it, begin; + if(poly.degree()==0) { + l1 = h1 = poly.lcoeff(); + return; + } + low = up = poly.lcoeff() * (*der_it_2).lcoeff(); + if(l > r) { + l = r_; + r = l_; + } + Affine_form f(l,r); + /*while((der_it_2--)!=der->begin()) { + // iterate through derivative coefficients + der_it = (*der_it_2).end()-1; + begin = (*der_it_2).begin(); + cache_it = poly.end()-1; // iterate through precomputed y-values + // if a derivative does not straddle zero we can + // calculate the exact boundaries for f(x) + if(low * up > 0) { + v1 = v2 = (*cache_it--) * (*der_it); + // calculate the ith derivative at xa and xb + while((der_it--)!=begin) { + v1 = v1 * l + (*cache_it) * (*der_it); + v2 = v2 * r + (*cache_it--) * (*der_it); + } + if(low < 0 && up < 0) { + v = v1; + v1 = v2; + v2 = v; + } + low = v1; + up = v2; + } else { // use affine arithmetic to compute bounds + Affine_form range(((*cache_it--) * (*der_it))); + // calculate the ith derivative using affine arithmetic + while((der_it--)!=begin) + range = (*cache_it--) * (*der_it) + (range * f); + range.convert(low,up); + } + } + if(low * up >= 0) { + Gfx_OUT << "+ " << std::endl; + v1 = evaluate(poly, l); + v2 = evaluate(poly, r); + //Gfx_OUT << "v1 = " << v1 << " v2 = " << v2 << std::endl; + if(low < 0 && up < 0) { + v = v1; + v1 = v2; + v2 = v; + } + low = v1; + up = v2; + } else */{ // use affine arithmetic to compute bounds + cache_it = poly.end()-1; + begin = poly.begin(); + Affine_form res(*cache_it); + while((cache_it--)!=begin) + res = (*cache_it) + (res * f); + res.convert(low,up); + } + l1 = low; + h1 = up; +//std::cout << "AARD bounds: [" << low << "; " << up << "]" << std::endl; } //! \brief returns whether a polynomial has zero at a given interval, //! since we are not interested in concrete values //! -//! flag \t der_check forces to calculate boundaries for the first +//! flag \t der_check forces to calculate boundaries for the first //! derivative instead of function itself. Caching is used if //! appropriate template -void Subdivision_2::get_range_1(int var, - const NT& lower, const NT& upper, const Poly_1& poly, NT& l, NT& h) +void Subdivision_2::get_range_1(int var, + const NT& lower, const NT& upper, const Poly_1& poly, NT& l, NT& h) { - //std::cout << "range for: [" << lower << "; " << upper << "] poly: " << - //poly << std::endl; - get_range_AARD_1(var, lower, upper, poly, l, h); + //std::cout << "range for: [" << lower << "; " << upper << "] poly: " << + //poly << std::endl; + get_range_AARD_1(var, lower, upper, poly, l, h); } //! precomputes some initial data, necessary for subsequent computations template void Subdivision_2::precompute() { - Intern::Max_coeff max_coeff; - Coeff mx1 = max_coeff(input_poly); - Intern::Transform::From_rational, - typename SoX::Curve_renderer_traits::Make_exact> tr; - tr.max = Rational(mx1); - coeffs_y = tr(input_poly); - // x - outer variable, y - inner - coeffs_x = transpose_bivariate_polynomial(coeffs_y); - int degree_x = coeffs_x.degree(), - degree_y = coeffs_y.degree(); - der_x.clear(); - der_y.clear(); - int i, j; - max_deg = degree_x; - if(degree_y > max_deg) - max_deg = degree_y; - NT *X = new NT[max_deg]; - NT det(1.0); - std::cout << "start" << std::endl; - for(i = 0; i < degree_x; i++) { - if(i != 0) - det = X[0]; - for(j = 1; j <= degree_x - i; j++) - if(i == 0) - X[j-1] = j; - else { - X[j-1] = X[j] * j / det; // divide by the lowest coefficient ? - make_exact(X[j-1]); - } - der_x.push_back(Poly_1(X,(X + degree_x - i))); - } - for(i = 0; i < degree_y; i++) { - if(i != 0) - det = X[0]; - for(j = 1; j <= degree_y - i; j++) - if(i == 0) - X[j-1] = j; // divide by the lowest coefficient ? - else { - X[j-1] = X[j] * j / det; - make_exact(X[j-1]); - } - der_y.push_back(Poly_1(X,(X + degree_y - i))); - } - delete []X; - mixed_derivatives.clear(); - // f, fx, fy, fxx, fxy, fyy, fxxx, fxxy, fxyy, fyyy, ... - mixed_derivatives.push_back(coeffs_y); - int idx = 0; - for(i = 1; i <= max_deg; i++) - { - mixed_derivatives.push_back(NiX::diff_x(mixed_derivatives[idx])); - for(j = 0; j < i; j++) + Intern::Max_coeff max_coeff; + Coeff mx1 = max_coeff(input_poly); + Intern::Transform::From_rational, + typename SoX::Curve_renderer_traits::Make_exact> tr; + tr.max = Rational(mx1); + coeffs_y = tr(input_poly); + // x - outer variable, y - inner + coeffs_x = transpose_bivariate_polynomial(coeffs_y); + int degree_x = coeffs_x.degree(), + degree_y = coeffs_y.degree(); + der_x.clear(); + der_y.clear(); + int i, j; + max_deg = degree_x; + if(degree_y > max_deg) + max_deg = degree_y; + NT *X = new NT[max_deg]; + NT det(1.0); + std::cout << "start" << std::endl; + for(i = 0; i < degree_x; i++) { + if(i != 0) + det = X[0]; + for(j = 1; j <= degree_x - i; j++) + if(i == 0) + X[j-1] = j; + else { + X[j-1] = X[j] * j / det; // divide by the lowest coefficient ? + make_exact(X[j-1]); + } + der_x.push_back(Poly_1(X,(X + degree_x - i))); + } + for(i = 0; i < degree_y; i++) { + if(i != 0) + det = X[0]; + for(j = 1; j <= degree_y - i; j++) + if(i == 0) + X[j-1] = j; // divide by the lowest coefficient ? + else { + X[j-1] = X[j] * j / det; + make_exact(X[j-1]); + } + der_y.push_back(Poly_1(X,(X + degree_y - i))); + } + delete []X; + mixed_derivatives.clear(); + // f, fx, fy, fxx, fxy, fyy, fxxx, fxxy, fxyy, fyyy, ... + mixed_derivatives.push_back(coeffs_y); + int idx = 0; + for(i = 1; i <= max_deg; i++) + { + mixed_derivatives.push_back(NiX::diff_x(mixed_derivatives[idx])); + for(j = 0; j < i; j++) // compute fx^(i-j)y^(j), i.e. (i-j) times derivate by x; and j times // derivate by y - { - Poly_2 p = mixed_derivatives[idx+j]; - p.diff(); - mixed_derivatives.push_back(p); - } - idx += i; - } - std::cout << "finished" << std::endl; - polynomial_set = true; - /*typename std::vector::const_iterator der_it = - mixed_derivatives.end()-1; - for(i = max_deg; i >= 0; i--) - { - std::cout << i << "th mixed derivatives: " << std::endl; - for(j = 0; j < i+1; j++, der_it--) - std::cout << *der_it << std::endl; - }*/ + { + Poly_2 p = mixed_derivatives[idx+j]; + p.diff(); + mixed_derivatives.push_back(p); + } + idx += i; + } + std::cout << "finished" << std::endl; + polynomial_set = true; + /*typename std::vector::const_iterator der_it = + mixed_derivatives.end()-1; + for(i = max_deg; i >= 0; i--) + { + std::cout << i << "th mixed derivatives: " << std::endl; + for(j = 0; j < i+1; j++, der_it--) + std::cout << *der_it << std::endl; + }*/ } } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h index bb87ecf28e51..3db023b54fb5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2008, 2010 Max-Planck-Institute Saarbruecken (Germany), +// Copyright (c) 2004-2008, 2010 Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) @@ -15,7 +15,7 @@ /*!\file include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h * \brief defines dummy implementations satisfying Curve_kernel_2 - * concept requirenments + * concept requirenments */ #include @@ -44,7 +44,7 @@ struct Curve_2_model_rep { Curve_2_model_rep() : i_(0) { } - + Curve_2_model_rep(int i) : i_(i) { } @@ -55,7 +55,7 @@ struct Curve_2_model : typedef Curve_2_model_rep Rep; typedef ::CGAL::Handle_with_policy< Rep > Base; - + typedef CGAL::Algebraic_kernel_d_1< CGAL::Arithmetic_kernel::Integer > AK_1; typedef AK_1::Algebraic_real_1 Algebraic_real_1; @@ -63,11 +63,11 @@ struct Curve_2_model : typedef double Bound; typedef int Coefficient; - + typedef CGAL::Polynomial< CGAL::Polynomial < int > > Poly_d; typedef CGAL::Handle_id_less_than< Curve_2_model > Less_than; - + // for total_degree (find smaller curve if two are available) Poly_d f() const { return ptr()->f_; @@ -85,7 +85,7 @@ struct Curve_2_model : return Bound(0); } - Algebraic_real_1 y_at(Bound r, int arcno){ + Algebraic_real_1 y_at(Bound r, int arcno){ return Algebraic_real_1(); } @@ -102,7 +102,7 @@ struct Curve_2_model : static bool decompose(Curve_2_model f, Curve_2_model g, OutputIterator parts_of_f, OutputIterator parts_of_g) { - return true; + return true; } bool operator== (const Curve_2_model& c) { @@ -127,14 +127,14 @@ template < class Curve_ > struct Curve_pair_2_model_rep { typedef Curve_ Curve; - + typedef Curve Algebraic_curve_2; //typedef SoX::Event2_slice< Curve_pair_2< Curve > > Event2_slice; - + Curve c1_; Curve c2_; - + // DefaultConstructible Curve_pair_2_model_rep() : c1_(), c2_() { @@ -143,14 +143,14 @@ struct Curve_pair_2_model_rep { Curve_pair_2_model_rep(Curve c1, Curve c2) : c1_(c1), c2_(c2) { } - + std::vector< int > slices_; }; template < class Curve_ > -struct Curve_pair_2_model : +struct Curve_pair_2_model : public ::CGAL::Handle_with_policy< Curve_pair_2_model_rep< Curve_ > > { - + typedef Curve_ Curve; typedef Curve Algebraic_curve_2; @@ -166,7 +166,7 @@ struct Curve_pair_2_model : }; // Assignable - + // Constructable from two curves Curve_pair_2_model(Curve c1, Curve c2) : Base(Rep(c1, c2)) { @@ -188,7 +188,7 @@ struct Curve_pair_2_model : return -1; } - void x_to_index(typename Algebraic_curve_2::Algebraic_real_1 x, + void x_to_index(typename Algebraic_curve_2::Algebraic_real_1 x, int& idx, bool& event) const { return; } @@ -209,24 +209,24 @@ class Xy_coordinate_2_rep { // myself typedef Xy_coordinate_2_rep Self; - typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 - Curve_analysis_2; - - typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; + typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 + Curve_analysis_2; + + typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; // constructors public: // default constructor () Xy_coordinate_2_rep() { } - + // data // x-coordinate Algebraic_real_1 _m_x; - + // supporting curve mutable Curve_analysis_2 _m_curve; - + // arc number on curve mutable int _m_arcno; @@ -235,26 +235,26 @@ class Xy_coordinate_2_rep { }; template -class Xy_coordinate_2 : +class Xy_coordinate_2 : public ::CGAL::Handle_with_policy > { public: //! \name public typedefs //!@{ - + //! this instance's first template parameter typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2; - + //! this instance's second template parameter typedef Xy_coordinate_2_rep Rep; - + //! this instance itself typedef Xy_coordinate_2 Self; - + //! type of an algabraic curve - typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 - Curve_analysis_2; + typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 + Curve_analysis_2; //! type of Algebraic_real_1 typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; @@ -274,23 +274,23 @@ class Xy_coordinate_2 : //!@{ Xy_coordinate_2() : - Base(Rep()) { + Base(Rep()) { } Xy_coordinate_2(const Self& p) : - Base(static_cast(p)) { + Base(static_cast(p)) { } Xy_coordinate_2(const Algebraic_real_1&, const Curve_analysis_2&, int) : Base(Rep()) { } - + Xy_coordinate_2(Rep rep) : - Base(rep) { + Base(rep) { } - + public: - + const Algebraic_real_1& x() const { return this->ptr()->_m_x; } @@ -298,13 +298,13 @@ class Xy_coordinate_2 : Algebraic_real_1 y() const { return this->ptr()->_m_x; } - + Curve_analysis_2 curve() const { - return this->ptr()->_m_curve; + return this->ptr()->_m_curve; } - + int arcno() const { - return -1; + return -1; } //!@} @@ -320,10 +320,10 @@ class Xy_coordinate_2 : bool equal_x = false) const { return CGAL::ZERO; } - + //! equality bool operator == (const Self& q) const {return false;} - + //! inequality bool operator != (const Self& q) const {return false;} @@ -338,7 +338,7 @@ class Xy_coordinate_2 : //! greater-equal in (x,y) lexicographic order bool operator >= (const Self& q) const {return false;} - + public: bool is_x_zero() const { @@ -348,7 +348,7 @@ class Xy_coordinate_2 : bool is_y_zero() const { return false; } - + std::pair to_double() const { return std::make_pair(0.0, 0.0); } @@ -360,22 +360,22 @@ class Xy_coordinate_2 : Bound_interval get_approximation_y() const { return Bound_interval(0.0, 0.0); } - + void refine_x() const { } - + void refine_x(int rel_prec) { } void refine_y() const { } - + //!@} }; // class Xy_coordinate_2 -template < class AlgebraicCurveKernel_2> -std::ostream& operator<< (std::ostream& os, +template < class AlgebraicCurveKernel_2> +std::ostream& operator<< (std::ostream& os, const Xy_coordinate_2& pt) { return os; } @@ -396,7 +396,7 @@ class Status_line_CA_1_rep { // type of x-coordinate typedef typename Curve_analysis_2::Algebraic_real_1 - Algebraic_real_1; + Algebraic_real_1; // an instance of a size type typedef typename Curve_analysis_2::size_type size_type; @@ -404,9 +404,9 @@ class Status_line_CA_1_rep { // constructors public: // default constructor () - Status_line_CA_1_rep() + Status_line_CA_1_rep() { } - + //! x-coordinate of event info mutable Algebraic_real_1 _m_x; @@ -415,8 +415,8 @@ class Status_line_CA_1_rep { size_type _m_index; //! underlying curve analysis - Curve_analysis_2 _m_ca; - + Curve_analysis_2 _m_ca; + // befriending the handle friend class Status_line_CA_1; }; @@ -432,7 +432,7 @@ class Status_line_CA_1 //! this instance's first template parameter //! model of AlgebraicKernel_d_2::CurveAnalysis_2 typedef CurveAnalysis_2 Curve_analysis_2; - + //! this instance's second template parameter typedef Status_line_CA_1_rep Rep; @@ -440,7 +440,7 @@ class Status_line_CA_1 typedef Status_line_CA_1 Self; //! type of x-coordinate - typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; + typedef typename Curve_analysis_2::Algebraic_real_1 Algebraic_real_1; typedef typename Curve_analysis_2::Xy_coordinate_2 Xy_coordinate_2; @@ -451,7 +451,7 @@ class Status_line_CA_1 //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //!@} public: //!\name constructors @@ -460,38 +460,38 @@ class Status_line_CA_1 /*!\brief * Default constructor */ - Status_line_CA_1() : - Base(Rep()) { + Status_line_CA_1() : + Base(Rep()) { } /*!\brief * copy constructor */ - Status_line_CA_1(const Self& p) : - Base(static_cast(p)) { + Status_line_CA_1(const Self& p) : + Base(static_cast(p)) { } /*!\brief * constructs from a given represenation */ - Status_line_CA_1(Rep rep) : - Base(rep) { + Status_line_CA_1(Rep rep) : + Base(rep) { } - + //!@} - + Algebraic_real_1 x() const { return Algebraic_real_1(); } - + Curve_analysis_2 curve_analysis_2() const { return Curve_analysis_2(); } - + size_type index() const { return static_cast(0); } - + bool covers_line() const { return false; } @@ -511,7 +511,7 @@ class Status_line_CA_1 Xy_coordinate_2 algebraic_real_2(size_type j) const { return Xy_coordinate_2(); } - + Xy_coordinate_2 xy_coordinate_2(size_type j) const { return algebraic_real_2(j); } @@ -527,7 +527,7 @@ class Status_line_CA_1 Arc_pair number_of_branches_approaching_plus_infinity() const { return Arc_pair(0, 0); } - + }; // class Status_line_CA_1 template @@ -557,19 +557,19 @@ class Curve_analysis_2_rep { // constructors public: // default constructor () - Curve_analysis_2_rep() + Curve_analysis_2_rep() { } - + // standard constructor Curve_analysis_2_rep(const Polynomial_2& curve) { } mutable Polynomial_2 _m_curve; - + // befriending the handle friend class Curve_analysis_2; }; - + template class Curve_analysis_2 : public ::CGAL::Handle_with_policy< @@ -583,7 +583,7 @@ class Curve_analysis_2 : //! this instance's second template parameter typedef Curve_analysis_2_rep Rep; - + //! x-coordinate type typedef typename Algebraic_curve_kernel_2::Algebraic_real_1 Algebraic_real_1; @@ -601,39 +601,39 @@ class Curve_analysis_2 : //! type of a vertical line typedef internal::Status_line_CA_1 Status_line_1; - + //! the handle superclass typedef ::CGAL::Handle_with_policy Base; - + //!@} public: //!\name Constructors //!@{ //! \brief default constructor - Curve_analysis_2() : - Base(Rep()) { + Curve_analysis_2() : + Base(Rep()) { } /*!\brief * copy constructor */ - Curve_analysis_2(const Self& p) : - Base(static_cast(p)) { + Curve_analysis_2(const Self& p) : + Base(static_cast(p)) { } //! \brief constructs a curve analysis from a given \c Curve_2 object //! //! for safety purposes implicit conversion from \c Curve_2 is disabled - explicit Curve_analysis_2(const Polynomial_2& c) : - Base(Rep(c)) { + explicit Curve_analysis_2(const Polynomial_2& c) : + Base(Rep(c)) { } - + /*!\brief * constructsa curve analysis from a given represenation */ - Curve_analysis_2(Rep rep) : - Base(rep) { + Curve_analysis_2(Rep rep) : + Base(rep) { } //!@} @@ -648,7 +648,7 @@ class Curve_analysis_2 : //! \brief alias for \c polynomial_2() Polynomial_2 curve_2() const - { + { return polynomial_2(); } @@ -673,7 +673,7 @@ class Curve_analysis_2 : Status_line_1 status_line_at_exact_x(Algebraic_real_1 x) const { return Status_line_1(); } - + /*!\brief * returns a \c CGAL::Object that encodes the asymptotic value of a * curve-arc approaching the left or the right boundary \c loc of the @@ -687,7 +687,7 @@ class Curve_analysis_2 : * * \pre \c loc is either \c CGAL::ARR_LEFT_BOUNDARY or * \c CGAL::ARR_RIGHT_BOUNDARY - */ + */ CGAL::Object asymptotic_value_of_arc(CGAL::Arr_parameter_space loc, size_type arcno) const { @@ -700,11 +700,11 @@ class Curve_analysis_2 : ////////////////////////////////////////////////////////////////////////////// -template < class CurvePairAnalysis_2, class Rep_ > +template < class CurvePairAnalysis_2, class Rep_ > class Status_line_CPA_1; template -std::ostream& operator<< (std::ostream&, +std::ostream& operator<< (std::ostream&, const Status_line_CPA_1&); template < class CurvePairAnalysis_2 > @@ -722,20 +722,20 @@ class Status_line_CPA_1_rep { // constructors public: // default constructor () - Status_line_CPA_1_rep() + Status_line_CPA_1_rep() { } // stores this status line interval or event index of a curve pair size_type _m_index; - + // befriending the handle friend class Status_line_CPA_1; }; template > -class Status_line_CPA_1 : - public ::CGAL::Handle_with_policy< Rep_ > +class Status_line_CPA_1 : + public ::CGAL::Handle_with_policy< Rep_ > { public: //!@{ @@ -743,7 +743,7 @@ class Status_line_CPA_1 : //! this instance's first template parameter typedef CurvePairAnalysis_2 Curve_pair_analysis_2; - + //! this instance's second template parameter typedef Rep_ Rep; @@ -751,7 +751,7 @@ class Status_line_CPA_1 : typedef Status_line_CPA_1 Self; //! type of x-coordinate - typedef typename Curve_pair_analysis_2::Algebraic_real_1 Algebraic_real_1; + typedef typename Curve_pair_analysis_2::Algebraic_real_1 Algebraic_real_1; //! an instance of a size type typedef typename Curve_pair_analysis_2::size_type size_type; @@ -761,36 +761,36 @@ class Status_line_CPA_1 : //! the handle superclass typedef ::CGAL::Handle_with_policy< Rep > Base; - + //!@} public: //!\name constructors //!@{ Status_line_CPA_1() : - Base(Rep()) { + Base(Rep()) { } Status_line_CPA_1(const Self& p) : - Base(static_cast(p)) { + Base(static_cast(p)) { } - + /*!\brief * constructs from a given represenation */ - Status_line_CPA_1(Rep rep) : - Base(rep) { + Status_line_CPA_1(Rep rep) : + Base(rep) { } - + Algebraic_real_1 x() const { return Algebraic_real_1(); } - + //! returns this vertical line's index (event or interval index) size_type index() const { return this->ptr()->_m_index; } - + size_type number_of_events() const { return static_cast(0); } @@ -814,20 +814,20 @@ class Status_line_CPA_1 : bool is_intersection() const { return false; } - + //!@} }; // class Status_line_CPA_1 template std::ostream& operator<< (std::ostream& os, const internal::Status_line_CPA_1& cpv_line) { - + return os; } /////////////////////////////////////////////////////////////////////////////// -template < class AlgebraicCurveKernel_2, class Rep_ > +template < class AlgebraicCurveKernel_2, class Rep_ > class Curve_pair_analysis_2; template < class AlgebraicCurveKernel_2 > @@ -847,19 +847,19 @@ class Curve_pair_analysis_2_rep { // constructors public: // default constructor () - Curve_pair_analysis_2_rep() + Curve_pair_analysis_2_rep() { } // data Curve_analysis_2 _m_ca1, _m_ca2; - + // befriending the handle friend class Curve_pair_analysis_2; }; - + template > -class Curve_pair_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > +class Curve_pair_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { public: //!@{ @@ -878,7 +878,7 @@ class Curve_pair_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > typedef typename Algebraic_curve_kernel_2::Xy_coordinate_2 Xy_coordinate_2; //! type of 1-curve analysis - typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 + typedef typename Algebraic_curve_kernel_2::Curve_analysis_2 Curve_analysis_2; //! an instance of a size type @@ -889,7 +889,7 @@ class Curve_pair_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > //! type of a vertical line typedef internal::Status_line_CPA_1 Status_line_1; - + //! the handle superclass typedef ::CGAL::Handle_with_policy Base; @@ -899,24 +899,24 @@ class Curve_pair_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > //!@{ //! \brief default constructor - Curve_pair_analysis_2() : - Base(Rep()) { + Curve_pair_analysis_2() : + Base(Rep()) { } /*!\brief * copy constructor */ - Curve_pair_analysis_2(const Self& p) : - Base(static_cast(p)) { + Curve_pair_analysis_2(const Self& p) : + Base(static_cast(p)) { } Curve_pair_analysis_2(const Curve_analysis_2& ca1, - const Curve_analysis_2& ca2) : - Base(Rep()) { + const Curve_analysis_2& ca2) : + Base(Rep()) { } - + Curve_pair_analysis_2(Rep rep) : - Base(rep) { + Base(rep) { } Curve_analysis_2 curve_analysis(bool c) const { @@ -979,7 +979,7 @@ class Simple_algebraic_kernel_2 { //! type of internal x_coordinate typedef Internal_curve_2::Algebraic_real_1 Internal_x_coordinate; - + //! type of internal coefficient typedef Internal_curve_2::Coefficient Internal_coefficient; @@ -987,10 +987,10 @@ class Simple_algebraic_kernel_2 { public: //! \name types and functors for \c ACK_2< > //!@{ - + //! myself typedef Simple_algebraic_kernel_2 Self; - + //! univariate polynomial type typedef CGAL::Polynomial Polynomial_1; @@ -1005,7 +1005,7 @@ class Simple_algebraic_kernel_2 { //! type of Bound typedef Internal_curve_2::Bound Bound; - + //! type of Coordinate_1 typedef Algebraic_real_1 Coordinate_1; @@ -1017,38 +1017,38 @@ class Simple_algebraic_kernel_2 { public: //! \name types and functors for \c GPA_2< both > //!@{ - + //! type of 1-curve analysis - typedef internal::Curve_analysis_2 Curve_analysis_2; + typedef internal::Curve_analysis_2 Curve_analysis_2; //! type of 2-curve analysis - typedef internal::Curve_pair_analysis_2 Curve_pair_analysis_2; - + typedef internal::Curve_pair_analysis_2 Curve_pair_analysis_2; + //!@} //! \name public functors and predicates //!@{ - + //! \brief default constructor - Simple_algebraic_kernel_2() + Simple_algebraic_kernel_2() { } - + //! \brief constructs \c Curve_analysis_2 object, uses caching if appropriate struct Construct_curve_2 : public CGAL::cpp98::unary_function< Polynomial_2, Curve_analysis_2 > { //! \brief constructs an object from \c Algebraic_curve_kernel_2 type //! no default constructor provided - Construct_curve_2(/*Self *pkernel_2*/) + Construct_curve_2(/*Self *pkernel_2*/) { } - + Curve_analysis_2 operator()(const Polynomial_2& f) const { return Curve_analysis_2(); } }; CGAL_Algebraic_Kernel_cons(Construct_curve_2, construct_curve_2_object); - + /*! \brief * constructs \c Curve_pair_analysis_2 from pair of 1-curve analysis, * caching is used when appropriate @@ -1056,148 +1056,148 @@ class Simple_algebraic_kernel_2 { struct Construct_curve_pair_2 : public CGAL::cpp98::binary_function { - + Curve_pair_analysis_2 operator() (const Curve_analysis_2& ca1, const Curve_analysis_2& ca2) const { - + Curve_pair_analysis_2 cpa_2(ca1,ca2); return cpa_2; } }; CGAL_Algebraic_Kernel_cons(Construct_curve_pair_2, construct_curve_pair_2_object); - - //! type of a curve point + + //! type of a curve point typedef internal::Xy_coordinate_2 Xy_coordinate_2; - + //! returns the first coordinate of \c Xy_coordinate_2 struct Get_x_2 : public CGAL::cpp98::unary_function { - + Algebraic_real_1 operator()(const Xy_coordinate_2& xy) const { return xy.x(); } }; CGAL_Algebraic_Kernel_cons(Get_x_2, Get_x_2_object); - + //! returns the second coordinate of \c Xy_coordinate_2 struct Get_y_2 : public CGAL::cpp98::unary_function { - + Algebraic_real_1 operator()(const Xy_coordinate_2& xy) const { return xy.y(); } }; CGAL_Algebraic_Kernel_cons(Get_y_2, Get_y_2_object); - + struct Refine_x_2 : public CGAL::cpp98::unary_function { - + void operator()(const Xy_coordinate_2& r) const { } - + void operator()(Xy_coordinate_2& r, int rel_prec) const { } }; CGAL_Algebraic_Kernel_pred(Refine_x_2, refine_x_2_object); - + struct Refine_y_2 : public CGAL::cpp98::unary_function { - + void operator()(const Xy_coordinate_2& r) const { } - + void operator()(Xy_coordinate_2& r, int rel_prec) const { } }; CGAL_Algebraic_Kernel_pred(Refine_y_2, refine_y_2_object); - + //! computes the current lower boundary of the first coordinate of \c r struct Lower_boundary_x_2 { - + typedef Xy_coordinate_2 agrument_type; typedef Bound result_type; - + result_type operator()(const Xy_coordinate_2& r) { - return static_cast(0); + return static_cast(0); } }; CGAL_Algebraic_Kernel_cons(Lower_boundary_x_2, lower_boundary_x_2_object); - + //! computes the current upper boundary of the first coordinate of \c r struct Upper_boundary_x_2 { - + typedef Xy_coordinate_2 agrument_type; typedef Bound result_type; - + result_type operator()(const Xy_coordinate_2& r) { - return static_cast(0); + return static_cast(0); } }; CGAL_Algebraic_Kernel_cons(Upper_boundary_x_2, upper_boundary_x_2_object); - + //! computes the current lower boundary of the second coordinate of \c r struct Lower_boundary_y_2 { - + typedef Xy_coordinate_2 agrument_type; typedef Bound result_type; - + result_type operator()(const Xy_coordinate_2& r) { - return static_cast(0); + return static_cast(0); } }; CGAL_Algebraic_Kernel_cons(Lower_boundary_y_2, lower_boundary_y_2_object); - + //! computes the current lower boundary of the second coordinate of \c r struct Upper_boundary_y_2 { - + typedef Xy_coordinate_2 agrument_type; typedef Bound result_type; - + result_type operator()(const Xy_coordinate_2& r) { - return static_cast(0); + return static_cast(0); } }; CGAL_Algebraic_Kernel_cons(Upper_boundary_y_2, upper_boundary_y_2_object); - + //! returns the number of boundary type in-between x-coordinates of two //! Xy_coordinate_2 objects struct Bound_between_x_2 { - + typedef Xy_coordinate_2 first_agrument_type; typedef Xy_coordinate_2 second_agrument_type; typedef Bound result_type; - - result_type operator()(const Xy_coordinate_2& r1, + + result_type operator()(const Xy_coordinate_2& r1, const Xy_coordinate_2& r2) const { - return static_cast(0); + return static_cast(0); } }; - CGAL_Algebraic_Kernel_cons(Bound_between_x_2, + CGAL_Algebraic_Kernel_cons(Bound_between_x_2, boundary_between_x_2_object); - + //! returns the number of boundary type in-between y-coordinates of two //! Xy_coordinate_2 objects struct Bound_between_y_2 { - + typedef Xy_coordinate_2 first_agrument_type; typedef Xy_coordinate_2 second_agrument_type; typedef Bound result_type; - - result_type operator()(const Xy_coordinate_2& r1, + + result_type operator()(const Xy_coordinate_2& r1, const Xy_coordinate_2& r2) const { - return static_cast(0); + return static_cast(0); } }; - CGAL_Algebraic_Kernel_cons(Bound_between_y_2, + CGAL_Algebraic_Kernel_cons(Bound_between_y_2, boundary_between_y_2_object); - - //! \brief comparison of x-coordinates + + //! \brief comparison of x-coordinates struct Compare_x_2 : public CGAL::cpp98::binary_function { - Comparison_result operator()(const Algebraic_real_1& x1, + Comparison_result operator()(const Algebraic_real_1& x1, const Algebraic_real_1& x2) const { return CGAL::EQUAL; } - Comparison_result operator()(const Xy_coordinate_2& xy1, + Comparison_result operator()(const Xy_coordinate_2& xy1, const Xy_coordinate_2& xy2) const { return CGAL::EQUAL; } @@ -1208,24 +1208,24 @@ class Simple_algebraic_kernel_2 { struct Compare_y_2 : public CGAL::cpp98::binary_function< Xy_coordinate_2, Xy_coordinate_2, Comparison_result > { - - Comparison_result operator()(const Xy_coordinate_2& xy1, + + Comparison_result operator()(const Xy_coordinate_2& xy1, const Xy_coordinate_2& xy2) const { return CGAL::EQUAL; } }; CGAL_Algebraic_Kernel_pred(Compare_y_2, compare_y_2_object); - + //! lexicographical comparison of two objects of type \c Xy_coordinate_2 //! //! \c equal_x specifies that only y-coordinates need to be compared struct Compare_xy_2 : public CGAL::cpp98::binary_function + Comparison_result > { - Comparison_result operator()(const Xy_coordinate_2& xy1, + Comparison_result operator()(const Xy_coordinate_2& xy1, const Xy_coordinate_2& xy2, bool equal_x = false) const { - + return CGAL::EQUAL; } }; @@ -1234,7 +1234,7 @@ class Simple_algebraic_kernel_2 { //! \brief checks whether curve has only finitely many self-intersection //! points, i.e., it has no self-overlapped continuous parts //! - //! for algerbaic curves this means that supporting polynomial is + //! for algerbaic curves this means that supporting polynomial is //! square-free struct Has_finite_number_of_self_intersections_2 : public CGAL::cpp98::unary_function< Polynomial_2, bool > { @@ -1243,9 +1243,9 @@ class Simple_algebraic_kernel_2 { return true; //is_square_free(p); } }; - CGAL_Algebraic_Kernel_pred(Has_finite_number_of_self_intersections_2, + CGAL_Algebraic_Kernel_pred(Has_finite_number_of_self_intersections_2, has_finite_number_of_self_intersections_2_object); - + //! \brief checks whether a curve pair has finitely many intersections, //! in other words, whether two curves have no continuous common part //! @@ -1253,20 +1253,20 @@ class Simple_algebraic_kernel_2 { //! coprime struct Has_finite_number_of_intersections_2 : public CGAL::cpp98::binary_function< Curve_analysis_2, Curve_analysis_2, bool > { - - bool operator()(const Curve_analysis_2& c1, + + bool operator()(const Curve_analysis_2& c1, const Curve_analysis_2& c2) const { return true; } }; - CGAL_Algebraic_Kernel_pred(Has_finite_number_of_intersections_2, + CGAL_Algebraic_Kernel_pred(Has_finite_number_of_intersections_2, has_finite_number_of_intersections_2_object); - + //! set of various curve and curve pair decomposition functions struct Decompose_2 { - + //! default constructor - Decompose_2(/*Self *pkernel_2*/) + Decompose_2(/*Self *pkernel_2*/) { } Polynomial_2 operator()(const Polynomial_2& p) { @@ -1274,17 +1274,17 @@ class Simple_algebraic_kernel_2 { } template< class OutputIterator1, class OutputIterator2 > - int operator()( const Curve_analysis_2& c, OutputIterator1 fit, + int operator()( const Curve_analysis_2& c, OutputIterator1 fit, OutputIterator2 mit ) const { - + return 0; } - + template < class OutputIterator > - bool operator()(const Curve_analysis_2& c1, + bool operator()(const Curve_analysis_2& c1, const Curve_analysis_2& c2, OutputIterator oi1, OutputIterator oi2, OutputIterator oib) { - + return false; } private: @@ -1292,12 +1292,12 @@ class Simple_algebraic_kernel_2 { /*Self *_m_pkernel_2; */ }; CGAL_Algebraic_Kernel_cons(Decompose_2, decompose_2_object); - + //!@} public: //! \name types and functors for \c GPA_2 //!@{ - + typedef Construct_curve_2 Construct_polynomial_2_; typedef Has_finite_number_of_self_intersections_2 Is_square_free_2; @@ -1306,11 +1306,11 @@ class Simple_algebraic_kernel_2 { typedef Decompose_2 Make_square_free_2; typedef Decompose_2 Square_free_factorize; typedef Decompose_2 Make_coprime_2; - + //! \brief computes the derivative w.r.t. the first (innermost) variable - struct Derivative_x_2 : + struct Derivative_x_2 : public CGAL::cpp98::unary_function< Polynomial_2, Polynomial_2 > { - + Polynomial_2 operator()(const Polynomial_2& p) const { return p; } @@ -1320,7 +1320,7 @@ class Simple_algebraic_kernel_2 { //! \brief computes the derivative w.r.t. the first (outermost) variable struct Derivative_y_2 : public CGAL::cpp98::unary_function< Polynomial_2, Polynomial_2 > { - + Polynomial_2 operator()(const Polynomial_2& p) const { return p; } @@ -1328,13 +1328,13 @@ class Simple_algebraic_kernel_2 { CGAL_Algebraic_Kernel_cons(Derivative_y_2, derivative_y_2_object); struct X_critical_points_2 { - + template - OutputIterator operator()(const Polynomial_2& p, + OutputIterator operator()(const Polynomial_2& p, OutputIterator oi) const { return oi; } - + //! \brief computes the ith x-critical point of polynomial \c p Xy_coordinate_2 operator()(const Polynomial_2& p, int i) const { return Xy_coordinate_2(); @@ -1342,17 +1342,17 @@ class Simple_algebraic_kernel_2 { }; CGAL_Algebraic_Kernel_cons(X_critical_points_2, x_critical_points_2_object); - + struct Y_critical_points_2 { - + //! \brief copies in the output iterator the y-critical points of //! polynomial \c p as objects of type \c Xy_coordinate_2 template - OutputIterator operator()(const Polynomial_2& p, + OutputIterator operator()(const Polynomial_2& p, OutputIterator oi) const { return oi; } - + //! \brief computes the ith y-critical point of polynomial \c p Xy_coordinate_2 operator()(const Polynomial_2& p, int i) const { return Xy_coordinate_2(); @@ -1361,8 +1361,8 @@ class Simple_algebraic_kernel_2 { CGAL_Algebraic_Kernel_cons(Y_critical_points_2, y_critical_points_2_object); - /*!\brief - * computes the sign of a bivariate polynomial \c p evaluated at the root + /*!\brief + * computes the sign of a bivariate polynomial \c p evaluated at the root * \c r of a system of two bivariate polynomial equations * * returns a value convertible to \c CGAL::Sign @@ -1378,7 +1378,7 @@ class Simple_algebraic_kernel_2 { CGAL_Algebraic_Kernel_pred(Sign_at_2, sign_at_2_object); struct Solve_2 { - + template std::pair operator()(const Polynomial_2& p1, const Polynomial_2& p2, @@ -1389,11 +1389,11 @@ class Simple_algebraic_kernel_2 { }; CGAL_Algebraic_Kernel_cons(Solve_2, solve_2_object); -#undef CGAL_Algebraic_Kernel_pred -#undef CGAL_Algebraic_Kernel_cons - +#undef CGAL_Algebraic_Kernel_pred +#undef CGAL_Algebraic_Kernel_cons + //!@} - + }; // class Algebraic_curve_kernel_2 } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h index 823327b7686d..d9337e2805f1 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Michal Meyerovitch and Ester Ezra) @@ -50,20 +50,20 @@ class Arr_text_formatter typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; - + protected: typedef typename Dcel::Vertex DVertex; typedef typename Dcel::Halfedge DHalfedge; typedef typename Dcel::Face DFace; - + // Data members: std::ostream* m_out; IO::Mode m_old_out_mode; std::istream* m_in; IO::Mode m_old_in_mode; -public: +public: /*! Default constructor.*/ Arr_text_formatter(): @@ -134,7 +134,7 @@ class Arr_text_formatter /*! Write a labeled size value. */ void write_size(const char *label, Size size) - { + { _write_comment(label); out() << size << '\n'; } @@ -185,7 +185,7 @@ class Arr_text_formatter { out() << std::endl; } - + virtual void write_point(const Point_2& p) { out() << p; @@ -250,7 +250,7 @@ class Arr_text_formatter void write_ccb_halfedges_begin() {} - + void write_ccb_halfedges_end() { out() << std::endl; @@ -274,7 +274,7 @@ class Arr_text_formatter //@{ /*! Start reading an arrangement. */ - void read_arrangement_begin() + void read_arrangement_begin() { CGAL_assertion(m_in != nullptr); m_old_in_mode = get_mode(*m_in); @@ -283,7 +283,7 @@ class Arr_text_formatter } /*! Read the arrangement edge. */ - void read_arrangement_end() + void read_arrangement_end() { _skip_comments(); set_mode(*m_in, m_old_in_mode); @@ -339,11 +339,11 @@ class Arr_text_formatter //@{ void read_vertex_begin() {} - + void read_vertex_end() {} - virtual void read_point(Point_2& p) + virtual void read_point(Point_2& p) { in() >> p; _skip_until_EOL(); @@ -357,18 +357,18 @@ class Arr_text_formatter //@{ void read_edge_begin() {} - + void read_edge_end() {} - - int read_vertex_index() + + int read_vertex_index() { int val = 0; in() >> val; return (val); } - virtual void read_x_monotone_curve(X_monotone_curve_2& cv) + virtual void read_x_monotone_curve(X_monotone_curve_2& cv) { in() >> cv; _skip_until_EOL(); @@ -376,7 +376,7 @@ class Arr_text_formatter virtual void read_halfedge_data(Halfedge_handle) {} - + //@} /// \name Reading a face. //@{ @@ -384,7 +384,7 @@ class Arr_text_formatter { _skip_comments(); } - + void read_face_end() { _skip_comments(); @@ -392,12 +392,12 @@ class Arr_text_formatter void read_outer_ccbs_begin() {} - + void read_outer_ccbs_end() {} int read_halfedge_index() - { + { int val = 0; in() >> val; return (val); @@ -405,22 +405,22 @@ class Arr_text_formatter void read_inner_ccbs_begin() {} - + void read_inner_ccbs_end() {} void read_ccb_halfedges_begin() {} - - void read_ccb_halfedges_end() + + void read_ccb_halfedges_end() { _skip_until_EOL(); } void read_isolated_vertices_begin() {} - - void read_isolated_vertices_end() + + void read_isolated_vertices_end() { _skip_until_EOL(); } @@ -438,16 +438,16 @@ class Arr_text_formatter } /*! Skip until end of line. */ - void _skip_until_EOL() + void _skip_until_EOL() { CGAL_assertion(m_in != nullptr); int c; while ((c = m_in->get()) != EOF && c != '\n') {}; } - + /*! Skip comment lines. */ - void _skip_comments() + void _skip_comments() { CGAL_assertion(m_in != nullptr); @@ -466,11 +466,22 @@ class Arr_text_formatter c = m_in->get(); } } + else + if (c == '\n') + { + c = m_in->get(); + if ( c!= '#') + { + m_in->putback(c); + return; + } + } // Skip comment lines that begin with a '#' character. while (c != EOF && c == '#') { - _skip_until_EOL(); + if (c != '\n') + _skip_until_EOL(); c = m_in->get(); } m_in->putback(c); @@ -525,7 +536,7 @@ class Arr_face_extended_text_formatter : { this->out() << f->data() << '\n'; } - + /*! Read a face-data object and attach it to the given face. */ virtual void read_face_data(Face_handle f) { @@ -581,7 +592,7 @@ class Arr_extended_dcel_text_formatter : { this->out() << '\n' << v->data(); } - + /*! Read a vertex-data object and attach it to the given vertex. */ virtual void read_vertex_data(Vertex_handle v) { @@ -594,7 +605,7 @@ class Arr_extended_dcel_text_formatter : { this->out() << '\n' << he->data(); } - + /*! Read a halfedge-data object and attach it to the given halfedge. */ virtual void read_halfedge_data(Halfedge_handle he) { @@ -607,7 +618,7 @@ class Arr_extended_dcel_text_formatter : { this->out() << f->data() << '\n'; } - + /*! Read a face-data object and attach it to the given face. */ virtual void read_face_data(Face_handle f) { diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_reader.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_reader.h index a408e1451669..bbcb4d14c17d 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_reader.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_reader.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein #ifndef CGAL_ARR_WITH_HISTORY_2_READER_H @@ -37,7 +37,7 @@ class Arr_with_history_2_reader : private Arrangement_2_reader typedef Arr_with_history_2_reader Self; protected: - + typedef Arrangement_2_reader Base; typedef typename Arr_with_history_2::Size Size; typedef typename Arr_with_history_2::Curve_handle Curve_handle; @@ -72,7 +72,7 @@ class Arr_with_history_2_reader : private Arrangement_2_reader { // Read the arrangement (without history). Base::operator() (formatter); - + // Read the inducing curves. formatter.read_curves_begin(); @@ -121,7 +121,7 @@ class Arr_with_history_2_reader : private Arrangement_2_reader formatter.read_curve_end(); return; } - + }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_writer.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_writer.h index f6dc977bbd95..406efe08e344 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_writer.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_2_writer.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -40,7 +40,7 @@ class Arr_with_history_2_writer : private Arrangement_2_writer typedef Arrangement_2_writer Base; typedef typename Arr_with_history_2::Size Size; - + typedef typename Arr_with_history_2::Curve_const_iterator Curve_const_iterator; typedef typename Arr_with_history_2::Curve_const_handle @@ -100,7 +100,7 @@ class Arr_with_history_2_writer : private Arrangement_2_writer formatter.write_induced_edges_begin(); formatter.write_size ("induced_edges", this->m_arr.number_of_induced_edges(cv)); - + Induced_edge_iterator ieit; for (ieit = this->m_arr.induced_edges_begin(cv); ieit != this->m_arr.induced_edges_end(cv); ++ieit) @@ -108,7 +108,7 @@ class Arr_with_history_2_writer : private Arrangement_2_writer formatter.write_halfedge_index (this->_index (&(**ieit))); } formatter.write_induced_edges_end(); - + formatter.write_curve_end(); return; } diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h index 0b9e0374cf6d..d1a37040e915 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -40,7 +40,7 @@ namespace CGAL { template std::ostream& write (const Arrangement_on_surface_with_history_2& arr, - std::ostream& os, + std::ostream& os, Formatter& format) { typedef Arrangement_on_surface_with_history_2 @@ -61,7 +61,7 @@ std::ostream& write */ template std::ostream& operator<< - (std::ostream& os, + (std::ostream& os, const Arrangement_on_surface_with_history_2& arr) { typedef Arrangement_on_surface_with_history_2 @@ -87,7 +87,7 @@ std::ostream& operator<< template std::istream& read (Arrangement_on_surface_with_history_2& arr, - std::istream& is, + std::istream& is, Formatter& format) { typedef Arrangement_on_surface_with_history_2 @@ -108,7 +108,7 @@ std::istream& read */ template std::istream& operator>> - (std::istream& is, + (std::istream& is, Arrangement_on_surface_with_history_2& arr) { typedef Arrangement_on_surface_with_history_2 @@ -119,7 +119,7 @@ std::istream& operator>> Text_formatter text_format (is); Arr_reader reader (arr); - + reader (text_format); return (is); } diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_text_formatter.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_text_formatter.h index d2ed519a6e08..92398665ec78 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_text_formatter.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_text_formatter.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein @@ -49,11 +49,11 @@ class Arr_with_history_text_formatter : public ArrFormatter_ typedef typename Arr_with_history_2::Halfedge_handle Halfedge_handle; typedef typename Arr_with_history_2::Face_handle Face_handle; - typedef typename Arr_with_history_2::Vertex_const_handle + typedef typename Arr_with_history_2::Vertex_const_handle Vertex_const_handle; typedef typename Arr_with_history_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arr_with_history_2::Face_const_handle + typedef typename Arr_with_history_2::Face_const_handle Face_const_handle; /*! Default constructor.*/ @@ -94,7 +94,7 @@ class Arr_with_history_text_formatter : public ArrFormatter_ void write_curve_end () {} - + void write_curve (const Curve_2& c) { this->out() << c << std::endl; @@ -114,13 +114,13 @@ class Arr_with_history_text_formatter : public ArrFormatter_ //@{ /*! Start reading the curves. */ - void read_curves_begin () + void read_curves_begin () { __skip_comments(); } /*! Read the end-curves message. */ - void read_curves_end() + void read_curves_end() { __skip_comments(); } @@ -128,11 +128,11 @@ class Arr_with_history_text_formatter : public ArrFormatter_ /*! Read a specific curve. */ void read_curve_begin () {} - + void read_curve_end () {} - void read_curve (Curve_2& c) + void read_curve (Curve_2& c) { this->in() >> c; __skip_until_EOL(); @@ -159,15 +159,15 @@ class Arr_with_history_text_formatter : public ArrFormatter_ } /*! Skip until end of line. */ - void __skip_until_EOL () + void __skip_until_EOL () { int c; while ((c = this->in().get()) != EOF && c != '\n') {}; return; } - + /*! Skip comment lines. */ - void __skip_comments () + void __skip_comments () { int c; while ((c = this->in().get()) != EOF && c == '#') diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h b/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h index 0a79a8cfb6fd..238004fbf91e 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // (based on old version by Michal Meyerovitch and Ester Ezra) @@ -41,9 +41,9 @@ namespace CGAL { typedef Arrangement_2_reader Self; protected: - + typedef typename Arrangement_2::Size Size; - typedef typename Arrangement_2::Dcel Dcel; + typedef typename Arrangement_2::Dcel Dcel; typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; typedef typename Arrangement_2::Point_2 Point_2; @@ -59,7 +59,7 @@ namespace CGAL { typedef typename Arr_accessor::Dcel_outer_ccb DOuter_ccb; typedef typename Arr_accessor::Dcel_inner_ccb DInner_ccb; typedef typename Arr_accessor::Dcel_isolated_vertex DIso_vert; - + // Data members: Arrangement_2& m_arr; Arr_accessor m_arr_access; @@ -104,7 +104,7 @@ namespace CGAL { // std::cout << number_of_vertices << std::endl; // std::cout << number_of_halfedges << std::endl; // std::cout << number_of_faces << std::endl; - + // Read the DCEL vertices and store them in the vertices vector. formatter.read_vertices_begin(); @@ -120,7 +120,7 @@ namespace CGAL { m_halfedges.resize(number_of_halfedges); for (k = 0; k < number_of_halfedges; k += 2) - { + { he = _read_edge(formatter); m_halfedges[k] = he; m_halfedges[k + 1] = he->opposite(); @@ -176,7 +176,7 @@ namespace CGAL { formatter.read_vertex_end(); return (new_v); } - + /*! Read a DCEL edge (a pair of twin halfedges). */ template DHalfedge* _read_edge(Formatter& formatter) @@ -194,7 +194,7 @@ namespace CGAL { if (has_curve) { - // Read the x-monotone curve associated with the edge. + // Read the x-monotone curve associated with the edge. formatter.read_x_monotone_curve(m_curve); // Allocate a pair of new DCEL halfegdes and associate them with the @@ -210,10 +210,10 @@ namespace CGAL { // Set the cross pointers between the twin halfedges and the end vertices. trg_v->set_halfedge(new_he); new_he->set_vertex(trg_v); - + src_v->set_halfedge(new_he->opposite()); new_he->opposite()->set_vertex(src_v); - + // Set the direction of the halfedges. if (direction == 0) { @@ -290,7 +290,7 @@ namespace CGAL { formatter.read_inner_ccbs_end(); // Read the isolated vertices inside the face. - Size n_isolated_vertices = + Size n_isolated_vertices = formatter.read_size("number_of_isolated_vertices"); if (n_isolated_vertices) { formatter.read_isolated_vertices_begin(); @@ -308,7 +308,7 @@ namespace CGAL { } formatter.read_isolated_vertices_end(); } - + // Read any auxiliary data associated with the face. if (is_valid) formatter.read_face_data(Face_handle(new_f)); @@ -326,7 +326,7 @@ namespace CGAL { * \return A pointer to the first halfedge read. */ template - DHalfedge* _read_ccb(Formatter& formatter, + DHalfedge* _read_ccb(Formatter& formatter, Size boundary_size, DOuter_ccb* p_outer, DInner_ccb* p_inner) @@ -335,7 +335,7 @@ namespace CGAL { (p_outer == nullptr && p_inner != nullptr)); formatter.read_ccb_halfedges_begin(); - + // Find the first halfedge, and set its CCB. std::size_t first_idx = formatter.read_halfedge_index(); DHalfedge* first_he = m_halfedges [first_idx]; @@ -347,7 +347,7 @@ namespace CGAL { // Read the rest of the halfedge along the boundary. std::size_t curr_idx; - DHalfedge* prev_he = first_he; + DHalfedge* prev_he = first_he; DHalfedge* curr_he; Size k; @@ -380,4 +380,4 @@ namespace CGAL { } //namespace CGAL -#endif // CGAL_IO_ARRANGEMENT_2_READER_H +#endif // CGAL_IO_ARRANGEMENT_2_READER_H diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h index 681e0e176193..22562cd1663b 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Ron Wein #ifndef CGAL_FIG_STREAM_H @@ -66,7 +66,7 @@ enum Fig_line_style }; #define FIG_DEFAULT_STYLE_VALUE 4.0 - + /*! * FIG fill styles. */ @@ -171,7 +171,7 @@ class Fig_stream public: typedef Kernel_ Kernel; - + // Define the kernel objects. typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; @@ -265,7 +265,7 @@ class Fig_stream * \param rect A rectangle bounding the logical drawing area. * \param width The physical width of the figure (in FIG units). * \param height The physical height of the figure (in FIG units). - * \pre The bounding rectangle is valid and the physical dimensions are + * \pre The bounding rectangle is valid and the physical dimensions are * both positive. */ Fig_stream (const char *filename, @@ -326,7 +326,7 @@ class Fig_stream * \param rect A rectangle bounding the logical drawing area. * \param width The physical width of the figure (in FIG units). * \param height The physical height of the figure (in FIG units). - * \pre The bounding rectangle is valid and the physical dimensions are + * \pre The bounding rectangle is valid and the physical dimensions are * both positive. * \return Whether the file was successfully opened. */ @@ -374,7 +374,7 @@ class Fig_stream _ofile << "Landscape" << std::endl; _ofile << "Center" << std::endl; _ofile << "Inches" << std::endl; - _ofile << "Letter" << std::endl; + _ofile << "Letter" << std::endl; _ofile << "100.00" << std::endl; _ofile << "Single" << std::endl; _ofile << "-2" << std::endl; @@ -398,7 +398,7 @@ class Fig_stream /// \name Accessing drawing properties. //@{ - + /*! * Get the workspace bounding rectangle. */ @@ -418,7 +418,7 @@ class Fig_stream /*! * Get the physical width of the fig - */ + */ int width () const { return _width; @@ -426,7 +426,7 @@ class Fig_stream /*! * Get the physical height of the fig - */ + */ int height () const { return _height; @@ -517,7 +517,7 @@ class Fig_stream * Get the arrow type. */ Fig_arrow_type arrow_type () const - { + { return (_arrow_type); } @@ -571,7 +571,7 @@ class Fig_stream return; } - + /*! * Set the color. * \pre The color must be defined. @@ -582,7 +582,7 @@ class Fig_stream if (color_defined (color)) _color = color; - + return; } @@ -670,7 +670,7 @@ class Fig_stream * Set the arrow type. */ void set_arrow_type (const Fig_arrow_type& type) - { + { _arrow_type = type; return; } @@ -739,8 +739,8 @@ class Fig_stream * \pre The color must be undefined. */ void define_color (const Fig_color& color, - const unsigned char& r, - const unsigned char& g, + const unsigned char& r, + const unsigned char& g, const unsigned char& b) { CGAL_precondition (color_defined (color)); @@ -822,7 +822,7 @@ class Fig_stream { // Draw an empty circle (use a solid line with width 1). _write_ellipse (p, - CGAL::square(_point_size), + CGAL::square(_point_size), CGAL::square(_point_size), _color, 1, FIG_SOLID, _style_value, FIG_WHITE, FIG_NOT_FILLED); @@ -834,7 +834,7 @@ class Fig_stream { // Draw a filled disc. _write_ellipse (p, - CGAL::square(_point_size), + CGAL::square(_point_size), CGAL::square(_point_size), _color, 1, FIG_SOLID, _style_value, _color, FIG_FILLED); @@ -1068,7 +1068,7 @@ class Fig_stream const Point_2& p3) { CGAL_precondition (_ofile.is_open()); - + _write_arc (p1, p2, p3, _color, _line_width, _line_style, _style_value); return; @@ -1114,18 +1114,18 @@ class Fig_stream * (0 by default). */ void write_text (const Point_2& pos, - const char *text, - const double& angle = 0) + const char *text, + const double& angle = 0) { CGAL_precondition (_ofile.is_open()); if (text == nullptr || strlen(text) == 0) return; - _write_text (pos, - reinterpret_cast(text), strlen(text), - angle, - _color, _font, _font_size); + _write_text (pos, + reinterpret_cast(text), strlen(text), + angle, + _color, _font, _font_size); return; } //@} @@ -1141,7 +1141,7 @@ class Fig_stream set_depth (static_cast(depth)); return (*this); } - + /*! * Set the color. */ @@ -1192,7 +1192,7 @@ class Fig_stream * Set the arrow type. */ Fig_stream& operator<< (const Fig_arrow_type& type) - { + { set_arrow_type (type); return (*this); } @@ -1245,7 +1245,7 @@ class Fig_stream write_line (line); return (*this); } - + /*! * Write a triangle. */ @@ -1291,9 +1291,9 @@ class Fig_stream void _convert_point (const Point_2& p, int& ix, int& iy) const { - ix = static_cast (_scale * + ix = static_cast (_scale * CGAL::to_double(p.x() - _bound_rect.xmin())); - iy = static_cast (_scale * + iy = static_cast (_scale * CGAL::to_double( _bound_rect.ymax() - p.y())); return; } @@ -1348,11 +1348,11 @@ class Fig_stream // Write the segment properties. _ofile << "2 1 " // Desginate a polyline. - << line_style << ' ' - << line_width << ' ' + << line_style << ' ' + << line_width << ' ' << line_color << ' ' << FIG_WHITE << ' ' // Fill color (dummy). - << _depth << ' ' + << _depth << ' ' << "0 " // Pen style (not in use, always 0). << FIG_NOT_FILLED << ' ' << style_value << ' ' @@ -1411,11 +1411,11 @@ class Fig_stream { // Write the polyline properties. _ofile << "2 3 " // Desginate a polygon. - << line_style << ' ' - << line_width << ' ' + << line_style << ' ' + << line_width << ' ' << line_color << ' ' << fill_color << ' ' - << _depth << ' ' + << _depth << ' ' << "0 " // Pen style (not in use, always 0). << fill_style << ' ' << style_value << ' ' @@ -1467,17 +1467,17 @@ class Fig_stream const Fig_line_style& line_style, const double& style_value, const Fig_color& fill_color, - const Fig_fill_style& fill_style) + const Fig_fill_style& fill_style) { - + // Write the ellipse properties. _ofile << "1 1 " // Desginate an ellipse. - << line_style << ' ' - << line_width << ' ' + << line_style << ' ' + << line_width << ' ' << line_color << ' ' << fill_color << ' ' - << _depth << ' ' + << _depth << ' ' << "0 " // Pen style (not in use, always 0). << fill_style << ' ' << style_value << ' ' @@ -1491,9 +1491,9 @@ class Fig_stream _ofile << ' ' << ix << ' ' << iy; // Write the radii. - int rx = static_cast (_scale * + int rx = static_cast (_scale * std::sqrt(CGAL::to_double(squared_radius_x))); - int ry = static_cast (_scale * + int ry = static_cast (_scale * std::sqrt(CGAL::to_double(squared_radius_y))); _ofile << ' ' << rx << ' ' << ry; @@ -1531,11 +1531,11 @@ class Fig_stream // Write the arc properties. _ofile << "5 1 " // Desginate an open arc. - << line_style << ' ' - << line_width << ' ' + << line_style << ' ' + << line_width << ' ' << line_color << ' ' << FIG_WHITE << ' ' // Fill color (dummy). - << _depth << ' ' + << _depth << ' ' << "0 " // Pen style (not in use, always 0). << FIG_NOT_FILLED << ' ' << style_value << ' ' @@ -1553,10 +1553,10 @@ class Fig_stream // Write the three points defining the arc. _convert_point (p1, ix, iy); _ofile << ' ' << ix << ' ' << iy; - + _convert_point (p2, ix, iy); _ofile << ' ' << ix << ' ' << iy; - + _convert_point (p3, ix, iy); _ofile << ' ' << ix << ' ' << iy << std::endl; @@ -1595,11 +1595,11 @@ class Fig_stream // Write the spline properties. _ofile << "3 0 " // Desginate an open spline. - << line_style << ' ' - << line_width << ' ' + << line_style << ' ' + << line_width << ' ' << line_color << ' ' << FIG_WHITE << ' ' // Fill color (dummy). - << _depth << ' ' + << _depth << ' ' << "0 " // Pen style (not in use, always 0). << FIG_NOT_FILLED << ' ' << style_value << ' ' @@ -1659,8 +1659,8 @@ class Fig_stream int height = static_cast (_scale * CGAL::to_double(_arrow_height)); _ofile << _arrow_type << ' ' - << "0 " // Arrow style (always 0). - << _line_width << ' ' + << "0 " // Arrow style (always 0). + << _line_width << ' ' << width << ' ' << height << std::endl; return; @@ -1670,12 +1670,12 @@ class Fig_stream * Write a text box. */ void _write_text (const Point_2& pos, - const unsigned char *text, - const int& len_text, - const double& angle, - const Fig_color& font_color, - const Fig_font& font, - const int& font_size) + const unsigned char *text, + const int& len_text, + const double& angle, + const Fig_color& font_color, + const Fig_font& font, + const int& font_size) { // Compute the text-box dimensions. const int text_height = font_size * 1200 / 80; @@ -1683,16 +1683,16 @@ class Fig_stream // Write the text properties. _ofile << "4 0 " // Desginate left-justified text. - << font_color << ' ' - << _depth << ' ' - << "0 " // Pen style (not in use, always 0). - << font << ' ' - << font_size << ' ' - << angle << ' ' - << "2 " // Indicates a special LaTeX font. - << text_height << ' ' - << text_width; - + << font_color << ' ' + << _depth << ' ' + << "0 " // Pen style (not in use, always 0). + << font << ' ' + << font_size << ' ' + << angle << ' ' + << "2 " // Indicates a special LaTeX font. + << text_height << ' ' + << text_width; + // Write the position coordinates. int ix, iy; @@ -1707,21 +1707,21 @@ class Fig_stream { if (text[i] >= ' ' && text[i] < 128 && text[i] != '\\') { - // If the current character is printable, just write it. - _ofile << static_cast(text[i]); + // If the current character is printable, just write it. + _ofile << static_cast(text[i]); } else { - // Convert the current character to an octal string and write it. - sprintf (oct, "\\%03o", text[i]); - _ofile << oct; + // Convert the current character to an octal string and write it. + sprintf (oct, "\\%03o", text[i]); + _ofile << oct; } } - + // Write the end-of-string sequence. _ofile << "\\001" << std::endl; - return; + return; } /*! diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h index 14db06fba430..5ca5bdecbb85 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Ron Wein #ifndef CGAL_FIG_STREAM_CONIC_ARC_2_H @@ -22,7 +22,7 @@ * Write an x-monotone conic arc to a FIG stream. */ template -static void _write_x_monotone_conic_arc +static void _write_x_monotone_conic_arc (CGAL::Fig_stream& fs, const typename Conic_traits::X_monotone_curve_2& cv) { @@ -30,15 +30,15 @@ static void _write_x_monotone_conic_arc typedef typename Conic_traits::Algebraic Algebraic; typedef typename Conic_traits::Point_2 Alg_point_2; typedef typename Alg_kernel::Segment_2 Alg_segment_2; - + if (cv.orientation() == CGAL::COLLINEAR) { // In case of a linear segment: Alg_segment_2 seg = Alg_segment_2 (cv.source(), cv.target()); fs << seg; - } + } else if (CGAL::compare (cv.r(), cv.s()) == CGAL::EQUAL && - CGAL::sign (cv.t()) == CGAL::ZERO) + CGAL::sign (cv.t()) == CGAL::ZERO) { // In case of a circular arc: Algebraic x_mid = (cv.source().x() + cv.target().x()) / 2; @@ -59,9 +59,9 @@ static void _write_x_monotone_conic_arc for (i = 1; i <= 3; i++) { x = (cv.source().x()*(4 - i) + cv.target().x()*i) / 4; - + q = Alg_point_2(x, 0); - cps[i] = cv.point_at_x (q); + cps[i] = cv.point_at_x (q); } cps[4] = cv.target(); @@ -86,11 +86,11 @@ void write_conic_arc std::list xcvs; traits.make_x_monotone_2_object() (cv, - std::back_inserter(xcvs)); + std::back_inserter(xcvs)); // Write the x-monotone sub-arcs. typename std::list::iterator xit; - + for (xit = xcvs.begin(); xit != xcvs.end(); ++xit) _write_x_monotone_conic_arc (fs, *xit); diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h index 8582f054d61c..970f6a452273 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h @@ -411,7 +411,7 @@ class Arr_basic_insertion_traits_2 { Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const { return (Compare_y_at_x_right_2 - (m_base_traits->compare_y_at_x_right_2_object())); + (m_base_traits->compare_y_at_x_right_2_object())); } /*! A functor that checks whether two points and two x-monotone curves are diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h index 8f6f8af71b42..71fa4b35bf20 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h @@ -55,80 +55,80 @@ class _Arr_default_overlay_traits_base * Create a vertex v that corresponds to the coinciding vertices v1 and v2. */ virtual void create_vertex (Vertex_handle_A /* v1 */, - Vertex_handle_B /* v2 */, - Vertex_handle_R /* v */) const + Vertex_handle_B /* v2 */, + Vertex_handle_R /* v */) const {} /*! * Create a vertex v that matches v1, which lies of the edge e2. */ virtual void create_vertex (Vertex_handle_A /* v1 */, - Halfedge_handle_B /* e2 */, - Vertex_handle_R /* v */) const + Halfedge_handle_B /* e2 */, + Vertex_handle_R /* v */) const {} /*! * Create a vertex v that matches v1, contained in the face f2. */ virtual void create_vertex (Vertex_handle_A /* v1 */, - Face_handle_B /* f2 */, - Vertex_handle_R /* v */) const + Face_handle_B /* f2 */, + Vertex_handle_R /* v */) const {} /*! * Create a vertex v that matches v2, which lies of the edge e1. */ virtual void create_vertex (Halfedge_handle_A /* e1 */, - Vertex_handle_B /* v2 */, - Vertex_handle_R /* v */) const + Vertex_handle_B /* v2 */, + Vertex_handle_R /* v */) const {} /*! * Create a vertex v that matches v2, contained in the face f1. */ virtual void create_vertex (Face_handle_A /* f1 */, - Vertex_handle_B /* v2 */, - Vertex_handle_R /* v */) const + Vertex_handle_B /* v2 */, + Vertex_handle_R /* v */) const {} /*! * Create a vertex v that matches the intersection of the edges e1 and e2. */ virtual void create_vertex (Halfedge_handle_A /* e1 */, - Halfedge_handle_B /* e2 */, - Vertex_handle_R /* v */) const + Halfedge_handle_B /* e2 */, + Vertex_handle_R /* v */) const {} /*! * Create an edge e that matches the overlap between e1 and e2. */ virtual void create_edge (Halfedge_handle_A /* e1 */, - Halfedge_handle_B /* e2 */, - Halfedge_handle_R /* e */) const + Halfedge_handle_B /* e2 */, + Halfedge_handle_R /* e */) const {} /*! * Create an edge e that matches the edge e1, contained in the face f2. */ virtual void create_edge (Halfedge_handle_A /* e1 */, - Face_handle_B /* f2 */, - Halfedge_handle_R /* e */) const + Face_handle_B /* f2 */, + Halfedge_handle_R /* e */) const {} /*! * Create an edge e that matches the edge e2, contained in the face f1. */ virtual void create_edge (Face_handle_A /* f1 */, - Halfedge_handle_B /* e2 */, - Halfedge_handle_R /* e */) const + Halfedge_handle_B /* e2 */, + Halfedge_handle_R /* e */) const {} /*! * Create a face f that matches the overlapping region between f1 and f2. */ virtual void create_face (Face_handle_A /* f1 */, - Face_handle_B /* f2 */, - Face_handle_R /* f */) const + Face_handle_B /* f2 */, + Face_handle_R /* f */) const {} }; diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index 53d5c6d1335b..8f6275e441d9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -340,7 +340,7 @@ class Arr_overlay_traits_2 { class Parameter_space_in_x_2; class Parameter_space_in_y_2; - + /*! A functor that computes intersections between x-monotone curves. */ class Intersect_2 { protected: @@ -1179,7 +1179,7 @@ class Arr_overlay_traits_2 { { return m_base->compare_x_near_boundary_2_object()(xcv1.base(), xcv2.base(), - ce); + ce); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h index d7f4856be170..751414b5d443 100644 --- a/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Ron Wein // Efi Fogel @@ -49,7 +49,7 @@ template class graph_traits > { public: - + typedef GeomTraits Geometry_traits_2; typedef TopTraits Topology_traits; typedef CGAL::Arrangement_on_surface_2 @@ -71,7 +71,7 @@ class graph_traits > * models the BidirectionalGraph concept as well as the VertexListGraph and * EdgeListGraph concepts. */ - struct Arr_traversal_category : + struct Arr_traversal_category : public virtual boost::bidirectional_graph_tag, // This tag refines the // incidence_graph_tag. public virtual boost::vertex_list_graph_tag, // Can iterate over vertices. @@ -84,7 +84,7 @@ class graph_traits > * This is by adapting the Halfegde_around_vertex_circulator type to an * iterator. Moreover, as the circulator goes over all ingoing halfedges * of the vertex, the iterator adapter may return their twin halfedges, if - * we need the outgoing halfedges. + * we need the outgoing halfedges. */ class Halfedge_around_vertex_iterator { @@ -116,7 +116,7 @@ class graph_traits > {} /*! - * Constructor. + * Constructor. * \param circ A ciruclator for the halfedges around a vertex. * \param out_edges Do we need the outgoing or the ingoing halfedges. * \param counter A counter associated with the iterator. @@ -145,12 +145,12 @@ class graph_traits > { return (_circ == it._circ && _out == it._out && _counter == it._counter); } - + bool operator!= (const Self& it) const { return (_circ != it._circ || _out != it._out || _counter != it._counter); } - + /*! Dereference operators. */ reference operator* () const { @@ -161,7 +161,7 @@ class graph_traits > { return &_hh; } - + /* Increment operators. */ Self& operator++() { @@ -169,7 +169,7 @@ class graph_traits > { ++_circ; ++_counter; - + if (_out) _hh = _circ->twin(); else @@ -183,12 +183,12 @@ class graph_traits > Self operator++ (int ) { Self tmp = *this; - + do { ++_circ; ++_counter; - + if (_out) _hh = _circ->twin(); else @@ -279,7 +279,7 @@ class graph_traits > Halfedge_around_vertex_circulator first = v->incident_halfedges(); Halfedge_around_vertex_circulator circ = first; degree_size_type deg = 0; - + do { if (! circ->is_fictitious()) @@ -528,7 +528,7 @@ degree (typename // -------------------------------------------------- /*! - * Get the number of vertices in the given arrangement. + * Get the number of vertices in the given arrangement. * \param arr The arrangement. * \return Number of vertices. */ @@ -541,7 +541,7 @@ num_vertices (const CGAL::Arrangement_on_surface_2& arr) boost::graph_traits > gt_arr (arr); - return gt_arr.number_of_vertices(); + return gt_arr.number_of_vertices(); } /*! @@ -570,7 +570,7 @@ vertices (const CGAL::Arrangement_on_surface_2& arr) // ------------------------------------------------ /*! - * Get the number of halfedges in the given arrangement. + * Get the number of halfedges in the given arrangement. * \param arr The arrangement. * \return Number of halfedges (graph edges). */ @@ -580,7 +580,7 @@ boost::graph_traits >:: edges_size_type num_edges (const CGAL::Arrangement_on_surface_2& arr) { - return arr.number_of_halfedges(); + return arr.number_of_halfedges(); } /*! diff --git a/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/long_description.txt b/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/long_description.txt index e906f7b29d59..4b6f1ab38986 100644 --- a/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/long_description.txt +++ b/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/long_description.txt @@ -34,7 +34,7 @@ zone of an arrangement, and line-sweeping the plane, the arrangements is embedded on. These frameworks are used in turn in the implementations of other operations on arrangements. Computing the overlay of two arrangements, for example, is based on the sweep-line -framework. +framework. Arrangements and arrangement components can also be extended to store additional data. An important extension stores the construction diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h index 7089f8c15d65..7adb505ef02a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h @@ -1239,7 +1239,7 @@ bool IO_base_test::read_curve(InputStream_& is, Curve_2& cv) // If we reached here, we have an unknown conic type: std::cerr << "Illegal conic type specification: " << type << "." - << std::endl; + << std::endl; return false; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h index 28c69831a9e9..d80c295becc5 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -1091,7 +1091,7 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) Face_const_handle* fh_ref = boost::get(&(objs[0][qi])); if (fh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { - Face_const_handle* fh_cur = + Face_const_handle* fh_cur = boost::get(&(objs[pl][qi])); if (fh_cur) { if ((*fh_cur) != (*fh_ref)) { @@ -1106,13 +1106,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Error: point location number " << pl << std::endl; std::cout << "Expected: a face." << std::endl; result += -1; - Halfedge_const_handle* hh_cur = + Halfedge_const_handle* hh_cur = boost::get(&(objs[pl][qi])); - if (hh_cur) { + if (hh_cur) { std::cout << "Actual: a halfedge." << std::endl; continue; } - Vertex_const_handle* vh_cur = + Vertex_const_handle* vh_cur = boost::get(&(objs[pl][qi])); if (vh_cur) { std::cout << "Actual: a vertex." << std::endl; @@ -1132,7 +1132,7 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) boost::get(&(objs[0][qi])); if (hh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { - Halfedge_const_handle* hh_cur = + Halfedge_const_handle* hh_cur = boost::get(&(objs[pl][qi])); if (hh_cur) { if (((*hh_cur) != (*hh_ref)) && ((*hh_cur)->twin() != (*hh_ref))) { @@ -1149,13 +1149,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Expected: a halfedge, " << (*hh_ref)->curve() << std::endl; result += -1; - Face_const_handle* fh_cur = + Face_const_handle* fh_cur = boost::get(&(objs[pl][qi])); if (fh_cur) { std::cout << "Actual: a face." << std::endl; continue; } - Vertex_const_handle* vh_cur = + Vertex_const_handle* vh_cur = boost::get(&(objs[pl][qi])); if (vh_cur) { std::cout << "Actual: a vertex." << std::endl; @@ -1171,7 +1171,7 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) boost::get(&(objs[0][qi])); if (vh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { - Vertex_const_handle* vh_cur = + Vertex_const_handle* vh_cur = boost::get(&(objs[pl][qi])); if (vh_cur) { if ((*vh_cur) != (*vh_ref)) { @@ -1187,13 +1187,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Error: point location number " << pl << std::endl; std::cout << "Expected: a vertex: "<< (*vh_ref)->point() << std::endl; result += -1; - Face_const_handle* fh_cur = + Face_const_handle* fh_cur = boost::get(&(objs[pl][qi])); if (fh_cur) { std::cout << "Actual: a face." << std::endl; continue; } - Halfedge_const_handle* hh_cur = + Halfedge_const_handle* hh_cur = boost::get(&(objs[pl][qi])); if (hh_cur) { std::cout << "Actual: a halfedge." << std::endl; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h index 7fb5476ace55..5a601805aa1c 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h @@ -26,15 +26,15 @@ class Segment_reader { } int count = 0; inp >> count; - //std::cout << "count ="< int main () { - std::cout << "Sorry, this example needs CORE ..." << std::endl; + std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else @@ -38,11 +38,11 @@ int main (int argc, char *argv[]) Bezier_traits_2 bezier_traits; Bezier_polycurve_traits poly_traits; - //vectors required for polylines + //vectors required for polylines std::vector points_vector; std::vector curves_vector; std::vector x_curves_vector; - + //creating a bezier curve points_vector.push_back( Rat_point_2(0,0) ); //points_vector.push_back( Rat_point_2(500,200) ); @@ -50,7 +50,7 @@ int main (int argc, char *argv[]) points_vector.push_back( Rat_point_2(500,200) ); points_vector.push_back( Rat_point_2(900,0) ); Bezier_curve curve_1 (points_vector.begin(), points_vector.end()); - + std::vector obj_vector; //creating x-mono bezier @@ -76,7 +76,7 @@ int main (int argc, char *argv[]) curves_vector.push_back(curve_2); x_curves_vector.push_back(x_curve_1); x_curves_vector.push_back(x_curve_2); - + //create polycurves Polycurve_bezier polycurve_1 = poly_traits.construct_curve_2_object()(curves_vector.begin(), curves_vector.end()); X_polycurve_bezier x_polycurve_1 = poly_traits.construct_x_monotone_curve_2_object()(x_curves_vector.begin(), x_curves_vector.end()); diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h index c34a49a24737..5af6c925ca7a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h @@ -44,7 +44,7 @@ #define GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS 11 #define RATIONAL_ARC_GEOM_TRAITS 12 #define ALGEBRAIC_GEOM_TRAITS 13 -#define POLYCURVE_CONIC_GEOM_TRAITS 14 +#define POLYCURVE_CONIC_GEOM_TRAITS 14 #define POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS 15 #define POLYCURVE_BEZIER_GEOM_TRAITS 16 #define FLAT_TORUS_GEOM_TRAITS 17 @@ -55,7 +55,7 @@ // Default value based on dependencies: #if (TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ - (TEST_GEOM_TRAITS == POLYCURVE_CONIC_GEOM_TRAITS) + (TEST_GEOM_TRAITS == POLYCURVE_CONIC_GEOM_TRAITS) #if !defined(TEST_NT) #define TEST_NT CORE_EXPR_NT #endif @@ -88,7 +88,7 @@ // Illegal combinations: #if (TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || (TEST_GEOM_TRAITS == POLYCURVE_CONIC_GEOM_TRAITS) #if(TEST_NT != CORE_EXPR_NT) - #error "Core conic traits implies Core Expr number type!" + #error "Core conic traits implies Core Expr number type!" #endif #endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp index 00d885fdb7ff..5b1c849af03b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp @@ -7,8 +7,8 @@ #include -#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ - (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ +#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ + (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ (TEST_GEOM_TRAITS == RATIONAL_ARC_GEOM_TRAITS)) && !defined(CGAL_USE_CORE) int main() @@ -28,7 +28,7 @@ int main() { // bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: LEDA is not installed, " + << "NOTE: LEDA is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -43,7 +43,7 @@ int main() // bool UNTESTED_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: GMP and/or MPFI are not installed, " + << "NOTE: GMP and/or MPFI are not installed, " << "skipping the test ..." << std::endl; return 0; @@ -57,7 +57,7 @@ int main() { // bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: CORE is not installed, " + << "NOTE: CORE is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -72,7 +72,7 @@ int main() // Define Geom_traits to be the curve-data-traits of the base geom traits. typedef CGAL::Arr_curve_data_traits_2 > + std::plus > Geom_traits; typedef Geom_traits::Point_2 Point_2; typedef Geom_traits::Curve_2 Curve_2; @@ -115,7 +115,7 @@ int main(int argc, char* argv[]) i += 2; } } - + int success = 0; for (; i < argc; ++i) { const char* filename = argv[i]; @@ -125,7 +125,7 @@ int main(int argc, char* argv[]) success = -1; } } - + return success; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_insertion.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_insertion.cpp index a3b0f6c35b62..3f5c021f0cc5 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_insertion.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_insertion.cpp @@ -19,56 +19,56 @@ typedef Arrangement_2::Vertex_handle Vertex_handle; //test from a bug report when inserting a segment closing a hole bool test_insert_at_vertices_1(){ Arrangement_2 arr; - + Vertex_handle v_x0y3 = arr.insert_in_face_interior(Point_2(Number_type(0), Number_type(3)), arr.unbounded_face()); Vertex_handle v_x1y6 = arr.insert_in_face_interior(Point_2(Number_type(1), Number_type(6)), arr.unbounded_face()); Vertex_handle v_x1y3 = arr.insert_in_face_interior(Point_2(Number_type(1), Number_type(3)), arr.unbounded_face()); Vertex_handle v_x2y3 = arr.insert_in_face_interior(Point_2(Number_type(2), Number_type(3)), arr.unbounded_face()); Vertex_handle v_x3y6 = arr.insert_in_face_interior(Point_2(Number_type(3), Number_type(6)), arr.unbounded_face()); Vertex_handle v_x3y0 = arr.insert_in_face_interior(Point_2(Number_type(3), Number_type(0)), arr.unbounded_face()); - + arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x1y6->point()), v_x0y3, v_x1y6); arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x1y3->point()), v_x0y3, v_x1y3); arr.insert_at_vertices(Segment_2(v_x1y3->point(), v_x2y3->point()), v_x1y3, v_x2y3); arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x3y6->point()), v_x0y3, v_x3y6); arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x3y0->point()), v_x0y3, v_x3y0); - + Halfedge_handle he = arr.insert_at_vertices(Segment_2(v_x3y6->point(), v_x3y0->point()), v_x3y6, v_x3y0); - - + + if (he->face() != arr.unbounded_face()) { std::cerr << "Error: he->face() must be the unbounded face!" << std::endl; return false; } - + return is_valid(arr); } bool test_insert_at_vertices_2(){ Arrangement_2 arr; - + Vertex_handle v_x0y3 = arr.insert_in_face_interior(Kernel::Point_2(Kernel::FT(0), Kernel::FT(3)), arr.unbounded_face()); Vertex_handle v_x1y6 = arr.insert_in_face_interior(Kernel::Point_2(Kernel::FT(1), Kernel::FT(6)), arr.unbounded_face()); Vertex_handle v_x1y3 = arr.insert_in_face_interior(Kernel::Point_2(Kernel::FT(1), Kernel::FT(3)), arr.unbounded_face()); Vertex_handle v_x2y3 = arr.insert_in_face_interior(Kernel::Point_2(Kernel::FT(2), Kernel::FT(3)), arr.unbounded_face()); Vertex_handle v_x3y6 = arr.insert_in_face_interior(Kernel::Point_2(Kernel::FT(3), Kernel::FT(6)), arr.unbounded_face()); Vertex_handle v_x3y0 = arr.insert_in_face_interior(Kernel::Point_2(Kernel::FT(3), Kernel::FT(0)), arr.unbounded_face()); - + arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x1y6->point()), v_x0y3, v_x1y6); arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x1y3->point()), v_x0y3, v_x1y3); arr.insert_at_vertices(Segment_2(v_x1y3->point(), v_x2y3->point()), v_x1y3, v_x2y3); arr.insert_at_vertices(Segment_2(v_x0y3->point(), v_x3y6->point()), v_x0y3, v_x3y6); arr.insert_at_vertices(Segment_2(v_x3y6->point(), v_x3y0->point()), v_x3y6, v_x3y0); - + Halfedge_handle he = arr.insert_at_vertices(Segment_2(v_x3y0->point(), v_x0y3->point()), v_x3y0, v_x0y3); - + if (he->face() != arr.unbounded_face()) { std::cerr << "Error: he->face() must be the unbounded face!" << std::endl; return false; } - + return is_valid(arr); } @@ -109,7 +109,7 @@ int main () segs[23] = Segment_2 (Point_2 (13, 3), Point_2 (17, 3)); segs[24] = Segment_2 (Point_2 (12, 6), Point_2 (13, 3)); segs[25] = Segment_2 (Point_2 (17, 3), Point_2 (20, 1)); - + for (k = 0; k < N_SEGMENTS; k++) { insert_non_intersecting_curve (arr, segs[k]); @@ -120,10 +120,10 @@ int main () if (! valid) return (1); } - + std::cout << "Arrangement size:" << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() + << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; // Check the validity more thoroughly. @@ -131,11 +131,11 @@ int main () std::cout << "Arrangement is " << (valid ? "valid." : "NOT valid!") << std::endl; if (!valid) return 1; - + std::cout << "Test insert_at_vertices "; valid=test_insert_at_vertices(); std::cout << ( valid ? "valid." : "NOT valid!") << std::endl; - + return valid?0:1; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_number_type.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_number_type.h index 292fb790ed85..0cee6483a590 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_number_type.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_number_type.h @@ -68,7 +68,7 @@ #include #else -#error No Number Type (NT) specified! +#error No Number Type (NT) specified! #endif // ============================================================================ @@ -180,7 +180,7 @@ typedef Basic_number_type Ring_type; #define NUMBER_TYPE "CORE BigInt" #elif TEST_NT == CORE_RAT_NT -typedef CGAL::CORE_arithmetic_kernel::Rational Basic_number_type; +typedef CGAL::CORE_arithmetic_kernel::Rational Basic_number_type; typedef Basic_number_type Number_type; typedef Basic_number_type Ring_type; #define NUMBER_TYPE "CORE Rational" diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp index 668338916dd4..6f12f6e8c736 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp @@ -69,13 +69,13 @@ class Test_observer : public CGAL::Arr_observer /// \name Notification functions on global arrangement operations. //@{ - /*! + /*! * Notification before the arrangement is assigned with another * arrangement. * \param arr The arrangement to be copied. */ virtual void before_assign (const Arrangement_2& /* arr */) - { + { compare_results("before_assign"); } @@ -84,13 +84,13 @@ class Test_observer : public CGAL::Arr_observer * arrangement. */ virtual void after_assign () - { + { compare_results("after_assign"); } /*! Notification before the arrangement is cleared. */ virtual void before_clear () - { + { compare_results("before_clear"); } @@ -118,12 +118,12 @@ class Test_observer : public CGAL::Arr_observer /// \name Notification functions on observer attachment or detachment. //@{ - /*! + /*! * Notification before the observer is attached to an arrangement. * \param arr The arrangement we are about to attach the observer to. */ virtual void before_attach (const Arrangement_2& /* arr */) - { + { compare_results("before_attach"); } @@ -135,7 +135,7 @@ class Test_observer : public CGAL::Arr_observer compare_results("after_attach"); } - /*! + /*! * Notification before the observer is detached from the arrangement. */ virtual void before_detach () @@ -148,7 +148,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void after_detach () - { + { compare_results("after_detach"); } //@} @@ -171,7 +171,7 @@ class Test_observer : public CGAL::Arr_observer * \param v A handle to the created vertex. */ virtual void after_create_vertex (Vertex_handle /* v */) - { + { compare_results("after_create_vertex"); } @@ -208,7 +208,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_create_edge (const X_monotone_curve_2& /* c */, Vertex_handle /* v1 */, Vertex_handle /* v2 */) - { + { compare_results("before_create_edge"); } @@ -217,7 +217,7 @@ class Test_observer : public CGAL::Arr_observer * \param e A handle to one of the twin halfedges that were created. */ virtual void after_create_edge (Halfedge_handle /* e */) - { + { compare_results("after_create_edge"); } @@ -228,7 +228,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_modify_vertex (Vertex_handle /* v */, const Point_2& /* p */) - { + { compare_results("before_modify_vertex"); } @@ -237,7 +237,7 @@ class Test_observer : public CGAL::Arr_observer * \param v A handle to the updated vertex. */ virtual void after_modify_vertex (Vertex_handle /* v */) - { + { compare_results("after_modify_vertex"); } @@ -248,7 +248,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_modify_edge (Halfedge_handle /* e */, const X_monotone_curve_2& /* c */) - { + { compare_results("before_modify_edge"); } @@ -257,7 +257,7 @@ class Test_observer : public CGAL::Arr_observer * \param e A handle to one of the twin halfedges that were updated. */ virtual void after_modify_edge (Halfedge_handle /* e */) - { + { compare_results("after_modify_edge"); } @@ -272,7 +272,7 @@ class Test_observer : public CGAL::Arr_observer Vertex_handle /* v */, const X_monotone_curve_2& /* c1 */, const X_monotone_curve_2& /* c2 */) - { + { compare_results("before_split_edge"); } @@ -283,7 +283,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void after_split_edge (Halfedge_handle /* e1 */, Halfedge_handle /* e2 */) - { + { compare_results("after_split_edge"); } @@ -294,7 +294,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_split_fictitious_edge (Halfedge_handle /* e */, Vertex_handle /* v */) - { + { compare_results("before_split_fictitious_edge"); } @@ -305,7 +305,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void after_split_fictitious_edge (Halfedge_handle /* e1 */, Halfedge_handle /* e2 */) - { + { compare_results("after_split_fictitious_edge"); } @@ -316,7 +316,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_split_face (Face_handle /* f */, Halfedge_handle /* e */) - { + { compare_results("before_split_face"); } @@ -329,7 +329,7 @@ class Test_observer : public CGAL::Arr_observer virtual void after_split_face (Face_handle /* f */, Face_handle /* new_f */, bool /* is_hole */) - { + { compare_results("after_split_face"); } @@ -342,7 +342,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_split_outer_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h */, Halfedge_handle /* e */) - { + { compare_results("before_split_outer_ccb"); } @@ -355,7 +355,7 @@ class Test_observer : public CGAL::Arr_observer virtual void after_split_outer_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h1 */, Ccb_halfedge_circulator /* h2 */) - { + { compare_results("after_split_outer_ccb"); } @@ -368,7 +368,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_split_inner_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h */, Halfedge_handle /* e */) - { + { compare_results("before_split_inner_ccb"); } @@ -381,7 +381,7 @@ class Test_observer : public CGAL::Arr_observer virtual void after_split_inner_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h1 */, Ccb_halfedge_circulator /* h2 */) - { + { compare_results("after_split_inner_ccb"); } @@ -392,7 +392,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_add_outer_ccb (Face_handle /* f */, Halfedge_handle /* e */) - { + { compare_results("before_add_outer_ccb"); } @@ -401,7 +401,7 @@ class Test_observer : public CGAL::Arr_observer * \param h A circulator representing the boundary of the new outer CCB. */ virtual void after_add_outer_ccb (Ccb_halfedge_circulator /* h */) - { + { compare_results("after_add_outer_ccb"); } @@ -412,7 +412,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_add_inner_ccb (Face_handle /* f */, Halfedge_handle /* e */) - { + { compare_results("before_add_inner_ccb"); } @@ -421,7 +421,7 @@ class Test_observer : public CGAL::Arr_observer * \param h A circulator representing the boundary of the new inner CCB. */ virtual void after_add_inner_ccb (Ccb_halfedge_circulator /* h */) - { + { compare_results("after_add_inner_ccb"); } @@ -432,7 +432,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_add_isolated_vertex (Face_handle /* f */, Vertex_handle /* v */) - { + { compare_results("before_add_isolated_vertex"); } @@ -441,7 +441,7 @@ class Test_observer : public CGAL::Arr_observer * \param v The isolated vertex. */ virtual void after_add_isolated_vertex (Vertex_handle /* v */) - { + { compare_results("after_add_isolated_vertex"); } @@ -454,7 +454,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_merge_edge (Halfedge_handle /* e1 */, Halfedge_handle /* e2 */, const X_monotone_curve_2& /* c */) - { + { compare_results("before_merge_edge"); } @@ -463,7 +463,7 @@ class Test_observer : public CGAL::Arr_observer * \param e A handle to one of the twin halfedges forming the merged edge. */ virtual void after_merge_edge (Halfedge_handle /* e */) - { + { compare_results("after_merge_edge"); } @@ -474,7 +474,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_merge_fictitious_edge (Halfedge_handle /* e1 */, Halfedge_handle /* e2 */) - { + { compare_results("before_merge_fictitious_edge"); } @@ -483,7 +483,7 @@ class Test_observer : public CGAL::Arr_observer * \param e A handle to one of the twin halfedges forming the merged edge. */ virtual void after_merge_fictitious_edge (Halfedge_handle /* e */) - { + { compare_results("after_merge_fictitious_edge"); } @@ -496,7 +496,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_merge_face (Face_handle /* f1 */, Face_handle /* f2 */, Halfedge_handle /* e */) - { + { compare_results("before_merge_face"); } @@ -505,7 +505,7 @@ class Test_observer : public CGAL::Arr_observer * \param f A handle to the merged face. */ virtual void after_merge_face (Face_handle /* f */) - { + { compare_results("after_merge_face"); } @@ -520,7 +520,7 @@ class Test_observer : public CGAL::Arr_observer Ccb_halfedge_circulator /* h1 */, Ccb_halfedge_circulator /* h2 */, Halfedge_handle /* e */) - { + { compare_results("before_merge_outer_ccb"); } @@ -531,7 +531,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void after_merge_outer_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h */) - { + { compare_results("after_merge_outer_ccb"); } @@ -546,7 +546,7 @@ class Test_observer : public CGAL::Arr_observer Ccb_halfedge_circulator /* h1 */, Ccb_halfedge_circulator /* h2 */, Halfedge_handle /* e */) - { + { compare_results("before_merge_inner_ccb"); } @@ -557,7 +557,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void after_merge_inner_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h */) - { + { compare_results("after_merge_inner_ccb"); } @@ -570,7 +570,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_move_outer_ccb (Face_handle /* from_f */, Face_handle /* to_f */, Ccb_halfedge_circulator /* h */) - { + { compare_results("before_move_outer_ccb"); } @@ -579,7 +579,7 @@ class Test_observer : public CGAL::Arr_observer * \param h A circulator representing the boundary of the component. */ virtual void after_move_outer_ccb (Ccb_halfedge_circulator /* h */) - { + { compare_results("after_move_outer_ccb"); } @@ -593,7 +593,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_move_inner_ccb (Face_handle /* from_f */, Face_handle /* to_f */, Ccb_halfedge_circulator /* h */) - { + { compare_results("before_move_inner_ccb"); } @@ -602,7 +602,7 @@ class Test_observer : public CGAL::Arr_observer * \param h A circulator representing the boundary of the component. */ virtual void after_move_inner_ccb (Ccb_halfedge_circulator /* h */) - { + { compare_results("after_move_inner_ccb"); } @@ -615,7 +615,7 @@ class Test_observer : public CGAL::Arr_observer virtual void before_move_isolated_vertex (Face_handle /* from_f */, Face_handle /* to_f */, Vertex_handle /* v */) - { + { compare_results("before_move_isolated_vertex"); } @@ -624,7 +624,7 @@ class Test_observer : public CGAL::Arr_observer * \param v The isolated vertex. */ virtual void after_move_isolated_vertex (Vertex_handle /* v */) - { + { compare_results("after_move_isolated_vertex"); } @@ -633,7 +633,7 @@ class Test_observer : public CGAL::Arr_observer * \param v A handle to the vertex to be deleted. */ virtual void before_remove_vertex (Vertex_handle /* v */) - { + { compare_results("before_remove_vertex"); } @@ -641,7 +641,7 @@ class Test_observer : public CGAL::Arr_observer * Notificaion after the removal of a vertex. */ virtual void after_remove_vertex () - { + { compare_results("after_remove_vertex"); } @@ -650,7 +650,7 @@ class Test_observer : public CGAL::Arr_observer * \param e A handle to one of the twin halfedges to be deleted. */ virtual void before_remove_edge (Halfedge_handle /* e */) - { + { compare_results("before_remove_edge"); } @@ -658,7 +658,7 @@ class Test_observer : public CGAL::Arr_observer * Notificaion after the removal of an edge. */ virtual void after_remove_edge () - { + { compare_results("after_remove_edge"); } @@ -669,7 +669,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_remove_outer_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h */) - { + { compare_results("before_remove_outer_ccb"); } @@ -678,7 +678,7 @@ class Test_observer : public CGAL::Arr_observer * \param f The face that used to own the outer CCB. */ virtual void after_remove_outer_ccb (Face_handle /* f */) - { + { compare_results("after_remove_outer_ccb"); } @@ -689,7 +689,7 @@ class Test_observer : public CGAL::Arr_observer */ virtual void before_remove_inner_ccb (Face_handle /* f */, Ccb_halfedge_circulator /* h */) - { + { compare_results("before_remove_inner_ccb"); } @@ -698,7 +698,7 @@ class Test_observer : public CGAL::Arr_observer * \param f The face that used to contain the inner CCB. */ virtual void after_remove_inner_ccb (Face_handle /* f */) - { + { compare_results("after_remove_inner_ccb"); } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp index 6077f7efa35b..ca54f1d25c54 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp @@ -34,8 +34,8 @@ #include -#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ - (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ +#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ + (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ (TEST_GEOM_TRAITS == RATIONAL_ARC_GEOM_TRAITS)) && !defined(CGAL_USE_CORE) int main() @@ -55,7 +55,7 @@ int main() { // bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: LEDA is not installed, " + << "NOTE: LEDA is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -70,7 +70,7 @@ int main() // bool UNTESTED_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: GMP and/or MPFI are not installed, " + << "NOTE: GMP and/or MPFI are not installed, " << "skipping the test ..." << std::endl; return 0; @@ -84,7 +84,7 @@ int main() { // bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: CORE is not installed, " + << "NOTE: CORE is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -99,7 +99,7 @@ int main() // Define Geom_traits to be the curve-data-traits of the base geom traits. typedef CGAL::Arr_curve_data_traits_2 > + std::plus > Geom_traits; typedef Geom_traits::Point_2 Point_2; typedef Geom_traits::Curve_2 Curve_2; @@ -148,7 +148,7 @@ int main(int argc, char* argv[]) i += 2; } } - + int success = 0; for (; i < argc; ++i) { const char* filename = argv[i]; @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) success = -1; } } - + return success; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp index 4bb7a0e0b1d3..9cc77ec99770 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp @@ -4,8 +4,8 @@ #include -#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ - (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ +#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ + (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ (TEST_GEOM_TRAITS == RATIONAL_ARC_GEOM_TRAITS)) && !defined(CGAL_USE_CORE) int main() @@ -25,7 +25,7 @@ int main() { // bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: LEDA is not installed, " + << "NOTE: LEDA is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -40,7 +40,7 @@ int main() // bool UNTESTED_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: GMP and/or MPFI are not installed, " + << "NOTE: GMP and/or MPFI are not installed, " << "skipping the test ..." << std::endl; return 0; @@ -54,7 +54,7 @@ int main() { // bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: CORE is not installed, " + << "NOTE: CORE is not installed, " << "skipping the test ..." << std::endl; return 0; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp index 4ecd96f4ddb0..4a1d461f6907 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp @@ -4,8 +4,8 @@ #include -#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ - (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ +#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ + (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ (TEST_GEOM_TRAITS == RATIONAL_ARC_GEOM_TRAITS)) && !defined(CGAL_USE_CORE) int main() @@ -25,7 +25,7 @@ int main() { // bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: LEDA is not installed, " + << "NOTE: LEDA is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -40,7 +40,7 @@ int main() // bool UNTESTED_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: GMP and/or MPFI are not installed, " + << "NOTE: GMP and/or MPFI are not installed, " << "skipping the test ..." << std::endl; return 0; @@ -54,7 +54,7 @@ int main() { // bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: CORE is not installed, " + << "NOTE: CORE is not installed, " << "skipping the test ..." << std::endl; return 0; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp index 167a5be79e61..d722606771ef 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp @@ -59,7 +59,7 @@ bool dispatch(CGAL::Arr_not_all_sides_non_open_tag) { int main () { - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, @@ -67,7 +67,7 @@ int main () assert(dispatch(result1())); - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, @@ -75,7 +75,7 @@ int main () assert(!dispatch(result2())); - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag, @@ -83,7 +83,7 @@ int main () assert(!dispatch(result3())); - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag, @@ -91,15 +91,15 @@ int main () assert(!dispatch(result4())); - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag >::result result5; - + assert(!dispatch(result5())); - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_closed_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, @@ -107,7 +107,7 @@ int main () assert(!dispatch(result6())); - typedef CGAL::Arr_are_all_sides_oblivious_tag< + typedef CGAL::Arr_are_all_sides_oblivious_tag< CGAL::Arr_contracted_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_identified_side_tag, @@ -117,7 +117,7 @@ int main () // all non-open - typedef CGAL::Arr_are_all_sides_non_open_tag< + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, @@ -125,7 +125,7 @@ int main () assert(dispatch(open1())); - typedef CGAL::Arr_are_all_sides_non_open_tag< + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, @@ -133,15 +133,15 @@ int main () assert(!dispatch(open2())); - typedef CGAL::Arr_are_all_sides_non_open_tag< + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag >::result open3; assert(!dispatch(open3())); - - typedef CGAL::Arr_are_all_sides_non_open_tag< + + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag, @@ -149,7 +149,7 @@ int main () assert(!dispatch(open4())); - typedef CGAL::Arr_are_all_sides_non_open_tag< + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, @@ -157,25 +157,25 @@ int main () assert(!dispatch(open5())); - typedef CGAL::Arr_are_all_sides_non_open_tag< + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_closed_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag >::result open6; assert(!dispatch(open6())); - - typedef CGAL::Arr_are_all_sides_non_open_tag< + + typedef CGAL::Arr_are_all_sides_non_open_tag< CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag >::result open7; assert(!dispatch(open7())); - + // opposite identified tagging - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag, @@ -183,7 +183,7 @@ int main () assert(ident1() == true); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_identified_side_tag, CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag, @@ -191,7 +191,7 @@ int main () assert(ident2() == true); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_open_side_tag, CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, @@ -199,7 +199,7 @@ int main () assert(ident3() == true); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, @@ -208,7 +208,7 @@ int main () assert(ident4() == true); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_closed_side_tag, CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, @@ -216,7 +216,7 @@ int main () assert(ident5() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_identified_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_identified_side_tag, @@ -224,7 +224,7 @@ int main () assert(ident6() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, CGAL::Arr_contracted_side_tag, @@ -232,7 +232,7 @@ int main () assert(ident7() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag, @@ -240,7 +240,7 @@ int main () assert(ident8() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_closed_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag, @@ -248,7 +248,7 @@ int main () assert(ident9() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_identified_side_tag, @@ -256,7 +256,7 @@ int main () assert(ident10() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_open_side_tag, CGAL::Arr_identified_side_tag, CGAL::Arr_contracted_side_tag, @@ -264,7 +264,7 @@ int main () assert(ident11() == false); - typedef CGAL::Arr_sane_identified_tagging< + typedef CGAL::Arr_sane_identified_tagging< CGAL::Arr_identified_side_tag, CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag, @@ -307,7 +307,7 @@ int main () (boost::is_same< CGAL::internal::Arr_complete_right_side_category< Traits1 >::Category, CGAL::Arr_open_side_tag >::value) ); - + return EXIT_SUCCESS; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp index 9b7958c57009..b883a6ba0f65 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp @@ -23,7 +23,7 @@ int main() { // bool UNTESTED_GEOM_TRAITS_AS_LEDA_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: LEDA is not installed, " + << "NOTE: LEDA is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -38,7 +38,7 @@ int main() // bool UNTESTED_GEOM_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: GMP and/or MPFI are not installed, " + << "NOTE: GMP and/or MPFI are not installed, " << "skipping the test ..." << std::endl; return 0; @@ -52,7 +52,7 @@ int main() { // bool UNTESTED_GEOM_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: CORE is not installed, " + << "NOTE: CORE is not installed, " << "skipping the test ..." << std::endl; return 0; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_dispatching.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_dispatching.cpp index 4c3f2391be1c..cc63473d6d61 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_dispatching.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_dispatching.cpp @@ -25,12 +25,12 @@ int main () // oblivious-open // oblivious-contracted // oblivious-closed - + // Arr_left_right_implementation_dispatch oblivious-oblivious { - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag > LR; - + typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; assert(dispatch(Psx_2_curve_end()) == 0); typedef LR::Parameter_space_in_x_2_curve_tag Psx_2_curve; @@ -51,7 +51,7 @@ int main () } { // Arr_left_right_implementation_dispatch oblivious-open - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -74,7 +74,7 @@ int main () } { // Arr_left_right_implementation_dispatch oblivious-contracted - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_contracted_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -97,7 +97,7 @@ int main () } { // Arr_left_right_implementation_dispatch oblivious-closed - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_closed_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -118,17 +118,17 @@ int main () typedef LR::Compare_y_near_boundary_2_curve_ends_tag Cmp_y_nb_2_curve_ends; assert(dispatch(Cmp_y_nb_2_curve_ends()) == 1); } - + // open-oblivious // open-open // open-contracted // open-closed - + // Arr_left_right_implementation_dispatch open-oblivious { - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag > LR; - + typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; assert(dispatch(Psx_2_curve_end()) == 1); typedef LR::Parameter_space_in_x_2_curve_tag Psx_2_curve; @@ -149,7 +149,7 @@ int main () } { // Arr_left_right_implementation_dispatch open-open - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -172,7 +172,7 @@ int main () } { // Arr_left_right_implementation_dispatch open-contracted - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_contracted_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -195,7 +195,7 @@ int main () } { // Arr_left_right_implementation_dispatch open-closed - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_closed_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -223,9 +223,9 @@ int main () // contracted-closed // Arr_left_right_implementation_dispatch contracted-oblivious { - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_oblivious_side_tag > LR; - + typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; assert(dispatch(Psx_2_curve_end()) == 1); typedef LR::Parameter_space_in_x_2_curve_tag Psx_2_curve; @@ -246,7 +246,7 @@ int main () } { // Arr_left_right_implementation_dispatch contracted-open - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_open_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -269,7 +269,7 @@ int main () } { // Arr_left_right_implementation_dispatch contracted-contracted - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_contracted_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -292,7 +292,7 @@ int main () } { // Arr_left_right_implementation_dispatch contracted-closed - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_closed_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -320,9 +320,9 @@ int main () // closed-closed // Arr_left_right_implementation_dispatch closed-oblivious { - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_oblivious_side_tag > LR; - + typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; assert(dispatch(Psx_2_curve_end()) == 1); typedef LR::Parameter_space_in_x_2_curve_tag Psx_2_curve; @@ -343,7 +343,7 @@ int main () } { // Arr_left_right_implementation_dispatch closed-open - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_open_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -366,7 +366,7 @@ int main () } { // Arr_left_right_implementation_dispatch closed-contracted - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_contracted_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -389,7 +389,7 @@ int main () } { // Arr_left_right_implementation_dispatch closed-closed - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_closed_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -410,12 +410,12 @@ int main () typedef LR::Compare_y_near_boundary_2_curve_ends_tag Cmp_y_nb_2_curve_ends; assert(dispatch(Cmp_y_nb_2_curve_ends()) == 1); } - + // identified-identified { // Arr_left_right_implementation_dispatch identified-identified - typedef CGAL::internal::Arr_left_right_implementation_dispatch< + typedef CGAL::internal::Arr_left_right_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_identified_side_tag > LR; typedef LR::Parameter_space_in_x_2_curve_end_tag Psx_2_curve_end; @@ -447,9 +447,9 @@ int main () // oblivious-closed { // Arr_bottom_top_implementation_dispatch oblivious-oblivious - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_oblivious_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 0); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -480,9 +480,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch oblivious-open - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_open_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -513,9 +513,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch oblivious-contracted - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_contracted_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -546,9 +546,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch oblivious-closed - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_oblivious_side_tag, CGAL::Arr_closed_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -577,14 +577,14 @@ int main () typedef BT::Compare_x_near_boundary_2_curve_ends_tag Cmp_x_nb_2_curve_ends; assert(dispatch(Cmp_x_nb_2_curve_ends()) == 1); } - + // open-oblivious // open-open // open-contracted // open-closed { // Arr_bottom_top_implementation_dispatch open-oblivious - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_oblivious_side_tag > BT; typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; @@ -617,9 +617,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch open-open - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_open_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -650,7 +650,7 @@ int main () } { // Arr_bottom_top_implementation_dispatch open-contracted - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_contracted_side_tag > BT; typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; @@ -683,9 +683,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch open-closed - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_open_side_tag, CGAL::Arr_closed_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -721,9 +721,9 @@ int main () // contracted-closed { // Arr_bottom_top_implementation_dispatch contracted-oblivious - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_oblivious_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -754,9 +754,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch contracted-open - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_open_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -787,9 +787,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch contracted-contracted - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_contracted_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -820,9 +820,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch contracted-closed - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_contracted_side_tag, CGAL::Arr_closed_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -858,9 +858,9 @@ int main () // closed-closed { // Arr_bottom_top_implementation_dispatch closed-oblivious - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_oblivious_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -891,9 +891,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch closed-open - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_open_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -924,9 +924,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch closed-contracted - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_contracted_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -957,9 +957,9 @@ int main () } { // Arr_bottom_top_implementation_dispatch closed-closed - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_closed_side_tag, CGAL::Arr_closed_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; @@ -992,9 +992,9 @@ int main () // identified-identified { // Arr_bottom_top_implementation_dispatch identified-identified - typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< + typedef CGAL::internal::Arr_bottom_top_implementation_dispatch< CGAL::Arr_identified_side_tag, CGAL::Arr_identified_side_tag > BT; - + typedef BT::Parameter_space_in_y_2_curve_end_tag Psy_2_curve_end; assert(dispatch(Psy_2_curve_end()) == 1); typedef BT::Parameter_space_in_y_2_curve_tag Psy_2_curve; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_direct_insertion.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_direct_insertion.cpp index 818fc4718a77..3ff6a090913c 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_direct_insertion.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_direct_insertion.cpp @@ -37,8 +37,8 @@ int main () #include #include -typedef CORE::BigInt Number_type; -typedef CGAL::Algebraic_kernel_d_1 AK1; +typedef CORE::BigInt Number_type; +typedef CGAL::Algebraic_kernel_d_1 AK1; typedef CGAL::Arr_rational_function_traits_2 Traits_2; typedef Traits_2::Curve_2 Curve_2; @@ -49,16 +49,16 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main() { - // Traits class object - AK1 ak1; + // Traits class object + AK1 ak1; Traits_2 traits(&ak1); - // constructor for rational functions - Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); - + // constructor for rational functions + Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); + // a polynomial representing x .-) Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); - + // Create the rational function y = 1 / ((x - 2)(x - 5)) = 1 / (x^2 - 7x + 10) Polynomial_1 P1(1); Polynomial_1 P2(-1); @@ -75,9 +75,9 @@ int main() "number of faces", "number of unbounded faces" }; - + Arrangement_2::Size expected_sizes[] = {0, 2, 1, 2, 2}; - + // Construct the 1st arrangement. Arrangement_2 arr1(&traits); arr1.insert_in_face_interior(c1, arr1.reference_face()); @@ -109,13 +109,13 @@ int main() // If a failure has already occurred, abort. if (result < 0) return result; - + std::cout << std::endl; // Construct the 2nd arrangement. Arrangement_2 arr2(&traits); arr2.insert_in_face_interior(c2, arr2.reference_face()); - + if (!arr2.is_valid()) { std::cerr << "The second arrangement is not valid!" << std::endl; return -1; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_insertion.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_insertion.cpp index c8e88eb0b272..6d532d799823 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_insertion.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_unbounded_rational_insertion.cpp @@ -37,8 +37,8 @@ int main () #include #include -typedef CORE::BigInt Number_type; -typedef CGAL::Algebraic_kernel_d_1 AK1; +typedef CORE::BigInt Number_type; +typedef CGAL::Algebraic_kernel_d_1 AK1; typedef CGAL::Arr_rational_function_traits_2 Traits_2; typedef Traits_2::Curve_2 Curve_2; @@ -49,16 +49,16 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main() { - // Traits class object - AK1 ak1; + // Traits class object + AK1 ak1; Traits_2 traits(&ak1); - // constructor for rational functions - Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); - + // constructor for rational functions + Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); + // a polynomial representing x .-) Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); - + // Create the rational function y = 1 / ((x - 2)(x - 5)) = 1 / (x^2 - 7x + 10) Polynomial_1 P1(1); Polynomial_1 P2(-1); @@ -75,9 +75,9 @@ int main() "number of faces", "number of unbounded faces" }; - + Arrangement_2::Size expected_sizes[] = {0, 2, 1, 2, 2}; - + // Construct the 1st arrangement. Arrangement_2 arr1(&traits); insert(arr1, c1); @@ -108,13 +108,13 @@ int main() // If a failure has already occurred, abort. if (result < 0) return result; - + std::cout << std::endl; // Construct the 2nd arrangement. Arrangement_2 arr2(&traits); insert(arr2, c2); - + if (!arr2.is_valid()) { std::cerr << "The second arrangement is not valid!" << std::endl; return -1; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp index 7d1eab9a88dd..e4a024fe4b9a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp @@ -11,12 +11,12 @@ void vertical_ray_shooting_query const typename VerticalRayShoot::Arrangement_2::Point_2& q) { // Perform the point-location query. - CGAL::Object obj = (shoot_up) ? vrs.ray_shoot_up (q) : + CGAL::Object obj = (shoot_up) ? vrs.ray_shoot_up (q) : vrs.ray_shoot_down (q); // Print the result. typedef typename VerticalRayShoot::Arrangement_2 Arrangement_2; - + typename Arrangement_2::Vertex_const_handle v; typename Arrangement_2::Halfedge_const_handle e; typename Arrangement_2::Face_const_handle f; @@ -43,8 +43,8 @@ void vertical_ray_shooting_query { // We did not hit anything: assert (f->is_unbounded()); - - std::cout << "hit nothing." << std::endl; + + std::cout << "hit nothing." << std::endl; } else { diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp index 3eae7596c981..748632219b7a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp @@ -4,8 +4,8 @@ #include "test_configuration.h" -#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ - (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ +#if ((TEST_GEOM_TRAITS == CORE_CONIC_GEOM_TRAITS) || \ + (TEST_GEOM_TRAITS == BEZIER_GEOM_TRAITS) || \ (TEST_GEOM_TRAITS == RATIONAL_ARC_GEOM_TRAITS)) && !defined(CGAL_USE_CORE) int main() @@ -25,7 +25,7 @@ int main() { // bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: LEDA is not installed, " + << "NOTE: LEDA is not installed, " << "skipping the test ..." << std::endl; return 0; @@ -40,7 +40,7 @@ int main() // bool UNTESTED_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: GMP and/or MPFI are not installed, " + << "NOTE: GMP and/or MPFI are not installed, " << "skipping the test ..." << std::endl; return 0; @@ -54,7 +54,7 @@ int main() { // bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl - << "NOTE: CORE is not installed, " + << "NOTE: CORE is not installed, " << "skipping the test ..." << std::endl; return 0; diff --git a/BGL/doc/BGL/CGAL/HalfedgeDS_face_max_base_with_id.h b/BGL/doc/BGL/CGAL/HalfedgeDS_face_max_base_with_id.h index 0006a4332e8a..c106f1d96448 100644 --- a/BGL/doc/BGL/CGAL/HalfedgeDS_face_max_base_with_id.h +++ b/BGL/doc/BGL/CGAL/HalfedgeDS_face_max_base_with_id.h @@ -4,26 +4,26 @@ namespace CGAL { /*! \ingroup BGLGraphExternalIndices -The class `HalfedgeDS_face_max_base_with_id` is a model of the `HalfedgeDSFace` -concept. +The class `HalfedgeDS_face_max_base_with_id` is a model of the `HalfedgeDSFace` +concept. -It is equivalent to `HalfedgeDS_face_base< Refs, Tag_true>` -with an added integer field which can be used to index faces -in \sc{Bgl} algorithms. -The class contains support for the incident halfedge pointer -and the required type definitions. -It can be used for deriving own faces. +It is equivalent to `HalfedgeDS_face_base< Refs, Tag_true>` +with an added integer field which can be used to index faces +in \sc{Bgl} algorithms. +The class contains support for the incident halfedge pointer +and the required type definitions. +It can be used for deriving own faces. -Note that the user is in charge to set the index correctly before -running a graph algorithm. +Note that the user is in charge to set the index correctly before +running a graph algorithm. -\tparam Refs must be an instantiation of a `HalfedgeDS`. +\tparam Refs must be an instantiation of a `HalfedgeDS`. \cgalModels `HalfedgeDSFace` -\sa `HalfedgeDS` -\sa `HalfedgeDSItems` -\sa `PolyhedronItems_3` +\sa `HalfedgeDS` +\sa `HalfedgeDSItems` +\sa `PolyhedronItems_3` \sa `CGAL::HalfedgeDS_min_items` \sa `CGAL::HalfedgeDS_vertex_min_base` \sa `CGAL::HalfedgeDS_halfedge_min_base` @@ -37,23 +37,23 @@ template< typename Refs > class HalfedgeDS_face_max_base_with_id { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -HalfedgeDS_face_max_base_with_id(); +%Default constructor. +*/ +HalfedgeDS_face_max_base_with_id(); /*! -Returns the index. -*/ -int id() const; +Returns the index. +*/ +int id() const; /*! -Returns a reference to the index stored in the face. -*/ -int& id(); +Returns a reference to the index stored in the face. +*/ +int& id(); /// @} diff --git a/BGL/doc/BGL/CGAL/HalfedgeDS_halfedge_max_base_with_id.h b/BGL/doc/BGL/CGAL/HalfedgeDS_halfedge_max_base_with_id.h index b9d7f4142eb9..965f513863a7 100644 --- a/BGL/doc/BGL/CGAL/HalfedgeDS_halfedge_max_base_with_id.h +++ b/BGL/doc/BGL/CGAL/HalfedgeDS_halfedge_max_base_with_id.h @@ -4,24 +4,24 @@ namespace CGAL { /*! \ingroup BGLGraphExternalIndices -The class `HalfedgeDS_halfedge_max_base_with_id` is a model of the `HalfedgeDSHalfedge` -concept. -It is equivalent to `HalfedgeDS_halfedge_base< Refs, Tag_true, Tag_true, Tag_true>` with an added integer -field which can be used to index halfedges in \sc{Bgl} algorithms. -The class contains support for the previous, next, opposite, vertex and -face pointers and the required type definitions. -It can be used for deriving own halfedges. +The class `HalfedgeDS_halfedge_max_base_with_id` is a model of the `HalfedgeDSHalfedge` +concept. +It is equivalent to `HalfedgeDS_halfedge_base< Refs, Tag_true, Tag_true, Tag_true>` with an added integer +field which can be used to index halfedges in \sc{Bgl} algorithms. +The class contains support for the previous, next, opposite, vertex and +face pointers and the required type definitions. +It can be used for deriving own halfedges. -Note that the user is in charge to set the index correctly before -running a graph algorithm. +Note that the user is in charge to set the index correctly before +running a graph algorithm. -\tparam Refs must be an instantiation of a `HalfedgeDS`. +\tparam Refs must be an instantiation of a `HalfedgeDS`. \cgalModels `HalfedgeDSHalfedge` -\sa `HalfedgeDS` -\sa `HalfedgeDSItems` -\sa `PolyhedronItems_3` +\sa `HalfedgeDS` +\sa `HalfedgeDSItems` +\sa `PolyhedronItems_3` \sa `CGAL::HalfedgeDS_min_items` \sa `CGAL::HalfedgeDS_vertex_min_base` \sa `CGAL::HalfedgeDS_face_min_base` @@ -35,23 +35,23 @@ template< typename Refs > class HalfedgeDS_halfedge_max_base_with_id { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -HalfedgeDS_halfedge_max_base_with_id(); +%Default constructor. +*/ +HalfedgeDS_halfedge_max_base_with_id(); /*! -Returns the index. -*/ -int id() const; +Returns the index. +*/ +int id() const; /*! -Returns a reference to the index stored in the halfedge. -*/ -int& id(); +Returns a reference to the index stored in the halfedge. +*/ +int& id(); /// @} diff --git a/BGL/doc/BGL/CGAL/HalfedgeDS_vertex_max_base_with_id.h b/BGL/doc/BGL/CGAL/HalfedgeDS_vertex_max_base_with_id.h index 565236d880e8..328c65aa8c4e 100644 --- a/BGL/doc/BGL/CGAL/HalfedgeDS_vertex_max_base_with_id.h +++ b/BGL/doc/BGL/CGAL/HalfedgeDS_vertex_max_base_with_id.h @@ -4,24 +4,24 @@ namespace CGAL { /*! \ingroup BGLGraphExternalIndices -The class `HalfedgeDS_vertex_max_base_with_id` is a model of the `HalfedgeDSVertex` -concept. It is -equivalent to `HalfedgeDS_vertex_base< Refs, Tag_true>` -with an added integer field which can be used to index vertices -in \sc{Bgl} algorithms.. -The class contains support for the point and the required type definitions. -It can be used for deriving own vertices. +The class `HalfedgeDS_vertex_max_base_with_id` is a model of the `HalfedgeDSVertex` +concept. It is +equivalent to `HalfedgeDS_vertex_base< Refs, Tag_true>` +with an added integer field which can be used to index vertices +in \sc{Bgl} algorithms.. +The class contains support for the point and the required type definitions. +It can be used for deriving own vertices. -Note that the user is in charge to set the index correctly before -running a graph algorithm. +Note that the user is in charge to set the index correctly before +running a graph algorithm. \tparam Refs must be an instantiation of a `HalfedgeDS`. \cgalModels `HalfedgeDSVertex` -\sa `HalfedgeDS` -\sa `HalfedgeDSItems` -\sa `PolyhedronItems_3` +\sa `HalfedgeDS` +\sa `HalfedgeDSItems` +\sa `PolyhedronItems_3` \sa `CGAL::HalfedgeDS_min_items` \sa `CGAL::HalfedgeDS_halfedge_min_base` \sa `CGAL::HalfedgeDS_face_min_base` @@ -35,23 +35,23 @@ template< typename Refs > class HalfedgeDS_vertex_max_base_with_id { public: -/// \name Creation +/// \name Creation /// @{ /*! -%Default constructor. -*/ -HalfedgeDS_vertex_max_base_with_id(); +%Default constructor. +*/ +HalfedgeDS_vertex_max_base_with_id(); /*! -Returns the index. -*/ -int id() const; +Returns the index. +*/ +int id() const; /*! -Returns a reference to the index stored in the vertex. -*/ -int& id(); +Returns a reference to the index stored in the vertex. +*/ +int& id(); /// @} diff --git a/BGL/doc/BGL/CGAL/Polyhedron_items_with_id_3.h b/BGL/doc/BGL/CGAL/Polyhedron_items_with_id_3.h index a64795aaa749..91f9fa321881 100644 --- a/BGL/doc/BGL/CGAL/Polyhedron_items_with_id_3.h +++ b/BGL/doc/BGL/CGAL/Polyhedron_items_with_id_3.h @@ -4,26 +4,26 @@ namespace CGAL { /*! \ingroup BGLGraphExternalIndices -The class `Polyhedron_items_with_id_3` is a model of the `PolyhedronItems_3` -concept. It provides definitions for vertices with points, halfedges, -and faces with plane equations, all of them with an additional integer +The class `Polyhedron_items_with_id_3` is a model of the `PolyhedronItems_3` +concept. It provides definitions for vertices with points, halfedges, +and faces with plane equations, all of them with an additional integer field which can be used to index the items in a \sc{Bgl} algorithm. -The polyhedron traits class must provide the respective types for -the point and the plane equation. -Vertices and facets both contain a halfedge handle to an incident -halfedge. +The polyhedron traits class must provide the respective types for +the point and the plane equation. +Vertices and facets both contain a halfedge handle to an incident +halfedge. -\cgalModels `PolyhedronItems_3` +\cgalModels `PolyhedronItems_3` \cgalHeading{Operations} -Supported as required by the `PolyhedronItems_3` concept. +Supported as required by the `PolyhedronItems_3` concept. \cgalHeading{Additional Methods in All Three Items} \code -int id() const; // Returns the index. -int& id(); // Returns a reference to the index stored in the item. +int id() const; // Returns the index. +int& id(); // Returns a reference to the index stored in the item. \endcode \sa `CGAL::Polyhedron_3` @@ -42,21 +42,21 @@ class Polyhedron_items_with_id_3 { template < class Refs, class Traits> struct Vertex_wrapper { typedef typename Traits::Point_3 Point; - typedef CGAL::Tag_true Supports_vertex_point; + typedef CGAL::Tag_true Supports_vertex_point; }; template < class Refs, class Traits> struct Face_wrapper { typedef typename Traits::Plane_3 Plane; - typedef CGAL::Tag_true Supports_face_plane; + typedef CGAL::Tag_true Supports_face_plane; }; - /// \name Creation + /// \name Creation /// @{ /*! - %Default constructor. - */ - Polyhedron_items_with_id_3(); + %Default constructor. + */ + Polyhedron_items_with_id_3(); /// @} }; /* end Polyhedron_items_with_id_3 */ diff --git a/BGL/doc/BGL/CGAL/Triangulation_face_base_with_id_2.h b/BGL/doc/BGL/CGAL/Triangulation_face_base_with_id_2.h index 15827d6758b0..e1b380ac939b 100644 --- a/BGL/doc/BGL/CGAL/Triangulation_face_base_with_id_2.h +++ b/BGL/doc/BGL/CGAL/Triangulation_face_base_with_id_2.h @@ -27,18 +27,18 @@ template< typename TriangulationTraits_2, typename TriangulationFaceBase_2 > class Triangulation_face_base_with_id_2 : public TriangulationFaceBase_2 { public: -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns the index. -*/ -int id() const; +Returns the index. +*/ +int id() const; /*! Returns a reference to the index stored in the face. -*/ -int& id(); +*/ +int& id(); /// @} diff --git a/BGL/doc/BGL/CGAL/Triangulation_vertex_base_with_id_2.h b/BGL/doc/BGL/CGAL/Triangulation_vertex_base_with_id_2.h index bc156657b304..0c71e6b72af8 100644 --- a/BGL/doc/BGL/CGAL/Triangulation_vertex_base_with_id_2.h +++ b/BGL/doc/BGL/CGAL/Triangulation_vertex_base_with_id_2.h @@ -15,30 +15,30 @@ running a graph algorithm, by calling the function \tparam TriangulationTraits_2 is the geometric traits class and must be a model of `TriangulationTraits_2`. -\tparam TriangulationVertexBase_2 must be a vertex base class from which -`Triangulation_vertex_base_with_id_2` derives. It has the default -value `Triangulation_vertex_base_2`. +\tparam TriangulationVertexBase_2 must be a vertex base class from which +`Triangulation_vertex_base_with_id_2` derives. It has the default +value `Triangulation_vertex_base_2`. \cgalModels `TriangulationVertexBase_2` -\sa `CGAL::Triangulation_vertex_base_2` +\sa `CGAL::Triangulation_vertex_base_2` */ template< typename TriangulationTraits_2, typename TriangulationVertexBase_2 > class Triangulation_vertex_base_with_id_2 : public TriangulationVertexBase_2 { public: -/// \name Access Functions +/// \name Access Functions /// @{ /*! -Returns the index. -*/ -int id() const; +Returns the index. +*/ +int id() const; /*! -Returns a reference to the index stored in the vertex. -*/ -int& id(); +Returns a reference to the index stored in the vertex. +*/ +int& id(); /// @} diff --git a/BGL/doc/BGL/CGAL/boost/graph/properties.h b/BGL/doc/BGL/CGAL/boost/graph/properties.h index a7416d53eae2..40ca966a8e28 100644 --- a/BGL/doc/BGL/CGAL/boost/graph/properties.h +++ b/BGL/doc/BGL/CGAL/boost/graph/properties.h @@ -69,7 +69,7 @@ struct dynamic_halfedge_property_t { dynamic_halfedge_property_t(); }; - + /// \ingroup PkgBGLPropertiesDynamic /// Dynamic edge property tag /// \tparam T the value type of the edge property @@ -78,7 +78,7 @@ struct dynamic_edge_property_t { dynamic_edge_property_t(); }; - + /// \ingroup PkgBGLPropertiesDynamic /// Dynamic face property tag /// \tparam T the value type of the face property diff --git a/BGL/doc/BGL/Concepts/FaceGraph.h b/BGL/doc/BGL/Concepts/FaceGraph.h index 3bb8e0e826f8..08501700261c 100644 --- a/BGL/doc/BGL/Concepts/FaceGraph.h +++ b/BGL/doc/BGL/Concepts/FaceGraph.h @@ -13,7 +13,7 @@ for each internal property map available. \cgalAssociatedTypesBegin \cgalAssociatedTypeBegin{boost::graph_traits::%face_descriptor} A face descriptor corresponds to a unique face in an abstract graph instance. -A face descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. +A face descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. \cgalAssociatedTypeEnd \cgalAssociatedTypesEnd diff --git a/BGL/doc/BGL/Concepts/FaceListGraph.h b/BGL/doc/BGL/Concepts/FaceListGraph.h index c1ef888f699a..d50e7a275f22 100644 --- a/BGL/doc/BGL/Concepts/FaceListGraph.h +++ b/BGL/doc/BGL/Concepts/FaceListGraph.h @@ -7,8 +7,8 @@ the requirement for traversal of all faces in a graph. \cgalAssociatedTypesBegin -\cgalAssociatedTypeBegin{boost::graph_traits::%face_iterator} A face iterator (obtained via `faces(g)`) provides access to all of the faces in a graph. -A face iterator type must meet the requirements of `MultiPassInputIterator`. The value type of the +\cgalAssociatedTypeBegin{boost::graph_traits::%face_iterator} A face iterator (obtained via `faces(g)`) provides access to all of the faces in a graph. +A face iterator type must meet the requirements of `MultiPassInputIterator`. The value type of the face iterator must be the same as the face descriptor of the graph. \cgalAssociatedTypeEnd diff --git a/BGL/doc/BGL/Concepts/HalfedgeGraph.h b/BGL/doc/BGL/Concepts/HalfedgeGraph.h index efc7527f6f68..b69cbb204477 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeGraph.h @@ -6,11 +6,11 @@ The concept `HalfedgeGraph` is a refinement of the \sc{Bgl} concept `IncidenceGraph` and adds the notion of a *halfedge*: Each edge is associated with two *opposite* halfedges with source and target vertices swapped. Furthermore, halfedges have a *successor* and *predecessor*, -and form cycles we call *faces*. However, this concept -does not introduce a face type. +and form cycles we call *faces*. However, this concept +does not introduce a face type. A `HalfedgeGraph` is undirected and does not allow parallel edges. -Using the composition of the *successor* and *opposite* functions results +Using the composition of the *successor* and *opposite* functions results in another cycle, namely the cycle of halfedges which are incident to the same vertex. We refer to \ref PkgBGLIterators for a description of iterators and circulators for these halfedge cycles. @@ -21,15 +21,15 @@ for each internal property map available. \cgalAssociatedTypesBegin \cgalAssociatedTypeBegin{boost::graph_traits::%vertex_descriptor} A vertex descriptor corresponds to a unique vertex in an abstract graph instance. -A vertex descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. +A vertex descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. \cgalAssociatedTypeEnd \cgalAssociatedTypeBegin{boost::graph_traits::%halfedge_descriptor} A halfedge descriptor corresponds to a unique halfedge in an abstract graph instance. -A halfedge descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. -\cgalAssociatedTypeEnd +A halfedge descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. +\cgalAssociatedTypeEnd \cgalAssociatedTypeBegin{boost::graph_traits::%edge_descriptor} An edge descriptor corresponds to a unique edge in an abstract graph instance. -An edge descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. +An edge descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`. \cgalAssociatedTypeEnd \cgalAssociatedTypesEnd diff --git a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h index f0d365b3d066..3d0f4cfdcfed 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h @@ -7,8 +7,8 @@ and adds the requirements for traversal of all halfedges in the graph. \cgalAssociatedTypesBegin -\cgalAssociatedTypeBegin{boost::graph_traits::%halfedge_iterator} A halfedge iterator (obtained via `halfedges(g)`) provides access to all of the halfedges in a graph. -A halfedge iterator type must meet the requirements of `MultiPassInputIterator`. The value type of the +\cgalAssociatedTypeBegin{boost::graph_traits::%halfedge_iterator} A halfedge iterator (obtained via `halfedges(g)`) provides access to all of the halfedges in a graph. +A halfedge iterator type must meet the requirements of `MultiPassInputIterator`. The value type of the halfedge iterator must be the same as the halfedge descriptor of the graph. \cgalAssociatedTypeEnd diff --git a/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h b/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h index 1aca33d72b92..8ea1da9f5610 100644 --- a/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h +++ b/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h @@ -52,7 +52,7 @@ void set_target(boost::graph_traits::halfedge_descriptor h, boost::graph_traits::vertex_descriptor v, MutableHalfedgeGraph& g); /*! \relates MutableHalfedgeGraph -Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`. +Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`. */ template void diff --git a/BGL/doc/BGL/NamedParameters.txt b/BGL/doc/BGL/NamedParameters.txt index 47c1d3f866a1..1b388ebe66d2 100644 --- a/BGL/doc/BGL/NamedParameters.txt +++ b/BGL/doc/BGL/NamedParameters.txt @@ -139,7 +139,7 @@ simply inaccessible. is a model of `OutputIterator` accepting `std::pair` A typical use case is mapping the vertices from a source mesh to its copy's after a `copy_face_graph()` operation.\n -Type:a class model of `OutputIterator` accepting +Type:a class model of `OutputIterator` accepting `std::pair<`boost::graph_traits::%vertex_descriptor, `boost::graph_traits::%vertex_descriptor>`.\n Default: Emptyset_iterator \cgalNPEnd @@ -148,7 +148,7 @@ operation.\n is a model of `OutputIterator` accepting `std::pair` A typical use case is mapping the halfedges from a source mesh to its copy's after a `copy_face_graph()` operation.\n -Type:a class model of `OutputIterator` accepting +Type:a class model of `OutputIterator` accepting `std::pair<`boost::graph_traits::%halfedge_descriptor, `boost::graph_traits::%halfedge_descriptor>`.\n Default: Emptyset_iterator \cgalNPEnd @@ -158,7 +158,7 @@ operation.\n is a model of `OutputIterator` accepting `std::pair` A typical use case is mapping the faces from a source mesh to its copy's after a `copy_face_graph()` operation.\n -Type:a class model of `OutputIterator` accepting +Type:a class model of `OutputIterator` accepting `std::pair<`boost::graph_traits::%face_descriptor, `boost::graph_traits::%face_descriptor>`.\n Default: Emptyset_iterator \cgalNPEnd @@ -168,7 +168,7 @@ is a property map storing for each vertex of a source mesh the corresponding ver A typical use case is mapping the vertices from a source mesh to its copy's after a `copy_face_graph()` operation.\n Type:a class model of `ReadWritePropertyMap` with -`boost::graph_traits::%vertex_descriptor` as key type and +`boost::graph_traits::%vertex_descriptor` as key type and `boost::graph_traits::%vertex_descriptor` as value type.\n Default: None. \cgalNPEnd @@ -178,7 +178,7 @@ is a property map storing for each halfedge of a source mesh the corresponding h A typical use case is mapping the vertices from a source mesh to its copy's after a `copy_face_graph()` operation.\n Type:a class model of `ReadWritePropertyMap` with -`boost::graph_traits::%halfedge_descriptor` as key type and +`boost::graph_traits::%halfedge_descriptor` as key type and `boost::graph_traits::%halfedge_descriptor` as value type.\n Default: None. \cgalNPEnd @@ -188,7 +188,7 @@ is a property map storing for each face of a source mesh the corresponding face A typical use case is mapping the vertices from a source mesh to its copy's after a `copy_face_graph()` operation.\n Type:a class model of `ReadWritePropertyMap` with -`boost::graph_traits::%face_descriptor` as key type and +`boost::graph_traits::%face_descriptor` as key type and `boost::graph_traits::%face_descriptor` as value type.\n Default: None. \cgalNPEnd diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 6f85bafbf06b..6651c00b6e20 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -22,7 +22,7 @@ digraph example { FaceGraph [ URL="\ref FaceGraph"]; FaceListGraph [ URL="\ref FaceListGraph"]; MutableFaceGraph [ URL="\ref MutableFaceGraph"]; - + MutableHalfedgeGraph -> HalfedgeGraph -> "boost Graph" [ arrowhead="open", label="refines" ]; FaceListGraph -> FaceGraph -> HalfedgeGraph [ arrowhead="open", label="refines" ]; MutableFaceGraph -> MutableHalfedgeGraph [ arrowhead="open", label="refines" ]; @@ -34,12 +34,12 @@ digraph example { \cgalHeading{Notations}
      -
      `G`
      A type that is a model of a graph concept.
      -
      `g`
      An object of type `G`.
      -
      `u`, `v`
      Objects of type `boost::graph_traits::%vertex_descriptor`.
      -
      `h`
      An object of type `boost::graph_traits::%halfedge_descriptor`.
      -
      `e`
      An object of type `boost::graph_traits::%edge_descriptor`.
      -
      `f`
      An object of type `boost::graph_traits::%face_descriptor`.
      +
      `G`
      A type that is a model of a graph concept.
      +
      `g`
      An object of type `G`.
      +
      `u`, `v`
      Objects of type `boost::graph_traits::%vertex_descriptor`.
      +
      `h`
      An object of type `boost::graph_traits::%halfedge_descriptor`.
      +
      `e`
      An object of type `boost::graph_traits::%edge_descriptor`.
      +
      `f`
      An object of type `boost::graph_traits::%face_descriptor`.
      \cgalHeading{%VertexListGraph} diff --git a/BGL/doc/BGL/graph_traits.txt b/BGL/doc/BGL/graph_traits.txt index 4ea10583ee75..87c96903b6f2 100644 --- a/BGL/doc/BGL/graph_traits.txt +++ b/BGL/doc/BGL/graph_traits.txt @@ -122,8 +122,8 @@ For convenience, the type `edge_descriptor` is hashable using the functor `CGAL:
    • In order to use property maps, darts and types associated with of 0- and 2-attributes must define the two fonctions: \code -int id() const; // Returns the index. -int& id(); // Returns a reference to the index stored in the attribute. +int id() const; // Returns the index. +int& id(); // Returns a reference to the index stored in the attribute. \endcode
    @@ -142,7 +142,7 @@ Defined in ``, ``, and ``. -We provide partial specialization for the classes +We provide partial specialization for the classes `CGAL::Triangulation_2`, `CGAL::Delaunay_triangulation_2`, `CGAL::Regular_triangulation_2`, `CGAL::Constrained_triangulation_2`, `CGAL::Constrained_Delaunay_triangulation_2`, `CGAL::Constrained_triangulation_plus_2`, diff --git a/BGL/examples/BGL_LCC/CMakeLists.txt b/BGL/examples/BGL_LCC/CMakeLists.txt index 0df74650e874..fea37899faeb 100644 --- a/BGL/examples/BGL_LCC/CMakeLists.txt +++ b/BGL/examples/BGL_LCC/CMakeLists.txt @@ -12,7 +12,7 @@ find_package( CGAL QUIET COMPONENTS ) if ( NOT CGAL_FOUND ) message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() @@ -23,7 +23,7 @@ if ( NOT Boost_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() diff --git a/BGL/examples/BGL_LCC/copy_lcc.cpp b/BGL/examples/BGL_LCC/copy_lcc.cpp index ecc43fefc59f..0c84c58a0b66 100644 --- a/BGL/examples/BGL_LCC/copy_lcc.cpp +++ b/BGL/examples/BGL_LCC/copy_lcc.cpp @@ -51,7 +51,7 @@ int main(int argc, char* argv[]) boost::unordered_map v2v; boost::unordered_map h2h; - + CGAL::copy_face_graph(T1, S, CGAL::parameters::vertex_to_vertex_output_iterator(std::inserter(v2v, v2v.end())) .halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end()))); std::ofstream out("reverse.off"); diff --git a/BGL/examples/BGL_LCC/distance_lcc.cpp b/BGL/examples/BGL_LCC/distance_lcc.cpp index 2dec36620db2..7f608eeae650 100644 --- a/BGL/examples/BGL_LCC/distance_lcc.cpp +++ b/BGL/examples/BGL_LCC/distance_lcc.cpp @@ -21,21 +21,21 @@ int main(int argc, char** argv) CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); // This is the vector where the distance gets written to - std::vector distance(lcc.vertex_attributes().size()); + std::vector distance(lcc.vertex_attributes().size()); - // Here we start at an arbitrary vertex + // Here we start at an arbitrary vertex // Any other vertex could be the starting point vertex_iterator vb, ve; boost::tie(vb,ve)=vertices(lcc); vertex_descriptor vd = *vb; - + std::cout << "We compute distances to " << vd->point() << std::endl; // bfs = breadth first search explores the graph - // Just as the distance_recorder there is a way to record the predecessor of a vertex + // Just as the distance_recorder there is a way to record the predecessor of a vertex boost::breadth_first_search(lcc, - vd, - visitor(boost::make_bfs_visitor + vd, + visitor(boost::make_bfs_visitor (boost::record_distances (make_iterator_property_map (distance.begin(), @@ -48,6 +48,6 @@ int main(int argc, char** argv) vd = *vb; std::cout<point()<<" is "<id()]<<" hops away."< mst; boost::kruskal_minimum_spanning_tree(lcc,std::back_inserter(mst)); - + std::cout << "#VRML V2.0 utf8\n" "Shape {\n" "appearance Appearance {\n" @@ -39,21 +39,21 @@ void kruskal(const LCC& lcc) "IndexedLineSet {\n" "coord Coordinate {\n" "point [ \n"; - + vertex_iterator vb, ve; for(boost::tie(vb,ve) = vertices(lcc); vb!=ve; ++vb){ std::cout << (*vb)->point() << "\n"; } - + std::cout << "]\n" "}\n" "coordIndex [\n"; - + for(std::list::iterator it = mst.begin(); it != mst.end(); ++it){ std::cout << source(*it,lcc)->id() - << ", " << target(*it,lcc)->id() << ", -1\n"; + << ", " << target(*it,lcc)->id() << ", -1\n"; } - + std::cout << "]\n" "}#IndexedLineSet\n" "}# Shape\n"; @@ -63,14 +63,14 @@ void kruskal(const LCC& lcc) int main() { LCC lcc; - + Point a(1,0,0); Point b(0,1,0); Point c(0,0,1); Point d(0,0,0); - + lcc.make_tetrahedron(a,b,c,d); kruskal(lcc); - + return 0; } diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index f66b35526fa8..4c9588546a69 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -14,12 +14,12 @@ typedef CGAL::Linear_cell_complex_traits<3, Kernel> LCC_traits; typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map_helper <2, 3, LCC_traits>::type LCC; -template -void calculate_face_normals(const HalfedgeGraph& g, - PointMap pm, - NormalMap nm) +void calculate_face_normals(const HalfedgeGraph& g, + PointMap pm, + NormalMap nm) { typedef boost::graph_traits GraphTraits; typedef typename GraphTraits::face_iterator face_iterator; @@ -39,7 +39,7 @@ void calculate_face_normals(const HalfedgeGraph& g, edg = next(edg, g); point p2 = pm[target(edg, g)]; edg = next(edg, g); - + if(edg == edgb) { // triangle nm[*fb] = CGAL::unit_normal(p1, p2, p0); @@ -51,11 +51,11 @@ void calculate_face_normals(const HalfedgeGraph& g, n = n + CGAL::normal(p1, p2, p0); p0 = p1; p1 = p2; - + edg = next(edg, g); p2 = pm[target(edg, g)]; } while(edg != edgb); - + nm[*fb] = n / CGAL::sqrt(n.squared_length()); } } @@ -68,12 +68,12 @@ int main(int argc, char** argv) LCC lcc; CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); - + // Ad hoc property_map to store normals. Face_index_map is used to // map face_descriptors to a contiguous range of indices. See // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. - boost::vector_property_map + boost::vector_property_map normals(get(CGAL::face_index, lcc)); calculate_face_normals( @@ -85,7 +85,7 @@ int main(int argc, char** argv) std::cout << "Normals" << std::endl; for(LCC::Attribute_range<2>::type::iterator it=lcc.attributes<2>().begin(); it!=lcc.attributes<2>().end(); ++it) - { + { // Facet_iterator is a face_descriptor, so we can use it as the // key here std::cout << normals[it] << std::endl; diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index e98acb8a5bcd..6221e67f2536 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -35,22 +35,22 @@ struct Fct void fct(const LCC& lcc) { vertex_range vr(vertices(lcc)); - + std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } - + std::cout << "boost::tie + std::for_each" << std::endl; vertex_iterator vb, ve; - + boost::tie(vb,ve) = vertices_range(lcc); std::for_each(vb,ve, Fct()); } int main(int argc, char** argv) { - LCC lcc; + LCC lcc; CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); fct(lcc); diff --git a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp index ca5cef8e664e..4c5134e3ad63 100644 --- a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp +++ b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp @@ -19,7 +19,7 @@ typedef CGAL::Halfedge_around_target_iterator halfedge_around_target_iterat template struct Source { - const G* g; + const G* g; Source() : g(NULL) @@ -44,14 +44,14 @@ int main(int argc, char** argv) CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); GraphTraits::vertex_descriptor vd = *(vertices(lcc).first); - typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; + typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; halfedge_around_target_iterator hb,he; boost::tie(hb,he) = halfedges_around_target(halfedge(vd,lcc),lcc); adjacent_vertex_iterator avib, avie; avib = boost::make_transform_iterator(hb, Source(lcc)); avie = boost::make_transform_iterator(he, Source(lcc)); - + std::list V; std::copy(avib,avie, std::back_inserter(V)); return 0; diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index 848b02e26047..685f9bc73679 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -12,7 +12,7 @@ find_package( CGAL QUIET COMPONENTS ) if ( NOT CGAL_FOUND ) message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() @@ -23,7 +23,7 @@ if ( NOT Boost_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() diff --git a/BGL/examples/BGL_arrangement_2/CMakeLists.txt b/BGL/examples/BGL_arrangement_2/CMakeLists.txt index 676d1347aa38..31b9e3480198 100644 --- a/BGL/examples/BGL_arrangement_2/CMakeLists.txt +++ b/BGL/examples/BGL_arrangement_2/CMakeLists.txt @@ -13,8 +13,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp b/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp index 3ca5598ea278..19cc07022673 100644 --- a/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp +++ b/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp @@ -15,7 +15,7 @@ #include "arr_print.h" -// A property map that reads/writes the information to/from the extended +// A property map that reads/writes the information to/from the extended // face. template class Extended_face_property_map { public: diff --git a/BGL/examples/BGL_arrangement_2/primal.cpp b/BGL/examples/BGL_arrangement_2/primal.cpp index b93a3284adb4..ccd1ce9fb61b 100644 --- a/BGL/examples/BGL_arrangement_2/primal.cpp +++ b/BGL/examples/BGL_arrangement_2/primal.cpp @@ -46,15 +46,15 @@ double get(Edge_length_func edge_length, Arrangement_2::Halfedge_handle e) { return edge_length(e); } - + int main() { Arrangement_2 arr; - + // Construct an arrangement of seven intersecting line segments. // We keep a handle for the vertex v_0 that corresponds to the point (1,1). Arrangement_2::Halfedge_handle e = - insert_non_intersecting_curve (arr, Segment_2 (Point_2 (1, 1), + insert_non_intersecting_curve (arr, Segment_2 (Point_2 (1, 1), Point_2 (7, 1))); Arrangement_2::Vertex_handle v0 = e->source(); insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7))); @@ -66,16 +66,16 @@ int main() // Create a mapping of the arrangement vertices to indices. CGAL::Arr_vertex_index_map index_map(arr); - + // Perform Dijkstra's algorithm from the vertex v0. Edge_length_func edge_length; - + boost::vector_property_map > dist_map(static_cast(arr.number_of_vertices()), index_map); boost::dijkstra_shortest_paths(arr, v0, boost::vertex_index_map(index_map). weight_map(edge_length). distance_map(dist_map)); - + // Print the results: Arrangement_2::Vertex_iterator vit; diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index ac3bd5256f29..01378916001b 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -12,7 +12,7 @@ find_package( CGAL QUIET COMPONENTS ) if ( NOT CGAL_FOUND ) message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() @@ -23,7 +23,7 @@ if ( NOT Boost_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() diff --git a/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp b/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp index 3f9e7b76bef3..64c2b8650d92 100644 --- a/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp +++ b/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) boost::unordered_map v2v; boost::unordered_map h2h; boost::unordered_map f2f; - + CGAL::copy_face_graph(S, T2, CGAL::parameters::vertex_to_vertex_output_iterator(std::inserter(v2v, v2v.end())) .halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())) .face_to_face_output_iterator(std::inserter(f2f, f2f.end()))); @@ -75,7 +75,7 @@ int main(int argc, char* argv[]) typedef boost::graph_traits::vertex_descriptor tm_vertex_descriptor; typedef boost::graph_traits::halfedge_descriptor tm_halfedge_descriptor; typedef boost::graph_traits::face_descriptor tm_face_descriptor; - + boost::unordered_map v2v; boost::unordered_map h2h; diff --git a/BGL/examples/BGL_polyhedron_3/distance.cpp b/BGL/examples/BGL_polyhedron_3/distance.cpp index 68a8122c2948..21af22d44d25 100644 --- a/BGL/examples/BGL_polyhedron_3/distance.cpp +++ b/BGL/examples/BGL_polyhedron_3/distance.cpp @@ -16,14 +16,14 @@ typedef boost::graph_traits::vertex_iterator vertex_iterator; int main(int argc, char** argv) { - Polyhedron P; + Polyhedron P; std::ifstream in((argc>1)?argv[1]:"cube.off"); in >> P ; - + // associate indices to the vertices using the "id()" field of the vertex. vertex_iterator vb, ve; int index = 0; - + // boost::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vit and ve for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ @@ -32,24 +32,24 @@ int main(int argc, char** argv) { } // This is the vector where the distance gets written to - std::vector distance(P.size_of_vertices()); - + std::vector distance(P.size_of_vertices()); + - // Here we start at an arbitrary vertex + // Here we start at an arbitrary vertex // Any other vertex could be the starting point boost::tie(vb,ve)=vertices(P); vertex_descriptor vd = *vb; - + std::cout << "We compute distances to " << vd->point() << std::endl; - + // bfs = breadth first search explores the graph - // Just as the distance_recorder there is a way to record the predecessor of a vertex - boost::breadth_first_search(P, - vd, - visitor(boost::make_bfs_visitor(boost::record_distances(make_iterator_property_map(distance.begin(), - get(boost::vertex_index, P)), - boost::on_tree_edge())))); + // Just as the distance_recorder there is a way to record the predecessor of a vertex + boost::breadth_first_search(P, + vd, + visitor(boost::make_bfs_visitor(boost::record_distances(make_iterator_property_map(distance.begin(), + get(boost::vertex_index, P)), + boost::on_tree_edge())))); @@ -58,6 +58,6 @@ int main(int argc, char** argv) { vd = *vb; std::cout << vd->point() << " is " << distance[vd->id()] << " hops away" << std::endl; } - + return 0; } diff --git a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp index 281fd0493202..71a1af6a5903 100644 --- a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp +++ b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp @@ -35,7 +35,7 @@ adjacent_vertices_V2(const Polyhedron& g, OutputIterator out) { halfedge_around_target_iterator hi, he; - + for(boost::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi) { *out++ = source(*hi,g); @@ -45,7 +45,7 @@ adjacent_vertices_V2(const Polyhedron& g, int main(int argc, char** argv) -{ +{ std::ifstream in((argc>1)?argv[1]:"cube.off"); Polyhedron P; in >> P; diff --git a/BGL/examples/BGL_polyhedron_3/kruskal.cpp b/BGL/examples/BGL_polyhedron_3/kruskal.cpp index 4d55340c4d5a..bb470e66b227 100644 --- a/BGL/examples/BGL_polyhedron_3/kruskal.cpp +++ b/BGL/examples/BGL_polyhedron_3/kruskal.cpp @@ -32,22 +32,22 @@ kruskal(const Polyhedron& P) // associate indices to the vertices vertex_iterator vb, ve; int index = 0; - + // boost::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vb and ve for(boost::tie(vb, ve)=vertices(P); vb!=ve; ++vb){ vertex_index_pmap[*vb]= index++; } - + // We use the default edge weight which is the length of the edge // This property map is defined in graph_traits_Polyhedron_3.h // In the function call you can see a named parameter: vertex_index_map std::list mst; - boost::kruskal_minimum_spanning_tree(P, - std::back_inserter(mst), + boost::kruskal_minimum_spanning_tree(P, + std::back_inserter(mst), boost::vertex_index_map(vertex_index_pmap)); std::cout << "#VRML V2.0 utf8\n" diff --git a/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp b/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp index dc20778f740e..7d712fcf9626 100644 --- a/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp +++ b/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp @@ -23,14 +23,14 @@ kruskal( const Polyhedron& P) // We use the default edge weight which is the length of the edge // This property map is defined in graph_traits_Polyhedron_3.h - + // This function call requires a vertex_index_map named parameter which // when ommitted defaults to "get(vertex_index,graph)". // That default works here because the vertex type has an "id()" method // field which is used by the vertex_index internal property. std::list mst; boost::kruskal_minimum_spanning_tree(P,std::back_inserter(mst)); - + std::cout << "#VRML V2.0 utf8\n" "Shape {\n" "appearance Appearance {\n" @@ -39,21 +39,21 @@ kruskal( const Polyhedron& P) "IndexedLineSet {\n" "coord Coordinate {\n" "point [ \n"; - + vertex_iterator vb, ve; for(boost::tie(vb,ve) = vertices(P); vb!=ve; ++vb){ std::cout << (*vb)->point() << "\n"; } - + std::cout << "]\n" "}\n" "coordIndex [\n"; - + for(std::list::iterator it = mst.begin(); it != mst.end(); ++it){ std::cout << source(*it,P)->id() - << ", " << target(*it,P)->id() << ", -1\n"; + << ", " << target(*it,P)->id() << ", -1\n"; } - + std::cout << "]\n" "}#IndexedLineSet\n" "}# Shape\n"; @@ -61,27 +61,27 @@ kruskal( const Polyhedron& P) int main() { - + Polyhedron P; - + Point a(1,0,0); Point b(0,1,0); Point c(0,0,1); Point d(0,0,0); - + P.make_tetrahedron(a,b,c,d); // associate indices to the vertices using the "id()" field of the vertex. vertex_iterator vb, ve; int index = 0; - + // boost::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vit and ve for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ vertex_descriptor vd = *vb; vd->id() = index++; } - + kruskal(P); return 0; } diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index ed977de08bad..5de0ba63f706 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -12,12 +12,12 @@ typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; typedef CGAL::Polyhedron_3 Polyhedron; -template -void calculate_face_normals(const HalfedgeGraph& g, - PointMap pm, - NormalMap nm) +void calculate_face_normals(const HalfedgeGraph& g, + PointMap pm, + NormalMap nm) { typedef boost::graph_traits GraphTraits; typedef typename GraphTraits::face_iterator face_iterator; @@ -37,7 +37,7 @@ void calculate_face_normals(const HalfedgeGraph& g, edg = next(edg, g); point p2 = pm[target(edg, g)]; edg = next(edg, g); - + if(edg == edgb) { // triangle nm[*fb] = CGAL::unit_normal(p1, p2, p0); @@ -49,11 +49,11 @@ void calculate_face_normals(const HalfedgeGraph& g, n = n + CGAL::normal(p1, p2, p0); p0 = p1; p1 = p2; - + edg = next(edg, g); p2 = pm[target(edg, g)]; } while(edg != edgb); - + nm[*fb] = n / CGAL::sqrt(n.squared_length()); } } @@ -61,18 +61,18 @@ void calculate_face_normals(const HalfedgeGraph& g, int main(int argc, char** argv) { - typedef boost::property_map< + typedef boost::property_map< Polyhedron, - CGAL::face_index_t + CGAL::face_index_t >::const_type Face_index_map; std::ifstream in((argc>1)?argv[1]:"cube.off"); Polyhedron P; in >> P ; - + // initialize facet indices std::size_t i = 0; - for(Polyhedron::Facet_iterator it = P.facets_begin(); it != P.facets_end(); ++it, ++i) + for(Polyhedron::Facet_iterator it = P.facets_begin(); it != P.facets_end(); ++it, ++i) { it->id() = i; } @@ -81,7 +81,7 @@ int main(int argc, char** argv) // map face_descriptors to a contiguous range of indices. See // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. - boost::vector_property_map + boost::vector_property_map normals(get(CGAL::face_index, P)); calculate_face_normals( @@ -91,7 +91,7 @@ int main(int argc, char** argv) ); std::cout << "Normals" << std::endl; - for(Polyhedron::Facet_iterator it = P.facets_begin(); it != P.facets_end(); ++it) { + for(Polyhedron::Facet_iterator it = P.facets_begin(); it != P.facets_end(); ++it) { // Facet_iterator is a face_descriptor, so we can use it as the // key here std::cout << normals[it] << std::endl; diff --git a/BGL/examples/BGL_polyhedron_3/range.cpp b/BGL/examples/BGL_polyhedron_3/range.cpp index b1b77d2fb740..29451987ab86 100644 --- a/BGL/examples/BGL_polyhedron_3/range.cpp +++ b/BGL/examples/BGL_polyhedron_3/range.cpp @@ -34,22 +34,22 @@ struct Fct void fct(const Polyhedron& p) { vertex_range vr(vertices(p)); - + std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } - + std::cout << "boost::tie + std::for_each" << std::endl; vertex_iterator vb, ve; - + boost::tie(vb,ve) = vertices_range(p); std::for_each(vb,ve, Fct()); } int main(int argc, char** argv) { - Polyhedron P; + Polyhedron P; std::ifstream in((argc>1)?argv[1]:"cube.off"); in >> P ; diff --git a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp index 776805c7a095..8542f4ea3b37 100644 --- a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp +++ b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp @@ -18,7 +18,7 @@ typedef CGAL::Halfedge_around_target_iterator halfedge_around_target template struct Source { - const G* g; + const G* g; Source() : g(NULL) @@ -38,20 +38,20 @@ struct Source { }; int main(int argc, char** argv) -{ +{ std::ifstream in((argc>1)?argv[1]:"cube.off"); Polyhedron P; in >> P; GraphTraits::vertex_descriptor vd = *(vertices(P).first); - typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; + typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; halfedge_around_target_iterator hb,he; boost::tie(hb,he) = halfedges_around_target(halfedge(vd,P),P); adjacent_vertex_iterator avib, avie; avib = boost::make_transform_iterator(hb, Source(P)); avie = boost::make_transform_iterator(he, Source(P)); - + std::list V; std::copy(avib,avie, std::back_inserter(V)); return 0; diff --git a/BGL/examples/BGL_surface_mesh/connected_components.cpp b/BGL/examples/BGL_surface_mesh/connected_components.cpp index e5ad68d39157..b2009f0da35e 100644 --- a/BGL/examples/BGL_surface_mesh/connected_components.cpp +++ b/BGL/examples/BGL_surface_mesh/connected_components.cpp @@ -12,7 +12,7 @@ typedef CGAL::Surface_mesh Mesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; -int main(int argc, char* argv[]) +int main(int argc, char* argv[]) { Mesh sm; std::ifstream in((argc>1)?argv[1]:"data/prim.off"); @@ -26,6 +26,6 @@ int main(int argc, char* argv[]) for(vertex_descriptor v : vertices(sm)){ std::cout << v << " is in component " << ccmap[v] << std::endl; } - + return 0; } diff --git a/BGL/examples/BGL_surface_mesh/data/flatten.selection.txt b/BGL/examples/BGL_surface_mesh/data/flatten.selection.txt index fa126d49a3b0..bc610e57e593 100644 --- a/BGL/examples/BGL_surface_mesh/data/flatten.selection.txt +++ b/BGL/examples/BGL_surface_mesh/data/flatten.selection.txt @@ -1,3 +1,3 @@ -1 5 1 0 1 3 2 1 +1 5 1 0 1 3 2 1 diff --git a/BGL/examples/BGL_surface_mesh/data/hole.selection.txt b/BGL/examples/BGL_surface_mesh/data/hole.selection.txt index d94ec43b9001..aa0295915890 100644 --- a/BGL/examples/BGL_surface_mesh/data/hole.selection.txt +++ b/BGL/examples/BGL_surface_mesh/data/hole.selection.txt @@ -1,3 +1,3 @@ -2 1 1 0 +2 1 1 0 diff --git a/BGL/examples/BGL_surface_mesh/data/two_connected_components.selection.txt b/BGL/examples/BGL_surface_mesh/data/two_connected_components.selection.txt index bef0aadc4f52..a06cee862fff 100644 --- a/BGL/examples/BGL_surface_mesh/data/two_connected_components.selection.txt +++ b/BGL/examples/BGL_surface_mesh/data/two_connected_components.selection.txt @@ -1,3 +1,3 @@ -1 5 5 4 4 7 3 7 1 3 +1 5 5 4 4 7 3 7 1 3 diff --git a/BGL/examples/BGL_surface_mesh/prim.cpp b/BGL/examples/BGL_surface_mesh/prim.cpp index 7aff244d40f7..f54256de8732 100644 --- a/BGL/examples/BGL_surface_mesh/prim.cpp +++ b/BGL/examples/BGL_surface_mesh/prim.cpp @@ -12,7 +12,7 @@ typedef CGAL::Surface_mesh Mesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; -int main(int argc, char* argv[]) +int main(int argc, char* argv[]) { Mesh P; //std::cin >> P; @@ -38,16 +38,16 @@ int main(int argc, char* argv[]) for(vertex_descriptor vd : vertices(P)){ std::cout << " " << P.point(vd) << "\n"; } - + std::cout << " ]\n" " }\n" - " coordIndex [\n"; + " coordIndex [\n"; for(vertex_descriptor vd : vertices(P)){ if(predecessor[vd]!=vd){ std::cout << " " << std::size_t(vd) << ", " << std::size_t(predecessor[vd]) << ", -1\n"; } } - + std::cout << "]\n" " }#IndexedLineSet\n" "}# Shape\n"; diff --git a/BGL/examples/BGL_surface_mesh/write_inp.cpp b/BGL/examples/BGL_surface_mesh/write_inp.cpp index ba9e3545bb5a..d4b09a6e28a0 100644 --- a/BGL/examples/BGL_surface_mesh/write_inp.cpp +++ b/BGL/examples/BGL_surface_mesh/write_inp.cpp @@ -13,7 +13,7 @@ typedef CGAL::Surface_mesh Mesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; -int main() +int main() { Mesh sm; CGAL::make_quad(Point(0,0,0), Point(1,0,0),Point(1,1,0),Point(0,1,0), sm); diff --git a/BGL/examples/BGL_triangulation_2/CMakeLists.txt b/BGL/examples/BGL_triangulation_2/CMakeLists.txt index d6bb35f7d477..55eb169ecffa 100644 --- a/BGL/examples/BGL_triangulation_2/CMakeLists.txt +++ b/BGL/examples/BGL_triangulation_2/CMakeLists.txt @@ -13,8 +13,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/BGL/include/CGAL/boost/graph/Dual.h b/BGL/include/CGAL/boost/graph/Dual.h index cff6ba4e6b2f..101548e4ba70 100644 --- a/BGL/include/CGAL/boost/graph/Dual.h +++ b/BGL/include/CGAL/boost/graph/Dual.h @@ -91,7 +91,7 @@ class graph_traits > typedef typename GTP::halfedge_descriptor halfedge_descriptor; typedef typename GTP::edge_descriptor edge_descriptor; typedef typename GTP::directed_category directed_category; - typedef boost::allow_parallel_edge_tag edge_parallel_category; + typedef boost::allow_parallel_edge_tag edge_parallel_category; typedef typename GTP::traversal_category traversal_category; typedef typename GTP::faces_size_type vertices_size_type; @@ -112,11 +112,11 @@ class graph_traits > static face_descriptor null_face() { return face_descriptor(); } static halfedge_descriptor null_halfedge() { return halfedge_descriptor(); } }; - + template -struct graph_traits< const CGAL::Dual

    > +struct graph_traits< const CGAL::Dual

    > : public graph_traits< CGAL::Dual

    > -{}; +{}; namespace internal{ @@ -271,7 +271,7 @@ num_halfedges(const CGAL::Dual

    & dual) { return num_halfedges(dual.primal()); } - + template typename boost::graph_traits >::faces_size_type num_faces(const CGAL::Dual

    & dual) @@ -283,34 +283,34 @@ template Iterator_range >::vertex_iterator> vertices(const CGAL::Dual

    & dual) { - return faces(dual.primal()); + return faces(dual.primal()); } template Iterator_range >::face_iterator> faces(const CGAL::Dual

    & dual) { - return vertices(dual.primal()); + return vertices(dual.primal()); } - + template Iterator_range >::halfedge_iterator> halfedges(const CGAL::Dual

    & dual) { - return halfedges(dual.primal()); + return halfedges(dual.primal()); } - + template Iterator_range >::edge_iterator> edges(const CGAL::Dual

    & dual) { - return edges(dual.primal()); + return edges(dual.primal()); } template std::pair >::edge_descriptor, bool> -edge(typename boost::graph_traits >::vertex_descriptor u, - typename boost::graph_traits >::vertex_descriptor v, +edge(typename boost::graph_traits >::vertex_descriptor u, + typename boost::graph_traits >::vertex_descriptor v, const Dual

    & dual) { typename boost::graph_traits >::out_edge_iterator e, e_end; @@ -318,7 +318,7 @@ edge(typename boost::graph_traits >::vertex_descriptor u, if(target(*e, dual) == v) return std::make_pair(*e, true); } - + return std::make_pair(typename boost::graph_traits >::edge_descriptor(), false); } @@ -338,7 +338,7 @@ source(typename boost::graph_traits >::halfedge_descriptor h, const typename Dual

    ::Primal& primal = dual.primal(); return face(h,primal); } - + template typename boost::graph_traits >::vertex_descriptor target(typename boost::graph_traits >::halfedge_descriptor h, @@ -347,7 +347,7 @@ target(typename boost::graph_traits >::halfedge_descriptor h, const typename Dual

    ::Primal& primal = dual.primal(); return face(opposite(h,primal),primal); } - + template typename boost::graph_traits >::vertex_descriptor @@ -357,7 +357,7 @@ source(typename boost::graph_traits >::edge_descriptor h, const typename Dual

    ::Primal& primal = dual.primal(); return face(halfedge(h,primal),primal); } - + template typename boost::graph_traits >::vertex_descriptor target(typename boost::graph_traits >::edge_descriptor h, @@ -403,7 +403,7 @@ halfedge(typename boost::graph_traits >::vertex_descriptor u, if(target(*e, dual) == v) return std::make_pair(halfedge(*e, dual), true); } - + return std::make_pair(boost::graph_traits >::null_halfedge(), false); } @@ -431,7 +431,7 @@ next(typename boost::graph_traits >::halfedge_descriptor h, { const typename Dual

    ::Primal& primal = dual.primal(); return prev(opposite(h,primal),primal); -} +} template typename boost::graph_traits >::halfedge_descriptor @@ -440,7 +440,7 @@ prev(typename boost::graph_traits >::halfedge_descriptor h, { const typename Dual

    ::Primal& primal = dual.primal(); return opposite(next(h,primal),primal); -} +} template Iterator_range >::out_edge_iterator> @@ -459,7 +459,7 @@ in_edges(typename boost::graph_traits >::vertex_descriptor v, const typename Dual

    ::Primal& primal = dual.primal(); return opposite_edges_around_face(halfedge(v,primal),primal); } - + template typename boost::graph_traits >::degree_size_type out_degree(typename boost::graph_traits >::vertex_descriptor v, @@ -476,8 +476,8 @@ in_degree(typename boost::graph_traits >::vertex_descriptor v, { return out_degree(v,dual); } - - + + } // namespace CGAL #include diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index f362aef6e175..ae4345e4978e 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Philipp Moeller @@ -52,13 +52,13 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, } bool fnull = is_border(h,g); - + halfedge_descriptor hprev2 = hprev; while(hprev2 != gprev) { hprev2 = next(hprev2, g); set_face(hprev2, f, g); } - + if (! fnull) set_halfedge(f, hprev, g); set_halfedge(target(hprev,g), hprev, g); @@ -79,7 +79,7 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, /// @{ -/** +/** * joins the two vertices incident to `h`, (that is `source(h, g)` and * `target(h, g)`) and removes `source(h,g)`. Returns the predecessor * of `h` around the vertex, i.e., `prev(opposite(h,g))`. The @@ -98,8 +98,8 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, * \pre The size of the faces incident to `h` and `opposite(h,g)` is at least 4. * * \post `source(h, g)` is invalidated - * \post `h` is invalidated - * + * \post `h` is invalidated + * * \sa `split_vertex()` */ template @@ -152,7 +152,7 @@ join_vertex(typename boost::graph_traits::halfedge_descriptor h, -/** +/** * splits the target vertex `v` of `h1` and `h2`, and connects the new vertex * and `v` with a new edge. Let `hnew` be `opposite(next(h1, g), g)` after the * split. The split regroups the halfedges around the two vertices. The @@ -189,7 +189,7 @@ split_vertex(typename boost::graph_traits::halfedge_descriptor h1, CGAL_assertion(h1 != h2); CGAL_assertion(target(h1, g) == target(h2, g)); - typename boost::graph_traits::halfedge_descriptor + typename boost::graph_traits::halfedge_descriptor hnew = halfedge(add_edge(g), g), hnewopp = opposite(hnew, g); typename boost::graph_traits::vertex_descriptor @@ -197,8 +197,8 @@ split_vertex(typename boost::graph_traits::halfedge_descriptor h1, internal::insert_halfedge(hnew, h2, g); internal::insert_halfedge(hnewopp, h1, g); set_target(hnew, target(h1, g), g); - - typename boost::graph_traits::halfedge_descriptor + + typename boost::graph_traits::halfedge_descriptor end = hnewopp; do { @@ -225,7 +225,7 @@ split_edge(typename boost::graph_traits::halfedge_descriptor h, Graph& g) /** - * joins the two faces incident to `h` and `opposite(h,g)`. + * joins the two faces incident to `h` and `opposite(h,g)`. * The faces may be holes. * * If `Graph` is a model of `MutableFaceGraph` @@ -260,10 +260,10 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, /** * splits the face incident to `h1` and `h2`. Creates the opposite * halfedges `h3` and `h4`, such that `next(h1,g) == h3` and `next(h2,g) == h4`. - * Performs the inverse operation to `join_face()`. + * Performs the inverse operation to `join_face()`. * * If `Graph` is a model of `MutableFaceGraph` and if the update of faces is not disabled - * a new face incident to `h4` is added. + * a new face incident to `h4` is added. * * \image html split_face.svg * @@ -284,7 +284,7 @@ typename boost::graph_traits::halfedge_descriptor split_face(typename boost::graph_traits::halfedge_descriptor h1, typename boost::graph_traits::halfedge_descriptor h2, Graph& g) -{ +{ typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; @@ -296,23 +296,23 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, internal::set_face_in_face_loop(opposite(hnew,g), fnew, g); set_halfedge(face(hnew,g), hnew, g); set_halfedge(face(opposite(hnew,g),g), opposite(hnew,g), g); - return hnew; + return hnew; } - + /** * glues the cycle of halfedges of `h1` and `h2` together. * The vertices in the cycle of `h2` get removed. * If `h1` or `h2` are not border halfedges their faces get removed. * The vertices on the face cycle of `h1` get removed. - * The invariant `join_loop(h1, split_loop(h1,h2,h3,g), g)` returns `h1` and keeps + * The invariant `join_loop(h1, split_loop(h1,h2,h3,g), g)` returns `h1` and keeps * the graph unchanged. - * + * * \image html join_loop.svg * * \tparam Graph must be a `MutableFaceGraph` * - * \returns `h1`. + * \returns `h1`. * * \pre The faces incident to `h` and `g` are different and have equal number of edges. */ @@ -368,24 +368,24 @@ join_loop(typename boost::graph_traits::halfedge_descriptor h1, /** - * cuts the graph along the cycle `(h1,h2,h3)` changing the genus + * cuts the graph along the cycle `(h1,h2,h3)` changing the genus * (halfedge `h3` runs on the backside of the three dimensional figure below). * Three new vertices, three new pairs of halfedges, * and two new triangular faces are created. * - * `h1`, `h2`, and `h3` will be incident to the first new face. + * `h1`, `h2`, and `h3` will be incident to the first new face. * * Note that `split_loop()` does not deal with properties of new vertices, halfedges, and faces. * * \image html split_loop.svg - * + * * \tparam Graph must be a `MutableFaceGraph` * * \returns the halfedge incident to the second new face. * - * \pre `h1`, `h2`, and `h3` denote distinct, consecutive halfedges of the graph - * and form a cycle: i.e., `target(h1) == target(opposite(h2,g),g)`, … , - * `target(h3,g) == target(opposite(h1,g),g)`. + * \pre `h1`, `h2`, and `h3` denote distinct, consecutive halfedges of the graph + * and form a cycle: i.e., `target(h1) == target(opposite(h2,g),g)`, … , + * `target(h3,g) == target(opposite(h1,g),g)`. * \pre The six faces incident to `h1`, `h2`, and `h3` are all distinct. */ template @@ -481,10 +481,10 @@ split_loop(typename boost::graph_traits::halfedge_descriptor h1, /** - * removes the incident face of `h` and changes all halfedges incident to the face into border halfedges + * removes the incident face of `h` and changes all halfedges incident to the face into border halfedges * or removes them from the graph if they were already border halfedges. * - * If this creates isolated vertices they get removed as well. + * If this creates isolated vertices they get removed as well. * * \image html remove_face.svg * \image html remove_face_and_vertex.svg @@ -662,7 +662,7 @@ add_face(const VertexRange& vr, Graph& g) halfedges[i] = halfedge(ne, g); CGAL_assertion(halfedges[i] != boost::graph_traits::null_halfedge()); - set_face(opposite(halfedges[i], g), boost::graph_traits::null_face(), g); // as it may be recycled we have to reset it + set_face(opposite(halfedges[i], g), boost::graph_traits::null_face(), g); // as it may be recycled we have to reset it CGAL_assertion(source(halfedges[i], g) == vertices[i]); } } @@ -770,13 +770,13 @@ void make_hole(typename boost::graph_traits::halfedge_descriptor h, CGAL_precondition(! is_border(h,g)); face_descriptor fd = face(h, g); halfedge_around_face_iterator hafib, hafie; - for(boost::tie(hafib, hafie) = halfedges_around_face(h, g); - hafib != hafie; + for(boost::tie(hafib, hafie) = halfedges_around_face(h, g); + hafib != hafie; ++hafib){ CGAL_assertion(! is_border(opposite(*hafib,g),g)); internal::set_border(*hafib, g); } - remove_face(fd,g); + remove_face(fd,g); } @@ -799,9 +799,9 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, } -/** +/** * creates a barycentric triangulation of the face incident to `h`. Creates a new - * vertex and connects it to each vertex incident to `h` and splits `face(h, g)` + * vertex and connects it to each vertex incident to `h` and splits `face(h, g)` * into triangular faces. * `h` remains incident to * the original face. The time complexity is linear in the size of the face. @@ -809,10 +809,10 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, * \image html add_center_vertex.svg * * \returns the halfedge `next(h, g)` after the - * operation, i.e., a halfedge pointing to the new vertex. + * operation, i.e., a halfedge pointing to the new vertex. * - * Note that `add_center_vertex()` does not deal with properties of new vertices, - * halfedges, and faces. + * Note that `add_center_vertex()` does not deal with properties of new vertices, + * halfedges, and faces. * \pre `h` is not a border halfedge. * * \param g the graph @@ -824,7 +824,7 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, template typename boost::graph_traits::halfedge_descriptor add_center_vertex(typename boost::graph_traits::halfedge_descriptor h, - Graph& g) + Graph& g) { typedef typename boost::graph_traits Traits; typedef typename Traits::vertex_descriptor vertex_descriptor; @@ -856,10 +856,10 @@ add_center_vertex(typename boost::graph_traits::halfedge_descriptor h, /** * removes the vertex `target(h, g)` and all incident halfedges thereby merging all - * incident faces. The resulting face may not be triangulated. - * This function is the inverse operation of `add_center_vertex()`. - * The invariant `h == remove_center_vertex(add_center_vertex(h,g),g)` - * holds, if `h` is not a border halfedge. + * incident faces. The resulting face may not be triangulated. + * This function is the inverse operation of `add_center_vertex()`. + * The invariant `h == remove_center_vertex(add_center_vertex(h,g),g)` + * holds, if `h` is not a border halfedge. * * \image html remove_center_vertex.svg * @@ -883,7 +883,7 @@ add_center_vertex(typename boost::graph_traits::halfedge_descriptor h, template typename boost::graph_traits::halfedge_descriptor remove_center_vertex(typename boost::graph_traits::halfedge_descriptor h, - Graph& g) + Graph& g) { typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; @@ -912,12 +912,12 @@ remove_center_vertex(typename boost::graph_traits::halfedge_descriptor h, } /** - * appends a new face to the border halfedge `h2` by connecting - * the tip of `h2` with the tip of `h1` with two new halfedges and a new vertex - * and creating a new face that is incident to `h2`. - * Note that `add_vertex_and_face_to_border()` does not deal with properties of new + * appends a new face to the border halfedge `h2` by connecting + * the tip of `h2` with the tip of `h1` with two new halfedges and a new vertex + * and creating a new face that is incident to `h2`. + * Note that `add_vertex_and_face_to_border()` does not deal with properties of new * vertices, halfedges, and faces. - * + * * \image html add_vertex_and_face_to_border.svg * * \tparam Graph must be a model of `MutableFaceGraph` @@ -958,7 +958,7 @@ add_vertex_and_face_to_border(typename boost::graph_traits::halfedge_desc set_next(h2,ohe2,g); internal::set_border(he1,g); internal::set_border(he2,g); - + CGAL::Halfedge_around_face_iterator hafib,hafie; for(boost::tie(hafib, hafie) = halfedges_around_face(ohe1, g); hafib != hafie; @@ -971,9 +971,9 @@ add_vertex_and_face_to_border(typename boost::graph_traits::halfedge_desc /** - * appends a new face incident to the border halfedge `h1` and `h2` by connecting the vertex `target(h2,g)` - * and the vertex `target(h1,g)` with a new halfedge, and filling this separated part of the hole - * with a new face, such that the new face is incident to `h2`. + * appends a new face incident to the border halfedge `h1` and `h2` by connecting the vertex `target(h2,g)` + * and the vertex `target(h1,g)` with a new halfedge, and filling this separated part of the hole + * with a new face, such that the new face is incident to `h2`. * * \image html add_face_to_border.svg * @@ -981,8 +981,8 @@ add_vertex_and_face_to_border(typename boost::graph_traits::halfedge_desc * * \returns the halfedge of the new edge that is incident to the new face. * - * \pre `h1` and `h2` are border halfedges, - * \pre `h1 != h2`, + * \pre `h1` and `h2` are border halfedges, + * \pre `h1 != h2`, * \pre `next(h1,g) != h2`, * \pre `h1` and `h2` are on the same border. */ @@ -999,18 +999,18 @@ add_face_to_border(typename boost::graph_traits::halfedge_descriptor h1, typename boost::graph_traits::face_descriptor f = add_face(g); typename boost::graph_traits::edge_descriptor e = add_edge(g); - typename boost::graph_traits::halfedge_descriptor + typename boost::graph_traits::halfedge_descriptor newh= halfedge(e, g) , newhop = opposite(newh, g); set_next(newhop, next(h2, g), g); set_next(h2, newh, g); - + set_next(newh, next(h1, g), g); set_next(h1, newhop, g); - + set_target(newh, target(h1, g), g); set_target(newhop, target(h2, g), g); @@ -1019,8 +1019,8 @@ add_face_to_border(typename boost::graph_traits::halfedge_descriptor h1, internal::set_border(newhop, g); CGAL::Halfedge_around_face_iterator hafib,hafie; - for(boost::tie(hafib, hafie) = halfedges_around_face(newh, g); - hafib != hafie; + for(boost::tie(hafib, hafie) = halfedges_around_face(newh, g); + hafib != hafie; ++hafib){ set_face(*hafib, f, g); } @@ -1065,7 +1065,7 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, halfedge_descriptor qp = opposite(pq, g); halfedge_descriptor pt = opposite(prev(pq, g), g); halfedge_descriptor qb = opposite(prev(qp, g), g); - + bool lTopFaceExists = ! is_border(pq,g); bool lBottomFaceExists = ! is_border(qp,g); bool lTopLeftFaceExists = lTopFaceExists && ! is_border(pt,g); @@ -1081,19 +1081,19 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, bool lP_Erased = false; if ( lTopFaceExists ) - { + { CGAL_precondition( ! is_border(opposite(pt, g),g) ) ; // p-q-t is a face of the mesh if ( lTopLeftFaceExists ) { - //CGAL_ECMS_TRACE(3, "Removing p-t E" << pt.idx() << " (V" - // << p.idx() << "->V" << target(pt, g).idx() + //CGAL_ECMS_TRACE(3, "Removing p-t E" << pt.idx() << " (V" + // << p.idx() << "->V" << target(pt, g).idx() // << ") by joining top-left face" ) ; join_face(pt,g); } else { - //CGAL_ECMS_TRACE(3, "Removing p-t E" << pt.idx() << " (V" << p.idx() + //CGAL_ECMS_TRACE(3, "Removing p-t E" << pt.idx() << " (V" << p.idx() // << "->V" << target(pt, g).idx() << ") by erasing top face" ) ; remove_face(opposite(pt, g),g); @@ -1104,24 +1104,24 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, lP_Erased = true ; } - } + } } if ( lBottomFaceExists ) - { + { CGAL_precondition( ! is_border(opposite(qb, g),g) ) ; // p-q-b is a face of the mesh if ( lBottomRightFaceExists ) { - //CGAL_ECMS_TRACE(3, "Removing q-b E" << qb.idx() << " (V" - // << q.idx() << "->V" << target(qb, g).idx() + //CGAL_ECMS_TRACE(3, "Removing q-b E" << qb.idx() << " (V" + // << q.idx() << "->V" << target(qb, g).idx() // << ") by joining bottom-right face" ) ; join_face(qb,g); } else { - //CGAL_ECMS_TRACE(3, "Removing q-b E" << qb.idx() << " (V" - // << q.idx() << "->V" << target(qb, g).idx() + //CGAL_ECMS_TRACE(3, "Removing q-b E" << qb.idx() << " (V" + // << q.idx() << "->V" << target(qb, g).idx() // << ") by erasing bottom face" ) ; if ( !lTopFaceExists ) @@ -1143,7 +1143,7 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, join_vertex(pq,g); lP_Erased = true ; - } + } CGAL_expensive_assertion(is_valid_polygon_mesh(g)); @@ -1155,18 +1155,18 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, * * Let `h` be the halfedge of `e`, and let `v0` and `v1` be the source and target vertices of `h`. * Collapses the edge `e` replacing it with `v1`, as described in the paragraph above - * and guarantees that an edge `e2`, for which `get(edge_is_constrained_map, e2)==true`, + * and guarantees that an edge `e2`, for which `get(edge_is_constrained_map, e2)==true`, * is not removed after the collapse. - * + * * \tparam Graph must be a model of `MutableFaceGraph` - * \tparam EdgeIsConstrainedMap mut be a model of `ReadablePropertyMap` with the edge descriptor of `Graph` - * as key type and a Boolean as value type. It indicates if an edge is constrained or not. + * \tparam EdgeIsConstrainedMap mut be a model of `ReadablePropertyMap` with the edge descriptor of `Graph` + * as key type and a Boolean as value type. It indicates if an edge is constrained or not. * * \returns vertex `v1`. - * \pre This function requires `g` to be an oriented 2-manifold with or without boundaries. - * Furthermore, the edge `v0v1` must satisfy the link condition, which guarantees that the surface mesh is also 2-manifold after the edge collapse. - * \pre `get(edge_is_constrained_map, v0v1)==false`. - * \pre `v0` and `v1` are not both incident to a constrained edge. + * \pre This function requires `g` to be an oriented 2-manifold with or without boundaries. + * Furthermore, the edge `v0v1` must satisfy the link condition, which guarantees that the surface mesh is also 2-manifold after the edge collapse. + * \pre `get(edge_is_constrained_map, v0v1)==false`. + * \pre `v0` and `v1` are not both incident to a constrained edge. */ template @@ -1305,8 +1305,8 @@ flip_edge(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; - vertex_descriptor s = source(h,g); - vertex_descriptor t = target(h,g); + vertex_descriptor s = source(h,g); + vertex_descriptor t = target(h,g); halfedge_descriptor nh = next(h,g), nnh = next(nh,g), oh = opposite(h,g), noh = next(oh,g), nnoh = next(noh,g); vertex_descriptor s2 = target(nh,g), t2 = target(noh,g); face_descriptor fh = face(h,g), foh = face(oh,g); diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index 07ed312307f4..5eade0abdeea 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -432,7 +432,7 @@ class Seam_mesh friend bool operator==(edge_descriptor e1, edge_descriptor e2) { - return (e1.hd == e2.hd) || (e1.hd == e2.mesh_->opposite(e2.hd)); + return (e1.hd == e2.hd) || (e1.hd == e2.mesh_->opposite(e2.hd)); } friend bool operator!=(edge_descriptor e1, edge_descriptor e2) diff --git a/BGL/include/CGAL/boost/graph/backward_compatibility_functions.h b/BGL/include/CGAL/boost/graph/backward_compatibility_functions.h index 3b5af8e7451c..0553f01daca4 100644 --- a/BGL/include/CGAL/boost/graph/backward_compatibility_functions.h +++ b/BGL/include/CGAL/boost/graph/backward_compatibility_functions.h @@ -50,10 +50,10 @@ namespace CGAL { , const Graph& g) { typename boost::graph_traits::halfedge_descriptor h = halfedge(e, g); - + return edge(prev(opposite(h, g), g), g); } - + template struct halfedge_graph_traits; @@ -63,7 +63,7 @@ namespace CGAL { { return edges(g); } - + } //end of namespace CGAL #endif //CGAL_BOOST_GRAPH_BACKWARD_COMPATIBILITY_FUNCTIONS_H diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index 84ec4184dfb9..da18703dceb0 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -225,9 +225,9 @@ struct Output_iterator_functor { put(map, pair.first, pair.second); } - + }; - + template boost::function_output_iterator > make_functor(PMAP map) { @@ -255,13 +255,13 @@ inline Emptyset_iterator make_functor(const internal_np::Param_not_found&) \tparam TargetMesh a model of `FaceListGraph` \tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" \tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" - + The types `sm_vertex_descriptor` and `sm_face_descriptor` must be models of the concept `Hashable`. \param sm the source mesh \param tm the target mesh \param np1 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below - + \cgalNamedParamsBegin \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `sm` . @@ -269,30 +269,30 @@ inline Emptyset_iterator make_functor(const internal_np::Param_not_found&) `CGAL::vertex_point_t` should be available in `SourceMesh` \cgalParamEnd \cgalParamBegin{vertex_to_vertex_output_iterator} an `OutputIterator` containing the - pairs source-vertex, target-vertex. If this parameter is given, then + pairs source-vertex, target-vertex. If this parameter is given, then `vertex_to_vertex_map` cannot be used. \cgalParamEnd \cgalParamBegin{halfedge_to_halfedge_output_iterator} an `OutputIterator` containing the - pairs source-halfedge, target-halfedge. If this parameter is given, then + pairs source-halfedge, target-halfedge. If this parameter is given, then `halfedge_to_halfedge_map` cannot be used. \cgalParamEnd \cgalParamBegin{face_to_face_output_iterator} an `OutputIterator` containing the - pairs source-face, target-face. If this parameter is given, then + pairs source-face, target-face. If this parameter is given, then `face_to_face_map` cannot be used. \cgalParamEnd \cgalParamBegin{vertex_to_vertex_map} a `ReadWritePropertyMap` containing the - pairs source-vertex, target-vertex. + pairs source-vertex, target-vertex. \cgalParamEnd \cgalParamBegin{halfedge_to_halfedge_map} a `ReadWritePropertyMap` containing the - pairs source-halfedge, target-halfedge. + pairs source-halfedge, target-halfedge. \cgalParamEnd \cgalParamBegin{face_to_face_map} a `ReadWritePropertyMap` containing the - pairs source-face, target-face. + pairs source-face, target-face. \cgalParamEnd \cgalNamedParamsEnd - + \param np2 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below - + \cgalNamedParamsBegin \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm`. @@ -310,7 +310,7 @@ inline Emptyset_iterator make_functor(const internal_np::Param_not_found&) */ template -void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, const CGAL::Named_function_parameters& np) { copy_face_graph(sm, tm, np, parameters::all_default()); diff --git a/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp b/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp index 90a72cd0c004..5b5e0bd472fc 100644 --- a/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp +++ b/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp @@ -62,7 +62,7 @@ namespace boost { * @param old_distance the previous distance to @p vertex */ template - inline void + inline void dijkstra_queue_update(Buffer& Q, Vertex vertex, DistanceType old_distance) { (void)old_distance; @@ -197,7 +197,7 @@ namespace boost { // The test here is equivalent to e_weight < 0 if m_combine has a // cancellation law, but always returns false when m_combine is a // projection operator. - if (m_compare(m_combine(m_zero, get(m_weight, e)), m_zero)) + if (m_compare(m_combine(m_zero, get(m_weight, e)), m_zero)) boost::throw_exception(negative_edge()); // End of test for negative-weight edges. @@ -416,7 +416,7 @@ namespace boost { template inline void dijkstra_shortest_paths @@ -439,7 +439,7 @@ namespace boost { template inline void dijkstra_shortest_paths diff --git a/BGL/include/CGAL/boost/graph/graph_concepts.h b/BGL/include/CGAL/boost/graph/graph_concepts.h index d84ac653270a..d9deed254e5e 100644 --- a/BGL/include/CGAL/boost/graph/graph_concepts.h +++ b/BGL/include/CGAL/boost/graph/graph_concepts.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Philipp Moeller @@ -54,9 +54,9 @@ BOOST_concept(HalfedgeGraph,(G)) h = next(h, cg); h = prev(h, cg); } - + G g; - + typename boost::graph_traits::vertex_descriptor v, u; typename boost::graph_traits::edge_descriptor e; typename boost::graph_traits::halfedge_descriptor h; @@ -68,7 +68,7 @@ BOOST_concept(HalfedgeListGraph,(G)) { typedef typename boost::graph_traits::halfedge_iterator halfedge_iterator; typedef typename boost::graph_traits::halfedges_size_type halfedges_size_type; - + BOOST_CONCEPT_USAGE(HalfedgeListGraph) { // BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator)); @@ -84,7 +84,7 @@ BOOST_concept(HalfedgeListGraph,(G)) p = halfedges(cg); this->h = *p.first; } - + G g; halfedges_size_type h_num; std::pair p; diff --git a/BGL/include/CGAL/boost/graph/halfedge_graph_traits.h b/BGL/include/CGAL/boost/graph/halfedge_graph_traits.h index 79dd7b0924cc..b70107308b49 100644 --- a/BGL/include/CGAL/boost/graph/halfedge_graph_traits.h +++ b/BGL/include/CGAL/boost/graph/halfedge_graph_traits.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index dc7f4977226a..81b77ff82d18 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Andreas Fabri #ifndef CGAL_BOOST_GRAPH_HELPERS_H @@ -24,7 +24,7 @@ namespace CGAL { /*! \ingroup PkgBGLHelperFct - returns `true` if the halfedge `hd` is on a border. + returns `true` if the halfedge `hd` is on a border. */ template bool is_border(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) @@ -34,7 +34,7 @@ bool is_border(typename boost::graph_traits::halfedge_descriptor hd, /*! \ingroup PkgBGLHelperFct - returns `true` if the halfedge `hd` or the opposite halfedge is on a border. + returns `true` if the halfedge `hd` or the opposite halfedge is on a border. */ template bool is_border_edge(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) @@ -44,7 +44,7 @@ bool is_border_edge(typename boost::graph_traits::halfedge_descriptor /*! \ingroup PkgBGLHelperFct - returns `true` if the edge `e` is on a border. + returns `true` if the edge `e` is on a border. */ template bool is_border(typename boost::graph_traits::edge_descriptor ed, const FaceGraph& g) @@ -54,7 +54,7 @@ bool is_border(typename boost::graph_traits::edge_descriptor ed, cons /*! \ingroup PkgBGLHelperFct - returns a halfedge which is on a border and whose target vertex is `vd`, if such a halfedge exists. + returns a halfedge which is on a border and whose target vertex is `vd`, if such a halfedge exists. */ template boost::optional::halfedge_descriptor> @@ -75,7 +75,7 @@ is_border(typename boost::graph_traits::vertex_descriptor vd, /*! \ingroup PkgBGLHelperFct - returns `true` if there are no border edges. + returns `true` if there are no border edges. */ template bool is_closed(const FaceGraph& g) @@ -91,8 +91,8 @@ bool is_closed(const FaceGraph& g) /*! \ingroup PkgBGLHelperFct - returns `true` if the target of `hd` has exactly two incident edges. - */ + returns `true` if the target of `hd` has exactly two incident edges. + */ template bool is_bivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) { @@ -101,10 +101,10 @@ bool is_bivalent(typename boost::graph_traits::halfedge_descriptor hd /*! \ingroup PkgBGLHelperFct - returns `true` if all vertices have exactly two incident edges. - */ + returns `true` if all vertices have exactly two incident edges. + */ template - bool is_bivalent_mesh(const FaceGraph& g) + bool is_bivalent_mesh(const FaceGraph& g) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -120,21 +120,21 @@ template /*! \ingroup PkgBGLHelperFct - returns `true` if the target of `hd` has exactly three incident edges. - */ + returns `true` if the target of `hd` has exactly three incident edges. + */ template bool is_trivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) { return hd == opposite(next(opposite(next(opposite(next(hd,g),g),g),g),g),g); } - + /*! \ingroup PkgBGLHelperFct - returns `true` if all - vertices have exactly three incident edges. - */ + returns `true` if all + vertices have exactly three incident edges. + */ template - bool is_trivalent_mesh(const FaceGraph& g) + bool is_trivalent_mesh(const FaceGraph& g) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -150,12 +150,12 @@ template /*! \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a triangle. + returns `true` iff the connected component denoted by `hd` is a triangle. \pre `g` must be valid. - */ + */ template - bool is_isolated_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ + bool is_isolated_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +{ typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; halfedge_descriptor beg = hd; if(is_border(hd,g)) return false; @@ -168,7 +168,7 @@ template /*! \ingroup PkgBGLHelperFct - returns `true` iff the face denoted by `hd` is a triangle, that is it has three incident halfedges. + returns `true` iff the face denoted by `hd` is a triangle, that is it has three incident halfedges. */ template bool is_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) @@ -178,10 +178,10 @@ bool is_triangle(typename boost::graph_traits::halfedge_descriptor hd /*! \ingroup PkgBGLHelperFct - returns `true` if all faces are triangles. - */ + returns `true` if all faces are triangles. + */ template - bool is_triangle_mesh(const FaceGraph& g) + bool is_triangle_mesh(const FaceGraph& g) { typedef typename boost::graph_traits::face_descriptor face_descriptor; for(face_descriptor fd : faces(g)){ @@ -194,7 +194,7 @@ template /*! \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a quadrilateral. + returns `true` iff the connected component denoted by `hd` is a quadrilateral. */ template bool is_isolated_quad(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) @@ -212,7 +212,7 @@ bool is_isolated_quad(typename boost::graph_traits::halfedge_descript /*! \ingroup PkgBGLHelperFct - returns `true` iff the face denoted by `hd` is a quad, that is it has four incident halfedges. + returns `true` iff the face denoted by `hd` is a quad, that is it has four incident halfedges. */ template bool is_quad(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) @@ -222,10 +222,10 @@ bool is_quad(typename boost::graph_traits::halfedge_descriptor hd, co /*! \ingroup PkgBGLHelperFct - returns `true` if all faces are quadrilaterals. - */ + returns `true` if all faces are quadrilaterals. + */ template - bool is_quad_mesh(const FaceGraph& g) + bool is_quad_mesh(const FaceGraph& g) { typedef typename boost::graph_traits::face_descriptor face_descriptor; for(face_descriptor fd : faces(g)){ @@ -235,13 +235,13 @@ template } return true; } - + /*! \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a tetrahedron. - */ + returns `true` iff the connected component denoted by `hd` is a tetrahedron. + */ template -bool is_tetrahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +bool is_tetrahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -695,10 +695,10 @@ bool is_valid_polygon_mesh(const Mesh& g, bool verb = false) /*! \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a hexahedron. - */ + returns `true` iff the connected component denoted by `hd` is a hexahedron. + */ template -bool is_hexahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +bool is_hexahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -861,7 +861,7 @@ void swap_edges( * * If the graph has a member function `clear()`, it will be called * instead. - * + * * @tparam FaceGraph model of `MutableHalfedgeGraph` and `MutableFaceGraph` * * @param g the graph to clear @@ -869,7 +869,7 @@ void swap_edges( **/ template void clear(FaceGraph& g) -{ +{ internal::clear_impl(g); CGAL_postcondition(std::distance(boost::begin(edges(g)),boost::end(edges(g))) == 0); CGAL_postcondition(std::distance(boost::begin(vertices(g)),boost::end(vertices(g))) == 0); diff --git a/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h b/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h index f9b0fff2c98d..71b798cc79ca 100644 --- a/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h +++ b/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Philipp Moeller @@ -46,19 +46,19 @@ class OM_iterator_from_circulator { typedef typename I__traits::iterator_category iterator_category; - typedef typename + typedef typename boost::mpl::if_c< Prevent_deref , C , typename C::value_type >::type value_type; typedef typename C::difference_type difference_type; - typedef typename + typedef typename boost::mpl::if_c< Prevent_deref , C& , typename C::reference >::type reference; - typedef typename + typedef typename boost::mpl::if_c< Prevent_deref , C* , typename C::reference @@ -80,7 +80,7 @@ class OM_iterator_from_circulator { CGAL_assertion( m_anchor == i.m_anchor); // same anchor? return (done() && i.done()) || (((!done()) && (!i.done())) && ( current == i.current)); } - + bool operator!=( const Self& i) const { return !(*this == i); } @@ -105,7 +105,7 @@ class OM_iterator_from_circulator { reference operator*() const { return indirection(); } - + private: template typename boost::disable_if_c::type diff --git a/BGL/include/CGAL/boost/graph/internal/helpers.h b/BGL/include/CGAL/boost/graph/internal/helpers.h index d39bff1110a2..98d3c7ec28bc 100644 --- a/BGL/include/CGAL/boost/graph/internal/helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/helpers.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Andread Fabri #ifndef CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H @@ -95,16 +95,16 @@ template void remove_tip(typename boost::graph_traits::halfedge_descriptor const& h , Graph& g) -{ +{ set_next(h, next(opposite(next(h, g), g), g), g); } template -void -set_face_in_face_loop(typename boost::graph_traits::halfedge_descriptor h, - typename boost::graph_traits::face_descriptor f, - Graph& g) +void +set_face_in_face_loop(typename boost::graph_traits::halfedge_descriptor h, + typename boost::graph_traits::face_descriptor f, + Graph& g) { typename boost::graph_traits::halfedge_descriptor end = h; do { @@ -112,7 +112,7 @@ set_face_in_face_loop(typename boost::graph_traits::halfedge_descriptor h h = next(h, g); } while ( h != end); } - + template void insert_halfedge(typename boost::graph_traits::halfedge_descriptor const& h @@ -127,7 +127,7 @@ void insert_halfedge(typename boost::graph_traits::halfedge_descriptor co template std::size_t exact_num_vertices(const Graph& g) -{ +{ typename boost::graph_traits::vertex_iterator beg, end; boost::tie(beg,end) = vertices(g); return std::distance(beg,end); @@ -136,7 +136,7 @@ exact_num_vertices(const Graph& g) template std::size_t exact_num_halfedges(const Graph& g) -{ +{ typename boost::graph_traits::halfedge_iterator beg, end; boost::tie(beg,end) = halfedges(g); return std::distance(beg,end); @@ -145,7 +145,7 @@ exact_num_halfedges(const Graph& g) template std::size_t exact_num_edges(const Graph& g) -{ +{ typename boost::graph_traits::edge_iterator beg, end; boost::tie(beg,end) = edges(g); return std::distance(beg,end); @@ -154,7 +154,7 @@ exact_num_edges(const Graph& g) template std::size_t exact_num_faces(const Graph& g) -{ +{ typename boost::graph_traits::face_iterator beg, end; boost::tie(beg,end) = faces(g); return std::distance(beg,end); diff --git a/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h index e392ff064a08..928c2c7bc764 100644 --- a/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // Author(s) : Mael Rouxel-Labbé // Maxime Gimeno diff --git a/BGL/include/CGAL/boost/graph/io.h b/BGL/include/CGAL/boost/graph/io.h index dd41b28a65f4..5d5d519de80b 100644 --- a/BGL/include/CGAL/boost/graph/io.h +++ b/BGL/include/CGAL/boost/graph/io.h @@ -30,13 +30,13 @@ namespace CGAL { /*! \ingroup PkgBGLIOFct writes the graph `g` in the wrl format (VRML 2.0). - + \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`. * If this parameter is omitted, an internal property map for * `CGAL::vertex_point_t` should be available in `FaceGraph`\cgalParamEnd * \cgalNamedParamsEnd - */ + */ template bool write_wrl(std::ostream& os, const FaceGraph& g, @@ -48,14 +48,14 @@ bool write_wrl(std::ostream& os, using parameters::get_parameter; using parameters::choose_parameter; - + typename CGAL::GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, g)); boost::container::flat_map reindex; int n = 0; - + os << "#VRML V2.0 utf8\n" "Group {\n" "children [\n" @@ -109,23 +109,23 @@ template bool write_wrl(std::ostream& os, const FaceGraph& g) { - return write_wrl(os, g, + return write_wrl(os, g, parameters::all_default()); } - + /*! \ingroup PkgBGLIOFct writes the graph `g` in the OFF format. - + \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`. * If this parameter is omitted, an internal property map for * `CGAL::vertex_point_t` should be available in `FaceGraph`\cgalParamEnd * \cgalNamedParamsEnd - + \sa Overloads of this function for specific models of the concept `FaceGraph`. - */ + */ template bool write_off(std::ostream& os, const FaceGraph& g, @@ -138,7 +138,7 @@ bool write_off(std::ostream& os, using parameters::choose_parameter; using parameters::get_parameter; - + typename CGAL::GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, g)); @@ -152,7 +152,7 @@ bool write_off(std::ostream& os, os << get(vpm,v) << '\n'; reindex[v]=n++; } - + for(face_descriptor f : faces(g)){ os << degree(f,g); for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){ @@ -169,7 +169,7 @@ bool write_off(std::ostream& os, writes the graph `g` in the OFF format into a file named `fname`. \sa Overloads of this function for specific models of the concept `FaceGraph`. - */ + */ template bool write_off(const char* fname, const FaceGraph& g, @@ -193,7 +193,7 @@ template bool write_off(std::ostream& os, const FaceGraph& g) { - return write_off(os, g, + return write_off(os, g, parameters::all_default()); } template @@ -207,11 +207,11 @@ bool write_off(const char* fname, template bool write_off(const std::string& fname, const FaceGraph& g) -{ return write_off(fname, g, +{ return write_off(fname, g, parameters::all_default()); } namespace internal { namespace read_off_tools { - + inline bool is_whitespace(const std::string& s) { for(unsigned int i=0; i < s.size(); i++){ @@ -221,7 +221,7 @@ bool write_off(const std::string& fname, } return true; } - + inline std::string next_non_comment(std::istream& is) { std::string line; @@ -238,7 +238,7 @@ inline std::string next_non_comment(std::istream& is) /*! \ingroup PkgBGLIOFct reads the graph `g` from data in the OFF format. Ignores comment lines which start with a hash, and lines with whitespace. - + \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`. * If this parameter is omitted, an internal property map for @@ -248,7 +248,7 @@ inline std::string next_non_comment(std::istream& is) \pre The data must represent a 2-manifold \attention The graph `g` is not cleared, and the data from the stream are added. - */ + */ template bool read_off(std::istream& is, FaceGraph& g, @@ -264,13 +264,13 @@ bool read_off(std::istream& is, typedef typename CGAL::GetVertexPointMap::type Vpm; typedef typename boost::property_traits::value_type Point_3; - + Vpm vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_property_map(CGAL::vertex_point, g)); vertices_size_type nv, nvf; faces_size_type nf; int ignore; - + std::string line = next_non_comment(is); { std::istringstream iss(line); @@ -283,7 +283,7 @@ bool read_off(std::istream& is, std::istringstream iss(line); iss >> nv >> nf >> ignore; } - + std::vector vertices(nv); Point_3 p; for(vertices_size_type i=0; i < nv; i++){ @@ -323,7 +323,7 @@ bool read_off(std::istream& is, \pre The data must represent a 2-manifold \attention The graph `g` is not cleared, and the data from the stream are added. - */ + */ template bool read_off(const char* fname, FaceGraph& g, @@ -347,12 +347,12 @@ template bool read_off(const std::string& fname, FaceGraph& g, NamedParameters np) -{ return read_off(fname.c_str(), g, np); } +{ return read_off(fname.c_str(), g, np); } template bool read_off(const std::string& fname, FaceGraph& g) -{ return read_off(fname, g, parameters::all_default()); } +{ return read_off(fname, g, parameters::all_default()); } template bool write_inp(std::ostream& os, diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index 5bfda3c28538..c5df26262527 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Andreas Fabri @@ -30,7 +30,7 @@ namespace internal { template struct Edge { - const G* g; + const G* g; Edge() : g(nullptr) @@ -51,7 +51,7 @@ struct Edge { template struct Opposite_edge { - const G* g; + const G* g; Opposite_edge() : g(nullptr) @@ -72,7 +72,7 @@ struct Opposite_edge { template struct Opposite_halfedge { - const G* g; + const G* g; Opposite_halfedge() : g(nullptr) @@ -93,7 +93,7 @@ struct Opposite_halfedge { template struct Target { - const G* g; + const G* g; Target() : g(nullptr) @@ -114,7 +114,7 @@ struct Target { template struct Source { - const G* g; + const G* g; Source() : g(nullptr) @@ -135,7 +135,7 @@ struct Source { template struct Face { - const G* g; + const G* g; Face() : g(nullptr) @@ -155,7 +155,7 @@ struct Face { }; template struct Opposite_face { - const G* g; + const G* g; Opposite_face() : g(nullptr) @@ -179,8 +179,8 @@ struct Opposite_face { /** * \ingroup PkgBGLIterators * A bidirectional iterator with value type `boost::graph_traits::%halfedge_descriptor` over all halfedges having the same vertex as source. - * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_source_iterator` `havi` with `h = *havi;` - * the following holds: Either `++havi` is the past the end iterator, or `next(opposite(h,g),g) == *++havi`. + * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_source_iterator` `havi` with `h = *havi;` + * the following holds: Either `++havi` is the past the end iterator, or `next(opposite(h,g),g) == *++havi`. * \tparam Graph must be a model of the concept `HalfedgeGraph` * \cgalModels `BidirectionalIterator` */ @@ -197,12 +197,12 @@ class Halfedge_around_source_iterator { typedef const value_type& reference; typedef std::ptrdiff_t difference_type; -private: +private: halfedge_descriptor anchor, pos; const Graph* g; int winding; -#endif - +#endif + public: Halfedge_around_source_iterator() : anchor(), pos(), g(0) @@ -229,7 +229,7 @@ class Halfedge_around_source_iterator { CGAL_assertion( anchor == anchor); return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); } - + bool operator!=( const Self& i) const { return !(*this == i); } @@ -277,8 +277,8 @@ class Halfedge_around_source_iterator { /** * \ingroup PkgBGLIterators * A bidirectional iterator with value type `boost::graph_traits::%halfedge_descriptor` over all halfedges having the same vertex as target. - * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_target_iterator` `havi` with `h = *havi;` - * the following holds: Either `++havi` is the past the end iterator, or `opposite(next(h,g),g) == *++havi`. + * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_target_iterator` `havi` with `h = *havi;` + * the following holds: Either `++havi` is the past the end iterator, or `opposite(next(h,g),g) == *++havi`. * \tparam Graph must be a model of the concept `HalfedgeGraph` * \cgalModels `BidirectionalIterator` */ @@ -297,12 +297,12 @@ class Halfedge_around_target_iterator { typedef const value_type& reference; typedef std::ptrdiff_t difference_type; -private: +private: halfedge_descriptor anchor, pos; const Graph* g; int winding; -#endif - +#endif + public: Halfedge_around_target_iterator() : anchor(), pos(), g(0) @@ -329,7 +329,7 @@ class Halfedge_around_target_iterator { CGAL_assertion( anchor == anchor); return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); } - + bool operator!=( const Self& i) const { return !(*this == i); } @@ -378,7 +378,7 @@ class Halfedge_around_target_iterator { /** * \ingroup PkgBGLIterators * A bidirectional iterator with value type `boost::graph_traits::%halfedge_descriptor` over all halfedges incident to the same face or border. - * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_face_iterator` `hafi` with `h = *hafi` + * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_face_iterator` `hafi` with `h = *hafi` * the following holds: Either `++hafi` is the past the end iterator, or `next(h,g) == *++hafi`. * \tparam Graph must be a model of the concept `HalfedgeGraph` * \cgalModels `BidirectionalIterator` @@ -386,7 +386,7 @@ class Halfedge_around_target_iterator { template class Halfedge_around_face_iterator { -#ifndef DOXYGEN_RUNNING +#ifndef DOXYGEN_RUNNING typedef Halfedge_around_face_iterator Self; public: @@ -396,9 +396,9 @@ class Halfedge_around_face_iterator { typedef value_type* pointer; typedef value_type& reference; typedef std::ptrdiff_t difference_type; - + #endif - + Halfedge_around_face_iterator() : pos(), g(0) {} @@ -433,7 +433,7 @@ class Halfedge_around_face_iterator { return !(*this == i); } - Self& operator++() + Self& operator++() { CGAL_assertion(g != nullptr); pos = next(pos,*g); @@ -442,7 +442,7 @@ class Halfedge_around_face_iterator { return *this; } - Self operator++(int) + Self operator++(int) { CGAL_assertion(g != nullptr); Self tmp = *this; @@ -450,17 +450,17 @@ class Halfedge_around_face_iterator { return tmp; } - Self& operator--() + Self& operator--() { - CGAL_assertion(g != nullptr); + CGAL_assertion(g != nullptr); if ( pos == anchor) --winding; - + pos = prev(pos,*g); return *this; } - Self operator--(int) + Self operator--(int) { CGAL_assertion(g != nullptr); Self tmp = *this; @@ -481,8 +481,8 @@ class Halfedge_around_target_circulator; /** * \ingroup PkgBGLIterators * A bidirectional circulator with value type `boost::graph_traits::%halfedge_descriptor` over all halfedges having the same vertex as source. - * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_source_circulator` `havc` with `h = *havc;` - * the following holds: `next(opposite(h,g),g) == *++havc`. + * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_source_circulator` `havc` with `h = *havc;` + * the following holds: `next(opposite(h,g),g) == *++havc`. * \tparam Graph must be a model of the concept `HalfedgeGraph` * \cgalModels `BidirectionalCirculator` */ @@ -525,24 +525,24 @@ class Halfedge_around_source_circulator // design patter: "safe bool" // will be replaced by explicit operator bool with C++11 typedef void (Halfedge_around_source_circulator::*bool_type)() const; - + void this_type_does_not_support_comparisons() const {} - + operator bool_type() const { return (! (this->base_reference() == nullptr)) ? &Halfedge_around_source_circulator::this_type_does_not_support_comparisons : 0; } - + bool operator== (void*) const { return this->base_reference() == nullptr; } - + private: friend class boost::iterator_core_access; typename boost::graph_traits::halfedge_descriptor dereference() const { return opp(*this->base_reference()); } -}; +}; /** @@ -603,14 +603,14 @@ class Face_around_target_circulator typename boost::graph_traits::face_descriptor dereference() const { return fct(*this->base_reference()); } #endif -}; +}; /** * \ingroup PkgBGLIterators * A bidirectional circulator with value type `boost::graph_traits::%halfedge_descriptor` over all halfedges having the same vertex as target. - * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_target_circulator` `havc` with `h = *havc;` - * the following holds: `opposite(next(h,g),g) == *++havc`. + * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_target_circulator` `havc` with `h = *havc;` + * the following holds: `opposite(next(h,g),g) == *++havc`. * \tparam Graph must be a model of the concept `HalfedgeGraph` * \cgalModels `BidirectionalCirculator` */ @@ -631,7 +631,7 @@ class Halfedge_around_target_circulator { typedef value_type& reference; typedef std::ptrdiff_t difference_type; typedef std::size_t size_type; -#endif +#endif Halfedge_around_target_circulator() : g(0) @@ -673,15 +673,15 @@ class Halfedge_around_target_circulator { return g == nullptr; } - - Self& operator++() + + Self& operator++() { CGAL_assertion(g != nullptr); pos = opposite(next(pos,*g),*g); return *this; } - Self operator++(int) + Self operator++(int) { CGAL_assertion(g != nullptr); Self tmp = *this; @@ -689,14 +689,14 @@ class Halfedge_around_target_circulator { return tmp; } - Self& operator--() + Self& operator--() { CGAL_assertion(g != nullptr); pos = prev(opposite(pos,*g),*g); return *this; } - Self operator--(int) + Self operator--(int) { CGAL_assertion(g != nullptr); Self tmp = *this; @@ -714,7 +714,7 @@ class Halfedge_around_target_circulator { /** * \ingroup PkgBGLIterators * A bidirectional circulator with value type `boost::graph_traits::%halfedge_descriptor` over all halfedges incident to the same face or border. - * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_face_circulator` `hafc` with `h = *hafc` + * Let `h` be a halfedge of graph `g`. For a `Halfedge_around_face_circulator` `hafc` with `h = *hafc` * the following holds: `next(h,g) == *++hafc`. * \tparam Graph must be a model of the concept `HalfedgeGraph` * \cgalModels `BidirectionalCirculator` @@ -733,8 +733,8 @@ class Halfedge_around_face_circulator { typedef value_type& reference; typedef std::ptrdiff_t difference_type; typedef std::size_t size_type; -#endif - +#endif + Halfedge_around_face_circulator() : pos(), g(0) {} @@ -750,7 +750,7 @@ class Halfedge_around_face_circulator { bool operator == ( const Self& other) const { return g == other.g && pos == other.pos; } bool operator != ( const Self& other) const { return g != other.g || pos != other.pos; } - + // design patter: "safe bool" // will be replaced by explicit operator bool with C++11 @@ -769,14 +769,14 @@ class Halfedge_around_face_circulator { return g == nullptr; } - Self& operator++() + Self& operator++() { CGAL_assertion(g != nullptr); pos = next(pos,*g); return *this; } - Self operator++(int) + Self operator++(int) { CGAL_assertion(g != nullptr); Self tmp = *this; @@ -784,14 +784,14 @@ class Halfedge_around_face_circulator { return tmp; } - Self& operator--() + Self& operator--() { CGAL_assertion(g != nullptr); pos = prev(pos,*g); return *this; } - Self operator--(int) + Self operator--(int) { CGAL_assertion(g != nullptr); Self tmp = *this; @@ -806,7 +806,7 @@ class Halfedge_around_face_circulator { }; -/** +/** * \ingroup PkgBGLIterators * returns an iterator range over all halfedges with vertex `source(h,g)` as source. */ @@ -818,7 +818,7 @@ halfedges_around_source(typename boost::graph_traits::halfedge_descriptor return make_range(I(h,g), I(h,g,1)); } -/** +/** * \ingroup PkgBGLIterators * returns an iterator range over all halfedges with vertex `v` as source. */ @@ -829,9 +829,9 @@ halfedges_around_source(typename boost::graph_traits::vertex_descriptor v return halfedges_around_source(opposite(halfedge(v,g),g),g); } -/** +/** * \ingroup PkgBGLIterators - * returns an iterator range over all halfedges with vertex `target(h,g)` as target. + * returns an iterator range over all halfedges with vertex `target(h,g)` as target. */ template Iterator_range > @@ -841,9 +841,9 @@ halfedges_around_target(typename boost::graph_traits::halfedge_descriptor return make_range(I(h,g), I(h,g,1)); } -/** +/** * \ingroup PkgBGLIterators - * returns an iterator range over all halfedges with vertex `v` as target. + * returns an iterator range over all halfedges with vertex `v` as target. */ template Iterator_range > @@ -852,9 +852,9 @@ halfedges_around_target(typename boost::graph_traits::vertex_descriptor v return halfedges_around_target(halfedge(v,g),g); } -/** +/** * \ingroup PkgBGLIterators - * returns an iterator range over all halfedges incident to the same face or border as `h`. + * returns an iterator range over all halfedges incident to the same face or border as `h`. */ template Iterator_range > @@ -899,7 +899,7 @@ class Face_around_face_iterator private: friend class boost::iterator_core_access; typename boost::graph_traits::face_descriptor dereference() const { return fct(*this->base_reference()); } -}; +}; /** @@ -928,7 +928,7 @@ class Face_around_face_circulator */ template class Face_around_target_iterator -#ifndef DOXYGEN_RUNNING +#ifndef DOXYGEN_RUNNING : public boost::iterator_adaptor< Face_around_target_iterator // Derived , Halfedge_around_target_iterator // Base @@ -954,11 +954,11 @@ class Face_around_target_iterator private: friend class boost::iterator_core_access; typename boost::graph_traits::face_descriptor dereference() const { return fct(*this->base_reference()); } -}; +}; -/** +/** * \ingroup PkgBGLIterators - * returns an iterator range over all faces around vertex `target(h,g)`. + * returns an iterator range over all faces around vertex `target(h,g)`. */ template Iterator_range > @@ -968,7 +968,7 @@ faces_around_target(typename boost::graph_traits::halfedge_descriptor h, return make_range(I(h,g), I(h,g,1)); } -/** +/** * \ingroup PkgBGLIterators * returns an iterator range over all edge-adjacent faces to the same face `face(h,g)`. */ @@ -982,7 +982,7 @@ faces_around_face(typename boost::graph_traits::halfedge_descriptor h, co template class Vertex_around_face_circulator -#ifndef DOXYGEN_RUNNING +#ifndef DOXYGEN_RUNNING : public boost::iterator_adaptor< Vertex_around_face_circulator // Derived , Halfedge_around_face_circulator // Base @@ -1028,7 +1028,7 @@ class Vertex_around_face_circulator friend class boost::iterator_core_access; typename boost::graph_traits::vertex_descriptor dereference() const { return fct(*this->base_reference()); } #endif -}; +}; /** * \ingroup PkgBGLIterators @@ -1082,7 +1082,7 @@ class Vertex_around_face_iterator friend class boost::iterator_core_access; typename boost::graph_traits::vertex_descriptor dereference() const { return fct(*this->base_reference()); } #endif -}; +}; template @@ -1110,7 +1110,7 @@ class Opposite_edge_around_face_iterator private: friend class boost::iterator_core_access; typename boost::graph_traits::edge_descriptor dereference() const { return fct(*this->base_reference()); } -}; +}; template Iterator_range > @@ -1145,7 +1145,7 @@ class Edge_around_face_iterator private: friend class boost::iterator_core_access; typename boost::graph_traits::edge_descriptor dereference() const { return fct(*this->base_reference()); } -}; +}; template Iterator_range > @@ -1191,7 +1191,7 @@ class Vertex_around_target_circulator : Vertex_around_target_circulator::iterator_adaptor_(Halfedge_around_target_circulator(h,g)), fct(g) {} -#ifndef DOXYGEN_RUNNING +#ifndef DOXYGEN_RUNNING // design patter: "safe bool" // will be replaced by explicit operator bool with C++11 typedef void (Vertex_around_target_circulator::*bool_type)() const; @@ -1213,7 +1213,7 @@ class Vertex_around_target_circulator friend class boost::iterator_core_access; typename boost::graph_traits::vertex_descriptor dereference() const { return fct(*this->base_reference()); } #endif -}; +}; @@ -1265,7 +1265,7 @@ class Vertex_around_target_iterator friend class boost::iterator_core_access; typename boost::graph_traits::vertex_descriptor dereference() const { return fct(*this->base_reference()); } #endif -}; +}; template @@ -1285,9 +1285,9 @@ adjacent_vertices(typename boost::graph_traits::vertex_descriptor v, cons return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } -/** +/** * \ingroup PkgBGLIterators - * returns an iterator range over all vertices adjacent to the vertex `target(h,g)`. + * returns an iterator range over all vertices adjacent to the vertex `target(h,g)`. */ template Iterator_range > @@ -1304,9 +1304,9 @@ vertices_around_target(typename boost::graph_traits::vertex_descriptor v, typedef Vertex_around_target_iterator I; return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } -/** +/** * \ingroup PkgBGLIterators - * returns an iterator range over all vertices adjacent to the face `face(h,g)`. + * returns an iterator range over all vertices adjacent to the face `face(h,g)`. */ template Iterator_range > @@ -1333,23 +1333,23 @@ class Out_edge_iterator public: Out_edge_iterator() {} - + Out_edge_iterator(halfedge_descriptor h, const Graph& g, int n = 0) : Out_edge_iterator::iterator_adaptor_(Halfedge_around_target_iterator(h,g,(h==halfedge_descriptor())?1:n)), opp(g) {} - + // design patter: "safe bool" // will be replaced by explicit operator bool with C++11 typedef void (Out_edge_iterator::*bool_type)() const; - + void this_type_does_not_support_comparisons() const {} - + operator bool_type() const { return (! (this->base_reference() == nullptr)) ? &Out_edge_iterator::this_type_does_not_support_comparisons : 0; } - - + + private: friend class boost::iterator_core_access; typename boost::graph_traits::edge_descriptor dereference() const { return opp(*this->base_reference()); } @@ -1374,7 +1374,7 @@ class In_edge_iterator public: In_edge_iterator() {} - + In_edge_iterator(halfedge_descriptor h, const Graph& g, int n = 0) : In_edge_iterator::iterator_adaptor_(Halfedge_around_target_iterator(h,g,(h==halfedge_descriptor())?1:n)), fct(g) {} diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h index 54c031a7c61f..6891abf0e273 100644 --- a/BGL/include/CGAL/boost/graph/named_params_helper.h +++ b/BGL/include/CGAL/boost/graph/named_params_helper.h @@ -351,7 +351,7 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits::fa typedef std::random_access_iterator_tag iterator_category; }; }; - + namespace parameters { template diff --git a/BGL/include/CGAL/boost/graph/properties.h b/BGL/include/CGAL/boost/graph/properties.h index 589662ce0dcf..9774e1ac39f2 100644 --- a/BGL/include/CGAL/boost/graph/properties.h +++ b/BGL/include/CGAL/boost/graph/properties.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Andreas Fabri, Fernando Cacciola @@ -90,7 +90,7 @@ using boost::face_external_index; namespace CGAL { namespace internal { - + template struct Index_accessor : boost::put_get_helper< std::size_t&, Index_accessor > diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index 02fb1efd4134..f7c20ed7f27b 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include @@ -189,7 +189,7 @@ void duplicate_terminal_vertices(Graph& graph, } ) // end of CGAL_assertion_code } // end of duplicate_terminal_vertices - + } // namespace internal template ::vertex_descriptor Graph_vertex_descriptor; typedef typename graph_traits::edge_descriptor Graph_edge_descriptor; - + typedef boost::adjacency_list G_copy; @@ -261,18 +261,18 @@ split_graph_into_polylines(const Graph& graph, typedef typename graph_traits::vertex_descriptor vertex_descriptor; typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::out_edge_iterator out_edge_iterator; - + // we make a copy of the input graph G_copy g_copy; { typedef std::map::vertex_descriptor, typename graph_traits::vertex_descriptor> V2vmap; V2vmap v2vmap; - + for(Graph_vertex_descriptor v : make_range(vertices(graph))){ vertex_descriptor vc = add_vertex(g_copy); g_copy[vc] = v; - v2vmap[v] = vc; + v2vmap[v] = vc; } for(Graph_edge_descriptor e : make_range(edges(graph))){ diff --git a/BGL/include/CGAL/boost/graph/visitor.h b/BGL/include/CGAL/boost/graph/visitor.h index f13ec2dc5235..085c6ce01d9f 100644 --- a/BGL/include/CGAL/boost/graph/visitor.h +++ b/BGL/include/CGAL/boost/graph/visitor.h @@ -122,7 +122,7 @@ inline void out_edges(typename boost::graph_traits::vertex_descriptor u // // MutableHalfedgeGraph -// +// template void add_vertex(Visitor_base & w) {} @@ -153,7 +153,7 @@ void set_next(typename boost::graph_traits< Graph >::halfedge_descriptor h1 {} // -// MutableFaceGraph +// MutableFaceGraph // template void add_face(Visitor_base & w) @@ -377,7 +377,7 @@ out_edges(typename boost::graph_traits::vertex_descriptor u // // MutableHalfedgeGraph -// +// template typename boost::graph_traits< Graph >::vertex_descriptor @@ -450,7 +450,7 @@ set_next(typename boost::graph_traits< Graph >::halfedge_descriptor h1 } // -// MutableFaceGraph +// MutableFaceGraph // template typename boost::graph_traits< Graph >::face_descriptor diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h index e26081b7a0ff..d4f213919d2b 100644 --- a/BGL/include/CGAL/boost/parameter.h +++ b/BGL/include/CGAL/boost/parameter.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Andreas Fabri @@ -57,7 +57,7 @@ struct Base private: T t_; }; - + #define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ struct Class : public Base { Class(bool b) : Base(b){} }; \ inline Class function_true() { return Class(true); } \ @@ -86,10 +86,10 @@ BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) BOOST_PARAMETER_NAME( (convergence, tag) convergence_) BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) - + BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) -BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) +BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_) BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index e7209f704d99..e57cefb8eef1 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -14,7 +14,7 @@ find_package( CGAL QUIET COMPONENTS ) if ( NOT CGAL_FOUND ) message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() @@ -23,7 +23,7 @@ find_package( Boost ) if ( NOT Boost_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() find_package( OpenMesh QUIET ) diff --git a/BGL/test/BGL/borders.cpp b/BGL/test/BGL/borders.cpp index 4df20313137b..ec6d52d167b9 100644 --- a/BGL/test/BGL/borders.cpp +++ b/BGL/test/BGL/borders.cpp @@ -72,7 +72,7 @@ int main() Is_border ib(g); FG fg(g,ib); - std::list polylines; + std::list polylines; Polyline_visitor polyline_visitor(polylines); CGAL::split_graph_into_polylines( fg, @@ -80,7 +80,7 @@ int main() Is_terminal() ); std::cout.precision(17); - + for(std::list::iterator it = polylines.begin(); it!= polylines.end(); ++it){ Polyline_3& poly = *it; std::size_t n; @@ -97,6 +97,6 @@ int main() std::cout << std::endl; } - + return 0; } diff --git a/BGL/test/BGL/graph_concept_Dual.cpp b/BGL/test/BGL/graph_concept_Dual.cpp index 6c29ab3fd57c..5998741e3a31 100644 --- a/BGL/test/BGL/graph_concept_Dual.cpp +++ b/BGL/test/BGL/graph_concept_Dual.cpp @@ -8,7 +8,7 @@ typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Polyhedron_3 Polyhedron; -template +template void concept_check_dual() { typedef CGAL::Dual Graph; typedef boost::graph_traits Traits; diff --git a/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp b/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp index 118070257aeb..75ba805387d2 100644 --- a/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp +++ b/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp @@ -18,7 +18,7 @@ typedef Traits::vertex_descriptor vertex_descriptor; typedef Traits::face_descriptor face_descriptor; typedef LCC::Traits::Point Point_3; -template +template void concept_check_polyhedron() { boost::function_requires< boost::GraphConcept >(); boost::function_requires< boost::VertexListGraphConcept >(); @@ -68,13 +68,13 @@ void runtime_check_halfedgegraph() // +--------+ // w x LCC p; - vertex_descriptor + vertex_descriptor u = add_vertex(Point_3(0,2,0), p), v = add_vertex(Point_3(2,2,0), p), w = add_vertex(Point_3(0,0,0), p), x = add_vertex(Point_3(2,0,0), p), y = add_vertex(Point_3(1,1,0), p); - + std::vector face; face.push_back(v); face.push_back(u); face.push_back(y); CGAL::Euler::add_face(face, p); @@ -86,7 +86,7 @@ void runtime_check_halfedgegraph() face.clear(); face.push_back(x); face.push_back(y); face.push_back(w); CGAL::Euler::add_face(face, p); - + face.clear(); face.push_back(w); face.push_back(y); face.push_back(u); CGAL::Euler::add_face(face, p); diff --git a/BGL/test/BGL/graph_concept_OpenMesh.cpp b/BGL/test/BGL/graph_concept_OpenMesh.cpp index 2e697e997fee..b9c8309b77ed 100644 --- a/BGL/test/BGL/graph_concept_OpenMesh.cpp +++ b/BGL/test/BGL/graph_concept_OpenMesh.cpp @@ -15,7 +15,7 @@ typedef Traits::vertex_descriptor vertex_descriptor; typedef Traits::face_descriptor face_descriptor; //typedef Kernel::Point_3 Point_3; -template +template void concept_check_polyhedron() { boost::function_requires< boost::GraphConcept >(); @@ -32,10 +32,10 @@ void concept_check_polyhedron() { boost::function_requires< CGAL::HalfedgeListGraphConcept >(); boost::function_requires< CGAL::FaceGraphConcept >(); boost::function_requires< CGAL::FaceListGraphConcept >(); - + boost::function_requires< CGAL::MutableHalfedgeGraphConcept >(); boost::function_requires< CGAL::MutableFaceGraphConcept >(); - + // this uses some internal boost concepts, better than nothing boost::function_requires< boost::concepts::ReadablePropertyGraph >(); boost::function_requires< boost::concepts::ReadablePropertyGraph >(); diff --git a/BGL/test/BGL/graph_concept_Polyhedron_3.cpp b/BGL/test/BGL/graph_concept_Polyhedron_3.cpp index 8a0d04458b11..8ae866c67b00 100644 --- a/BGL/test/BGL/graph_concept_Polyhedron_3.cpp +++ b/BGL/test/BGL/graph_concept_Polyhedron_3.cpp @@ -12,7 +12,7 @@ typedef Traits::vertex_descriptor vertex_descriptor; typedef Traits::face_descriptor face_descriptor; typedef Kernel::Point_3 Point_3; -template +template void concept_check_polyhedron() { boost::function_requires< boost::GraphConcept >(); boost::function_requires< boost::VertexListGraphConcept >(); diff --git a/BGL/test/BGL/next.cpp b/BGL/test/BGL/next.cpp index e7c665dd1d76..aa7a53d52352 100644 --- a/BGL/test/BGL/next.cpp +++ b/BGL/test/BGL/next.cpp @@ -20,7 +20,7 @@ namespace Toto { { return d; } - + } namespace std { @@ -28,17 +28,17 @@ namespace std { template <> struct iterator_traits { - }; + }; }; namespace Nested { - void + void gnu() { SM sm; CGAL::make_triangle(Point_3(0,0,0), Point_3(1,0,0), Point_3(1,1,0),sm); - + halfedge_descriptor hd = *(halfedges(sm).first); hd = next(hd,sm); std::cout << hd; @@ -51,7 +51,7 @@ namespace Nested { Toto::Descriptor d; d = next(d,g); } - + } int main() @@ -59,6 +59,6 @@ int main() Nested::gnu(); Nested::gnats(); - + return 0; } diff --git a/BGL/test/BGL/split.cpp b/BGL/test/BGL/split.cpp index 28f547e39ff1..7df61a985a9f 100644 --- a/BGL/test/BGL/split.cpp +++ b/BGL/test/BGL/split.cpp @@ -9,7 +9,7 @@ typedef CGAL::Simple_cartesian K; typedef K::Point_2 Point_2; typedef boost::adjacency_list < boost::listS, - boost::vecS, + boost::vecS, boost::undirectedS, Point_2 > G; @@ -27,7 +27,7 @@ struct Is_terminal }; -template +template struct Polyline_visitor { std::list& polylines; @@ -57,7 +57,7 @@ int main() { G g; - std::list polylines; + std::list polylines; Polyline_visitor polyline_visitor(polylines, g); std::map p2vd; @@ -66,10 +66,10 @@ int main() Point_2 p, q; - vertex_descriptor vdp, vdq; + vertex_descriptor vdp, vdq; for(int i=0; i < n; i++){ std::cin >> p >> q; - + if(p2vd.find(p) == p2vd.end()){ vdp = add_vertex(g); g[vdp] = p; @@ -92,7 +92,7 @@ int main() Is_terminal() ); std::cout.precision(17); - + for(std::list::iterator it = polylines.begin(); it!= polylines.end(); ++it){ Polyline_2& poly = *it; std::size_t n; @@ -108,6 +108,6 @@ int main() } std::cout << std::endl; } - + return 0; } diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 2edc8060d891..9583f8e8506a 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -4,7 +4,7 @@ #include template -void +void join_face_test() { CGAL_GRAPH_TRAITS_MEMBERS(T); @@ -22,7 +22,7 @@ join_face_test() assert(CGAL::internal::exact_num_faces(f.m) == 2); assert(CGAL::internal::exact_num_edges(f.m) == 6); - + CGAL::Halfedge_around_face_iterator begin, end; boost::tie(begin, end) = CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m); assert(std::distance(begin, end) == 4); @@ -38,7 +38,7 @@ join_face_test() for(boost::tie(fit, fend) = faces(f.m); fit != fend; ++fit) { assert(*fit == f.f1 || *fit == f.f3); } - + assert(degree(f.w, f.m) == 2); assert(degree(f.v, f.m) == 3); assert(CGAL::is_valid_polygon_mesh(f.m)); @@ -48,7 +48,7 @@ join_face_test() template -void +void remove_face_test_1() { CGAL_GRAPH_TRAITS_MEMBERS(T); @@ -82,13 +82,13 @@ remove_face_test_1() template -void +void remove_face_test_2() { CGAL_GRAPH_TRAITS_MEMBERS(T); Surface_fixture_2 f; - + // find the edge between x and v bool found; halfedge_descriptor e; @@ -108,22 +108,22 @@ remove_face_test_2() boost::tie(e, found) = halfedge(f.x, f.w, f.m); assert(found); assert(face(e,f.m) == boost::graph_traits::null_face()); - + // check the boundary halfedge_descriptor n = next(e, f.m); while(n != e) { assert(face(n,f.m) == boost::graph_traits::null_face() ); - n = next(n, f.m); + n = next(n, f.m); } } -template +template void add_face_to_border_test() { CGAL_GRAPH_TRAITS_MEMBERS(T); - + Surface_fixture_5 f; CGAL::Euler::add_face_to_border(f.h1, f.h2, f.m); @@ -132,12 +132,12 @@ add_face_to_border_test() } -template +template void add_vertex_and_face_to_border_test() { CGAL_GRAPH_TRAITS_MEMBERS(T); - + Surface_fixture_5 f; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; halfedge_descriptor h1 = f.h1, h2 = f.h2; @@ -159,7 +159,7 @@ add_vertex_and_face_to_border_test() halfedge_descriptor res = CGAL::Euler::add_vertex_and_face_to_border(f.h1, f.h2, f.m); assert(CGAL::is_valid_polygon_mesh(f.m)); - + assert(! CGAL::is_border(res,m)); assert(CGAL::is_border(opposite(res,m),m)); res = opposite(res,m); @@ -172,7 +172,7 @@ add_vertex_and_face_to_border_test() } -template +template void join_vertex_interior_test() { @@ -194,7 +194,7 @@ join_vertex_interior_test() assert(CGAL::is_valid_polygon_mesh(f.m)); } -template +template void join_vertex_exterior_test() { @@ -234,7 +234,7 @@ join_vertex_exterior_test() assert(CGAL::internal::exact_num_edges(f.m) == 6); assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 4); assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3); - + assert(CGAL::is_valid_polygon_mesh(f.m)); assert(degree(f.w, f.m) == 3); @@ -242,7 +242,7 @@ join_vertex_exterior_test() } -template +template void split_vertex() { @@ -266,7 +266,7 @@ split_vertex() assert(boost::distance(CGAL::halfedges_around_face(h2, f.m)) == 7); } -template +template void split_join_vertex_inverse() { @@ -284,7 +284,7 @@ split_join_vertex_inverse() assert(found); CGAL::Euler::join_vertex(CGAL::Euler::split_vertex(h1, h2,f.m),f.m); assert(CGAL::is_valid_polygon_mesh(f.m)); - + assert(CGAL::internal::exact_num_vertices(f.m)== 5); assert(CGAL::internal::exact_num_faces(f.m) == 2); assert(CGAL::internal::exact_num_edges(f.m) == 6); @@ -294,7 +294,7 @@ split_join_vertex_inverse() } -template +template void join_loop_test() { @@ -302,11 +302,11 @@ join_loop_test() Surface_fixture_4 f; CGAL::Euler::join_loop(f.h1, f.h2, f.m); - + assert(CGAL::is_valid_polygon_mesh(f.m)); } -template +template void split_loop_test() { @@ -320,7 +320,7 @@ split_loop_test() assert(CGAL::is_valid_polygon_mesh(f.m)); } -template +template void split_face_test() { @@ -331,7 +331,7 @@ split_face_test() assert(num_halfedges(f.m) == 10); } -template +template void make_hole_test() { @@ -347,7 +347,7 @@ void assert(CGAL::internal::exact_num_halfedges(f.m) == nh); } -template +template void remove_center_vertex_test() { @@ -364,14 +364,14 @@ remove_center_vertex_test() assert(CGAL::internal::exact_num_halfedges(f.m) == nh-(2*deg)); } -template +template void join_split_inverse() { - + } -template +template void does_satisfy_link_condition() { @@ -443,7 +443,7 @@ add_face_bug() template void test_Euler_operations() -{ +{ join_face_test(); add_vertex_and_face_to_border_test(); add_face_to_border_test(); diff --git a/BGL/test/BGL/test_Has_member_clear.cpp b/BGL/test/BGL/test_Has_member_clear.cpp index 7d9e09495471..cbc66de0864c 100644 --- a/BGL/test/BGL/test_Has_member_clear.cpp +++ b/BGL/test/BGL/test_Has_member_clear.cpp @@ -7,11 +7,11 @@ struct with_clear { struct wo_clear { }; -struct with_clear_but_args { +struct with_clear_but_args { void clear(int) {} }; -struct with_clear_but_const { +struct with_clear_but_const { void clear() const {} }; diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index 4ca383561f1d..a08af579147b 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -171,7 +171,7 @@ bool read_a_mesh(Polyhedron& p, const std::string& str) { } template -std::vector t_data() +std::vector t_data() { std::vector vs; for(unsigned int i = 0; i < sizeof(data) / sizeof(data[0]); ++i) { @@ -254,7 +254,7 @@ struct Surface_fixture_1 { f1 = CGAL::is_border(halfedge(u, m),m) ? face(opposite(halfedge(u, m), m), m) : face(halfedge(u, m), m); assert(f1 != boost::graph_traits::null_face()); CGAL::Halfedge_around_face_iterator hafib, hafie; - for(boost::tie(hafib, hafie) = CGAL::halfedges_around_face(halfedge(f1, m), m); hafib != hafie; ++hafib) + for(boost::tie(hafib, hafie) = CGAL::halfedges_around_face(halfedge(f1, m), m); hafib != hafie; ++hafib) { if(! CGAL::is_border(opposite(*hafib, m), m)) f2 = face(opposite(*hafib, m), m); @@ -401,7 +401,7 @@ struct Surface_fixture_4 { h2 = *hb; ++found; } - } + } } } assert(found == 2); @@ -434,7 +434,7 @@ struct Surface_fixture_5 { } else if(get(pm, target(*hb,m)) == Point_3(2,-1,0)){ h2 = *hb; found++; - } + } } } assert(found == 2); @@ -452,9 +452,9 @@ struct Surface_fixture_6 { assert(CGAL::is_valid_polygon_mesh(m)); typename boost::graph_traits::halfedge_descriptor h; - + h1 = halfedge(*faces(m).first, m); - + h2 = next(next(h1,m),m); } @@ -470,7 +470,7 @@ struct Surface_fixture_7 { assert(read_a_mesh(m, "data/cube.off")); assert(CGAL::is_valid_polygon_mesh(m)); - h = *(halfedges(m).first); + h = *(halfedges(m).first); } Graph m; @@ -501,9 +501,9 @@ struct Surface_fixture_8 { get(pm, target(*hb,m)) == Point_3(0,0,0)){ h3 = *hb; found++; - } + } } - + assert(found == 3); } diff --git a/BGL/test/BGL/test_Properties.cpp b/BGL/test/BGL/test_Properties.cpp index 984891b4ca93..bb541bbc8909 100644 --- a/BGL/test/BGL/test_Properties.cpp +++ b/BGL/test/BGL/test_Properties.cpp @@ -67,7 +67,7 @@ void test_uniqueness(const Graph&, std::cout << "Element type: " << typeid(typename boost::range_value::type).name() << std::endl; #endif - typename boost::range_iterator::type + typename boost::range_iterator::type begin = boost::begin(range), begin2 = boost::begin(range), end = boost::end(range); diff --git a/BGL/test/BGL/test_Surface_mesh.cpp b/BGL/test/BGL/test_Surface_mesh.cpp index 927f8e9c290d..f47f4f49f94c 100644 --- a/BGL/test/BGL/test_Surface_mesh.cpp +++ b/BGL/test/BGL/test_Surface_mesh.cpp @@ -6,7 +6,7 @@ BOOST_AUTO_TEST_CASE( edges_test ) { edge_iterator eb, ee; vertex_iterator vb, ve; - + Surface_fixture f; boost::tie(eb, ee) = edges(f.m); boost::tie(vb, ve) = vertices(f.m); @@ -70,12 +70,12 @@ BOOST_AUTO_TEST_CASE( in_out_equality ) BOOST_AUTO_TEST_CASE( face_test ) { Surface_fixture f; - std::pair + std::pair enc = enclosure(f.f1, f.m); BOOST_CHECK(enc.first != enc.second); BOOST_CHECK(std::distance(enc.first, enc.second) == 3); enclosure_iterator begin = enc.first; - while(begin != enc.second) + while(begin != enc.second) { BOOST_CHECK(face(*begin, f.m) == f.f1); ++begin; @@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE( weight_map_test ) { Surface_fixture f; Cube_fixture c; - + CGAL::SM_edge_weight_pmap wm1 = boost::get(boost::edge_weight, c.m); edge_iterator eb, ee; boost::test_tools::check_is_close_t check_close; diff --git a/BGL/test/BGL/test_bgl_dual.cpp b/BGL/test/BGL/test_bgl_dual.cpp index 8f14a234c385..9a79832fcb9f 100644 --- a/BGL/test/BGL/test_bgl_dual.cpp +++ b/BGL/test/BGL/test_bgl_dual.cpp @@ -24,20 +24,20 @@ int main() Dual dual(primal); face_descriptor fd = *faces(dual).first; halfedge_descriptor hd = halfedge(fd,dual); - assert(face(hd,dual) == fd); + assert(face(hd,dual) == fd); halfedge_descriptor nhd = next(hd,dual); assert(hd != nhd); assert(hd == prev(nhd,dual)); assert(face(nhd,dual) == fd); for(halfedge_descriptor lhd : halfedges_around_face(hd,dual)){ - assert(face(lhd,dual) == fd); + assert(face(lhd,dual) == fd); } - + vertex_descriptor vd = *vertices(dual).first; - + assert(target(halfedge(vd,dual),dual) == vd); for(halfedge_descriptor lhd : halfedges_around_target(halfedge(vd,dual),dual)){ - assert(target(lhd,dual) == vd); + assert(target(lhd,dual) == vd); } { diff --git a/BGL/test/BGL/test_cgal_bgl_named_params.cpp b/BGL/test/BGL/test_cgal_bgl_named_params.cpp index 07dc883392d4..5aa0021d0b3b 100644 --- a/BGL/test/BGL/test_cgal_bgl_named_params.cpp +++ b/BGL/test/BGL/test_cgal_bgl_named_params.cpp @@ -41,11 +41,11 @@ void test(const NamedParameters& np) assert(get_parameter(np, CGAL::internal_np::METIS_options).v == 800000001); assert(get_parameter(np, CGAL::internal_np::vertex_partition_id).v == 800000002); assert(get_parameter(np, CGAL::internal_np::face_partition_id).v == 800000003); - + assert(get_parameter(np, CGAL::internal_np::vertex_to_vertex_output_iterator).v == 800000004); assert(get_parameter(np, CGAL::internal_np::halfedge_to_halfedge_output_iterator).v == 800000005); assert(get_parameter(np, CGAL::internal_np::face_to_face_output_iterator).v == 800000006); - + assert(get_parameter(np, CGAL::internal_np::vertex_to_vertex_map).v == 800000007); assert(get_parameter(np, CGAL::internal_np::halfedge_to_halfedge_map).v == 800000008); assert(get_parameter(np, CGAL::internal_np::face_to_face_map).v == 800000009); @@ -203,7 +203,7 @@ void test(const NamedParameters& np) check_same_type<42>(get_parameter(np, CGAL::internal_np::projection_functor)); check_same_type<46>(get_parameter(np, CGAL::internal_np::apply_per_connected_component)); check_same_type<47>(get_parameter(np, CGAL::internal_np::output_iterator)); - + // Named parameters used in the package 'Point Set Processing' check_same_type<9000>(get_parameter(np, CGAL::internal_np::point_map)); check_same_type<9001>(get_parameter(np, CGAL::internal_np::query_point_map)); diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index c41847308ad6..f258e3403ec7 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -55,7 +55,7 @@ int main(int argc, char* argv[]) halfedge_descriptor hd = *halfedges(P).first; { halfedge_around_face_circulator hafc(hd,P), done(hafc); - + do { std::cout << get(CGAL::vertex_point, P, target(*hafc,P)) << std::endl; ++hafc; @@ -74,7 +74,7 @@ int main(int argc, char* argv[]) } { vertex_around_target_circulator havc(hd,P), done(havc); - + do { std::cout << get(CGAL::vertex_point, P, *havc) << std::endl; ++havc; @@ -82,7 +82,7 @@ int main(int argc, char* argv[]) } { face_around_target_circulator havc(hd,P), done(havc); - + do { //std::cout << get(CGAL::vertex_point, P, *havc) << std::endl; ++havc; @@ -114,14 +114,14 @@ int main(int argc, char* argv[]) { halfedge_around_face_iterator vit, end; boost::tie(vit,end) = halfedges_around_face(hd,P); - + while(vit!= end) { halfedge_descriptor hd = *vit; std::cout << get(CGAL::vertex_point, P, target(hd,P)) << std::endl; ++vit; } } - + { out_edge_iterator ohi, end; @@ -130,7 +130,7 @@ int main(int argc, char* argv[]) halfedge_descriptor hd2 = halfedge(ed,P); std::cout << get(CGAL::vertex_point, P, target(hd2,P)) << std::endl; } - } + } { for(edge_descriptor ed : out_edges(target(hd,P),P)){ diff --git a/BGL/test/BGL/test_graph_traits.cpp b/BGL/test/BGL/test_graph_traits.cpp index 58144b4e3665..cc2559752d47 100644 --- a/BGL/test/BGL/test_graph_traits.cpp +++ b/BGL/test/BGL/test_graph_traits.cpp @@ -29,7 +29,7 @@ void test_halfedge_around_vertex_iterator(const Graph& g) vertex_iterator vit, vend; for(boost::tie(vit, vend) = vertices(g); vit != vend; ++vit) { halfedge_around_target_iterator havit, havend; - for(boost::tie(havit, havend) = CGAL::halfedges_around_target(halfedge(*vit, g), g); + for(boost::tie(havit, havend) = CGAL::halfedges_around_target(halfedge(*vit, g), g); havit != havend; ++havit) { assert(target(*havit, g) == *vit); @@ -90,7 +90,7 @@ void test_edge_iterators(const G& g) typedef typename Traits::edges_size_type edges_size_type; // assert(g.size_of_halfedges() / 2 == num_edges(g)); - + // do we iterate as many as that? edge_iterator eb, ee; boost::tie(eb, ee) = edges(g); @@ -135,7 +135,7 @@ void test_vertex_iterators(const G& g) } template -void test_out_edges(const G& g) +void test_out_edges(const G& g) { typedef boost::graph_traits< G > Traits; typedef typename Traits::vertex_iterator vertex_iterator; @@ -162,7 +162,7 @@ void test_out_edges(const G& g) } template -void test_in_edges(const G& g) +void test_in_edges(const G& g) { typedef boost::graph_traits< G > Traits; typedef typename Traits::vertex_iterator vertex_iterator; @@ -187,7 +187,7 @@ void test_in_edges(const G& g) } template -void test_in_out_edges(const G& g) +void test_in_out_edges(const G& g) { typedef boost::graph_traits< G > Traits; typedef typename Traits::vertex_iterator vertex_iterator; diff --git a/BGL/test/BGL/test_helpers.cpp b/BGL/test/BGL/test_helpers.cpp index 2464a60150ad..57a1c11a6918 100644 --- a/BGL/test/BGL/test_helpers.cpp +++ b/BGL/test/BGL/test_helpers.cpp @@ -32,38 +32,38 @@ void test_validity() vertices[1] = add_vertex(mesh); vertices[2] = add_vertex(mesh); vertices[3] = add_vertex(mesh); - + put(vpmap, vertices[0], Point_3(0,0,0)); put(vpmap, vertices[1], Point_3(1,0,0)); put(vpmap, vertices[2], Point_3(1,1,0)); put(vpmap, vertices[3], Point_3(0,1,0)); - - edges[0] = add_edge(mesh); - edges[1] = add_edge(mesh); - edges[2] = add_edge(mesh); - edges[3] = add_edge(mesh); - + + edges[0] = add_edge(mesh); + edges[1] = add_edge(mesh); + edges[2] = add_edge(mesh); + edges[3] = add_edge(mesh); + assert(!CGAL::is_valid_halfedge_graph(mesh)); for(int i=0; i<4; ++i) { set_target(halfedge(edges[i], mesh), vertices[i], mesh); set_halfedge(vertices[i], halfedge(edges[i], mesh), mesh); } - + for(int i=0; i<4; ++i) set_target(opposite(halfedge(edges[i], mesh), mesh), vertices[(i+1)%4], mesh); for(int i=0; i<4; ++i) { set_next(halfedge(edges[(i+1)%4], mesh), halfedge(edges[i], mesh), mesh); - set_next(opposite(halfedge(edges[i], mesh), mesh), + set_next(opposite(halfedge(edges[i], mesh), mesh), opposite(halfedge(edges[(i+1)%4], mesh), mesh), mesh); } - + assert(CGAL::is_valid_halfedge_graph(mesh)); face_descriptor faces[1]; faces[0] = add_face(mesh); assert(!CGAL::is_valid_face_graph(mesh)); - + for(int i=0; i<4; ++i) { set_face(opposite(halfedge(edges[i], mesh), mesh), faces[0], mesh); @@ -71,7 +71,7 @@ void test_validity() set_halfedge(faces[0], opposite(halfedge(edges[0], mesh), mesh), mesh); assert(CGAL::is_valid_face_graph(mesh)); assert(CGAL::is_valid_polygon_mesh(mesh)); - + Mesh dummy; vertices[0] = add_vertex(dummy); vertices[1] = add_vertex(dummy); @@ -88,7 +88,7 @@ void test_validity() set_face(opposite(halfedge(edges[0], dummy), dummy), faces[0], dummy); assert(CGAL::is_valid_face_graph(dummy)); assert(!CGAL::is_valid_polygon_mesh(dummy)); - + } template diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_100_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_100_vertices.cpp index 0b37ce54e32f..05a1b96bb6aa 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_100_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_100_vertices.cpp @@ -32,7 +32,7 @@ void generate_regular_polygon(const int number_of_vertices, const double polygon vertices.resize(n); - for(int i = 0; i < n; ++i) + for(int i = 0; i < n; ++i) vertices[i] = Point(Scalar(r*sin((CGAL_PI / n) + ((i * 2.0 * CGAL_PI) / n))), Scalar(-r*cos((CGAL_PI / n) + ((i * 2.0 * CGAL_PI) / n)))); } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test.cpp index 76cba3efff7b..0ccb8a8e7544 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test.cpp @@ -65,6 +65,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Mean Value coordinates (4 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_100_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_100_vertices.cpp index 1d568bf03db4..f654b82bdfe4 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_100_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_100_vertices.cpp @@ -32,7 +32,7 @@ void generate_regular_polygon(const int number_of_vertices, const double polygon vertices.resize(n); - for(int i = 0; i < n; ++i) + for(int i = 0; i < n; ++i) vertices[i] = Point(Scalar(r*sin((CGAL_PI / n) + ((i * 2.0 * CGAL_PI) / n))), Scalar(-r*cos((CGAL_PI / n) + ((i * 2.0 * CGAL_PI) / n)))); } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp index fa537a7b9e2a..7f445fca8e6f 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp @@ -80,6 +80,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Mean Value coordinates (34 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp index d5471e9ecd3f..169128712b7c 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp @@ -62,7 +62,7 @@ int main() mean_value_coordinates(Point(x, y), it, CGAL::Barycentric_coordinates::ON_BOUNDED_SIDE); } time_to_compute.stop(); - + time += time_to_compute.time(); time_to_compute.reset(); @@ -71,6 +71,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Mean Value coordinates (16 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test.cpp index 91172dd193de..a2f5d988adf1 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test.cpp @@ -65,6 +65,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Mean Value weights (4 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp index 28e25d4f478e..679c2ff8ad6e 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp @@ -80,6 +80,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Mean Value weights (34 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp index 72d3db59e565..470f58d3ecde 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp @@ -62,7 +62,7 @@ int main() mean_value_coordinates.compute_weights(Point(x, y), it); } time_to_compute.stop(); - + time += time_to_compute.time(); time_to_compute.reset(); @@ -71,6 +71,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Mean Value weights (16 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Segment_coordinates/Segment_coordinates_speed_test.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Segment_coordinates/Segment_coordinates_speed_test.cpp index eedfb2efd504..404a00f0f70d 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Segment_coordinates/Segment_coordinates_speed_test.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Segment_coordinates/Segment_coordinates_speed_test.cpp @@ -45,7 +45,7 @@ int main() time_to_compute.start(); for(int j = 0; j < number_of_iterations; ++j) { - for(Scalar x = zero; x <= one; x += step) + for(Scalar x = zero; x <= one; x += step) segment_coordinates(Point(x, zero), it); } time_to_compute.stop(); @@ -58,6 +58,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Segment coordinates = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Triangle_coordinates/Triangle_coordinates_speed_test.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Triangle_coordinates/Triangle_coordinates_speed_test.cpp index 02ede69f5ad2..f38317c3187e 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Triangle_coordinates/Triangle_coordinates_speed_test.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Triangle_coordinates/Triangle_coordinates_speed_test.cpp @@ -52,7 +52,7 @@ int main() triangle_coordinates(Point(x, y), it); } time_to_compute.stop(); - + time += time_to_compute.time(); time_to_compute.reset(); @@ -61,6 +61,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Triangle coordinates = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test.cpp index 77d2b2740fe1..d7e02c610b2a 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test.cpp @@ -56,7 +56,7 @@ int main() wachspress_coordinates(Point(x, y), it, CGAL::Barycentric_coordinates::ON_BOUNDED_SIDE); } time_to_compute.stop(); - + time += time_to_compute.time(); time_to_compute.reset(); @@ -65,6 +65,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Wachspress coordinates (4 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_100_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_100_vertices.cpp index 0d28ec26fd2b..66046a6c081e 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_100_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_100_vertices.cpp @@ -32,7 +32,7 @@ void generate_regular_polygon(const int number_of_vertices, const double polygon vertices.resize(n); - for(int i = 0; i < n; ++i) + for(int i = 0; i < n; ++i) vertices[i] = Point(Scalar(r*sin((CGAL_PI / n) + ((i * 2.0 * CGAL_PI) / n))), Scalar(-r*cos((CGAL_PI / n) + ((i * 2.0 * CGAL_PI) / n)))); } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp index 6bcfececf75c..a738403732df 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp @@ -62,7 +62,7 @@ int main() wachspress_coordinates(Point(x, y), it, CGAL::Barycentric_coordinates::ON_BOUNDED_SIDE); } time_to_compute.stop(); - + time += time_to_compute.time(); time_to_compute.reset(); @@ -71,6 +71,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Wachspress coordinates (16 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp index 5c667fe5a495..30c1f8a7faf9 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp @@ -62,7 +62,7 @@ int main() wachspress_coordinates.compute_weights(Point(x, y), it); } time_to_compute.stop(); - + time += time_to_compute.time(); time_to_compute.reset(); @@ -71,6 +71,6 @@ int main() cout.precision(10); cout << endl << "CPU time to compute Wachspress weights (16 vertices) = " << mean_time << " seconds." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt index f68af8359199..31b69acb6baa 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt @@ -10,9 +10,9 @@ namespace CGAL { \section gbc_introduction Introduction -The package 2D Generalized Barycentric Coordinates offers an efficient and robust implementation of two-dimensional closed-form generalized barycentric coordinates defined for simple two-dimensional polygons. If coordinates with respect to multivariate scattered points instead of a polygon are required, please refer to natural neighbor coordinates from the package \ref PkgInterpolation2 "2D and Surface Function Interpolation". +The package 2D Generalized Barycentric Coordinates offers an efficient and robust implementation of two-dimensional closed-form generalized barycentric coordinates defined for simple two-dimensional polygons. If coordinates with respect to multivariate scattered points instead of a polygon are required, please refer to natural neighbor coordinates from the package \ref PkgInterpolation2 "2D and Surface Function Interpolation". -In particular, the package includes an implementation of \ref wp_example "Wachspress", \ref mv_example "mean value", and \ref dh_example "discrete harmonic" coordinates and provides some extra functions to compute barycentric coordinates with respect to segments (\ref seg_example "segment coordinates") and triangles (\ref tri_example "triangle coordinates"). The section \ref gbc_theory gives a short introduction to the topic of barycentric coordinates. +In particular, the package includes an implementation of \ref wp_example "Wachspress", \ref mv_example "mean value", and \ref dh_example "discrete harmonic" coordinates and provides some extra functions to compute barycentric coordinates with respect to segments (\ref seg_example "segment coordinates") and triangles (\ref tri_example "triangle coordinates"). The section \ref gbc_theory gives a short introduction to the topic of barycentric coordinates. \section gbc_interface Interface @@ -24,7 +24,7 @@ Mean value coordinates are the most generic coordinates in this package because Segment and triangle coordinates can be computed by using either a global function or creating the corresponding class. All other generalized coordinates can be computed by creating an instance of the class `CGAL::Barycentric_coordinates::Generalized_barycentric_coordinates_2` parameterized by an appropriate coordinate type that must be a model of the concept `BarycentricCoordinates_2`. -Any point in the plane may be taken as a query point. However, we do not recommend to use Wachspress and discrete harmonic coordinates with query points outside the closure of a polygon because at some of those points these coordinates are not well-defined, as explained in the Section \ref gbc_degeneracies. +Any point in the plane may be taken as a query point. However, we do not recommend to use Wachspress and discrete harmonic coordinates with query points outside the closure of a polygon because at some of those points these coordinates are not well-defined, as explained in the Section \ref gbc_degeneracies. Once instantiated for some polygon, the coordinates can be computed multiple times for different query points with respect to all the vertices of the provided polygon. Use the \ref PkgBarycentricCoordinates2Ref "Reference Manual" for the detailed interface. @@ -116,16 +116,16 @@ With inexact data types, the resulting coordinate values are correct up to the p These coordinates can be computed exactly if an exact data type is chosen, for any query point in the plane and with respect to any non-degenerate triangle. No special cases are handled. The computation always gives the correct result. The notion of correctness depends on the precision of the used data type. Note that for exterior points some coordinate values will be negative. \subsection gbc_deg_wachspress_coordinates Wachspress Coordinates -Wachspress coordinates are well-defined in the closure of any strictly convex polygon. Therefore, for any query point from the polygon's closure with an exact data type, these coordinates are computed exactly and no false result is expected. For inexact data types, the resulting precision of the computation is due to the involved algorithm and chosen data type. In the following paragraph we discuss two available algorithms for computing Wachspress coordinates. One of them is `CGAL::Barycentric_coordinates::PRECISE`, the other is `CGAL::Barycentric_coordinates::FAST`. +Wachspress coordinates are well-defined in the closure of any strictly convex polygon. Therefore, for any query point from the polygon's closure with an exact data type, these coordinates are computed exactly and no false result is expected. For inexact data types, the resulting precision of the computation is due to the involved algorithm and chosen data type. In the following paragraph we discuss two available algorithms for computing Wachspress coordinates. One of them is `CGAL::Barycentric_coordinates::PRECISE`, the other is `CGAL::Barycentric_coordinates::FAST`. \anchor wp_polygon \cgalFigureBegin{wp__notations,wp_notations.png} Notation for Wachspress coordinates. \cgalFigureEnd -To compute Wachspress weights, we follow \cite cgal:bc:fhk-gcbcocp-06 and use the formula +To compute Wachspress weights, we follow \cite cgal:bc:fhk-gcbcocp-06 and use the formula -

    \f$w_i = \frac{C_i}{A_{i-1}A_i}\f$
    +
    \f$w_i = \frac{C_i}{A_{i-1}A_i}\f$
    with \f$i = 1\dots n\f$ where \f$n\f$ is the number of the polygon's vertices. In order to compute the coordinates, we normalize these weights, @@ -156,7 +156,7 @@ Notation for discrete harmonic coordinates. To compute discrete harmonic weights, we follow \cite cgal:bc:fhk-gcbcocp-06 and use the formula -
    \f$w_i = \frac{r_{i+1}^2A_{i-1}-r_i^2B_i+r_{i-1}^2A_i}{A_{i-1}A_i}\f$
    +
    \f$w_i = \frac{r_{i+1}^2A_{i-1}-r_i^2B_i+r_{i-1}^2A_i}{A_{i-1}A_i}\f$
    with \f$i = 1\dots n\f$ where \f$n\f$ is the number of the polygon's vertices. In order to compute the coordinates, we normalize these weights, @@ -181,9 +181,9 @@ Notation for mean value coordinates. For these coordinates we also have two algorithms: one is precise and one is fast. The first one works everywhere in the plane, and the precision of the computation depends only on the chosen data type, including the remarks above. This algorithm is based on the following weight formula from \cite cgal:bc:f-wmvc-14 -
    \f$w_i = \sigma_i\bar{w}_i\qquad\f$ with \f$\qquad\bar{w}_i = (r_{i-1}r_{i+1}-d_{i-1}d_{i+1})^{1/2}\prod_{j\not= i-1,i}(r_jr_{j+1} + d_jd_{j+1})^{1/2}\qquad\f$ where \f$\qquad r_i = \|d_i\|.\f$
    +
    \f$w_i = \sigma_i\bar{w}_i\qquad\f$ with \f$\qquad\bar{w}_i = (r_{i-1}r_{i+1}-d_{i-1}d_{i+1})^{1/2}\prod_{j\not= i-1,i}(r_jr_{j+1} + d_jd_{j+1})^{1/2}\qquad\f$ where \f$\qquad r_i = \|d_i\|.\f$
    -Since \f$\bar{w}_i\f$ is always positive, we have to append to it the proper sign \f$\sigma_i\f$ of the signed mean value weight, which can be found efficiently (see the figures below). Basically, this weight is always positive to the left of the red piecewise linear curve, and it is negative to the right of this curve, moving in anticlockwise direction. +Since \f$\bar{w}_i\f$ is always positive, we have to append to it the proper sign \f$\sigma_i\f$ of the signed mean value weight, which can be found efficiently (see the figures below). Basically, this weight is always positive to the left of the red piecewise linear curve, and it is negative to the right of this curve, moving in anticlockwise direction. \cgalFigureBegin{mv__weight__signs,mv_weight_signs_convex.png,mv_weight_signs_concave.png} Signs of the mean value weight \f$w_i\f$ depending on the region with respect to a convex polygon \f$P\f$ and a concave polygon \f$P'\f$. @@ -221,17 +221,17 @@ From the figure above it is easy to see that the \f$O(n^2)\f$ algorithm is as fa \section gbc_implementation Implementation Details -The generic design of the package was developed in 2013 by Dmitry Anisimov and David Bommes with many useful comments by Kai Hormann and Pierre Alliez. The package consists of 6 classes, 2 enumerations, and one namespace. Appropriate iterators are used to provide an efficient access to data and to pass them to one of the generic algorithms for computing coordinates. Once instantiated for a polygon (triangle, segment), the coordinates can be computed multiple times for different query points with respect to all the vertices of the provided polygon (triangle, segment). All the classes are fully templated and have a simple and similar design. In particular, we follow the same naming convention for all functions. Yet, the number of functions can differ from one class to another. +The generic design of the package was developed in 2013 by Dmitry Anisimov and David Bommes with many useful comments by Kai Hormann and Pierre Alliez. The package consists of 6 classes, 2 enumerations, and one namespace. Appropriate iterators are used to provide an efficient access to data and to pass them to one of the generic algorithms for computing coordinates. Once instantiated for a polygon (triangle, segment), the coordinates can be computed multiple times for different query points with respect to all the vertices of the provided polygon (triangle, segment). All the classes are fully templated and have a simple and similar design. In particular, we follow the same naming convention for all functions. Yet, the number of functions can differ from one class to another. The implemented algorithms for computing coordinates do not depend on a particular kernel, and all the coordinates can be computed exactly, if an exact kernel is used, apart from mean value coordinates. The latter coordinates involve a square root operation, which results in a slightly worse precision with exact data types due to temporal conversion into a floating point type. The computed coordinates can be stored in an arbitrary container if an appropriate output iterator is provided. It is worth noting that the class `CGAL::Barycentric_coordinates::Segment_coordinates_2` is used to compute generalized barycentric coordinates along the polygon's boundary. Hence, one can use the trick for segment coordinates from Section \ref gbc_degeneracies if one is convinced that a point must lie exactly on the polygon's boundary but due to some numerical instabilities it does not. -The package is implemented in a way that later, if needed, other two-dimensional generalized barycentric coordinates can be easily added to this package. +The package is implemented in a way that later, if needed, other two-dimensional generalized barycentric coordinates can be easily added to this package. \section gbc_theory Theory of 2D Generalized Barycentric Coordinates -In 1827, the German mathematician and theoretical astronomer August Ferdinand Möbius (1790--1868) proposed a method \cite cgal:bc:m-dbc-27 to find coordinates of a point in the plane with respect to the vertices of a triangle. These coordinates are called triangle barycentric coordinates (sometimes area coordinates), and they are widely used in a variety of applications. Some of these applications are linear interpolation over a triangle and a triangle inclusion test. The first one is used for so-called shading, and the second one arises in the rasterization step when an image in vector graphics format needs to be converted into a raster image. +In 1827, the German mathematician and theoretical astronomer August Ferdinand Möbius (1790--1868) proposed a method \cite cgal:bc:m-dbc-27 to find coordinates of a point in the plane with respect to the vertices of a triangle. These coordinates are called triangle barycentric coordinates (sometimes area coordinates), and they are widely used in a variety of applications. Some of these applications are linear interpolation over a triangle and a triangle inclusion test. The first one is used for so-called shading, and the second one arises in the rasterization step when an image in vector graphics format needs to be converted into a raster image. Triangle barycentric coordinates have many important properties, including \em constant and linear precision, the Lagrange property, and positivity inside a triangle. These properties make these coordinates a unique tool in many scientific fields. If we restrict triangle coordinates to one of the edges of a triangle and its supporting line, we get barycentric coordinates with respect to a segment and call them \ref compute_seg_coord "segment coordinates". @@ -247,7 +247,7 @@ If we want to plot triangle coordinates, we follow a similar approach. We take \ Triangle coordinates with respect to \f$v_2 = (1.0,\ 2.0)\f$. The color bar indicates the range of values for the chosen coordinate. \cgalFigureEnd -Since many applications require to work with more complex planar geometric shapes than segments and triangles, it seems natural to investigate a generalized version of triangle coordinates with respect to arbitrary polygons. The first attempt was taken in 1975 by E. L. Wachspress \cite cgal:bc:w-rfeb-75, and the resulting generalized barycentric coordinates are now called Wachspress coordinates \cite cgal:bc:mlbd-gbcip-02. \ref gbc_deg_wachspress_coordinates "These coordinates" are well-defined for arbitrary strictly convex polygons and have all the properties of triangle coordinates \cite cgal:bc:fhk-gcbcocp-06. Unfortunately, they are not well-defined for weakly convex and concave polygons. +Since many applications require to work with more complex planar geometric shapes than segments and triangles, it seems natural to investigate a generalized version of triangle coordinates with respect to arbitrary polygons. The first attempt was taken in 1975 by E. L. Wachspress \cite cgal:bc:w-rfeb-75, and the resulting generalized barycentric coordinates are now called Wachspress coordinates \cite cgal:bc:mlbd-gbcip-02. \ref gbc_deg_wachspress_coordinates "These coordinates" are well-defined for arbitrary strictly convex polygons and have all the properties of triangle coordinates \cite cgal:bc:fhk-gcbcocp-06. Unfortunately, they are not well-defined for weakly convex and concave polygons. Analogously to the previous cases, we want to plot the Wachspress coordinates and see how they look like. Let us choose a \ref wp_polygon "non-regular hexagon", slightly rotate it, and move one of its vertices towards the line through its two adjacent neighbors. We sample the interior and the boundary of this polygon as before and plot the coordinate function with respect to the vertex that we moved at all the sample points. We see that we get a smooth function, which is linear along all edges and grows from zero to one, as the color bar indicates. @@ -273,10 +273,10 @@ In order to show the particular behaviour of mean value coordinates with an appl Mean value coordinates with respect to \f$v_3\f$. The color bar indicates the range of values for the chosen coordinate function. \cgalFigureEnd -Interesting fact: all the coordinates discussed in this section and implemented in the package come from one and the same family of generalized barycentric coordinates named 3-point family of coordinates \cite cgal:bc:fhk-gcbcocp-06. +Interesting fact: all the coordinates discussed in this section and implemented in the package come from one and the same family of generalized barycentric coordinates named 3-point family of coordinates \cite cgal:bc:fhk-gcbcocp-06. \section gbc_acknowledgments Acknowledgments -The authors wish to thank Teseo Schneider and Randolf Schaerfig for helpful comments and discussions. We also appreciate the great effort invested in this package by our reviewers Andreas Fabri and Sébastien Loriot. Finally, to create pictures for this manual, we used two programs: Geogebra and Matlab. +The authors wish to thank Teseo Schneider and Randolf Schaerfig for helpful comments and discussions. We also appreciate the great effort invested in this package by our reviewers Andreas Fabri and Sébastien Loriot. Finally, to create pictures for this manual, we used two programs: Geogebra and Matlab. */ diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h index 3d90dd14ef99..78b78863f940 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h @@ -27,25 +27,25 @@ BarycentricCoordinates_2(const std::vector &vertices, const Tra /// @{ /*! - A function that computes generalized barycentric coordinates without normalization that are called generalized baycentric weights (as fast as possible algorithm is used). - Weights are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. The function returns a pointer to the last stored element. -*/ + A function that computes generalized barycentric coordinates without normalization that are called generalized baycentric weights (as fast as possible algorithm is used). + Weights are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. The function returns a pointer to the last stored element. +*/ boost::optional weights(const Traits::Point_2 &query_point, OutputIterator &output); /*! - A function that computes generalized barycentric coordinates on the bounded side of a polygon with one of two possible algorithms: one is precise and one is fast. - The algorithm type is specified by the parameter type_of_algorithm. Coordinates are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. - The function returns a pointer to the last stored element. -*/ + A function that computes generalized barycentric coordinates on the bounded side of a polygon with one of two possible algorithms: one is precise and one is fast. + The algorithm type is specified by the parameter type_of_algorithm. Coordinates are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. + The function returns a pointer to the last stored element. +*/ boost::optional coordinates_on_bounded_side(const Traits::Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm); /*! - A function that computes generalized barycentric coordinates on the unbounded side of a polygon with one of two possible algorithms: one is precise and one is fast. - The algorithm type is specified by the parameter type_of_algorithm. Coordinates are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. - The function returns a pointer to the last stored element. -*/ + A function that computes generalized barycentric coordinates on the unbounded side of a polygon with one of two possible algorithms: one is precise and one is fast. + The algorithm type is specified by the parameter type_of_algorithm. Coordinates are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. + The function returns a pointer to the last stored element. +*/ boost::optional coordinates_on_unbounded_side(const Traits::Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm); -/// @} +/// @} }; /* end BarycentricCoordinates_2 */ diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h index ae63a83a5182..29fae0d0d8a0 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h @@ -2,7 +2,7 @@ \ingroup PkgBarycentricCoordinates2Concepts \cgalConcept -Requirements of the template parameter `Traits` for all the classes with two-dimensional barycentric coordinates from the namespace `CGAL::Barycentric_coordinates`. +Requirements of the template parameter `Traits` for all the classes with two-dimensional barycentric coordinates from the namespace `CGAL::Barycentric_coordinates`. \cgalHasModel All models of `Kernel` @@ -12,12 +12,12 @@ class BarycentricTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! - A model of `FieldNumberType`. -*/ + A model of `FieldNumberType`. +*/ typedef unspecified_type FT; /// @} @@ -26,36 +26,36 @@ typedef unspecified_type FT; /// @{ /*! - A model of `Kernel::Point_2`. -*/ -typedef unspecified_type Point_2; + A model of `Kernel::Point_2`. +*/ +typedef unspecified_type Point_2; /*! - A model of `Kernel::Vector_2`. -*/ -typedef unspecified_type Vector_2; + A model of `Kernel::Vector_2`. +*/ +typedef unspecified_type Vector_2; -/// @} +/// @} /// \name Two-dimensional Constructions /// @{ /*! - A model of this concept must provide an FT operator(const Point_2 &p, const Point_2 &q, const Point_2 &r) - that returns the signed area of the triangle defined by the points p, q, and r. -*/ -typedef unspecified_type Compute_area_2; + A model of this concept must provide an FT operator(const Point_2 &p, const Point_2 &q, const Point_2 &r) + that returns the signed area of the triangle defined by the points p, q, and r. +*/ +typedef unspecified_type Compute_area_2; /*! A model of this concept must provide an FT operator(const Point_2 &p, const Point_2 &q) that returns the squared Euclidean distance between the points p and q. -*/ -typedef unspecified_type Compute_squared_distance_2; +*/ +typedef unspecified_type Compute_squared_distance_2; /*! A model of this concept must provide an FT operator(const Vector_2 &p) that returns the squared length of the vector p. -*/ +*/ typedef unspecified_type Compute_squared_length_2; /*! @@ -70,23 +70,23 @@ typedef unspecified_type Compute_scalar_product_2; /// @{ /*! - A model of this concept must provide a bool operator(const Point_2 &p, const Point_2 &q) - that returns true if p = q and false otherwise. -*/ -typedef unspecified_type Equal_2; + A model of this concept must provide a bool operator(const Point_2 &p, const Point_2 &q) + that returns true if p = q and false otherwise. +*/ +typedef unspecified_type Equal_2; /*! - A model of this concept must provide a bool operator(const Point_2 &p, const Point_2 &q, const Point_2 &r) - that returns true if the points p, q, and r are collinear and false otherwise. -*/ -typedef unspecified_type Collinear_2; + A model of this concept must provide a bool operator(const Point_2 &p, const Point_2 &q, const Point_2 &r) + that returns true if the points p, q, and r are collinear and false otherwise. +*/ +typedef unspecified_type Collinear_2; /*! - A model of this concept must provide a bool operator(const Point_2 &p, const Point_2 &q, const Point_2 &r) - that returns true if the point q lies between the points p and r and all three points are collinear. -*/ -typedef unspecified_type Collinear_are_ordered_along_line_2; + A model of this concept must provide a bool operator(const Point_2 &p, const Point_2 &q, const Point_2 &r) + that returns true if the point q lies between the points p and r and all three points are collinear. +*/ +typedef unspecified_type Collinear_are_ordered_along_line_2; -/// @} +/// @} }; /* end BarycentricTraits_2 */ diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt index 2bfc68a24f3f..fe29d09d8afa 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp index b3aae353b79a..9cab09334964 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp @@ -24,7 +24,7 @@ int main() // Construct a unit square. const int number_of_vertices = 4; Point_vector vertices(number_of_vertices); - + vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); vertices[2] = Point(1, 1); vertices[3] = Point(0, 1); // Create an std::vector to store coordinates. @@ -96,7 +96,7 @@ int main() // Output the computed coordinate values. cout << endl << "Exact discrete harmonic coordinates for all the defined points: " << endl << endl; - const size_t number_of_query_points = coordinates.size(); + const size_t number_of_query_points = coordinates.size(); for(int index = 0; index < int(number_of_query_points); ++index) { cout << "Coordinate " << index % number_of_vertices + 1 << " = " << coordinates[index] << " "; if((index + 1) % number_of_vertices == 0) cout << endl; diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Mean_value_coordinates_example.cpp b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Mean_value_coordinates_example.cpp index 103c8f0bd6f4..fe31f874df7b 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Mean_value_coordinates_example.cpp +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Mean_value_coordinates_example.cpp @@ -20,11 +20,11 @@ typedef CGAL::Barycentric_coordinates::Generalized_barycentric_coordinates_2 vertex_handle(number_of_vertices); @@ -114,7 +114,7 @@ int main() const Point &point = vertex_iterator->point(); mean_value_coordinates(point, std::back_inserter(coordinates)); - for(int j = 0; j < number_of_vertices; ++j) + for(int j = 0; j < number_of_vertices; ++j) point_coordinates[j] = std::make_pair(vertices[j], coordinates[j]); Scalar f = CGAL::linear_interpolation(point_coordinates.begin(), point_coordinates.end(), Scalar(1), Value_access(point_function_value)); diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp index 8c3224048361..ef94e6f6a336 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp @@ -43,7 +43,7 @@ int main() // Print some information about the polygon and coordinates. wachspress_coordinates.print_information(); - + // Compute Wachspress coordinates for all the randomly defined points. cout << endl << "Computed Wachspress coordinates: " << endl << endl; for(int i = 0; i < number_of_points; ++i) { diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2.h index 4978a43e66eb..80f390361050 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2.h @@ -20,12 +20,11 @@ #include -#include -#include +#include +#include #include #include #include -#include +#include #endif // CGAL_BARYCENTRIC_COORDINATES_2_H - \ No newline at end of file diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h index 8600942e7351..8ca18216b567 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h @@ -41,7 +41,7 @@ namespace Barycentric_coordinates { /*! * \ingroup PkgBarycentricCoordinates2Ref - * The class `Discrete_harmonic_2` implements 2D discrete harmonic coordinates ( \cite cgal:bc:fhk-gcbcocp-06, \cite cgal:pp-cdmsc-93, \cite cgal:bc:eddhls-maam-95 ). + * The class `Discrete_harmonic_2` implements 2D discrete harmonic coordinates ( \cite cgal:bc:fhk-gcbcocp-06, \cite cgal:pp-cdmsc-93, \cite cgal:bc:eddhls-maam-95 ). * This class is parameterized by a traits class `Traits`, and it is used as a coordinate class to complete the class `Generalized_barycentric_coordinates_2`. * For a polygon with three vertices (triangle) it is better to use the class `Triangle_coordinates_2`. * Discrete harmonic coordinates can be computed exactly. By definition, they do not necesserily give positive values. @@ -54,7 +54,7 @@ namespace Barycentric_coordinates { */ -template +template class Discrete_harmonic_2 { @@ -103,10 +103,10 @@ template // Computation of Discrete Harmonic Basis Functions // This function computes discrete harmonic barycentric coordinates for a chosen query point on the bounded side of a strictly convex polygon. - // \pre The provided polygon is strictly convex. + // \pre The provided polygon is strictly convex. template inline boost::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) - { + { switch(type_of_algorithm) { case PRECISE: @@ -129,7 +129,7 @@ template // \pre The provided polygon is strictly convex. template inline boost::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm, const bool warning_tag = true) - { + { switch(type_of_algorithm) { case PRECISE: @@ -356,7 +356,7 @@ template { if(warning_tag) std::cout << std::endl << "ATTENTION: Discrete harmonic coordinates might be not well-defined outside the polygon!" << std::endl; - + // Use the same formulas as for the bounded side since they are also valid on the unbounded side. return coordinates_on_bounded_side_fast_2(query_point, output); } @@ -407,7 +407,7 @@ template // Index of the last polygon's vertex. const int last = int(number_of_vertices) - 1; - // Test all the consequent triplets of the polygon's vertices on collinearity. + // Test all the consequent triplets of the polygon's vertices on collinearity. // In case we find at least one, return WEAKLY_CONVEX polygon. if(collinear_2(vertex[last], vertex[0], vertex[1])) return WEAKLY_CONVEX; diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h index 23475f41428e..b36e1db9babf 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h @@ -24,7 +24,7 @@ #include // Barycentric coordinates headers. -#include +#include #include // Boost headers. @@ -49,7 +49,7 @@ namespace Barycentric_coordinates { */ -template +template class Generalized_barycentric_coordinates_2 { @@ -89,7 +89,7 @@ template number_of_vertices(vertex.size()), equal_2(barycentric_traits.equal_2_object()), collinear_2(barycentric_traits.collinear_2_object()), - collinear_are_ordered_along_line_2(barycentric_traits.collinear_are_ordered_along_line_2_object()) + collinear_are_ordered_along_line_2(barycentric_traits.collinear_are_ordered_along_line_2_object()) { CGAL_precondition( int(number_of_vertices) > 2 ); @@ -104,19 +104,19 @@ template /// Computes generalized barycentric coordinates for any query point in the plane with respect to all the vertices of the polygon. /// Computed coordinates are stored in the output iterator `output`. /// - /// Different choices of the parameter `query_point_location` are possible: - /// `CGAL::Barycentric_coordinates::UNSPECIFIED_LOCATION` - default constant with automatic check for a location, - /// `CGAL::Barycentric_coordinates::ON_BOUNDED_SIDE` - for a strictly interior query point, + /// Different choices of the parameter `query_point_location` are possible: + /// `CGAL::Barycentric_coordinates::UNSPECIFIED_LOCATION` - default constant with automatic check for a location, + /// `CGAL::Barycentric_coordinates::ON_BOUNDED_SIDE` - for a strictly interior query point, /// `CGAL::Barycentric_coordinates::ON_BOUNDARY` - for a query point on the boundary of the polygon, /// `CGAL::Barycentric_coordinates::ON_VERTEX` - for a query point at one of the polygon's vertices, and /// `CGAL::Barycentric_coordinates::ON_UNBOUNDED_SIDE` - for a strictly exterior query point. /// - /// Another parameter is `type_of_algorithm` with the following possible constants: + /// Another parameter is `type_of_algorithm` with the following possible constants: /// `CGAL::Barycentric_coordinates::PRECISE` - default slow algorithm, which is as precise as possible and /// `CGAL::Barycentric_coordinates::FAST` - fast algorithm, which is less precise but much faster. template inline boost::optional operator()(const Point_2 &query_point, OutputIterator output, Query_point_location query_point_location = UNSPECIFIED_LOCATION, Type_of_algorithm type_of_algorithm = PRECISE) - { + { return coordinates_2(query_point, output, query_point_location, type_of_algorithm); } @@ -127,7 +127,7 @@ template /// \pre (0 <= index) && (index < number of the polygon's vertices). template inline boost::optional compute_on_edge(const Point_2 &query_point, const int index, OutputIterator output) const - { + { return coordinates_on_boundary_2(query_point, index, output); } @@ -157,39 +157,39 @@ template /// @{ /// Returns all the vertices of the polygon. - inline const Vertex_range& vertices() const - { - return vertex; + inline const Vertex_range& vertices() const + { + return vertex; } /// Returns the first vertex of the polygon. - inline const Point_2& first_vertex() const - { - return vertex[0]; + inline const Point_2& first_vertex() const + { + return vertex[0]; } /// Returns the last vertex of the polygon. - inline const Point_2& last_vertex() const - { - return vertex[number_of_vertices-1]; + inline const Point_2& last_vertex() const + { + return vertex[number_of_vertices-1]; } /// @} // Computes generalized barycentric coordinates for any query point in the plane with respect to all the vertices of the polygon. - // This function accepts a container of the type `std::vector` + // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. inline boost::optional > > operator()(const Point_2 &query_point, std::vector &output_vector, Query_point_location query_point_location = UNSPECIFIED_LOCATION, Type_of_algorithm type_of_algorithm = PRECISE) { - output_vector.reserve(output_vector.size() + number_of_vertices); + output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; OutputIterator output = std::back_inserter(output_vector); return coordinates_2(query_point, output, query_point_location, type_of_algorithm); } // Computes generalized barycentric coordinates for a query point on the polygon's boundary with known index of the edge to which this point belongs. - // This function accepts a container of the type `std::vector` + // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. // @@ -197,35 +197,35 @@ template // \pre (0 <= index) && (index < number of the polygon's vertices). inline boost::optional > > compute_on_edge(const Point_2 &query_point, const int index, std::vector &output_vector) const { - output_vector.reserve(output_vector.size() + number_of_vertices); + output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; OutputIterator output = std::back_inserter(output_vector); return coordinates_on_boundary_2(query_point, index, output); } // Computes generalized barycentric coordinates for a query point, which coincides with one of the polygon's vertices, with known index. - // This function accepts a container of the type `std::vector` + // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. // // \pre (0 <= index) && (index < number of the polygon's vertices). inline boost::optional > > compute_on_vertex(const int index, std::vector &output_vector) const { - output_vector.reserve(output_vector.size() + number_of_vertices); + output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; OutputIterator output = std::back_inserter(output_vector); return coordinates_on_vertex_2(index, output); } // Computes generalized barycentric weights (unnormalized coordinates) for any strictly interior query point with respect to all the vertices of the polygon. - // This function accepts a container of the type `std::vector` + // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of weight values. // // \pre The provided query point belongs to the polygon's interior, excluding the boundary. inline boost::optional > > compute_weights(const Point_2 &query_point, std::vector &output_vector) { - output_vector.reserve(output_vector.size() + number_of_vertices); + output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; OutputIterator output = std::back_inserter(output_vector); return weights_2(query_point, output); @@ -260,7 +260,7 @@ template coordinate.print_coordinates_information(output_stream); } - + private: // Internal global variables. @@ -274,7 +274,7 @@ template typename Traits::Equal_2 equal_2; typename Traits::Collinear_2 collinear_2; - typename Traits::Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line_2; + typename Traits::Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line_2; // WEIGHTS. @@ -373,7 +373,7 @@ template template boost::optional coordinates_on_boundary_2(const Point_2 &query_point, const int index, OutputIterator &output) const { - CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_BOUNDARY ); + CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_BOUNDARY ); CGAL_precondition( (0 <= index) && (index < int(number_of_vertices)) ); // Index of the last polygon's vertex. @@ -420,7 +420,7 @@ template const int last = int(number_of_vertices) - 1; // If the query point is on the last edge, call the function coordinates_on_last_edge_2(). - if(collinear_2(vertex[last], vertex[0], query_point) && collinear_are_ordered_along_line_2(vertex[last], query_point, vertex[0])) { + if(collinear_2(vertex[last], vertex[0], query_point) && collinear_are_ordered_along_line_2(vertex[last], query_point, vertex[0])) { return coordinates_on_last_edge_2(query_point, last, output); } else { @@ -477,7 +477,7 @@ template Segment_coordinates_2 segment_coordinates(vertex[last], vertex[0]); boost::optional success = segment_coordinates(query_point, std::back_inserter(coordinate)); - // Store all the coordinate values. + // Store all the coordinate values. // All the values are zeros apart from those corresponding to the first and the last vertices of the polygon. *output = coordinate[1]; ++output; diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h index bda0cd8526f8..a5b94b9ee965 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h @@ -20,11 +20,11 @@ #include -// STL headers. +// STL headers. #include // CGAL headers. -#include +#include #include #include @@ -45,14 +45,14 @@ namespace Barycentric_coordinates { // Try to find a square root object in the provided `Traits` class. If not, then use the default square root from CGAL. // Finds a square root of the provided value of the type `Kernel::FT` by first converting it to the double type and then taking the square root using the `CGAL::sqrt()` function. -template +template class Default_sqrt { typedef typename Traits::FT FT; public: FT operator()(const FT &value) const - { + { return FT(CGAL::sqrt(CGAL::to_double(value))); } }; @@ -66,9 +66,9 @@ template::v public: typedef Default_sqrt Sqrt; - static Sqrt sqrt_object(const Traits&) - { - return Sqrt(); + static Sqrt sqrt_object(const Traits&) + { + return Sqrt(); } }; @@ -80,8 +80,8 @@ template typedef typename Traits::Sqrt Sqrt; static Sqrt sqrt_object(const Traits &traits) - { - return traits.sqrt_object(); + { + return traits.sqrt_object(); } }; @@ -103,8 +103,8 @@ template \cgalModels `BarycentricCoordinates_2` */ - -template + +template class Mean_value_2 { @@ -161,7 +161,7 @@ template // This function computes mean value barycentric coordinates for a chosen query point on the bounded side of a simple polygon. template inline boost::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) - { + { switch(type_of_algorithm) { case PRECISE: @@ -183,7 +183,7 @@ template // This function computes mean value barycentric coordinates for a chosen query point on the unbounded side of a simple polygon. template inline boost::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) - { + { switch(type_of_algorithm) { case PRECISE: @@ -265,7 +265,7 @@ template D[n-1] = scalar_product_2(s[n-1], s[0]); // Compute intermediate values t using the formulas from slide 19 here - // - http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf + // - http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf for(int i = 0; i < n-1; ++i) { CGAL_precondition( (r[i]*r[i+1] + D[i]) != FT(0) ); t[i] = A[i] / (r[i]*r[i+1] + D[i]); @@ -394,7 +394,7 @@ template D[n-1] = scalar_product_2(s[n-1], s[0]); // Compute intermediate values t using the formulas from slide 19 here - // - http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf + // - http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf for(int i = 0; i < n-1; ++i) { CGAL_precondition( (r[i]*r[i+1] + D[i]) != FT(0) ); t[i] = A[i] / (r[i]*r[i+1] + D[i]); diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h index 0a29b1f16600..9738eba83b7a 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h @@ -20,11 +20,11 @@ #include -// STL headers. +// STL headers. #include // CGAL headers. -#include +#include #include // Boost headers. @@ -47,7 +47,7 @@ namespace Barycentric_coordinates { */ -template +template class Segment_coordinates_2 { @@ -83,7 +83,7 @@ template barycentric_traits(b_traits), scalar_product_2(barycentric_traits.compute_scalar_product_2_object()), squared_distance_2(barycentric_traits.compute_squared_distance_2_object()), - equal_2(barycentric_traits.equal_2_object()) + equal_2(barycentric_traits.equal_2_object()) { CGAL_precondition( !equal_2(first_vertex, second_vertex) ); @@ -99,7 +99,7 @@ template /// Computes segment barycentric coordinates for a chosen query point with respect to both vertices of the segment. /// Computed coordinates are stored in the output iterator `output`. - template + template inline boost::optional operator()(const Point_2 &query_point, OutputIterator output) { return segment_coordinates_2(query_point, output); @@ -111,32 +111,32 @@ template /// @{ /// Returns both vertices of the segment. - inline const Vertex_range& vertices() const - { - return vertex; + inline const Vertex_range& vertices() const + { + return vertex; } /// Returns the first vertex of the segment. - inline const Point_2& first_vertex() const - { - return vertex[0]; + inline const Point_2& first_vertex() const + { + return vertex[0]; } /// Returns the second vertex of the segment. - inline const Point_2& second_vertex() const - { - return vertex[1]; + inline const Point_2& second_vertex() const + { + return vertex[1]; } /// @} // Computes segment barycentric coordinates for a chosen query point with respect to both vertices of the segment. - // This function accepts a container of the type `std::vector` + // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. inline boost::optional > > operator()(const Point_2 &query_point, std::vector &output_vector) { - output_vector.reserve(output_vector.size() + 2); + output_vector.reserve(output_vector.size() + 2); typedef typename std::back_insert_iterator > OutputIterator; OutputIterator output = std::back_inserter(output_vector); return segment_coordinates_2(query_point, output); @@ -179,9 +179,9 @@ template typename Traits::Equal_2 equal_2; // Compute segment coordinates. - template + template boost::optional segment_coordinates_2(const Point_2 &query_point, OutputIterator &output) - { + { // Project point on the segment and compute the first coordinate. opposite_scalar_product = scalar_product_2(query_point - vertex[1], vertex[0] - vertex[1]); b_first = opposite_scalar_product / squared_distance_2(vertex[0], vertex[1]); @@ -202,7 +202,7 @@ template \anchor seg_coord_global * \relates Segment_coordinates_2 * This is a global function that takes both vertices of a segment and computes segment coordinates at a given query point with respect to these vertices. - + \tparam Traits must be a model of the concept `BarycentricTraits_2`. */ diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h index 611f46f81507..52ea066ae665 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h @@ -20,7 +20,7 @@ #include -// STL headers. +// STL headers. #include // CGAL headers. @@ -49,7 +49,7 @@ namespace Barycentric_coordinates { */ -template +template class Triangle_coordinates_2 { @@ -113,33 +113,33 @@ template /// @{ /// Returns all the vertices of the triangle. - inline const Vertex_range& vertices() const - { - return vertex; + inline const Vertex_range& vertices() const + { + return vertex; } /// Returns the first vertex of the triangle. - inline const Point_2& first_vertex() const - { - return vertex[0]; + inline const Point_2& first_vertex() const + { + return vertex[0]; } /// Returns the second vertex of the triangle. - inline const Point_2& second_vertex() const - { - return vertex[1]; + inline const Point_2& second_vertex() const + { + return vertex[1]; } /// Returns the third vertex of the triangle. - inline const Point_2& third_vertex() const - { - return vertex[2]; + inline const Point_2& third_vertex() const + { + return vertex[2]; } /// @} // Computes triangle barycentric coordinates for a chosen query point with respect to all three vertices of the triangle. - // This function accepts a container of the type `std::vector` + // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. inline boost::optional > > operator()(const Point_2 &query_point, std::vector &output_vector) @@ -222,7 +222,7 @@ template /*! * \relates Triangle_coordinates_2 * This is a global function that takes three vertices of a triangle and computes triangle coordinates at a given query point with respect to these vertices. - + \tparam Traits must be a model of the concept `BarycentricTraits_2`. */ diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h index 5c189e772138..4cadb90e8ad1 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h @@ -53,8 +53,8 @@ namespace Barycentric_coordinates { \pre The provided polygon is strictly convex. */ - -template + +template class Wachspress_2 { @@ -101,10 +101,10 @@ template // Computation of Wachspress Basis Functions // This function computes Wachspress barycentric coordinates for a chosen query point on the bounded side of a strictly convex polygon. - // \pre The provided polygon is strictly convex. + // \pre The provided polygon is strictly convex. template inline boost::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) - { + { switch(type_of_algorithm) { case PRECISE: @@ -127,7 +127,7 @@ template // \pre The provided polygon is strictly convex. template inline boost::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm, const bool warning_tag = true) - { + { switch(type_of_algorithm) { case PRECISE: @@ -177,7 +177,7 @@ template // WEIGHTS. // Compute Wachspress weights without normalization. - template + template boost::optional weights_2(const Point_2 &query_point, OutputIterator &output) { // Get the number of vertices in the polygon. @@ -390,7 +390,7 @@ template // Index of the last polygon's vertex. const int last = int(number_of_vertices) - 1; - // Test all the consequent triplets of the polygon's vertices on collinearity. + // Test all the consequent triplets of the polygon's vertices on collinearity. // In case we find at least one, return WEAKLY_CONVEX polygon. if(collinear_2(vertex[last], vertex[0], vertex[1])) return WEAKLY_CONVEX; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_segment_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_segment_test.cpp index 6cbe98c23961..6c56e699d823 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_segment_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_segment_test.cpp @@ -57,7 +57,7 @@ int main() assert(difference == zero); - if(difference != zero) + if(difference != zero) { cout << endl << "Almost_degenerate_segment_test: FAILED." << endl << endl; exit(EXIT_FAILURE); @@ -70,13 +70,13 @@ int main() assert(coordinates[12] - half == Scalar(0) && coordinates[13] - half == Scalar(0)); if( coordinates[12] - half != Scalar(0) || - coordinates[13] - half != Scalar(0) ) + coordinates[13] - half != Scalar(0) ) { cout << endl << "Almost_degenerate_segment_test: FAILED." << endl << endl; exit(EXIT_FAILURE); } cout << endl << "Almost_degenerate_segment_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_triangle_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_triangle_test.cpp index 4ce968f46a9a..c99122331fb6 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_triangle_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Almost_degenerate_triangle_test.cpp @@ -88,6 +88,6 @@ int main() } cout << endl << "Almost_degenerate_triangle_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt index 01ca0f521455..1e5b96696b22 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_at_vertices_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_at_vertices_test.cpp index 2269809cafa2..c9faf7fb31d8 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_at_vertices_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_at_vertices_test.cpp @@ -59,8 +59,8 @@ int main() for(int i = 0; i < 6; ++i) { const Output_type result = wachspress_coordinates.compute_on_vertex(i, std::back_inserter(coordinates)); - assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && coordinates[count + 1] - expected_coordinates[count + 1] == Scalar(0) && - coordinates[count + 2] - expected_coordinates[count + 2] == Scalar(0) && coordinates[count + 3] - expected_coordinates[count + 3] == Scalar(0) && + assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && coordinates[count + 1] - expected_coordinates[count + 1] == Scalar(0) && + coordinates[count + 2] - expected_coordinates[count + 2] == Scalar(0) && coordinates[count + 3] - expected_coordinates[count + 3] == Scalar(0) && coordinates[count + 4] - expected_coordinates[count + 4] == Scalar(0) && coordinates[count + 5] - expected_coordinates[count + 5] == Scalar(0) ); if( coordinates[count + 0] - expected_coordinates[count + 0] != Scalar(0) || @@ -80,9 +80,9 @@ int main() count = 0; for(int i = 0; i < 6; ++i) { const Output_type result = wachspress_coordinates(query_points[i], std::back_inserter(coordinates), CGAL::Barycentric_coordinates::ON_VERTEX); - - assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && coordinates[count + 1] - expected_coordinates[count + 1] == Scalar(0) && - coordinates[count + 2] - expected_coordinates[count + 2] == Scalar(0) && coordinates[count + 3] - expected_coordinates[count + 3] == Scalar(0) && + + assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && coordinates[count + 1] - expected_coordinates[count + 1] == Scalar(0) && + coordinates[count + 2] - expected_coordinates[count + 2] == Scalar(0) && coordinates[count + 3] - expected_coordinates[count + 3] == Scalar(0) && coordinates[count + 4] - expected_coordinates[count + 4] == Scalar(0) && coordinates[count + 5] - expected_coordinates[count + 5] == Scalar(0) ); if( coordinates[count + 0] - expected_coordinates[count + 0] != Scalar(0) || diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_on_boundary_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_on_boundary_test.cpp index 84a33c9bd430..e2cf0f2f996b 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_on_boundary_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Computation_on_boundary_test.cpp @@ -32,9 +32,9 @@ int main() { Point_vector vertices(7); - vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); - vertices[2] = Point(Scalar(1) /Scalar(2), 1); vertices[3] = Point(Scalar(3) /Scalar(2), Scalar(3)/Scalar(2)); - vertices[4] = Point(Scalar(-1)/Scalar(2), Scalar(3)/Scalar(2)); vertices[5] = Point(0, 1); + vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); + vertices[2] = Point(Scalar(1) /Scalar(2), 1); vertices[3] = Point(Scalar(3) /Scalar(2), Scalar(3)/Scalar(2)); + vertices[4] = Point(Scalar(-1)/Scalar(2), Scalar(3)/Scalar(2)); vertices[5] = Point(0, 1); vertices[6] = Point(Scalar(-1)/Scalar(2), Scalar(1)/Scalar(2)); Mean_value_coordinates mean_value_coordinates(vertices.begin(), vertices.end()); diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_almost_degenerate_polygon_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_almost_degenerate_polygon_test.cpp index d0fed961c74d..169e010af351 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_almost_degenerate_polygon_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_almost_degenerate_polygon_test.cpp @@ -111,7 +111,7 @@ int main() const Scalar quater = Scalar(1)/Scalar(4); - assert(coordinates[120] - quater == Scalar(0) && coordinates[121] - quater == Scalar(0) && + assert(coordinates[120] - quater == Scalar(0) && coordinates[121] - quater == Scalar(0) && coordinates[122] - quater == Scalar(0) && coordinates[123] - quater == Scalar(0) ); if( coordinates[120] - quater != Scalar(0) || @@ -124,6 +124,6 @@ int main() } cout << endl << "DH_almost_degenerate_polygon_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_const_linear_precision_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_const_linear_precision_test.cpp index 9bc2b9bfe190..c31d8a6b9c05 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_const_linear_precision_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_const_linear_precision_test.cpp @@ -87,6 +87,6 @@ int main() } cout << endl << "DH_const_linear_precision_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_triangle_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_triangle_test.cpp index e8e16473ddf7..c8b0bdef5d1b 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_triangle_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_triangle_test.cpp @@ -59,7 +59,7 @@ int main() const Output_type dh_result = discrete_harmonic_coordinates(point, dh_coordinates); assert(tri_coordinates[count + 0] - dh_coordinates[count + 0] == Scalar(0) && - tri_coordinates[count + 1] - dh_coordinates[count + 1] == Scalar(0) && + tri_coordinates[count + 1] - dh_coordinates[count + 1] == Scalar(0) && tri_coordinates[count + 2] - dh_coordinates[count + 2] == Scalar(0) ); if( tri_coordinates[count + 0] - dh_coordinates[count + 0] != Scalar(0) || @@ -74,6 +74,6 @@ int main() } cout << endl << "DH_triangle_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_weights_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_weights_test.cpp index 2d3e1eeb6b69..d2e3e18fc49a 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_weights_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/DH_weights_test.cpp @@ -63,7 +63,7 @@ int main() const Output_type c_result = discrete_harmonic_coordinates(point, expected_coordinates); - assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && + assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && coordinates[count + 1] - expected_coordinates[count + 1] == Scalar(0) && coordinates[count + 2] - expected_coordinates[count + 2] == Scalar(0) && coordinates[count + 3] - expected_coordinates[count + 3] == Scalar(0) && @@ -101,7 +101,7 @@ int main() const Output_type c_result = discrete_harmonic_coordinates(query_points[i], expected_coordinates); - assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && + assert(coordinates[count + 0] - expected_coordinates[count + 0] == Scalar(0) && coordinates[count + 1] - expected_coordinates[count + 1] == Scalar(0) && coordinates[count + 2] - expected_coordinates[count + 2] == Scalar(0) && coordinates[count + 3] - expected_coordinates[count + 3] == Scalar(0) && @@ -120,6 +120,6 @@ int main() } cout << endl << "DH_weights_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_const_linear_precision_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_const_linear_precision_test.cpp index 54d699920da8..534393a16651 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_const_linear_precision_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_const_linear_precision_test.cpp @@ -106,6 +106,6 @@ int main() } cout << endl << "MV_const_linear_precision_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_special_points_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_special_points_test.cpp index 125dbdcf6508..4149372edac9 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_special_points_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_special_points_test.cpp @@ -120,6 +120,6 @@ int main() } cout << endl << "MV_special_points_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_triangle_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_triangle_test.cpp index d7e8171b1e88..a69d7eae71ba 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_triangle_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_triangle_test.cpp @@ -77,6 +77,6 @@ int main() } cout << endl << "MV_triangle_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weakly_convex_polygon_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weakly_convex_polygon_test.cpp index 63c75cada21d..0dc3b6bcfd8f 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weakly_convex_polygon_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weakly_convex_polygon_test.cpp @@ -84,6 +84,6 @@ int main() } cout << endl << "MV_weakly_convex_polygon_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weights_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weights_test.cpp index a16348fc5690..e0e03e8adfc7 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weights_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/MV_weights_test.cpp @@ -32,8 +32,8 @@ int main() { Point_vector vertices(5); - vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); - vertices[2] = Point(Scalar(5) /Scalar(4), Scalar(3)/Scalar(4)); vertices[3] = Point(Scalar(1)/Scalar(2), Scalar(3)/Scalar(2)); + vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); + vertices[2] = Point(Scalar(5) /Scalar(4), Scalar(3)/Scalar(4)); vertices[3] = Point(Scalar(1)/Scalar(2), Scalar(3)/Scalar(2)); vertices[4] = Point(Scalar(-1)/Scalar(4), Scalar(3)/Scalar(4)); Mean_value_coordinates mean_value_coordinates(vertices.begin(), vertices.end()); @@ -85,6 +85,6 @@ int main() } cout << endl << "MV_weights_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp index c7fb23045a0e..4451ba3d0761 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp @@ -17,7 +17,7 @@ typedef Kernel::Point_2 Point; typedef std::array Pair; using std::cout; using std::endl; using std::string; - + int main() { const Point first_vertex = Point(0, 0); @@ -38,6 +38,6 @@ int main() } cout << endl << "Segment_test_with_array: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_coordinates_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_coordinates_test.cpp index 8fae1a879707..d4a0b8c1edf3 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_coordinates_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_coordinates_test.cpp @@ -25,7 +25,7 @@ using std::cout; using std::endl; using std::string; int main() { - const Point first_vertex = Point(0, 0); + const Point first_vertex = Point(0, 0); const Point second_vertex = Point(1, 0); const Point third_vertex = Point(Scalar(1)/Scalar(2), 1); diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp index b11ec23a86ea..a4e88caa98da 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp @@ -17,7 +17,7 @@ typedef Kernel::Point_2 Point; typedef std::array Triple; using std::cout; using std::endl; using std::string; - + int main() { const Point first_vertex = Point(0, 0); @@ -27,7 +27,7 @@ int main() const Triple p = CGAL::Barycentric_coordinates::compute_triangle_coordinates_2(first_vertex, second_vertex, third_vertex, center, Kernel()); - assert(p[0] - (Scalar(1) / Scalar(4)) == Scalar(0) && + assert(p[0] - (Scalar(1) / Scalar(4)) == Scalar(0) && p[1] - (Scalar(1) / Scalar(4)) == Scalar(0) && p[2] - (Scalar(1) / Scalar(2)) == Scalar(0) ); diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_DH_unit_square_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_DH_unit_square_test.cpp index db6b9c4cc11f..55e7592a6ba5 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_DH_unit_square_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_DH_unit_square_test.cpp @@ -74,6 +74,6 @@ int main() } cout << endl << "WP_DH_unit_square_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_almost_degenerate_polygon_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_almost_degenerate_polygon_test.cpp index f7eeb4c3a00c..357ada0b1842 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_almost_degenerate_polygon_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_almost_degenerate_polygon_test.cpp @@ -125,6 +125,6 @@ int main() } cout << endl << "WP_almost_degenerate_polygon_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_const_linear_precision_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_const_linear_precision_test.cpp index 86a98c1dc782..1b7db5b3ff52 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_const_linear_precision_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_const_linear_precision_test.cpp @@ -31,8 +31,8 @@ int main() { Point_vector vertices(6); - vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); - vertices[2] = Point(Scalar(7)/Scalar(4), Scalar(3)/Scalar(4)); vertices[3] = Point(Scalar(5) /Scalar(4), Scalar(3)/Scalar(2)); + vertices[0] = Point(0, 0); vertices[1] = Point(1, 0); + vertices[2] = Point(Scalar(7)/Scalar(4), Scalar(3)/Scalar(4)); vertices[3] = Point(Scalar(5) /Scalar(4), Scalar(3)/Scalar(2)); vertices[4] = Point(Scalar(1)/Scalar(4), Scalar(3)/Scalar(2)); vertices[5] = Point(Scalar(-1)/Scalar(2), Scalar(5)/Scalar(4)); Wachspress_coordinates wachspress_coordinates(vertices.begin(), vertices.end()); @@ -88,6 +88,6 @@ int main() } cout << endl << "WP_const_linear_precision_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_triangle_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_triangle_test.cpp index 9590ede576d5..e7950a340fe1 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_triangle_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_triangle_test.cpp @@ -74,6 +74,6 @@ int main() } cout << endl << "WP_triangle_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_weights_test.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_weights_test.cpp index 3f654aebf9f1..1810cbd46265 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_weights_test.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/WP_weights_test.cpp @@ -120,6 +120,6 @@ int main() } cout << endl << "WP_weights_test: PASSED." << endl << endl; - + return EXIT_SUCCESS; } diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt index 91381c3a6b57..dac559d68462 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Boolean_set_operations_2_GraphicsView_Demo ) +project( Boolean_set_operations_2_GraphicsView_Demo ) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -26,7 +26,7 @@ set(CMAKE_AUTOMOC ON) qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject - + # The executable itself. add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp ${CGAL_Qt5_MOC_FILES} ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ) diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp index 6602c9248ff8..a8dd97b66c9d 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009 GeometryFactory Sarl (France). // All rights reserved. -// +// // This file is part of CGAL (www.cgal.org). // // $URL$ @@ -15,11 +15,11 @@ #ifdef ENABLE_TRACE # define TRACE(m) { std::ostringstream ss ; ss << m << std::endl ; trace(ss.str()); } #else -# define TRACE(m) +# define TRACE(m) #endif -#include +#include #include #include #include @@ -31,7 +31,7 @@ void trace( std::string s ) out << s ; } -#include +#include #include #include @@ -46,7 +46,7 @@ void trace( std::string s ) #include #include -#include +#include #include #include #include @@ -103,23 +103,23 @@ void show_error( std::string aS ) void error( std::string aS ) { show_error(aS); - - throw std::runtime_error(aS); + + throw std::runtime_error(aS); } void error_handler ( char const* what, char const* expr, char const* file, int line, char const* msg ) { std::ostringstream ss ; - + ss << "CGAL error: " << what << " violation!" << std::endl << "Expr: " << expr << std::endl << "File: " << file << std::endl << "Line: " << line << std::endl; if ( msg != 0) ss << "Explanation:" << msg << std::endl; - + error(ss.str()); - + } @@ -130,9 +130,9 @@ enum { CIRCULAR_TYPE, BEZIER_TYPE } ; QPen sPens [] = { QPen(QColor(0,0,255),0,Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin) , QPen(QColor(255,0,0),0,Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin) - , QPen(QColor(0,255,0),0,Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin) + , QPen(QColor(0,255,0),0,Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin) } ; - + QBrush sBrushes[] = { QBrush(QColor(0,0,255,32 )) , QBrush(QColor(255,0,0,32 )) , QBrush(QColor(0,255,0,220)) @@ -140,19 +140,19 @@ QBrush sBrushes[] = { QBrush(QColor(0,0,255,32 )) struct Rep_base { virtual ~Rep_base() {} - + virtual int type () const = 0 ; - + virtual CGAL::Qt::GraphicsItem* gi() const = 0 ; virtual CGAL::Qt::GraphicsItem* gi() = 0 ; - + virtual void set_pen ( QPen const& aPen ) = 0 ; virtual void set_brush( QBrush const& aBrush ) = 0 ; - + virtual QRectF bounding_rect() const { return gi()->boundingRect() ; } - + virtual bool is_empty() const = 0 ; - + virtual void clear () = 0 ; virtual void complement () = 0 ; virtual void assign ( Rep_base const& aOther ) = 0 ; @@ -160,7 +160,7 @@ struct Rep_base virtual void join ( Rep_base const& aOther ) = 0 ; virtual void difference ( Rep_base const& aOther ) = 0 ; virtual void symmetric_difference( Rep_base const& aOther ) = 0 ; - + } ; @@ -172,109 +172,109 @@ class Rep : public Rep_base typedef GI_ GI ; typedef Set_ Set ; - + typedef Rep Self ; - + Rep() { mGI = new GI(&mSet) ; } - + Set const& set() const { return mSet ; } Set & set() { return mSet ; } - + virtual CGAL::Qt::GraphicsItem* gi() const { return mGI; } virtual CGAL::Qt::GraphicsItem* gi() { return mGI; } - - virtual void set_pen ( QPen const& aPen ) { mGI->setPen (aPen); } + + virtual void set_pen ( QPen const& aPen ) { mGI->setPen (aPen); } virtual void set_brush( QBrush const& aBrush ) { mGI->setBrush(aBrush); } - + virtual bool is_empty() const { return mSet.is_empty() ; } - - virtual void clear() - { + + virtual void clear() + { try { - mSet.clear() ; - } + mSet.clear() ; + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - - virtual void complement() - { + + virtual void complement() + { try { - mSet.complement(); - } + mSet.complement(); + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - - virtual void assign( Rep_base const& aOther ) - { + + virtual void assign( Rep_base const& aOther ) + { try { - mSet = cast(aOther).mSet; - } + mSet = cast(aOther).mSet; + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - - virtual void intersect( Rep_base const& aOther ) - { + + virtual void intersect( Rep_base const& aOther ) + { try { - mSet.intersection( cast(aOther).mSet); - } + mSet.intersection( cast(aOther).mSet); + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - - virtual void join( Rep_base const& aOther ) - { + + virtual void join( Rep_base const& aOther ) + { try { - mSet.join( cast(aOther).mSet); - } + mSet.join( cast(aOther).mSet); + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - - virtual void difference( Rep_base const& aOther ) - { + + virtual void difference( Rep_base const& aOther ) + { try { - mSet.difference( cast(aOther).mSet); - } + mSet.difference( cast(aOther).mSet); + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - - virtual void symmetric_difference( Rep_base const& aOther ) - { + + virtual void symmetric_difference( Rep_base const& aOther ) + { try { - mSet.symmetric_difference( cast(aOther).mSet); - } + mSet.symmetric_difference( cast(aOther).mSet); + } catch(...) { show_error("Exception thrown during boolean operation"); - } + } } - + static Self const& cast( Rep_base const& aOther ) { return dynamic_cast(aOther); } static Self & cast( Rep_base & aOther ) { return dynamic_cast(aOther); } - + private: GI* mGI; @@ -284,60 +284,60 @@ class Rep : public Rep_base class Circular_rep : public Rep { typedef Rep Base ; - + public: - - Circular_rep () : Base() {} - + + Circular_rep () : Base() {} + virtual int type() const { return CIRCULAR_TYPE ; } } ; class Bezier_rep : public Rep { typedef Rep Base ; - + public: - - - Bezier_rep () : Base() {} - + + + Bezier_rep () : Base() {} + virtual int type() const { return BEZIER_TYPE ; } } ; class Curve_set { typedef boost::shared_ptr Rep_ptr ; - + public: - - Curve_set( int aType, QPen aPen, QBrush aBrush ) + + Curve_set( int aType, QPen aPen, QBrush aBrush ) : mPen (aPen) , mBrush(aBrush) { reset_type(aType); } - - void reset_type( int aType ) + + void reset_type( int aType ) { mRep = aType == CIRCULAR_TYPE ? Rep_ptr(new Circular_rep()) : Rep_ptr(new Bezier_rep ()) ; - + mRep->set_pen (mPen); mRep->set_brush(mBrush); } - + CGAL::Qt::GraphicsItem const* gi() const { return mRep->gi() ; } CGAL::Qt::GraphicsItem* gi() { return mRep->gi() ; } - + QRectF bounding_rect() const { return mRep->bounding_rect() ; } - + bool is_empty() const { return !mRep || mRep->is_empty(); } - + void clear () { mRep->clear() ; } void complement () { mRep->complement() ; } - - void assign ( Curve_set const& aOther ) + + void assign ( Curve_set const& aOther ) { if ( is_circular() && aOther.is_circular() ) { @@ -346,10 +346,10 @@ class Curve_set else if ( is_bezier() && aOther.is_bezier() ) { get_bezier_rep()->assign( *aOther.get_bezier_rep() ) ; - } + } } - - void intersect( Curve_set const& aOther ) + + void intersect( Curve_set const& aOther ) { if ( is_circular() && aOther.is_circular() ) { @@ -358,10 +358,10 @@ class Curve_set else if ( is_bezier() && aOther.is_bezier() ) { get_bezier_rep()->intersect( *aOther.get_bezier_rep() ) ; - } + } } - - void join ( Curve_set const& aOther ) + + void join ( Curve_set const& aOther ) { if ( is_circular() && aOther.is_circular() ) { @@ -370,10 +370,10 @@ class Curve_set else if ( is_bezier() && aOther.is_bezier() ) { get_bezier_rep()->join( *aOther.get_bezier_rep() ) ; - } + } } - - void difference( Curve_set const& aOther ) + + void difference( Curve_set const& aOther ) { if ( is_circular() && aOther.is_circular() ) { @@ -382,10 +382,10 @@ class Curve_set else if ( is_bezier() && aOther.is_bezier() ) { get_bezier_rep()->difference( *aOther.get_bezier_rep() ) ; - } + } } - - void symmetric_difference( Curve_set const& aOther ) + + void symmetric_difference( Curve_set const& aOther ) { if ( is_circular() && aOther.is_circular() ) { @@ -394,31 +394,31 @@ class Curve_set else if ( is_bezier() && aOther.is_bezier() ) { get_bezier_rep()->symmetric_difference( *aOther.get_bezier_rep() ) ; - } + } } - + Rep_base const& rep() const { return *mRep ; } Rep_base& rep() { return *mRep ; } - - bool is_circular() const { return mRep->type() == CIRCULAR_TYPE ; } - bool is_bezier () const { return mRep->type() == BEZIER_TYPE ; } - + + bool is_circular() const { return mRep->type() == CIRCULAR_TYPE ; } + bool is_bezier () const { return mRep->type() == BEZIER_TYPE ; } + Circular_rep const* get_circular_rep() const { return dynamic_cast( boost::get_pointer(mRep) ); } Circular_rep * get_circular_rep() { return dynamic_cast( boost::get_pointer(mRep) ); } Bezier_rep const* get_bezier_rep () const { return dynamic_cast( boost::get_pointer(mRep) ); } Bezier_rep * get_bezier_rep () { return dynamic_cast( boost::get_pointer(mRep) ); } - + Circular_polygon_set const& circular() const { return get_circular_rep()->set(); } Circular_polygon_set & circular() { return get_circular_rep()->set(); } Bezier_polygon_set const& bezier () const { return get_bezier_rep ()->set(); } Bezier_polygon_set & bezier () { return get_bezier_rep ()->set(); } - + private: QPen mPen ; QBrush mBrush ; boost::shared_ptr mRep ; - + } ; typedef std::vector Curve_set_container ; @@ -432,8 +432,8 @@ class MainWindow : public Ui::Boolean_operations_2 { Q_OBJECT - -private: + +private: QGraphicsScene mScene; bool mCircular_active ; @@ -441,29 +441,29 @@ class MainWindow : Curve_set_container mCurve_sets ; Circular_region_source_container mBlue_circular_sources ; Circular_region_source_container mRed_circular_sources ; - Bezier_region_source_container mBlue_bezier_sources ; - Bezier_region_source_container mRed_bezier_sources ; + Bezier_region_source_container mBlue_bezier_sources ; + Bezier_region_source_container mRed_bezier_sources ; CGAL::Qt::GraphicsViewBezierPolygonInput* mBezierInput ; CGAL::Qt::GraphicsViewCircularPolygonInput* mCircularInput ; //CGAL::Qt::GraphicsViewGpsCircleSegmentInput* mCircularInput ; //CGAL::Qt::GraphicsViewGpsCircleInput* mCircleInput ; - + public: MainWindow(); private: - + void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); void zoomToFit(); - + protected slots: - + void open( QString filename ) ; public slots: - + void processInput(CGAL::Object o); void on_actionNew_triggered() ; void on_actionOpenLinear_triggered() ; @@ -481,7 +481,7 @@ public slots: void on_actionBlueComplement_triggered(); void on_actionRedComplement_triggered(); void on_actionAllBlue_triggered(); - void on_actionAllRed_triggered(); + void on_actionAllRed_triggered(); void on_actionDeleteBlue_triggered(); void on_actionDeleteRed_triggered(); void on_actionRecenter_triggered(); @@ -489,25 +489,25 @@ public slots: void on_actionInsertBezier_toggled (bool aChecked); void on_actionInsertCircular_toggled(bool aChecked); void on_actionInsertCircle_toggled (bool aChecked); - + void on_checkboxShowBlue_toggled (bool aChecked) { ToogleView(BLUE_GROUP ,aChecked); } void on_checkboxShowRed_toggled (bool aChecked) { ToogleView(RED_GROUP ,aChecked); } void on_checkboxShowResult_toggled (bool aChecked) { ToogleView(RESULT_GROUP,aChecked); } - + void on_radioMakeBlueActive_toggled(bool aChecked) { mBlue_active = aChecked ; } void on_radioMakeRedActive_toggled (bool aChecked) { mBlue_active = !aChecked ; } - + signals: void changed(); - + private: - + void modelChanged() { emit(changed()); } - + bool ask_user_yesno( const char* aTitle, const char* aQuestion ) { return QMessageBox::warning(this @@ -517,18 +517,18 @@ public slots: ,"&No" ,QString::null , 1 - , 1 + , 1 ) == 0 ; } - + Curve_set& set( int aGroup ) { return mCurve_sets[aGroup] ; } - + Curve_set& blue_set () { return set(BLUE_GROUP) ; } Curve_set& red_set () { return set(RED_GROUP) ; } Curve_set& result_set() { return set(RESULT_GROUP); } int active_group() const { return mBlue_active ? BLUE_GROUP : RED_GROUP ; } - + Curve_set& active_set() { return set(active_group()) ; } Circular_region_source_container const& blue_circular_sources() const { return mBlue_circular_sources ; } @@ -549,30 +549,30 @@ public slots: Circular_region_source_container const& active_circular_sources() const { return mBlue_active ? mBlue_circular_sources : mRed_circular_sources ; } Circular_region_source_container & active_circular_sources() { return mBlue_active ? mBlue_circular_sources : mRed_circular_sources ; } - void SetViewBlue ( bool aChecked ) { checkboxShowBlue ->setChecked(aChecked); } - void SetViewRed ( bool aChecked ) { checkboxShowRed ->setChecked(aChecked); } - void SetViewResult( bool aChecked ) { checkboxShowResult->setChecked(aChecked); } + void SetViewBlue ( bool aChecked ) { checkboxShowBlue ->setChecked(aChecked); } + void SetViewRed ( bool aChecked ) { checkboxShowRed ->setChecked(aChecked); } + void SetViewResult( bool aChecked ) { checkboxShowResult->setChecked(aChecked); } void ToogleView( int aGROUP, bool aChecked ); - + void link_GI ( CGAL::Qt::GraphicsItem* aGI ) { QObject::connect(this, SIGNAL(changed()), aGI, SLOT(modelChanged())); mScene.addItem( aGI ); } - + void unlink_GI ( CGAL::Qt::GraphicsItem* aGI ) { mScene.removeItem( aGI ); QObject::disconnect(this, SIGNAL(changed()), aGI, SLOT(modelChanged())); } - + void switch_set_type( Curve_set& aSet, int aType ); - + void switch_sets_type( int aType ); - + bool ensure_circular_mode(); - + bool ensure_bezier_mode(); }; @@ -584,7 +584,7 @@ MainWindow::MainWindow() { CGAL::set_error_handler (error_handler); CGAL::set_warning_handler(error_handler); - + setupUi(this); setAcceptDrops(true); @@ -592,10 +592,10 @@ MainWindow::MainWindow() mCurve_sets.push_back( Curve_set(CIRCULAR_TYPE, sPens[BLUE_GROUP] , sBrushes[BLUE_GROUP] ) ) ; mCurve_sets.push_back( Curve_set(CIRCULAR_TYPE, sPens[RED_GROUP] , sBrushes[RED_GROUP] ) ) ; mCurve_sets.push_back( Curve_set(CIRCULAR_TYPE, sPens[RESULT_GROUP], sBrushes[RESULT_GROUP]) ) ; - + for( Curve_set_iterator si = mCurve_sets.begin(); si != mCurve_sets.end() ; ++ si ) link_GI(si->gi()) ; - + // // Setup the mScene and the view // @@ -606,7 +606,7 @@ MainWindow::MainWindow() // Turn the vertical axis upside down this->graphicsView->scale(1, -1); - + // The navigation adds zooming and translation functionality to the // QGraphicsView this->addNavigation(this->graphicsView); @@ -617,48 +617,48 @@ MainWindow::MainWindow() this->addAboutCGAL(); this->addRecentFiles(this->menuFile, this->actionQuit); - + mBezierInput = new CGAL::Qt::GraphicsViewBezierPolygonInput (this, &mScene); mCircularInput = new CGAL::Qt::GraphicsViewCircularPolygonInput(this, &mScene); //mCircleInput = new CGAL::Qt::GraphicsViewCircleInput (this, &mScene); - + QObject::connect(mBezierInput , SIGNAL(generate(CGAL::Object)), this, SLOT(processInput(CGAL::Object))); QObject::connect(mCircularInput, SIGNAL(generate(CGAL::Object)), this, SLOT(processInput(CGAL::Object))); //QObject::connect(mCircleInput , SIGNAL(generate(CGAL::Object)), this, SLOT(processInput(CGAL::Object))); QObject::connect(this->actionQuit, SIGNAL(triggered()), this, SLOT(close())); QObject::connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); - + QObject::connect(radioMakeBlueActive, SIGNAL(toggled(bool)), this, SLOT(on_radioMakeBlueActive_toggled (bool))); QObject::connect(radioMakeRedActive , SIGNAL(toggled(bool)), this, SLOT(on_radioMakeRedActive_toggled(bool))); - + QObject::connect(checkboxShowBlue , SIGNAL(toggled(bool)), this, SLOT(on_checkboxShowBlue_toggled (bool))); QObject::connect(checkboxShowRed , SIGNAL(toggled(bool)), this, SLOT(on_checkboxShowRed_toggled (bool))); QObject::connect(checkboxShowResult , SIGNAL(toggled(bool)), this, SLOT(on_checkboxShowResult_toggled (bool))); - - + + } -void MainWindow::on_actionNew_triggered() +void MainWindow::on_actionNew_triggered() { for( Curve_set_iterator si = mCurve_sets.begin(); si != mCurve_sets.end() ; ++ si ) si->clear(); - + blue_circular_sources().clear(); blue_bezier_sources ().clear(); red_circular_sources ().clear(); red_bezier_sources ().clear(); - + SetViewBlue (true); SetViewRed (true); SetViewResult(true); - + mCircular_active = true ; - + radioMakeBlueActive->setChecked(true); - + modelChanged(); - + } void MainWindow::on_actionRecenter_triggered() @@ -682,14 +682,14 @@ void MainWindow::dropEvent(QDropEvent *event) Circular_polygon linear_2_circ( Linear_polygon const& pgn ) { CGAL::Cartesian_converter convert ; - + Circular_polygon rCP; - + for( Linear_polygon::Edge_const_iterator ei = pgn.edges_begin(); ei != pgn.edges_end(); ++ei ) { if ( ei->source() != ei->target() ) rCP.push_back( Circular_X_monotone_curve( convert(ei->source()), convert(ei->target())) ); - } + } return rCP; } @@ -697,7 +697,7 @@ Circular_polygon linear_2_circ( Linear_polygon const& pgn ) Circular_polygon_with_holes linear_2_circ( Linear_polygon_with_holes const& pwh ) { Circular_polygon_with_holes rCP( linear_2_circ(pwh.outer_boundary()) ) ; - + for( Linear_polygon_with_holes::Hole_const_iterator hi = pwh.holes_begin(); hi != pwh.holes_end(); ++ hi ) rCP.add_hole( linear_2_circ(*hi) ); @@ -707,47 +707,47 @@ Circular_polygon_with_holes linear_2_circ( Linear_polygon_with_holes const& pwh bool read_linear ( QString aFileName, Circular_polygon_set& rSet, Circular_region_source_container& rSources ) { bool rOK = false ; - + std::ifstream in_file (qPrintable(aFileName)); if ( in_file ) { unsigned int n_regions ; in_file >> n_regions; - + for ( unsigned int r = 0 ; r < n_regions ; ++ r ) { unsigned int n_boundaries; in_file >> n_boundaries; - + Circular_polygon outer ; std::vector holes ; - + for ( unsigned int r = 0 ; r < n_boundaries ; ++ r ) { Linear_polygon p ; in_file >> p ; - + if ( r == 0 ) - outer = linear_2_circ(p); + outer = linear_2_circ(p); else holes.push_back( linear_2_circ(p) ); } - + Circular_polygon_with_holes pwh(outer,holes.begin(),holes.end()); rSources.push_back(pwh); - rSet.join(pwh) ; + rSet.join(pwh) ; rOK = true ; } - + } - + return rOK ; } bool read_dxf ( QString aFileName, Circular_polygon_set& rSet, Circular_region_source_container& rSources ) { bool rOK = false ; - + std::ifstream in_file (qPrintable(aFileName)); if ( in_file ) @@ -755,13 +755,13 @@ bool read_dxf ( QString aFileName, Circular_polygon_set& rSet, Circular_region_s CGAL::Dxf_bsop_reader reader; std::vector circ_polygons; std::vector circ_polygons_with_holes; - + reader(in_file ,std::back_inserter(circ_polygons) ,std::back_inserter(circ_polygons_with_holes) ,false ); - + for ( std::vector::iterator pit = circ_polygons.begin() ; pit != circ_polygons.end() ; ++ pit ) circ_polygons_with_holes.push_back( Circular_polygon_with_holes(*pit) ) ; @@ -771,7 +771,7 @@ bool read_dxf ( QString aFileName, Circular_polygon_set& rSet, Circular_region_s rOK = true ; } - + return rOK ; } @@ -781,10 +781,10 @@ Bezier_curve read_bezier_curve ( std::istream& is, bool aDoubleFormat ) unsigned int n; is >> n; - + // Read the control points. std::vector ctrl_pts; - + for ( unsigned int k = 0; k < n; k++) { Bezier_rat_point p ; @@ -793,15 +793,15 @@ Bezier_curve read_bezier_curve ( std::istream& is, bool aDoubleFormat ) double x,y ; is >> x >> y ; Bezier_rational rx(static_cast (1000 * x + 0.5), 1000); - Bezier_rational ry(static_cast (1000 * y + 0.5), 1000); + Bezier_rational ry(static_cast (1000 * y + 0.5), 1000); p = Bezier_rat_point(rx,ry); } else { is >> p ; } - - if ( k == 0 || ctrl_pts[k-1] != p ) + + if ( k == 0 || ctrl_pts[k-1] != p ) { ctrl_pts.push_back(p) ; } @@ -831,7 +831,7 @@ Bezier_curve read_bezier_curve ( std::istream& is, bool aDoubleFormat ) ctrl_pts2.push_back(*next1); ++ curr ; - ++ next1 ; + ++ next1 ; ++ next2 ; } @@ -845,25 +845,25 @@ Bezier_curve read_bezier_curve ( std::istream& is, bool aDoubleFormat ) bool read_bezier ( QString aFileName, Bezier_polygon_set& rSet, Bezier_region_source_container& rSources ) { - + bool rOK = false ; - + std::ifstream in_file (qPrintable(aFileName)); - + if ( in_file ) { try { - + std::string format ; std::getline(in_file,format); - + bool lDoubleFormat = ( format.length() >= 6 && format.substr(0,6) == "DOUBLE") ; - + // Red the number of bezier polygon with holes unsigned int n_regions ; in_file >> n_regions; - + for ( unsigned int r = 0 ; r < n_regions ; ++ r ) { Bezier_polygon_vector bezier_polygons ; @@ -872,81 +872,81 @@ bool read_bezier ( QString aFileName, Bezier_polygon_set& rSet, Bezier_region_so // Read the number of bezier curves. unsigned int n_boundaries; in_file >> n_boundaries; - + for ( unsigned int b = 0 ; b < n_boundaries ; ++ b ) { - Bezier_boundary_source bb_source ; - + Bezier_boundary_source bb_source ; + // Read the number of bezier curves. unsigned int n_curves; in_file >> n_curves; - + // Read the curves one by one, and construct the general polygon these // curve form (the outer boundary and the holes inside it). - + std::list xcvs; - - for ( unsigned int k = 0; k < n_curves; ++ k ) + + for ( unsigned int k = 0; k < n_curves; ++ k ) { // Read the current curve and subdivide it into x-monotone subcurves. - + std::list x_objs; std::list::const_iterator xoit; Bezier_X_monotone_curve xcv; Bezier_traits traits; Bezier_traits::Make_x_monotone_2 make_x_monotone = traits.make_x_monotone_2_object(); - + Bezier_curve b = read_bezier_curve(in_file, lDoubleFormat); if ( b.number_of_control_points() >= 2 ) { bb_source.push_back(b); //TRACE( "region " << r << " boundary " << b << " curve " << k ); - + make_x_monotone (b, std::back_inserter (x_objs)); - - for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) + + for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) { if (CGAL::assign (xcv, *xoit)) { //TRACE( " X montonote: " << xcv.source() << " -> " << xcv.target() << ( xcv.is_directed_right() ? " RIGHT":" LEFT") << ( xcv.is_vertical() ? " VERTICAL" : "")) ; xcvs.push_back (xcv); - } + } } } - } - + } + Bezier_polygon pgn (xcvs.begin(), xcvs.end()); - + CGAL::Orientation orient = pgn.orientation(); //TRACE( " Orientation: " << orient ) ; - + if (( b == 0 && orient == CGAL::CLOCKWISE) || ( b > 0 && orient == CGAL::COUNTERCLOCKWISE)) { //TRACE( "Reversing orientation: " ) ; pgn.reverse_orientation(); } - + br_source.push_back(bb_source); bezier_polygons.push_back (pgn); } - + if ( bezier_polygons.size() > 0 ) { Bezier_polygon_with_holes pwh(bezier_polygons.front()); - + if ( bezier_polygons.size() > 1 ) { for ( Bezier_polygon_vector::const_iterator it = std::next(bezier_polygons.begin()) ; it != bezier_polygons.end() - ; ++ it + ; ++ it ) - pwh.add_hole(*it); + pwh.add_hole(*it); } - + if ( is_valid_polygon_with_holes(pwh, rSet.traits() ) ) { - rSet.join(pwh) ; + rSet.join(pwh) ; rSources.push_back(br_source); } else @@ -954,60 +954,60 @@ bool read_bezier ( QString aFileName, Bezier_polygon_set& rSet, Bezier_region_so show_warning( "Bezier polygon is not valid" ); } } - + rOK = true ; } - + } catch(...) { show_error("Exception ocurred during reading of bezier polygon set."); - } + } } - + return rOK ; } bool save_circular ( QString aFileName, Circular_polygon_set& rSet ) { bool rOK = false ; - + return rOK ; } void save_bezier_polygon( std::ostream& out_file, Bezier_polygon const& aBP ) { typedef std::vector Bezier_rat_point_vector ; - + int cc = aBP.size() ; int lc = cc - 1 ; - + out_file << " " << cc << std::endl ; - + Bezier_rat_point lFirstP, lPrevP ; - + int i = 0 ; - + for ( Bezier_polygon::Curve_const_iterator cit = aBP.curves_begin() ; cit != aBP.curves_end() ; ++ cit, ++ i ) { Bezier_rat_point_vector lQ ; - CGAL::Qt::Bezier_helper::clip(*cit,lQ); - + CGAL::Qt::Bezier_helper::clip(*cit,lQ); + out_file << " " << lQ.size() << std::endl ; - + if ( i == 0 ) lFirstP = lQ.front(); - - if ( i == lc ) + + if ( i == lc ) lQ.back() = lFirstP ; - + for ( Bezier_rat_point_vector::const_iterator pit = lQ.begin() ; pit != lQ.end() ; ++ pit ) { Bezier_rat_point lP = pit == lQ.begin() && i > 0 ? lPrevP : *pit ; - + out_file << " " << CGAL::to_double(lP.x()) << " " << CGAL::to_double(lP.y()) << std::endl ; - + lPrevP = lP ; } } @@ -1016,81 +1016,81 @@ void save_bezier_polygon( std::ostream& out_file, Bezier_polygon const& aBP ) bool save_bezier_result ( QString aFileName, Bezier_polygon_set const& aSet ) { bool rOK = false ; - + std::ofstream out_file( qPrintable(aFileName) ) ; if ( out_file ) { out_file << "DOUBLE" << std::endl ; - + std::vector bpwh_container; - + aSet.polygons_with_holes( std::back_inserter(bpwh_container) ) ; - + out_file << bpwh_container.size() << std::endl ; for( std::vector::const_iterator rit = bpwh_container.begin(); rit != bpwh_container.end() ; ++ rit ) { Bezier_polygon_with_holes bpwh = *rit ; - + out_file << " " << ( 1 + bpwh.number_of_holes() ) << std::endl ; - + save_bezier_polygon( out_file, bpwh.outer_boundary() ) ; - + for ( Bezier_polygon_with_holes::Hole_const_iterator hit = bpwh.holes_begin() ; hit != bpwh.holes_end() ; ++ hit ) save_bezier_polygon(out_file, *hit); - + rOK = true ; } } - + return rOK ; - + } bool save_bezier_sources ( QString aFileName, Bezier_region_source_container const& aSources ) { bool rOK = false ; - + std::ofstream out_file( qPrintable(aFileName) ) ; if ( out_file ) { out_file << std::setprecision(19); - + out_file << "DOUBLE" << std::endl ; - + out_file << aSources.size() << std::endl ; - + for( Bezier_region_source_container::const_iterator rit = aSources.begin(); rit != aSources.end() ; ++ rit ) { Bezier_region_source const& br = *rit ; - + out_file << " " << br.size() << std::endl ; - + for( Bezier_region_source::const_iterator bit = br.begin(); bit != br.end() ; ++ bit ) { Bezier_boundary_source const& bb = *bit ; - + out_file << " " << bb.size() << std::endl ; - + for ( Bezier_boundary_source::const_iterator cit = bb.begin() ; cit != bb.end() ; ++ cit ) { Bezier_curve const& bc = *cit ; out_file << " " << bc.number_of_control_points() << std::endl ; - + for ( Bezier_curve::Control_point_iterator pit = bc.control_points_begin() ; pit != bc.control_points_end() ; ++ pit ) { out_file << " " << CGAL::to_double(pit->x()) << " " << CGAL::to_double(pit->y()) << std::endl ; } } - } + } } - + rOK = true ; } - + return rOK ; - + } void MainWindow::on_actionOpenLinear_triggered() @@ -1111,19 +1111,19 @@ void MainWindow::on_actionSaveBlue_triggered() { if ( mCircular_active ) { - if ( !save_circular(QFileDialog::getSaveFileName(this, tr("Save 'Q' Circular Polygon Set"), "../data", tr("Linear Curve files (*.lps)") ) + if ( !save_circular(QFileDialog::getSaveFileName(this, tr("Save 'Q' Circular Polygon Set"), "../data", tr("Linear Curve files (*.lps)") ) ,active_set().circular() ) ) { show_error("Cannot save circular polygon set."); } - + } else { if ( !save_bezier_sources(QFileDialog::getSaveFileName(this, tr("Save 'Q' Bezier Polygon Set"), "../data", tr("Bezier Curve files (*.bps)") ) - ,blue_bezier_sources() + ,blue_bezier_sources() ) ) { @@ -1137,19 +1137,19 @@ void MainWindow::on_actionSaveRed_triggered() { if ( mCircular_active ) { - if ( !save_circular(QFileDialog::getSaveFileName(this, tr("Save 'P' Circular Polygon Set"), "../data", tr("Linear Curve files (*.lps)") ) + if ( !save_circular(QFileDialog::getSaveFileName(this, tr("Save 'P' Circular Polygon Set"), "../data", tr("Linear Curve files (*.lps)") ) ,red_set().circular() ) ) { show_error("Cannot save circular polygon set."); } - + } else { if ( !save_bezier_sources(QFileDialog::getSaveFileName(this, tr("Save 'P' Bezier Polygon Set"), "../data", tr("Bezier Curve files (*.bps)") ) - ,red_bezier_sources() + ,red_bezier_sources() ) ) { @@ -1164,19 +1164,19 @@ void MainWindow::on_actionSaveResult_triggered() { if ( mCircular_active ) { - if ( !save_circular(QFileDialog::getSaveFileName(this, tr("Save Result Circular Polygon Set"), "../data", tr("Linear Curve files (*.lps)") ) + if ( !save_circular(QFileDialog::getSaveFileName(this, tr("Save Result Circular Polygon Set"), "../data", tr("Linear Curve files (*.lps)") ) ,result_set().circular() ) ) { show_error("Cannot save circular polygon set."); } - + } else { if ( !save_bezier_result(QFileDialog::getSaveFileName(this, tr("Save Result Bezier Polygon Set"), "../data", tr("Bezier Curve files (*.bps)") ) - ,result_set().bezier() + ,result_set().bezier() ) ) { @@ -1189,20 +1189,20 @@ void MainWindow::on_actionSaveResult_triggered() void MainWindow::switch_set_type( Curve_set& aSet, int aType ) { unlink_GI( aSet.gi() ) ; - + aSet.reset_type(aType); - + link_GI( aSet.gi() ) ; - + modelChanged(); } void MainWindow::switch_sets_type( int aType ) { - switch_set_type( blue_set (), aType ) ; - switch_set_type( red_set (), aType ) ; - switch_set_type( result_set(), aType ) ; - + switch_set_type( blue_set (), aType ) ; + switch_set_type( red_set (), aType ) ; + switch_set_type( result_set(), aType ) ; + } bool MainWindow::ensure_circular_mode() @@ -1210,14 +1210,14 @@ bool MainWindow::ensure_circular_mode() if ( ! mCircular_active ) { bool lProceed = blue_set().is_empty() && red_set().is_empty() ; - + if ( ! lProceed ) lProceed = ask_user_yesno("Linear/Circular mode switch" ,"You are about to load a linear or circular poygon, but there are bezier curves already loaded.\n" \ "Both types are not interoperable. In order to proceed, the bezier curves must be removed first.\n" \ "OK to remove and proceed?\n" ) ; - + if ( lProceed ) { switch_sets_type(CIRCULAR_TYPE); @@ -1232,14 +1232,14 @@ bool MainWindow::ensure_bezier_mode() if ( mCircular_active ) { bool lProceed = blue_set().is_empty() && red_set().is_empty() ; - + if ( ! lProceed ) lProceed = ask_user_yesno("Bezier mode switch" ,"You are about to load a Bezier curve, but there are linear and/or circular polygons already loaded.\n" \ "Both types are not interoperable. In order to proceed, the polygons must be removed first.\n" \ "OK to remove and proceed?\n" ) ; - + if ( lProceed ) { switch_sets_type(BEZIER_TYPE); @@ -1254,7 +1254,7 @@ void MainWindow::open( QString fileName ) if(! fileName.isEmpty()) { bool lRead = false ; - + if(fileName.endsWith(".lps")) { if ( ensure_circular_mode() ) @@ -1270,15 +1270,15 @@ void MainWindow::open( QString fileName ) if ( ensure_bezier_mode() ) lRead = read_bezier(fileName,active_set().bezier(), active_bezier_sources() ) ; } - + if ( lRead ) { modelChanged(); zoomToFit(); this->addToRecentFiles(fileName); - + } - } + } } void MainWindow::on_actionInsertBezier_toggled(bool aChecked) @@ -1306,7 +1306,7 @@ void MainWindow::processInput(CGAL::Object o ) { std::pair lBI ; Circular_polygon lCI ; - + if(CGAL::assign(lBI, o)) { if ( ensure_bezier_mode() ) @@ -1314,13 +1314,13 @@ void MainWindow::processInput(CGAL::Object o ) CGAL::Orientation o = lBI.first.orientation(); if ( o == CGAL::CLOCKWISE ) lBI.first.reverse_orientation(); - - active_set().bezier().join( Bezier_polygon_with_holes(lBI.first) ) ; - + + active_set().bezier().join( Bezier_polygon_with_holes(lBI.first) ) ; + Bezier_region_source br ; br.push_back (lBI.second); - + active_bezier_sources().push_back(br); - + } } else if ( CGAL::assign(lCI, o) ) @@ -1330,119 +1330,119 @@ void MainWindow::processInput(CGAL::Object o ) CGAL::Orientation o = lCI.orientation(); if ( o == CGAL::CLOCKWISE ) lCI.reverse_orientation(); - + Circular_polygon_with_holes lCPWH(lCI); - active_set().circular().join(lCPWH) ; - + active_set().circular().join(lCPWH) ; + active_circular_sources().push_back(lCPWH); } } - modelChanged(); + modelChanged(); } -void MainWindow::on_actionIntersection_triggered() +void MainWindow::on_actionIntersection_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !blue_set().is_empty() && !red_set().is_empty() ) { result_set().assign( red_set() ) ; result_set().intersect(blue_set()); lDone = true ; } - + this->setCursor(old); - + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } -void MainWindow::on_actionUnion_triggered() +void MainWindow::on_actionUnion_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !blue_set().is_empty() && !red_set().is_empty() ) { result_set().assign( red_set() ) ; result_set().join(blue_set()); lDone = true ; } - + this->setCursor(old); - + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } -void MainWindow::on_actionBlueMinusRed_triggered() +void MainWindow::on_actionBlueMinusRed_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !blue_set().is_empty() && !red_set().is_empty() ) { result_set().assign( blue_set() ) ; result_set().difference(red_set()); lDone = true ; } - + this->setCursor(old); - + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } -void MainWindow::on_actionRedMinusBlue_triggered() +void MainWindow::on_actionRedMinusBlue_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !blue_set().is_empty() && !red_set().is_empty() ) { result_set().assign( red_set() ) ; result_set().difference(blue_set()); lDone = true ; } - + this->setCursor(old); - + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } -void MainWindow::on_actionSymmDiff_triggered() +void MainWindow::on_actionSymmDiff_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !blue_set().is_empty() && !red_set().is_empty() ) { result_set().assign( red_set() ) ; @@ -1451,12 +1451,12 @@ void MainWindow::on_actionSymmDiff_triggered() } this->setCursor(old); - - + + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } @@ -1468,23 +1468,23 @@ void MainWindow::on_actionMinkowskiSum_triggered() void MainWindow::on_actionBlueComplement_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !blue_set().is_empty() ) { result_set().assign( blue_set() ) ; result_set().complement(); lDone = true ; } - + this->setCursor(old); - + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } @@ -1492,23 +1492,23 @@ void MainWindow::on_actionBlueComplement_triggered() void MainWindow::on_actionRedComplement_triggered() { bool lDone = false ; - + QCursor old = this->cursor(); this->setCursor(Qt::WaitCursor); - + if ( !red_set().is_empty() ) { result_set().assign( red_set() ) ; result_set().complement(); lDone = true ; } - + this->setCursor(old); - + if ( lDone ) { //SetViewBlue(false); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } @@ -1516,22 +1516,22 @@ void MainWindow::on_actionRedComplement_triggered() void MainWindow::on_actionAllBlue_triggered() { bool lDone = false ; - + bool lProceed = result_set().is_empty() ? ask_user_yesno("Store result", "Result is empty, all polygons will be deleted\n continue anyway?\n") : true ; - - if ( lProceed ) + + if ( lProceed ) { blue_set().assign( result_set() ) ; result_set().clear(); radioMakeRedActive->setChecked(true); lDone = true ; } - + if ( lDone ) { //SetViewBlue(true); SetViewRed(false); SetViewResult(true); - + modelChanged(); } } @@ -1539,22 +1539,22 @@ void MainWindow::on_actionAllBlue_triggered() void MainWindow::on_actionAllRed_triggered() { bool lDone = false ; - + bool lProceed = result_set().is_empty() ? ask_user_yesno("Store result", "Result is empty, all polygons will be deleted\n continue anyway?\n") : true ; - - if ( lProceed ) + + if ( lProceed ) { red_set().assign( result_set() ) ; result_set().clear(); radioMakeBlueActive->setChecked(true); lDone = true ; } - + if ( lDone ) { //SetViewBlue(false); SetViewRed(true); SetViewResult(true); - + modelChanged(); } } @@ -1563,9 +1563,9 @@ void MainWindow::on_actionDeleteBlue_triggered() blue_set ().clear(); blue_circular_sources().clear(); blue_bezier_sources ().clear(); - + //SetViewBlue(true);SetViewRed(true); SetViewResult(true); - + modelChanged(); } @@ -1574,9 +1574,9 @@ void MainWindow::on_actionDeleteRed_triggered() red_set ().clear(); red_circular_sources().clear(); red_bezier_sources ().clear(); - + //SetViewBlue(true); SetViewRed(true); SetViewResult(true); - + modelChanged(); } @@ -1592,23 +1592,23 @@ void MainWindow::ToogleView( int aGROUP, bool aChecked ) void MainWindow::zoomToFit() { boost::optional lTotalRect ; - + for ( Curve_set_const_iterator si = mCurve_sets.begin() ; si != mCurve_sets.end() ; ++ si ) { - if ( !si->is_empty() ) + if ( !si->is_empty() ) { QRectF lRect = si->bounding_rect(); if ( lTotalRect ) lTotalRect = *lTotalRect | lRect ; - else lTotalRect = lRect ; + else lTotalRect = lRect ; } } - + if ( lTotalRect ) { this->graphicsView->setSceneRect(*lTotalRect); - this->graphicsView->fitInView(*lTotalRect, Qt::KeepAspectRatio); - } + this->graphicsView->fitInView(*lTotalRect, Qt::KeepAspectRatio); + } } #include "boolean_operations_2.moc" @@ -1624,7 +1624,7 @@ int main(int argc, char **argv) // Import resources from libCGALQt5. CGAL_QT_INIT_RESOURCES; - + MainWindow mainWindow; mainWindow.show(); return app.exec(); diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BezierCurves.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BezierCurves.h index 8d3f2bbda136..f5b84dd1e1fd 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BezierCurves.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BezierCurves.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -27,7 +27,7 @@ namespace Qt { struct Bezier_helper { template static OPoint cvtp2 ( IPoint const& p ) { return OPoint( to_double(p.x()), to_double(p.y()) ) ; } - + template static Point_2< Simple_cartesian > refine_bezier_point ( Bezier_point const& aP, double aError = 1e-2 ) { @@ -37,9 +37,9 @@ struct Bezier_helper NT min_x, min_y, max_x, max_y ; NT const error(aError); - + bool lCanRefine = true ; - + do { aP.get_bbox (min_x, min_y, max_x, max_y); @@ -49,26 +49,26 @@ struct Bezier_helper lCanRefine = aP.refine(); } while ( lCanRefine ) ; - + NT const two(2.0); - + double x = to_double( ( min_x + max_x ) / two ) ; double y = to_double( ( min_y + max_y ) / two ) ; return Point_2< Simple_cartesian >(x,y); - } + } template static typename Bezier_point::Bez_point_bound::NT get_endpoint_parameter( Bezier_point const& aP, Bezier_curve const& aCurve, unsigned int aXID ) { typedef typename Bezier_point::Originator_iterator Originator_iterator ; - + Originator_iterator lOrg = aP.get_originator(aCurve, aXID); typedef typename Bezier_point::Bez_point_bound::NT NT ; - + refine_bezier_point(aP); - + return ( lOrg->point_bound().t_min + lOrg->point_bound().t_max ) / NT(2.0); } @@ -76,13 +76,13 @@ struct Bezier_helper static void clip_impl ( Ctrl_points& rQ, FT aS, FT aT) { FT const zero(0.0); - FT const one (1.0); - + FT const one (1.0); + if ( aS >= zero || aT <= one ) { int nc = rQ.size() ; int ncc = nc - 1 ; - + FT lAlfa = aS ; FT lBeta = (aT-aS) / ( one - aS ) ; @@ -90,7 +90,7 @@ struct Bezier_helper { for ( int j = 0 ; j < ncc ; ++ j ) rQ[j] = rQ[j] + lAlfa * ( rQ[j+1] - rQ[j] ) ; - + for ( int j = nc - i ; j <= ncc ; ++ j ) rQ[j] = rQ[j-1] + lBeta * ( rQ[j] - rQ[j-1] ) ; } @@ -104,26 +104,26 @@ struct Bezier_helper typedef typename Bezier_X_monotone_curve::Curve_2 Bezier_curve ; typedef typename Bezier_X_monotone_curve::Bounding_traits::NT BoundNT ; typedef typename Bezier_X_monotone_curve::Rat_kernel::Point_2 Rat_point_2 ; - + Bezier_curve const& lBC = aXMCurve.supporting_curve(); - + BoundNT lS = get_endpoint_parameter(aXMCurve.source(), lBC, aXMCurve.xid() ); BoundNT lT = get_endpoint_parameter(aXMCurve.target(), lBC, aXMCurve.xid() ); - + bool lFwd = lS <= lT ; - + BoundNT lMin = lFwd ? lS : BoundNT(1.0) - lS ; BoundNT lMax = lFwd ? lT : BoundNT(1.0) - lT ; - + std::copy( lBC.control_points_begin(), lBC.control_points_end(), std::back_inserter(rQ) ) ; if ( !lFwd ) std::reverse(rQ.begin(), rQ.end()); - - clip_impl(rQ, lMin, lMax ); + + clip_impl(rQ, lMin, lMax ); } - template + template static void recursive_subdivision( Control_point_in_iterator aBeginCtrlPts , Control_point_in_iterator aEndCtrlPts , NT aMin @@ -139,33 +139,33 @@ struct Bezier_helper Control_point lMinP = point_on_Bezier_curve_2(aBeginCtrlPts, aEndCtrlPts, aMin); Control_point lMidP = point_on_Bezier_curve_2(aBeginCtrlPts, aEndCtrlPts, aMid); Control_point lMaxP = point_on_Bezier_curve_2(aBeginCtrlPts, aEndCtrlPts, aMax); - - NT lB = squared_distance(lMinP, lMaxP); - NT lH = squared_distance(lMidP, typename Kernel_traits::Kernel::Line_2(lMinP, lMaxP)); - - if ( lH > lB * aFlatness ) + + NT lB = squared_distance(lMinP, lMaxP); + NT lH = squared_distance(lMidP, typename Kernel_traits::Kernel::Line_2(lMinP, lMaxP)); + + if ( lH > lB * aFlatness ) { recursive_subdivision(aBeginCtrlPts, aEndCtrlPts, aMin, (aMin+aMid)/NT(2.0), aMid, aOut, aFlatness); - + *aOut ++ = cvtp2(lMidP) ; - + recursive_subdivision(aBeginCtrlPts, aEndCtrlPts, aMid, (aMid+aMax)/NT(2.0), aMax, aOut, aFlatness); } else { *aOut ++ = cvtp2(lMaxP) ; } - + } template static void sample_curve( Bezier_curve const& aCurve, NT aSourceT, NT aTargetT, Output_iterator aOut, NT aFlatness ) { bool lFwd = aSourceT < aTargetT ; - + NT lMinT = lFwd ? aSourceT : NT(1.0) - aSourceT ; NT lMaxT = lFwd ? aTargetT : NT(1.0) - aTargetT ; - + recursive_subdivision( aCurve.control_points_begin(), aCurve.control_points_end(), lMinT, ( lMinT + lMaxT ) / NT(2.0) , lMaxT, aOut, aFlatness ) ; } @@ -174,7 +174,7 @@ struct Bezier_helper static void sample_curve( Bezier_curve const& aCurve, Output_iterator aOut, NT aFlatness ) { sample_curve(aCurve, NT(0.0), NT(1.0), aOut, aFlatness); } template - static void sample_X_monotone_curve( Bezier_X_monotone_curve const& aXMCurve, bool aFwd, Output_iterator aOut, NT aFlatness ) + static void sample_X_monotone_curve( Bezier_X_monotone_curve const& aXMCurve, bool aFwd, Output_iterator aOut, NT aFlatness ) { typedef typename value_type_traits::type Output_point ; @@ -187,18 +187,18 @@ struct Bezier_helper NT lFromT = get_endpoint_parameter(aFwd ? aXMCurve.source() : aXMCurve.target(), aXMCurve.supporting_curve(), aXMCurve.xid() ) ; NT lToT = get_endpoint_parameter(aFwd ? aXMCurve.target() : aXMCurve.source(), aXMCurve.supporting_curve(), aXMCurve.xid() ) ; - - sample_curve(aXMCurve.supporting_curve(), lFromT, lToT, aOut, aFlatness ); + + sample_curve(aXMCurve.supporting_curve(), lFromT, lToT, aOut, aFlatness ); *aOut ++ = refine_bezier_point(aXMCurve.target()); } - + } ; struct Bezier_bbox { template - Bbox_2 operator()( Bezier_curve const& aBC ) const + Bbox_2 operator()( Bezier_curve const& aBC ) const { return CGAL::bbox_2(aBC.control_points_begin(), aBC.control_points_end()); } @@ -207,7 +207,7 @@ struct Bezier_bbox struct Bezier_X_monotone_bbox { template - Bbox_2 operator()( Bezier_X_monotone_curve const& aBXMC ) const + Bbox_2 operator()( Bezier_X_monotone_curve const& aBXMC ) const { typedef typename Bezier_X_monotone_curve::Rat_kernel::Point_2 Rat_point_2 ; std::vector lQ ; @@ -219,58 +219,58 @@ struct Bezier_X_monotone_bbox struct Draw_bezier_curve { template - void operator()( Bezier_curve const& aBC, Path& aPath, int aIdx ) const + void operator()( Bezier_curve const& aBC, Path& aPath, int aIdx ) const { typedef typename Bezier_curve::Bounding_traits::NT BoundNT ; typedef typename Bezier_curve::Rat_kernel::Point_2 Rat_point_2 ; - + typedef std::vector Rat_point_vector ; - + typedef Simple_cartesian Linear_kernel ; - + typedef Qt::Converter Converter ; - + typedef Point_2 Linear_point ; - + typedef std::vector Linear_point_vector ; - + if ( aBC.number_of_control_points() == 2 ) { if ( aIdx == 0 ) aPath.moveTo( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; - else aPath.lineTo( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; - + else aPath.lineTo( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; + aPath.lineTo( Bezier_helper::cvtp2(aBC.control_point(1)) ) ; } else if ( aBC.number_of_control_points() == 3 ) { if ( aIdx == 0 ) aPath.moveTo ( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; - else aPath.lineTo ( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; - - aPath.quadTo( Bezier_helper::cvtp2(aBC.control_point(1)), Bezier_helper::cvtp2(aBC.control_point(2)) ) ; + else aPath.lineTo ( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; + + aPath.quadTo( Bezier_helper::cvtp2(aBC.control_point(1)), Bezier_helper::cvtp2(aBC.control_point(2)) ) ; } else if ( aBC.number_of_control_points() == 4 ) { if ( aIdx == 0 ) aPath.moveTo ( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; - else aPath.lineTo ( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; - - aPath.cubicTo( Bezier_helper::cvtp2(aBC.control_point(1)), Bezier_helper::cvtp2(aBC.control_point(2)), Bezier_helper::cvtp2(aBC.control_point(3)) ) ; + else aPath.lineTo ( Bezier_helper::cvtp2(aBC.control_point(0)) ) ; + + aPath.cubicTo( Bezier_helper::cvtp2(aBC.control_point(1)), Bezier_helper::cvtp2(aBC.control_point(2)), Bezier_helper::cvtp2(aBC.control_point(3)) ) ; } else { Linear_point_vector lSample ; - + Bezier_helper::sample_curve(aBC,std::back_inserter(lSample), BoundNT(1e-4) ); - + for( typename Linear_point_vector::const_iterator it = lSample.begin() ; it != lSample.end() ; ++ it ) { QPointF lP = Bezier_helper::cvtp2(*it) ; - - if ( aIdx == 0 && it == lSample.begin() ) + + if ( aIdx == 0 && it == lSample.begin() ) aPath.moveTo(lP) ; - else aPath.lineTo(lP) ; + else aPath.lineTo(lP) ; } } } @@ -281,64 +281,64 @@ struct Draw_bezier_curve struct Draw_bezier_X_monotone_curve { template - void operator()( Bezier_X_monotone_curve const& aBXMC, Path& aPath, int aIdx ) const + void operator()( Bezier_X_monotone_curve const& aBXMC, Path& aPath, int aIdx ) const { typedef typename Bezier_X_monotone_curve::Curve_2 Bezier_curve ; typedef typename Bezier_X_monotone_curve::Bounding_traits::NT BoundNT ; typedef typename Bezier_X_monotone_curve::Rat_kernel::Point_2 Rat_point_2 ; - + typedef std::vector Rat_point_vector ; typedef Simple_cartesian Linear_kernel ; - + typedef Qt::Converter Converter ; - + typedef Point_2 Linear_point ; typedef std::vector Linear_point_vector ; - + Rat_point_vector lQ ; - + Bezier_helper::clip(aBXMC,lQ); - + if ( lQ.size() == 2 ) { if ( aIdx == 0 ) aPath.moveTo( Bezier_helper::cvtp2(lQ[0]) ) ; - else aPath.lineTo( Bezier_helper::cvtp2(lQ[0]) ) ; - + else aPath.lineTo( Bezier_helper::cvtp2(lQ[0]) ) ; + aPath.lineTo( Bezier_helper::cvtp2(lQ[1]) ) ; } else if ( lQ.size() == 3 ) { if ( aIdx == 0 ) aPath.moveTo ( Bezier_helper::cvtp2(lQ[0]) ) ; - else aPath.lineTo ( Bezier_helper::cvtp2(lQ[0]) ) ; - - aPath.quadTo( Bezier_helper::cvtp2(lQ[1]), Bezier_helper::cvtp2(lQ[2]) ) ; + else aPath.lineTo ( Bezier_helper::cvtp2(lQ[0]) ) ; + + aPath.quadTo( Bezier_helper::cvtp2(lQ[1]), Bezier_helper::cvtp2(lQ[2]) ) ; } else if ( lQ.size() == 4 ) { if ( aIdx == 0 ) aPath.moveTo ( Bezier_helper::cvtp2(lQ[0]) ) ; - else aPath.lineTo ( Bezier_helper::cvtp2(lQ[0]) ) ; - - aPath.cubicTo( Bezier_helper::cvtp2(lQ[1]), Bezier_helper::cvtp2(lQ[2]), Bezier_helper::cvtp2(lQ[3]) ) ; + else aPath.lineTo ( Bezier_helper::cvtp2(lQ[0]) ) ; + + aPath.cubicTo( Bezier_helper::cvtp2(lQ[1]), Bezier_helper::cvtp2(lQ[2]), Bezier_helper::cvtp2(lQ[3]) ) ; } else { - + Linear_point_vector lSample ; - + Bezier_helper::sample_X_monotone_curve(aBXMC,true,std::back_inserter(lSample), BoundNT(1e-4) ); - + for( typename Linear_point_vector::const_iterator it = lSample.begin() ; it != lSample.end() ; ++ it ) { QPointF lP = Bezier_helper::cvtp2(*it) ; - - if ( aIdx == 0 && it == lSample.begin() ) + + if ( aIdx == 0 && it == lSample.begin() ) aPath.moveTo(lP) ; - else aPath.lineTo(lP) ; + else aPath.lineTo(lP) ; } } } @@ -349,29 +349,29 @@ struct Draw_bezier_X_monotone_curve struct Draw_bezier_X_monotone_curve { template - void operator()( Bezier_X_monotone_curve const& aBXMC, Path& aPath, int aIdx ) const + void operator()( Bezier_X_monotone_curve const& aBXMC, Path& aPath, int aIdx ) const { typedef Simple_cartesian Linear_kernel ; - + typedef Qt::Converter Converter ; - + typedef Point_2 Linear_point ; typedef std::vector Linear_point_vector ; - + Converter convert ; - + Linear_point_vector lSample ; - + Bezier_helper::sample_X_monotone_curve(aBXMC,true,std::back_inserter(lSample) ); - + for( typename Linear_point_vector::const_iterator it = lSample.begin() ; it != lSample.end() ; ++ it ) { QPointF lP = Bezier_helper::cvtp2(*it) ; - - if ( aIdx == 0 && it == lSample.begin() ) + + if ( aIdx == 0 && it == lSample.begin() ) aPath.moveTo(lP) ; - else aPath.lineTo(lP) ; + else aPath.lineTo(lP) ; } } } ; @@ -382,7 +382,7 @@ template class Bezier_boundary_pieces_graphics_item : public Boundary_pieces_graphics_item { typedef Boundary_pieces_graphics_item Base ; - + public : Bezier_boundary_pieces_graphics_item( Bezier_boundary_pieces* aPieces ) : Base(aPieces) {} @@ -392,7 +392,7 @@ template class Bezier_boundary_graphics_item : public Piecewise_boundary_graphics_item { typedef Piecewise_boundary_graphics_item Base ; - + public : Bezier_boundary_graphics_item( Bezier_boundary* aBoundary ) : Base(aBoundary) {} @@ -403,10 +403,10 @@ class Bezier_region_graphics_item : public Piecewise_region_graphics_item Base ; - + public: - Bezier_region_graphics_item(Bezier_region* aRegion ) : Base(aRegion) {} + Bezier_region_graphics_item(Bezier_region* aRegion ) : Base(aRegion) {} } ; template @@ -414,7 +414,7 @@ class Bezier_set_graphics_item : public Piecewise_set_graphics_item Base ; - + public: Bezier_set_graphics_item(Bezier_set* aSet) : Base(aSet) {} diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BoundaryPiecesGraphicsItem.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BoundaryPiecesGraphicsItem.h index 663f203925cb..594ea0e3c6ff 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BoundaryPiecesGraphicsItem.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/BoundaryPiecesGraphicsItem.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -28,7 +28,7 @@ class Boundary_pieces_graphics_item : public Piecewise_graphics_item_base typedef Boundary_pieces_ Boundary_pieces ; typedef Draw_piece_ Draw_piece ; typedef Piece_bbox_ Piece_bbox ; - + typedef typename Boundary_pieces::const_iterator Piece_const_iterator ; public: @@ -41,38 +41,38 @@ class Boundary_pieces_graphics_item : public Piecewise_graphics_item_base mBoundary (aBoundary) ,mPieceDrawer(aPieceDrawer) ,mPieceBBox (aPieceBBox) - {} + {} public: virtual bool isModelEmpty() const { return !mBoundary || mBoundary->size() == 0 ; } - + protected: - + virtual void update_bbox( Bbox_builder& aBboxBuilder) { - if ( mBoundary ) + if ( mBoundary ) { for( Piece_const_iterator pit = mBoundary->begin(); pit != mBoundary->end(); ++ pit ) aBboxBuilder.add(mPieceBBox(*pit)); - } - } + } + } - virtual void draw_model ( QPainterPath& aPath ) + virtual void draw_model ( QPainterPath& aPath ) { if ( mBoundary ) { int c = 0 ; for( Piece_const_iterator pit = mBoundary->begin(); pit != mBoundary->end(); ++ pit, ++c ) mPieceDrawer(*pit,aPath,c); - } + } } protected: Boundary_pieces* mBoundary; Draw_piece mPieceDrawer ; - Piece_bbox mPieceBBox ; + Piece_bbox mPieceBBox ; }; diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/CircularPolygons.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/CircularPolygons.h index b13460778a4e..296c1ec8fcc3 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/CircularPolygons.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/CircularPolygons.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -22,7 +22,7 @@ namespace Qt { struct Circular_X_monotone_bbox { template - CGAL::Bbox_2 operator()( X_monotone_circle_segment_2 const& aC ) const + CGAL::Bbox_2 operator()( X_monotone_circle_segment_2 const& aC ) const { return aC.bbox(); } @@ -31,11 +31,11 @@ struct Circular_X_monotone_bbox struct Circular_bbox { template - CGAL::Bbox_2 operator()( Circle_segment_2 const& aC ) const + CGAL::Bbox_2 operator()( Circle_segment_2 const& aC ) const { double x_min = to_double(aC.source().x()); - double x_max = to_double(aC.target().x()); - double y_min = to_double(aC.source().y()); + double x_max = to_double(aC.target().x()); + double y_min = to_double(aC.source().y()); double y_max = to_double(aC.target().y()); if(x_min > x_max) { @@ -54,7 +54,7 @@ struct Circular_bbox return circ.bbox(); } - + return Bbox_2(x_min, y_min, x_max, y_max); } } ; @@ -62,16 +62,16 @@ struct Circular_bbox struct Draw_circular_X_monotone_curve { template - void operator()( X_monotone_circle_segment_2 const& curve, Path& aPath, int aIdx ) const + void operator()( X_monotone_circle_segment_2 const& curve, Path& aPath, int aIdx ) const { typedef Simple_cartesian Linear_kernel ; - + typedef Point_2 Linear_point ; - + typedef Qt::Converter Converter ; - + Converter convert ; - + if ( curve.is_circular() ) { typename X_monotone_circle_segment_2::Circle_2 const& circ = curve.supporting_circle(); @@ -95,7 +95,7 @@ struct Draw_circular_X_monotone_curve double tdy = ty - cy ; double tdx = tx - cx ; - double asource = std::atan2(sdy, sdx ); + double asource = std::atan2(sdy, sdx ); double atarget = std::atan2(tdy, tdx ); if( asource < 0.0) @@ -107,7 +107,7 @@ struct Draw_circular_X_monotone_curve if ( atarget < asource ) atarget += 2 * CGAL_PI; - double aspan = atarget - asource ; + double aspan = atarget - asource ; const double to_deg = 180.0/CGAL_PI; @@ -116,7 +116,7 @@ struct Draw_circular_X_monotone_curve if ( lO == CLOCKWISE ) aspan = 2.0 * CGAL_PI - aspan ; - if ( aIdx == 0 ) + if ( aIdx == 0 ) aPath.moveTo(sx,sy) ; else aPath.lineTo(sx,sy) ; @@ -131,18 +131,18 @@ struct Draw_circular_X_monotone_curve // We use the fact that an X-monotone arc can never span an angle greater than PI. if ( daspan < 270 ) { - aPath.arcTo(bbox , dasource, daspan ); + aPath.arcTo(bbox , dasource, daspan ); } else { - if ( aIdx == 0 ) + if ( aIdx == 0 ) aPath.moveTo(sx,sy) ; aPath.lineTo(sx,sy) ; } } else { - if ( aIdx == 0 ) + if ( aIdx == 0 ) aPath.moveTo(sx,sy) ; aPath.lineTo(sx,sy) ; } @@ -151,8 +151,8 @@ struct Draw_circular_X_monotone_curve { Linear_point lS( CGAL::to_double(curve.source().x()), CGAL::to_double(curve.source().y()) ) ; Linear_point lT( CGAL::to_double(curve.target().x()), CGAL::to_double(curve.target().y()) ) ; - - if ( aIdx == 0 ) + + if ( aIdx == 0 ) aPath.moveTo( convert( lS ) ) ; else aPath.lineTo( convert( lS ) ) ; @@ -165,16 +165,16 @@ struct Draw_circular_X_monotone_curve struct Draw_circular_curve { template - void operator()( Circle_segment_2 const& curve, Path& aPath, int aIdx ) const + void operator()( Circle_segment_2 const& curve, Path& aPath, int aIdx ) const { typedef Simple_cartesian Linear_kernel ; - + typedef Point_2 Linear_point ; - + typedef Qt::Converter Converter ; - + Converter convert ; - + if ( curve.is_circular() ) { typename Circle_segment_2::Circle_2 const& circ = curve.supporting_circle(); @@ -198,7 +198,7 @@ struct Draw_circular_curve double tdy = ty - cy ; double tdx = tx - cx ; - double asource = std::atan2(sdy, sdx ); + double asource = std::atan2(sdy, sdx ); double atarget = std::atan2(tdy, tdx ); if( asource < 0.0) @@ -210,7 +210,7 @@ struct Draw_circular_curve if ( atarget < asource ) atarget += 2 * CGAL_PI; - double aspan = atarget - asource ; + double aspan = atarget - asource ; const double to_deg = 180.0/CGAL_PI; @@ -218,8 +218,8 @@ struct Draw_circular_curve if ( lO == CLOCKWISE ) aspan = 2.0 * CGAL_PI - aspan ; - - if ( aIdx == 0 ) + + if ( aIdx == 0 ) aPath.moveTo(sx,sy) ; else aPath.lineTo(sx,sy) ; @@ -229,15 +229,15 @@ struct Draw_circular_curve double daspan = aspan * to_deg * ( lO == COUNTERCLOCKWISE ? -1.0 : +1.0) ; - aPath.arcTo(bbox , dasource, daspan ); + aPath.arcTo(bbox , dasource, daspan ); } } else { Linear_point lS( CGAL::to_double(curve.source().x()), CGAL::to_double(curve.source().y()) ) ; Linear_point lT( CGAL::to_double(curve.target().x()), CGAL::to_double(curve.target().y()) ) ; - - if ( aIdx == 0 ) + + if ( aIdx == 0 ) aPath.moveTo( convert( lS ) ) ; else aPath.lineTo( convert( lS ) ) ; @@ -250,17 +250,17 @@ template class Circular_boundary_pieces_graphics_item : public Boundary_pieces_graphics_item { typedef Boundary_pieces_graphics_item Base ; - + public : Circular_boundary_pieces_graphics_item( Circular_boundary_pieces* aPieces ) : Base(aPieces) {} } ; - + template class Circular_boundary_graphics_item : public Piecewise_boundary_graphics_item { typedef Piecewise_boundary_graphics_item Base ; - + public : Circular_boundary_graphics_item( Circular_boundary* aBoundary ) : Base(aBoundary) {} @@ -271,10 +271,10 @@ class Circular_region_graphics_item : public Piecewise_region_graphics_item Base ; - + public: - Circular_region_graphics_item(Circular_region* aRegion ) : Base(aRegion) {} + Circular_region_graphics_item(Circular_region* aRegion ) : Base(aRegion) {} } ; template @@ -282,7 +282,7 @@ class Circular_set_graphics_item : public Piecewise_set_graphics_item Base ; - + public: Circular_set_graphics_item(Circular_set* aSet) : Base(aSet) {} diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GpsCircleSegmentGraphicsItem.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GpsCircleSegmentGraphicsItem.h index 8e4e79e05d52..9c5341f76ff0 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GpsCircleSegmentGraphicsItem.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GpsCircleSegmentGraphicsItem.h @@ -33,16 +33,16 @@ class GpsCircleSegmentGraphicsItem : public GraphicsItem typedef Qt::Converter< Simple_cartesian > Converter ; public: - + GpsCircleSegmentGraphicsItem(); void modelChanged(); public: QRectF boundingRect() const; - + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - + const QPen& verticesPen() const { @@ -63,7 +63,7 @@ class GpsCircleSegmentGraphicsItem : public GraphicsItem { edges_pen = pen; } - + void setCircleSegment(const Circle_segment_2& cs); Circle_segment_2 circleSegment() const @@ -83,7 +83,7 @@ class GpsCircleSegmentGraphicsItem : public GraphicsItem template -void +void GpsCircleSegmentGraphicsItem::setCircleSegment(const Circle_segment_2& cs) { cs_ = cs; @@ -99,15 +99,15 @@ GpsCircleSegmentGraphicsItem::GpsCircleSegmentGraphicsItem() } template -QRectF +QRectF GpsCircleSegmentGraphicsItem::boundingRect() const { return bounding_rect; } template -void -GpsCircleSegmentGraphicsItem::paint(QPainter *painter, +void +GpsCircleSegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget * widget) { @@ -135,14 +135,14 @@ GpsCircleSegmentGraphicsItem::paint(QPainter *painter, x0 = sx ; y0 = sy ; x1 = tx ; - y1 = ty ; + y1 = ty ; } else { x0 = tx ; y0 = ty ; x1 = sx ; - y1 = sy ; + y1 = sy ; } double rad = std::sqrt(CGAL::to_double(cs_.supporting_circle().squared_radius())); @@ -171,15 +171,15 @@ GpsCircleSegmentGraphicsItem::paint(QPainter *painter, } - + } template -void +void GpsCircleSegmentGraphicsItem::updateBoundingBox() { Converter convert; - + prepareGeometryChange(); if(cs_.is_circular()) @@ -189,10 +189,10 @@ GpsCircleSegmentGraphicsItem::updateBoundingBox() else { double x_min = to_double(cs_.source().x()); - double y_min = to_double(cs_.source().y()); - double x_max = to_double(cs_.target().x()); + double y_min = to_double(cs_.source().y()); + double x_max = to_double(cs_.target().x()); double y_max = to_double(cs_.target().y()); - + if(x_min > x_max) { std::swap(x_min, x_max); @@ -201,14 +201,14 @@ GpsCircleSegmentGraphicsItem::updateBoundingBox() if(y_min > y_max) std::swap(y_min, y_max); - + bounding_rect = QRectF(x_min,y_min,x_max,y_max) ; } } template -void +void GpsCircleSegmentGraphicsItem::modelChanged() { updateBoundingBox(); diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewBezierPolygonInput.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewBezierPolygonInput.h index a85d0bf840b8..e71987a2cb28 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewBezierPolygonInput.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewBezierPolygonInput.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola // @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -36,19 +36,19 @@ namespace Qt { public: typedef Traits_ Traits ; - + typedef CGAL::Gps_traits_2 Bezier_gps_traits; - + typedef typename Traits::Curve_2 Bezier_curve; typedef typename Traits::X_monotone_curve_2 Bezier_X_monotone_curve; typedef typename Bezier_gps_traits::General_polygon_2 Bezier_polygon; typedef typename Traits::Rat_kernel::Vector_2 Vector ; typedef typename Traits::Rat_kernel::Point_2 Point ; - + typedef std::vector Bezier_curve_vector ; - + typedef typename Bezier_curve_vector::const_iterator const_bezier_curve_iterator ; - + typedef Bezier_boundary_pieces_graphics_item GI ; GraphicsViewBezierPolygonInput(QObject* aParent, QGraphicsScene* aScene) @@ -64,105 +64,105 @@ namespace Qt { mOngoingPieceGI = new GI(&mOngoingPieceCtr) ; mHandle0GI = new QGraphicsLineItem(); mHandle1GI = new QGraphicsLineItem(); - + mOngoingPieceGI->setPen(mOngoingCurvePen); mHandle0GI ->setPen(mHandlePen); mHandle1GI ->setPen(mHandlePen); - + mHandle0GI->setLine(0,0,1,1); mHandle1GI->setLine(0,0,1,1); mHandle0GI->hide(); mHandle1GI->hide(); - + mBezierGI = new GI(&mBezierPolygonPieces) ; - + mBezierGI->setPen(mBezierPolygonPen); - + mScene->addItem(mOngoingPieceGI); mScene->addItem(mHandle0GI); mScene->addItem(mHandle1GI); mScene->addItem(mBezierGI); } - + ~GraphicsViewBezierPolygonInput() { } - + bool eventFilter(QObject *obj, QEvent *aEvent) { bool rHandled = false ; - - if (aEvent->type() == QEvent::GraphicsSceneMousePress) + + if (aEvent->type() == QEvent::GraphicsSceneMousePress) { rHandled = mousePressEvent( static_cast(aEvent) ) ; - } - else if (aEvent->type() == QEvent::GraphicsSceneMouseRelease) + } + else if (aEvent->type() == QEvent::GraphicsSceneMouseRelease) { rHandled = mouseReleaseEvent( static_cast(aEvent) ) ; - } - else if (aEvent->type() == QEvent::GraphicsSceneMouseMove) + } + else if (aEvent->type() == QEvent::GraphicsSceneMouseMove) { rHandled = mouseMoveEvent( static_cast(aEvent) ) ; - } - else if (aEvent->type() == QEvent::KeyPress) + } + else if (aEvent->type() == QEvent::KeyPress) { rHandled = keyPressEvent( static_cast(aEvent) ) ; } - + if ( !rHandled ) rHandled = QObject::eventFilter(obj, aEvent); - - return rHandled ; + + return rHandled ; } - + protected: enum State { Start, PieceOrFirstHandleStarted, PieceOngoing, FirstHandleOngoing, HandleOngoing, PieceEnded, CurveEnded } ; - + Point cvt ( QPointF const& aP ) const { return Point(aP.x(),aP.y()) ; } bool mousePressEvent(QGraphicsSceneMouseEvent *aEvent) { bool rHandled = false ; - + Point lP = cvt(aEvent->scenePos()); if ( aEvent->button() == ::Qt::LeftButton ) { switch (mState) { - case Start: + case Start: mP0 = lP; mState = PieceOrFirstHandleStarted; rHandled = true; break; - case PieceOngoing: + case PieceOngoing: mP1 = lP; mState = HandleOngoing; rHandled = true; break; } } - + return rHandled ; } - + bool mouseMoveEvent(QGraphicsSceneMouseEvent *aEvent) { bool rHandled = false ; - + Point lP = cvt(aEvent->scenePos()); - + switch (mState) { case PieceOrFirstHandleStarted: mState = FirstHandleOngoing; rHandled = true; break; - - case PieceOngoing: + + case PieceOngoing: mP1 = lP; UpdateOngoingPiece(); rHandled = true ; @@ -172,30 +172,30 @@ namespace Qt { UpdateVeryFirstHandle(lP); rHandled = true ; break; - + case HandleOngoing: - + UpdateHandles(lP); UpdateOngoingPiece(); - + rHandled = true ; break; - + case PieceEnded: mState = PieceOngoing; rHandled = true; break; } - + return rHandled ; } - + bool mouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent) { bool rHandled = false ; - + Point lP = cvt(aEvent->scenePos()); - + if ( aEvent->button() == ::Qt::LeftButton ) { switch (mState) @@ -204,7 +204,7 @@ namespace Qt { mState = PieceOngoing; rHandled = true; break; - + case FirstHandleOngoing: UpdateVeryFirstHandle(lP); mPrevH0 = mH1 ; @@ -212,8 +212,8 @@ namespace Qt { mState = PieceOngoing; rHandled = true; break; - - case HandleOngoing: + + case HandleOngoing: UpdateHandles(lP); CommitOngoingPiece(lP); mState = PieceEnded; @@ -225,24 +225,24 @@ namespace Qt { { switch (mState) { - case PieceOngoing: + case PieceOngoing: CloseCurrBundary(); CommitCurrBezierPolygon(); ReStart(); rHandled = true; break; - } + } } - + return rHandled ; } - + bool keyPressEvent(QKeyEvent *aEvent) { bool rHandled = false ; - + if( aEvent->key() == ::Qt::Key_Delete || aEvent->key() == ::Qt::Key_Backspace ) - { + { RemoveLastPiece(); mState = mBezierPolygonPieces.size() > 0 ? PieceEnded : Start ; rHandled = true; @@ -257,18 +257,18 @@ namespace Qt { return rHandled ; } - - + + private: Bezier_curve const* ongoing_piece() const { return mOngoingPieceCtr.size() == 1 ? &mOngoingPieceCtr[0] : NULL ; } - + void ReStart() { mPrevH0 = mH0 = mH1 = boost::optional(); - mState = Start ; + mState = Start ; } - + void Reset() { mBezierPolygonPieces.clear(); @@ -277,7 +277,7 @@ namespace Qt { mOngoingPieceGI->modelChanged(); ReStart(); } - + void RemoveLastPiece() { mBezierPolygonPieces.pop_back(); @@ -290,13 +290,13 @@ namespace Qt { UpdateOngoingPiece(); } mPrevH0 = mH0 = mH1 = boost::optional(); - } + } void HideHandles() { mHandle0GI->hide(); mHandle1GI->hide(); - } + } Bezier_curve CreatePiece() { @@ -305,7 +305,7 @@ namespace Qt { Point lControlPoints[4] = { mP0 , *mPrevH0 , *mH1 - , mP1 + , mP1 } ; return Bezier_curve( lControlPoints, lControlPoints + 4 ) ; } @@ -313,7 +313,7 @@ namespace Qt { { Point lControlPoints[3] = { mP0 , *mPrevH0 - , mP1 + , mP1 } ; return Bezier_curve( lControlPoints, lControlPoints + 3 ) ; } @@ -321,30 +321,30 @@ namespace Qt { { Point lControlPoints[3] = { mP0 , *mH1 - , mP1 + , mP1 } ; return Bezier_curve( lControlPoints, lControlPoints + 3 ) ; } else { Point lControlPoints[2] = { mP0 - , mP1 + , mP1 } ; return Bezier_curve( lControlPoints, lControlPoints + 2 ) ; } } - + void UpdateOngoingPiece() { if ( mOngoingPieceCtr.size() > 0 ) mOngoingPieceCtr.clear(); - mOngoingPieceCtr.push_back(CreatePiece()); + mOngoingPieceCtr.push_back(CreatePiece()); mOngoingPieceGI->modelChanged(); - } - + } + void CommitOngoingPiece( Point const& aP ) { - if ( ongoing_piece() ) + if ( ongoing_piece() ) { mBezierPolygonPieces.push_back( *ongoing_piece() ) ; mBezierGI->modelChanged(); @@ -355,7 +355,7 @@ namespace Qt { mPrevH0 = mH0 ; mH0 = mH1 = boost::optional(); } - } + } void UpdateVeryFirstHandle(Point const& aP) { @@ -364,7 +364,7 @@ namespace Qt { mH1 = aP ; mHandle1GI->setLine( to_double(mP0.x()), to_double(mP0.y()), to_double(mH1->x()), to_double(mH1->y())); mHandle1GI->show(); - + mH0 = boost::optional(); mHandle0GI->hide(); } @@ -381,7 +381,7 @@ namespace Qt { { mH0 = aP ; mH1 = mP1 - (aP - mP1); - + mHandle0GI->setLine( to_double(mP1.x()), to_double(mP1.y()), to_double(mH0->x()), to_double(mH0->y())); mHandle1GI->setLine( to_double(mP1.x()), to_double(mP1.y()), to_double(mH1->x()), to_double(mH1->y())); mHandle0GI->show(); @@ -393,90 +393,90 @@ namespace Qt { mH0 = mH1 = boost::optional(); } } - + void CloseCurrBundary() { if ( mBezierPolygonPieces.size() > 0 && ongoing_piece()!= NULL ) { std::vector lControlPoints(ongoing_piece()->control_points_begin(),ongoing_piece()->control_points_end()); - + lControlPoints.back() = mBezierPolygonPieces.front().control_point(0); - + mBezierPolygonPieces.push_back( Bezier_curve( lControlPoints.begin(), lControlPoints.end() ) ) ; - + mBezierGI->modelChanged() ; } } - + void CommitCurrBezierPolygon() { GenerateBezierPolygon(); mOngoingPieceCtr.clear(); mOngoingPieceGI->modelChanged(); - + mBezierPolygonPieces.clear(); mBezierGI->modelChanged() ; - + mPrevH0 = mH0 = mH1 = boost::optional(); - + HideHandles(); } - - void GenerateBezierPolygon() + + void GenerateBezierPolygon() { Traits traits ; typename Traits::Make_x_monotone_2 make_x_monotone = traits.make_x_monotone_2_object(); - + std::vector xcvs; for ( const_bezier_curve_iterator it = mBezierPolygonPieces.begin() ; it != mBezierPolygonPieces.end() ; ++ it ) - { + { std::vector x_objs; std::vector::const_iterator xoit; - + make_x_monotone ( *it, std::back_inserter (x_objs)); - - for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) + + for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) { Bezier_X_monotone_curve xcv; if (CGAL::assign (xcv, *xoit)) xcvs.push_back (xcv); - } + } } - + if ( xcvs.size() > 0 ) { Bezier_polygon bp(xcvs.begin(), xcvs.end()); emit(generate(CGAL::make_object( std::make_pair(bp,mBezierPolygonPieces)))); - } + } } - + private: - + QGraphicsScene* mScene ; - GI* mBezierGI ; - GI* mOngoingPieceGI ; - QGraphicsLineItem* mHandle0GI ; - QGraphicsLineItem* mHandle1GI ; + GI* mBezierGI ; + GI* mOngoingPieceGI ; + QGraphicsLineItem* mHandle0GI ; + QGraphicsLineItem* mHandle1GI ; QPen mBezierPolygonPen ; QPen mOngoingCurvePen ; - QPen mHandlePen ; - + QPen mHandlePen ; + Bezier_curve_vector mBezierPolygonPieces ; - Bezier_curve_vector mOngoingPieceCtr ; + Bezier_curve_vector mOngoingPieceCtr ; int mState; - + Point mP0; Point mP1; - + boost::optional mPrevH0; boost::optional mH0; boost::optional mH1; - + }; // end class GraphicsViewBezierPolygonInput } // namespace Qt diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h index 4afa73998ffe..27d73737bbd9 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include @@ -35,9 +35,9 @@ namespace Qt { public: typedef K Kernel ; - + typedef CGAL::Gps_circle_segment_traits_2 Gps_traits; - + typedef typename Gps_traits::Curve_2 Circular_curve; typedef typename Gps_traits::X_monotone_curve_2 Circular_X_monotone_curve; typedef typename Gps_traits::Polygon_2 Circular_polygon; @@ -45,11 +45,11 @@ namespace Qt { typedef typename Kernel::FT FT ; typedef typename Kernel::Vector_2 Vector ; typedef typename Kernel::Point_2 Point ; - + typedef std::vector Circular_curve_vector ; - + typedef typename Circular_curve_vector::const_iterator const_circular_curve_iterator ; - + typedef Circular_boundary_pieces_graphics_item GI ; GraphicsViewCircularPolygonInput(QObject* aParent, QGraphicsScene* aScene) @@ -64,125 +64,125 @@ namespace Qt { { mOngoingPieceGI = new GI(&mOngoingPieceCtr) ; mHandleGI = new QGraphicsLineItem(); - + mOngoingPieceGI->setPen(mOngoingCurvePen); mHandleGI ->setPen(mHandlePen); - + mHandleGI->setLine(0,0,1,1); mHandleGI->hide(); - + mCircularGI = new GI(&mCircularPolygonPieces) ; - + mCircularGI->setPen(mCircularPolygonPen); - + mScene->addItem(mOngoingPieceGI); mScene->addItem(mHandleGI); mScene->addItem(mCircularGI); } - + ~GraphicsViewCircularPolygonInput() { } - + bool eventFilter(QObject *obj, QEvent *aEvent) { bool rHandled = false ; - - if (aEvent->type() == QEvent::GraphicsSceneMousePress) + + if (aEvent->type() == QEvent::GraphicsSceneMousePress) { rHandled = mousePressEvent( static_cast(aEvent) ) ; - } - else if (aEvent->type() == QEvent::GraphicsSceneMouseRelease) + } + else if (aEvent->type() == QEvent::GraphicsSceneMouseRelease) { rHandled = mouseReleaseEvent( static_cast(aEvent) ) ; - } - else if (aEvent->type() == QEvent::GraphicsSceneMouseMove) + } + else if (aEvent->type() == QEvent::GraphicsSceneMouseMove) { rHandled = mouseMoveEvent( static_cast(aEvent) ) ; - } - else if (aEvent->type() == QEvent::KeyPress) + } + else if (aEvent->type() == QEvent::KeyPress) { rHandled = keyPressEvent( static_cast(aEvent) ) ; } - + if ( !rHandled ) rHandled = QObject::eventFilter(obj, aEvent); - - return rHandled ; + + return rHandled ; } - + protected: enum State { Start, PieceStarted, PieceOngoing, HandleOngoing, PieceEnded, CurveEnded } ; - + Point cvt ( QPointF const& aP ) const { return Point(aP.x(),aP.y()) ; } bool mousePressEvent(QGraphicsSceneMouseEvent *aEvent) { bool rHandled = false ; - + Point lP = cvt(aEvent->scenePos()); - + if ( aEvent->button() == ::Qt::LeftButton ) { switch (mState) { - case Start: + case Start: mP0 = lP; mState = PieceStarted; rHandled = true; break; - case PieceOngoing: + case PieceOngoing: mP1 = lP; mState = HandleOngoing; rHandled = true; break; } } - + return rHandled ; } - + bool mouseMoveEvent(QGraphicsSceneMouseEvent *aEvent) { bool rHandled = false ; - + Point lP = cvt(aEvent->scenePos()); - + switch (mState) { - case PieceOngoing: + case PieceOngoing: mP1 = lP; UpdateOngoingPiece(); rHandled = true ; break; - + case HandleOngoing: - + UpdateHandle(lP); UpdateOngoingPiece(); - + rHandled = true ; break; - + case PieceEnded: mState = PieceOngoing; rHandled = true; break; } - + return rHandled ; } - + bool mouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent) { bool rHandled = false ; - + Point lP = cvt(aEvent->scenePos()); - + if ( aEvent->button() == ::Qt::LeftButton ) { switch (mState) @@ -191,8 +191,8 @@ namespace Qt { mState = PieceOngoing; rHandled = true; break; - - case HandleOngoing: + + case HandleOngoing: HideHandle(); CommitOngoingPiece(lP); mState = PieceEnded; @@ -204,23 +204,23 @@ namespace Qt { { switch (mState) { - case PieceOngoing: + case PieceOngoing: CommitCurrCircularPolygon(); ReStart(); rHandled = true; break; - } + } } - + return rHandled ; } - + bool keyPressEvent(QKeyEvent *aEvent) { bool rHandled = false ; - + if( aEvent->key() == ::Qt::Key_Delete || aEvent->key() == ::Qt::Key_Backspace ) - { + { RemoveLastPiece(); mState = mCircularPolygonPieces.size() > 0 ? PieceEnded : Start ; rHandled = true; @@ -235,8 +235,8 @@ namespace Qt { return rHandled ; } - - + + private: Circular_curve const* ongoing_piece() const { return mOngoingPieceCtr.size() == 1 ? &mOngoingPieceCtr[0] : NULL ; } @@ -244,9 +244,9 @@ namespace Qt { void ReStart() { mH = boost::optional(); - mState = Start ; + mState = Start ; } - + void Reset() { mCircularPolygonPieces.clear(); @@ -255,11 +255,11 @@ namespace Qt { mOngoingPieceGI->modelChanged(); ReStart(); } - + void HideHandle() { mHandleGI->hide(); - } + } Circular_curve CreatePiece() { @@ -268,15 +268,15 @@ namespace Qt { Vector lD = *mH - mP1 ; Vector lU = lD * 1.5 ; Point lH = mP1 - lU ; - return Circular_curve(mP0,lH,mP1); + return Circular_curve(mP0,lH,mP1); } else { - return Circular_curve(mP0,mP1); + return Circular_curve(mP0,mP1); } } - - + + void RemoveLastPiece() { mCircularPolygonPieces.pop_back(); @@ -289,19 +289,19 @@ namespace Qt { UpdateOngoingPiece(); } mH = boost::optional(); - } - + } + void UpdateOngoingPiece() { if ( mOngoingPieceCtr.size() > 0 ) mOngoingPieceCtr.clear(); - mOngoingPieceCtr.push_back(CreatePiece()); + mOngoingPieceCtr.push_back(CreatePiece()); mOngoingPieceGI->modelChanged(); - } - + } + void CommitOngoingPiece( Point const& aP ) { - if ( ongoing_piece() ) + if ( ongoing_piece() ) { mCircularPolygonPieces.push_back( *ongoing_piece() ) ; mCircularGI->modelChanged(); @@ -311,14 +311,14 @@ namespace Qt { mP1 = aP ; mH = boost::optional(); } - } + } void UpdateHandle(Point const& aP) { if ( squared_distance(mP1,aP) >= 4 ) { mH = aP ; - + mHandleGI->setLine( to_double(mP1.x()), to_double(mP1.y()), to_double(mH->x()), to_double(mH->y())); mHandleGI->show(); } @@ -328,48 +328,48 @@ namespace Qt { mH = boost::optional(); } } - - Point cvt ( typename Circular_curve::Point_2 const& aP ) { return Point( to_double(aP.x()), to_double(aP.y()) ) ; } - + + Point cvt ( typename Circular_curve::Point_2 const& aP ) { return Point( to_double(aP.x()), to_double(aP.y()) ) ; } + void CommitCurrCircularPolygon() { GenerateCircularPolygon(); mOngoingPieceCtr.clear(); mOngoingPieceGI->modelChanged(); - + mCircularPolygonPieces.clear(); mCircularGI->modelChanged() ; - + mH = boost::optional(); - + HideHandle(); } - - void GenerateCircularPolygon() + + void GenerateCircularPolygon() { if ( mCircularPolygonPieces.size() > 0 ) { Gps_traits traits ; typename Gps_traits::Make_x_monotone_2 make_x_monotone = traits.make_x_monotone_2_object(); - + std::vector xcvs; for ( const_circular_curve_iterator it = mCircularPolygonPieces.begin() ; it != mCircularPolygonPieces.end() ; ++ it ) - { + { std::vector x_objs; std::vector::const_iterator xoit; - + make_x_monotone ( *it, std::back_inserter (x_objs)); - - for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) + + for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) { Circular_X_monotone_curve xcv; if (CGAL::assign (xcv, *xoit)) xcvs.push_back (xcv); - } + } } - + if ( xcvs.size() > 0 ) { Arc_point const& first_point = xcvs.front().source(); @@ -384,31 +384,31 @@ namespace Qt { Circular_polygon cp(xcvs.begin(), xcvs.end()); emit(generate(CGAL::make_object(cp))); - } + } } } - + private: - + QGraphicsScene* mScene ; - GI* mCircularGI ; - GI* mOngoingPieceGI ; - QGraphicsLineItem* mHandleGI ; + GI* mCircularGI ; + GI* mOngoingPieceGI ; + QGraphicsLineItem* mHandleGI ; QPen mCircularPolygonPen ; QPen mOngoingCurvePen ; - QPen mHandlePen ; - + QPen mHandlePen ; + Circular_curve_vector mCircularPolygonPieces ; - Circular_curve_vector mOngoingPieceCtr ; + Circular_curve_vector mOngoingPieceCtr ; int mState; - + Point mP0; Point mP1; - + boost::optional mH; - + }; // end class GraphicsViewCircularPolygonInput } // namespace Qt diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseBoundaryGraphicsItem.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseBoundaryGraphicsItem.h index 40f3e2778b5a..d4731702b0e8 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseBoundaryGraphicsItem.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseBoundaryGraphicsItem.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -25,7 +25,7 @@ class Piecewise_boundary_graphics_item : public Piecewise_graphics_item_base typedef Piecewise_boundary_ Piecewise_boundary ; typedef Draw_piece_ Draw_piece ; typedef Piece_bbox_ Piece_bbox ; - + typedef typename Piecewise_boundary::Curve_const_iterator Curve_piece_const_iterator ; public: @@ -38,33 +38,33 @@ class Piecewise_boundary_graphics_item : public Piecewise_graphics_item_base mBoundary (aBoundary) ,mPieceDrawer(aPieceDrawer) ,mPieceBBox (aPieceBBox) - {} + {} public: virtual bool isModelEmpty() const { return !mBoundary || mBoundary->is_empty() ; } - + protected: - - Piecewise_boundary_graphics_item( Draw_piece const& aPieceDrawer = Draw_piece() + + Piecewise_boundary_graphics_item( Draw_piece const& aPieceDrawer = Draw_piece() , Piece_bbox const& aPieceBBox = Piece_bbox() ) : mBoundary (0) ,mPieceDrawer(aPieceDrawer) ,mPieceBBox (aPieceBBox) - {} - + {} + virtual void update_bbox( Bbox_builder& aBboxBuilder) { - if ( mBoundary ) + if ( mBoundary ) update_boundary_bbox(*mBoundary, aBboxBuilder ) ; - } + } - virtual void draw_model ( QPainterPath& aPath ) + virtual void draw_model ( QPainterPath& aPath ) { if ( mBoundary ) - draw_boundary(*mBoundary,aPath); + draw_boundary(*mBoundary,aPath); } void update_boundary_bbox( Piecewise_boundary const& aBoundary, Bbox_builder& aBboxBuilder ) @@ -72,14 +72,14 @@ class Piecewise_boundary_graphics_item : public Piecewise_graphics_item_base for( Curve_piece_const_iterator pit = aBoundary.curves_begin(); pit != aBoundary.curves_end(); ++ pit ) aBboxBuilder.add(mPieceBBox(*pit)); } - + void draw_boundary( Piecewise_boundary const& aBoundary, QPainterPath& aPath ) ; - + protected: Piecewise_boundary* mBoundary; Draw_piece mPieceDrawer ; - Piece_bbox mPieceBBox ; + Piece_bbox mPieceBBox ; }; template diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseGraphicsItemBase.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseGraphicsItemBase.h index 0cce46681f95..9f6ef7c2e97f 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseGraphicsItemBase.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseGraphicsItemBase.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -34,23 +34,23 @@ class Piecewise_graphics_item_base : public GraphicsItem protected: Piecewise_graphics_item_base() {} - + public: void updateBoundingBox(); - + void modelChanged() { updateBoundingBox(); update(); } - + QRectF boundingRect() const { return mBounding_rect ; } - + void paint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, QWidget* aWidget); - + const QBrush& brush() const { return mBrush; } - + void setBrush(const QBrush& aBrush ) { mBrush = aBrush; } const QPen& pen() const{ return mPen; } @@ -60,23 +60,23 @@ class Piecewise_graphics_item_base : public GraphicsItem protected: typedef Converter< Simple_cartesian > ToQtConverter; - + struct Bbox_builder { - void add ( Bbox_2 const& aBbox ) + void add ( Bbox_2 const& aBbox ) { if ( bbox ) bbox = *bbox + aBbox; else bbox = aBbox; } - + boost::optional bbox ; } ; virtual bool isModelEmpty() const = 0 ; - + virtual void draw_model ( QPainterPath& aPath ) = 0 ; - + virtual void update_bbox( Bbox_builder& aBBoxBuilder ) = 0 ; protected: @@ -92,9 +92,9 @@ void Piecewise_graphics_item_base::paint( QPainter* aPainter, const QStyleOption if ( ! isModelEmpty() ) { QPainterPath lPath ; - + draw_model(lPath); - + aPainter->setPen (mPen ); aPainter->setBrush(mBrush); aPainter->drawPath(lPath); @@ -108,16 +108,16 @@ void Piecewise_graphics_item_base::updateBoundingBox() if ( ! isModelEmpty() ) { prepareGeometryChange(); - + Bbox_builder lBBoxBuilder ; - + update_bbox(lBBoxBuilder); - - if ( lBBoxBuilder.bbox ) + + if ( lBBoxBuilder.bbox ) { ToQtConverter to_Qt ; mBounding_rect = to_Qt(*lBBoxBuilder.bbox); - } + } } } diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseRegionGraphicsItem.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseRegionGraphicsItem.h index 3228364e302e..6bd01337784e 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseRegionGraphicsItem.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseRegionGraphicsItem.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -20,50 +20,50 @@ namespace CGAL { namespace Qt { template -class Piecewise_region_graphics_item : public Piecewise_boundary_graphics_item< typename Piecewise_region_::General_polygon_2, Draw_piece_, Piece_bbox_ > +class Piecewise_region_graphics_item : public Piecewise_boundary_graphics_item< typename Piecewise_region_::General_polygon_2, Draw_piece_, Piece_bbox_ > { typedef Piecewise_boundary_graphics_item< typename Piecewise_region_::General_polygon_2, Draw_piece_, Piece_bbox_> Base ; - + typedef Piecewise_region_ Piecewise_region ; typedef Draw_piece_ Draw_piece ; typedef Piece_bbox_ Piece_bbox ; - + typedef typename Piecewise_region::Hole_const_iterator Hole_const_itertator ; - + public: Piecewise_region_graphics_item( Piecewise_region* aRegion, Draw_piece const& aPieceDrawer = Draw_piece(), Piece_bbox const& aPieceBBox = Piece_bbox() ) : Base(aPieceDrawer, aPieceBBox) ,mRegion(aRegion) - {} + {} public: virtual bool isModelEmpty() const { return !mRegion || mRegion->outer_boundary().size() ; } - + protected: - + Piecewise_region_graphics_item( Draw_piece const& aPieceDrawer = Draw_piece(), Piece_bbox const& aPieceBBox = Piece_bbox() ) : Base(aPieceDrawer, aPieceBBox) - {} - + {} + virtual void update_bbox( Piecewise_graphics_item_base::Bbox_builder& aBboxBuilder) { - if ( mRegion ) + if ( mRegion ) update_region_bbox(*mRegion, aBboxBuilder ) ; - } + } - virtual void draw_model ( QPainterPath& aPath ) + virtual void draw_model ( QPainterPath& aPath ) { if ( mRegion ) - draw_region(*mRegion,aPath); + draw_region(*mRegion,aPath); } void update_region_bbox( Piecewise_region const& aRegion, Piecewise_graphics_item_base::Bbox_builder& aBboxBuilder ) ; void draw_region ( Piecewise_region const& aRegion, QPainterPath& aPath ) ; - + protected: Piecewise_region* mRegion; @@ -73,7 +73,7 @@ template void Piecewise_region_graphics_item::update_region_bbox( Piecewise_region const& aRegion, Piecewise_graphics_item_base::Bbox_builder& aBboxBuilder ) { this->update_boundary_bbox( aRegion.outer_boundary(), aBboxBuilder ) ;//"This" added for qt5 version ! - + for( Hole_const_itertator hit = aRegion.holes_begin(); hit != aRegion.holes_end(); ++ hit ) this->update_boundary_bbox(*hit,aBboxBuilder);//"This" added for qt5 version ! } @@ -82,7 +82,7 @@ template void Piecewise_region_graphics_item::draw_region( Piecewise_region const& aRegion, QPainterPath& aPath ) { this->draw_boundary( aRegion.outer_boundary(), aPath ) ;//This added for qt5 version ! - + for( Hole_const_itertator hit = aRegion.holes_begin(); hit != aRegion.holes_end(); ++ hit ) this->draw_boundary(*hit,aPath);//"This" added for qt5 version ! } diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseSetGraphicsItem.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseSetGraphicsItem.h index df023eba4c8b..0177127ac95c 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseSetGraphicsItem.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/PiecewiseSetGraphicsItem.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Fernando Cacciola @@ -21,67 +21,67 @@ namespace Qt { namespace internal { - template - struct Piecewise_set_traits + template + struct Piecewise_set_traits { typedef typename Piecewise_set::Base base ; - + typedef typename base::Polygon_with_holes_2 Region ; } ; - + template struct Piecewise_set_traits< Polygon_set_2 > { typedef Polygon_set_2 PS ; - + typedef typename PS::Polygon_with_holes_2 Region ; } ; } template -class Piecewise_set_graphics_item : public Piecewise_region_graphics_item< typename internal::Piecewise_set_traits::Region, Draw_piece_, Piece_bbox_ > +class Piecewise_set_graphics_item : public Piecewise_region_graphics_item< typename internal::Piecewise_set_traits::Region, Draw_piece_, Piece_bbox_ > { typedef Piecewise_set_ Piecewise_set ; typedef Draw_piece_ Draw_piece ; typedef Piece_bbox_ Piece_bbox ; - + typedef typename internal::Piecewise_set_traits::Region Region ; - + typedef Piecewise_region_graphics_item Base ; - + typedef std::vector Region_vector ; typedef typename Region_vector::const_iterator Region_const_iterator ; - + public: Piecewise_set_graphics_item( Piecewise_set* aSet, Draw_piece const& aPieceDrawer = Draw_piece(), Piece_bbox const& aPieceBBox = Piece_bbox() ) : Base(aPieceDrawer,aPieceBBox) ,mSet(aSet) - {} + {} public: virtual bool isModelEmpty() const { return !mSet || mSet->is_empty() ; } - + protected: - + virtual void update_bbox( Piecewise_graphics_item_base::Bbox_builder& aBboxBuilder) { - if ( mSet ) + if ( mSet ) update_set_bbox(*mSet, aBboxBuilder ) ; - } + } - virtual void draw_model ( QPainterPath& aPath ) + virtual void draw_model ( QPainterPath& aPath ) { if ( mSet ) - draw_set(*mSet,aPath); + draw_set(*mSet,aPath); } void update_set_bbox( Piecewise_set const& aSet, Piecewise_graphics_item_base::Bbox_builder& aBboxBuilder ) ; void draw_set ( Piecewise_set const& aSet, QPainterPath& aPath ) ; - + protected: Piecewise_set* mSet; @@ -91,9 +91,9 @@ template void Piecewise_set_graphics_item::update_set_bbox( Piecewise_set const& aSet, Piecewise_graphics_item_base::Bbox_builder& aBboxBuilder ) { Region_vector vec ; - + aSet.polygons_with_holes( std::back_inserter(vec) ) ; - + for( Region_const_iterator rit = vec.begin(); rit != vec.end() ; ++ rit ) this->update_region_bbox(*rit,aBboxBuilder);//This added for Qt5 version ! } @@ -102,9 +102,9 @@ template void Piecewise_set_graphics_item::draw_set( Piecewise_set const& aSet, QPainterPath& aPath ) { Region_vector vec ; - + aSet.polygons_with_holes( std::back_inserter(vec) ) ; - + for( Region_const_iterator rit = vec.begin(); rit != vec.end() ; ++ rit ) this->draw_region(*rit,aPath);//This added for Qt5 version ! } diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/typedefs.h b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/typedefs.h index b80da51d7c5b..5d797b40f6ad 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/typedefs.h +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/typedefs.h @@ -66,7 +66,7 @@ struct Bezier_rat_kernel : public CGAL::Cartesian {}; struct Bezier_alg_kernel : public CGAL::Cartesian {}; struct Bezier_traits : public CGAL::Arr_Bezier_curve_traits_2 {}; - + typedef Bezier_rat_kernel::Point_2 Bezier_rat_point; typedef Bezier_traits::Curve_2 Bezier_curve; typedef Bezier_traits::X_monotone_curve_2 Bezier_X_monotone_curve; diff --git a/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp b/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp index d3adafadeb23..608c3ffbfcdd 100644 --- a/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp +++ b/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp @@ -110,7 +110,7 @@ int main( int argc , char ** argv ) { double scale_factor = argc>1 ? atof(argv[1]):1; double sqrt_scale_factor = std::sqrt(scale_factor); - + //testing grid rectangle intersection numLines = 100 * sqrt_scale_factor; numArrays = 2; @@ -213,9 +213,9 @@ int main( int argc , char ** argv ) std::ofstream out("polygons_disjoint.cgal"); std::vector polygons; polygons.reserve(grid_size*grid_size); - + double epsilon = 1./(2* grid_size); - + for (int i=0;i(outer) boundary.
  1. A polygon whose curves are pairwise disjoint in their interior, and whose vertices' degree equals two is defined as a Simple polygon. Such a polygon has a well-defined interior and exterior and is topologically equivalent to a disk. Note that while traversing the edges of the relatively simple polygon illustrated above (B), no curve is crossed over.
  2. A Relatively simple polygon allows vertices with a degree\f$> 2\f$, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal). -Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple. +Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple.
  3. A polygon in our context must be relatively simple and its outer boundary vertices must be ordered in a counterclockwise direction around the interior of the polygon. We extend the notion of a polygon to a point set in \f$ \mathbb{R}^2\f$ @@ -109,7 +109,7 @@ general polygons, where the edges of a general polygon may be general \f$ x\f$-monotone curves, rather than being simple line segments. -\subsection bso_ssecpolygon_validation Conditions for Valid Polygons +\subsection bso_ssecpolygon_validation Conditions for Valid Polygons In our context, a polygon must uphold the following conditions: @@ -119,23 +119,23 @@ In our context, a polygon must uphold the following conditions:
  4. Orientation - the polygon's outer boundary must be counter-clockwise oriented. -\subsection bso_ssecpolygon_with_holes_validation Conditions for Valid Polygons with Holes +\subsection bso_ssecpolygon_with_holes_validation Conditions for Valid Polygons with Holes In our context, a polygon with holes must uphold the following conditions:
    1. Closed Boundary - both the outer boundary and the holes must be closed polygons as defined above. -
    2. Simplicity - the outer boundary must be a relatively simple polygon (as defined above). Every hole must be a simple polygon. -
    3. Orientation - The polygon with holes must have an outer boundary with counter clockwise orientation. Every hole's outer boundary should have clockwise orientation. -
    4. The holes and the outer boundary must be pairwise disjoint,except maybe on vertices. +
    5. Simplicity - the outer boundary must be a relatively simple polygon (as defined above). Every hole must be a simple polygon. +
    6. Orientation - The polygon with holes must have an outer boundary with counter clockwise orientation. Every hole's outer boundary should have clockwise orientation. +
    7. The holes and the outer boundary must be pairwise disjoint,except maybe on vertices.
        -
      • All holes are contained in the outer boundary - holes must be contained inside the outer boundary and must be disjoint from it (except on vertices). +
      • All holes are contained in the outer boundary - holes must be contained inside the outer boundary and must be disjoint from it (except on vertices).
      • Pairwise disjoint holes (on interior) - the polygon's holes must be pairwise disjoint, except for intersection on a joint vertex/vertices.
    -\section bso_secbso_lin Boolean Set-Operations on Linear Polygons +\section bso_secbso_lin Boolean Set-Operations on Linear Polygons The basic library of \cgal includes the `Polygon_2` class-template that represents a linear polygon in the plane. The @@ -179,8 +179,8 @@ following sections. \image html triangles.png \image latex triangles.png -Testing whether two polygons intersect results with a Boolean value, -and does not require any additional data beyond the provision of the +Testing whether two polygons intersect results with a Boolean value, +and does not require any additional data beyond the provision of the two input polygons. The example listed below tests whether the two triangles depicted on the right intersect. It uses, as do the other example programs in this chapter, the auxiliary header file @@ -193,7 +193,7 @@ which is located in the header file `print_utils.h`. \cgalExample{Boolean_set_operations_2/do_intersect.cpp} -\subsection bso_ssecpolygons_with_holes Polygons with Holes +\subsection bso_ssecpolygons_with_holes Polygons with Holes \cgalFigureBegin{figsimple,simple.png} Operations on simple polygons. (a) The union of two polygons, resulting in a point set whose outer boundary is defined by a simple polygon and contains a polygonal hole in its interior. (b) The intersection (darkly shaded) of two polygons (lightly shaded), resulting in two disjoint polygons. (c) The complement (darkly shaded) of a simple polygon (lightly shaded). @@ -201,7 +201,7 @@ Operations on simple polygons. (a) The union of two polygons, resulting in a poi In many cases a binary operation that operates on two simple polygons that have no holes may result in a set of polygons that -contain holes in their interior (see \cgalFigureRef{figsimple} (a)), +contain holes in their interior (see \cgalFigureRef{figsimple} (a)), or a set of disjoint polygons (see \cgalFigureRef{figsimple} (b); a similar set may result from the union, or the symmetric difference, of two disjoint polygons). Moreover, the complement of a simple polygon is an unbounded set @@ -209,7 +209,7 @@ that contains a hole; see \cgalFigureRef{figsimple} (c). Regular sets are closed under regularized Boolean set-operations. These operations accept as input, and may result as output, polygons -with holes. +with holes. A polygon with holes represents a point set that may be bounded or unbounded. In case of a bounded set, its outer boundary is represented as a relatively simple (but not necessarily simple) polygon, whose vertices are oriented in a counterclockwise @@ -236,7 +236,7 @@ Consider, for example, the regular set depicted on the right, which is the result of the union of three small triangles translated appropriately. Alternatively, the same set can be reached by taking the difference between a large triangle and a small -upside-down triangle. In general, there are many ways to arrive at +upside-down triangle. In general, there are many ways to arrive at a particular point set. However, the set of polygons with holes obtained through the application of any sequence of operations is unique. The set depicted on the right is represented as a single @@ -256,7 +256,7 @@ represents its outer boundary through the member function `outer_boundary()`. You can also traverse the holes of \f$ P\f$ through `holes_begin()` and `holes_end()`. The two functions return iterators of the nested type -`Polygon_with_holes_2::Hole_const_iterator` that +`Polygon_with_holes_2::Hole_const_iterator` that defines the valid range of \f$ P\f$'s holes. The value type of this iterator is `Polygon_2`. @@ -269,7 +269,7 @@ template void print_polygon_with_holes(const CGAL::Polygon_with_holes_2 & pwh) { if (! pwh.is_unbounded()) { - std::cout << "{ Outer boundary = "; + std::cout << "{ Outer boundary = "; print_polygon (pwh.outer_boundary()); } else std::cout << "{ Unbounded polygon." << std::endl; @@ -301,7 +301,7 @@ indicating whether \f$ P \cap Q \neq \emptyset\f$. If the two polygons are not disjoint, it assigns the polygon with holes object \f$ R\f$ (which it accepts by reference) with the union of the regularized union operation \f$ P \cup Q\f$. -
  5. The other three functions, namely `intersection(P, Q, oi)`, +
  6. The other three functions, namely `intersection(P, Q, oi)`, `difference(P, Q, oi)` and `symmetric_difference(P, Q, oi)`, all have a similar interface. As the result of these operation may consist of several disconnected components, they all accept an output iterator @@ -309,7 +309,7 @@ of several disconnected components, they all accept an output iterator output polygons to its associated container. -\subsection bso_sssecex_simple_bops Example - Joining and Intersecting Simple Polygons +\subsection bso_sssecex_simple_bops Example - Joining and Intersecting Simple Polygons The following example demonstrates the usage of the free functions `join()` and `intersection()` for computing the union and the @@ -320,10 +320,10 @@ the header file `print_utils.h` under the examples folder. \cgalExample{Boolean_set_operations_2/simple_join_intersect.cpp} -\subsection bso_sssecpwh_bops Operations on Polygons with Holes +\subsection bso_sssecpwh_bops Operations on Polygons with Holes We have demonstrated that free functions that perform boolean set operations on simple polygons may output polygons with holes. In addition to these functions, the Boolean set-operations package provides the following overridden free functions that accept -`General_polygon_with_holes_2` objects as their input - +`General_polygon_with_holes_2` objects as their input - `complement()`, `intersection()`, `join()`, `difference()`, `symmetric_difference()` and `do_intersect()` The prototypes of most functions is the same as of their simpler counterparts that operate @@ -354,7 +354,7 @@ vertical walls). \cgalExample{Boolean_set_operations_2/connect_polygon.cpp} -\subsection bso_ssecmain_component Operating on Polygon Sets +\subsection bso_ssecmain_component Operating on Polygon Sets We argue that the result of a regularized operations on two polygons (or polygons with holes) \f$ P\f$ and \f$ Q\f$ is typically a collection of @@ -364,15 +364,15 @@ operate on the set resulting from computing, for example, \f$ P \setminus Q\f$. A central component in the Boolean set-operations package is the -`Polygon_set_2` class-template. An instance of -this class represents a point set formed by the collection of several -disconnected polygons with holes. It employs the `Arrangement_2` class -to represent this point set in the plane as a planar arrangement; see +`Polygon_set_2` class-template. An instance of +this class represents a point set formed by the collection of several +disconnected polygons with holes. It employs the `Arrangement_2` class +to represent this point set in the plane as a planar arrangement; see Chapter \ref chapterArrangement_on_surface_2 "2D Arrangements". The instantiated `Dcel` type is used to represent the underlying internal arrangement. It must model the concept `GeneralPolygonSetDcel`, and defaults to `Gps_default_dcel`. You can override this default, with a different Dcel class, typically -an extension of the default. Overriding the default is necessary only if +an extension of the default. Overriding the default is necessary only if you intend to obtain the underlying internal arrangement and process it further. An instance \f$ S\f$ of a `Polygon_set_2` class usually represents @@ -384,7 +384,7 @@ In addition, a polygon-set object can be constructed from a single polygon object or from a polygon-with-holes object. Once constructed, it is possible to insert new polygons (or polygons with holes) into the set using the `insert()` method, as long as the inserted -polygons and the existing polygons in the set are disjoint. +polygons and the existing polygons in the set are disjoint. The `Polygon_set_2` class also provides access functions for accessing the polygons with holes it contains, and a few queries. The most important query is `S.oriented_side(q)`, which determined @@ -394,7 +394,7 @@ whether the query point \f$ q\f$ is contained in the interior of the set The `General_polygon_set_2` class defines the predicate `do_intersect()` and the methods `complement()`, `intersection()`, `join()`, `difference()` and `symmetric_difference()` as member -functions. The operands to these functions may be simple polygons +functions. The operands to these functions may be simple polygons (`Polygon_2` object), polygons with holes (`General_polygon_with_holes_2` objects), or polygon sets (`General_polygon_set_2` objects). Thus, each of the function @@ -408,7 +408,7 @@ computes the union of \f$ P\f$ and \f$ Q\f$ and assigned the result to \f$ S\f$, Similarly, `S.complement(P)` sets \f$ S\f$ to be the complement of \f$ P\f$, while `S.complement()` simply negates the set \f$ S\f$. -\subsection bso_sssecsequence A Sequence of Set Operations +\subsection bso_sssecsequence A Sequence of Set Operations The free functions reviewed in Section \ref bso_ssecpolygons_with_holes serve as a wrapper for the polygon-set class, and are only provided for @@ -430,14 +430,14 @@ The next example performs a sequence of three Boolean set-operations. First, it computes the union of two simple polygons depicted in \cgalFigureRef{figsimple} (a). It then computes the complement of the result of the union operation. Finally, it computes the intersection of the result -of the complement operation with a rectangle, confining the final result to +of the complement operation with a rectangle, confining the final result to the area of the rectangle. The resulting set \f$ S\f$ is comprised of two components: a polygon with a hole, and a simple polygon contained in the interior of this hole. \cgalExample{Boolean_set_operations_2/sequence.cpp} -\subsection bso_ssecinsert_ni Inserting Non Intersecting Polygons +\subsection bso_ssecinsert_ni Inserting Non Intersecting Polygons If you want to compute the union of a polygon \f$ P\f$ (\f$ P\f$ may be a simple polygon or a polygon-with-holes object) with a general-polygon set @@ -467,14 +467,14 @@ insertion of a non-disjoint polygon that intersects \f$ R\f$. The `insert()` function is also overloaded, so it can also accept a range of polygons. When a range of polygons are inserted into a -polygon set \f$ S\f$, all the polygons in the range and the polygons represented +polygon set \f$ S\f$, all the polygons in the range and the polygons represented by \f$ S\f$ must be pairwise disjoint in their interiors. -\subsection bso_ssecagg_ops Performing Aggregated Operations +\subsection bso_ssecagg_ops Performing Aggregated Operations There are a few options to compute the union of a set of polygons \f$ P_1, \ldots P_m\f$. You can do it incrementally as follows. At each step -compute the union of \f$ S_{k-1} = \bigcup_{i=1}^{k-1}{P_i}\f$ +compute the union of \f$ S_{k-1} = \bigcup_{i=1}^{k-1}{P_i}\f$ with \f$ P_{k}\f$ and obtain \f$ S_k\f$. Namely, if the polygon set is given as a pair of iterator `[begin, end)`, the following loop computes their union in \f$ S\f$. @@ -486,14 +486,14 @@ while (++iter != end) { S.join (*iter); ++iter; } -\endcode +\endcode A second option is to use a divide-and-conquer approach. You bisect the set of polygons into two sets. Compute the union of each set recursively and obtain the partial results in \f$ S_1\f$ and \f$ S_2\f$, and finally, you compute the union \f$ S_1 \cup S_2\f$. However, the union operation can be done more efficiently for sparse polygons, having a relatively small number of intersections, using a third option that -simultaneously computes the union of all polygons. This is done by +simultaneously computes the union of all polygons. This is done by constructing a planar arrangement of all input polygons, utilizing the sweep-line algorithm, then extracting the result from the arrangement. Similarly, it is also possible to aggregately compute the @@ -503,7 +503,7 @@ Our package provides the free overloaded functions `join()` and `intersection()` that aggregately compute the union and the intersection of a range of input polygons. There is no restriction on the polygons in the range - naturally, they may intersect each other. -The package provides the overloaded free function +The package provides the overloaded free function \ref do_intersect "do_intersect(begin, end)" that determines whether the polygons in the range defined by the two input iterators `[begin, end)` intersect. @@ -516,9 +516,9 @@ follows: \code{.cpp} Polygon_set_2 S; S.join (begin, end); -\endcode +\endcode -\section bso_secbso_gen Boolean Set-Operations on General Polygons +\section bso_secbso_gen Boolean Set-Operations on General Polygons \image html general_polygon.png \image latex general_polygon.png @@ -542,7 +542,7 @@ of this concept must fulfill the following requirements: interior disjoint \f$ x\f$-monotone curves \f$ c_1, \ldots, c_n\f$. The target point of the \f$ k\f$th curve \f$ c_k\f$ and the source point of the next curve in the range (in a cyclic order) must coincide, such that this point -defines the \f$ k\f$th polygon vertex. +defines the \f$ k\f$th polygon vertex.
  7. It is possible to traverse the \f$ x\f$-monotone curves that form the edges of a general polygon. @@ -568,30 +568,30 @@ In Section \ref bso_secbso_lin we introduce the classes respectively. In this section we introduce other models of these two concepts. -The central class-template `General_polygon_set_2` is -used to represent point sets that are comprised of a finite number of -pairwise disjoint general polygons with holes, and provides various +The central class-template `General_polygon_set_2` is +used to represent point sets that are comprised of a finite number of +pairwise disjoint general polygons with holes, and provides various Boolean set-operations on such sets. It is parameterized by a traits -class and a Dcel class. The former defines the type of points used -to represent polygon vertices and the type of \f$ x\f$-monotone curves that -represent the polygon edges. The traits class also provides primitive -geometric operations that operate on objects of these types. -The Dcel class is used to represent the underlying internal -`Arrangement_2` data structure. The instantiated `Dcel` type is -used to represent the underlying internal arrangement. It must model the +class and a Dcel class. The former defines the type of points used +to represent polygon vertices and the type of \f$ x\f$-monotone curves that +represent the polygon edges. The traits class also provides primitive +geometric operations that operate on objects of these types. +The Dcel class is used to represent the underlying internal +`Arrangement_2` data structure. The instantiated `Dcel` type is +used to represent the underlying internal arrangement. It must model the concept `GeneralPolygonSetDcel`, and defaults to `Gps_default_dcel`. You can override this default, with a different Dcel class, typically -an extension of the default. Overriding the default is necessary only if +an extension of the default. Overriding the default is necessary only if you intend to obtain the underlying internal arrangement and process it further. An instantiated -`General_polygon_set_2` class defines the nested types +`General_polygon_set_2` class defines the nested types `General_polygon_set_2::%Polygon_2` and `General_polygon_set_2::%Polygon_with_holes_2`, which model the concepts `GeneralPolygon_2` and `GeneralPolygonWithHoles_2` respectively. -\subsection bso_ssectraits_concepts The Traits-Class Concepts +\subsection bso_ssectraits_concepts The Traits-Class Concepts The traits class used to instantiate the `General_polygon_set_2` class template must model the concept `GeneralPolygonSetTraits_2`, @@ -599,14 +599,14 @@ and is tailored to handle a specific family of curves. The concept `GeneralPolygonSetTraits_2` refines the concept `ArrangementDirectionalXMonotoneTraits_2` specified next. -The concept `ArrangementDirectionalXMonotoneTraits_2` refines the -concept `ArrangementXMonotoneTraits_2` (see +The concept `ArrangementDirectionalXMonotoneTraits_2` refines the +concept `ArrangementXMonotoneTraits_2` (see Section \ref arr_sssecinsert_x_mon in the 2D Arrangements chapter). -Thus, a model of this concept must define the type `X_monotone_curve_2`, -which represents an \f$ x\f$-monotone curve, and the type `Point_2`, +Thus, a model of this concept must define the type `X_monotone_curve_2`, +which represents an \f$ x\f$-monotone curve, and the type `Point_2`, with represents a planar point. Such a point may be an endpoint of an \f$ x\f$-monotone curve or an intersection point between two curves. -It must also provide various geometric predicates and operations +It must also provide various geometric predicates and operations on these types listed by the base concept, such as determining whether a point lies above or below an \f$ x\f$-monotone curve, computing the intersections between two curves, etc. Note that the base concept does @@ -625,20 +625,20 @@ lexicographically. swap its source and target points). -The traits classes `Arr_segment_traits_2`, +The traits classes `Arr_segment_traits_2`, `Arr_non_caching_segment_traits_2`, `Arr_circle_segment_traits_2`, -`Arr_conic_traits_2` and `Arr_rational_function_traits_2`, which are +`Arr_conic_traits_2` and `Arr_rational_function_traits_2`, which are bundled in the `Arrangement_2` package and distributed with \cgal, -are all models of the refined concept +are all models of the refined concept `ArrangementDirectionalXMonotoneTraits_2`.\cgalFootnote{The `Arr_polyline_traits_2` class is not a model of the, `ArrangementDirectionalXMonotoneTraits_2` concept, as the \f$ x\f$-monotone curve it defines is always directed from left to right. Thus, an opposite curve cannot be constructed. However, it is not very useful to construct a polygon whose edges are polylines, as an ordinary polygon with linear edges can represent the same entity.} -Just as with the case of computations using models of the +Just as with the case of computations using models of the `ArrangementXMonotoneTraits_2` concept, operations are robust only when exact arithmetic is used. When inexact arithmetic is used, (nearly) degenerate configurations may result in abnormal termination of the program or even incorrect results. -\subsection bso_sseccirc_seg Operating on Polygons with Circular Arcs +\subsection bso_sseccirc_seg Operating on Polygons with Circular Arcs Two traits classes are distributed with \cgal. The first one is named `Gps_segment_traits_2`, and it is used to perform Boolean @@ -649,7 +649,7 @@ Section \ref bso_ssecmain_component is a specialization of its polygon and polygon with holes types, such that the usage of this traits class is encapsulated in the polygon-set class. -The other predefined traits class is named +The other predefined traits class is named `Gps_circle_segment_traits_2` and is parameterized by a geometric \cgal kernel. By instantiating the `General_polygon_set_2` with this traits class, we obtain the representation of a polygon whose @@ -672,27 +672,27 @@ operator. \cgalExample{Boolean_set_operations_2/circle_segment.cpp} -\subsection bso_ssecgeneral_polygon_concept General Polygon Set Traits Adapter - -The concept `GeneralPolygon_2` and its generic model -`General_polygon_2` facilitate the -production of general-polygon set traits classes. A model of the concept -`GeneralPolygon_2` represents a simple point-set in the plane bounded -by \f$ x\f$-monotone curves. As opposed to the plain `Traits::Polygon_2` type -defined by any traits class, it must define the type -`X_monotone_curve_2`, which represents an \f$ x\f$-monotone curve of the -point-set boundary. It must provide a constructor from a range of such -curves, and a pair of methods, namely `curves_begin()` and -`curves_end()`, that can be used to iterate over the point-set boundary +\subsection bso_ssecgeneral_polygon_concept General Polygon Set Traits Adapter + +The concept `GeneralPolygon_2` and its generic model +`General_polygon_2` facilitate the +production of general-polygon set traits classes. A model of the concept +`GeneralPolygon_2` represents a simple point-set in the plane bounded +by \f$ x\f$-monotone curves. As opposed to the plain `Traits::Polygon_2` type +defined by any traits class, it must define the type +`X_monotone_curve_2`, which represents an \f$ x\f$-monotone curve of the +point-set boundary. It must provide a constructor from a range of such +curves, and a pair of methods, namely `curves_begin()` and +`curves_end()`, that can be used to iterate over the point-set boundary curves. The class-template `General_polygon_2` models the concept `GeneralPolygon_2`. Its sole template parameter must be instantiated with a model of the concept -`ArrangementDirectionalXMonotoneTraits_2` from which it obtains the +`ArrangementDirectionalXMonotoneTraits_2` from which it obtains the `X_monotone_curve_2` type. It uses the geometric operations on this type provided by such a model to maintain a container of -directed curves of type `X_monotone_curve_2`, which represents a +directed curves of type `X_monotone_curve_2`, which represents a boundary of the general polygon. The class-template @@ -704,7 +704,7 @@ concept `ArrangementDirectionalXMonotoneTraits_2`. It can be used for performing set-operations on general polygons. The implementation of the adapter is rather simple, as it is derived from the instantiated template-parameter `ArrXMonotoneTraits_2` -inheriting its necessary types and methods. It further exploits +inheriting its necessary types and methods. It further exploits the methods provided by the instantiated parameter `GeneralPolygon`, which is a model of the concept `GeneralPolygon_2`. By default, the `GeneralPolygon` parameter @@ -757,7 +757,7 @@ the `Gps_traits_2` adapter. \cgalExample{Boolean_set_operations_2/bezier_traits_adapter.cpp} -\subsection bso_ssecaggregated_gen_ops Example - Aggregated Operations +\subsection bso_ssecaggregated_gen_ops Example - Aggregated Operations In Section \ref bso_ssecagg_ops we describe how aggregated union and intersection operations can be applied to a collection of ordinary @@ -779,6 +779,6 @@ line. \cgalExample{Boolean_set_operations_2/set_union.cpp} -*/ +*/ } /* namespace CGAL */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index f22267db5758..7e2f9cfb60aa 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -3,12 +3,12 @@ namespace CGAL { /*! \addtogroup boolean_complement Complement Functions \ingroup PkgBooleanSetOperations2Ref -\anchor ref_bso_complement +\anchor ref_bso_complement The `complement` function is overloaded. Depending on the -type of polygon `pgn` the complement is either a single (general) polygon with -holes, or several (general) poylgons with holes. In the latter case -the `complement function` writes them into an output iterator +type of polygon `pgn` the complement is either a single (general) polygon with +holes, or several (general) poylgons with holes. In the latter case +the `complement function` writes them into an output iterator `oi`. \param pgn The input polygon for the `complement` function. It may be of the type @@ -59,14 +59,14 @@ namespace CGAL { /*! \addtogroup boolean_difference Difference Functions \ingroup PkgBooleanSetOperations2Ref -\anchor ref_bso_difference +\anchor ref_bso_difference -Each one of these functions computes the difference between two given -polygons `p1` and `p2`, and inserts the resulting polygons -with holes into an output container through the output iterator `oi`. -The value type of the `OutputIterator` is either -`Polygon_with_holes_2` or -`General_polygon_with_holes_2`. +Each one of these functions computes the difference between two given +polygons `p1` and `p2`, and inserts the resulting polygons +with holes into an output container through the output iterator `oi`. +The value type of the `OutputIterator` is either +`Polygon_with_holes_2` or +`General_polygon_with_holes_2`. The signature of the function is \code @@ -77,19 +77,19 @@ The signature of the function is The types of the paramters of the `difference()` function are any of the following combinations. -
    - - - - - - - - - - -
    Type1Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    -
    +
    + + + + + + + + + + +
    Type1Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    +
    \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink \sa \link boolean_intersection `CGAL::intersection()` \endlink @@ -182,10 +182,10 @@ namespace CGAL { /*! \addtogroup boolean_do_intersect Intersection Testing Functions \ingroup PkgBooleanSetOperations2Ref -\anchor ref_bso_do_intersect +\anchor ref_bso_do_intersect -Each one of these functions computes if the interior of two given -polygons `p1` and `p2` intersect. +Each one of these functions computes if the interior of two given +polygons `p1` and `p2` intersect. The signature of the function is \code @@ -196,19 +196,19 @@ The signature of the function is The types of the paramters of the `do_intersect()` function are any of the following combinations. -
    - - - - - - - - - - -
    Type1 Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    -
    +
    + + + + + + + + + + +
    Type1 Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    +
    \sa \link boolean_intersection `CGAL::intersection()` \endlink @@ -256,7 +256,7 @@ bool do_intersect(const Polygon_with_holes_2 & p1, template bool do_intersect(const General_polygon_2 & p1, const General_polygon_2 & p2); - + /*! returns `true` if the general polygons `p1` and `p2` intersect in their interior. */ @@ -280,18 +280,18 @@ bool do_intersect(const General_polygon_with_holes_2 & p1, const General_polygon_with_holes_2 & p2); /*! - returns `true`, if the set of general polygons (or general - polygons with holes) in the given range intersect in their interior, - and `false` otherwise. (The value type of the input iterator is - used to distinguish between the two). + returns `true`, if the set of general polygons (or general + polygons with holes) in the given range intersect in their interior, + and `false` otherwise. (The value type of the input iterator is + used to distinguish between the two). */ template bool do_intersect(InputIterator begin, InputIterator end); /*! - returns `true`, if the set of general polygons and general - polygons with holes in the given two ranges respectively intersect in - their interior, and `false` otherwise. + returns `true`, if the set of general polygons and general + polygons with holes in the given two ranges respectively intersect in + their interior, and `false` otherwise. */ template bool do_intersect(InputIterator1 pgn_begin1, @@ -308,12 +308,12 @@ namespace CGAL { \ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_intersection -Each one of these functions computes the intersection of two given -polygons `p1` and `p2`, inserts the resulting polygons with -holes into an output container through a given output iterator -`oi`, and returns the output iterator. The value type of the -`OutputIterator` is either `Polygon_with_holes_2` or -`General_polygon_with_holes_2`. +Each one of these functions computes the intersection of two given +polygons `p1` and `p2`, inserts the resulting polygons with +holes into an output container through a given output iterator +`oi`, and returns the output iterator. The value type of the +`OutputIterator` is either `Polygon_with_holes_2` or +`General_polygon_with_holes_2`. The signature of the function is @@ -327,19 +327,19 @@ The signature of the function is The types of the paramters of the `intersection()` function are any of the following combinations. -
    - - - - - - - - - - -
    Type1 Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    -
    +
    + + + + + + + + + + +
    Type1 Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    +
    \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink @@ -433,23 +433,23 @@ OutputIterator intersection(const General_polygon_with_holes_2 & p1, /*! - computes the intersection of the general polygons (or general polygons with - holes) in the given range. (The value type of the input iterator is - used to distinguish between the two.) The result, represented by a set - of general polygon with holes, is written into the output iterator `oi`. - The output iterator is returned. The value type of the `OutputIterator` is - `Traits::Polygon_with_holes_2`. + computes the intersection of the general polygons (or general polygons with + holes) in the given range. (The value type of the input iterator is + used to distinguish between the two.) The result, represented by a set + of general polygon with holes, is written into the output iterator `oi`. + The output iterator is returned. The value type of the `OutputIterator` is + `Traits::Polygon_with_holes_2`. */ template OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi); /*! - computes the intersection of the general polygons and general polygons - with holes in the given two ranges. The result, represented by a set - of general polygon with holes, is written into the output iterator `oi`. - The output iterator is returned. The value type of the `OutputIterator` is - `Traits::Polygon_with_holes_2`. + computes the intersection of the general polygons and general polygons + with holes in the given two ranges. The result, represented by a set + of general polygon with holes, is written into the output iterator `oi`. + The output iterator is returned. The value type of the `OutputIterator` is + `Traits::Polygon_with_holes_2`. */ template @@ -470,10 +470,10 @@ namespace CGAL { \ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_union -Each one of these functions computes the union of two given polygons -`p1` and `p2`. If the two given polygons overlap, it returns -`true`, and places the resulting polygon in `p`. Otherwise, it -returns `false`. +Each one of these functions computes the union of two given polygons +`p1` and `p2`. If the two given polygons overlap, it returns +`true`, and places the resulting polygon in `p`. Otherwise, it +returns `false`. The signature of the function is @@ -485,19 +485,19 @@ The signature of the function is The types of the paramters of the `join()` function are any of the following combinations. -
    - - - - - - - - - - -
    Type1 Type2
    Polygon_2Polygon_2
    Polygon_2polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    -
    +
    + + + + + + + + + + +
    Type1 Type2
    Polygon_2Polygon_2
    Polygon_2polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    +
    \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink \sa \link boolean_intersection `CGAL::intersection()` \endlink @@ -589,25 +589,25 @@ bool join(const General_polygon_with_holes_2 & p1, /*! - computes the union of the general polygons (or general polygons with - holes) in the given range. (The value type of the input iterator is - used to distinguish between the two.) The result, represented by a set - of general polygon with holes, is written into the output iterator `oi`. - The output iterator is - returned. The value type of the `OutputIterator` is - `Traits::Polygon_with_holes_2`. + computes the union of the general polygons (or general polygons with + holes) in the given range. (The value type of the input iterator is + used to distinguish between the two.) The result, represented by a set + of general polygon with holes, is written into the output iterator `oi`. + The output iterator is + returned. The value type of the `OutputIterator` is + `Traits::Polygon_with_holes_2`. */ template OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi); /*! - computes the union of the general polygons and general polygons - with holes in the given two ranges. The result, represented by a set - of general polygon with holes, is written into the output iterator `oi`. - The output iterator is - returned. The value type of the `OutputIterator` is - `Traits::Polygon_with_holes_2`. + computes the union of the general polygons and general polygons + with holes in the given two ranges. The result, represented by a set + of general polygon with holes, is written into the output iterator `oi`. + The output iterator is + returned. The value type of the `OutputIterator` is + `Traits::Polygon_with_holes_2`. */ template @@ -624,11 +624,11 @@ namespace CGAL { \ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_oriented_side -Each one of these functions returns `ON_POSITIVE_SIDE` if the two -given polygons `p1` and `p2` intersect in their interior, -`ON_NEGATIVE_SIDE` if `p1` and `p2` do not intersect at -all, and `ON_ORIENTED_BOUNDARY` if `p1` and `p2` intersect -only in their boundaries. +Each one of these functions returns `ON_POSITIVE_SIDE` if the two +given polygons `p1` and `p2` intersect in their interior, +`ON_NEGATIVE_SIDE` if `p1` and `p2` do not intersect at +all, and `ON_ORIENTED_BOUNDARY` if `p1` and `p2` intersect +only in their boundaries. The signature of the function is \code @@ -639,19 +639,19 @@ The signature of the function is The types of the paramters of the `oriented_side()` function are any of the following combinations. -
    - - - - - - - - - - -
    Type1Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    -
    +
    + + + + + + + + + + +
    Type1Type2
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    +
    \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink @@ -707,14 +707,14 @@ namespace CGAL { /*! \addtogroup boolean_symmetric_difference Symmetric Difference Functions \ingroup PkgBooleanSetOperations2Ref -\anchor ref_bso_symmetric_difference +\anchor ref_bso_symmetric_difference -Each one of these functions computes the symmetric difference between -two given polygons `p1` and `p2`, and inserts the resulting -polygons with holes into an output container through the output -iterator `oi`. The value type of the `OutputIterator` is either -`Polygon_with_holes_2` or -`General_polygon_with_holes_2`. +Each one of these functions computes the symmetric difference between +two given polygons `p1` and `p2`, and inserts the resulting +polygons with holes into an output container through the output +iterator `oi`. The value type of the `OutputIterator` is either +`Polygon_with_holes_2` or +`General_polygon_with_holes_2`. The signature of the function is \code @@ -725,19 +725,19 @@ The signature of the function is The types of the paramters of the `symmetric_difference()` function are any of the following combinations. -
    - - - - - - - - - - -
    Arg 1 typeArg 2 type
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    -
    +
    + + + + + + + + + + +
    Arg 1 typeArg 2 type
    Polygon_2Polygon_2
    Polygon_2Polygon_with_holes_2
    Polygon_with_holes_2Polygon_2
    Polygon_with_holes_2Polygon_with_holes_2
    General_polygon_2General_polygon_2
    General_polygon_2General_polygon_with_holes_2
    General_polygon_with_holes_2General_polygon_2
    General_polygon_with_holes_2General_polygon_with_holes_2
    +
    \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink @@ -760,20 +760,20 @@ OutputIterator symmetric_difference(const Polygon_2 & p1, template -OutputIterator +OutputIterator symmetric_difference(const Polygon_2 & p1, const Polygon_with_holes_2 & p2, OutputIterator oi); template -OutputIterator +OutputIterator symmetric_difference(const Polygon_with_holes_2 & p1, const Polygon_2 & p2, OutputIterator oi); template -OutputIterator +OutputIterator symmetric_difference(const Polygon_with_holes_2 & p1, const Polygon_with_holes_2 & p2, OutputIterator oi); @@ -786,53 +786,53 @@ OutputIterator symmetric_difference(const General_polygon_2 & p1, template -OutputIterator +OutputIterator symmetric_difference(const General_polygon_with_holes_2 > & p1, const General_polygon_2 & p2, OutputIterator oi); template -OutputIterator +OutputIterator symmetric_difference(const General_polygon_2 & p1, const General_polygon_with_holes_2 > & p2, OutputIterator oi); template -OutputIterator +OutputIterator symmetric_difference(const General_polygon_with_holes_2 & p1, const General_polygon_with_holes_2 & p2, OutputIterator oi); /*! - computes the symmetric difference of the general polygons (or general - polygons with holes) in the given range. A point is contained in the - symmetric difference, if and only if it is contained in an odd number of - input polygons. (The value type of the input iterator is used to - distinguish between the two.) The result, represented by a set - of general polygon with holes, is inserted into an output container - through a given output iterator `oi`. The output iterator is - returned. The value type of the `OutputIterator` is - `Traits::Polygon_with_holes_2`. + computes the symmetric difference of the general polygons (or general + polygons with holes) in the given range. A point is contained in the + symmetric difference, if and only if it is contained in an odd number of + input polygons. (The value type of the input iterator is used to + distinguish between the two.) The result, represented by a set + of general polygon with holes, is inserted into an output container + through a given output iterator `oi`. The output iterator is + returned. The value type of the `OutputIterator` is + `Traits::Polygon_with_holes_2`. */ template OutputIterator symmetric_difference(InputIterator begin, InputIterator end, OutputIterator oi); /*! - computes the symmetric difference of the general polygons and general polygons - with holes in the given two ranges. A point is contained in the - symmetric difference, if and only if it is contained in an odd number of - input polygons. The result, represented by a set of general polygon with - holes, is inserted into an output container through a given output - iterator `oi`. The output iterator is returned. The value type of - the `OutputIterator` is `Traits::Polygon_with_holes_2`. + computes the symmetric difference of the general polygons and general polygons + with holes in the given two ranges. A point is contained in the + symmetric difference, if and only if it is contained in an odd number of + input polygons. The result, represented by a set of general polygon with + holes, is inserted into an output container through a given output + iterator `oi`. The output iterator is returned. The value type of + the `OutputIterator` is `Traits::Polygon_with_holes_2`. */ template -OutputIterator symmetric_difference(InputIterator1 pgn_begin1, +OutputIterator symmetric_difference(InputIterator1 pgn_begin1, InputIterator1 pgn_end1, - InputIterator2 pgn_begin2, + InputIterator2 pgn_begin2, InputIterator2 pgn_end2, OutputIterator oi); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h index 9f1b175d3831..46724fe52b03 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h @@ -4,21 +4,21 @@ namespace CGAL { /*! \ingroup PkgBooleanSetOperations2Ref -The class `General_polygon_2` models the concept `GeneralPolygon_2`. -It represents a simple general-polygon. It is parameterized with the type -`ArrTraits` that models the concept -`ArrangementDirectionalXMonotoneTraits_2`. The latter is a refinement -of the concept `ArrangementXMonotoneTraits_2`. In addition to the -requirements of the concept `ArrangementXMonotoneTraits_2`, a -model of the concept `ArrangementDirectionalXMonotoneTraits_2` must -support the following functions: -
      -
    • Given an \f$ x\f$-monotone curve, construct its opposite curve. -
    • Given an \f$ x\f$-monotone curve, compare its two endpoints lexicographically. -
    - -This class supports a few convenient operations in addition to the -requirements that the concept `GeneralPolygon_2` lists. +The class `General_polygon_2` models the concept `GeneralPolygon_2`. +It represents a simple general-polygon. It is parameterized with the type +`ArrTraits` that models the concept +`ArrangementDirectionalXMonotoneTraits_2`. The latter is a refinement +of the concept `ArrangementXMonotoneTraits_2`. In addition to the +requirements of the concept `ArrangementXMonotoneTraits_2`, a +model of the concept `ArrangementDirectionalXMonotoneTraits_2` must +support the following functions: +
      +
    • Given an \f$ x\f$-monotone curve, construct its opposite curve. +
    • Given an \f$ x\f$-monotone curve, compare its two endpoints lexicographically. +
    + +This class supports a few convenient operations in addition to the +requirements that the concept `GeneralPolygon_2` lists. \cgalModels `GeneralPolygon_2` @@ -27,55 +27,55 @@ template< typename ArrTraits > class General_polygon_2 { public: -/// \name Types +/// \name Types /// @{ /*! -number of edges size type. -*/ -typedef unspecified_type Size; +number of edges size type. +*/ +typedef unspecified_type Size; -/// @} +/// @} -/// \name Operations +/// \name Operations /// @{ /*! -returns the number of edges of the general polygon. -*/ -Size size(); +returns the number of edges of the general polygon. +*/ +Size size(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -clears the polygon. -*/ -void clear(); +clears the polygon. +*/ +void clear(); /*! -reverses the orientation of the polygon. -\pre `is_simple()`. -*/ -void reverse_orientation(); +reverses the orientation of the polygon. +\pre `is_simple()`. +*/ +void reverse_orientation(); -/// @} +/// @} -/// \name Predicates +/// \name Predicates /// @{ /*! -returns `true` if the polygon is empty, and `false` otherwise. -*/ -bool is_empty(); +returns `true` if the polygon is empty, and `false` otherwise. +*/ +bool is_empty(); /*! -returns the orientation of the polygon. -\pre `is_simple()`. -*/ -Orientation orientation(); +returns the orientation of the polygon. +\pre `is_simple()`. +*/ +Orientation orientation(); /// @} @@ -87,9 +87,9 @@ This operator imports a general polygon from the input stream `in`. An ASCII and a binary format exist. The stream detects the format automatically and can read both. -The format consists of the number of points of the outer boundary followed +The format consists of the number of points of the outer boundary followed by the points themselves in counterclockwise order, followed by the number of holes, -and for each hole, the number of points of the outer boundary is followed +and for each hole, the number of points of the outer boundary is followed by the points themselves in clockwise order. \relates General_polygon_2 diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h index c11787975f8b..c5446377ab75 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h @@ -3,460 +3,460 @@ namespace CGAL { /*! \ingroup PkgBooleanSetOperations2Ref -An object of the `General_polygon_set_2` class-template represents a -point set in the plane bounded by \f$ x\f$ monotone curves. Points in the set -lie on the boundary or on the positive side of the curves. This class -template provides methods to apply regularized Boolean set-operations and -few other utility methods. An `Arrangement_2` data structure is -internally used to represent the point set. The arrangement is -represented as a doubly-connected edge-list (Dcel). - -The `Traits` template-parameter should be instantiated with a -model of the concept `GeneralPolygonSetTraits_2`. The traits class -defines the types of points, \f$ x\f$-monotone curves, general polygons, -and general polygons with holes, that is -`Traits::Point_2`, -`Traits::X_monotone_curve_2`, `Traits::Polygon_2`, and -`Traits::Polygon_with_holes_2`, respectively. -`Traits::Point_2` must -be the type of the endpoints of -`Traits::X_monotone_curve_2`, and -`Traits::X_monotone_curve_2` must be the type of -the curves that comprise the boundaries of the general polygons. The traits -class supports geometric operations on the types above. We sometimes use -the term polygon instead of general polygon for simplicity hereafter. - -The template parameter `Dcel` should be instantiated with a -model of the concept `GeneralPolygonSetDcel`. It is instantiated -by default with the type `Gps_default_dcel`. You can override -this default, with a different Dcel class, typically an extension -of the `Gps_default_dcel` class template. Overriding the default is -necessary only if you intend to obtain the underlying internal arrangement -and process it further. - -The input and output of the Boolean set-operations methods consist of one -or more general polygons, some of which may have holes. In particular, -these methods operate on pairs of objects of type `General_polygon_set_2`, or -directly on objects of type `Traits::Polygon_2` or -`Traits::Polygon_with_holes_2`. An object of type -`Traits::Polygon_2` is a valid operand, only if it -is simple and its boundary is oriented counterclockwise. An object of type -`Traits::Polygon_with_holes_2` is valid, only if -its outer boundary bounds a relatively simple general polygon oriented -counterclockwise, and each one of its holes is a simple polygon oriented -clockwise. The holes are pairwise disjoint, except perhaps at the vertices, -and are contained in the polygon bounded by the outer boundary. The outer -boundary and the holes are also pairwise disjoint, except perhaps at the -vertices. - -\sa `Arrangement_2` -\sa `ArrangementXMonotoneTraits_2` -\sa `Nef_polyhedron_2` +An object of the `General_polygon_set_2` class-template represents a +point set in the plane bounded by \f$ x\f$ monotone curves. Points in the set +lie on the boundary or on the positive side of the curves. This class +template provides methods to apply regularized Boolean set-operations and +few other utility methods. An `Arrangement_2` data structure is +internally used to represent the point set. The arrangement is +represented as a doubly-connected edge-list (Dcel). + +The `Traits` template-parameter should be instantiated with a +model of the concept `GeneralPolygonSetTraits_2`. The traits class +defines the types of points, \f$ x\f$-monotone curves, general polygons, +and general polygons with holes, that is +`Traits::Point_2`, +`Traits::X_monotone_curve_2`, `Traits::Polygon_2`, and +`Traits::Polygon_with_holes_2`, respectively. +`Traits::Point_2` must +be the type of the endpoints of +`Traits::X_monotone_curve_2`, and +`Traits::X_monotone_curve_2` must be the type of +the curves that comprise the boundaries of the general polygons. The traits +class supports geometric operations on the types above. We sometimes use +the term polygon instead of general polygon for simplicity hereafter. + +The template parameter `Dcel` should be instantiated with a +model of the concept `GeneralPolygonSetDcel`. It is instantiated +by default with the type `Gps_default_dcel`. You can override +this default, with a different Dcel class, typically an extension +of the `Gps_default_dcel` class template. Overriding the default is +necessary only if you intend to obtain the underlying internal arrangement +and process it further. + +The input and output of the Boolean set-operations methods consist of one +or more general polygons, some of which may have holes. In particular, +these methods operate on pairs of objects of type `General_polygon_set_2`, or +directly on objects of type `Traits::Polygon_2` or +`Traits::Polygon_with_holes_2`. An object of type +`Traits::Polygon_2` is a valid operand, only if it +is simple and its boundary is oriented counterclockwise. An object of type +`Traits::Polygon_with_holes_2` is valid, only if +its outer boundary bounds a relatively simple general polygon oriented +counterclockwise, and each one of its holes is a simple polygon oriented +clockwise. The holes are pairwise disjoint, except perhaps at the vertices, +and are contained in the polygon bounded by the outer boundary. The outer +boundary and the holes are also pairwise disjoint, except perhaps at the +vertices. + +\sa `Arrangement_2` +\sa `ArrangementXMonotoneTraits_2` +\sa `Nef_polyhedron_2` */ template< typename Traits, typename Dcel > class General_polygon_set_2 { public: -/// \name Types +/// \name Types /// @{ /*! -the traits class in use. -*/ -typedef unspecified_type Traits_2; +the traits class in use. +*/ +typedef unspecified_type Traits_2; /*! -the general polygon type. Must model the `GpsTraitsGeneralPolygon_2` concept. -*/ -typedef unspecified_type Polygon_2; +the general polygon type. Must model the `GpsTraitsGeneralPolygon_2` concept. +*/ +typedef unspecified_type Polygon_2; /*! -the general polygon with holes type. Must model the `GpsTraitsGeneralPolygonWithHoles_2` concept. -*/ -typedef unspecified_type Polygon_with_holes_2; +the general polygon with holes type. Must model the `GpsTraitsGeneralPolygonWithHoles_2` concept. +*/ +typedef unspecified_type Polygon_with_holes_2; /*! -number of polygons with holes size type. -*/ -typedef unspecified_type Size; +number of polygons with holes size type. +*/ +typedef unspecified_type Size; /*! -the arrangement type used internally. -*/ -typedef unspecified_type Arrangement_2; +the arrangement type used internally. +*/ +typedef unspecified_type Arrangement_2; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -constructs an empty set of polygons `gps` represented by an empty arrangement. -*/ -General_polygon_set_2(); +constructs an empty set of polygons `gps` represented by an empty arrangement. +*/ +General_polygon_set_2(); /*! -copy constructor. -*/ -General_polygon_set_2(const Self & other); +copy constructor. +*/ +General_polygon_set_2(const Self & other); /*! -constructs an empty set of polygons `gps` that uses the given -`traits` instance for performing the geometric operations. -*/ -General_polygon_set_2(Traits & traits); +constructs an empty set of polygons `gps` that uses the given +`traits` instance for performing the geometric operations. +*/ +General_polygon_set_2(Traits & traits); /*! -constructs a set of polygons `gps` that consists of the single polygon `pgn`. -*/ -General_polygon_set_2(const Polygon_2 & pgn); +constructs a set of polygons `gps` that consists of the single polygon `pgn`. +*/ +General_polygon_set_2(const Polygon_2 & pgn); /*! -constructs a set of polygons `gps` that consists of the single polygon with -holes `pgn_with_holes`. -*/ -General_polygon_set_2(const Polygon_with_holes_2 & pgn_with_holes); +constructs a set of polygons `gps` that consists of the single polygon with +holes `pgn_with_holes`. +*/ +General_polygon_set_2(const Polygon_with_holes_2 & pgn_with_holes); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -obtains the polygons with holes represented by `gps`. -*/ -template -OutputIterator polygons_with_holes(OutputIterator out); +obtains the polygons with holes represented by `gps`. +*/ +template +OutputIterator polygons_with_holes(OutputIterator out); /*! -returns the total number of general polygons represented by `gps`. -*/ -Size number_of_polygons_with_holes() const; +returns the total number of general polygons represented by `gps`. +*/ +Size number_of_polygons_with_holes() const; /*! -returns `true` if `gps` represents an empty set. -*/ -bool is_empty() const; +returns `true` if `gps` represents an empty set. +*/ +bool is_empty() const; /*! -returns `true` if `gps` represents the entire plane. -*/ -bool is_plane() const; +returns `true` if `gps` represents the entire plane. +*/ +bool is_plane() const; /*! -obtains an instance of the traits. If the traits was passed as a -parameter to the constructor of `gps`, it is returned. Otherwise, a -newly created instance is returned. -*/ -Traits & traits() const; +obtains an instance of the traits. If the traits was passed as a +parameter to the constructor of `gps`, it is returned. Otherwise, a +newly created instance is returned. +*/ +Traits & traits() const; /*! -obtains the arrangement data structure that internally represents the -general-polygon set. -*/ -const Arrangement_2 & arrangement() const; +obtains the arrangement data structure that internally represents the +general-polygon set. +*/ +const Arrangement_2 & arrangement() const; -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -clears `gps`. -*/ -void clear(); +clears `gps`. +*/ +void clear(); /*! -inserts `pgn` into `gps`. -\pre `pgn` and the point set represented by `gps` are disjoint. -This precondition enables the use of very efficient insertion methods. -Use the respective overloaded method that inserts a polygon of type -`Polygon_with_holes_2`, if only a relaxed -precondition can be guaranteed. If even the relaxed precondition cannot -be guaranteed, use the `join` method. -*/ -void insert(Polygon_2 & pgn); +inserts `pgn` into `gps`. +\pre `pgn` and the point set represented by `gps` are disjoint. +This precondition enables the use of very efficient insertion methods. +Use the respective overloaded method that inserts a polygon of type +`Polygon_with_holes_2`, if only a relaxed +precondition can be guaranteed. If even the relaxed precondition cannot +be guaranteed, use the `join` method. +*/ +void insert(Polygon_2 & pgn); /*! -inserts `pgn_with_holes` into `gps`. -\pre `pgn_with_holes` does not intersect with the point set represented by `gps`, except maybe at the vertices. -If this relaxed precondition cannot be guaranteed, use the `join` -method. -*/ -void insert(Polygon_with_holes_2 & pgn_with_holes); +inserts `pgn_with_holes` into `gps`. +\pre `pgn_with_holes` does not intersect with the point set represented by `gps`, except maybe at the vertices. +If this relaxed precondition cannot be guaranteed, use the `join` +method. +*/ +void insert(Polygon_with_holes_2 & pgn_with_holes); /*! -inserts the range of polygons (or polygons with holes) into `gps`. (The -value type of the input iterator is used to distinguish between the two.) -\pre If the given range contains objects of type `Polygon_with_holes_2`, then these polygons and the point set represented by `gps` are pairwise disjoint, except maybe at the vertices. If the given range contains objects of type `Polygon_2`, then these polygons and the point set represented by `gps` are pairwise disjoint without any exceptions. -*/ -template -void insert(InputIterator begin, InputIterator end); +inserts the range of polygons (or polygons with holes) into `gps`. (The +value type of the input iterator is used to distinguish between the two.) +\pre If the given range contains objects of type `Polygon_with_holes_2`, then these polygons and the point set represented by `gps` are pairwise disjoint, except maybe at the vertices. If the given range contains objects of type `Polygon_2`, then these polygons and the point set represented by `gps` are pairwise disjoint without any exceptions. +*/ +template +void insert(InputIterator begin, InputIterator end); /*! -inserts the two ranges of polygons and polygons with holes into `gps`. -\pre All polygons in the first range, all polygon with holes in the second range, and the point set represented by `gps` are pairwise disjoint, except maybe at the vertices -*/ -template -void insert(InputIterator1 pgn_begin, InputIterator1 pgn_end, -InputIterator2 pgn_with_holes_begin, -InputIterator2 pgn_with_holes_end); +inserts the two ranges of polygons and polygons with holes into `gps`. +\pre All polygons in the first range, all polygon with holes in the second range, and the point set represented by `gps` are pairwise disjoint, except maybe at the vertices +*/ +template +void insert(InputIterator1 pgn_begin, InputIterator1 pgn_end, +InputIterator2 pgn_with_holes_begin, +InputIterator2 pgn_with_holes_end); /*! -computes the complement of `gps`. -*/ -void complement(); +computes the complement of `gps`. +*/ +void complement(); /*! -computes the complement of `other`. -`gps` is overridden by the result. -*/ -void complement(const Polygon_set_2 & other); +computes the complement of `other`. +`gps` is overridden by the result. +*/ +void complement(const Polygon_set_2 & other); -/// @} +/// @} -/// \name Univariate Operations +/// \name Univariate Operations /// In the following univariate and bivariate methods the result is placed in `gps` after it is cleared. /// @{ /*! -computes the intersection of `gps` and `other`. -*/ -void intersection(const General_polygon_set_2 & other); +computes the intersection of `gps` and `other`. +*/ +void intersection(const General_polygon_set_2 & other); /*! -computes the intersection of `gps` and `pgn`. -*/ -void intersection(const Polygon_2 & pgn); +computes the intersection of `gps` and `pgn`. +*/ +void intersection(const Polygon_2 & pgn); /*! -computes the intersection of `gps` and `pgn`. -*/ -void intersection(const Polygon_with_holes_2 & pgn); +computes the intersection of `gps` and `pgn`. +*/ +void intersection(const Polygon_with_holes_2 & pgn); /*! -computes the intersection of a collection of point sets. The collection -consists of the polygons (or polygons with holes) in the given range and -the point set represented by `gps`. (The value type of the input iterator -is used to distinguish between the two options.) -*/ -template -void intersection(InputIterator begin, InputIterator end); +computes the intersection of a collection of point sets. The collection +consists of the polygons (or polygons with holes) in the given range and +the point set represented by `gps`. (The value type of the input iterator +is used to distinguish between the two options.) +*/ +template +void intersection(InputIterator begin, InputIterator end); /*! -computes the intersection of a collection of point sets. The collection -consists of the polygons and polygons with holes in the given two ranges -and the point set represented by `gps`. -*/ -template -void intersection(InputIterator1 pgn_begin, InputIterator1 pgn_end, -InputIterator2 pgn_with_holes_begin, -InputIterator2 pgn_with_holes_end); +computes the intersection of a collection of point sets. The collection +consists of the polygons and polygons with holes in the given two ranges +and the point set represented by `gps`. +*/ +template +void intersection(InputIterator1 pgn_begin, InputIterator1 pgn_end, +InputIterator2 pgn_with_holes_begin, +InputIterator2 pgn_with_holes_end); /*! -computes the union of `gps` and `other`. -*/ -void join(const General_polygon_set_2 & other); +computes the union of `gps` and `other`. +*/ +void join(const General_polygon_set_2 & other); /*! -computes the union of `gps` and `pgn`. -*/ -void join(const Polygon_2 & pgn); +computes the union of `gps` and `pgn`. +*/ +void join(const Polygon_2 & pgn); /*! -computes the union of `gps` and `pgn`. -*/ -void join(const Polygon_with_holes_2 & pgn); +computes the union of `gps` and `pgn`. +*/ +void join(const Polygon_with_holes_2 & pgn); /*! -computes the union of the polygons (or polygons with holes) in the -given range and the point set represented by `gps`. (The value type -of the input iterator is used to distinguish between the two options.) -*/ -template -void join(InputIterator begin, InputIterator end); +computes the union of the polygons (or polygons with holes) in the +given range and the point set represented by `gps`. (The value type +of the input iterator is used to distinguish between the two options.) +*/ +template +void join(InputIterator begin, InputIterator end); /*! -computes the union of the polygons and polygons with holes in the -given two ranges and the point set represented by `gps`. -*/ -template -void join(InputIterator1 pgn_begin, InputIterator1 pgn_end, -InputIterator2 pgn_with_holes_begin, -InputIterator2 pgn_with_holes_end); +computes the union of the polygons and polygons with holes in the +given two ranges and the point set represented by `gps`. +*/ +template +void join(InputIterator1 pgn_begin, InputIterator1 pgn_end, +InputIterator2 pgn_with_holes_begin, +InputIterator2 pgn_with_holes_end); /*! -computes the difference between `gps` and `other`. -*/ -void difference(const General_polygon_set_2 & other); +computes the difference between `gps` and `other`. +*/ +void difference(const General_polygon_set_2 & other); /*! -computes the difference between `gps` and `pgn`. -*/ -void difference(const Polygon_2 & pgn); +computes the difference between `gps` and `pgn`. +*/ +void difference(const Polygon_2 & pgn); /*! -computes the difference between `gps` and `pgn`. -*/ -void difference(const Polygon_with_holes_2 & pgn); +computes the difference between `gps` and `pgn`. +*/ +void difference(const Polygon_with_holes_2 & pgn); /*! -computes the symmetric difference between `gps` and `other`. -*/ -void symmetric_difference(const General_polygon_set_2 & other); +computes the symmetric difference between `gps` and `other`. +*/ +void symmetric_difference(const General_polygon_set_2 & other); /*! -computes the symmetric difference between `gps` and `pgn`. -*/ -void symmetric_difference(const Polygon_2 & pgn); +computes the symmetric difference between `gps` and `pgn`. +*/ +void symmetric_difference(const Polygon_2 & pgn); /*! -computes the symmetric difference between `gps` and `pgn`. -*/ -void symmetric_difference(const Polygon_with_holes_2 & pgn); +computes the symmetric difference between `gps` and `pgn`. +*/ +void symmetric_difference(const Polygon_with_holes_2 & pgn); /*! -computes the symmetric difference (xor) of a collection of point sets. -The collection consists of the polygons (or polygons with holes) in the -given range and the point set represented by `gps`. (The value type of -the input iterator is used to distinguish between the two options.) -*/ -template -void symmetric_difference(InputIterator begin, InputIterator end); +computes the symmetric difference (xor) of a collection of point sets. +The collection consists of the polygons (or polygons with holes) in the +given range and the point set represented by `gps`. (The value type of +the input iterator is used to distinguish between the two options.) +*/ +template +void symmetric_difference(InputIterator begin, InputIterator end); /*! -computes the symmetric difference (xor) of a collection of point sets. -The collection consists of the polygons and polygons with holes in the -given two ranges and the point set represented by `gps`. -*/ -template -void symmetric_difference(InputIterator1 pgn_begin, InputIterator1 pgn_end, -InputIterator2 pgn_with_holes_begin, -InputIterator2 pgn_with_holes_end); +computes the symmetric difference (xor) of a collection of point sets. +The collection consists of the polygons and polygons with holes in the +given two ranges and the point set represented by `gps`. +*/ +template +void symmetric_difference(InputIterator1 pgn_begin, InputIterator1 pgn_end, +InputIterator2 pgn_with_holes_begin, +InputIterator2 pgn_with_holes_end); -/// @} +/// @} -/// \name Bivariate Operations +/// \name Bivariate Operations /// The following bivariate function replace `gps` with the result. /// @{ /*! -computes the intersection of `gps1` and `gps2`. -*/ -void intersection(const General_polygon_set_2 & gps1, -const General_polygon_set_2 & gps2); +computes the intersection of `gps1` and `gps2`. +*/ +void intersection(const General_polygon_set_2 & gps1, +const General_polygon_set_2 & gps2); /*! -computes the union of `gps1` and `gps2`. -*/ -void join(const General_polygon_set_2 & gps1, -const General_polygon_set_2 & gps2); +computes the union of `gps1` and `gps2`. +*/ +void join(const General_polygon_set_2 & gps1, +const General_polygon_set_2 & gps2); /*! -computes the difference between `gps1` and `gps2`. -*/ -void difference(const General_polygon_set_2 & gps1, -const General_polygon_set_2 & gps2); +computes the difference between `gps1` and `gps2`. +*/ +void difference(const General_polygon_set_2 & gps1, +const General_polygon_set_2 & gps2); /*! -computes the symmetric difference between `gps1` and `gps2`. -*/ -void symmetric_difference(const General_polygon_set_2 & gps1, -const General_polygon_set_2 & gps2); +computes the symmetric difference between `gps1` and `gps2`. +*/ +void symmetric_difference(const General_polygon_set_2 & gps1, +const General_polygon_set_2 & gps2); -/// @} +/// @} -/// \name Query Functions +/// \name Query Functions /// @{ /*! -returns `true` if `gps` and `other` intersect in their -interior, and `false` otherwise. -*/ -bool do_intersect(const General_polygon_set_2 & other); +returns `true` if `gps` and `other` intersect in their +interior, and `false` otherwise. +*/ +bool do_intersect(const General_polygon_set_2 & other); /*! -returns `true` if `gps` and `pgn` intersect in their -interior, and `false` otherwise. -*/ -bool do_intersect(const Polygon_2 & pgn); +returns `true` if `gps` and `pgn` intersect in their +interior, and `false` otherwise. +*/ +bool do_intersect(const Polygon_2 & pgn); /*! -returns `true` if `gps` and `pgn` intersect in their -interior, and `false` otherwise. -*/ -bool do_intersect(const Polygon_with_holes_2 & pgn); +returns `true` if `gps` and `pgn` intersect in their +interior, and `false` otherwise. +*/ +bool do_intersect(const Polygon_with_holes_2 & pgn); /*! -returns `true` if the interior of the point sets in a collection -intersect, and `false` otherwise. The collection consists of the -polygons (or polygons with holes) in the given range and the point set -represented by `gps`. (The value type of the input iterator is used to -distinguish between the two options.) -*/ -template -void do_intersect(InputIterator begin, InputIterator end); +returns `true` if the interior of the point sets in a collection +intersect, and `false` otherwise. The collection consists of the +polygons (or polygons with holes) in the given range and the point set +represented by `gps`. (The value type of the input iterator is used to +distinguish between the two options.) +*/ +template +void do_intersect(InputIterator begin, InputIterator end); /*! -returns `true` if the interior of the point sets in a collection -intersect, and `false` otherwise. The collection consists of the -polygons and polygons with holes in the given two ranges and the point -set represented by `gps`. -*/ -template -void do_intersect(InputIterator1 pgn_begin, InputIterator1 pgn_end, -InputIterator2 pgn_with_holes_begin, -InputIterator2 pgn_with_holes_end); +returns `true` if the interior of the point sets in a collection +intersect, and `false` otherwise. The collection consists of the +polygons and polygons with holes in the given two ranges and the point +set represented by `gps`. +*/ +template +void do_intersect(InputIterator1 pgn_begin, InputIterator1 pgn_end, +InputIterator2 pgn_with_holes_begin, +InputIterator2 pgn_with_holes_end); /*! -obtains a polygon with holes that contains the query point `p`, -if exists, through `pgn`, and returns `true`. -Otherwise, returns `false`. -*/ -bool locate(const Point_2 & p, Polygon_with_holes_2 & pgn); +obtains a polygon with holes that contains the query point `p`, +if exists, through `pgn`, and returns `true`. +Otherwise, returns `false`. +*/ +bool locate(const Point_2 & p, Polygon_with_holes_2 & pgn); /*! -returns either the constant `ON_ORIENTED_BOUNDARY`, -`ON_POSITIVE_SIDE`, or `ON_NEGATIVE_SIDE`, iff `p` lies on -the boundary, properly on the positive side, or properly on the negative -side of `gps` respectively. -*/ -Oriented_side oriented_side(const Point_2 & q); +returns either the constant `ON_ORIENTED_BOUNDARY`, +`ON_POSITIVE_SIDE`, or `ON_NEGATIVE_SIDE`, iff `p` lies on +the boundary, properly on the positive side, or properly on the negative +side of `gps` respectively. +*/ +Oriented_side oriented_side(const Point_2 & q); /*! -returns either the constant `ON_NEGATIVE_SIDE`, -`ON_ORIENTED_BOUNDARY`, or `ON_POSITIVE_SIDE`, iff -`other` and `gps` are completely disjoint, in contact, or -intersect in their interior, respectively. -*/ -Oriented_side oriented_side(const General_polygon_set_2 & other); +returns either the constant `ON_NEGATIVE_SIDE`, +`ON_ORIENTED_BOUNDARY`, or `ON_POSITIVE_SIDE`, iff +`other` and `gps` are completely disjoint, in contact, or +intersect in their interior, respectively. +*/ +Oriented_side oriented_side(const General_polygon_set_2 & other); /*! -returns either the constant `ON_NEGATIVE_SIDE`, -`ON_ORIENTED_BOUNDARY`, or `ON_POSITIVE_SIDE`, iff -`pgn` and `gps` are completely disjoint, in contact, or -intersect in their interior, respectively. -*/ -Oriented_side oriented_side(const Polygon_2 & pgn); +returns either the constant `ON_NEGATIVE_SIDE`, +`ON_ORIENTED_BOUNDARY`, or `ON_POSITIVE_SIDE`, iff +`pgn` and `gps` are completely disjoint, in contact, or +intersect in their interior, respectively. +*/ +Oriented_side oriented_side(const Polygon_2 & pgn); /*! -returns either the constant `ON_NEGATIVE_SIDE`, -`ON_ORIENTED_BOUNDARY`, or `ON_POSITIVE_SIDE`, iff -`pgn` and `gps` are completely disjoint, in contact, or -intersect in their interior, respectively. -*/ -Oriented_side oriented_side(const Polygon_with_holes_2 & pgn); +returns either the constant `ON_NEGATIVE_SIDE`, +`ON_ORIENTED_BOUNDARY`, or `ON_POSITIVE_SIDE`, iff +`pgn` and `gps` are completely disjoint, in contact, or +intersect in their interior, respectively. +*/ +Oriented_side oriented_side(const Polygon_with_holes_2 & pgn); -/// @} +/// @} -/// \name Miscellaneous +/// \name Miscellaneous /// @{ /*! -returns `true` if `gps` represents a valid point set. -*/ -bool is_valid() const; +returns `true` if `gps` represents a valid point set. +*/ +bool is_valid() const; /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h index e22be2b363fa..c93ff9e02752 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h @@ -4,14 +4,14 @@ namespace CGAL { /*! \ingroup PkgBooleanSetOperations2Ref -The traits class `Gps_circle_segment_traits_2` models the `GeneralPolygonSetTraits_2` -concept. It enables Boolean set-operations on general polygons bounded by -linear segments or circular arcs. -It should be parameterized with a kernel. +The traits class `Gps_circle_segment_traits_2` models the `GeneralPolygonSetTraits_2` +concept. It enables Boolean set-operations on general polygons bounded by +linear segments or circular arcs. +It should be parameterized with a kernel. \cgalModels `GeneralPolygonSetTraits_2` -\sa `CGAL::Arr_circle_segment_traits_2` +\sa `CGAL::Arr_circle_segment_traits_2` */ template< typename Kernel > diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h index 536b7dddd40d..dbe5f325b011 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h @@ -6,14 +6,14 @@ namespace CGAL { \cgalModels `GeneralPolygonSetTraits_2` -\sa `CGAL::Arr_segment_traits_2` +\sa `CGAL::Arr_segment_traits_2` */ template< typename Kernel, typename Container, typename ArrSegmentTraits > class Gps_segment_traits_2 { public: -/// \name Definition +/// \name Definition /// The traits class `Gps_segment_traits_2` models the concept /// `GeneralPolygonSetTraits_2`. It enables Boolean set-operations on /// (linear) polygons. It defines the exposed type `Polygon_2` to be @@ -26,8 +26,8 @@ class Gps_segment_traits_2 { /*! -*/ -typedef CGAL::Polygon_2 Polygon_2; +*/ +typedef CGAL::Polygon_2 Polygon_2; /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h index cebe22ad9bad..050bada2dece 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h @@ -4,14 +4,14 @@ namespace CGAL { /*! \ingroup PkgBooleanSetOperations2Ref -The traits class `Gps_traits_2` models the concept -`GeneralPolygonSetTraits_2`. It inherits from the instantiated -type of the template parameter `ArrTraits`, which must model the -concept `ArrangementDirectionalXMonotoneTraits_2`, (which in turn refines -the concept `ArrangementXMonotoneTraits_2`). The template parameter -`GeneralPolygon_t` must be instantiated with a model of the concept -of `GpsTraitsGeneralPolygon_2`. By default, the latter is instantiated by -`CGAL::General_polygon_2`. +The traits class `Gps_traits_2` models the concept +`GeneralPolygonSetTraits_2`. It inherits from the instantiated +type of the template parameter `ArrTraits`, which must model the +concept `ArrangementDirectionalXMonotoneTraits_2`, (which in turn refines +the concept `ArrangementXMonotoneTraits_2`). The template parameter +`GeneralPolygon_t` must be instantiated with a model of the concept +of `GpsTraitsGeneralPolygon_2`. By default, the latter is instantiated by +`CGAL::General_polygon_2`. \cgalModels `GeneralPolygonSetTraits_2` diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h index ab96d0f34667..d426ebb55a32 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h @@ -4,22 +4,22 @@ namespace CGAL { /*! \ingroup PkgBooleanSetOperations2Ref -The class `Polygon_set_2` represents sets of linear polygons with holes. -The first two template parameters (`Kernel` and `Container`) -are used to instantiate the type `Polygon_2`. -This type is used to represent the outer boundary of every set member -and the boundaries of all holes of every set member. +The class `Polygon_set_2` represents sets of linear polygons with holes. +The first two template parameters (`Kernel` and `Container`) +are used to instantiate the type `Polygon_2`. +This type is used to represent the outer boundary of every set member +and the boundaries of all holes of every set member. -The third template parameter `Dcel` must be instantiated with a -model of the concept `GeneralPolygonSetDcel`. It is instantiated -by default with the type `Gps_default_dcel`. You can override -this default, with a different Dcel class, typically an extension -of the `Gps_default_dcel` class template. Overriding the default is -necessary only if you intend to obtain the underlying internal arrangement -and process it further. +The third template parameter `Dcel` must be instantiated with a +model of the concept `GeneralPolygonSetDcel`. It is instantiated +by default with the type `Gps_default_dcel`. You can override +this default, with a different Dcel class, typically an extension +of the `Gps_default_dcel` class template. Overriding the default is +necessary only if you intend to obtain the underlying internal arrangement +and process it further. -\sa `General_polygon_set_2` -\sa `Gps_segment_traits_2` +\sa `General_polygon_set_2` +\sa `Gps_segment_traits_2` */ template< typename Kernel, typename Container, typename Dcel > diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h index 928c0d1fc96a..cfb4c754697a 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h @@ -3,24 +3,24 @@ namespace CGAL { /*! \addtogroup boolean_connect_holes Functions on Polygon with Holes \ingroup PkgBooleanSetOperations2Ref -\anchor ref_bso_connect_holes +\anchor ref_bso_connect_holes */ /// @{ /*! -Connects the holes of `pwh` with its outer boundary. This is done -by locating the topmost vertex in each hole in the polygon with holes -`pwh`, and connecting it by a vertical segment to the polygon -feature located directly above it (a vertex or an edge of the outer -boundary, or of another hole). The function produces an output -sequence of points, which corresponds to the traversal of the vertices -of the input polygon; this traversal starts from the outer boundary -and moves to the holes using the auxiliary vertical segments that -were added to connect the polygon with its holes. The value-type -of `oi` is `Kernel::Point_2`. -\pre The input polygon with holes `pwh` is bounded (namely it has a valid outer boundary). +Connects the holes of `pwh` with its outer boundary. This is done +by locating the topmost vertex in each hole in the polygon with holes +`pwh`, and connecting it by a vertical segment to the polygon +feature located directly above it (a vertex or an edge of the outer +boundary, or of another hole). The function produces an output +sequence of points, which corresponds to the traversal of the vertices +of the input polygon; this traversal starts from the outer boundary +and moves to the holes using the auxiliary vertical segments that +were added to connect the polygon with its holes. The value-type +of `oi` is `Kernel::Point_2`. +\pre The input polygon with holes `pwh` is bounded (namely it has a valid outer boundary). */ template diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h index 00a4c0cd04fc..972825d1bf8d 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h @@ -3,9 +3,9 @@ namespace ArrDirectionalTraits { \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` -\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Are_mergeable_2` +\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Are_mergeable_2` */ @@ -17,15 +17,15 @@ class AreMergeable_2 { /// @{ /*! -accepts two \f$ x\f$-monotone curves `xc1` and `xc2` and determines -whether they can be merged to form a single \f$ x\f$-monotone curve. -`xc1` and `xc2` are mergeable if their underlying curves are -identical, they share a common endpoint, and they do not bend to form -a non-\f$ x\f$-monotone curve. -\pre The target point of `xc1` and the source point `xc2` coincide or the source point of `xc2` and the target point `xc2` coincide. -*/ -bool operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, -ArrDirectionalTraits::X_monotone_curve_2 xc2); +accepts two \f$ x\f$-monotone curves `xc1` and `xc2` and determines +whether they can be merged to form a single \f$ x\f$-monotone curve. +`xc1` and `xc2` are mergeable if their underlying curves are +identical, they share a common endpoint, and they do not bend to form +a non-\f$ x\f$-monotone curve. +\pre The target point of `xc1` and the source point `xc2` coincide or the source point of `xc2` and the target point `xc2` coincide. +*/ +bool operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, +ArrDirectionalTraits::X_monotone_curve_2 xc2); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h index d85c94b6d0fb..ff77632107f6 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h @@ -18,12 +18,12 @@ class CompareEndpointsXy_2 { /// @{ /*! -accepts an input curve `xc` and compares its source and target -points. It returns `SMALLER` if the curve is directed from -lexicographically left to right, and `LARGER` if it is directed -from lexicographically right to left. -*/ -Comparison_result operator()(ArrDirectionalTraits::X_monotone_curve_2 xc); +accepts an input curve `xc` and compares its source and target +points. It returns `SMALLER` if the curve is directed from +lexicographically left to right, and `LARGER` if it is directed +from lexicographically right to left. +*/ +Comparison_result operator()(ArrDirectionalTraits::X_monotone_curve_2 xc); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h index 75fe707d88d6..3b9248da8718 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h @@ -18,11 +18,11 @@ class ConstructOpposite_2 { /// @{ /*! -accepts an \f$ x\f$-monotone curve `xc` and returns its opposite curve, -namely a curve whose graph is the same as `xc`'s, and whose source and -target are swapped with respect to `xc`'s source and target. -*/ -ArrDirectionalTraits::X_monotone_curve_2 operator()(ArrDirectionalTraits::X_monotone_curve_2 xc); +accepts an \f$ x\f$-monotone curve `xc` and returns its opposite curve, +namely a curve whose graph is the same as `xc`'s, and whose source and +target are swapped with respect to `xc`'s source and target. +*/ +ArrDirectionalTraits::X_monotone_curve_2 operator()(ArrDirectionalTraits::X_monotone_curve_2 xc); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h index 707ff25beebf..4d09d1f41e3d 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h @@ -3,9 +3,9 @@ namespace ArrDirectionalTraits { \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` -\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Intersect_2` +\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Intersect_2` */ @@ -17,23 +17,23 @@ class Intersect_2 { /// @{ /*! -computes the intersections of `xc1` and `xc2` and -inserts them in an ascending lexicographic \f$ xy\f$-order into the -output iterator `oi`. The value-type of `Output_iterator` is -`CGAL::Object`, where each `Object` wraps either a -`pair` object, which -represents an intersection point with its multiplicity (in case the -multiplicity is undefined or unknown, it is set to \f$ 0\f$) or an -`ArrDirectionalTraits::X_monotone_curve_2` object, representing an -overlapping subcurve of `xc1` and `xc2`. In the latter case, -the overlapping subcurves are given the direction of `xc1` and -`xc2` if their directions are identical. Otherwise, the overlapping -subcurves are given an arbitrary direction. The operator returns a -past-the-end iterator for the output sequence. -*/ -Output_iterator operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, -ArrDirectionalTraits::X_monotone_curve_2 xc2, -Output_iterator& oi); +computes the intersections of `xc1` and `xc2` and +inserts them in an ascending lexicographic \f$ xy\f$-order into the +output iterator `oi`. The value-type of `Output_iterator` is +`CGAL::Object`, where each `Object` wraps either a +`pair` object, which +represents an intersection point with its multiplicity (in case the +multiplicity is undefined or unknown, it is set to \f$ 0\f$) or an +`ArrDirectionalTraits::X_monotone_curve_2` object, representing an +overlapping subcurve of `xc1` and `xc2`. In the latter case, +the overlapping subcurves are given the direction of `xc1` and +`xc2` if their directions are identical. Otherwise, the overlapping +subcurves are given an arbitrary direction. The operator returns a +past-the-end iterator for the output sequence. +*/ +Output_iterator operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, +ArrDirectionalTraits::X_monotone_curve_2 xc2, +Output_iterator& oi); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h index 681fb5286256..d7b1cbe791e0 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h @@ -3,9 +3,9 @@ namespace ArrDirectionalTraits { \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -\cgalRefines `AdaptableBinaryFunction` +\cgalRefines `AdaptableBinaryFunction` -\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Merge_2` +\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Merge_2` */ @@ -17,19 +17,19 @@ class Merge_2 { /// @{ /*! -accepts two mergeable \f$ x\f$-monotone curves `xc1` and -`xc2` and asigns `xc` with the merged curve. If the target -point of `xc1` and the source point of `xc2` coincide; then -the source point of `xc1` and the target point of `xc2` become -the source and target points of `xc`, respectively. If the target -point of `xc2` and the source point of `xc1` coincide; then -the source point of `xc2` and the target point of `xc1` become -the source and target points of `xc`, respectively. -\pre `are_mergeable_2`(`xc1`, `xc2`) is true. -*/ -void operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, -ArrDirectionalTraits::X_monotone_curve_2 xc2, -ArrDirectionalTraits::X_monotone_curve_2& xc); +accepts two mergeable \f$ x\f$-monotone curves `xc1` and +`xc2` and asigns `xc` with the merged curve. If the target +point of `xc1` and the source point of `xc2` coincide; then +the source point of `xc1` and the target point of `xc2` become +the source and target points of `xc`, respectively. If the target +point of `xc2` and the source point of `xc1` coincide; then +the source point of `xc2` and the target point of `xc1` become +the source and target points of `xc`, respectively. +\pre `are_mergeable_2`(`xc1`, `xc2`) is true. +*/ +void operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, +ArrDirectionalTraits::X_monotone_curve_2 xc2, +ArrDirectionalTraits::X_monotone_curve_2& xc); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h index c61c498edee4..7e8499c446ce 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h @@ -5,7 +5,7 @@ namespace ArrDirectionalTraits { \cgalRefines `AdaptableUnaryFunction` -\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Split_2` +\cgalHasModel `ArrangementDirectionalXMonotoneTraits_2::Split_2` */ @@ -17,18 +17,18 @@ class Split_2 { /// @{ /*! -accepts an input curve `xc` and a split point `p` in its -interior. It splits `xc` at the split point into two subcurves -`xc1` and `xc2`, such that `p` is `xc1`'s right -endpoint and `xc2`'s left endpoint. The direction of `xc` -is preserved. That is, in case `xc` is directed from left to right, -`p` becomes `xc1`'s target and `c2`'s source; -otherwise, `p` becomes `xc2`'s target and `xc1`'s source. -*/ -void operator()(ArrDirectionalTraits::X_monotone_curve_2 xc, -ArrDirectionalTraits::Point_2 p, -ArrDirectionalTraits::X_monotone_curve_2& xc1, -ArrDirectionalTraits::X_monotone_curve_2& xc2); +accepts an input curve `xc` and a split point `p` in its +interior. It splits `xc` at the split point into two subcurves +`xc1` and `xc2`, such that `p` is `xc1`'s right +endpoint and `xc2`'s left endpoint. The direction of `xc` +is preserved. That is, in case `xc` is directed from left to right, +`p` becomes `xc1`'s target and `c2`'s source; +otherwise, `p` becomes `xc2`'s target and `xc1`'s source. +*/ +void operator()(ArrDirectionalTraits::X_monotone_curve_2 xc, +ArrDirectionalTraits::Point_2 p, +ArrDirectionalTraits::X_monotone_curve_2& xc1, +ArrDirectionalTraits::X_monotone_curve_2& xc2); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h index f660e7fdb9d3..20ef75870ff2 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h @@ -3,101 +3,101 @@ \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -This concept refines the basic arrangement \f$ x\f$-monotone traits concept. -A model of this concept is able to handle directed \f$ x\f$-monotone curves -that intersect in their interior. Namely, an instance of the -`X_monotone_curve_2` type defined by a model of the concept -`ArrangementXMonotoneTraits_2` is only required to have a left -(lexicographically smaller) endpoint and a right endpoint. -If the traits class is also a model of -`ArrangementDirectionalXMonotoneTraits_2`, the \f$ x\f$-monotone curve is -also required to have a direction, namely one of these two endpoint serves -as its source and the other as its target. - -\cgalRefines `ArrangementXMonotoneTraits_2` - -\cgalHasModel `CGAL::Arr_segment_traits_2` -\cgalHasModel `CGAL::Arr_non_caching_segment_traits_2` -\cgalHasModel `CGAL::Arr_circle_segment_traits_2` -\cgalHasModel `CGAL::Arr_conic_traits_2` -\cgalHasModel `CGAL::Arr_rational_function_traits_2` -\cgalHasModel `CGAL::Arr_Bezier_curve_traits_2` -\cgalHasModel `CGAL::Arr_algebraic_segment_traits_2` - -\sa `ArrangementXMonotoneTraits_2` +This concept refines the basic arrangement \f$ x\f$-monotone traits concept. +A model of this concept is able to handle directed \f$ x\f$-monotone curves +that intersect in their interior. Namely, an instance of the +`X_monotone_curve_2` type defined by a model of the concept +`ArrangementXMonotoneTraits_2` is only required to have a left +(lexicographically smaller) endpoint and a right endpoint. +If the traits class is also a model of +`ArrangementDirectionalXMonotoneTraits_2`, the \f$ x\f$-monotone curve is +also required to have a direction, namely one of these two endpoint serves +as its source and the other as its target. + +\cgalRefines `ArrangementXMonotoneTraits_2` + +\cgalHasModel `CGAL::Arr_segment_traits_2` +\cgalHasModel `CGAL::Arr_non_caching_segment_traits_2` +\cgalHasModel `CGAL::Arr_circle_segment_traits_2` +\cgalHasModel `CGAL::Arr_conic_traits_2` +\cgalHasModel `CGAL::Arr_rational_function_traits_2` +\cgalHasModel `CGAL::Arr_Bezier_curve_traits_2` +\cgalHasModel `CGAL::Arr_algebraic_segment_traits_2` + +\sa `ArrangementXMonotoneTraits_2` */ class ArrangementDirectionalXMonotoneTraits_2 { public: -/// \name Functor Types +/// \name Functor Types /// @{ /*! -models the concept `ArrDirectionalTraits::CompareEndpointsXy_2`. -*/ -typedef unspecified_type Compare_endpoints_xy_2; +models the concept `ArrDirectionalTraits::CompareEndpointsXy_2`. +*/ +typedef unspecified_type Compare_endpoints_xy_2; /*! -models the concept `ArrDirectionalTraits::ConstructOpposite_2`. -*/ -typedef unspecified_type Construct_opposite_2; +models the concept `ArrDirectionalTraits::ConstructOpposite_2`. +*/ +typedef unspecified_type Construct_opposite_2; /*! -models the concept `ArrDirectionalTraits::Intersect_2`. -*/ -typedef unspecified_type Intersect_2; +models the concept `ArrDirectionalTraits::Intersect_2`. +*/ +typedef unspecified_type Intersect_2; /*! -models the concept `ArrDirectionalTraits::Split_2`. -*/ -typedef unspecified_type Split_2; +models the concept `ArrDirectionalTraits::Split_2`. +*/ +typedef unspecified_type Split_2; /*! -models the concept `ArrDirectionalTraits::AreMergeable_2`. -*/ -typedef unspecified_type Are_mergeable_2; +models the concept `ArrDirectionalTraits::AreMergeable_2`. +*/ +typedef unspecified_type Are_mergeable_2; /*! -models the concept `ArrDirectionalTraits::Merge_2`. -*/ -typedef unspecified_type Merge_2; +models the concept `ArrDirectionalTraits::Merge_2`. +*/ +typedef unspecified_type Merge_2; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -ArrangementDirectionalXMonotoneTraits_2(); +default constructor. +*/ +ArrangementDirectionalXMonotoneTraits_2(); /*! -copy constructor -*/ -ArrangementDirectionalXMonotoneTraits_2(ArrangementDirectionalXMonotoneTraits_2 other); +copy constructor +*/ +ArrangementDirectionalXMonotoneTraits_2(ArrangementDirectionalXMonotoneTraits_2 other); /*! -assignment operator. -*/ -ArrangementDirectionalXMonotoneTraits_2 operator=(other); +assignment operator. +*/ +ArrangementDirectionalXMonotoneTraits_2 operator=(other); -/// @} +/// @} -/// \name Accessing Functor Objects +/// \name Accessing Functor Objects /// @{ /*! -*/ -Compare_endpoints_xy_2 compare_endpoints_xy_2_object(); +*/ +Compare_endpoints_xy_2 compare_endpoints_xy_2_object(); /*! -*/ -Construct_opposite_2 construct_opposite_2_object(); +*/ +Construct_opposite_2 construct_opposite_2_object(); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h index d437e0d4ec46..9b39e7302405 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h @@ -3,11 +3,11 @@ \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -A doubly-connected edge-list (\em Dcel for short) data-structure. It consists -of three containers of records: vertices \f$ V\f$, halfedges \f$ E\f$, and faces \f$ F\f$. -It maintains the incidence relation among them. The halfedges are ordered -in pairs sometimes referred to as twins, such that each halfedge pair -represent an edge. +A doubly-connected edge-list (\em Dcel for short) data-structure. It consists +of three containers of records: vertices \f$ V\f$, halfedges \f$ E\f$, and faces \f$ F\f$. +It maintains the incidence relation among them. The halfedges are ordered +in pairs sometimes referred to as twins, such that each halfedge pair +represent an edge. A model of the `GeneralPolygonSetDcel` simply refines `ArrangementDcel`, the `Halfedge` and `Face` types being models of the concepts @@ -16,10 +16,10 @@ respectively \cgalRefines `ArrangementDcel` -\cgalHasModel `CGAL::Gps_default_dcel` +\cgalHasModel `CGAL::Gps_default_dcel` -\sa `GeneralPolygonSetDcelFace` -\sa `GeneralPolygonSetDcelHalfedge` +\sa `GeneralPolygonSetDcelFace` +\sa `GeneralPolygonSetDcelHalfedge` */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h index 03d85e0cbca3..83fe7a4acd13 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h @@ -3,145 +3,145 @@ \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -This concept defines the minimal set of geometric predicates needed to -perform the Boolean-set operations. It refines the directional \f$ x\f$-monotone -arrangement-traits concept. In addition to the `Point_2` and -`X_monotone_curve_2` types defined in the generalized concept, it defines -a type that represents a general polygon and another one that represents -general polygon with holes. It also requires operations that operate on these -types. +This concept defines the minimal set of geometric predicates needed to +perform the Boolean-set operations. It refines the directional \f$ x\f$-monotone +arrangement-traits concept. In addition to the `Point_2` and +`X_monotone_curve_2` types defined in the generalized concept, it defines +a type that represents a general polygon and another one that represents +general polygon with holes. It also requires operations that operate on these +types. -\cgalRefines `ArrangementDirectionalXMonotoneTraits_2` +\cgalRefines `ArrangementDirectionalXMonotoneTraits_2` \cgalHasModel `CGAL::Gps_segment_traits_2` \cgalHasModel `CGAL::Gps_circle_segment_traits_2` -\cgalHasModel `CGAL::Gps_traits_2` +\cgalHasModel `CGAL::Gps_traits_2` -\sa `ArrangementDirectionalXMonotoneTraits_2` +\sa `ArrangementDirectionalXMonotoneTraits_2` */ class GeneralPolygonSetTraits_2 { public: -/// \name Types +/// \name Types /// @{ /*! -represents a general polygon. Must be a model of the `GpsTraitsGeneralPolygon_2` concept. -*/ -typedef unspecified_type Polygon_2; +represents a general polygon. Must be a model of the `GpsTraitsGeneralPolygon_2` concept. +*/ +typedef unspecified_type Polygon_2; /*! -represents a general polygon with holes. Must be a model of the `GpsTraitsGeneralPolygonWithHoles_2` concept. -*/ -typedef unspecified_type Polygon_with_holes_2; +represents a general polygon with holes. Must be a model of the `GpsTraitsGeneralPolygonWithHoles_2` concept. +*/ +typedef unspecified_type Polygon_with_holes_2; /*! -A const iterator of curves. Its value type is const -`X_monotone_curve_2`. -*/ -typedef unspecified_type Curve_const_iterator; +A const iterator of curves. Its value type is const +`X_monotone_curve_2`. +*/ +typedef unspecified_type Curve_const_iterator; -/// @} +/// @} -/// \name Functor Types +/// \name Functor Types /// @{ /*! -a functor that constructs a general polygon from a range of -\f$ x\f$-monotone curves. It uses the operator +a functor that constructs a general polygon from a range of +\f$ x\f$-monotone curves. It uses the operator -`void operator() (InputIterator begin, Input iterator end, Polygon_2 & pgn)`, +`void operator() (InputIterator begin, Input iterator end, Polygon_2 & pgn)`, -parameterized by the `InputIterator` type. -*/ -typedef unspecified_type Construct_polygon_2; +parameterized by the `InputIterator` type. +*/ +typedef unspecified_type Construct_polygon_2; /*! -a functor that constructs a general polygon with holes from a general polygon and, optionally, a range of holes. It uses the operator +a functor that constructs a general polygon with holes from a general polygon and, optionally, a range of holes. It uses the operator -`void operator() (const General_polygon_2& pgn_boundary)` or +`void operator() (const General_polygon_2& pgn_boundary)` or -`void operator() (const General_polygon_2& pgn_boundary, HolesInputIterator h_begin, HolesInputIterator h_end)` parameterized by the `HolesInputIterator` type. -*/ -typedef unspecified_type Construct_general_polygon_with_holes_2; +`void operator() (const General_polygon_2& pgn_boundary, HolesInputIterator h_begin, HolesInputIterator h_end)` parameterized by the `HolesInputIterator` type. +*/ +typedef unspecified_type Construct_general_polygon_with_holes_2; /*! -A functor for constructing the outer boundary of a polygon with holes. It uses the operator +A functor for constructing the outer boundary of a polygon with holes. It uses the operator -`General_polygon_2 operator()(const General_polygon_with_holes_2& pol_wh)`. -*/ -typedef unspecified_type Construct_outer_boundary; +`General_polygon_2 operator()(const General_polygon_with_holes_2& pol_wh)`. +*/ +typedef unspecified_type Construct_outer_boundary; /*! -A functor for constructing the container of holes of a polygon with holes. It returns the begin/end iterators for the holes It uses the operator +A functor for constructing the container of holes of a polygon with holes. It returns the begin/end iterators for the holes It uses the operator -`std::pair operator()(const General_polygon_with_holes_2& pol_wh)`. -*/ -typedef unspecified_type Construct_holes; +`std::pair operator()(const General_polygon_with_holes_2& pol_wh)`. +*/ +typedef unspecified_type Construct_holes; /*! -A functor for checking if polygon with holes has no outer boundary. It uses the operator +A functor for checking if polygon with holes has no outer boundary. It uses the operator -`bool operator()(const General_polygon_with_holes_2& pol_wh)`. -*/ -typedef unspecified_type Is_unbounded; +`bool operator()(const General_polygon_with_holes_2& pol_wh)`. +*/ +typedef unspecified_type Is_unbounded; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -GeneralPolygonSetTraits_2(); +default constructor. +*/ +GeneralPolygonSetTraits_2(); /*! -copy constructor -*/ -GeneralPolygonSetTraits_2(GeneralPolygonSetTraits_2 other); +copy constructor +*/ +GeneralPolygonSetTraits_2(GeneralPolygonSetTraits_2 other); /*! -assignment operator. -*/ -GeneralPolygonSetTraits_2 operator=(other); +assignment operator. +*/ +GeneralPolygonSetTraits_2 operator=(other); -/// @} +/// @} -/// \name Accessing Functor Objects +/// \name Accessing Functor Objects /// @{ /*! -returns a functor that constructs a polygon. -*/ -Construct_polygon_2 construct_polygon_2_object(); +returns a functor that constructs a polygon. +*/ +Construct_polygon_2 construct_polygon_2_object(); /*! -returns a functor that obtains the curves of a polygon. -*/ -Construct_curves_2 construct_curves_2_object(); +returns a functor that obtains the curves of a polygon. +*/ +Construct_curves_2 construct_curves_2_object(); /*! -returns a functor that constructs a polygon with holes. -*/ -Construct_general_polygon_with_holes_2 construct_polygon_with_holes_2_object() const; +returns a functor that constructs a polygon with holes. +*/ +Construct_general_polygon_with_holes_2 construct_polygon_with_holes_2_object() const; /*! -returns a functor that obtains the outer boundary of a polygon with holes. -*/ -Construct_outer_boundary construct_outer_boundary_object() const; +returns a functor that obtains the outer boundary of a polygon with holes. +*/ +Construct_outer_boundary construct_outer_boundary_object() const; /*! -returns a functor that obtains begin/end iterators over a container of holes. -*/ -Construct_holes construct_holes_object() const; +returns a functor that obtains begin/end iterators over a container of holes. +*/ +Construct_holes construct_holes_object() const; /*! -returns a functor that determines if the polygon with holes is unbounded -*/ -Is_unbounded construct_is_unbounded_object(); +returns a functor that determines if the polygon with holes is unbounded +*/ +Is_unbounded construct_is_unbounded_object(); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygon_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygon_2.h index afb592934f1b..0966bde729b8 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygon_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygon_2.h @@ -3,110 +3,110 @@ \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -\cgalRefines `GpsTraitsGeneralPolygon_2` +\cgalRefines `GpsTraitsGeneralPolygon_2` -A model of this concept represents a simple general-polygon. The -geometric mapping of the edges of the polygon must be \f$ x\f$-monotone curves. -The concept requires the ability to access these curves. -The general polygon represented must be simple. That is, the -only points of the plane belonging to two curves are the geometric mapping -of the polygon vertices. In addition, the vertices of the represented -polygon must be ordered consistently, and the curved must be directed -accordingly. Only counterclockwise oriented polygons are valid operands -of Boolean set-operations. General polygon that represent holes must be -clockwise oriented. +A model of this concept represents a simple general-polygon. The +geometric mapping of the edges of the polygon must be \f$ x\f$-monotone curves. +The concept requires the ability to access these curves. +The general polygon represented must be simple. That is, the +only points of the plane belonging to two curves are the geometric mapping +of the polygon vertices. In addition, the vertices of the represented +polygon must be ordered consistently, and the curved must be directed +accordingly. Only counterclockwise oriented polygons are valid operands +of Boolean set-operations. General polygon that represent holes must be +clockwise oriented. -\cgalHasModel `CGAL::General_polygon_2` +\cgalHasModel `CGAL::General_polygon_2` */ class GeneralPolygon_2 { public: -/// \name Types +/// \name Types /// @{ /*! -represents a planar (weakly) \f$ x\f$-monotone -curve. The type of the geometric mapping of the polygonal edges. It must model the concept ArrTraits::XMonotoneCurve_2. -*/ -typedef unspecified_type X_monotone_curve_2; +represents a planar (weakly) \f$ x\f$-monotone +curve. The type of the geometric mapping of the polygonal edges. It must model the concept ArrTraits::XMonotoneCurve_2. +*/ +typedef unspecified_type X_monotone_curve_2; /*! -an iterator over the geometric mapping of the -polygon edges. Its value type is `X_monotone_curve_2`. -*/ -typedef unspecified_type Curve_iterator; +an iterator over the geometric mapping of the +polygon edges. Its value type is `X_monotone_curve_2`. +*/ +typedef unspecified_type Curve_iterator; /*! -a const iterator over the geometric -mapping of the polygon edges. Its value type is `X_monotone_curve_2`. -*/ -typedef unspecified_type Curve_const_iterator; +a const iterator over the geometric +mapping of the polygon edges. Its value type is `X_monotone_curve_2`. +*/ +typedef unspecified_type Curve_const_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// @{ /*! -default constructor. -*/ -GeneralPolygon_2(); +default constructor. +*/ +GeneralPolygon_2(); /*! -copy constructor. -*/ -GeneralPolygon_2(GeneralPolygon_2 other); +copy constructor. +*/ +GeneralPolygon_2(GeneralPolygon_2 other); /*! -assignment operator. -*/ -GeneralPolygon_2 operator=(other); +assignment operator. +*/ +GeneralPolygon_2 operator=(other); /*! -constructs a general polygon from a given range of curves. -*/ -template -GeneralPolygon_2(InputIterator begin, InputIterator end); +constructs a general polygon from a given range of curves. +*/ +template +GeneralPolygon_2(InputIterator begin, InputIterator end); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// @{ /*! -returns the begin iterator of the curves. -*/ -Curve_iterator curves_begin(); +returns the begin iterator of the curves. +*/ +Curve_iterator curves_begin(); /*! -returns the past-the-end iterator of the curves. -*/ -Curve_iterator curves_end(); +returns the past-the-end iterator of the curves. +*/ +Curve_iterator curves_end(); /*! -returns the begin const iterator of the curves. -*/ -Curve_const_iterator curves_begin(); +returns the begin const iterator of the curves. +*/ +Curve_const_iterator curves_begin(); /*! -returns the past-the-end const iterator of the curves. -*/ -Curve_const_iterator curves_end(); +returns the past-the-end const iterator of the curves. +*/ +Curve_const_iterator curves_end(); -/// @} +/// @} -/// \name Modifiers +/// \name Modifiers /// @{ /*! -initializes the polygon with the polygonal chain given by the range. -The value type of `Iterator` must be `X_monotone_curve_2`. -\pre The curves in the range must define a simple polygon. -*/ -template -void init(Iterator begin, Iterator end); +initializes the polygon with the polygonal chain given by the range. +The value type of `Iterator` must be `X_monotone_curve_2`. +\pre The curves in the range must define a simple polygon. +*/ +template +void init(Iterator begin, Iterator end); /// @} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygonWithHoles_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygonWithHoles_2.h index 9a96a1d366c2..729c28a35e9b 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygonWithHoles_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygonWithHoles_2.h @@ -3,17 +3,17 @@ \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -A model of this concept represents a general polygon with holes. +A model of this concept represents a general polygon with holes. \cgalRefines `DefaultConstructible` \cgalRefines `CopyConstructible` \cgalRefines `Assignable` -\cgalGeneralizes `GeneralPolygonWithHoles_2` +\cgalGeneralizes `GeneralPolygonWithHoles_2` -\cgalHasModel `GeneralPolygonSetTraits_2::Polygon_with_holes2` +\cgalHasModel `GeneralPolygonSetTraits_2::Polygon_with_holes2` -\sa `GeneralPolygonWithHoles_2` +\sa `GeneralPolygonWithHoles_2` */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygon_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygon_2.h index 98bf1ab16b26..7fb8ac367658 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygon_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GpsTraitsGeneralPolygon_2.h @@ -3,18 +3,18 @@ \ingroup PkgBooleanSetOperations2Concepts \cgalConcept -A model of this concept represents a simple general polygon. +A model of this concept represents a simple general polygon. \cgalRefines `DefaultConstructible` \cgalRefines `CopyConstructible` \cgalRefines `Assignable` -\cgalGeneralizes `GeneralPolygon_2` +\cgalGeneralizes `GeneralPolygon_2` -\cgalHasModel `GeneralPolygonSetTraits_2::Polygon_2` -\cgalHasModel `CGAL::Polygon_2` +\cgalHasModel `GeneralPolygonSetTraits_2::Polygon_2` +\cgalHasModel `CGAL::Polygon_2` -\sa `GeneralPolygon_2` +\sa `GeneralPolygon_2` */ diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt index e96e127c29fa..f3a59f956410 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt @@ -19,8 +19,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter.cpp index 0758aff7fe08..5d0fbe222574 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter.cpp @@ -30,7 +30,7 @@ typedef CGAL::Cartesian Rat_kernel; typedef CGAL::Cartesian Alg_kernel; typedef CGAL::Arr_Bezier_curve_traits_2 Traits_2; - + typedef Rat_kernel::Point_2 Rat_point_2; typedef Traits_2::Curve_2 Bezier_curve_2; typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; @@ -49,7 +49,7 @@ bool read_Bezier_polygon(const char* filename, Polygon_with_holes_2& P) if (! in_file.is_open()) return false; - + // Read the number of curves. unsigned int n_curves; unsigned int k; @@ -76,12 +76,12 @@ bool read_Bezier_polygon(const char* filename, Polygon_with_holes_2& P) in_file >> B; mk_x_monotone(B, std::back_inserter(x_objs)); - + for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) { if (CGAL::assign(xcv, *xoit)) xcvs.push_back(xcv); } - + // Check if the current curve closes a polygon, namely whether it target // point (the last control point) equals the source of the first curve in // the current chain. @@ -92,11 +92,11 @@ bool read_Bezier_polygon(const char* filename, Polygon_with_holes_2& P) // and clockwise oriented if it represents a hole. Polygon_2 pgn(xcvs.begin(), xcvs.end()); CGAL::Orientation orient = pgn.orientation(); - + if ((pgns.empty() && (orient == CGAL::CLOCKWISE)) || (! pgns.empty() && (orient == CGAL::COUNTERCLOCKWISE))) pgn.reverse_orientation(); - + pgns.push_back(pgn); xcvs.clear(); first = true; @@ -114,7 +114,7 @@ bool read_Bezier_polygon(const char* filename, Polygon_with_holes_2& P) // Construct the polygon with holes. std::list::iterator pit = pgns.begin(); - + ++pit; P = Polygon_with_holes_2(pgns.front(), pit, pgns.end()); @@ -146,9 +146,9 @@ int main(int argc, char* argv[]) } timer.stop(); - std::cout << "Constructed the input polygons in " << timer.time() + std::cout << "Constructed the input polygons in " << timer.time() << " seconds." << std::endl << std::endl; - + // Compute the intersection of the two polygons. Polygon_set R; Polygon_set::const_iterator rit; @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) timer.start(); CGAL::intersection(P1, P2, std::back_inserter(R)); timer.stop(); - + std::cout << "The intersection polygons are of sizes: {"; for (rit = R.begin(); rit != R.end(); ++rit) std::cout << ' ' << rit->outer_boundary().size(); diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/connect_polygon.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/connect_polygon.cpp index 9f38405097ed..7b5e83caf0a3 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/connect_polygon.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/connect_polygon.cpp @@ -13,12 +13,12 @@ typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; int main (int argc, char* argv[]) { - + // Get the name of the input file from the command line, or use the default // pgn_holes.dat file if no command-line parameters are given. //more data files can be found under test data - //boundary no other connections are made. - const char* filename = (argc > 1) ? argv[1] : "pgn_holes.dat"; + //boundary no other connections are made. + const char* filename = (argc > 1) ? argv[1] : "pgn_holes.dat"; std::ifstream input_file (filename); if (! input_file.is_open()) { diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h index a35b129b679a..6d96107a4439 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ron Wein @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -37,14 +37,14 @@ namespace CGAL { //@{ template -inline bool do_intersect(const Polygon_2& pgn1, +inline bool do_intersect(const Polygon_2& pgn1, const Polygon_2& pgn2) { return (_do_intersect(pgn1, pgn2)); } template -inline bool do_intersect(const Polygon_2& pgn1, +inline bool do_intersect(const Polygon_2& pgn1, const Polygon_2& pgn2, Traits& tr) { @@ -52,14 +52,14 @@ inline bool do_intersect(const Polygon_2& pgn1, } template -inline bool do_intersect(const Polygon_2& pgn1, +inline bool do_intersect(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2) { return (_do_intersect(pgn1, pgn2)); } template -inline bool do_intersect(const Polygon_2& pgn1, +inline bool do_intersect(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, Traits& tr) { @@ -97,14 +97,14 @@ inline bool do_intersect(const Polygon_with_holes_2& pgn1, } template -inline bool do_intersect(const General_polygon_2& pgn1, +inline bool do_intersect(const General_polygon_2& pgn1, const General_polygon_2& pgn2) { return (_do_intersect(pgn1, pgn2)); } template -inline bool do_intersect(const General_polygon_2& pgn1, +inline bool do_intersect(const General_polygon_2& pgn1, const General_polygon_2& pgn2, Gps_traits& tr) { @@ -112,7 +112,7 @@ inline bool do_intersect(const General_polygon_2& pgn1, } template -inline bool do_intersect(const General_polygon_2& pgn1, +inline bool do_intersect(const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2) { @@ -120,7 +120,7 @@ inline bool do_intersect(const General_polygon_2& pgn1, } template -inline bool do_intersect(const General_polygon_2& pgn1, +inline bool do_intersect(const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, Gps_traits& tr) @@ -167,7 +167,7 @@ inline bool do_intersect(const General_polygon_with_holes_2& pgn1, //@{ template -inline OutputIterator intersection(const Polygon_2& pgn1, +inline OutputIterator intersection(const Polygon_2& pgn1, const Polygon_2& pgn2, OutputIterator out) { @@ -175,7 +175,7 @@ inline OutputIterator intersection(const Polygon_2& pgn1, } template -inline OutputIterator intersection(const Polygon_2& pgn1, +inline OutputIterator intersection(const Polygon_2& pgn1, const Polygon_2& pgn2, OutputIterator out, Traits& tr) @@ -184,7 +184,7 @@ inline OutputIterator intersection(const Polygon_2& pgn1, } template -inline OutputIterator intersection(const Polygon_2& pgn1, +inline OutputIterator intersection(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator out) { @@ -193,7 +193,7 @@ inline OutputIterator intersection(const Polygon_2& pgn1, template inline OutputIterator -intersection (const Polygon_2& pgn1, +intersection (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator out, Traits& tr) { @@ -219,7 +219,7 @@ intersection (const Polygon_with_holes_2& pgn1, } template -inline OutputIterator +inline OutputIterator intersection (const Polygon_with_holes_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator out) @@ -238,7 +238,7 @@ intersection (const Polygon_with_holes_2& pgn1, } template -inline OutputIterator intersection (const General_polygon_2& pgn1, +inline OutputIterator intersection (const General_polygon_2& pgn1, const General_polygon_2& pgn2, OutputIterator out) { @@ -246,7 +246,7 @@ inline OutputIterator intersection (const General_polygon_2& pgn1, } template -inline OutputIterator intersection (const General_polygon_2& pgn1, +inline OutputIterator intersection (const General_polygon_2& pgn1, const General_polygon_2& pgn2, OutputIterator out, Traits& tr) @@ -256,7 +256,7 @@ inline OutputIterator intersection (const General_polygon_2& pgn1, template inline OutputIterator -intersection (const General_polygon_2& pgn1, +intersection (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, OutputIterator out) @@ -266,7 +266,7 @@ intersection (const General_polygon_2& pgn1, template inline OutputIterator -intersection (const General_polygon_2& pgn1, +intersection (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, OutputIterator out, Traits& tr) @@ -317,7 +317,7 @@ intersection (const General_polygon_with_holes_2& pgn1, //@{ template -inline bool join (const Polygon_2& pgn1, +inline bool join (const Polygon_2& pgn1, const Polygon_2& pgn2, Polygon_with_holes_2& res) { @@ -325,7 +325,7 @@ inline bool join (const Polygon_2& pgn1, } template -inline bool join (const Polygon_2& pgn1, +inline bool join (const Polygon_2& pgn1, const Polygon_2& pgn2, Polygon_with_holes_2& res, Traits& tr) { @@ -333,7 +333,7 @@ inline bool join (const Polygon_2& pgn1, } template -inline bool join (const Polygon_2& pgn1, +inline bool join (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, Polygon_with_holes_2& res) { @@ -341,7 +341,7 @@ inline bool join (const Polygon_2& pgn1, } template -inline bool join (const Polygon_2& pgn1, +inline bool join (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, Polygon_with_holes_2& res, Traits& tr) { @@ -381,8 +381,8 @@ inline bool join (const Polygon_with_holes_2& pgn1, } template -inline bool -join (const General_polygon_2& pgn1, +inline bool +join (const General_polygon_2& pgn1, const General_polygon_2& pgn2, General_polygon_with_holes_2 >& res) { @@ -391,7 +391,7 @@ join (const General_polygon_2& pgn1, template inline bool -join (const General_polygon_2& pgn1, +join (const General_polygon_2& pgn1, const General_polygon_2& pgn2, General_polygon_with_holes_2 >& res, Traits& tr) @@ -401,7 +401,7 @@ join (const General_polygon_2& pgn1, template inline bool -join (const General_polygon_2& pgn1, +join (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, General_polygon_with_holes_2 >& res) { @@ -410,7 +410,7 @@ join (const General_polygon_2& pgn1, template inline bool -join (const General_polygon_2& pgn1, +join (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, General_polygon_with_holes_2 >& res, Traits& tr) @@ -458,7 +458,7 @@ inline bool join (const General_polygon_with_holes_2& pgn1, //@{ template -inline OutputIterator difference (const Polygon_2& pgn1, +inline OutputIterator difference (const Polygon_2& pgn1, const Polygon_2& pgn2, OutputIterator oi) { @@ -466,7 +466,7 @@ inline OutputIterator difference (const Polygon_2& pgn1, } template -inline OutputIterator difference (const Polygon_2& pgn1, +inline OutputIterator difference (const Polygon_2& pgn1, const Polygon_2& pgn2, OutputIterator oi, Traits& tr) { @@ -475,7 +475,7 @@ inline OutputIterator difference (const Polygon_2& pgn1, template inline OutputIterator -difference (const Polygon_2& pgn1, +difference (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator oi) { @@ -484,7 +484,7 @@ difference (const Polygon_2& pgn1, template inline OutputIterator -difference (const Polygon_2& pgn1, +difference (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator oi, Traits& tr) { @@ -529,7 +529,7 @@ difference (const Polygon_with_holes_2& pgn1, } template -inline OutputIterator difference (const General_polygon_2& pgn1, +inline OutputIterator difference (const General_polygon_2& pgn1, const General_polygon_2& pgn2, OutputIterator oi) { @@ -537,7 +537,7 @@ inline OutputIterator difference (const General_polygon_2& pgn1, } template -inline OutputIterator difference (const General_polygon_2& pgn1, +inline OutputIterator difference (const General_polygon_2& pgn1, const General_polygon_2& pgn2, OutputIterator oi, Traits& tr) @@ -546,7 +546,7 @@ inline OutputIterator difference (const General_polygon_2& pgn1, } template -inline OutputIterator difference (const General_polygon_2& pgn1, +inline OutputIterator difference (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, OutputIterator oi) @@ -555,7 +555,7 @@ inline OutputIterator difference (const General_polygon_2& pgn1, } template -inline OutputIterator difference (const General_polygon_2& pgn1, +inline OutputIterator difference (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, OutputIterator oi, Traits& tr) @@ -605,7 +605,7 @@ difference (const General_polygon_with_holes_2& pgn1, template inline OutputIterator -symmetric_difference (const Polygon_2& pgn1, +symmetric_difference (const Polygon_2& pgn1, const Polygon_2& pgn2, OutputIterator oi, Traits& tr) { @@ -614,7 +614,7 @@ symmetric_difference (const Polygon_2& pgn1, template inline OutputIterator -symmetric_difference (const Polygon_2& pgn1, +symmetric_difference (const Polygon_2& pgn1, const Polygon_2& pgn2, OutputIterator oi) { @@ -623,7 +623,7 @@ symmetric_difference (const Polygon_2& pgn1, template inline OutputIterator -symmetric_difference (const Polygon_2& pgn1, +symmetric_difference (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator oi, Traits& tr) { @@ -633,7 +633,7 @@ symmetric_difference (const Polygon_2& pgn1, template inline OutputIterator -symmetric_difference (const Polygon_2& pgn1, +symmetric_difference (const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, OutputIterator oi) { @@ -677,8 +677,8 @@ symmetric_difference (const Polygon_with_holes_2& pgn1, } template -inline OutputIterator -symmetric_difference (const General_polygon_2& pgn1, +inline OutputIterator +symmetric_difference (const General_polygon_2& pgn1, const General_polygon_2& pgn2, OutputIterator oi, Traits& tr) @@ -687,8 +687,8 @@ symmetric_difference (const General_polygon_2& pgn1, } template -inline OutputIterator -symmetric_difference (const General_polygon_2& pgn1, +inline OutputIterator +symmetric_difference (const General_polygon_2& pgn1, const General_polygon_2& pgn2, OutputIterator oi) { @@ -696,8 +696,8 @@ symmetric_difference (const General_polygon_2& pgn1, } template -inline OutputIterator -symmetric_difference (const General_polygon_2& pgn1, +inline OutputIterator +symmetric_difference (const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, OutputIterator oi, Traits& tr) @@ -706,8 +706,8 @@ symmetric_difference (const General_polygon_2& pgn1, } template -inline OutputIterator -symmetric_difference(const General_polygon_2& pgn1, +inline OutputIterator +symmetric_difference(const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, OutputIterator oi) @@ -746,7 +746,7 @@ symmetric_difference (const General_polygon_with_holes_2& pgn1, } template -inline OutputIterator +inline OutputIterator symmetric_difference (const General_polygon_with_holes_2& pgn1, const General_polygon_with_holes_2& pgn2, OutputIterator oi) @@ -924,7 +924,7 @@ inline OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, General_polygon_set_2 gps(*begin1); gps.intersection(++begin1, end1, begin2, end2, k); return (gps.polygons_with_holes(oi)); - + } template -inline Oriented_side oriented_side(const Polygon_2& pgn1, +inline Oriented_side oriented_side(const Polygon_2& pgn1, const Polygon_2& pgn2) { return (_oriented_side(pgn1, pgn2)); } template -inline Oriented_side oriented_side(const Polygon_2& pgn1, +inline Oriented_side oriented_side(const Polygon_2& pgn1, const Polygon_2& pgn2, Traits& tr) { @@ -1062,7 +1062,7 @@ inline Oriented_side oriented_side(const Polygon_2& pgn1, template inline -Oriented_side oriented_side(const Polygon_2& pgn1, +Oriented_side oriented_side(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2) { return (_oriented_side(pgn1, pgn2)); @@ -1070,7 +1070,7 @@ Oriented_side oriented_side(const Polygon_2& pgn1, template inline -Oriented_side oriented_side(const Polygon_2& pgn1, +Oriented_side oriented_side(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, Traits& tr) { @@ -1112,14 +1112,14 @@ Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, } template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, +inline Oriented_side oriented_side(const General_polygon_2& pgn1, const General_polygon_2& pgn2) { return (_oriented_side(pgn1, pgn2)); } template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, +inline Oriented_side oriented_side(const General_polygon_2& pgn1, const General_polygon_2& pgn2, Gps_traits& tr) { @@ -1127,7 +1127,7 @@ inline Oriented_side oriented_side(const General_polygon_2& pgn1, } template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, +inline Oriented_side oriented_side(const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2) { @@ -1135,7 +1135,7 @@ inline Oriented_side oriented_side(const General_polygon_2& pgn1, } template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, +inline Oriented_side oriented_side(const General_polygon_2& pgn1, const General_polygon_with_holes_2 >& pgn2, Gps_traits& tr) @@ -1182,14 +1182,14 @@ Oriented_side oriented_side(const General_polygon_with_holes_2& pgn1, // Point Query: template -inline Oriented_side oriented_side(const typename Kernel::Point_2& p, +inline Oriented_side oriented_side(const typename Kernel::Point_2& p, const Polygon_2& pgn) { return (_oriented_side(p, pgn)); } template -inline Oriented_side oriented_side(const typename Kernel::Point_2& p, +inline Oriented_side oriented_side(const typename Kernel::Point_2& p, const Polygon_2& pgn, Traits& tr) { @@ -1198,7 +1198,7 @@ inline Oriented_side oriented_side(const typename Kernel::Point_2& p, template inline -Oriented_side oriented_side(const typename Kernel::Point_2& p, +Oriented_side oriented_side(const typename Kernel::Point_2& p, const Polygon_with_holes_2& pgn) { return (_oriented_side(p, pgn)); @@ -1206,7 +1206,7 @@ Oriented_side oriented_side(const typename Kernel::Point_2& p, template inline -Oriented_side oriented_side(const typename Kernel::Point_2& p, +Oriented_side oriented_side(const typename Kernel::Point_2& p, const Polygon_with_holes_2& pgn, Traits& tr) { @@ -1214,14 +1214,14 @@ Oriented_side oriented_side(const typename Kernel::Point_2& p, } template -inline Oriented_side oriented_side(const typename Arr_traits::Point_2& p, +inline Oriented_side oriented_side(const typename Arr_traits::Point_2& p, const General_polygon_2& pgn) { return (_oriented_side(p, pgn)); } template -inline Oriented_side oriented_side(const typename Arr_traits::Point_2& p, +inline Oriented_side oriented_side(const typename Arr_traits::Point_2& p, const General_polygon_2& pgn, Gps_traits& tr) { diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Bso_internal_functions.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Bso_internal_functions.h index 9b15f31789c5..dd7fd28b3987 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Bso_internal_functions.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Bso_internal_functions.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ron Wein @@ -88,7 +88,7 @@ inline OutputIterator _intersection(const Pgn1& pgn1, const Pgn2& pgn2, //@{ template -inline bool _is_empty (const typename Traits:: Polygon_2& pgn, Traits& tr) +inline bool _is_empty (const typename Traits:: Polygon_2& pgn, Traits& tr) { typedef typename Traits::Curve_const_iterator Curve_const_iterator; const std::pair& itr_pair = diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Ccb_curve_iterator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Ccb_curve_iterator.h index da3538f6f28c..210aadd73483 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Ccb_curve_iterator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Ccb_curve_iterator.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -89,12 +89,12 @@ namespace CGAL { Self& operator++ () { CGAL_assertion(!_done); - + --_circ; if (_circ == _first) _done = true; - + return (*this); } diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Curve_with_halfedge.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Curve_with_halfedge.h index a46d5827b9a3..3e482094838e 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Curve_with_halfedge.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Curve_with_halfedge.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -24,7 +24,7 @@ class Curve_with_halfedge protected: typedef typename Arrangement_::Halfedge_handle Halfedge_handle; typedef typename Arrangement_::Halfedge_const_handle Halfedge_const_handle; - + public: Halfedge_handle m_he; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_base_functor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_base_functor.h index d2ae075dfd36..0580ace00be5 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_base_functor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_base_functor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -33,7 +33,7 @@ class Gps_base_functor typedef typename Arrangement_2::Face_handle Face_handle; typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; typedef typename Arrangement_2::Vertex_handle Vertex_handle; - + void create_face (Face_const_handle , diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_base_visitor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_base_visitor.h index 0e2791129795..4bb4803f0893 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_base_visitor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_base_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ophir Setter @@ -17,7 +17,7 @@ #include -#include +#include namespace CGAL { @@ -47,7 +47,7 @@ class Gps_bfs_base_visitor Gps_bfs_base_visitor(Edges_hash* edges_hash, Faces_hash* faces_hash, - unsigned int n_pgn): + unsigned int n_pgn): m_edges_hash(edges_hash), m_faces_hash(faces_hash), m_num_of_polygons(n_pgn) @@ -55,15 +55,15 @@ class Gps_bfs_base_visitor //! discovered_face -/*! discovered_face is called by Gps_bfs_scanner when it reveals a new face - during a BFS scan. In the BFS traversal we are going from old_face to +/*! discovered_face is called by Gps_bfs_scanner when it reveals a new face + during a BFS scan. In the BFS traversal we are going from old_face to new_face throught the half-edge he. \param old_face The face that was already revealed \param new_face The face that we have just now revealed \param he The half-edge that is used to traverse between them. */ - void discovered_face(Face_iterator old_face, - Face_iterator new_face, + void discovered_face(Face_iterator old_face, + Face_iterator new_face, Halfedge_iterator he) { unsigned int ic = compute_ic(old_face, new_face, he); @@ -83,18 +83,18 @@ class Gps_bfs_base_visitor protected: // compute the inside count of a face - unsigned int compute_ic(Face_iterator f1, - Face_iterator f2, + unsigned int compute_ic(Face_iterator f1, + Face_iterator f2, Halfedge_iterator he) { - CGAL_assertion(m_edges_hash->is_defined(he) && + CGAL_assertion(m_edges_hash->is_defined(he) && m_edges_hash->is_defined(he->twin()) && m_faces_hash->is_defined(f1) && !m_faces_hash->is_defined(f2)); - unsigned int ic_f2 = + unsigned int ic_f2 = (*m_faces_hash)[f1] - (*m_edges_hash)[he] + (*m_edges_hash)[he->twin()]; (*m_faces_hash)[f2] = ic_f2; - + return (ic_f2); } }; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_intersection_visitor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_intersection_visitor.h index 55228a5677db..cb624debf2c6 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_intersection_visitor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_intersection_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -24,7 +24,7 @@ namespace CGAL { template -class Gps_bfs_intersection_visitor : +class Gps_bfs_intersection_visitor : public Gps_bfs_base_visitor > { typedef Arrangement_ Arrangement; @@ -34,19 +34,19 @@ public Gps_bfs_base_visitor Base; typedef typename Base::Edges_hash Edges_hash; typedef typename Base::Faces_hash Faces_hash; - + public: Gps_bfs_intersection_visitor(Edges_hash* edges_hash, Faces_hash* faces_hash, - unsigned int n_polygons): + unsigned int n_polygons): Base(edges_hash, faces_hash, n_polygons) {} //! contained_criteria -/*! contained_criteria is used to the determine if the face which has +/*! contained_criteria is used to the determine if the face which has inside count should be marked as contained. \param ic the inner count of the talked-about face. \return true if the face of ic, otherwise false. diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_join_visitor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_join_visitor.h index 60f5b01a901a..3d81533d19f8 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_join_visitor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_join_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ophir Setter @@ -22,7 +22,7 @@ namespace CGAL { template -class Gps_bfs_join_visitor : +class Gps_bfs_join_visitor : public Gps_bfs_base_visitor > { typedef Arrangement_ Arrangement; @@ -35,12 +35,12 @@ public Gps_bfs_base_visitor > public: - Gps_bfs_join_visitor(Edges_hash* edges_hash, Faces_hash* faces_hash, unsigned int n_pgn): + Gps_bfs_join_visitor(Edges_hash* edges_hash, Faces_hash* faces_hash, unsigned int n_pgn): Base(edges_hash, faces_hash, n_pgn) {} //! contained_criteria -/*! contained_criteria is used to the determine if the face which has +/*! contained_criteria is used to the determine if the face which has inside count should be marked as contained. \param ic the inner count of the talked-about face. \return true if the face of ic, otherwise false. diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_scanner.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_scanner.h index f943e02a3410..5a17a822acc2 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_scanner.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_scanner.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ophir Setter @@ -28,11 +28,11 @@ class Gps_bfs_scanner typedef Arrangement_ Arrangement; typedef typename Arrangement::Inner_ccb_iterator Inner_ccb_iterator; - typedef typename Arrangement::Ccb_halfedge_circulator + typedef typename Arrangement::Ccb_halfedge_circulator Ccb_halfedge_circulator; typedef typename Arrangement::Face_iterator Face_iterator; typedef typename Arrangement::Halfedge_iterator Halfedge_iterator; - + typedef Visitor_ Visitor; protected: @@ -57,7 +57,7 @@ class Gps_bfs_scanner ubf->set_visited(true); push_to_queue_holes_of_face(ubf); - + while(!m_holes.empty()) { Inner_ccb_iterator hole = m_holes.front(); @@ -82,7 +82,7 @@ class Gps_bfs_scanner { Ccb_halfedge_circulator ccb_circ = ccb; Ccb_halfedge_circulator ccb_end = ccb; - Face_iterator new_f; + Face_iterator new_f; do { Halfedge_iterator he = ccb_circ; @@ -91,8 +91,8 @@ class Gps_bfs_scanner { push_to_queue_holes_of_face(he->twin()->face()); new_f->set_visited(true); - m_visitor->discovered_face(he->face(), new_f, he); - + m_visitor->discovered_face(he->face(), new_f, he); + //scan(he->twin()); m_ccb_stack.push(he->twin()); } @@ -101,10 +101,10 @@ class Gps_bfs_scanner while(ccb_circ != ccb_end); } - + void push_to_queue_holes_of_face(Face_iterator f) { - for(Inner_ccb_iterator hit = f->inner_ccbs_begin(); + for(Inner_ccb_iterator hit = f->inner_ccbs_begin(); hit!= f->inner_ccbs_end(); ++hit) { m_holes.push(hit); diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_xor_visitor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_xor_visitor.h index a2f63db70486..5c35964139b0 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_xor_visitor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_bfs_xor_visitor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ophir Setter @@ -22,7 +22,7 @@ namespace CGAL { template -class Gps_bfs_xor_visitor : +class Gps_bfs_xor_visitor : public Gps_bfs_base_visitor > { typedef Arrangement_ Arrangement; @@ -35,13 +35,13 @@ public Gps_bfs_base_visitor > public: - Gps_bfs_xor_visitor(Edges_hash* edges_hash, Faces_hash* faces_hash, + Gps_bfs_xor_visitor(Edges_hash* edges_hash, Faces_hash* faces_hash, unsigned int n_pgn) : Base(edges_hash, faces_hash, n_pgn) {} //! contained_criteria -/*! contained_criteria is used to the determine if the face which has +/*! contained_criteria is used to the determine if the face which has inside count should be marked as contained. \param ic the inner count of the talked-about face. \return true if the face of ic, otherwise false. @@ -54,8 +54,8 @@ public Gps_bfs_base_visitor > //! after_scan post-processing after bfs scan. /*! The function fixes some of the curves, to be in the same direction as the - half-edges. - + half-edges. + \param arr The given arrangment. */ void after_scan(Arrangement& arr) @@ -78,11 +78,11 @@ public Gps_bfs_base_visitor > Halfedge_iterator he = eit; const X_monotone_curve_2& cv = he->curve(); const bool is_cont = he->face()->contained(); - const Comparison_result he_res = + const Comparison_result he_res = ((Arr_halfedge_direction)he->direction() == ARR_LEFT_TO_RIGHT) ? SMALLER : LARGER; const bool has_same_dir = (cmp_endpoints(cv) == he_res); - + if ((is_cont && !has_same_dir) || (!is_cont && has_same_dir)) arr.modify_edge(he, ctr_opp(cv)); } diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h index 4738fe4502c6..250f303dcfed 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Efi Fogel @@ -76,7 +76,7 @@ class Gps_face_base : public Arr_face_base const Gps_face_base & ex_f = static_cast(f); m_info = ex_f.m_info; } - + bool contained() const { return (m_info & CONTAINED) != 0; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_traits.h index cf82b237ad55..66eeaa4e64ce 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_difference_functor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_difference_functor.h index c9ef3a79a945..6149407250dc 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_difference_functor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_difference_functor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -28,7 +28,7 @@ class Gps_difference_functor : public Gps_base_functor typedef typename Arrangement_2::Face_const_handle Face_const_handle; typedef typename Arrangement_2::Face_handle Face_handle; - + void create_face (Face_const_handle f1, diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_do_intersect_functor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_do_intersect_functor.h index 934d67ff0643..d110a8e30f45 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_do_intersect_functor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_do_intersect_functor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -19,7 +19,7 @@ namespace CGAL { template -class Gps_do_intersect_functor +class Gps_do_intersect_functor { public: @@ -45,7 +45,7 @@ class Gps_do_intersect_functor { if(f1->contained() && f2->contained()) // found intersection - m_found_reg_intersection = true; + m_found_reg_intersection = true; } diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_insertion_meta_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_insertion_meta_traits.h index 666cf328c88c..2c1557a26197 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_insertion_meta_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_insertion_meta_traits.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -23,7 +23,7 @@ namespace CGAL { template -class Gps_insertion_meta_traits : +class Gps_insertion_meta_traits : public Gps_traits_decorator, Point_with_vertex > @@ -34,8 +34,8 @@ class Gps_insertion_meta_traits : Curve_with_halfedge, Point_with_vertex > Base; - typedef typename Base::Point_2 Point_2; - typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Base::Point_2 Point_2; + typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; typedef typename Base::Curve_data Curve_data; typedef typename Base::Point_data Point_data; typedef typename Base_traits::Construct_min_vertex_2 diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_intersection_functor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_intersection_functor.h index 837adc88f830..a57cf18fa670 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_intersection_functor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_intersection_functor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_join_functor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_join_functor.h index 9e471a18029a..bc834653a2a3 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_join_functor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_join_functor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_merge.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_merge.h index b3bbbc245e1f..95a4d282ab73 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_merge.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_merge.h @@ -51,17 +51,17 @@ class Base_merge void operator()(unsigned int i, unsigned int j, unsigned int jump, - std::vector& arr_vec) + std::vector& arr_vec) { if(i==j) return; - const typename Arrangement_2::Geometry_traits_2 * tr = + const typename Arrangement_2::Geometry_traits_2 * tr = arr_vec[i].first->geometry_traits(); Arrangement_2 *res = new Arrangement_2(tr); std::vector *verts = new std::vector; - Gps_agg_op + Gps_agg_op agg_op(*res, *verts, *(res->traits_adaptor())); agg_op.sweep_arrangements(i, j, jump, arr_vec); @@ -70,7 +70,7 @@ class Base_merge delete (arr_vec[count].first); delete (arr_vec[count].second); } - + arr_vec[i].first = res; arr_vec[i].second = verts; } @@ -78,30 +78,30 @@ class Base_merge }; //! Join_merge -/*! Join_merge is used to join two sets of polygons together in the D&C +/*! Join_merge is used to join two sets of polygons together in the D&C algorithm. It is a base merge with a visitor that joins faces. */ template -class Join_merge : public Base_merge > {}; //! Intersection_merge -/*! Intersection_merge is used to merge two sets of polygons creating their +/*! Intersection_merge is used to merge two sets of polygons creating their intersection. */ template -class Intersection_merge : public Base_merge > {}; //! Xor_merge -/*! Xor_merge is used to merge two sets of polygons creating their +/*! Xor_merge is used to merge two sets of polygons creating their symmetric difference. */ template -class Xor_merge : public Base_merge > { }; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2_impl.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2_impl.h index aa775eb9aeb4..42b33b64514a 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2_impl.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2_impl.h @@ -735,8 +735,8 @@ template if (f->number_of_outer_ccbs() > 1) CGAL_error_msg("Not implemented yet."); - // Some compilers (VC 9) do not like that we directly access the ccb_circ. So we have - // to pass through the iterator. + // Some compilers (VC 9) do not like that we directly access the ccb_circ. So we have + // to pass through the iterator. Outer_ccb_const_iterator oci_temp = f->outer_ccbs_begin(); Ccb_halfedge_const_circulator ccb_end = *oci_temp; Ccb_halfedge_const_circulator ccb_circ = ccb_end; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_sym_diff_functor.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_sym_diff_functor.h index de6d33c70b9a..60335786575b 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_sym_diff_functor.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_sym_diff_functor.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h index 702f25e8e844..74b62b9d5f54 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -57,31 +57,31 @@ class Gps_traits_decorator // a side is either oblivious or open (unbounded) BOOST_MPL_ASSERT( - (boost::mpl::or_< + (boost::mpl::or_< boost::is_same< Left_side_category, Arr_oblivious_side_tag >, boost::is_same< Left_side_category, Arr_open_side_tag > > ) ); BOOST_MPL_ASSERT( - (boost::mpl::or_< + (boost::mpl::or_< boost::is_same< Bottom_side_category, Arr_oblivious_side_tag >, boost::is_same< Bottom_side_category, Arr_open_side_tag > > ) ); BOOST_MPL_ASSERT( - (boost::mpl::or_< + (boost::mpl::or_< boost::is_same< Top_side_category, Arr_oblivious_side_tag >, boost::is_same< Top_side_category, Arr_open_side_tag > > ) ); BOOST_MPL_ASSERT( - (boost::mpl::or_< + (boost::mpl::or_< boost::is_same< Right_side_category, Arr_oblivious_side_tag >, boost::is_same< Right_side_category, Arr_open_side_tag > > ) ); - class Ex_point_2 + class Ex_point_2 { protected: Base_Point_2 m_base; @@ -138,7 +138,7 @@ class Gps_traits_decorator protected: Base_X_monotone_curve_2 m_base; Curve_data m_data; - + public: Ex_x_monotone_curve_2(): m_base(), m_data() @@ -148,7 +148,7 @@ class Gps_traits_decorator m_data() {} - Ex_x_monotone_curve_2(const Base_X_monotone_curve_2& pt, + Ex_x_monotone_curve_2(const Base_X_monotone_curve_2& pt, const Curve_data& data): m_base(pt), m_data(data) {} @@ -206,7 +206,7 @@ class Gps_traits_decorator bool m_traits_owner; public: - + Gps_traits_decorator() : m_base_tr(new Base()), m_traits_owner(true) @@ -469,7 +469,7 @@ class Gps_traits_decorator oi_end = m_base(cv2.base(), cv1.base(), oi); // convert objects that are associated with Base_X_monotone_curve_2 to - // the extenede X_monotone_curve_2 + // the extenede X_monotone_curve_2 for(; oi != oi_end; ++oi) { base_pt = object_cast >(&(*oi)); @@ -477,7 +477,7 @@ class Gps_traits_decorator if (base_pt != nullptr) { Point_2 point_plus (base_pt->first); // the extended point - *oi = CGAL::make_object(std::make_pair(point_plus, + *oi = CGAL::make_object(std::make_pair(point_plus, base_pt->second)); } else @@ -489,7 +489,7 @@ class Gps_traits_decorator } //return past-end iterator return oi_end; - } + } }; /*! Get a Intersect_2 functor object. */ diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Point_with_vertex.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Point_with_vertex.h index fa29a1b46229..a4ecf117e85e 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Point_with_vertex.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Point_with_vertex.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -24,7 +24,7 @@ class Point_with_vertex protected: typedef typename Arrangement_::Vertex_handle Vertex_handle; typedef typename Arrangement_::Vertex_const_handle Vertex_const_handle; - + public: Vertex_handle m_v; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_2_curve_iterator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_2_curve_iterator.h index 8ad3f708e22f..39a5e7dd34a1 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_2_curve_iterator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_2_curve_iterator.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -35,16 +35,16 @@ class Polygon_2_curve_ptr }; template -class Polygon_2_curve_iterator +class Polygon_2_curve_iterator { public: typedef Polygon_2_curve_iterator< X_monotone_curve_2_, Polygon_ > Self; - - + + typedef X_monotone_curve_2_ X_monotone_curve_2; typedef typename Polygon_::Container Container; typedef typename Container::iterator Container_iterator; - typedef typename std::iterator_traits::iterator_category + typedef typename std::iterator_traits::iterator_category iterator_category; typedef X_monotone_curve_2 value_type; typedef X_monotone_curve_2* pointer; @@ -54,11 +54,11 @@ class Polygon_2_curve_iterator typedef Polygon_ Polygon; typedef typename Polygon::Edge_const_iterator Edge_const_iterator; typedef typename Edge_const_iterator::difference_type difference_type; - + private: const Polygon* m_pgn; // needed for dereferencing the last edge Edge_const_iterator m_curr_edge; // points to the current edge iterator - + public: Polygon_2_curve_iterator< X_monotone_curve_2_, Polygon_ >(){} @@ -70,17 +70,17 @@ class Polygon_2_curve_iterator { return (m_curr_edge == x.m_curr_edge); } - + bool operator!=(const Self& x) const { return !(m_curr_edge == x.m_curr_edge); } - X_monotone_curve_2 operator*() + X_monotone_curve_2 operator*() { return X_monotone_curve_2(*m_curr_edge); } - + Polygon_2_curve_ptr operator->() { return Polygon_2_curve_ptr(operator*()); @@ -99,7 +99,7 @@ class Polygon_2_curve_iterator return tmp; } - Self& operator--() + Self& operator--() { --m_curr_edge; return *this; @@ -112,7 +112,7 @@ class Polygon_2_curve_iterator } // random access iterator requirements - Self& operator+=(difference_type n) + Self& operator+=(difference_type n) { m_curr_edge += n; return *this; @@ -123,12 +123,12 @@ class Polygon_2_curve_iterator return Self(m_pgn, m_curr_edge + n); } - Self& operator-=(difference_type n) + Self& operator-=(difference_type n) { return (*this) -= n; } - Self operator-(difference_type n) + Self operator-(difference_type n) { return Self(m_pgn, m_curr_edge - n); } @@ -138,7 +138,7 @@ class Polygon_2_curve_iterator return (const_cast(m_curr_edge) - a.m_curr_edge); } - X_monotone_curve_2 operator[](int n) + X_monotone_curve_2 operator[](int n) { return *Self(m_pgn, m_curr_edge+n); } @@ -169,15 +169,15 @@ class Polygon_2_curve_iterator template typename Polygon_2_curve_iterator::difference_type distance_type(const Polygon_2_curve_iterator&) -{ - return Polygon_2_curve_iterator::difference_type(); +{ + return Polygon_2_curve_iterator::difference_type(); } template X_monotone_curve_2_* value_type(const Polygon_2_curve_iterator&) { - return (X_monotone_curve_2_*)(0); + return (X_monotone_curve_2_*)(0); } diff --git a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h index b9f4636db9cc..fd6badf0c40b 100644 --- a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -111,7 +111,7 @@ class General_polygon_2 Gps_traits_adaptor tr; return (tr.orientation_2_object()(m_xcurves.begin(), m_xcurves.end())); } - + void reverse_orientation() { m_xcurves.reverse(); @@ -149,7 +149,7 @@ class General_polygon_2 { result = result + first->bbox(); } - + return result; } }; @@ -165,7 +165,7 @@ std::istream &operator>>(std::istream &is, General_polygon_2& p) int n; // number of edges is >> n; typename Traits::X_monotone_curve_2 cv; - + if (is) { p.clear(); for (int i=0; i>(std::istream &is, General_polygon_2& p) p.push_back(cv); } } - + return is; } diff --git a/Boolean_set_operations_2/include/CGAL/Gps_segment_traits_2.h b/Boolean_set_operations_2/include/CGAL/Gps_segment_traits_2.h index 4ca6b63b2336..af6aa17c22eb 100644 --- a/Boolean_set_operations_2/include/CGAL/Gps_segment_traits_2.h +++ b/Boolean_set_operations_2/include/CGAL/Gps_segment_traits_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman @@ -26,7 +26,7 @@ namespace CGAL { -template < class Kernel_, +template < class Kernel_, class Container_ = std::vector, class Arr_seg_traits_ = Arr_segment_traits_2 > class Gps_segment_traits_2 : public Arr_seg_traits_ @@ -38,17 +38,17 @@ class Gps_segment_traits_2 : public Arr_seg_traits_ // Polygon_2 type is required by GeneralPolygonSetTraits Concept typedef CGAL::Polygon_2 Polygon_2; - // Polygon_2 is a model of the GeneralPolygon2 concept. + // Polygon_2 is a model of the GeneralPolygon2 concept. typedef Polygon_2 General_polygon_2; - // Polygon_with_holes_2 can be a simple polygon , with holes that are + // Polygon_with_holes_2 can be a simple polygon , with holes that are // entirely inside him , or some vertices of the polygon and its holes // may overlap. - + // Polygon_with_holes_2 type required by GeneralPolygonSetTraits Concept. - typedef CGAL::Polygon_with_holes_2 + typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - // Polygon_with_Holes_2 is a model of the GeneralPolygonWithHoles2 concept. + // Polygon_with_Holes_2 is a model of the GeneralPolygonWithHoles2 concept. typedef Polygon_with_holes_2 General_polygon_with_holes_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; @@ -59,7 +59,7 @@ class Gps_segment_traits_2 : public Arr_seg_traits_ Hole_const_iterator; typedef typename Base::Point_2 Point_2; - + /*! * A functor for constructing a polygon from a range of segments. */ @@ -69,7 +69,7 @@ class Gps_segment_traits_2 : public Arr_seg_traits_ /*! The traits (in case it has state) */ const Traits_adaptor* m_traits; - + public: /*! Constructor * \param traits the traits (in case it has state) @@ -77,7 +77,7 @@ class Gps_segment_traits_2 : public Arr_seg_traits_ Construct_polygon_2(const Self* traits) : m_traits(static_cast(traits)) {} - + template void operator()(XCurveIterator begin, XCurveIterator end, Polygon_2& pgn) const @@ -154,7 +154,7 @@ class Gps_segment_traits_2 : public Arr_seg_traits_ { return Construct_holes(); } - + /* A functor for constructing a General_polygon_with_holes from a * General_Polygon (and possibly a range of holes). * @@ -187,7 +187,7 @@ class Gps_segment_traits_2 : public Arr_seg_traits_ { return Construct_general_polygon_with_holes_2(); } - + //functor returns true if the outer boundary is unbounded, and false otherwise. class Is_unbounded { public: diff --git a/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h b/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h index d8a88b315d32..1645afc1354e 100644 --- a/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h +++ b/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Ron Wein @@ -73,7 +73,7 @@ class Dxf_bsop_reader * \param simplify Should we simplify the polygons (in case the file * contains polygons that are not simple). * \return A pair of past-the-end iterators for both ranges. - */ + */ template std::pair @@ -94,7 +94,7 @@ class Dxf_bsop_reader // Convert the circles, such that each circle becomes a simple polygon // with two edges (the upper and the lower half-circles). Traits_2 traits; - typename Traits_2::Make_x_monotone_2 make_x_monotone = + typename Traits_2::Make_x_monotone_2 make_x_monotone = traits.make_x_monotone_2_object(); typename Dxf_circles_list::iterator circ_it; CGAL::Object obj_vec[3]; @@ -153,7 +153,7 @@ class Dxf_bsop_reader pt = pgn_it->begin()->first; // Check whether a "bulge" is defined between the two vertices. - if (curr->second) + if (curr->second) { // A non-zero bulge: ps and pt are connected by a circular arc. // We compute the center and the squared radius of its supporting @@ -165,8 +165,8 @@ class Dxf_bsop_reader const FT x_coord = ((ps.x() + pt.x())/2) + common*(ps.y() - pt.y()); const FT y_coord = ((ps.y() + pt.y())/2) + common*(pt.x() - ps.x()); const FT sqr_bulge = CGAL::square(bulge); - const FT sqr_rad = CGAL::squared_distance(ps, pt) * - (1/sqr_bulge + 2 + sqr_bulge) / 16; + const FT sqr_rad = CGAL::squared_distance(ps, pt) * + (1/sqr_bulge + 2 + sqr_bulge) / 16; // Construct the arc: A positive bulge means the arc is // counterclockwise oriented and a negative bulge means that the arc @@ -178,7 +178,7 @@ class Dxf_bsop_reader supp_circ = Circle_2 (Point_2 (x_coord, y_coord), sqr_rad, CGAL::CLOCKWISE); - Curve_2 circ_arc (supp_circ, + Curve_2 circ_arc (supp_circ, Arc_point_2 (ps.x(), ps.y()), Arc_point_2 (pt.x(), pt.y())); diff --git a/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h b/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h index fec99a0f8207..eae28c242a14 100644 --- a/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h +++ b/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Efi Fogel @@ -39,7 +39,7 @@ std::ostream & operator<< (std::ostream& os, std::cout << pgn_set.number_of_polygons_with_holes() << std::endl; std::copy(res.begin(), res.end(), std::ostream_iterator(std::cout, "\n")); - + return os; } diff --git a/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h index 54c410c85e70..d986acfd860f 100644 --- a/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Baruch Zukerman // Efi Fogel @@ -33,7 +33,7 @@ template > > class Polygon_set_2 : public General_polygon_set_2, Dcel_> -{ +{ private: typedef General_polygon_set_2, Dcel_> Base; @@ -41,7 +41,7 @@ class Polygon_set_2 : typedef Polygon_set_2 Self; public: - typedef typename Base::Traits_2 Traits_2; + typedef typename Base::Traits_2 Traits_2; typedef typename Base::Polygon_2 Polygon_2; typedef typename Base::Polygon_with_holes_2 Polygon_with_holes_2; typedef typename Base::Arrangement_2 Arrangement_2; @@ -72,7 +72,7 @@ class Polygon_set_2 : Base (pwh) {} - + inline void intersection(const Polygon_2& pgn) { Base::intersection(pgn); diff --git a/Boolean_set_operations_2/include/CGAL/connect_holes.h b/Boolean_set_operations_2/include/CGAL/connect_holes.h index 0c36356f439f..f4e293418bd8 100644 --- a/Boolean_set_operations_2/include/CGAL/connect_holes.h +++ b/Boolean_set_operations_2/include/CGAL/connect_holes.h @@ -8,7 +8,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Ron Wein -// Guy Zucker +// Guy Zucker #ifndef CGAL_CONNECT_HOLES_H #define CGAL_CONNECT_HOLES_H @@ -42,7 +42,7 @@ struct _Less_handle }; /*bool is_adjacent_hole(const Halfedge_handle he, Arrangement_2 arr) { - return ((!he->twin()->face()->contained()) + return ((!he->twin()->face()->contained()) && (he->twin()->face() != arr.unbounded_face())) }*/ @@ -78,18 +78,18 @@ OutputIterator connect_holes(const Polygon_with_holes_2 Traits_2; typedef typename Kernel::Point_2 Point_2; typedef typename Traits_2::X_monotone_curve_2 Segment_2; - typedef CGAL::Gps_default_dcel dcel; + typedef CGAL::Gps_default_dcel dcel; typedef General_polygon_set_2 , dcel> - General_polygon_set_2; + General_polygon_set_2; typedef Arrangement_2, dcel> Arrangement_2; typedef typename Arrangement_2::Vertex_handle Vertex_handle; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_handle Face_handle; - + CGAL_precondition (! pwh.is_unbounded()); - + // In case the polygon has not holes, just go over its outer boundary // and report the points along it. const Polygon_2& outer_pgn = pwh.outer_boundary(); @@ -98,7 +98,7 @@ OutputIterator connect_holes(const Polygon_with_holes_2 V_map; - V_map top_vertices(false ,arr.number_of_faces()); - - /*traversal of arrangement face holes - a hole in the face + V_map top_vertices(false ,arr.number_of_faces()); + + /*traversal of arrangement face holes - a hole in the face in arranements is disjoint from the outer boundary (different from BOP where the hole can have vertices along the outer boundary). We look for holes only inside faces that are part of the point set. This guarantees that if the input PWH had holes with vertices on the outer boundary they will not be connected by additional vertical segments to - the outer boundary or another hole's vertex/edge. + the outer boundary or another hole's vertex/edge. */ typename Arrangement_2::Face_const_handle fit; //std::cout << arr.number_of_faces() << " faces:" << std::endl; @@ -162,11 +162,11 @@ OutputIterator connect_holes(const Polygon_with_holes_2point() <first)) + if (!top_vertices.is_defined(vrs_iter->first)) continue; v_top = arr.non_const_handle (vrs_iter->first); @@ -205,10 +205,10 @@ OutputIterator connect_holes(const Polygon_with_holes_2point(), v_above->point()), - v_top, v_above); - //std::cout << "connected ((" << v_top->point() << "),( " << v_above->point() << "))" <point() << "),( " << v_above->point() << "))" <second.second)) { @@ -236,8 +236,8 @@ OutputIterator connect_holes(const Polygon_with_holes_2point(), ip), he_above, v_top); - //added for debugging - //std::cout << "connected ((" << v_top->point() << "),( " << ip << "))" <point() << "),( " << ip << "))" <2 - (note that this includes new vertices added by the vertical ray shooting). + /*For the traversal we switch between two states using key vertices. + A key vertex is a vertex on the outer boundary of the PWH that has a degree>2 + (note that this includes new vertices added by the vertical ray shooting). In other words, it is a vertice that leads to holes. One state is searching for a key vertice that - leads to a hole that has not been traversed. The other state is traversing (marking) a hole completely - (starting and finishing at the same key vertice). Once the hole traversal is completed + leads to a hole that has not been traversed. The other state is traversing (marking) a hole completely + (starting and finishing at the same key vertice). Once the hole traversal is completed return to search state*/ - - //start state is search state + + //start state is search state bool marking_hole_state = false; - - /*flags used for printing the edges for debugging purposes - bool skip_print = false; - bool antenna_trav = false; */ - - //marker of first vertex of hole that is being traversed - Vertex_handle hole_start, empty_handle; - + + /*flags used for printing the edges for debugging purposes + bool skip_print = false; + bool antenna_trav = false; */ + + //marker of first vertex of hole that is being traversed + Vertex_handle hole_start, empty_handle; + /*create a hash map container for outer boundary key vertices (degree>2 and on outer boundary. Hash map is constructed with a - size parameter so we'll traverse once around the outer boundary to + size parameter so we'll traverse once around the outer boundary to count the key vertices and once to insert them*/ - + f_hole_it = uf->holes_begin(); Halfedge_const_handle he_han = *f_hole_it; - if (he_han->face() != uf) + if (he_han->face() != uf) he_han = he_han->twin(); - CGAL_assertion(he_han->face() == uf); - //std::cout << "outer boundary:" <target()->point() << ")" <face() == uf); + //std::cout << "outer boundary:" <target()->point() << ")" <next(); CGAL_assertion(he_han->face() == uf); while (he_han != begin) { - //std::cout << "(" << he_han->target()->point() << ")" <target()->degree()>2) - size++; + //std::cout << "(" << he_han->target()->point() << ")" <target()->degree()>2) + size++; he_han = he_han->next(); - CGAL_assertion(he_han->face() == uf); + CGAL_assertion(he_han->face() == uf); } - + //construct vertex hash map (default data is false) and insert vertex //handles as keys (key vertex data value is true) - V_map ver_map(false ,size); + V_map ver_map(false ,size); if (he_han->target()->degree()>2) - ver_map[he_han->target()]=true; + ver_map[he_han->target()]=true; //std::cout << "(" << he_han->target()->point() << ")" <next(); while (he_han != begin) { CGAL_assertion(he_han->face() == uf); - if (he_han->target()->degree()>2) + if (he_han->target()->degree()>2) ver_map[he_han->target()]=true; - //std::cout << "(" << he_han->target()->point() << ")" <next(); + //std::cout << "(" << he_han->target()->point() << ")" <next(); } //std::cout << "outer boundary finished" <outer_ccb(); //std::cout << "first edge is ((" << first->source()->point() << "),(" << first->target()->point() << "))" <twin()->face() != uf) start = start->next(); //std::cout << "start edge is ((" << start->source()->point() << "),(" << start->target()->point() << "))" <2. check hole on every step and mark new holes (if two holes are connected by a vertex) @@ -332,30 +332,30 @@ OutputIterator connect_holes(const Polygon_with_holes_2face() == curr->twin()->face()) { + if (curr->face() == curr->twin()->face()) { //antenna_trav = true ; - //std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); + //std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); ++oi; - curr = curr->next(); + curr = curr->next(); } Face_handle curr_face; - //Traversal of the hole + //Traversal of the hole while (hole_start != arr.non_const_handle(curr->target())) { curr_face = arr.non_const_handle(curr->twin()->face()); /*mark the hole as a hole that has been traversed to save - multiple traversals*/ - curr_face->set_visited(true); - //std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); - ++oi; + multiple traversals*/ + curr_face->set_visited(true); + //std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); + ++oi; //"turn inside" instead of next if target is located on outer boundary - //(a key vertex encountered while traversing a hole) - if (ver_map.is_defined(curr->target())) { + //(a key vertex encountered while traversing a hole) + if (ver_map.is_defined(curr->target())) { curr = curr->twin()->prev()->twin(); - } else {//regular advance + } else {//regular advance curr = curr->next(); } } //exited loop target is the hole marking start vertex @@ -364,101 +364,101 @@ OutputIterator connect_holes(const Polygon_with_holes_2target()) as their source to determine next move - does curr->target() have more holes to traverse or do we - return to searching the outer boundary*/ + return to searching the outer boundary*/ } else - {//search for next hole to traverse - + {//search for next hole to traverse + /*Treatment of 4 possible cases (can be narrowed to 3) - the first two cannot co-exist here as vertices with degree of 2 that are - not on the unbounded face will be encountered when traversing holes + not on the unbounded face will be encountered when traversing holes (different state) */ next = curr->next(); - //unified 2 simple cases of traversal along outer boundary + //unified 2 simple cases of traversal along outer boundary /* case target() is a simple vertice with a single possible edge on path. add it to output and continue searching for a hole. This is when traversing along the outer polygon boundary*/ /*the case the next half edge is on the outer boundary meaning we finished handling holes connected to the target vertex. Add the target to the output, and continue searching for next hole*/ - - /*if (curr->target()->degree()==2) { + + /*if (curr->target()->degree()==2) { //std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); - ++oi; + ++oi; curr = curr->next(); - //maintain the same state + //maintain the same state continue; }*/ if ((curr->target()->degree()==2) ||(next->twin()->face() == uf)) { - /*if (!skip_print) - std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); - ++oi; + ++oi; curr = curr->next(); //maintain the same state continue; } - + /*if next is a boundary of a hole that has not been traversed, or an antenna (which should also be completely traversed until returning to the source vertex). an antenna to the outer boundary occurs only for polygons that are detached from the outer boundary - and therefore these holes are connected to the boundary only by a + and therefore these holes are connected to the boundary only by a single vertex and will be travrsed only once. - Target must be added to output and state changed. - */ - if ((!next->twin()->face()->visited()) - //case of antenna - || (next->face()==next->twin()->face())) { - /*if (!skip_print) - std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <twin()->face()->visited()) + //case of antenna + || (next->face()==next->twin()->face())) { + /*if (!skip_print) + std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <target()->point(); - ++oi; + ++oi; hole_start = arr.non_const_handle(curr->target()); - marking_hole_state=true; + marking_hole_state=true; curr = curr->next(); continue; - } else { + } else { /*the case where target() is a part of several holes, and next is a - boundary of a hole that has been traversed. This requires + boundary of a hole that has been traversed. This requires to continue "traversal alongside all edges whose target is also curr->target() to keep looking for a hole that hasn't been traversed. we do not insert the target to the output set to avoid duplication with cases 2 and 3*/ - + /*bypass traversed hole from inside*/ - + /*print debugging comment: the current edge needs to be printed now before moving on, but the current (target) vertex will be inserted to output iterator in case 2*/ - /*if (traversed_holes.find(arr.non_const_handle(curr->twin()->face())) == traversed_holes.end()) + /*if (traversed_holes.find(arr.non_const_handle(curr->twin()->face())) == traversed_holes.end()) std::cout << "curr edge is ((" << curr->source()->point() << "),( " << curr->target()->point() << "))" <source()->point() << "),( " << curr->target()->point() << "))" <source()->point() << "),( " << curr->target()->point() << "))" <twin()->next()->twin(); - //maintain the same state + //maintain the same state continue; /*now curr->target() has remained the same but curr->next() will - be adjacent to a different hole or curr->next->twin->face() + be adjacent to a different hole or curr->next->twin->face() will be the unbounded face*/ - } - } + } + } } while (curr != start); return (oi); } diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt index c846aae2c299..f346e2183ec4 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt @@ -17,8 +17,8 @@ if ( CGAL_FOUND ) endforeach() else() - + message(STATUS "This program requires the CGAL library, and will not be compiled.") - + endif() diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp index 83c949f59403..d8a345b28cd8 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/agg_op_test_suite_generator.cpp @@ -24,7 +24,7 @@ typedef CGAL::Gps_segment_traits_2 Traits_2; typedef std::vector Polygons_vec; typedef std::vector Polygons_with_holes_vec; -typedef std::back_insert_iterator +typedef std::back_insert_iterator Output_itr; template @@ -35,12 +35,12 @@ bool are_polygons_valid(Vec& vec) for(; i < vec.size(); ++i) { if(!is_valid_unknown_polygon(vec[i], tr)) - return false; + return false; } return true; } -void write_result_to_file(Polygons_with_holes_vec& result, +void write_result_to_file(Polygons_with_holes_vec& result, std::ofstream& out) { std::ostream_iterator ostream_itr(out, "\n"); @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) char c = std::cin.get(); if(c != 'y') return 0; - + } std::ofstream out (argv[2]); if(!out.is_open()) @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) Polygons_with_holes_vec result; Output_itr oi(result); - + int n; // read polygons diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp index 0f74f3ab364c..703d31724d85 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/bop_test_suite_generator.cpp @@ -29,7 +29,7 @@ bool are_polygons_valid(const std::vector& vec) for(; i < vec.size(); ++i) { if(!is_valid_polygon_with_holes(vec[i],tr)) - return false; + return false; } return true; } @@ -41,7 +41,7 @@ std::ostream& write_result_to_file(std::ostream& out, const T_P1& p1, Traits_2 tr; std::vector res; std::back_insert_iterator > oi(res); - + Polygon_with_holes_2 res_pgn; bool intersect = CGAL::join(p1, p2, res_pgn); if(intersect) @@ -95,7 +95,7 @@ std::ostream& write_result_to_file(std::ostream& out, const T_P1& p1, if(!are_polygons_valid(res)) std::cout << "warning: invalid polygon was generated" << std::endl; res.clear(); - + return out; } @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) char c = std::cin.get(); if(c != 'y') return 0; - + } std::ofstream out (argv[3]); if(!out.is_open()) @@ -184,7 +184,7 @@ int main(int argc, char *argv[]) std::cout << "warning: first input polygon is invalid!!!" << std::endl; } } - else + else { inp1 >> pwh1; out << pwh1; @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) } } out <> join_res; - + unsigned int n_pgns; inp >> n_pgns; intersection_res.resize(n_pgns); @@ -134,7 +134,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) bool intersect; CGAL::Oriented_side or_side_from_file; - + read_file(inp, intersect, join_res_from_file, @@ -148,7 +148,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) std::vector temp_result; std::back_insert_iterator > oi(temp_result); - + CGAL::intersection(p1, p2, oi); if (! are_equal(intersection_res_from_file, temp_result)) { @@ -165,7 +165,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) Polygon_with_holes_2 join_res; bool do_x; - + do_x = CGAL::join(p1, p2, join_res); if (do_x != intersect) { @@ -178,7 +178,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) { std::cout << "join 12 failed..." << std::endl; return false; - } + } } do_x = CGAL::join(p2, p1, join_res); @@ -193,7 +193,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) { std::cout << "join 22 failed..." << std::endl; return false; - } + } } CGAL::difference(p1 ,p2, oi); @@ -204,7 +204,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) } CGAL::difference(p2 ,p1, oi); - + if (! are_equal(diff2_res_from_file, temp_result)) { std::cout << "diff 2 failed" << std::endl; @@ -252,13 +252,13 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) std::cout << "oriented_side 2 failed" << std::endl; return false; } - + ///////////////////////////////////////// Ps ps; Ps ps1(p1); Ps ps2(p2); - + ps.intersection(ps1, ps2); ps.polygons_with_holes(oi); if (!ps.is_valid() || ! are_equal(intersection_res_from_file, temp_result)) @@ -307,7 +307,7 @@ bool test(std::istream& inp, const Polygon1& p1, const Polygon2& p2) else if (temp_result.size() == 2) { - if (! (temp_result[0]==p1 && temp_result[1]==p2) || + if (! (temp_result[0]==p1 && temp_result[1]==p2) || (temp_result[0]==p2 && temp_result[1]==p1)) { std::cout << "join failed" << std::endl; @@ -395,7 +395,7 @@ int main(int argc, char *argv[]) std::string::iterator tmp = itr; --tmp; if (*itr == 't') break; - + str.erase(itr); itr = tmp; } @@ -415,6 +415,6 @@ int main(int argc, char *argv[]) } inp.close(); } - + return success; } diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_compilation.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_compilation.cpp index e642a24a0f0b..7ac5e732a751 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_compilation.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_compilation.cpp @@ -37,7 +37,7 @@ template void test() { typedef typename GPS::Traits_2 Traits; - typedef typename Traits::Point_2 Point_2; + typedef typename Traits::Point_2 Point_2; typedef typename Traits::Polygon_2 Polygon_2; typedef typename Traits::Polygon_with_holes_2 Polygon_with_holes_2; @@ -91,7 +91,7 @@ void test() gps.do_intersect(polygons.begin(), polygons.end()); gps.do_intersect(polygons_with_holes.begin(), polygons_with_holes.end()); - + gps.do_intersect(polygons.begin(), polygons.end(), polygons_with_holes.begin(), polygons_with_holes.end()); @@ -122,7 +122,7 @@ void test() CGAL::do_intersect(polygons.begin(), polygons.end(), polygons_with_holes.begin(), polygons_with_holes.end(), tr); - + CGAL::intersection(pgn1, pgn2, std::back_inserter(result)); CGAL::intersection(pgn1, pgn_with_holes2, std::back_inserter(result)); diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp index 0a2c09ef9d89..2a2498f5dddf 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_connect_holes.cpp @@ -1,7 +1,7 @@ /*! \file test_connect_holes.cpp * Connecting a polygon with holes. */ - + #ifndef CGAL_BSO_RATIONAL_NT_H #define CGAL_BSO_RATIONAL_NT_H @@ -21,15 +21,15 @@ typedef CGAL::Cartesian Kernel; typedef Kernel::Point_2 Point_2; typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; -typedef Polygon_2::FT FT; +typedef Polygon_2::FT FT; typedef Polygon_with_holes_2::Hole_const_iterator Hole_const_iterator; -typedef Polygon_with_holes_2::Hole_iterator Hole_iterator; +typedef Polygon_with_holes_2::Hole_iterator Hole_iterator; -//compute the area of a polygon with holes +//compute the area of a polygon with holes FT pwh_area(Polygon_with_holes_2 pwh) { Polygon_2 outerP = pwh.outer_boundary(); - FT result = outerP.area(); + FT result = outerP.area(); if (! pwh.has_holes()) return result; Hole_const_iterator hit = pwh.holes_begin(); @@ -43,14 +43,14 @@ FT pwh_area(Polygon_with_holes_2 pwh) } bool testExampleFile(const char* filename) -{ +{ // Read a polygon with holes from a file. std::ifstream input_file (filename); if (! input_file.is_open()) { std::cerr << "Failed to open the " << filename << std::endl; return false; - } + } Polygon_2 outerP; unsigned int num_holes; @@ -65,7 +65,7 @@ bool testExampleFile(const char* filename) Polygon_with_holes_2 P (outerP, holes.begin(), holes.end()); FT inputArea = pwh_area(P); - + // Connect the outer boundary of the polygon with its holes. std::list pts; std::list::iterator pit; @@ -81,33 +81,33 @@ bool testExampleFile(const char* filename) } /* Test all 5 test files. The results are compared according to the area -signature. The input polygon with holes area is calculated, and then +signature. The input polygon with holes area is calculated, and then after the holes are connected, an output polygon is created, and its -area is calculated +area is calculated */ int main() -{ +{ std::string testfilePrefix = "data/pgn_holes"; - std::string testfileSuffix = ".dat"; - int result = 0; + std::string testfileSuffix = ".dat"; + int result = 0; for (int i = 1; i < 6; ++i) { std::stringstream strs; std::string si; strs << i; - strs >> si; + strs >> si; std::string filename = testfilePrefix + si + testfileSuffix; - const char * cfilename = filename.c_str(); + const char * cfilename = filename.c_str(); bool res = testExampleFile(cfilename); if (!res) { std::cout << "test " << i << " was a bitter failure" << std::endl; result = 1; - } + } else { - std::cout <<"test " << i << " was a great success" << std::endl; + std::cout <<"test " << i << " was a great success" << std::endl; } } if (result == 0) - std::cout << "ALL TESTS SUCCEEDED!" << std::endl; + std::cout << "ALL TESTS SUCCEEDED!" << std::endl; return result; } diff --git a/Bounding_volumes/archive/test_extensive/stability/stability-exact.cpp b/Bounding_volumes/archive/test_extensive/stability/stability-exact.cpp index 3c56d80a3952..31eb7939561d 100644 --- a/Bounding_volumes/archive/test_extensive/stability/stability-exact.cpp +++ b/Bounding_volumes/archive/test_extensive/stability/stability-exact.cpp @@ -36,13 +36,13 @@ class PairToDouble { const double operator()(const std::pair p) { return to_double(p.first)+sqrt*to_double(p.second); - } + } }; // A helper routine to write a pair (as returned by the miniball package) // to a stream: void writePair(const std::pair& p, - std::ostream& out,const ExactFT& disc) { + std::ostream& out,const ExactFT& disc) { out << ' ' << p.first; if (p.second >= 0) out << '+'; @@ -51,8 +51,8 @@ void writePair(const std::pair& p, template void atomicTest(const int no,const std::string& name,Perturbation perturb, - const std::vector< Ball >& S, - const BuildFlag) { + const std::vector< Ball >& S, + const BuildFlag) { // open the file containing the exact radius and center: std::string filename("data/results."); filename += toStr(no); @@ -67,11 +67,11 @@ void atomicTest(const int no,const std::string& name,Perturbation perturb, // verify result: if (!mb.is_valid()) { std::cout << std::endl - << "ERROR! Computed ball is *not* valid!" << std::endl - << "Please contact the author kf@iaeth.ch!" << std::endl; + << "ERROR! Computed ball is *not* valid!" << std::endl + << "Please contact the author kf@iaeth.ch!" << std::endl; exit(-1); } - + // save exact coordinates and exact radius: using std::setprecision; fd << D << std::endl; @@ -87,10 +87,10 @@ void atomicTest(const int no,const std::string& name,Perturbation perturb, std::cout << " [" << setprecision(18) << p2d(mb.radius()) << ']'; // write control information: - fd << std::endl + fd << std::endl << "Name: " << name << " (test #" << no << ')' << std::endl << "Perturbation: " << static_cast(perturb) << std::endl; - ed << std::endl + ed << std::endl << "Name: " << name << " (test #" << no << ')' << std::endl << "Perturbation: " << static_cast(perturb) << std::endl; } diff --git a/Bounding_volumes/archive/test_extensive/stability/stability.cpp b/Bounding_volumes/archive/test_extensive/stability/stability.cpp index 010713d9405f..419c50460c8e 100644 --- a/Bounding_volumes/archive/test_extensive/stability/stability.cpp +++ b/Bounding_volumes/archive/test_extensive/stability/stability.cpp @@ -26,13 +26,13 @@ double rerr(double exact,double approx) { template void atomicTest(const int test,const std::string& name,Perturbation perturb, - const std::vector< Ball >& S, - const RunFlag) { + const std::vector< Ball >& S, + const RunFlag) { // open the file containing the exact radius and center: std::string filename("data/results."); filename += toStr(test); std::ifstream ed(filename.c_str()); - + // read number of coordinates and exact radius: int no; ed >> no; @@ -52,18 +52,18 @@ void atomicTest(const int test,const std::string& name,Perturbation perturb, CGAL::Min_sphere_of_spheres_d fumb(S.begin(),S.end()); CGAL::Min_sphere_of_spheres_d famb(S.begin(),S.end()); - std::cout << " Double with sqrts: " << std::setw(50) - << std::setprecision(30) << rerr(exact,dumb.radius()) - << std::endl; - std::cout << " Double w/o sqrts: " << std::setw(50) - << std::setprecision(30) << rerr(exact,damb.radius()) - << std::endl; - std::cout << " Float with sqrts: " << std::setw(50) - << std::setprecision(30) << rerr(exact,fumb.radius()) - << std::endl; - std::cout << " Float w/o sqrts: " << std::setw(50) - << std::setprecision(30) << rerr(exact,famb.radius()) - << std::endl; + std::cout << " Double with sqrts: " << std::setw(50) + << std::setprecision(30) << rerr(exact,dumb.radius()) + << std::endl; + std::cout << " Double w/o sqrts: " << std::setw(50) + << std::setprecision(30) << rerr(exact,damb.radius()) + << std::endl; + std::cout << " Float with sqrts: " << std::setw(50) + << std::setprecision(30) << rerr(exact,fumb.radius()) + << std::endl; + std::cout << " Float w/o sqrts: " << std::setw(50) + << std::setprecision(30) << rerr(exact,famb.radius()) + << std::endl; } int main(int argnr,char **argv) { @@ -87,7 +87,7 @@ int main(int argnr,char **argv) { << "for the details." << endl << "---------------------------------------------------------" << endl << "Running testsuite (this may take a while)..." << endl - << "READ THE FINAL 'TEST RESULTS' line(s)..." << endl + << "READ THE FINAL 'TEST RESULTS' line(s)..." << endl << "---------------------------------------------------------" << endl << endl; diff --git a/Bounding_volumes/archive/test_extensive/stability/stability.h b/Bounding_volumes/archive/test_extensive/stability/stability.h index fb31c8485da1..71d62353f212 100644 --- a/Bounding_volumes/archive/test_extensive/stability/stability.h +++ b/Bounding_volumes/archive/test_extensive/stability/stability.h @@ -71,7 +71,7 @@ class Ball { assert(r >= 0); std::copy(first,first+d,c); } - + public: // access: // Returns the radius. const Number& radius() const { @@ -81,7 +81,7 @@ class Ball { const Number *center() const { return c; } - + // Returns the i-th coordinate for 0<=i defined above: template + typename StorageNumberType, + typename NumberType, + typename Sqrt> struct BallTraits { // constants: static const int D = d; - + // types: typedef Ball Sphere; typedef NumberType FT; typedef CGAL::Default_algorithm Algorithm; typedef Sqrt Use_square_roots; typedef FunctorIterator< const StorageNumberType *, - fromDouble > Cartesian_const_iterator; - + fromDouble > Cartesian_const_iterator; + // routines: inline static Cartesian_const_iterator center_cartesian_begin(const Sphere& b) { @@ -147,10 +147,10 @@ enum Perturbation { // the variable balls. template void readConfiguration(const std::string& name, // name of the configuration - Perturbation perturb, // amount of perturbation - double magnitude, // magnitude of perturbation - int copies, // number of copies - std::vector< Ball >& balls) { + Perturbation perturb, // amount of perturbation + double magnitude, // magnitude of perturbation + int copies, // number of copies + std::vector< Ball >& balls) { // clear set and open data file: balls.clear(); std::ifstream data(name.c_str()); @@ -163,7 +163,7 @@ void readConfiguration(const std::string& name, // name of the configuration // read number of input balls: int n; data >> n; - + for (int i=0; i(ce,r)); } @@ -208,17 +208,17 @@ struct BuildFlag {}; template void atomicTest(const int,const std::string&,Perturbation, - const std::vector< Ball >& S,RunFlag); + const std::vector< Ball >& S,RunFlag); template void atomicTest(const int,const std::string&,Perturbation, - const std::vector< Ball >& S,BuildFlag); + const std::vector< Ball >& S,BuildFlag); // (See routine basicTest() below.) int from = 0, to = 1000, curr = -1; template void basicTest(const std::string& name,double magnitude, - Perturbation perturb,int copies) { + Perturbation perturb,int copies) { // decide whether to do the test or not: ++curr; if (curr < from || curr > to) @@ -264,7 +264,7 @@ void test(const std::string& f,double magnitude) { basicTest(f,magnitude,Medium,1); basicTest(f,magnitude,Large,1); cout << endl; - + cout << " Multiset (d): "; basicTest(f,magnitude,None,10); basicTest(f,magnitude,Tiny,10); @@ -272,7 +272,7 @@ void test(const std::string& f,double magnitude) { basicTest(f,magnitude,Medium,10); basicTest(f,magnitude,Large,10); cout << endl; - + cout << " Set (D): "; basicTest(f,magnitude,None,1); basicTest(f,magnitude,Tiny,1); @@ -280,7 +280,7 @@ void test(const std::string& f,double magnitude) { basicTest(f,magnitude,Medium,1); basicTest(f,magnitude,Large,1); cout << endl; - + cout << " Multiset (D): "; basicTest(f,magnitude,None,10); basicTest(f,magnitude,Tiny,10); @@ -296,22 +296,22 @@ template void mainTest() { test<2,Flag>("data/cocircular_points_small_radius_2.data",1e8); test<2,Flag>("data/cocircular_points_large_radius_2.data",1e9); - + test<3,Flag>("data/almost_cospherical_points_3.data",1); test<10,Flag>("data/almost_cospherical_points_10.data",1); - + test<3,Flag>("data/longitude_latitude_model_3.data",1); - + test<3,Flag>("data/random_points_3.data",1); test<5,Flag>("data/random_points_5.data",1); test<10,Flag>("data/random_points_10.data",1); test<10,Flag>("data/simplex_10.data",1); test<15,Flag>("data/simplex_15.data",1); - + test<10,Flag>("data/cube_10.data",1); test<12,Flag>("data/cube_12.data",1); - + test<2,Flag>("data/balls_on_boundary_2.data",1); test<3,Flag>("data/balls_on_boundary_3.data",1); } diff --git a/Bounding_volumes/doc/Bounding_volumes/Bounding_volumes.txt b/Bounding_volumes/doc/Bounding_volumes/Bounding_volumes.txt index 5cb61190869a..55116f807f7e 100644 --- a/Bounding_volumes/doc/Bounding_volumes/Bounding_volumes.txt +++ b/Bounding_volumes/doc/Bounding_volumes/Bounding_volumes.txt @@ -2,7 +2,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_Bounding_Volumes \anchor chapBoundingVolumes \cgalAutoToc @@ -19,10 +19,10 @@ then we obtain the smallest enclosing sphere problem already mentioned above. In the following example a smallest enclosing circle -(`Min_circle_2`) is constructed from points +(`Min_circle_2`) is constructed from points on a line and written to standard output. The example -shows that it is advisable to switch on random shuffling -in order to deal with a bad order of the input points. +shows that it is advisable to switch on random shuffling +in order to deal with a bad order of the input points. \cgalExample{Min_circle_2/min_circle_2.cpp} @@ -83,6 +83,6 @@ three boxes; the center points are shown in red. \image html pcenter.png \image latex pcenter.png -*/ +*/ } /* namespace CGAL */ diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h index 535dc70d085b..46fe14ad2670 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h @@ -4,106 +4,106 @@ namespace CGAL { /*! \ingroup PkgBoundingVolumesRef -An object of class `Approximate_min_ellipsoid_d` is an approximation to the -ellipsoid of smallest volume enclosing a finite multiset of points -in \f$ d\f$-dimensional Euclidean space \f$ \E^d\f$, \f$ d\ge 2\f$. - -An ellipsoid in \f$ \E^d\f$ is a Cartesian pointset of the form \f$ \{ -x\in\E^d \mid x^T E x + x^T e + \eta\leq 0 \}\f$, where \f$ E\f$ is some -positive definite matrix from the set \f$ \mathbb{R}^{d\times d}\f$, \f$ e\f$ is some -real \f$ d\f$-vector, and \f$ \eta\in\mathbb{R}\f$. A pointset \f$ P\subseteq \E^d\f$ is -called full-dimensional if its affine hull has dimension \f$ d\f$. -For a finite, full-dimensional pointset \f$ P\f$ we denote by \f$ (P)\f$ the -smallest ellipsoid that contains all points of \f$ P\f$; this ellipsoid -exists and is unique. - -For a given finite and full-dimensional pointset \f$ P\subset \E^d\f$ and a -real number \f$ \epsilon\ge 0\f$, we say that an ellipsoid \f$ {\cal -E}\subset\E^d\f$ is an \f$ (1+\epsilon)\f$-appoximation to \f$ (P)\f$ if -\f$ P\subset {\cal E}\f$ and \f$ ({\cal E}) \leq (1+\epsilon) -((P))\f$. In other words, an \f$ (1+\epsilon)\f$-approximation to -\f$ (P)\f$ is an enclosing ellipsoid whose volume is by at most a -factor of \f$ 1+\epsilon\f$ larger than the volume of the smallest -enclosing ellipsoid of \f$ P\f$. - -Given this notation, an object of class `Approximate_min_ellipsoid_d` represents an -\f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$ for a given finite and -full-dimensional multiset of points \f$ P\subset\E^d\f$ and a real constant -\f$ \epsilon>0\f$.\cgalFootnote{A multiset is a set where elements may have multiplicity greater than \f$ 1\f$.} When an -`Approximate_min_ellipsoid_d` object is constructed, an -iterator over the points \f$ P\f$ and the number \f$ \epsilon\f$ have to be -specified; the number \f$ \epsilon\f$ defines the desired -approximation ratio \f$ 1+\epsilon\f$. The underlying algorithm will then -try to compute an \f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$, and one of -the following two cases takes place. -
      -
    • The algorithm determines that \f$ P\f$ is not full-dimensional (see -`is_full_dimensional()` below). - -Important note: due to rounding errors, the algorithm cannot -in all cases decide correctly whether \f$ P\f$ is full-dimensional or -not. If `is_full_dimensional()` returns `false`, the points -lie in such a "thin" subspace of \f$ \E^d\f$ that the algorithm is -incapable of computing an approximation to \f$ (P)\f$. More -precisely, if `is_full_dimensional()` returns `false`, there -exist two parallel hyperplanes in \f$ \E^d\f$ with the points \f$ P\f$ in -between so that the distance \f$ \delta\f$ between the hyperplanes is -very small, possible zero. (If \f$ \delta=0\f$ then \f$ P\f$ is not -full-dimensional.) - -If \f$ P\f$ is not full-dimensional, linear algebra techniques should be -used to determine an affine subspace \f$ S\f$ of \f$ \E^d\f$ that contains the -points \f$ P\f$ as a (w.r.t.\ \f$ S\f$) full-dimensional pointset; once \f$ S\f$ is -determined, the algorithm can be invoked again to compute an -approximation to (the lower-dimensional) \f$ (P)\f$ in \f$ S\f$. Since -`is_full_dimensional()` might (due to rounding errors, see -above) return `false` even though \f$ P\f$ is full-dimensional, the -lower-dimensional subspace \f$ S\f$ containing \f$ P\f$ need not exist. -Therefore, it might be more advisable to fit a hyperplane \f$ H\f$ -through the pointset \f$ P\f$, project \f$ P\f$ onto this affine subspace \f$ H\f$, -and compute an approximation to the minimum-volume enclosing -ellipsoid of the projected points within \f$ H\f$; the fitting can be -done for instance using the `linear_least_squares_fitting()` -function from the \cgal package `Principal_component_analysis`. -
    • The algorithm determines that \f$ P\f$ is full-dimensional. In this -case, it provides an approximation \f$ {\cal E}\f$ to \f$ (P)\f$, but -depending on the input problem (i.e., on the pair \f$ (P,\epsilon)\f$), -it may not have achieved the desired approximation ratio but merely -some worse approximation ratio \f$ 1+\epsilon'>1+\epsilon\f$. The -achieved approximation ratio \f$ 1+\epsilon'\f$ can be queried using -`achieved_epsilon()`, which returns \f$ \epsilon'\f$. The ellipsoid -\f$ {\cal E}\f$ itself can be queried via the methods -`defining_matrix()`, `defining_vector()`, and -`defining_scalar()`. -
    - -The ellipsoid \f$ {\cal E}\f$ computed by the algorithm satisfies the inclusions -\anchor eqapproximate_min_ellipsoid_incl -\f[ +An object of class `Approximate_min_ellipsoid_d` is an approximation to the +ellipsoid of smallest volume enclosing a finite multiset of points +in \f$ d\f$-dimensional Euclidean space \f$ \E^d\f$, \f$ d\ge 2\f$. + +An ellipsoid in \f$ \E^d\f$ is a Cartesian pointset of the form \f$ \{ +x\in\E^d \mid x^T E x + x^T e + \eta\leq 0 \}\f$, where \f$ E\f$ is some +positive definite matrix from the set \f$ \mathbb{R}^{d\times d}\f$, \f$ e\f$ is some +real \f$ d\f$-vector, and \f$ \eta\in\mathbb{R}\f$. A pointset \f$ P\subseteq \E^d\f$ is +called full-dimensional if its affine hull has dimension \f$ d\f$. +For a finite, full-dimensional pointset \f$ P\f$ we denote by \f$ (P)\f$ the +smallest ellipsoid that contains all points of \f$ P\f$; this ellipsoid +exists and is unique. + +For a given finite and full-dimensional pointset \f$ P\subset \E^d\f$ and a +real number \f$ \epsilon\ge 0\f$, we say that an ellipsoid \f$ {\cal +E}\subset\E^d\f$ is an \f$ (1+\epsilon)\f$-appoximation to \f$ (P)\f$ if +\f$ P\subset {\cal E}\f$ and \f$ ({\cal E}) \leq (1+\epsilon) +((P))\f$. In other words, an \f$ (1+\epsilon)\f$-approximation to +\f$ (P)\f$ is an enclosing ellipsoid whose volume is by at most a +factor of \f$ 1+\epsilon\f$ larger than the volume of the smallest +enclosing ellipsoid of \f$ P\f$. + +Given this notation, an object of class `Approximate_min_ellipsoid_d` represents an +\f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$ for a given finite and +full-dimensional multiset of points \f$ P\subset\E^d\f$ and a real constant +\f$ \epsilon>0\f$.\cgalFootnote{A multiset is a set where elements may have multiplicity greater than \f$ 1\f$.} When an +`Approximate_min_ellipsoid_d` object is constructed, an +iterator over the points \f$ P\f$ and the number \f$ \epsilon\f$ have to be +specified; the number \f$ \epsilon\f$ defines the desired +approximation ratio \f$ 1+\epsilon\f$. The underlying algorithm will then +try to compute an \f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$, and one of +the following two cases takes place. +
      +
    • The algorithm determines that \f$ P\f$ is not full-dimensional (see +`is_full_dimensional()` below). + +Important note: due to rounding errors, the algorithm cannot +in all cases decide correctly whether \f$ P\f$ is full-dimensional or +not. If `is_full_dimensional()` returns `false`, the points +lie in such a "thin" subspace of \f$ \E^d\f$ that the algorithm is +incapable of computing an approximation to \f$ (P)\f$. More +precisely, if `is_full_dimensional()` returns `false`, there +exist two parallel hyperplanes in \f$ \E^d\f$ with the points \f$ P\f$ in +between so that the distance \f$ \delta\f$ between the hyperplanes is +very small, possible zero. (If \f$ \delta=0\f$ then \f$ P\f$ is not +full-dimensional.) + +If \f$ P\f$ is not full-dimensional, linear algebra techniques should be +used to determine an affine subspace \f$ S\f$ of \f$ \E^d\f$ that contains the +points \f$ P\f$ as a (w.r.t.\ \f$ S\f$) full-dimensional pointset; once \f$ S\f$ is +determined, the algorithm can be invoked again to compute an +approximation to (the lower-dimensional) \f$ (P)\f$ in \f$ S\f$. Since +`is_full_dimensional()` might (due to rounding errors, see +above) return `false` even though \f$ P\f$ is full-dimensional, the +lower-dimensional subspace \f$ S\f$ containing \f$ P\f$ need not exist. +Therefore, it might be more advisable to fit a hyperplane \f$ H\f$ +through the pointset \f$ P\f$, project \f$ P\f$ onto this affine subspace \f$ H\f$, +and compute an approximation to the minimum-volume enclosing +ellipsoid of the projected points within \f$ H\f$; the fitting can be +done for instance using the `linear_least_squares_fitting()` +function from the \cgal package `Principal_component_analysis`. +
    • The algorithm determines that \f$ P\f$ is full-dimensional. In this +case, it provides an approximation \f$ {\cal E}\f$ to \f$ (P)\f$, but +depending on the input problem (i.e., on the pair \f$ (P,\epsilon)\f$), +it may not have achieved the desired approximation ratio but merely +some worse approximation ratio \f$ 1+\epsilon'>1+\epsilon\f$. The +achieved approximation ratio \f$ 1+\epsilon'\f$ can be queried using +`achieved_epsilon()`, which returns \f$ \epsilon'\f$. The ellipsoid +\f$ {\cal E}\f$ itself can be queried via the methods +`defining_matrix()`, `defining_vector()`, and +`defining_scalar()`. +
    + +The ellipsoid \f$ {\cal E}\f$ computed by the algorithm satisfies the inclusions +\anchor eqapproximate_min_ellipsoid_incl +\f[ \frac{1}{(1+\epsilon')d} {\cal E} \subseteq \mathop{\rm conv}\nolimits(P) \subseteq {\cal E} -\f] -where \f$ f {\cal E}\f$ denotes the ellipsoid \f$ {\cal E}\f$ scaled by the -factor \f$ f\in\mathbb{R}^+\f$ with respect to its center, and where \f$ \mathop{\rm -conv}\nolimits(A)\f$ denotes the convex hull of a pointset -\f$ A\subset \E^d\f$. - -The underlying algorithm can cope with all kinds of inputs (multisets -\f$ P\f$, \f$ \epsilon\in[0,\infty)\f$) and terminates in all cases. There -is, however, no guarantee that any desired approximation ratio -is actually achieved; the performance of the algorithm in this respect -highly depends on the input pointset. Values of at least \f$ 0.01\f$ for -\f$ \epsilon\f$ are usually handled without problems. - -Internally, the algorithm represents the input points' Cartesian -coordinates as `double`'s. For this conversion to work, the input -point coordinates must be convertible to `double`. Also, in order -to compute the achieved epsilon \f$ \epsilon'\f$ mentioned above, the algorithm -requires a number type `ET` that provides exact arithmetic. -(Both these aspects are discussed in the documentation of the concept -`ApproximateMinEllipsoid_d_Traits_d`.) - - -\tparam Traits must be a model for `ApproximateMinEllipsoid_d_Traits_d`. +\f] +where \f$ f {\cal E}\f$ denotes the ellipsoid \f$ {\cal E}\f$ scaled by the +factor \f$ f\in\mathbb{R}^+\f$ with respect to its center, and where \f$ \mathop{\rm +conv}\nolimits(A)\f$ denotes the convex hull of a pointset +\f$ A\subset \E^d\f$. + +The underlying algorithm can cope with all kinds of inputs (multisets +\f$ P\f$, \f$ \epsilon\in[0,\infty)\f$) and terminates in all cases. There +is, however, no guarantee that any desired approximation ratio +is actually achieved; the performance of the algorithm in this respect +highly depends on the input pointset. Values of at least \f$ 0.01\f$ for +\f$ \epsilon\f$ are usually handled without problems. + +Internally, the algorithm represents the input points' Cartesian +coordinates as `double`'s. For this conversion to work, the input +point coordinates must be convertible to `double`. Also, in order +to compute the achieved epsilon \f$ \epsilon'\f$ mentioned above, the algorithm +requires a number type `ET` that provides exact arithmetic. +(Both these aspects are discussed in the documentation of the concept +`ApproximateMinEllipsoid_d_Traits_d`.) + + +\tparam Traits must be a model for `ApproximateMinEllipsoid_d_Traits_d`. We provide the model `CGAL::Approximate_min_ellipsoid_d_traits_d` using the \f$ d\f$-dimensional \cgal kernel; the models @@ -111,31 +111,31 @@ using the \f$ d\f$-dimensional \cgal kernel; the models `CGAL::Approximate_min_ellipsoid_d_traits_3` are for use with the \f$ 2\f$- and \f$ 3\f$-dimensional \cgal kernel, respectively. -\sa `CGAL::Min_ellipse_2` +\sa `CGAL::Min_ellipse_2` \cgalHeading{Implementation} -We implement Khachyian's algorithm for rounding -polytopes \cgalCite{cgal:k-rprnm-96}. Internally, we use -`double`-arithmetic and (initially a single) -Cholesky-decomposition. The algorithm's running time is -\f$ {\cal O}(nd^2(\epsilon^{-1}+\ln d + \ln\ln(n)))\f$, where \f$ n=|P|\f$ and -\f$ 1+\epsilon\f$ is the desired approximation ratio. +We implement Khachyian's algorithm for rounding +polytopes \cgalCite{cgal:k-rprnm-96}. Internally, we use +`double`-arithmetic and (initially a single) +Cholesky-decomposition. The algorithm's running time is +\f$ {\cal O}(nd^2(\epsilon^{-1}+\ln d + \ln\ln(n)))\f$, where \f$ n=|P|\f$ and +\f$ 1+\epsilon\f$ is the desired approximation ratio. \cgalHeading{Example} -To illustrate the usage of `Approximate_min_ellipsoid_d` we give two examples in 2D. The -first program generates a random set \f$ P\subset\E^2\f$ and outputs the -points and a \f$ 1.01\f$-approximation of \f$ (P)\f$ as an EPS-file, which -you can view using gv, for instance. (In both examples you can -change the variables `n` and `d` to experiment with the code.) +To illustrate the usage of `Approximate_min_ellipsoid_d` we give two examples in 2D. The +first program generates a random set \f$ P\subset\E^2\f$ and outputs the +points and a \f$ 1.01\f$-approximation of \f$ (P)\f$ as an EPS-file, which +you can view using gv, for instance. (In both examples you can +change the variables `n` and `d` to experiment with the code.) -\cgalExample{Approximate_min_ellipsoid_d/ellipsoid.cpp} +\cgalExample{Approximate_min_ellipsoid_d/ellipsoid.cpp} -The second program outputs the approximation in a format suitable -for display in Maplesoft's Maple. +The second program outputs the approximation in a format suitable +for display in Maplesoft's Maple. -\cgalExample{Approximate_min_ellipsoid_d/ellipsoid_for_maple.cpp} +\cgalExample{Approximate_min_ellipsoid_d/ellipsoid_for_maple.cpp} \note This class requires the \ref thirdpartyEigen library. @@ -144,58 +144,58 @@ template< typename Traits > class Approximate_min_ellipsoid_d { public: -/// \name Types +/// \name Types /// @{ /*! -`typedef Traits::FT FT` (which is always a -typedef to `double`). -*/ -typedef unspecified_type FT; +`typedef Traits::FT FT` (which is always a +typedef to `double`). +*/ +typedef unspecified_type FT; /*! -`typedef Traits::ET ET` (which is an exact number type used for exact computation like for example in `achieved_epsilon()`). -*/ -typedef unspecified_type ET; +`typedef Traits::ET ET` (which is an exact number type used for exact computation like for example in `achieved_epsilon()`). +*/ +typedef unspecified_type ET; /*! -`typedef Traits::Point Point` -*/ -typedef unspecified_type Point; +`typedef Traits::Point Point` +*/ +typedef unspecified_type Point; /*! -`typedef Traits::Cartesian_const_iterator Cartesian_const_iterator` -*/ -typedef unspecified_type Cartesian_const_iterator; +`typedef Traits::Cartesian_const_iterator Cartesian_const_iterator` +*/ +typedef unspecified_type Cartesian_const_iterator; /*! -A model of STL concept -`RandomAccessIterator` with value type `double` that is used -to iterate over the Cartesian center coordinates of the computed -ellipsoid, see `center_cartesian_begin()`. -*/ -typedef unspecified_type Center_coordinate_iterator; +A model of STL concept +`RandomAccessIterator` with value type `double` that is used +to iterate over the Cartesian center coordinates of the computed +ellipsoid, see `center_cartesian_begin()`. +*/ +typedef unspecified_type Center_coordinate_iterator; /*! -A model of STL concept -`RandomAccessIterator` with value type `double` that is used -to iterate over the lengths of the semiaxes of the computed ellipsoid, -see `axes_lengths_begin()`. -*/ -typedef unspecified_type Axes_lengths_iterator; +A model of STL concept +`RandomAccessIterator` with value type `double` that is used +to iterate over the lengths of the semiaxes of the computed ellipsoid, +see `axes_lengths_begin()`. +*/ +typedef unspecified_type Axes_lengths_iterator; /*! -A model of STL concept -`RandomAccessIterator` with value type `double` that is used -to iterate over the %Cartesian coordinates of the direction of a fixed -axis of the computed ellipsoid, see -`axis_direction_cartesian_begin()`. -*/ -typedef unspecified_type Axis_direction_iterator; +A model of STL concept +`RandomAccessIterator` with value type `double` that is used +to iterate over the %Cartesian coordinates of the direction of a fixed +axis of the computed ellipsoid, see +`axis_direction_cartesian_begin()`. +*/ +typedef unspecified_type Axis_direction_iterator; -/// @} +/// @} -/// \name Creation +/// \name Creation /// An object of type `Approximate_min_ellipsoid_d` can be created /// from an arbitrary point set \f$ P\f$ and some nonnegative `double` /// value `eps`. @@ -203,31 +203,31 @@ typedef unspecified_type Axis_direction_iterator; /*! -initializes `ame` to an \f$ (1+\epsilon)\f$-approximation of -\f$ (P)\f$ with \f$ P\f$ being the set of points in the range -[`first`,`last`). The number \f$ \epsilon\f$ in this will -be at most `eps`, if possible. However, due to the -limited precision in the algorithm's underlying arithmetic, it -can happen that the computed approximation ellipsoid has a -worse approximation ratio (and \f$ \epsilon\f$ can thus be larger -than `eps` in general). In any case, the number -\f$ \epsilon\f$ (and with this, the achived approximation -\f$ 1+\epsilon\f$) can be queried by calling the routine -`achieved_epsilon()` discussed below. +initializes `ame` to an \f$ (1+\epsilon)\f$-approximation of +\f$ (P)\f$ with \f$ P\f$ being the set of points in the range +[`first`,`last`). The number \f$ \epsilon\f$ in this will +be at most `eps`, if possible. However, due to the +limited precision in the algorithm's underlying arithmetic, it +can happen that the computed approximation ellipsoid has a +worse approximation ratio (and \f$ \epsilon\f$ can thus be larger +than `eps` in general). In any case, the number +\f$ \epsilon\f$ (and with this, the achived approximation +\f$ 1+\epsilon\f$) can be queried by calling the routine +`achieved_epsilon()` discussed below. \tparam Iterator must be a model of `InputIterator` with `Point` as value type. -\pre The dimension \f$ d\f$ of the input points must be at least \f$ 2\f$, and \f$ \epsilon>0\f$. -*/ -template < class Iterator > -Approximate_min_ellipsoid_d(double eps, -Iterator first, -Iterator last, -const Traits& traits = Traits() ); +\pre The dimension \f$ d\f$ of the input points must be at least \f$ 2\f$, and \f$ \epsilon>0\f$. +*/ +template < class Iterator > +Approximate_min_ellipsoid_d(double eps, +Iterator first, +Iterator last, +const Traits& traits = Traits() ); -/// @} +/// @} -/// \name Access Functions +/// \name Access Functions /// The following methods can be used to query the achieved /// approximation ratio \f$ 1+\epsilon'\f$ and the computed ellipsoid /// \f$ {\cal E} = \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq 0 @@ -252,155 +252,155 @@ const Traits& traits = Traits() ); /*! -returns the number of points of `ame`, i.e., \f$ |P|\f$. -*/ -unsigned int number_of_points( ) const; +returns the number of points of `ame`, i.e., \f$ |P|\f$. +*/ +unsigned int number_of_points( ) const; /*! -returns a number -\f$ \epsilon'\f$ such that the computed approximation is (under exact -arithmetic) guaranteed to be an \f$ (1+\epsilon')\f$-approximation to -\f$ (P)\f$. -\pre `ame.is_full_dimensional() == true`. -\post \f$ \epsilon'>0\f$. -*/ -double achieved_epsilon() const; +returns a number +\f$ \epsilon'\f$ such that the computed approximation is (under exact +arithmetic) guaranteed to be an \f$ (1+\epsilon')\f$-approximation to +\f$ (P)\f$. +\pre `ame.is_full_dimensional() == true`. +\post \f$ \epsilon'>0\f$. +*/ +double achieved_epsilon() const; /*! -gives access to the \f$ (i,j)\f$th entry of the matrix \f$ E\f$ in the -representation \f$ \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq0 -\}\f$ of the computed approximation ellipsoid \f$ {\cal E}\f$. The number returned by -this routine is \f$ (1+\epsilon')(d+1)\,E_{ij}\f$, where \f$ \epsilon'\f$ is -the number returned by `achieved_epsilon()`. -\pre \f$ 0\leq i,j\leq d\f$, where \f$ d\f$ is the dimension of the points \f$ P\f$, and `ame.is_full_dimensional() == true`. -*/ -double defining_matrix(int i,int j) const; +gives access to the \f$ (i,j)\f$th entry of the matrix \f$ E\f$ in the +representation \f$ \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq0 +\}\f$ of the computed approximation ellipsoid \f$ {\cal E}\f$. The number returned by +this routine is \f$ (1+\epsilon')(d+1)\,E_{ij}\f$, where \f$ \epsilon'\f$ is +the number returned by `achieved_epsilon()`. +\pre \f$ 0\leq i,j\leq d\f$, where \f$ d\f$ is the dimension of the points \f$ P\f$, and `ame.is_full_dimensional() == true`. +*/ +double defining_matrix(int i,int j) const; /*! -gives access to the \f$ i\f$th entry of the vector \f$ e\f$ in the -representation \f$ \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq0 -\}\f$ of the computed approximation ellipsoid \f$ {\cal E}\f$. The number returned by -this routine is \f$ (1+\epsilon')(d+1)\,e_{i}\f$, where \f$ \epsilon'\f$ is -the number returned by `achieved_epsilon()`. -\pre \f$ 0\leq i\leq d\f$, where \f$ d\f$ is the dimension of the points \f$ P\f$, and `ame.is_full_dimensional() == true`. -*/ -double defining_vector(int i) const; +gives access to the \f$ i\f$th entry of the vector \f$ e\f$ in the +representation \f$ \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq0 +\}\f$ of the computed approximation ellipsoid \f$ {\cal E}\f$. The number returned by +this routine is \f$ (1+\epsilon')(d+1)\,e_{i}\f$, where \f$ \epsilon'\f$ is +the number returned by `achieved_epsilon()`. +\pre \f$ 0\leq i\leq d\f$, where \f$ d\f$ is the dimension of the points \f$ P\f$, and `ame.is_full_dimensional() == true`. +*/ +double defining_vector(int i) const; /*! -gives access to the scalar \f$ \eta\f$ from the -representation \f$ \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq0 -\}\f$ of the computed approximation ellipsoid \f$ {\cal E}\f$. The number returned by -this routine is \f$ (1+\epsilon')(d+1)\,(\eta+1)\f$, where \f$ \epsilon'\f$ is -the number returned by `achieved_epsilon()`. -\pre `ame.is_full_dimensional() == true`. -*/ -double defining_scalar() const; +gives access to the scalar \f$ \eta\f$ from the +representation \f$ \{ x\in\E^d \mid x^T E x + x^T e + \eta\leq0 +\}\f$ of the computed approximation ellipsoid \f$ {\cal E}\f$. The number returned by +this routine is \f$ (1+\epsilon')(d+1)\,(\eta+1)\f$, where \f$ \epsilon'\f$ is +the number returned by `achieved_epsilon()`. +\pre `ame.is_full_dimensional() == true`. +*/ +double defining_scalar() const; /*! -returns a const reference to the traits class object. -*/ -const Traits& traits( ) const; +returns a const reference to the traits class object. +*/ +const Traits& traits( ) const; /*! -returns the dimension of -the ambient space, i.e., the dimension of the points \f$ P\f$. -*/ -int dimension() const; +returns the dimension of +the ambient space, i.e., the dimension of the points \f$ P\f$. +*/ +int dimension() const; /*! -returns an iterator pointing to the first of the \f$ d\f$ Cartesian -coordinates of the computed ellipsoid's center. +returns an iterator pointing to the first of the \f$ d\f$ Cartesian +coordinates of the computed ellipsoid's center. -The returned point is a floating-point approximation to the -ellipsoid's exact center; no guarantee is given w.r.t.\ the involved -relative error. \pre `ame.is_full_dimensional() == true`. -*/ -Center_coordinate_iterator center_cartesian_begin(); +The returned point is a floating-point approximation to the +ellipsoid's exact center; no guarantee is given w.r.t.\ the involved +relative error. \pre `ame.is_full_dimensional() == true`. +*/ +Center_coordinate_iterator center_cartesian_begin(); /*! -returns the past-the-end iterator corresponding to -`center_cartesian_begin()`. -\pre `ame.is_full_dimensional() == true`. -*/ -Center_coordinate_iterator center_cartesian_end(); +returns the past-the-end iterator corresponding to +`center_cartesian_begin()`. +\pre `ame.is_full_dimensional() == true`. +*/ +Center_coordinate_iterator center_cartesian_end(); /*! -returns an iterator pointing to the first of the \f$ d\f$ descendantly -sorted lengths of the computed ellipsoid's axes. The \f$ d\f$ returned -numbers are floating-point approximations to the exact -axes-lengths of the computed ellipsoid; no guarantee is given -w.r.t.\ the involved relative error. (See also method -`axes_direction_cartesian_begin()`.) \pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$. -*/ -Axes_lengths_iterator axes_lengths_begin(); +returns an iterator pointing to the first of the \f$ d\f$ descendantly +sorted lengths of the computed ellipsoid's axes. The \f$ d\f$ returned +numbers are floating-point approximations to the exact +axes-lengths of the computed ellipsoid; no guarantee is given +w.r.t.\ the involved relative error. (See also method +`axes_direction_cartesian_begin()`.) \pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$. +*/ +Axes_lengths_iterator axes_lengths_begin(); /*! -returns the past-the-end iterator corresponding to -`axes_lengths_begin()`. \pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$. -*/ -Axes_lengths_iterator axes_lengths_end(); +returns the past-the-end iterator corresponding to +`axes_lengths_begin()`. \pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$. +*/ +Axes_lengths_iterator axes_lengths_end(); /*! -returns an iterator -pointing to the first of the \f$ d\f$ %Cartesian coordinates of the -computed ellipsoid's \f$ i\f$th axis direction (i.e., unit vector in -direction of the ellipsoid's \f$ i\f$th axis). The direction described -by this iterator is a floating-point approximation to the exact -axis direction of the computed ellipsoid; no guarantee is given -w.r.t.\ the involved relative error. An approximation to the -length of axis \f$ i\f$ is given by the \f$ i\f$th entry of -`axes_lengths_begin()`. -\pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$, and \f$ 0\leq i < d\f$. -*/ -Axes_direction_coordinate_iterator -axis_direction_cartesian_begin(int i); +returns an iterator +pointing to the first of the \f$ d\f$ %Cartesian coordinates of the +computed ellipsoid's \f$ i\f$th axis direction (i.e., unit vector in +direction of the ellipsoid's \f$ i\f$th axis). The direction described +by this iterator is a floating-point approximation to the exact +axis direction of the computed ellipsoid; no guarantee is given +w.r.t.\ the involved relative error. An approximation to the +length of axis \f$ i\f$ is given by the \f$ i\f$th entry of +`axes_lengths_begin()`. +\pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$, and \f$ 0\leq i < d\f$. +*/ +Axes_direction_coordinate_iterator +axis_direction_cartesian_begin(int i); /*! -returns the past-the-end -iterator corresponding to -`axis_direction_cartesian_begin()`.\pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$, and \f$ 0\leq i < d\f$. -*/ -Axes_direction_coordinate_iterator -axis_direction_cartesian_end(int i); +returns the past-the-end +iterator corresponding to +`axis_direction_cartesian_begin()`.\pre `ame.is_full_dimensional() == true`, and \f$ d\in\{2,3\}\f$, and \f$ 0\leq i < d\f$. +*/ +Axes_direction_coordinate_iterator +axis_direction_cartesian_end(int i); -/// @} +/// @} -/// \name Predicates +/// \name Predicates /// @{ /*! -returns whether -\f$ P\f$ is full-dimensional or not, i.e., returns `true` if -and only if \f$ P\f$ is full-dimensional. -Note: due to -the limited precision in the algorithm's underlying -arithmetic, the result of this method is not always -correct. Rather, a return value of `false` means that the -points \f$ P\f$ are contained in a "very thin" linear subspace of -\f$ \E^d\f$, and as a consequence, the algorithm cannot compute an -approximation. More precisely, a return value of `false` -means that the points \f$ P\f$ are contained between two parallel -hyperplanes in \f$ \E^d\f$ that are very close to each other -(possibly at distance zero) - so close, that the algorithm -could not compute an approximation ellipsoid. Similarly, a -return value of `true` does not guarantee \f$ P\f$ to be -full-dimensional; but there exists an input pointset \f$ P'\f$ such -that the points \f$ P'\f$ and \f$ P\f$ have almost identical coordinates -and \f$ P'\f$ is full-dimensional. -*/ -bool is_full_dimensional( ) const; - -/// @} - -/// \name Validity Check +returns whether +\f$ P\f$ is full-dimensional or not, i.e., returns `true` if +and only if \f$ P\f$ is full-dimensional. +Note: due to +the limited precision in the algorithm's underlying +arithmetic, the result of this method is not always +correct. Rather, a return value of `false` means that the +points \f$ P\f$ are contained in a "very thin" linear subspace of +\f$ \E^d\f$, and as a consequence, the algorithm cannot compute an +approximation. More precisely, a return value of `false` +means that the points \f$ P\f$ are contained between two parallel +hyperplanes in \f$ \E^d\f$ that are very close to each other +(possibly at distance zero) - so close, that the algorithm +could not compute an approximation ellipsoid. Similarly, a +return value of `true` does not guarantee \f$ P\f$ to be +full-dimensional; but there exists an input pointset \f$ P'\f$ such +that the points \f$ P'\f$ and \f$ P\f$ have almost identical coordinates +and \f$ P'\f$ is full-dimensional. +*/ +bool is_full_dimensional( ) const; + +/// @} + +/// \name Validity Check /// An object `ame` is valid iff