Add FaceData / Face_data to TDS_2

This commit is contained in:
Mael Rouxel-Labbé 2020-06-18 10:58:41 +02:00
parent 973a759e92
commit f324618c87
6 changed files with 106 additions and 0 deletions

View File

@ -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;
};

View File

@ -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 */

View File

@ -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`

View File

@ -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`

View File

@ -69,6 +69,22 @@ public:
typedef Triangulation_data_structure_2<Vb, Fb2> 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;

View File

@ -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 <typename TDS2>
struct Rebind_TDS { typedef Triangulation_ds_face_base_2<TDS2> Other; };