1#[cfg(feature = "serde")]
13use serde::{de::DeserializeOwned, Serialize};
14
15#[macro_use]
16extern crate derive_builder;
17
18pub mod delaunay_core {
21 pub mod cell;
22 pub mod facet;
23 pub mod matrix;
24 pub mod point;
25 pub mod triangulation_data_structure;
26 pub mod utilities;
27 pub mod vertex;
28 pub use cell::*;
30 pub use facet::*;
31 pub use matrix::*;
32 pub use point::*;
33 pub use triangulation_data_structure::*;
34 pub use utilities::*;
35 pub use vertex::*;
36}
37
38#[cfg(feature = "serde")]
41pub trait Coord: Copy + Default + DeserializeOwned + Serialize + Sized {}
42#[cfg(not(feature = "serde"))]
44pub trait Coord: Copy + Default + Sized {}
45
46#[cfg(feature = "serde")]
47impl<T: Copy + Default + DeserializeOwned + Serialize + Sized> Coord for T {}
48#[cfg(not(feature = "serde"))]
49impl<T: Copy + Default + Sized> Coord for T {}
50
51#[cfg(feature = "serde")]
53pub trait Coordf64: Default + DeserializeOwned + Serialize + Sized {}
54#[cfg(not(feature = "serde"))]
56pub trait Coordf64: Default + Sized {}
57
58#[cfg(feature = "serde")]
59impl<T: Default + DeserializeOwned + Serialize + Sized> Coordf64 for T {}
60#[cfg(not(feature = "serde"))]
61impl<T: Default + Sized> Coordf64 for T {}
62
63#[allow(clippy::extra_unused_type_parameters, unused)]
67fn is_normal<T: Sized + Send + Sync + Unpin>() -> bool {
68 true
69}
70
71#[cfg(test)]
72mod lib_tests {
73 use crate::{
74 delaunay_core::{
75 cell::Cell, facet::Facet, point::Point, triangulation_data_structure::Tds,
76 vertex::Vertex,
77 },
78 is_normal,
79 };
80
81 #[test]
82 fn normal_types() {
83 assert!(is_normal::<Point<f64, 3>>());
84 assert!(is_normal::<Point<f32, 3>>());
85 assert!(is_normal::<Vertex<f64, Option<()>, 3>>());
86 assert!(is_normal::<Facet<f64, Option<()>, Option<()>, 3>>());
87 assert!(is_normal::<Cell<f64, Option<()>, Option<()>, 4>>());
88 assert!(is_normal::<Tds<f64, Option<()>, Option<()>, 4>>());
89 }
90}