1use lina::Point3;
4
5use crate::hsize;
6
7
8mod list;
9mod num;
10mod prop;
11
12pub use self::{
13 list::{TriList, DiList, TriListIntoIter, DiListIntoIter, TriListIter, DiListIter},
14 num::{CastFromPrimitive, CastIntoPrimitive, PrimitiveNum, PrimitiveCast, PrimitiveFloat},
15 prop::{ColorLike, PrimitiveColorChannel, Pos3Like, Vec3Like},
16};
17
18
19pub trait IteratorExt: Sized + Iterator {
26 fn into_vec(self) -> Vec<Self::Item> {
27 self.collect()
28 }
29
30 fn centroid(self) -> Option<Self::Item>
31 where
32 Self::Item: Pos3Like,
33 {
34 Point3::centroid(self.map(|item| item.to_point3())).map(|p| p.convert())
35 }
36}
37
38impl<I: Iterator> IteratorExt for I {}
39
40
41pub trait HSizeExt {
43 fn next(self) -> Self;
49}
50
51impl HSizeExt for hsize {
52 #[inline(always)]
53 fn next(self) -> Self {
54 self + 1
55 }
56}