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
use std::collections::HashMap;
use crate::types::coord::CoordType;
use num_traits::One;
/// `kml:Scale`, [10.12](http://docs.opengeospatial.org/is/12-007r2/12-007r2.html#575) in the KML
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Scale<T: CoordType = f64> {
pub x: T,
pub y: T,
pub z: T,
pub attrs: HashMap<String, String>,
}
impl<T> Scale<T>
where
T: CoordType,
{
pub fn new(x: T, y: T, z: T) -> Self {
Scale {
x,
y,
z,
attrs: HashMap::new(),
}
}
}
impl Default for Scale {
fn default() -> Scale {
Scale {
x: One::one(),
y: One::one(),
z: One::one(),
attrs: HashMap::new(),
}
}
}