Struct otter_api_tests::shapelib::GroupDetails[][src]

pub struct GroupDetails {
    pub size: Vec<f64, Global>,
    pub orig_size: Vec<f64, Global>,
    pub centre: Option<[f64; 2]>,
    pub flip: bool,
    pub back: Option<Box<dyn PieceSpec + 'static, Global>>,
    pub scale: f64,
    pub colours: HashMap<String, RecolourData, RandomState>,
    pub desc_template: Option<String>,
    pub occulted: Option<OccultationMethod>,
    pub outline: Box<dyn OutlineDefn + 'static, Global>,
}

Details for a group of pieces. See also GroupDefn.

This is separate from GroupDefn only to make the implementation convenient (for complicated reasons). At the library TOML file level, there is no meaningful difference between the fields in this struct, and the ones in GroupDefn

Fields

size: Vec<f64, Global>

Should be either a 1- or 2- element list, x and y, or just one number for both.

orig_size: Vec<f64, Global>

If specified, the input is first scaled from orig_size to size. If both size and orig_size are 2 elements, may scale by different amounts in x and y.

centre: Option<[f64; 2]>

Default if not supplied is the centre according to the size.

flip: bool

Default is false

back: Option<Box<dyn PieceSpec + 'static, Global>>

The back of this is some other item. Doesn’t make sense with flip.

scale: f64

size and centre are in the SVG’s own internal coordinate system, not the Otter scaled coordinates which result from multiplying by by this scale factor. If not specified, default is 1.0.

colours: HashMap<String, RecolourData, RandomState>

If specified and non-empty, specifies that this group should be instantiated multiple times, each time with a recolouring.

For each entry in this table, the recolouring is applied to every item in the files list.

When recolouring is being done, every effective item name must contain the substring _c exactly once, and every item description must contain the substring _colour exactly once. _c will be replaced with the recoluring’s abbrev, and _colour with the recolouring name (the key of the colours table).

desc_template: Option<String>

If specified, provides a template for the description. The description previously calculated replaces _desc in this string.

occulted: Option<OccultationMethod>

If specified, pieces in this group can be occulted.

outline: Box<dyn OutlineDefn + 'static, Global>

One of "Circle" or "Rect", to define the outline shape. The size is taken from size.

This value is a string, not some weird Rust type, despite what you see here.

Trait Implementations

impl Debug for GroupDetails[src]

impl<'de> Deserialize<'de> for GroupDetails[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<A> DynCastExt for A

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,