Struct shapefile::record::multipatch::Multipatch [−][src]
pub struct Multipatch { /* fields omitted */ }
Shapefile’s Multipatch shape (p 24/34)
The following things are important with Multipatch shape:
- Ring types must be closed (the various constructors will close the rings if you did not close them yourself)
- InnerRings must follow their OuterRings (this is not checked)
- Parts must not intersects or penetrate each others (this is not checked)
- The points organization of
TriangleStrip
andTriangleFan
is not checked
Implementations
impl Multipatch
[src]
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 Clone for Multipatch
[src]fn clone(&self) -> Multipatch
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl ConcreteReadableShape for Multipatch
[src]
impl ConcreteReadableShape for Multipatch
[src]impl ConcreteShape for Multipatch
[src]
impl ConcreteShape for Multipatch
[src]impl EsriShape for Multipatch
[src]
impl EsriShape for Multipatch
[src]impl From<Multipatch> for Shape
[src]
impl From<Multipatch> for Shape
[src]fn from(concrete: Multipatch) -> Self
[src]
impl HasShapeType for Multipatch
[src]
impl HasShapeType for Multipatch
[src]impl PartialEq<Multipatch> for Multipatch
[src]
impl PartialEq<Multipatch> for Multipatch
[src]fn eq(&self, other: &Multipatch) -> bool
[src]
fn ne(&self, other: &Multipatch) -> bool
[src]
impl StructuralPartialEq for Multipatch
[src]
impl StructuralPartialEq for Multipatch
[src]impl TryFrom<Shape> for Multipatch
[src]
impl TryFrom<Shape> for Multipatch
[src]impl WritableShape for Multipatch
[src]
impl WritableShape for Multipatch
[src]Auto Trait Implementations
impl RefUnwindSafe for Multipatch
impl RefUnwindSafe for Multipatch
impl Send for Multipatch
impl Send for Multipatch
impl Sync for Multipatch
impl Sync for Multipatch
impl Unpin for Multipatch
impl Unpin for Multipatch
impl UnwindSafe for Multipatch
impl UnwindSafe for Multipatch