From f324618c87f12799c56d0c01b5effe6d7e7041f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 18 Jun 2020 10:58:41 +0200 Subject: [PATCH] Add FaceData / Face_data to TDS_2 --- TDS_2/doc/TDS_2/Concepts/FaceData.h | 58 +++++++++++++++++++ .../Concepts/TriangulationDSFaceBase_2.h | 25 ++++++++ .../Concepts/TriangulationDataStructure_2.h | 5 ++ TDS_2/doc/TDS_2/PackageDescription.txt | 1 + .../CGAL/Triangulation_data_structure_2.h | 16 +++++ .../CGAL/Triangulation_ds_face_base_2.h | 1 + 6 files changed, 106 insertions(+) create mode 100644 TDS_2/doc/TDS_2/Concepts/FaceData.h diff --git a/TDS_2/doc/TDS_2/Concepts/FaceData.h b/TDS_2/doc/TDS_2/Concepts/FaceData.h new file mode 100644 index 00000000000..b69cbd324c3 --- /dev/null +++ b/TDS_2/doc/TDS_2/Concepts/FaceData.h @@ -0,0 +1,58 @@ + +/*! +\ingroup PkgTDS2Concepts + +\cgalConcept + +The concept `FaceData` describes the requirements on the type which +is used to mark some faces during modifications of the 2D triangulation data +structure. + +\sa `TriangulationDataStructure_2` +\sa `TriangulationDSFaceBase_2` +*/ + +class FaceData +{ +public: + + /*! + Clear all data. + */ + void clear(); + + /*! + Mark the face as "in conflict". + */ + void mark_in_conflict(); + + /*! + Mark the face as "on boundary". + */ + void mark_on_boundary(); + + /*! + Mark the face as processed. + */ + void mark_processed(); + + /*! + Returns `true` if the face is not marked as "in conflict", "on boundary", or "processed", and `false` otherwise. + */ + void is_clear(); + + /*! + Returns `true` if the face is marked as "in conflict", `false` otherwise. + */ + void is_in_conflict(); + + /*! + Returns `true` if the face is marked as "on boundary", `false` otherwise. + */ + void is_on_boundary(); + + /*! + Returns `true` if the face is marked as processed, `false` otherwise. + */ + bool processed() const; +}; diff --git a/TDS_2/doc/TDS_2/Concepts/TriangulationDSFaceBase_2.h b/TDS_2/doc/TDS_2/Concepts/TriangulationDSFaceBase_2.h index 4d17e03cf52..62ebb3015f6 100644 --- a/TDS_2/doc/TDS_2/Concepts/TriangulationDSFaceBase_2.h +++ b/TDS_2/doc/TDS_2/Concepts/TriangulationDSFaceBase_2.h @@ -95,6 +95,11 @@ typedef TriangulationDataStructure_2::Vertex_handle Vertex_handle; */ typedef TriangulationDataStructure_2::Face_handle Face_handle; +/*! + +*/ +typedef TriangulationDataStructure_2::Face_data TDS_data; + /// @} /// \name Creation @@ -274,5 +279,25 @@ void * & for_compact_container(); /// @} +/// \name Internal +/// \cgalAdvancedBegin +/// These functions are used internally by the triangulation data +/// structure. The user is not encouraged to use them directly as they +/// may change in the future. +/// \cgalAdvancedEnd +/// @{ + +/*! + +*/ +TDS_data& tds_data(); + +/*! + +*/ +const TDS_data& tds_data() const; + +/// @} + }; /* end TriangulationDSFaceBase_2 */ diff --git a/TDS_2/doc/TDS_2/Concepts/TriangulationDataStructure_2.h b/TDS_2/doc/TDS_2/Concepts/TriangulationDataStructure_2.h index 4b025c1b7e4..c7ecee47ac6 100644 --- a/TDS_2/doc/TDS_2/Concepts/TriangulationDataStructure_2.h +++ b/TDS_2/doc/TDS_2/Concepts/TriangulationDataStructure_2.h @@ -98,6 +98,11 @@ The face type, requirements for this type are described in concept `Triangulatio */ typedef unspecified_type Face; +/*! +A model of the concept `FaceData`. +*/ +typedef unspecified_type Face_data; + /*! Handle to a vertex. \cgalModels `Handle` diff --git a/TDS_2/doc/TDS_2/PackageDescription.txt b/TDS_2/doc/TDS_2/PackageDescription.txt index 95e6f385c9f..f60784c957a 100644 --- a/TDS_2/doc/TDS_2/PackageDescription.txt +++ b/TDS_2/doc/TDS_2/PackageDescription.txt @@ -50,6 +50,7 @@ These refining concepts and their models are described in Chapter \cgalClassifedRefPages \cgalCRPSection{Concepts} +- `FaceData` - `TriangulationDataStructure_2` - `TriangulationDataStructure_2::Face` - `TriangulationDataStructure_2::Vertex` diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index 303115158b2..600150f633e 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -69,6 +69,22 @@ public: typedef Triangulation_data_structure_2 Other; }; + class Face_data { + unsigned char conflict_state; + public: + Face_data() : conflict_state(0) {} + + void clear() { conflict_state = 0; } + void mark_in_conflict() { conflict_state = 1; } + void mark_on_boundary() { conflict_state = 2; } + void mark_processed() { conflict_state = 1; } + + bool is_clear() const { return conflict_state == 0; } + bool is_in_conflict() const { return conflict_state == 1; } + bool is_on_boundary() const { return conflict_state == 2; } + bool processed() const { return conflict_state == 1; } + }; + typedef Vertex_base Vertex; typedef Face_base Face; diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h index 971f2b2d807..83f8338f266 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h @@ -30,6 +30,7 @@ public: typedef TDS Triangulation_data_structure; typedef typename TDS::Vertex_handle Vertex_handle; typedef typename TDS::Face_handle Face_handle; + typedef typename TDS::Face_data TDS_data; template struct Rebind_TDS { typedef Triangulation_ds_face_base_2 Other; };