From d390cd2f0a6323033a8b6d17f67b18bfc42a0c20 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 28 Feb 2021 15:35:17 +0000 Subject: [PATCH] shapelib hidden: Spec for occultation Signed-off-by: Ian Jackson --- src/shapelib-toml.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index b983f1e1..f9f619fa 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -134,6 +134,9 @@ pub struct GroupDetails { #[serde(default)] pub colours: HashMap, + /// If specified, pieces in this group can be occulted. + pub occulted: Option, + /// One of `"Circle"` or `"Square"`, to define the outline shape. /// The size is taken from `size`. /// @@ -142,6 +145,21 @@ pub struct GroupDetails { #[serde(flatten)] pub outline: Box, } +/// How pieces may be occulted. Currently only one supported way. +#[derive(Deserialize,Clone,Debug)] +#[serde(tag="method")] +pub enum OccultationMethod { + /// When occulted, display as a piece of a particular colour. + /// `colour` refers to one of the entries in + /// `GroupDetails::colours`. + /// + /// The description will be different too: `_colour` will be elided, + /// along with up to one of any spaces either side of it. + ByColour { + colour: String, + }, +} + /// An entry in the `colours` table, specifying one recolouring. #[derive(Debug,Deserialize)] pub struct RecolourData { -- 2.30.2