Skip to main content

View

Struct View 

Source
pub struct View {
Show 25 fields pub target: Target, pub window: Option<Window>, pub portion: Option<[f64; 2]>, pub size_px: [f64; 2], pub background: String, pub hidden: Vec<String>, pub colours: Vec<(String, String)>, pub unit_colours: Vec<(String, String)>, pub widths: Vec<(String, f64)>, pub well_colouring: WellColouring, pub well_width_px: f64, pub fills: Vec<FillChoice>, pub show: Show, pub axis: AxisMode, pub highlight: Vec<String>, pub labels: LabelMode, pub paints: Vec<(String, Paint)>, pub joints: Joint, pub zoom_script: bool, pub strata_legend: bool, pub strata_ticks: bool, pub draw_unstratified: bool, pub unstratified: UnstratifiedStyle, pub store_names: Vec<(String, String)>, pub markers: Vec<Marker>,
}
Expand description

What to draw and how - nothing here makes a new catalogue.

Fields§

§target: Target

A section, or the plan.

§window: Option<Window>

The window drawn; None: everything, with a margin.

§portion: Option<[f64; 2]>

A portion of the trace: [s start, s end], a truncation - the abscissas keep their origin at the trace’s first point.

§size_px: [f64; 2]

The drawing’s size in pixels.

§background: String

The background colour.

§hidden: Vec<String>

Objects hidden in this drawing, by key.

§colours: Vec<(String, String)>

Colours the scene gives objects, by key - the front end’s colour stack, resolved by the front end (never a second resolution here).

§unit_colours: Vec<(String, String)>

The colour of each stratigraphic unit now, by the key of its well’s package and the unit’s full uri (object_key of store and Interval::unit_uri), resolved by the library’s colour walks. Read before the colour baked into an interval, by the wells and by the strata legend, so that the two cannot disagree - and a colour edited after the catalogue was made shows without making a new one. Empty: the baked colours, as drawings always were (and then not written into the metadata).

§widths: Vec<(String, f64)>

Line widths in pixels, by object key: each overrides, for that object only, the default width (well_width_px for a well). A width that is not a finite number in (0, MAX_WIDTH_PX] is refused by name in the drawing’s warnings and the default is drawn.

§well_colouring: WellColouring

How wells are coloured.

§well_width_px: f64

How wide a well is drawn, in pixels.

§fills: Vec<FillChoice>

For each surface, which way its colour fills.

§show: Show

What is shown.

§axis: AxisMode

What the horizontal axis says.

§highlight: Vec<String>

Objects put forward on purpose - exported.

§labels: LabelMode

How objects are named on the drawing: their whole title, or a short code (H0, W3, F1…) and a legend beside it.

§paints: Vec<(String, Paint)>

What the front end’s scene paints along an object, by key: one colour per node, resolved by the front end from what its 3D view already holds (a property, the strata) - never a second resolution here (the resolver is supplied by the front end). An object without one is drawn as before: that is the default resolver.

§joints: Joint

Marks along a painted well - at every node, or where its colour changes - the 3D view’s joints.

§zoom_script: bool

Write, into the SVG, the script that lets it zoom itself when opened alone in a browser: lines keep their width in pixels, objects part (on by default).

§strata_legend: bool

A legend of the stratigraphic units the drawn wells show, each with the colour its interval is drawn in, on the left of the drawing and in a group of its own (<g id="strata-legend">, an Inkscape layer) that is easy to move or edit. Off by default, and then not written into the metadata: a drawing made before the option existed is the same bytes.

§strata_ticks: bool

A short black tick across the well at every boundary between two intervals of a strata-coloured well, in the well’s own group. Off by default, and then not written into the metadata.

§draw_unstratified: bool

Under strata colouring, draw the portions of a well that carry no strata information (below the last interval, between two) in the well’s own colour - as drawings always did. Off: a well is drawn only where a unit is known (its head and label stay), and a note counts the wells that lost portions. On by default, and then not written into the metadata, so earlier drawings keep their bytes.

A legacy alias of UnstratifiedStyle::Hidden, kept so that every document written before the styles still reads: false here is the same as unstratified: hidden, and wins over it (View::unstratified_style is the one place that decides). New code sets unstratified.

§unstratified: UnstratifiedStyle

How the portions of a well with no strata information are drawn, under strata colouring (several styles are offered: fixed colour, texture, dashes…). The default is the solid neutral grey drawings always had, and then it is not written into the metadata, so earlier drawings keep their bytes. crate::style::declared lists the styles and their parameters; the front end builds its form from that list.

§store_names: Vec<(String, String)>

What each package is called, by the front end’s store id (s1 → the file’s name): the strata legend writes it beside a unit shown more than once - the same unit, two colours, because two packages do not agree on it (the legend says which package the entries sharing a name come from). A store with no name here is named by its id. Empty, and then not written into the metadata, so earlier drawings keep their bytes.

§markers: Vec<Marker>

Named markers on a set of objects - a symbol or a contour at the head, the bottom or a depth of each - listed in a legend of their own (ADR-0015). Empty, and then not written into the metadata, so earlier drawings keep their bytes.

Implementations§

Source§

impl View

Source

pub fn unstratified_style(&self) -> UnstratifiedStyle

The style the unstratified portions are drawn in: hidden when the legacy draw_unstratified is off, whatever unstratified says - the one place the two are read together.

Source

pub fn new(target: Target, size_px: [f64; 2]) -> Self

A view of target at size_px, everything else at its default: the whole section, a white background, wells coloured by their strata, names, distances, vertices and crossings shown, the projected distance on the axis.

Trait Implementations§

Source§

impl Clone for View

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 Debug for View

Source§

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

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

impl<'de> Deserialize<'de> for View

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for View

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 Serialize for View

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for View

Auto Trait Implementations§

§

impl Freeze for View

§

impl RefUnwindSafe for View

§

impl Send for View

§

impl Sync for View

§

impl Unpin for View

§

impl UnsafeUnpin for View

§

impl UnwindSafe for View

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, 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