From 633e4e7b0cdebff673d59d1dde91d9dbc134951c Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 15 Nov 2023 14:46:59 +0100 Subject: [PATCH] ongoing renaming --- Documentation/doc/Documentation/packages.txt | 2 +- .../Kinetic_shape_partition/CMakeLists.txt | 2 +- .../include/CGAL/KSP_2/Data_structure.h | 54 +++++++++---------- .../include/CGAL/KSP_2/Event.h | 12 ++--- .../include/CGAL/KSP_2/Event_queue.h | 16 +++--- .../include/CGAL/KSP_2/Meta_vertex.h | 12 ++--- .../include/CGAL/KSP_2/Segment.h | 10 ++-- .../include/CGAL/KSP_2/Support_line.h | 16 +++--- .../include/CGAL/KSP_2/Vertex.h | 16 +++--- .../include/CGAL/Kinetic_shape_partition_2.h | 24 ++++----- 10 files changed, 82 insertions(+), 82 deletions(-) diff --git a/Documentation/doc/Documentation/packages.txt b/Documentation/doc/Documentation/packages.txt index 07f627cb2dd..720453ce15e 100644 --- a/Documentation/doc/Documentation/packages.txt +++ b/Documentation/doc/Documentation/packages.txt @@ -102,7 +102,7 @@ \package_listing{Scale_space_reconstruction_3} \package_listing{Advancing_front_surface_reconstruction} \package_listing{Polygonal_surface_reconstruction} -\package_listing{Kinetic_shape_reconstruction} +\package_listing{Kinetic_shape_partition} \package_listing{Optimal_transportation_reconstruction_2} \cgalPackageSection{PartGeometryProcessing,Geometry Processing} diff --git a/Kinetic_shape_partition/examples/Kinetic_shape_partition/CMakeLists.txt b/Kinetic_shape_partition/examples/Kinetic_shape_partition/CMakeLists.txt index 4a4c0193a2b..31fefaedffd 100644 --- a/Kinetic_shape_partition/examples/Kinetic_shape_partition/CMakeLists.txt +++ b/Kinetic_shape_partition/examples/Kinetic_shape_partition/CMakeLists.txt @@ -20,7 +20,7 @@ if(Boost_FOUND) message(STATUS "Found Eigen") include(CGAL_Eigen_support) - set(targets kinetic_partition) + set(targets kinetic_partition kinetic_2d) set(project_linked_libraries) set(project_compilation_definitions) diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Data_structure.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Data_structure.h index de4ad38352f..72c070e43c2 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Data_structure.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Data_structure.h @@ -10,22 +10,22 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_DATA_STRUCTURE_H -#define CGAL_KSR_2_DATA_STRUCTURE_H +#ifndef CGAL_KSP_2_DATA_STRUCTURE_H +#define CGAL_KSP_2_DATA_STRUCTURE_H //#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include namespace CGAL { -namespace KSR_2 +namespace KSP_2 { template @@ -41,11 +41,11 @@ public: typedef typename Kernel::Line_2 Line_2; typedef typename Kernel::Segment_2 Segment_2; - typedef KSR_2::Support_line Support_line; - typedef KSR_2::Segment Segment; - typedef KSR_2::Vertex Vertex; + typedef KSP_2::Support_line Support_line; + typedef KSP_2::Segment Segment; + typedef KSP_2::Vertex Vertex; - typedef KSR_2::Meta_vertex Meta_vertex; + typedef KSP_2::Meta_vertex Meta_vertex; typedef std::vector Support_lines; typedef std::vector Segments; @@ -109,7 +109,7 @@ public: std::string segment_str (std::size_t segment_idx) const { return "Segment[" + std::to_string(segment_idx) - + " from " + (segment(segment_idx).input_idx() == KSR::no_element() ? + + " from " + (segment(segment_idx).input_idx() == KSP::no_element() ? "bbox" : std::to_string(segment(segment_idx).input_idx())) + "](v" + std::to_string(segment(segment_idx).source_idx()) + "->v" + std::to_string(segment(segment_idx).target_idx()) @@ -213,7 +213,7 @@ public: { return meta_vertex_of_vertex(m_vertices[vertex_idx]); } bool has_meta_vertex (const Vertex& vertex) const - { return vertex.meta_vertex_idx() != KSR::no_element(); } + { return vertex.meta_vertex_idx() != KSP::no_element(); } bool has_meta_vertex (std::size_t vertex_idx) const { return has_meta_vertex (m_vertices[vertex_idx]); } @@ -290,7 +290,7 @@ public: bool is_bbox_meta_edge (std::size_t source_idx, std::size_t target_idx) const { - std::size_t common_line_idx = KSR::no_element(); + std::size_t common_line_idx = KSP::no_element(); for (std::size_t support_line_idx : meta_vertex(source_idx).support_lines_idx()) if (m_meta_vertices[target_idx].support_lines_idx().find(support_line_idx) @@ -300,7 +300,7 @@ public: break; } - CGAL_assertion (common_line_idx != KSR::no_element()); + CGAL_assertion (common_line_idx != KSP::no_element()); return is_bbox_support_line (common_line_idx); } @@ -363,11 +363,11 @@ public: return std::size_t(m_support_lines.size() - 1); } - Segment& add_segment (const Segment_2 segment, std::size_t input_idx = KSR::no_element()) + Segment& add_segment (const Segment_2 segment, std::size_t input_idx = KSP::no_element()) { // Check if support line exists first Support_line new_support_line (segment); - std::size_t support_line_idx = KSR::no_element(); + std::size_t support_line_idx = KSP::no_element(); for (std::size_t i = 0; i < number_of_support_lines(); ++ i) if (new_support_line == support_line(i)) { @@ -375,12 +375,12 @@ public: break; } - if (support_line_idx == KSR::no_element()) + if (support_line_idx == KSP::no_element()) { support_line_idx = number_of_support_lines(); m_support_lines.push_back (new_support_line); - if (input_idx == KSR::no_element()) + if (input_idx == KSP::no_element()) { m_support_lines.back().minimum() = m_support_lines.back().to_1d (segment.source()); m_support_lines.back().maximum() = m_support_lines.back().to_1d (segment.target()); @@ -393,7 +393,7 @@ public: for (std::size_t i = 0; i < 4; ++ i) { Point_2 point; - if (!KSR::intersection(m_support_lines[i].line(), m_support_lines.back().line(), point)) + if (!KSP::intersection(m_support_lines[i].line(), m_support_lines.back().line(), point)) continue; FT position = m_support_lines.back().to_1d (point); @@ -436,7 +436,7 @@ public: std::size_t add_meta_vertex (const Point_2& point, std::size_t support_line_idx_0, - std::size_t support_line_idx_1 = KSR::no_element()) + std::size_t support_line_idx_1 = KSP::no_element()) { // Avoid several points almost equal Point_2 p (1e-10 * std::floor(CGAL::to_double(point.x()) / 1e-10), @@ -452,7 +452,7 @@ public: for (std::size_t support_line_idx : { support_line_idx_0, support_line_idx_1 }) { - if (support_line_idx != KSR::no_element()) + if (support_line_idx != KSP::no_element()) { meta_vertex(meta_vertex_idx).support_lines_idx().insert (support_line_idx); @@ -464,7 +464,7 @@ public: } // Special case = meta vertex is deadend of one line - if (support_line_idx_1 == KSR::no_element()) + if (support_line_idx_1 == KSP::no_element()) { meta_vertex(meta_vertex_idx).make_deadend_of (support_line_idx_0); } @@ -585,7 +585,7 @@ public: m_vertices[source_idx].freeze(m_current_time); // Release other end - m_vertices[target_idx].meta_vertex_idx() = KSR::no_element(); + m_vertices[target_idx].meta_vertex_idx() = KSP::no_element(); return target_idx; } @@ -598,7 +598,7 @@ public: }; -}} // namespace CGAL::KSR_3 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_3_DATA_STRUCTURE_H +#endif // CGAL_KSP_2_DATA_STRUCTURE_H diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Event.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Event.h index c8735a0d3aa..b50e2d0c989 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Event.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Event.h @@ -10,17 +10,17 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_EVENT_H -#define CGAL_KSR_2_EVENT_H +#ifndef CGAL_KSP_2_EVENT_H +#define CGAL_KSP_2_EVENT_H //#include -#include +#include namespace CGAL { -namespace KSR_2 +namespace KSP_2 { template @@ -68,7 +68,7 @@ public: }; -}} // namespace CGAL::KSR_2 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_2_EVENT_H +#endif // CGAL_KSP_2_EVENT_H diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Event_queue.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Event_queue.h index e7d49996d38..05c09717599 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Event_queue.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Event_queue.h @@ -10,13 +10,13 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_EVENT_QUEUE_H -#define CGAL_KSR_2_EVENT_QUEUE_H +#ifndef CGAL_KSP_2_EVENT_QUEUE_H +#define CGAL_KSP_2_EVENT_QUEUE_H //#include -#include -#include +#include +#include #include #include @@ -26,7 +26,7 @@ namespace CGAL { -namespace KSR_2 +namespace KSP_2 { template @@ -36,7 +36,7 @@ public: typedef GeomTraits Kernel; typedef typename Kernel::FT FT; - typedef KSR_2::Event Event; + typedef KSP_2::Event Event; private: @@ -101,7 +101,7 @@ public: }; -}} // namespace CGAL::KSR_2 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_2_EVENT_QUEUE_H +#endif // CGAL_KSP_2_EVENT_QUEUE_H diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Meta_vertex.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Meta_vertex.h index 2dd9848bdd7..fb41a6a83a6 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Meta_vertex.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Meta_vertex.h @@ -10,18 +10,18 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_META_VERTEX_H -#define CGAL_KSR_2_META_VERTEX_H +#ifndef CGAL_KSP_2_META_VERTEX_H +#define CGAL_KSP_2_META_VERTEX_H //#include -#include +#include #include namespace CGAL { -namespace KSR_2 +namespace KSP_2 { template @@ -58,7 +58,7 @@ public: }; -}} // namespace CGAL::KSR_2 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_2_META_VERTEX_H +#endif // CGAL_KSP_2_META_VERTEX_H diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Segment.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Segment.h index 1192314b75b..718be50d127 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Segment.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Segment.h @@ -10,15 +10,15 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_SEGMENT_H -#define CGAL_KSR_2_SEGMENT_H +#ifndef CGAL_KSP_2_SEGMENT_H +#define CGAL_KSP_2_SEGMENT_H //#include namespace CGAL { -namespace KSR_2 +namespace KSP_2 { class Segment @@ -48,7 +48,7 @@ public: }; -}} // namespace CGAL::KSR_2 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_2_POLYGON_H +#endif // CGAL_KSP_2_POLYGON_H diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Support_line.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Support_line.h index fb9e9f82142..0eeac2de053 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Support_line.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Support_line.h @@ -10,18 +10,18 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_SUPPORT_LINE_H -#define CGAL_KSR_2_SUPPORT_LINE_H +#ifndef CGAL_KSP_2_SUPPORT_LINE_H +#define CGAL_KSP_2_SUPPORT_LINE_H //#include -#include -#include +#include +#include namespace CGAL { -namespace KSR_2 +namespace KSP_2 { template @@ -55,7 +55,7 @@ public: , m_connected_components(1) { m_origin = CGAL::midpoint (segment.source(), segment.target()); - m_vector = KSR::normalize (Vector_2 (segment.source(), segment.target())); + m_vector = KSP::normalize (Vector_2 (segment.source(), segment.target())); } Line_2 line() const { return Line_2 (m_origin, m_vector); } @@ -121,7 +121,7 @@ bool operator== } #endif -}} // namespace CGAL::KSR_2 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_2_SUPPORT_LINE_H +#endif // CGAL_KSP_2_SUPPORT_LINE_H diff --git a/Kinetic_shape_partition/include/CGAL/KSP_2/Vertex.h b/Kinetic_shape_partition/include/CGAL/KSP_2/Vertex.h index 318e5c4f612..3b0e11f0958 100644 --- a/Kinetic_shape_partition/include/CGAL/KSP_2/Vertex.h +++ b/Kinetic_shape_partition/include/CGAL/KSP_2/Vertex.h @@ -10,17 +10,17 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_KSR_2_VERTEX_H -#define CGAL_KSR_2_VERTEX_H +#ifndef CGAL_KSP_2_VERTEX_H +#define CGAL_KSP_2_VERTEX_H //#include -#include +#include namespace CGAL { -namespace KSR_2 +namespace KSP_2 { template @@ -39,13 +39,13 @@ public: Vertex () { } Vertex (FT point, - std::size_t segment_idx = KSR::no_element(), + std::size_t segment_idx = KSP::no_element(), unsigned int remaining_intersections = 0) : m_point (point) , m_direction (0) , m_segment_idx (segment_idx) , m_remaining_intersections(remaining_intersections) - , m_meta_vertex_idx (KSR::no_element()) + , m_meta_vertex_idx (KSP::no_element()) { } @@ -82,7 +82,7 @@ public: }; -}} // namespace CGAL::KSR_2 +}} // namespace CGAL::KSP_2 -#endif // CGAL_KSR_2_VERTEX_H +#endif // CGAL_KSP_2_VERTEX_H diff --git a/Kinetic_shape_partition/include/CGAL/Kinetic_shape_partition_2.h b/Kinetic_shape_partition/include/CGAL/Kinetic_shape_partition_2.h index 18e4338c3e2..706f85f9f12 100644 --- a/Kinetic_shape_partition/include/CGAL/Kinetic_shape_partition_2.h +++ b/Kinetic_shape_partition/include/CGAL/Kinetic_shape_partition_2.h @@ -43,15 +43,15 @@ public: typedef typename Kernel::Ray_2 Ray_2; typedef typename Kernel::Vector_2 Vector_2; - typedef KSR_2::Data_structure Data; + typedef KSP_2::Data_structure Data; typedef typename Data::Support_line Support_line; typedef typename Data::Segment Segment; typedef typename Data::Vertex Vertex; typedef typename Data::Meta_vertex Meta_vertex; - typedef KSR_2::Event Event; - typedef KSR_2::Event_queue Event_queue; + typedef KSP_2::Event Event; + typedef KSP_2::Event_queue Event_queue; private: @@ -124,7 +124,7 @@ public: const Support_line& support_line = m_data.support_line(i); for (std::size_t s : support_line.segments_idx()) { - if (s == KSR::no_element()) + if (s == KSP::no_element()) { if (verbose) std::cerr << "ERROR: Support_line[" << i @@ -268,7 +268,7 @@ public: << "] is on Segment[-1]" << std::endl; return false; } - // if (vertex.meta_vertex_idx() == KSR::no_element()) + // if (vertex.meta_vertex_idx() == KSP::no_element()) // { // if (verbose) // std::cerr << "ERROR: Vertex[" << i @@ -618,7 +618,7 @@ private: != m_data.segment(segment_idx_b).support_line_idx()); Point_2 point; - if (!KSR::intersection(segments_2[segment_idx_a], segments_2[segment_idx_b], point)) + if (!KSP::intersection(segments_2[segment_idx_a], segments_2[segment_idx_b], point)) return; todo.push_back (std::make_tuple (point, @@ -712,7 +712,7 @@ private: continue; Point_2 point; - if (!KSR::intersection(si, segments_2[segment_idx], point)) + if (!KSP::intersection(si, segments_2[segment_idx], point)) continue; Support_line& sli = m_data.support_line_of_vertex(vertex); @@ -896,7 +896,7 @@ private: m_data.vertex(ev.vertex_idx()).remaining_intersections() --; // If there are still intersections to be made, propagate - std::size_t new_vertex_idx = KSR::no_element(); + std::size_t new_vertex_idx = KSP::no_element(); if (m_data.vertex(ev.vertex_idx()).remaining_intersections() != 0) new_vertex_idx = m_data.propagate_segment (ev.vertex_idx()); else @@ -912,7 +912,7 @@ private: std::vector events; m_queue.erase_vertex_events (old_vertex, events); - if (new_vertex != KSR::no_element()) + if (new_vertex != KSP::no_element()) for (Event& ev : events) { ev.vertex_idx() = new_vertex; @@ -934,13 +934,13 @@ private: CGAL_assertion (support_line.meta_vertices_idx().size() > 1); - std::size_t beginning = KSR::no_element(); - std::size_t end = KSR::no_element(); + std::size_t beginning = KSP::no_element(); + std::size_t end = KSP::no_element(); for (std::size_t segment_idx : support_line.segments_idx()) { // New segment - if (beginning == KSR::no_element()) + if (beginning == KSP::no_element()) { beginning = m_data.source_of_segment(segment_idx).meta_vertex_idx(); end = m_data.target_of_segment(segment_idx).meta_vertex_idx();