[][src]Struct shapefile::record::multipatch::Multipatch

pub struct Multipatch { /* fields omitted */ }

Shapefile's Multipatch shape (p 24/34)

The following things are important with Multipatch shape:

  1. Ring types must be closed (the various constructors will close the rings if you did not close them yourself)
  2. InnerRings must follow their OuterRings (this is not checked)
  3. Parts must not intersects or penetrate each others (this is not checked)
  4. The points organization of TriangleStrip and TriangleFan is not checked

Methods

impl Multipatch[src]

pub fn new(patch: Patch) -> Self[src]

Creates a Multipatch with one patch

The constructor closes rings patch

Examples

use shapefile::{PointZ, Multipatch, NO_DATA, Patch};
let points = vec![
    PointZ::new(0.0, 0.0, 0.0, NO_DATA),
    PointZ::new(0.0, 1.0, 0.0, NO_DATA),
    PointZ::new(1.0, 1.0, 0.0, NO_DATA),
    PointZ::new(1.0, 0.0, 0.0, NO_DATA),
];
let multip = Multipatch::new(Patch::OuterRing(points));

pub fn with_parts(patches: Vec<Patch>) -> Self[src]

Creates a Multipatch with multiple patches

Closes any patch part that is a ring

Example

use shapefile::{PointZ, Multipatch, NO_DATA, Patch};
let multipatch = Multipatch::with_parts(vec![
    Patch::OuterRing(vec![
        PointZ::new(0.0, 0.0, 0.0, NO_DATA),
        PointZ::new(0.0, 4.0, 0.0, NO_DATA),
        PointZ::new(4.0, 4.0, 0.0, NO_DATA),
        PointZ::new(4.0, 0.0, 0.0, NO_DATA),
    ]),
    Patch::InnerRing(vec![
        PointZ::new(0.0, 0.0, 0.0, NO_DATA),
        PointZ::new(0.0, 2.0, 0.0, NO_DATA),
        PointZ::new(2.0, 2.0, 0.0, NO_DATA),
        PointZ::new(2.0, 0.0, 0.0, NO_DATA),
    ])
]);

pub fn bbox(&self) -> &GenericBBox<PointZ>[src]

Returns the bounding box of the points contained in this multipatch

pub fn patches(&self) -> &Vec<Patch>[src]

Returns a reference to the patches of the Multipatch Shape

pub fn patch(&self, index: usize) -> Option<&Patch>[src]

Returns a reference to the patch at given index

pub fn into_inner(self) -> Vec<Patch>[src]

Consumes the shape and returns the patches

pub fn total_point_count(&self) -> usize[src]

Trait Implementations

impl Clone for Multipatch[src]

impl ConcreteReadableShape for Multipatch[src]

impl ConcreteShape for Multipatch[src]

impl Debug for Multipatch[src]

impl Display for Multipatch[src]

impl EsriShape for Multipatch[src]

impl From<Multipatch> for Shape[src]

impl HasShapeType for Multipatch[src]

impl PartialEq<Multipatch> for Multipatch[src]

impl StructuralPartialEq for Multipatch[src]

impl TryFrom<Multipatch> for MultiPolygon<f64>[src]

Converts a Multipatch to Multipolygon

For simplicity,reasons, Triangle Fan & Triangle Strip are considered to be valid polygons When the individual types of rings in a collection of rings representing a polygonal patch with holes are unknown, the sequence must start with First Ring, followed by a number of Rings. A sequence of Rings not preceded by an First Ring is treated as a sequence of Outer Rings without holes.

type Error = &'static str

The type returned in the event of a conversion error.

impl TryFrom<Shape> for Multipatch[src]

type Error = Error

The type returned in the event of a conversion error.

impl WritableShape for Multipatch[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> From<T> for T[src]

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

impl<S> ReadableShape for S where
    S: ConcreteReadableShape
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.