clipper2_sys/clipper64/
paths.rs1use crate::cxx_bridge::clipper2_sys_cxx::PathsBlob64;
2use crate::paths_blob::{paths64_from_blob, PathsBlob64Iter};
3use crate::Path64;
4
5define_lazy_paths! {
6 LazyPaths64,
10 blob = PathsBlob64,
11 paths = Paths64,
12 path = Path64,
13 iter = PathsBlob64Iter,
14 from_blob = paths64_from_blob,
15}
16
17#[derive(Clone, Debug, Default)]
21pub struct Paths64(pub(crate) Vec<Path64>);
22
23impl_paths_collection!(int64, Paths64, Path64);
24
25#[cfg(test)]
26mod tests {
27 use crate::{Path64, Paths64, Point64};
28
29 #[test]
30 fn new_add_path_len() {
31 let mut ps = Paths64::default();
32 assert!(ps.is_empty());
33 ps.add_path(Path64::new(vec![Point64::new(0, 0), Point64::new(1, 0)]));
34 assert_eq!(ps.len(), 1);
35 let t = ps.translate(10, 0);
36 let q = t.path(0).get_point(0);
37 assert_eq!(q.x, 10);
38 assert_eq!(q.y, 0);
39 }
40}