maker_panel/features/
unit.rs

1use geo::{Coordinate, MultiPolygon};
2use std::fmt;
3
4/// A feature with no geometry.
5#[derive(Debug, Clone)]
6pub struct Unit;
7
8impl fmt::Display for Unit {
9    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10        write!(f, "()")
11    }
12}
13
14impl super::Feature for Unit {
15    fn name(&self) -> &'static str {
16        "unit"
17    }
18
19    fn edge_union(&self) -> Option<MultiPolygon<f64>> {
20        None
21    }
22
23    fn translate(&mut self, _v: Coordinate<f64>) {}
24
25    fn interior(&self) -> Vec<super::InnerAtom> {
26        vec![]
27    }
28}
29
30impl super::InnerFeature for Unit {
31    fn name(&self) -> &'static str {
32        "unit"
33    }
34
35    fn translate(&mut self, _v: Coordinate<f64>) {}
36
37    fn atoms(&self) -> Vec<super::InnerAtom> {
38        vec![]
39    }
40}