Skip to main content

Shape

Enum Shape 

Source
pub enum Shape {
    Auto,
    Points,
    Lines,
    Surface,
    Volume,
    Outline,
    Centroid,
}
Expand description

The form a caller wants a representation drawn in.

Variants§

§

Auto

The richest form this topology supports.

A grid becomes its cells, a polyline set stays lines, a hexahedral grid stays a volume. What every export did before there was anything to ask.

§

Points

The nodes alone.

§

Lines

Polylines.

§

Surface

Triangles and quadrilaterals.

§

Volume

Cells with an inside.

§

Outline

One polygon: the convex hull of every node, whatever the topology was.

A summary, not a rendering - the first of the two shapes here whose output is not the object. It answers “where is this”, which is what a discovery index wants and what OSDU’s SpatialArea asks for: “a polygon boundary that reflects the locale of the content”. (OSDU).

Convex and not concave, deliberately: an alpha-shape follows a horizon’s bays and holes far better, and it needs a parameter whose wrong value silently cuts the outline into pieces. A hull has no parameter and no wrong answer - it is simply the smallest convex thing containing the data.

§

Centroid

One point: the mean of the nodes.

The other summary, and OSDU’s SpatialPoint: “a centroid point that reflects the locale of the content”.

The mean of the nodes, which is not the centroid of the area - a densely sampled corner pulls it. Saying so rather than implying a precision this does not have; for “where is this on a map”, at the scale these are used, the difference is invisible.

Implementations§

Source§

impl Shape

Source

pub fn name(&self) -> &'static str

The name a caller writes on a command line.

Source

pub fn all() -> [Shape; 7]

Every shape there is, for a caller listing them.

Source

pub fn is_summary(&self) -> bool

Whether this shape summarises the object instead of drawing it.

The two are different in a way a caller has to know about: a summary replaces the points, so nothing that hangs on nodes or cells - a property, a colour ramp - comes through it. Four points that say where a horizon is cannot carry a value per node of the horizon.

Source

pub fn parse(text: &str) -> Option<Shape>

Parse a name, case-insensitively.

The plural and singular both work - someone writing --as Grid=polygon means the same thing as surface, and refusing them over an s teaches nothing.

Trait Implementations§

Source§

impl Clone for Shape

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Shape

Source§

impl Debug for Shape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Shape

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Shape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Shape

Source§

impl PartialEq for Shape

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Shape

Auto Trait Implementations§

§

impl Freeze for Shape

§

impl RefUnwindSafe for Shape

§

impl Send for Shape

§

impl Sync for Shape

§

impl Unpin for Shape

§

impl UnsafeUnpin for Shape

§

impl UnwindSafe for Shape

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more