1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Slotmap key types used by the TDS storage layer.
use slotmap::new_key_type;
new_key_type! {
/// Key type for accessing vertices in the storage map.
///
/// This creates a unique, type-safe identifier for vertices stored in the
/// triangulation's vertex storage. Each VertexKey corresponds to exactly
/// one vertex and provides efficient, stable access even as vertices are
/// added or removed from the triangulation.
///
/// # Examples
///
/// ```
/// use delaunay::prelude::*;
///
/// # #[derive(Debug, thiserror::Error)]
/// # enum ExampleError {
/// # #[error(transparent)] Construction(#[from] delaunay::DelaunayTriangulationConstructionError),
/// # #[error(transparent)] Insertion(#[from] delaunay::prelude::insertion::InsertionError),
/// # #[error(transparent)] Tds(#[from] delaunay::prelude::tds::TdsError),
/// # #[error(transparent)] TdsConstruction(#[from] delaunay::prelude::tds::TdsConstructionError),
/// # #[error(transparent)] Invariant(#[from] delaunay::prelude::tds::InvariantError),
/// # #[error(transparent)] Facet(#[from] delaunay::prelude::tds::FacetError),
/// # #[error(transparent)] Simplex(#[from] delaunay::prelude::tds::SimplexValidationError),
/// # #[error(transparent)]
/// # Coordinate(#[from] delaunay::prelude::geometry::CoordinateConversionError),
/// # }
/// # fn main() -> Result<(), ExampleError> {
/// let vertices = [
/// delaunay::vertex![0.0, 0.0]?,
/// delaunay::vertex![1.0, 0.0]?,
/// delaunay::vertex![0.0, 1.0]?,
/// ];
/// let dt = DelaunayTriangulationBuilder::new(&vertices).build()?;
/// let Some((key, _)) = dt.vertices().next() else {
/// return Ok(());
/// };
/// let _ = key;
/// # Ok(())
/// # }
/// ```
pub struct VertexKey;
}
new_key_type! {
/// Key type for accessing simplices in the storage map.
///
/// This creates a unique, type-safe identifier for simplices stored in the
/// triangulation's simplex storage. Each SimplexKey corresponds to exactly
/// one simplex and provides efficient, stable access even as simplices are
/// added or removed during triangulation operations.
///
/// # Examples
///
/// ```
/// use delaunay::prelude::*;
///
/// # #[derive(Debug, thiserror::Error)]
/// # enum ExampleError {
/// # #[error(transparent)] Construction(#[from] delaunay::DelaunayTriangulationConstructionError),
/// # #[error(transparent)] Insertion(#[from] delaunay::prelude::insertion::InsertionError),
/// # #[error(transparent)] Tds(#[from] delaunay::prelude::tds::TdsError),
/// # #[error(transparent)] TdsConstruction(#[from] delaunay::prelude::tds::TdsConstructionError),
/// # #[error(transparent)] Invariant(#[from] delaunay::prelude::tds::InvariantError),
/// # #[error(transparent)] Facet(#[from] delaunay::prelude::tds::FacetError),
/// # #[error(transparent)] Simplex(#[from] delaunay::prelude::tds::SimplexValidationError),
/// # #[error(transparent)]
/// # Coordinate(#[from] delaunay::prelude::geometry::CoordinateConversionError),
/// # }
/// # fn main() -> Result<(), ExampleError> {
/// let vertices = [
/// delaunay::vertex![0.0, 0.0]?,
/// delaunay::vertex![1.0, 0.0]?,
/// delaunay::vertex![0.0, 1.0]?,
/// ];
/// let dt = DelaunayTriangulationBuilder::new(&vertices).build()?;
/// let Some((key, _)) = dt.simplices().next() else {
/// return Ok(());
/// };
/// let _ = key;
/// # Ok(())
/// # }
/// ```
pub struct SimplexKey;
}